[Migration] Add content from Juniper
Automated change
Change-Id: Ie1ceb7b977663ecd93cdf0fc317d402d1f991d07
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..5c304d1
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright {yyyy} {name of copyright owner}
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..bb9b58a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,4 @@
+contrail-third-party-cache
+==========================
+
+to store third party source and use it as a cache
diff --git a/analytics/centoslinux71/grok-1.20110308.1-0contrail0.x86_64.rpm b/analytics/centoslinux71/grok-1.20110308.1-0contrail0.x86_64.rpm
new file mode 100644
index 0000000..e6fd3b5
--- /dev/null
+++ b/analytics/centoslinux71/grok-1.20110308.1-0contrail0.x86_64.rpm
Binary files differ
diff --git a/analytics/centoslinux71/grok-devel-1.20110308.1-0contrail0.x86_64.rpm b/analytics/centoslinux71/grok-devel-1.20110308.1-0contrail0.x86_64.rpm
new file mode 100644
index 0000000..9e1c945
--- /dev/null
+++ b/analytics/centoslinux71/grok-devel-1.20110308.1-0contrail0.x86_64.rpm
Binary files differ
diff --git a/analytics/centoslinux71/libipfix-110209-1.el7.centos.x86_64.rpm b/analytics/centoslinux71/libipfix-110209-1.el7.centos.x86_64.rpm
new file mode 100644
index 0000000..9c4635d
--- /dev/null
+++ b/analytics/centoslinux71/libipfix-110209-1.el7.centos.x86_64.rpm
Binary files differ
diff --git a/analytics/centoslinux71/libzookeeper-3.4.8-0contrail0.el7.centos.x86_64.rpm b/analytics/centoslinux71/libzookeeper-3.4.8-0contrail0.el7.centos.x86_64.rpm
new file mode 100644
index 0000000..9e5380b
--- /dev/null
+++ b/analytics/centoslinux71/libzookeeper-3.4.8-0contrail0.el7.centos.x86_64.rpm
Binary files differ
diff --git a/analytics/centoslinux71/libzookeeper-devel-3.4.8-0.contrail0.el7.centos.x86_64.rpm b/analytics/centoslinux71/libzookeeper-devel-3.4.8-0.contrail0.el7.centos.x86_64.rpm
new file mode 100644
index 0000000..ae62cde
--- /dev/null
+++ b/analytics/centoslinux71/libzookeeper-devel-3.4.8-0.contrail0.el7.centos.x86_64.rpm
Binary files differ
diff --git a/analytics/centoslinux71/zookeeper-3.4.8-0.contrail1.el7.centos.x86_64.rpm b/analytics/centoslinux71/zookeeper-3.4.8-0.contrail1.el7.centos.x86_64.rpm
new file mode 100644
index 0000000..56032f8
--- /dev/null
+++ b/analytics/centoslinux71/zookeeper-3.4.8-0.contrail1.el7.centos.x86_64.rpm
Binary files differ
diff --git a/cni/cni_go_deps.tar.gz b/cni/cni_go_deps.tar.gz
new file mode 100644
index 0000000..c19865c
--- /dev/null
+++ b/cni/cni_go_deps.tar.gz
Binary files differ
diff --git a/contrail-webui/common/ajv-4.1.0.zip b/contrail-webui/common/ajv-4.1.0.zip
new file mode 100644
index 0000000..694beaf
--- /dev/null
+++ b/contrail-webui/common/ajv-4.1.0.zip
Binary files differ
diff --git a/contrail-webui/common/contrail-charts.tgz b/contrail-webui/common/contrail-charts.tgz
new file mode 100644
index 0000000..fc0d625
--- /dev/null
+++ b/contrail-webui/common/contrail-charts.tgz
Binary files differ
diff --git a/contrail-webui/common/d3-v4.1.1.min.js b/contrail-webui/common/d3-v4.1.1.min.js
new file mode 100644
index 0000000..ee7f4a7
--- /dev/null
+++ b/contrail-webui/common/d3-v4.1.1.min.js
@@ -0,0 +1,8 @@
+// https://d3js.org Version 4.1.1. Copyright 2016 Mike Bostock.
+!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function e(t){return 1===t.length&&(t=r(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}function r(t){return function(e,r){return n(t(e),r)}}function i(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function o(t){return null===t?NaN:+t}function u(t,n){var e,r,i=t.length,u=0,a=0,c=-1,s=0;if(null==n)for(;++c<i;)isNaN(e=o(t[c]))||(r=e-u,u+=r/++s,a+=r*(e-u));else for(;++c<i;)isNaN(e=o(n(t[c],c,t)))||(r=e-u,u+=r/++s,a+=r*(e-u));if(s>1)return a/(s-1)}function a(t,n){var e=u(t,n);return e?Math.sqrt(e):e}function c(t,n){var e,r,i,o=-1,u=t.length;if(null==n){for(;++o<u;)if(null!=(r=t[o])&&r>=r){e=i=r;break}for(;++o<u;)null!=(r=t[o])&&(e>r&&(e=r),i<r&&(i=r))}else{for(;++o<u;)if(null!=(r=n(t[o],o,t))&&r>=r){e=i=r;break}for(;++o<u;)null!=(r=n(t[o],o,t))&&(e>r&&(e=r),i<r&&(i=r))}return[e,i]}function s(t){return function(){return t}}function f(t){return t}function l(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r<i;)o[r]=t+r*e;return o}function h(t,n,e){var r=p(t,n,e);return l(Math.ceil(t/r)*r,Math.floor(n/r)*r+r/2,r)}function p(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Pd?i*=10:o>=qd?i*=5:o>=Ld&&(i*=2),n<t?-i:i}function d(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}function v(){function t(t){var i,o,u=t.length,a=new Array(u);for(i=0;i<u;++i)a[i]=n(t[i],i,t);var c=e(a),s=c[0],f=c[1],l=r(a,s,f);Array.isArray(l)||(l=h(s,f,l));for(var p=l.length;l[0]<=s;)l.shift(),--p;for(;l[p-1]>=f;)l.pop(),--p;var d,v=new Array(p+1);for(i=0;i<=p;++i)d=v[i]=[],d.x0=i>0?l[i-1]:s,d.x1=i<p?l[i]:f;for(i=0;i<u;++i)o=a[i],s<=o&&o<=f&&v[Sd(l,o,0,p)].push(t[i]);return v}var n=f,e=c,r=d;return t.value=function(e){return arguments.length?(n="function"==typeof e?e:s(e),t):n},t.domain=function(n){return arguments.length?(e="function"==typeof n?n:s([n[0],n[1]]),t):e},t.thresholds=function(n){return arguments.length?(r="function"==typeof n?n:s(Array.isArray(n)?Cd.call(n):n),t):r},t}function _(t,n,e){if(null==e&&(e=o),r=t.length){if((n=+n)<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,u=Math.floor(i),a=+e(t[u],u,t),c=+e(t[u+1],u+1,t);return a+(c-a)*(i-u)}}function y(t,e,r){return t=zd.call(t,o).sort(n),Math.ceil((r-e)/(2*(_(t,.75)-_(t,.25))*Math.pow(t.length,-1/3)))}function g(t,n,e){return Math.ceil((e-n)/(3.5*a(t)*Math.pow(t.length,-1/3)))}function m(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&r>e&&(e=r)}else{for(;++i<o;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n(t[i],i,t))&&r>e&&(e=r)}return e}function x(t,n){var e,r=0,i=t.length,u=-1,a=i;if(null==n)for(;++u<i;)isNaN(e=o(t[u]))?--a:r+=e;else for(;++u<i;)isNaN(e=o(n(t[u],u,t)))?--a:r+=e;if(a)return r/a}function b(t,e){var r,i=[],u=t.length,a=-1;if(null==e)for(;++a<u;)isNaN(r=o(t[a]))||i.push(r);else for(;++a<u;)isNaN(r=o(e(t[a],a,t)))||i.push(r);return _(i.sort(n),.5)}function w(t){for(var n,e,r,i=t.length,o=-1,u=0;++o<i;)u+=t[o].length;for(e=new Array(u);--i>=0;)for(r=t[i],n=r.length;--n>=0;)e[--u]=r[n];return e}function M(t,n){var e,r,i=-1,o=t.length;if(null==n){for(;++i<o;)if(null!=(r=t[i])&&r>=r){e=r;break}for(;++i<o;)null!=(r=t[i])&&e>r&&(e=r)}else{for(;++i<o;)if(null!=(r=n(t[i],i,t))&&r>=r){e=r;break}for(;++i<o;)null!=(r=n(t[i],i,t))&&e>r&&(e=r)}return e}function T(t){for(var n=0,e=t.length-1,r=t[0],i=new Array(e<0?0:e);n<e;)i[n]=[r,r=t[++n]];return i}function k(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r}function N(t,e){if(r=t.length){var r,i,o=0,u=0,a=t[u];for(e||(e=n);++o<r;)(e(i=t[o],a)<0||0!==e(a,a))&&(a=i,u=o);return 0===e(a,a)?u:void 0}}function S(t,n,e){for(var r,i,o=(null==e?t.length:e)-(n=null==n?0:+n);o;)i=Math.random()*o--|0,r=t[o+n],t[o+n]=t[i+n],t[i+n]=r;return t}function A(t,n){var e,r=0,i=t.length,o=-1;if(null==n)for(;++o<i;)(e=+t[o])&&(r+=e);else for(;++o<i;)(e=+n(t[o],o,t))&&(r+=e);return r}function E(t){if(!(i=t.length))return[];for(var n=-1,e=M(t,C),r=new Array(e);++n<e;)for(var i,o=-1,u=r[n]=new Array(i);++o<i;)u[o]=t[o][n];return r}function C(t){return t.length}function z(){return E(arguments)}function P(){}function q(t,n){var e=new P;if(t instanceof P)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var u in t)e.set(u,t[u]);return e}function L(){function t(n,i,u,a){if(i>=o.length)return null!=r?r(n):null!=e?n.sort(e):n;for(var c,s,f,l=-1,h=n.length,p=o[i++],d=q(),v=u();++l<h;)(f=d.get(c=p(s=n[l])+""))?f.push(s):d.set(c,[s]);return d.each(function(n,e){a(v,e,t(n,i,u,a))}),v}function n(t,e){if(++e>o.length)return t;var i,a=u[e-1];return null!=r&&e>=o.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:n(t,e)})})),null!=a?i.sort(function(t,n){return a(t.key,n.key)}):i}var e,r,i,o=[],u=[];return i={object:function(n){return t(n,0,R,U)},map:function(n){return t(n,0,D,O)},entries:function(e){return n(t(e,0,D,O),0)},key:function(t){return o.push(t),i},sortKeys:function(t){return u[o.length-1]=t,i},sortValues:function(t){return e=t,i},rollup:function(t){return r=t,i}}}function R(){return{}}function U(t,n,e){t[n]=e}function D(){return q()}function O(t,n,e){t.set(n,e)}function F(){}function I(t,n){var e=new F;if(t instanceof F)t.each(function(t){e.add(t)});else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}function Y(t){var n=[];for(var e in t)n.push(e);return n}function B(t){var n=[];for(var e in t)n.push(t[e]);return n}function j(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n}function H(t,n){return t=null==t?0:+t,n=null==n?1:+n,1===arguments.length?(n=t,t=0):n-=t,function(){return Math.random()*n+t}}function X(t,n){var e,r;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=e)i=e,e=null;else do e=2*Math.random()-1,i=2*Math.random()-1,r=e*e+i*i;while(!r||r>1);return t+n*i*Math.sqrt(-2*Math.log(r)/r)}}function V(){var t=X.apply(this,arguments);return function(){return Math.exp(t())}}function W(t){return function(){for(var n=0,e=0;e<t;++e)n+=Math.random();return n}}function $(t){var n=W(t);return function(){return n()/t}}function Z(t){return function(){return-Math.log(1-Math.random())/t}}function G(t){return+t}function J(t){return t*t}function Q(t){return t*(2-t)}function K(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function tt(t){return t*t*t}function nt(t){return--t*t*t+1}function et(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function rt(t){return 1-Math.cos(t*Bd)}function it(t){return Math.sin(t*Bd)}function ot(t){return(1-Math.cos(Yd*t))/2}function ut(t){return Math.pow(2,10*t-10)}function at(t){return 1-Math.pow(2,-10*t)}function ct(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function st(t){return 1-Math.sqrt(1-t*t)}function ft(t){return Math.sqrt(1- --t*t)}function lt(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}function ht(t){return 1-pt(1-t)}function pt(t){return(t=+t)<jd?Qd*t*t:t<Xd?Qd*(t-=Hd)*t+Vd:t<$d?Qd*(t-=Wd)*t+Zd:Qd*(t-=Gd)*t+Jd}function dt(t){return((t*=2)<=1?1-pt(1-t):pt(t-1)+1)/2}function vt(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e<r;)n=i,i=t[e],o+=n[1]*i[0]-n[0]*i[1];return o/2}function _t(t){for(var n,e,r=-1,i=t.length,o=0,u=0,a=t[i-1],c=0;++r<i;)n=a,a=t[r],c+=e=n[0]*a[1]-a[0]*n[1],o+=(n[0]+a[0])*e,u+=(n[1]+a[1])*e;return c*=3,[o/c,u/c]}function yt(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function gt(t,n){return t[0]-n[0]||t[1]-n[1]}function mt(t){for(var n=t.length,e=[0,1],r=2,i=2;i<n;++i){for(;r>1&&yt(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function xt(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n<e;++n)r[n]=[+t[n][0],+t[n][1],n];for(r.sort(gt),n=0;n<e;++n)i[n]=[r[n][0],-r[n][1]];var o=mt(r),u=mt(i),a=u[0]===o[0],c=u[u.length-1]===o[o.length-1],s=[];for(n=o.length-1;n>=0;--n)s.push(t[r[o[n]][2]]);for(n=+a;n<u.length-c;++n)s.push(t[r[u[n]][2]]);return s}function bt(t,n){for(var e,r,i=t.length,o=t[i-1],u=n[0],a=n[1],c=o[0],s=o[1],f=!1,l=0;l<i;++l)o=t[l],e=o[0],r=o[1],r>a!=s>a&&u<(c-e)*(a-r)/(s-r)+e&&(f=!f),c=e,s=r;return f}function wt(t){for(var n,e,r=-1,i=t.length,o=t[i-1],u=o[0],a=o[1],c=0;++r<i;)n=u,e=a,o=t[r],u=o[0],a=o[1],n-=u,e-=a,c+=Math.sqrt(n*n+e*e);return c}function Mt(){this._x0=this._y0=this._x1=this._y1=null,this._=[]}function Tt(){return new Mt}function kt(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return Nt(this.cover(n,e),n,e,t)}function Nt(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,u,a,c,s,f,l,h,p=t._root,d={data:r},v=t._x0,_=t._y0,y=t._x1,g=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((s=n>=(o=(v+y)/2))?v=o:y=o,(f=e>=(u=(_+g)/2))?_=u:g=u,i=p,!(p=p[l=f<<1|s]))return i[l]=d,t;if(a=+t._x.call(null,p.data),c=+t._y.call(null,p.data),n===a&&e===c)return d.next=p,i?i[l]=d:t._root=d,t;do i=i?i[l]=new Array(4):t._root=new Array(4),(s=n>=(o=(v+y)/2))?v=o:y=o,(f=e>=(u=(_+g)/2))?_=u:g=u;while((l=f<<1|s)===(h=(c>=u)<<1|a>=o));return i[h]=p,i[l]=d,t}function St(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),c=1/0,s=1/0,f=-(1/0),l=-(1/0);for(e=0;e<o;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(u[e]=r,a[e]=i,r<c&&(c=r),r>f&&(f=r),i<s&&(s=i),i>l&&(l=i));for(f<c&&(c=this._x0,f=this._x1),l<s&&(s=this._y0,l=this._y1),this.cover(c,s).cover(f,l),e=0;e<o;++e)Nt(this,u[e],a[e],t[e]);return this}function At(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{if(!(e>t||t>i||r>n||n>o))return this;var u,a,c=i-e,s=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do u=new Array(4),u[a]=s,s=u;while(c*=2,i=e+c,o=r+c,t>i||n>o);break;case 1:do u=new Array(4),u[a]=s,s=u;while(c*=2,e=i-c,o=r+c,e>t||n>o);break;case 2:do u=new Array(4),u[a]=s,s=u;while(c*=2,i=e+c,r=o-c,t>i||r>n);break;case 3:do u=new Array(4),u[a]=s,s=u;while(c*=2,e=i-c,r=o-c,e>t||r>n)}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this}function Et(){var t=[];return this.visit(function(n){if(!n.length)do t.push(n.data);while(n=n.next)}),t}function Ct(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function zt(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function Pt(t,n,e){var r,i,o,u,a,c,s,f=this._x0,l=this._y0,h=this._x1,p=this._y1,d=[],v=this._root;for(v&&d.push(new zt(v,f,l,h,p)),null==e?e=1/0:(f=t-e,l=n-e,h=t+e,p=n+e,e*=e);c=d.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(o=c.y0)>p||(u=c.x1)<f||(a=c.y1)<l))if(v.length){var _=(i+u)/2,y=(o+a)/2;d.push(new zt(v[3],_,y,u,a),new zt(v[2],i,y,_,a),new zt(v[1],_,o,u,y),new zt(v[0],i,o,_,y)),(s=(n>=y)<<1|t>=_)&&(c=d[d.length-1],d[d.length-1]=d[d.length-1-s],d[d.length-1-s]=c)}else{var g=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=g*g+m*m;if(x<e){var b=Math.sqrt(e=x);f=t-b,l=n-b,h=t+b,p=n+b,r=v.data}}return r}function qt(t){if(isNaN(o=+this._x.call(null,t))||isNaN(u=+this._y.call(null,t)))return this;var n,e,r,i,o,u,a,c,s,f,l,h,p=this._root,d=this._x0,v=this._y0,_=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((s=o>=(a=(d+_)/2))?d=a:_=a,(f=u>=(c=(v+y)/2))?v=c:y=c,n=p,!(p=p[l=f<<1|s]))return this;if(!p.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(p=n[0]||n[1]||n[2]||n[3])&&p===(n[3]||n[2]||n[1]||n[0])&&!p.length&&(e?e[h]=p:this._root=p),this):(this._root=i,this)}function Lt(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this}function Rt(){return this._root}function Ut(){var t=0;return this.visit(function(n){if(!n.length)do++t;while(n=n.next)}),t}function Dt(t){var n,e,r,i,o,u,a=[],c=this._root;for(c&&a.push(new zt(c,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(c=n.node,r=n.x0,i=n.y0,o=n.x1,u=n.y1)&&c.length){var s=(r+o)/2,f=(i+u)/2;(e=c[3])&&a.push(new zt(e,s,f,o,u)),(e=c[2])&&a.push(new zt(e,r,f,s,u)),(e=c[1])&&a.push(new zt(e,s,i,o,f)),(e=c[0])&&a.push(new zt(e,r,i,s,f))}return this}function Ot(t){var n,e=[],r=[];for(this._root&&e.push(new zt(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,u=n.x0,a=n.y0,c=n.x1,s=n.y1,f=(u+c)/2,l=(a+s)/2;(o=i[0])&&e.push(new zt(o,u,a,f,l)),(o=i[1])&&e.push(new zt(o,f,a,c,l)),(o=i[2])&&e.push(new zt(o,u,l,f,s)),(o=i[3])&&e.push(new zt(o,f,l,c,s))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this}function Ft(t){return t[0]}function It(t){return arguments.length?(this._x=t,this):this._x}function Yt(t){return t[1]}function Bt(t){return arguments.length?(this._y=t,this):this._y}function jt(t,n,e){var r=new Ht(null==n?Ft:n,null==e?Yt:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Ht(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Xt(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}function Vt(t){if(!(t>=1))throw new Error;this._size=t,this._call=this._error=null,this._tasks=[],this._data=[],this._waiting=this._active=this._ended=this._start=0}function Wt(t){if(!t._start)try{$t(t)}catch(n){t._tasks[t._ended+t._active-1]&&Gt(t,n)}}function $t(t){for(;t._start=t._waiting&&t._active<t._size;){var n=t._ended+t._active,e=t._tasks[n],r=e.length-1,i=e[r];e[r]=Zt(t,n),--t._waiting,++t._active,e=i.apply(null,e),t._tasks[n]&&(t._tasks[n]=e||vv)}}function Zt(t,n){return function(e,r){t._tasks[n]&&(--t._active,++t._ended,t._tasks[n]=null,null==t._error&&(null!=e?Gt(t,e):(t._data[n]=r,t._waiting?Wt(t):Jt(t))))}}function Gt(t,n){var e,r=t._tasks.length;for(t._error=n,t._data=void 0,t._waiting=NaN;--r>=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(t){}t._active=NaN,Jt(t)}function Jt(t){!t._active&&t._call&&t._call(t._error,t._data)}function Qt(t){return new Vt(arguments.length?+t:1/0)}function Kt(t){return function(){return t}}function tn(t){return t.innerRadius}function nn(t){return t.outerRadius}function en(t){return t.startAngle}function rn(t){return t.endAngle}function on(t){return t&&t.padAngle}function un(t){return t>=1?gv:t<=-1?-gv:Math.asin(t)}function an(t,n,e,r,i,o,u,a){var c=e-t,s=r-n,f=u-i,l=a-o,h=(f*(n-o)-l*(t-i))/(l*c-f*s);return[t+h*c,n+h*s]}function cn(t,n,e,r,i,o,u){var a=t-e,c=n-r,s=(u?o:-o)/Math.sqrt(a*a+c*c),f=s*c,l=-s*a,h=t+f,p=n+l,d=e+f,v=r+l,_=(h+d)/2,y=(p+v)/2,g=d-h,m=v-p,x=g*g+m*m,b=i-o,w=h*v-d*p,M=(m<0?-1:1)*Math.sqrt(Math.max(0,b*b*x-w*w)),T=(w*m-g*M)/x,k=(-w*g-m*M)/x,N=(w*m+g*M)/x,S=(-w*g+m*M)/x,A=T-_,E=k-y,C=N-_,z=S-y;return A*A+E*E>C*C+z*z&&(T=N,k=S),{cx:T,cy:k,x01:-f,y01:-l,x11:T*(i/b-1),y11:k*(i/b-1)}}function sn(){function t(){var t,s,f=+n.apply(this,arguments),l=+e.apply(this,arguments),h=o.apply(this,arguments)-gv,p=u.apply(this,arguments)-gv,d=Math.abs(p-h),v=p>h;if(c||(c=t=Tt()),l<f&&(s=l,l=f,f=s),l>_v)if(d>mv-_v)c.moveTo(l*Math.cos(h),l*Math.sin(h)),c.arc(0,0,l,h,p,!v),f>_v&&(c.moveTo(f*Math.cos(p),f*Math.sin(p)),c.arc(0,0,f,p,h,v));else{var _,y,g=h,m=p,x=h,b=p,w=d,M=d,T=a.apply(this,arguments)/2,k=T>_v&&(i?+i.apply(this,arguments):Math.sqrt(f*f+l*l)),N=Math.min(Math.abs(l-f)/2,+r.apply(this,arguments)),S=N,A=N;if(k>_v){var E=un(k/f*Math.sin(T)),C=un(k/l*Math.sin(T));(w-=2*E)>_v?(E*=v?1:-1,x+=E,b-=E):(w=0,x=b=(h+p)/2),(M-=2*C)>_v?(C*=v?1:-1,g+=C,m-=C):(M=0,g=m=(h+p)/2)}var z=l*Math.cos(g),P=l*Math.sin(g),q=f*Math.cos(b),L=f*Math.sin(b);if(N>_v){var R=l*Math.cos(m),U=l*Math.sin(m),D=f*Math.cos(x),O=f*Math.sin(x);if(d<yv){var F=w>_v?an(z,P,D,O,R,U,q,L):[q,L],I=z-F[0],Y=P-F[1],B=R-F[0],j=U-F[1],H=1/Math.sin(Math.acos((I*B+Y*j)/(Math.sqrt(I*I+Y*Y)*Math.sqrt(B*B+j*j)))/2),X=Math.sqrt(F[0]*F[0]+F[1]*F[1]);S=Math.min(N,(f-X)/(H-1)),A=Math.min(N,(l-X)/(H+1))}}M>_v?A>_v?(_=cn(D,O,z,P,l,A,v),y=cn(R,U,q,L,l,A,v),c.moveTo(_.cx+_.x01,_.cy+_.y01),A<N?c.arc(_.cx,_.cy,A,Math.atan2(_.y01,_.x01),Math.atan2(y.y01,y.x01),!v):(c.arc(_.cx,_.cy,A,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!v),c.arc(0,0,l,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(y.cy+y.y11,y.cx+y.x11),!v),c.arc(y.cx,y.cy,A,Math.atan2(y.y11,y.x11),Math.atan2(y.y01,y.x01),!v))):(c.moveTo(z,P),c.arc(0,0,l,g,m,!v)):c.moveTo(z,P),f>_v&&w>_v?S>_v?(_=cn(q,L,R,U,f,-S,v),y=cn(z,P,D,O,f,-S,v),c.lineTo(_.cx+_.x01,_.cy+_.y01),S<N?c.arc(_.cx,_.cy,S,Math.atan2(_.y01,_.x01),Math.atan2(y.y01,y.x01),!v):(c.arc(_.cx,_.cy,S,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!v),c.arc(0,0,f,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(y.cy+y.y11,y.cx+y.x11),v),c.arc(y.cx,y.cy,S,Math.atan2(y.y11,y.x11),Math.atan2(y.y01,y.x01),!v))):c.arc(0,0,f,b,x,v):c.lineTo(q,L)}else c.moveTo(0,0);if(c.closePath(),t)return c=null,t+""||null}var n=tn,e=nn,r=Kt(0),i=null,o=en,u=rn,a=on,c=null;return t.centroid=function(){var t=(+n.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+o.apply(this,arguments)+ +u.apply(this,arguments))/2-yv/2;return[Math.cos(r)*t,Math.sin(r)*t]},t.innerRadius=function(e){return arguments.length?(n="function"==typeof e?e:Kt(+e),t):n},t.outerRadius=function(n){return arguments.length?(e="function"==typeof n?n:Kt(+n),t):e},t.cornerRadius=function(n){return arguments.length?(r="function"==typeof n?n:Kt(+n),t):r},t.padRadius=function(n){return arguments.length?(i=null==n?null:"function"==typeof n?n:Kt(+n),t):i},t.startAngle=function(n){return arguments.length?(o="function"==typeof n?n:Kt(+n),t):o},t.endAngle=function(n){return arguments.length?(u="function"==typeof n?n:Kt(+n),t):u},t.padAngle=function(n){return arguments.length?(a="function"==typeof n?n:Kt(+n),t):a},t.context=function(n){return arguments.length?(c=null==n?null:n,t):c},t}function fn(t){this._context=t}function ln(t){return new fn(t)}function hn(t){return t[0]}function pn(t){return t[1]}function dn(){function t(t){var a,c,s,f=t.length,l=!1;for(null==i&&(u=o(s=Tt())),a=0;a<=f;++a)!(a<f&&r(c=t[a],a,t))===l&&((l=!l)?u.lineStart():u.lineEnd()),l&&u.point(+n(c,a,t),+e(c,a,t));if(s)return u=null,s+""||null}var n=hn,e=pn,r=Kt(!0),i=null,o=ln,u=null;return t.x=function(e){return arguments.length?(n="function"==typeof e?e:Kt(+e),t):n},t.y=function(n){return arguments.length?(e="function"==typeof n?n:Kt(+n),t):e},t.defined=function(n){return arguments.length?(r="function"==typeof n?n:Kt(!!n),t):r},t.curve=function(n){return arguments.length?(o=n,null!=i&&(u=o(i)),t):o},t.context=function(n){return arguments.length?(null==n?i=u=null:u=o(i=n),t):i},t}function vn(){function t(t){var n,f,l,h,p,d=t.length,v=!1,_=new Array(d),y=new Array(d);for(null==a&&(s=c(p=Tt())),n=0;n<=d;++n){if(!(n<d&&u(h=t[n],n,t))===v)if(v=!v)f=n,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),l=n-1;l>=f;--l)s.point(_[l],y[l]);s.lineEnd(),s.areaEnd()}v&&(_[n]=+e(h,n,t),y[n]=+i(h,n,t),s.point(r?+r(h,n,t):_[n],o?+o(h,n,t):y[n]))}if(p)return s=null,p+""||null}function n(){return dn().defined(u).curve(c).context(a)}var e=hn,r=null,i=Kt(0),o=pn,u=Kt(!0),a=null,c=ln,s=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:Kt(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:Kt(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:Kt(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:Kt(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:Kt(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:Kt(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(u="function"==typeof n?n:Kt(!!n),t):u},t.curve=function(n){return arguments.length?(c=n,null!=a&&(s=c(a)),t):c},t.context=function(n){return arguments.length?(null==n?a=s=null:s=c(a=n),t):a},t}function _n(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function yn(t){return t}function gn(){function t(t){var a,c,s,f,l,h=t.length,p=0,d=new Array(h),v=new Array(h),_=+i.apply(this,arguments),y=Math.min(mv,Math.max(-mv,o.apply(this,arguments)-_)),g=Math.min(Math.abs(y)/h,u.apply(this,arguments)),m=g*(y<0?-1:1);for(a=0;a<h;++a)(l=v[d[a]=a]=+n(t[a],a,t))>0&&(p+=l);for(null!=e?d.sort(function(t,n){return e(v[t],v[n])}):null!=r&&d.sort(function(n,e){return r(t[n],t[e])}),a=0,s=p?(y-h*m)/p:0;a<h;++a,_=f)c=d[a],l=v[c],f=_+(l>0?l*s:0)+m,v[c]={data:t[c],index:a,value:l,startAngle:_,endAngle:f,padAngle:g};return v}var n=yn,e=_n,r=null,i=Kt(0),o=Kt(mv),u=Kt(0);return t.value=function(e){return arguments.length?(n="function"==typeof e?e:Kt(+e),t):n},t.sortValues=function(n){return arguments.length?(e=n,r=null,t):e},t.sort=function(n){return arguments.length?(r=n,e=null,t):r},t.startAngle=function(n){return arguments.length?(i="function"==typeof n?n:Kt(+n),t):i},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:Kt(+n),t):o},t.padAngle=function(n){return arguments.length?(u="function"==typeof n?n:Kt(+n),t):u},t}function mn(t){this._curve=t}function xn(t){function n(n){return new mn(t(n))}return n._curve=t,n}function bn(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(xn(t)):n()._curve},t}function wn(){return bn(dn().curve(xv))}function Mn(){var t=vn().curve(xv),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return bn(e())},delete t.lineX0,t.lineEndAngle=function(){return bn(r())},delete t.lineX1,t.lineInnerRadius=function(){return bn(i())},delete t.lineY0,t.lineOuterRadius=function(){return bn(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(xn(t)):n()._curve},t}function Tn(){function t(){var t;if(r||(r=t=Tt()),n.apply(this,arguments).draw(r,+e.apply(this,arguments)),t)return r=null,t+""||null}var n=Kt(bv),e=Kt(64),r=null;return t.type=function(e){return arguments.length?(n="function"==typeof e?e:Kt(e),t):n},t.size=function(n){return arguments.length?(e="function"==typeof n?n:Kt(+n),t):e},t.context=function(n){return arguments.length?(r=null==n?null:n,t):r},t}function kn(){}function Nn(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function Sn(t){this._context=t}function An(t){return new Sn(t)}function En(t){this._context=t}function Cn(t){return new En(t)}function zn(t){this._context=t}function Pn(t){return new zn(t)}function qn(t,n){this._basis=new Sn(t),this._beta=n}function Ln(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Rn(t,n){this._context=t,this._k=(1-n)/6}function Un(t,n){this._context=t,this._k=(1-n)/6}function Dn(t,n){this._context=t,this._k=(1-n)/6}function On(t,n,e){var r=t._x1,i=t._y1,o=t._x2,u=t._y2;if(t._l01_a>_v){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>_v){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-n*t._l12_2a)/f,u=(u*s+t._y1*t._l23_2a-e*t._l12_2a)/f}t._context.bezierCurveTo(r,i,o,u,t._x2,t._y2)}function Fn(t,n){this._context=t,this._alpha=n}function In(t,n){this._context=t,this._alpha=n}function Yn(t,n){this._context=t,this._alpha=n}function Bn(t){this._context=t}function jn(t){return new Bn(t)}function Hn(t){return t<0?-1:1}function Xn(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),u=(e-t._y1)/(i||r<0&&-0),a=(o*i+u*r)/(r+i);return(Hn(o)+Hn(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(a))||0}function Vn(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Wn(t,n,e){var r=t._x0,i=t._y0,o=t._x1,u=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*n,o-a,u-a*e,o,u)}function $n(t){this._context=t}function Zn(t){this._context=new Gn(t)}function Gn(t){this._context=t}function Jn(t){return new $n(t)}function Qn(t){return new Zn(t)}function Kn(t){this._context=t}function te(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),u=new Array(r);for(i[0]=0,o[0]=2,u[0]=t[0]+2*t[1],n=1;n<r-1;++n)i[n]=1,o[n]=4,u[n]=4*t[n]+2*t[n+1];for(i[r-1]=2,o[r-1]=7,u[r-1]=8*t[r-1]+t[r],n=1;n<r;++n)e=i[n]/o[n-1],o[n]-=e,u[n]-=e*u[n-1];for(i[r-1]=u[r-1]/o[r-1],n=r-2;n>=0;--n)i[n]=(u[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n<r-1;++n)o[n]=2*t[n+1]-i[n+1];return[i,o]}function ne(t){return new Kn(t)}function ee(t,n){this._context=t,this._t=n}function re(t){return new ee(t,.5)}function ie(t){return new ee(t,0)}function oe(t){return new ee(t,1)}function ue(t,n){if((r=t.length)>1)for(var e,r,i=1,o=t[n[0]],u=o.length;i<r;++i){e=o,o=t[n[i]];for(var a=0;a<u;++a)o[a][1]+=o[a][0]=isNaN(e[a][1])?e[a][0]:e[a][1]}}function ae(t){for(var n=t.length,e=new Array(n);--n>=0;)e[n]=n;return e}function ce(t,n){return t[n]}function se(){function t(t){var o,u,a=n.apply(this,arguments),c=t.length,s=a.length,f=new Array(s);for(o=0;o<s;++o){for(var l,h=a[o],p=f[o]=new Array(c),d=0;d<c;++d)p[d]=l=[0,+i(t[d],h,d,t)],l.data=t[d];p.key=h}for(o=0,u=e(f);o<s;++o)f[u[o]].index=o;return r(f,u),f}var n=Kt([]),e=ae,r=ue,i=ce;return t.keys=function(e){return arguments.length?(n="function"==typeof e?e:Kt(Wv.call(e)),t):n},t.value=function(n){return arguments.length?(i="function"==typeof n?n:Kt(+n),t):i},t.order=function(n){return arguments.length?(e=null==n?ae:"function"==typeof n?n:Kt(Wv.call(n)),t):e},t.offset=function(n){return arguments.length?(r=null==n?ue:n,t):r},t}function fe(t,n){if((r=t.length)>0){for(var e,r,i,o=0,u=t[0].length;o<u;++o){for(i=e=0;e<r;++e)i+=t[e][o][1]||0;if(i)for(e=0;e<r;++e)t[e][o][1]/=i}ue(t,n)}}function le(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r<o;++r){for(var u=0,a=0;u<e;++u)a+=t[u][r][1]||0;i[r][1]+=i[r][0]=-a/2}ue(t,n)}}function he(t,n){if((i=t.length)>0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,u=1;u<r;++u){for(var a=0,c=0,s=0;a<i;++a){for(var f=t[n[a]],l=f[u][1]||0,h=f[u-1][1]||0,p=(l-h)/2,d=0;d<a;++d){var v=t[n[d]],_=v[u][1]||0,y=v[u-1][1]||0;p+=_-y}c+=l,s+=p*l}e[u-1][1]+=e[u-1][0]=o,c&&(o-=s/c)}e[u-1][1]+=e[u-1][0]=o,ue(t,n)}}function pe(t){var n=t.map(de);return ae(t).sort(function(t,e){return n[t]-n[e]})}function de(t){for(var n,e=0,r=-1,i=t.length;++r<i;)(n=+t[r][1])&&(e+=n);return e}function ve(t){return pe(t).reverse()}function _e(t){var n,e,r=t.length,i=t.map(de),o=ae(t).sort(function(t,n){return i[n]-i[t]}),u=0,a=0,c=[],s=[];for(n=0;n<r;++n)e=o[n],u<a?(u+=i[e],c.push(e)):(a+=i[e],s.push(e));return s.reverse().concat(c)}function ye(t){return ae(t).reverse()}function ge(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function me(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function xe(){}function be(t){var n;return t=(t+"").trim().toLowerCase(),(n=Gv.exec(t))?(n=parseInt(n[1],16),new Ne(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=Jv.exec(t))?we(parseInt(n[1],16)):(n=Qv.exec(t))?new Ne(n[1],n[2],n[3],1):(n=Kv.exec(t))?new Ne(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=t_.exec(t))?Me(n[1],n[2],n[3],n[4]):(n=n_.exec(t))?Me(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=e_.exec(t))?Se(n[1],n[2]/100,n[3]/100,1):(n=r_.exec(t))?Se(n[1],n[2]/100,n[3]/100,n[4]):i_.hasOwnProperty(t)?we(i_[t]):"transparent"===t?new Ne(NaN,NaN,NaN,0):null}function we(t){return new Ne(t>>16&255,t>>8&255,255&t,1)}function Me(t,n,e,r){return r<=0&&(t=n=e=NaN),new Ne(t,n,e,r)}function Te(t){return t instanceof xe||(t=be(t)),t?(t=t.rgb(),new Ne(t.r,t.g,t.b,t.opacity)):new Ne}function ke(t,n,e,r){return 1===arguments.length?Te(t):new Ne(t,n,e,null==r?1:r)}function Ne(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Se(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Ce(t,n,e,r)}function Ae(t){if(t instanceof Ce)return new Ce(t.h,t.s,t.l,t.opacity);if(t instanceof xe||(t=be(t)),!t)return new Ce;if(t instanceof Ce)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,c=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=c<.5?o+i:2-o-i,u*=60):a=c>0&&c<1?0:u,new Ce(u,a,c,t.opacity)}function Ee(t,n,e,r){return 1===arguments.length?Ae(t):new Ce(t,n,e,null==r?1:r)}function Ce(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ze(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Pe(t){if(t instanceof Le)return new Le(t.l,t.a,t.b,t.opacity);if(t instanceof Ye){var n=t.h*o_;return new Le(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Ne||(t=Te(t));var e=Oe(t.r),r=Oe(t.g),i=Oe(t.b),o=Re((.4124564*e+.3575761*r+.1804375*i)/c_),u=Re((.2126729*e+.7151522*r+.072175*i)/s_),a=Re((.0193339*e+.119192*r+.9503041*i)/f_);return new Le(116*u-16,500*(o-u),200*(u-a),t.opacity)}function qe(t,n,e,r){return 1===arguments.length?Pe(t):new Le(t,n,e,null==r?1:r)}function Le(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Re(t){return t>d_?Math.pow(t,1/3):t/p_+l_}function Ue(t){return t>h_?t*t*t:p_*(t-l_)}function De(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Oe(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Fe(t){if(t instanceof Ye)return new Ye(t.h,t.c,t.l,t.opacity);t instanceof Le||(t=Pe(t));var n=Math.atan2(t.b,t.a)*u_;return new Ye(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Ie(t,n,e,r){return 1===arguments.length?Fe(t):new Ye(t,n,e,null==r?1:r)}function Ye(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Be(t){if(t instanceof He)return new He(t.h,t.s,t.l,t.opacity);t instanceof Ne||(t=Te(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(w_*r+x_*n-b_*e)/(w_+x_-b_),o=r-i,u=(m_*(e-i)-y_*o)/g_,a=Math.sqrt(u*u+o*o)/(m_*i*(1-i)),c=a?Math.atan2(u,o)*u_-120:NaN;return new He(c<0?c+360:c,a,i,t.opacity)}function je(t,n,e,r){return 1===arguments.length?Be(t):new He(t,n,e,null==r?1:r)}function He(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Xe(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}function Ve(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=r<n-1?t[r+2]:2*o-i;return Xe((e-r/n)*n,u,i,o,a)}}function We(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],o=t[r%n],u=t[(r+1)%n],a=t[(r+2)%n];return Xe((e-r/n)*n,i,o,u,a)}}function $e(t){return function(){return t}}function Ze(t,n){return function(e){return t+e*n}}function Ge(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Je(t,n){var e=n-t;return e?Ze(t,e>180||e<-180?e-360*Math.round(e/360):e):$e(isNaN(t)?n:t)}function Qe(t){return 1===(t=+t)?Ke:function(n,e){return e-n?Ge(n,e,t):$e(isNaN(n)?e:n)}}function Ke(t,n){var e=n-t;return e?Ze(t,e):$e(isNaN(t)?n:t)}function tr(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;e<i;++e)r=ke(n[e]),o[e]=r.r||0,u[e]=r.g||0,a[e]=r.b||0;return o=t(o),u=t(u),a=t(a),r.opacity=1,function(t){return r.r=o(t),r.g=u(t),r.b=a(t),r+""}}}function nr(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(r),u=new Array(r);for(e=0;e<i;++e)o[e]=cr(t[e],n[e]);
+for(;e<r;++e)u[e]=n[e];return function(t){for(e=0;e<i;++e)u[e]=o[e](t);return u}}function er(t,n){var e=new Date;return t=+t,n-=t,function(r){return e.setTime(t+n*r),e}}function rr(t,n){return t=+t,n-=t,function(e){return t+n*e}}function ir(t,n){var e,r={},i={};null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={});for(e in n)e in t?r[e]=cr(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}function or(t){return function(){return t}}function ur(t){return function(n){return t(n)+""}}function ar(t,n){var e,r,i,o=C_.lastIndex=z_.lastIndex=0,u=-1,a=[],c=[];for(t+="",n+="";(e=C_.exec(t))&&(r=z_.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:rr(e,r)})),o=z_.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?c[0]?ur(c[0].x):or(n):(n=c.length,function(t){for(var e,r=0;r<n;++r)a[(e=c[r]).i]=e.x(t);return a.join("")})}function cr(t,n){var e,r=typeof n;return null==n||"boolean"===r?$e(n):("number"===r?rr:"string"===r?(e=be(n))?(n=e,S_):ar:n instanceof be?S_:n instanceof Date?er:Array.isArray(n)?nr:isNaN(n)?ir:rr)(t,n)}function sr(t,n){return t=+t,n-=t,function(e){return Math.round(t+n*e)}}function fr(t,n,e,r,i,o){var u,a,c;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(c=t*e+n*r)&&(e-=t*c,r-=n*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),t*r<n*e&&(t=-t,n=-n,c=-c,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*P_,skewX:Math.atan(c)*P_,scaleX:u,scaleY:a}}function lr(t){return"none"===t?q_:(M_||(M_=document.createElement("DIV"),T_=document.documentElement,k_=document.defaultView),M_.style.transform=t,t=k_.getComputedStyle(T_.appendChild(M_),null).getPropertyValue("transform"),T_.removeChild(M_),t=t.slice(7,-1).split(","),fr(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function hr(t){return null==t?q_:(N_||(N_=document.createElementNS("http://www.w3.org/2000/svg","g")),N_.setAttribute("transform",t),(t=N_.transform.baseVal.consolidate())?(t=t.matrix,fr(t.a,t.b,t.c,t.d,t.e,t.f)):q_)}function pr(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(t,r,i,o,u,a){if(t!==i||r!==o){var c=u.push("translate(",null,n,null,e);a.push({i:c-4,x:rr(t,i)},{i:c-2,x:rr(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}function u(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:rr(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function a(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:rr(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function c(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:rr(t,e)},{i:a-2,x:rr(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),u(n.rotate,e.rotate,r,i),a(n.skewX,e.skewX,r,i),c(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e<o;)r[(n=i[e]).i]=n.x(t);return r.join("")}}}function dr(t){return((t=Math.exp(t))+1/t)/2}function vr(t){return((t=Math.exp(t))-1/t)/2}function _r(t){return((t=Math.exp(2*t))-1)/(t+1)}function yr(t,n){var e,r,i=t[0],o=t[1],u=t[2],a=n[0],c=n[1],s=n[2],f=a-i,l=c-o,h=f*f+l*l;if(h<F_)r=Math.log(s/u)/U_,e=function(t){return[i+t*f,o+t*l,u*Math.exp(U_*t*r)]};else{var p=Math.sqrt(h),d=(s*s-u*u+O_*h)/(2*u*D_*p),v=(s*s-u*u-O_*h)/(2*s*D_*p),_=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-_)/U_,e=function(t){var n=t*r,e=dr(_),a=u/(D_*p)*(e*_r(U_*n+_)-vr(_));return[i+a*f,o+a*l,u*e/dr(U_*n+_)]}}return e.duration=1e3*r,e}function gr(t){return function(n,e){var r=t((n=Ee(n)).h,(e=Ee(e)).h),i=Ke(n.s,e.s),o=Ke(n.l,e.l),u=Ke(n.opacity,e.opacity);return function(t){return n.h=r(t),n.s=i(t),n.l=o(t),n.opacity=u(t),n+""}}}function mr(t,n){var e=Ke((t=qe(t)).l,(n=qe(n)).l),r=Ke(t.a,n.a),i=Ke(t.b,n.b),o=Ke(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}}function xr(t){return function(n,e){var r=t((n=Ie(n)).h,(e=Ie(e)).h),i=Ke(n.c,e.c),o=Ke(n.l,e.l),u=Ke(n.opacity,e.opacity);return function(t){return n.h=r(t),n.c=i(t),n.l=o(t),n.opacity=u(t),n+""}}}function br(t){return function n(e){function r(n,r){var i=t((n=je(n)).h,(r=je(r)).h),o=Ke(n.s,r.s),u=Ke(n.l,r.l),a=Ke(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=o(t),n.l=u(Math.pow(t,e)),n.opacity=a(t),n+""}}return e=+e,r.gamma=n,r}(1)}function wr(t,n){for(var e=new Array(n),r=0;r<n;++r)e[r]=t(r/(n-1));return e}function Mr(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new Tr(r)}function Tr(t){this._=t}function kr(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function Nr(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function Sr(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=V_,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function Ar(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")}function Er(t,n){var e=Ar(t);return function(r,i){return n(e(r),i,t)}}function Cr(t){var n=Object.create(null),e=[];return t.forEach(function(t){for(var r in t)r in n||e.push(n[r]=r)}),e}function zr(t){function n(t,n){var r,i,o=e(t,function(t,e){return r?r(t,e-1):(i=t,void(r=n?Er(t,n):Ar(t)))});return o.columns=i,o}function e(t,n){function e(){if(f>=s)return u;if(i)return i=!1,o;var n,e=f;if(34===t.charCodeAt(e)){for(var r=e;r++<s;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return f=r+2,n=t.charCodeAt(r+1),13===n?(i=!0,10===t.charCodeAt(r+2)&&++f):10===n&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;f<s;){var a=1;if(n=t.charCodeAt(f++),10===n)i=!0;else if(13===n)i=!0,10===t.charCodeAt(f)&&(++f,++a);else if(n!==c)continue;return t.slice(e,f-a)}return t.slice(e)}for(var r,i,o={},u={},a=[],s=t.length,f=0,l=0;(r=e())!==u;){for(var h=[];r!==o&&r!==u;)h.push(r),r=e();n&&null==(h=n(h,l++))||a.push(h)}return a}function r(n,e){return null==e&&(e=Cr(n)),[e.map(u).join(t)].concat(n.map(function(n){return e.map(function(t){return u(n[t])}).join(t)})).join("\n")}function i(t){return t.map(o).join("\n")}function o(n){return n.map(u).join(t)}function u(t){return null==t?"":a.test(t+="")?'"'+t.replace(/\"/g,'""')+'"':t}var a=new RegExp('["'+t+"\n]"),c=t.charCodeAt(0);return{parse:n,parseRows:e,format:r,formatRows:i}}function Pr(t,n){function e(t){var n,e=s.status;if(!e&&Lr(s)||e>=200&&e<300||304===e){if(o)try{n=o.call(r,s)}catch(t){return void a.call("error",r,t)}else n=s;a.call("load",r,n)}else a.call("error",r,t)}var r,i,o,u,a=Mr("beforesend","progress","load","error"),c=q(),s=new XMLHttpRequest,f=null,l=null,h=0;if("undefined"==typeof XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=s.ontimeout=e:s.onreadystatechange=function(t){s.readyState>3&&e(t)},s.onprogress=function(t){a.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?c.get(t):(null==n?c.remove(t):c.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(u=t,r):u},timeout:function(t){return arguments.length?(h=+t,r):h},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",r)},password:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return s.open(n,t,!0,f,l),null==i||c.has("accept")||c.set("accept",i+",*/*"),s.setRequestHeader&&c.each(function(t,n){s.setRequestHeader(n,t)}),null!=i&&s.overrideMimeType&&s.overrideMimeType(i),null!=u&&(s.responseType=u),h>0&&(s.timeout=h),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=qr(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),a.call("beforesend",r,s),s.send(null==e?null:e),r},abort:function(){return s.abort(),r},on:function(){var t=a.on.apply(a,arguments);return t===a?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r}function qr(t){return function(n,e){t(null==n?e:null)}}function Lr(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function Rr(t,n){return function(e,r){var i=Pr(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}}function Ur(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=Pr(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(Dr(n,r=t)):r},o.row(r),i?o.get(i):o}}function Dr(t,n){return function(e){return t(e.responseText,n)}}function Or(){return _y||(my(Fr),_y=gy.now()+yy)}function Fr(){_y=0}function Ir(){this._call=this._time=this._next=null}function Yr(t,n,e){var r=new Ir;return r.restart(t,n,e),r}function Br(){Or(),++ly;for(var t,n=W_;n;)(t=_y-n._time)>=0&&n._call.call(null,t),n=n._next;--ly}function jr(t){_y=(vy=t||gy.now())+yy,ly=hy=0;try{Br()}finally{ly=0,Xr(),_y=0}}function Hr(){var t=gy.now(),n=t-vy;n>dy&&(yy-=n,vy=t)}function Xr(){for(var t,n,e=W_,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:W_=n);$_=t,Vr(r)}function Vr(t){if(!ly){hy&&(hy=clearTimeout(hy));var n=t-_y;n>24?(t<1/0&&(hy=setTimeout(jr,n)),py&&(py=clearInterval(py))):(py||(py=setInterval(Hr,dy)),ly=1,my(jr))}}function Wr(t,n,e){var r=new Ir;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}function $r(t,n,e){var r=new Ir,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?Or():+e,r.restart(function o(u){u+=i,r.restart(o,i+=n,e),t(u)},n,e),r)}function Zr(t,n,e,r){function i(n){return t(n=new Date((+n))),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=function(t,e){return n(t=new Date((+t)),null==e?1:Math.floor(e)),t},i.range=function(e,r,o){var u=[];if(e=i.ceil(e),o=null==o?1:Math.floor(o),!(e<r&&o>0))return u;do u.push(new Date((+e)));while(n(e,o),t(e),e<r);return u},i.filter=function(e){return Zr(function(n){for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return xy.setTime(+n),by.setTime(+r),t(xy),t(by),Math.floor(e(xy,by))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t===0}:function(n){return i.count(0,n)%t===0}):i:null}),i}function Gr(t){return Zr(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ky)/Ay})}function Jr(t){return Zr(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Ay})}function Qr(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function Kr(t){return t=Qr(Math.abs(t)),t?t[1]:NaN}function ti(t,n){return function(e,r){for(var i=e.length,o=[],u=0,a=t[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(e.substring(i-=a,i+a)),!((c+=a+1)>r));)a=t[u=(u+1)%t.length];return o.reverse().join(n)}}function ni(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i<r;++i)switch(t[i]){case".":o=e=i;break;case"0":0===o&&(o=i),e=i;break;case"e":break t;default:o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}function ei(t,n){var e=Qr(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Tg=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Qr(t,Math.max(0,n+o-1))[0]}function ri(t,n){var e=Qr(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array((-i)).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}function ii(t){return new oi(t)}function oi(t){if(!(n=Sg.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",u=!!n[5],a=n[6]&&+n[6],c=!!n[7],s=n[8]&&+n[8].slice(1),f=n[9]||"";"n"===f?(c=!0,f="g"):Ng[f]||(f=""),(u||"0"===e&&"="===r)&&(u=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=u,this.width=a,this.comma=c,this.precision=s,this.type=f}function ui(t){return t}function ai(t){function n(t){function n(t){var n,i,c,g=d,m=v;if("c"===p)m=_(t)+m,t="";else{t=+t;var x=(t<0||1/t<0)&&(t*=-1,!0);if(t=_(t,h),x)for(n=-1,i=t.length,x=!1;++n<i;)if(c=t.charCodeAt(n),48<c&&c<58||"x"===p&&96<c&&c<103||"X"===p&&64<c&&c<71){x=!0;break}if(g=(x?"("===a?a:"-":"-"===a||"("===a?"":a)+g,m=m+("s"===p?Eg[8+Tg/3]:"")+(x&&"("===a?")":""),y)for(n=-1,i=t.length;++n<i;)if(c=t.charCodeAt(n),48>c||c>57){m=(46===c?o+t.slice(n+1):t.slice(n))+m,t=t.slice(0,n);break}}l&&!s&&(t=r(t,1/0));var b=g.length+t.length+m.length,w=b<f?new Array(f-b+1).join(e):"";switch(l&&s&&(t=r(w+t,w.length?f-m.length:1/0),w=""),u){case"<":return g+t+m+w;case"=":return g+w+t+m;case"^":return w.slice(0,b=w.length>>1)+g+t+m+w.slice(b)}return w+g+t+m}t=ii(t);var e=t.fill,u=t.align,a=t.sign,c=t.symbol,s=t.zero,f=t.width,l=t.comma,h=t.precision,p=t.type,d="$"===c?i[0]:"#"===c&&/[boxX]/.test(p)?"0"+p.toLowerCase():"",v="$"===c?i[1]:/[%p]/.test(p)?"%":"",_=Ng[p],y=!p||/[defgprs%]/.test(p);return h=null==h?p?6:12:/[gprs]/.test(p)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=ii(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Kr(e)/3))),o=Math.pow(10,-i),u=Eg[8+i/3];return function(t){return r(o*t)+u}}var r=t.grouping&&t.thousands?ti(t.grouping,t.thousands):ui,i=t.currency,o=t.decimal;return{format:n,formatPrefix:e}}function ci(n){return Ag=ai(n),t.format=Ag.format,t.formatPrefix=Ag.formatPrefix,Ag}function si(t){return Math.max(0,-Kr(Math.abs(t)))}function fi(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Kr(n)/3)))-Kr(Math.abs(t)))}function li(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Kr(n)-Kr(t))+1}function hi(t){if(0<=t.y&&t.y<100){var n=new Date((-1),t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function pi(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function di(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function vi(t){function n(t,n){return function(e){var r,i,o,u=[],a=-1,c=0,s=t.length;for(e instanceof Date||(e=new Date((+e)));++a<s;)37===t.charCodeAt(a)&&(u.push(t.slice(c,a)),null!=(i=zg[r=t.charAt(++a)])?r=t.charAt(++a):i="e"===r?" ":"0",(o=n[r])&&(r=o(e,i)),u.push(r),c=a+1);return u.push(t.slice(c,a)),u.join("")}}function e(t,n){return function(e){var i=di(1900),o=r(i,t,e+="",0);if(o!=e.length)return null;if("p"in i&&(i.H=i.H%12+12*i.p),"W"in i||"U"in i){"w"in i||(i.w="W"in i?1:0);var u="Z"in i?pi(di(i.y)).getUTCDay():n(di(i.y)).getDay();i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(u+5)%7:i.w+7*i.U-(u+6)%7}return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,pi(i)):n(i)}}function r(t,n,e,r){for(var i,o,u=0,a=n.length,c=e.length;u<a;){if(r>=c)return-1;if(i=n.charCodeAt(u++),37===i){if(i=n.charAt(u++),o=B[i in zg?n.charAt(u++):i],!o||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=C.exec(n.slice(e));return r?(t.p=z[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=L.exec(n.slice(e));return r?(t.w=R[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=P.exec(n.slice(e));return r?(t.w=q[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=O.exec(n.slice(e));return r?(t.m=F[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){var r=U.exec(n.slice(e));return r?(t.m=D[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){return r(t,w,n,e)}function f(t,n,e){return r(t,M,n,e)}function l(t,n,e){return r(t,T,n,e)}function h(t){return S[t.getDay()]}function p(t){return N[t.getDay()]}function d(t){return E[t.getMonth()]}function v(t){return A[t.getMonth()]}function _(t){return k[+(t.getHours()>=12)]}function y(t){return S[t.getUTCDay()]}function g(t){return N[t.getUTCDay()]}function m(t){return E[t.getUTCMonth()]}function x(t){return A[t.getUTCMonth()]}function b(t){return k[+(t.getUTCHours()>=12)]}var w=t.dateTime,M=t.date,T=t.time,k=t.periods,N=t.days,S=t.shortDays,A=t.months,E=t.shortMonths,C=gi(k),z=mi(k),P=gi(N),q=mi(N),L=gi(S),R=mi(S),U=gi(A),D=mi(A),O=gi(E),F=mi(E),I={a:h,A:p,b:d,B:v,c:null,d:Li,e:Li,H:Ri,I:Ui,j:Di,L:Oi,m:Fi,M:Ii,p:_,S:Yi,U:Bi,w:ji,W:Hi,x:null,X:null,y:Xi,Y:Vi,Z:Wi,"%":co},Y={a:y,A:g,b:m,B:x,c:null,d:$i,e:$i,H:Zi,I:Gi,j:Ji,L:Qi,m:Ki,M:to,p:b,S:no,U:eo,w:ro,W:io,x:null,X:null,y:oo,Y:uo,Z:ao,"%":co},B={a:o,A:u,b:a,B:c,c:s,d:Si,e:Si,H:Ei,I:Ei,j:Ai,L:Pi,m:Ni,M:Ci,p:i,S:zi,U:bi,w:xi,W:wi,x:f,X:l,y:Ti,Y:Mi,Z:ki,"%":qi};return I.x=n(M,I),I.X=n(T,I),I.c=n(w,I),Y.x=n(M,Y),Y.X=n(T,Y),Y.c=n(w,Y),{format:function(t){var e=n(t+="",I);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",hi);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",Y);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,pi);return n.toString=function(){return t},n}}}function _i(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function yi(t){return t.replace(Lg,"\\$&")}function gi(t){return new RegExp("^(?:"+t.map(yi).join("|")+")","i")}function mi(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function xi(t,n,e){var r=Pg.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function bi(t,n,e){var r=Pg.exec(n.slice(e));return r?(t.U=+r[0],e+r[0].length):-1}function wi(t,n,e){var r=Pg.exec(n.slice(e));return r?(t.W=+r[0],e+r[0].length):-1}function Mi(t,n,e){var r=Pg.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function Ti(t,n,e){var r=Pg.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function ki(t,n,e){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Ni(t,n,e){var r=Pg.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Si(t,n,e){var r=Pg.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Ai(t,n,e){var r=Pg.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Ei(t,n,e){var r=Pg.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Ci(t,n,e){var r=Pg.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function zi(t,n,e){var r=Pg.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Pi(t,n,e){var r=Pg.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function qi(t,n,e){var r=qg.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Li(t,n){return _i(t.getDate(),n,2)}function Ri(t,n){return _i(t.getHours(),n,2)}function Ui(t,n){return _i(t.getHours()%12||12,n,2)}function Di(t,n){return _i(1+Ry.count(Ky(t),t),n,3)}function Oi(t,n){return _i(t.getMilliseconds(),n,3)}function Fi(t,n){return _i(t.getMonth()+1,n,2)}function Ii(t,n){return _i(t.getMinutes(),n,2)}function Yi(t,n){return _i(t.getSeconds(),n,2)}function Bi(t,n){return _i(Dy.count(Ky(t),t),n,2)}function ji(t){return t.getDay()}function Hi(t,n){return _i(Oy.count(Ky(t),t),n,2)}function Xi(t,n){return _i(t.getFullYear()%100,n,2)}function Vi(t,n){return _i(t.getFullYear()%1e4,n,4)}function Wi(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+_i(n/60|0,"0",2)+_i(n%60,"0",2)}function $i(t,n){return _i(t.getUTCDate(),n,2)}function Zi(t,n){return _i(t.getUTCHours(),n,2)}function Gi(t,n){return _i(t.getUTCHours()%12||12,n,2)}function Ji(t,n){return _i(1+og.count(Mg(t),t),n,3)}function Qi(t,n){return _i(t.getUTCMilliseconds(),n,3)}function Ki(t,n){return _i(t.getUTCMonth()+1,n,2)}function to(t,n){return _i(t.getUTCMinutes(),n,2)}function no(t,n){return _i(t.getUTCSeconds(),n,2)}function eo(t,n){return _i(ag.count(Mg(t),t),n,2)}function ro(t){return t.getUTCDay()}function io(t,n){return _i(cg.count(Mg(t),t),n,2)}function oo(t,n){return _i(t.getUTCFullYear()%100,n,2)}function uo(t,n){return _i(t.getUTCFullYear()%1e4,n,4)}function ao(){return"+0000"}function co(){return"%"}function so(n){return Cg=vi(n),t.timeFormat=Cg.format,t.timeParse=Cg.parse,t.utcFormat=Cg.utcFormat,t.utcParse=Cg.utcParse,Cg}function fo(t){return t.toISOString()}function lo(t){var n=new Date(t);return isNaN(n)?null:n}function ho(t){function n(n){var o=n+"",u=e.get(o);if(!u){if(i!==Yg)return i;e.set(o,u=r.push(n))}return t[(u-1)%t.length]}var e=q(),r=[],i=Yg;return t=null==t?[]:Ig.call(t),n.domain=function(t){if(!arguments.length)return r.slice();r=[],e=q();for(var i,o,u=-1,a=t.length;++u<a;)e.has(o=(i=t[u])+"")||e.set(o,r.push(i));return n},n.range=function(e){return arguments.length?(t=Ig.call(e),n):t.slice()},n.unknown=function(t){return arguments.length?(i=t,n):i},n.copy=function(){return ho().domain(r).range(t).unknown(i)},n}function po(){function t(){var t=i().length,r=u[1]<u[0],h=u[r-0],p=u[1-r];n=(p-h)/Math.max(1,t-c+2*s),a&&(n=Math.floor(n)),h+=(p-h-n*(t-c))*f,e=n*(1-c),a&&(h=Math.round(h),e=Math.round(e));var d=l(t).map(function(t){return h+n*t});return o(r?d.reverse():d)}var n,e,r=ho().unknown(void 0),i=r.domain,o=r.range,u=[0,1],a=!1,c=0,s=0,f=.5;return delete r.unknown,r.domain=function(n){return arguments.length?(i(n),t()):i()},r.range=function(n){return arguments.length?(u=[+n[0],+n[1]],t()):u.slice()},r.rangeRound=function(n){return u=[+n[0],+n[1]],a=!0,t()},r.bandwidth=function(){return e},r.step=function(){return n},r.round=function(n){return arguments.length?(a=!!n,t()):a},r.padding=function(n){return arguments.length?(c=s=Math.max(0,Math.min(1,n)),t()):c},r.paddingInner=function(n){return arguments.length?(c=Math.max(0,Math.min(1,n)),t()):c},r.paddingOuter=function(n){return arguments.length?(s=Math.max(0,Math.min(1,n)),t()):s},r.align=function(n){return arguments.length?(f=Math.max(0,Math.min(1,n)),t()):f},r.copy=function(){return po().domain(i()).range(u).round(a).paddingInner(c).paddingOuter(s).align(f)},t()}function vo(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return vo(n())},t}function _o(){return vo(po().paddingInner(1))}function yo(t){return function(){return t}}function go(t){return+t}function mo(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:yo(n)}function xo(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}function bo(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function wo(t,n,e,r){var i=t[0],o=t[1],u=n[0],a=n[1];return o<i?(i=e(o,i),u=r(a,u)):(i=e(i,o),u=r(u,a)),function(t){return u(i(t))}}function Mo(t,n,e,r){var i=Math.min(t.length,n.length)-1,o=new Array(i),u=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<i;)o[a]=e(t[a],t[a+1]),u[a]=r(n[a],n[a+1]);return function(n){var e=Sd(t,n,1,i)-1;return u[e](o[e](n))}}function To(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function ko(t,n){function e(){return i=Math.min(a.length,c.length)>2?Mo:wo,o=u=null,r}function r(n){return(o||(o=i(a,c,f?xo(t):t,s)))(+n)}var i,o,u,a=Bg,c=Bg,s=cr,f=!1;return r.invert=function(t){return(u||(u=i(c,a,mo,f?bo(n):n)))(+t)},r.domain=function(t){return arguments.length?(a=Fg.call(t,go),e()):a.slice()},r.range=function(t){return arguments.length?(c=Ig.call(t),e()):c.slice()},r.rangeRound=function(t){return c=Ig.call(t),s=sr,e()},r.clamp=function(t){return arguments.length?(f=!!t,e()):f},r.interpolate=function(t){return arguments.length?(s=t,e()):s},e()}function No(n,e,r){var i,o=n[0],u=n[n.length-1],a=p(o,u,null==e?10:e);switch(r=ii(null==r?",f":r),r.type){case"s":var c=Math.max(Math.abs(o),Math.abs(u));return null!=r.precision||isNaN(i=fi(a,c))||(r.precision=i),t.formatPrefix(r,c);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=li(a,Math.max(Math.abs(o),Math.abs(u))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=si(a))||(r.precision=i-2*("%"===r.type))}return t.format(r)}function So(t){var n=t.domain;return t.ticks=function(t){var e=n();return h(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return No(n(),t,e)},t.nice=function(e){var r=n(),i=r.length-1,o=null==e?10:e,u=r[0],a=r[i],c=p(u,a,o);return c&&(c=p(Math.floor(u/c)*c,Math.ceil(a/c)*c,o),r[0]=Math.floor(u/c)*c,r[i]=Math.ceil(a/c)*c,n(r)),t},t}function Ao(){var t=ko(mo,rr);return t.copy=function(){return To(t,Ao())},So(t)}function Eo(){function t(t){return+t}var n=[0,1];return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=Fg.call(e,go),t):n.slice()},t.copy=function(){return Eo().domain(n)},So(t)}function Co(t,n){t=t.slice();var e,r=0,i=t.length-1,o=t[r],u=t[i];return u<o&&(e=r,r=i,i=e,e=o,o=u,u=e),t[r]=n.floor(o),t[i]=n.ceil(u),t}function zo(t,n){return(n=Math.log(n/t))?function(e){return Math.log(e/t)/n}:yo(n)}function Po(t,n){return t<0?function(e){return-Math.pow(-n,e)*Math.pow(-t,1-e)}:function(e){return Math.pow(n,e)*Math.pow(t,1-e)}}function qo(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Lo(t){return 10===t?qo:t===Math.E?Math.exp:function(n){return Math.pow(t,n)}}function Ro(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(n){return Math.log(n)/t})}function Uo(t){return function(n){return-t(-n)}}function Do(){function n(){return o=Ro(i),u=Lo(i),r()[0]<0&&(o=Uo(o),u=Uo(u)),e}var e=ko(zo,Po).domain([1,10]),r=e.domain,i=10,o=Ro(10),u=Lo(10);return e.base=function(t){return arguments.length?(i=+t,n()):i},e.domain=function(t){return arguments.length?(r(t),n()):r()},e.ticks=function(t){var n,e=r(),a=e[0],c=e[e.length-1];(n=c<a)&&(p=a,a=c,c=p);var s,f,l,p=o(a),d=o(c),v=null==t?10:+t,_=[];if(!(i%1)&&d-p<v){if(p=Math.round(p)-1,d=Math.round(d)+1,a>0){for(;p<d;++p)for(f=1,s=u(p);f<i;++f)if(l=s*f,!(l<a)){if(l>c)break;_.push(l)}}else for(;p<d;++p)for(f=i-1,s=u(p);f>=1;--f)if(l=s*f,!(l<a)){if(l>c)break;_.push(l)}}else _=h(p,d,Math.min(d-p,v)).map(u);return n?_.reverse():_},e.tickFormat=function(n,r){if(null==r&&(r=10===i?".0e":","),"function"!=typeof r&&(r=t.format(r)),n===1/0)return r;null==n&&(n=10);var a=Math.max(1,i*n/e.ticks().length);return function(t){var n=t/u(Math.round(o(t)));return n*i<i-.5&&(n*=i),n<=a?r(t):""}},e.nice=function(){return r(Co(r(),{floor:function(t){return u(Math.floor(o(t)))},ceil:function(t){return u(Math.ceil(o(t)))}}))},e.copy=function(){return To(e,Do().base(i))},e}function Oo(t,n){return t<0?-Math.pow(-t,n):Math.pow(t,n)}function Fo(){function t(t,n){return(n=Oo(n,e)-(t=Oo(t,e)))?function(r){return(Oo(r,e)-t)/n}:yo(n)}function n(t,n){return n=Oo(n,e)-(t=Oo(t,e)),function(r){return Oo(t+n*r,1/e)}}var e=1,r=ko(t,n),i=r.domain;return r.exponent=function(t){return arguments.length?(e=+t,i(i())):e},r.copy=function(){return To(r,Fo().exponent(e))},So(r)}function Io(){return Fo().exponent(.5)}function Yo(){function t(){var t=0,n=Math.max(1,i.length);for(o=new Array(n-1);++t<n;)o[t-1]=_(r,t/n);return e}function e(t){if(!isNaN(t=+t))return i[Sd(o,t)]}var r=[],i=[],o=[];return e.invertExtent=function(t){var n=i.indexOf(t);return n<0?[NaN,NaN]:[n>0?o[n-1]:r[0],n<o.length?o[n]:r[r.length-1]]},e.domain=function(e){if(!arguments.length)return r.slice();r=[];for(var i,o=0,u=e.length;o<u;++o)i=e[o],null==i||isNaN(i=+i)||r.push(i);return r.sort(n),t()},e.range=function(n){return arguments.length?(i=Ig.call(n),t()):i.slice()},e.quantiles=function(){return o.slice()},e.copy=function(){return Yo().domain(r).range(i)},e}function Bo(){function t(t){if(t<=t)return u[Sd(o,t,0,i)]}function n(){var n=-1;for(o=new Array(i);++n<i;)o[n]=((n+1)*r-(n-i)*e)/(i+1);return t}var e=0,r=1,i=1,o=[.5],u=[0,1];return t.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n()):[e,r]},t.range=function(t){return arguments.length?(i=(u=Ig.call(t)).length-1,n()):u.slice()},t.invertExtent=function(t){var n=u.indexOf(t);return n<0?[NaN,NaN]:n<1?[e,o[0]]:n>=i?[o[i-1],r]:[o[n-1],o[n]]},t.copy=function(){return Bo().domain([e,r]).range(u)},So(t)}function jo(){function t(t){if(t<=t)return e[Sd(n,t,0,r)]}var n=[.5],e=[0,1],r=1;return t.domain=function(i){return arguments.length?(n=Ig.call(i),r=Math.min(n.length,e.length-1),t):n.slice()},t.range=function(i){return arguments.length?(e=Ig.call(i),r=Math.min(n.length,e.length-1),t):e.slice()},t.invertExtent=function(t){var r=e.indexOf(t);return[n[r-1],n[r]]},t.copy=function(){return jo().domain(n).range(e)},t}function Ho(t){return new Date(t)}function Xo(t){return t instanceof Date?+t:+new Date((+t))}function Vo(t,n,r,i,o,u,a,c,s){function f(e){return(a(e)<e?_:u(e)<e?y:o(e)<e?g:i(e)<e?m:n(e)<e?r(e)<e?x:b:t(e)<e?w:M)(e)}function l(n,r,i,o){if(null==n&&(n=10),"number"==typeof n){var u=Math.abs(i-r)/n,a=e(function(t){return t[2]}).right(T,u);a===T.length?(o=p(r/Zg,i/Zg,n),n=t):a?(a=T[u/T[a-1][2]<T[a][2]/u?a-1:a],o=a[1],n=a[0]):(o=p(r,i,n),n=c)}return null==o?n:n.every(o)}var h=ko(mo,rr),d=h.invert,v=h.domain,_=s(".%L"),y=s(":%S"),g=s("%I:%M"),m=s("%I %p"),x=s("%a %d"),b=s("%b %d"),w=s("%B"),M=s("%Y"),T=[[a,1,jg],[a,5,5*jg],[a,15,15*jg],[a,30,30*jg],[u,1,Hg],[u,5,5*Hg],[u,15,15*Hg],[u,30,30*Hg],[o,1,Xg],[o,3,3*Xg],[o,6,6*Xg],[o,12,12*Xg],[i,1,Vg],[i,2,2*Vg],[r,1,Wg],[n,1,$g],[n,3,3*$g],[t,1,Zg]];return h.invert=function(t){return new Date(d(t))},h.domain=function(t){return arguments.length?v(Fg.call(t,Xo)):v().map(Ho)},h.ticks=function(t,n){var e,r=v(),i=r[0],o=r[r.length-1],u=o<i;return u&&(e=i,i=o,o=e),e=l(t,i,o,n),e=e?e.range(i,o+1):[],u?e.reverse():e},h.tickFormat=function(t,n){return null==n?f:s(n)},h.nice=function(t,n){var e=v();return(t=l(t,e[0],e[e.length-1],n))?v(Co(e,t)):h},h.copy=function(){return To(h,Vo(t,n,r,i,o,u,a,c,s))},h}function Wo(){return Vo(Ky,Jy,Dy,Ry,qy,zy,Ey,wy,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])}function $o(){return Vo(Mg,bg,ag,og,rg,ng,Ey,wy,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])}function Zo(t){return t.match(/.{6}/g).map(function(t){return"#"+t})}function Go(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return rm.h=360*t-100,rm.s=1.5-1.5*n,rm.l=.8-.9*n,rm+""}function Jo(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}function Qo(t){function n(n){var o=(n-e)/(r-e);return t(i?Math.max(0,Math.min(1,o)):o)}var e=0,r=1,i=!1;return n.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n):[e,r]},n.clamp=function(t){return arguments.length?(i=!!t,n):i},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Qo(t).domain([e,r]).clamp(i)},So(n)}function Ko(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),sm.hasOwnProperty(n)?{space:sm[n],local:t}:t}function tu(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===cm&&n.documentElement.namespaceURI===cm?n.createElement(t):n.createElementNS(e,t)}}function nu(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function eu(t){var n=Ko(t);return(n.local?nu:tu)(n)}function ru(){return new iu}function iu(){this._="@"+(++fm).toString(36)}function ou(t,n,e){return t=uu(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function uu(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}function au(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),
+t=t.slice(0,e)),{type:t,name:n}})}function cu(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function su(t,n,e){var r=vm.hasOwnProperty(t.type)?ou:uu;return function(i,o,u){var a,c=this.__on,s=r(n,o,u);if(c)for(var f=0,l=c.length;f<l;++f)if((a=c[f]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=s,a.capture=e),void(a.value=n);this.addEventListener(t.type,s,e),a={type:t.type,name:t.name,value:n,listener:s,capture:e},c?c.push(a):this.__on=[a]}}function fu(t,n,e){var r,i,o=au(t+""),u=o.length;{if(!(arguments.length<2)){for(a=n?su:cu,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var c,s=0,f=a.length;s<f;++s)for(r=0,c=a[s];r<u;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value}}function lu(n,e,r,i){var o=t.event;n.sourceEvent=t.event,t.event=n;try{return e.apply(r,i)}finally{t.event=o}}function hu(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e}function pu(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]}function du(t){var n=hu();return n.changedTouches&&(n=n.changedTouches[0]),pu(t,n)}function vu(){}function _u(t){return null==t?vu:function(){return this.querySelector(t)}}function yu(t){"function"!=typeof t&&(t=_u(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],c=a.length,s=r[i]=new Array(c),f=0;f<c;++f)(o=a[f])&&(u=t.call(o,o.__data__,f,a))&&("__data__"in o&&(u.__data__=o.__data__),s[f]=u);return new qa(r,this._parents)}function gu(){return[]}function mu(t){return null==t?gu:function(){return this.querySelectorAll(t)}}function xu(t){"function"!=typeof t&&(t=mu(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],c=a.length,s=0;s<c;++s)(u=a[s])&&(r.push(t.call(u,u.__data__,s,a)),i.push(u));return new qa(r,i)}function bu(t){"function"!=typeof t&&(t=dm(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,c=r[i]=[],s=0;s<a;++s)(o=u[s])&&t.call(o,o.__data__,s,u)&&c.push(o);return new qa(r,this._parents)}function wu(t){return new Array(t.length)}function Mu(){return new qa(this._enter||this._groups.map(wu),this._parents)}function Tu(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function ku(t){return function(){return t}}function Nu(t,n,e,r,i,o){for(var u,a=0,c=n.length,s=o.length;a<s;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new Tu(t,o[a]);for(;a<c;++a)(u=n[a])&&(i[a]=u)}function Su(t,n,e,r,i,o,u){var a,c,s,f={},l=n.length,h=o.length,p=new Array(l);for(a=0;a<l;++a)(c=n[a])&&(p[a]=s=ym+u.call(c,c.__data__,a,n),s in f?i[a]=c:f[s]=c);for(a=0;a<h;++a)s=ym+u.call(t,o[a],a,o),(c=f[s])?(r[a]=c,c.__data__=o[a],f[s]=null):e[a]=new Tu(t,o[a]);for(a=0;a<l;++a)(c=n[a])&&f[p[a]]===c&&(i[a]=c)}function Au(t,n){if(!t)return p=new Array(this.size()),s=-1,this.each(function(t){p[++s]=t}),p;var e=n?Su:Nu,r=this._parents,i=this._groups;"function"!=typeof t&&(t=ku(t));for(var o=i.length,u=new Array(o),a=new Array(o),c=new Array(o),s=0;s<o;++s){var f=r[s],l=i[s],h=l.length,p=t.call(f,f&&f.__data__,s,r),d=p.length,v=a[s]=new Array(d),_=u[s]=new Array(d),y=c[s]=new Array(h);e(f,l,v,_,y,p,n);for(var g,m,x=0,b=0;x<d;++x)if(g=v[x]){for(x>=b&&(b=x+1);!(m=_[b])&&++b<d;);g._next=m||null}}return u=new qa(u,r),u._enter=a,u._exit=c,u}function Eu(){return new qa(this._exit||this._groups.map(wu),this._parents)}function Cu(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var c,s=n[a],f=e[a],l=s.length,h=u[a]=new Array(l),p=0;p<l;++p)(c=s[p]||f[p])&&(h[p]=c);for(;a<r;++a)u[a]=n[a];return new qa(u,this._parents)}function zu(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this}function Pu(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=qu);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],c=a.length,s=i[o]=new Array(c),f=0;f<c;++f)(u=a[f])&&(s[f]=u);s.sort(n)}return new qa(i,this._parents).order()}function qu(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Lu(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ru(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function Uu(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null}function Du(){var t=0;return this.each(function(){++t}),t}function Ou(){return!this.node()}function Fu(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this}function Iu(t){return function(){this.removeAttribute(t)}}function Yu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bu(t,n){return function(){this.setAttribute(t,n)}}function ju(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Hu(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Xu(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Vu(t,n){var e=Ko(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?Yu:Iu:"function"==typeof n?e.local?Xu:Hu:e.local?ju:Bu)(e,n))}function Wu(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function $u(t){return function(){this.style.removeProperty(t)}}function Zu(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Gu(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Ju(t,n,e){var r;return arguments.length>1?this.each((null==n?$u:"function"==typeof n?Gu:Zu)(t,n,null==e?"":e)):Wu(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function Qu(t){return function(){delete this[t]}}function Ku(t,n){return function(){this[t]=n}}function ta(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function na(t,n){return arguments.length>1?this.each((null==n?Qu:"function"==typeof n?ta:Ku)(t,n)):this.node()[t]}function ea(t){return t.trim().split(/^|\s+/)}function ra(t){return t.classList||new ia(t)}function ia(t){this._node=t,this._names=ea(t.getAttribute("class")||"")}function oa(t,n){for(var e=ra(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function ua(t,n){for(var e=ra(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function aa(t){return function(){oa(this,t)}}function ca(t){return function(){ua(this,t)}}function sa(t,n){return function(){(n.apply(this,arguments)?oa:ua)(this,t)}}function fa(t,n){var e=ea(t+"");if(arguments.length<2){for(var r=ra(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?sa:n?aa:ca)(e,n))}function la(){this.textContent=""}function ha(t){return function(){this.textContent=t}}function pa(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function da(t){return arguments.length?this.each(null==t?la:("function"==typeof t?pa:ha)(t)):this.node().textContent}function va(){this.innerHTML=""}function _a(t){return function(){this.innerHTML=t}}function ya(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function ga(t){return arguments.length?this.each(null==t?va:("function"==typeof t?ya:_a)(t)):this.node().innerHTML}function ma(){this.nextSibling&&this.parentNode.appendChild(this)}function xa(){return this.each(ma)}function ba(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function wa(){return this.each(ba)}function Ma(t){var n="function"==typeof t?t:eu(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Ta(){return null}function ka(t,n){var e="function"==typeof t?t:eu(t),r=null==n?Ta:"function"==typeof n?n:_u(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Na(){var t=this.parentNode;t&&t.removeChild(this)}function Sa(){return this.each(Na)}function Aa(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ea(t,n,e){var r=Wu(t),i=r.CustomEvent;i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function Ca(t,n){return function(){return Ea(this,t,n)}}function za(t,n){return function(){return Ea(this,t,n.apply(this,arguments))}}function Pa(t,n){return this.each(("function"==typeof n?za:Ca)(t,n))}function qa(t,n){this._groups=t,this._parents=n}function La(){return new qa([[document.documentElement]],gm)}function Ra(t){return"string"==typeof t?new qa([[document.querySelector(t)]],[document.documentElement]):new qa([[t]],gm)}function Ua(t){return"string"==typeof t?new qa([document.querySelectorAll(t)],[document.documentElement]):new qa([null==t?[]:t],gm)}function Da(t,n,e){arguments.length<3&&(e=n,n=hu().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return pu(t,r);return null}function Oa(t,n){null==n&&(n=hu().touches);for(var e=0,r=n?n.length:0,i=new Array(r);e<r;++e)i[e]=pu(t,n[e]);return i}function Fa(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};ja(t,e,{name:n,index:r,group:i,on:mm,tween:xm,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:bm})}function Ia(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>bm)throw new Error("too late");return e}function Ya(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Mm)throw new Error("too late");return e}function Ba(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function ja(t,n,e){function r(t){e.state=wm,e.delay<=t?i(t-e.delay):e.timer.restart(i,e.delay,e.time)}function i(r){var i,c,s,f;for(i in a)f=a[i],f.name===e.name&&(f.state===Tm?(f.state=Nm,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete a[i]):+i<n&&(f.state=Nm,f.timer.stop(),delete a[i]));if(Wr(function(){e.state===Tm&&(e.timer.restart(o,e.delay,e.time),o(r))}),e.state=Mm,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Mm){for(e.state=Tm,u=new Array(s=e.tween.length),i=0,c=-1;i<s;++i)(f=e.tween[i].value.call(t,t.__data__,e.index,e.group))&&(u[++c]=f);u.length=c+1}}function o(r){for(var i=r<e.duration?e.ease.call(null,r/e.duration):(e.state=km,1),o=-1,c=u.length;++o<c;)u[o].call(null,i);if(e.state===km){e.state=Nm,e.timer.stop(),e.on.call("end",t,t.__data__,e.index,e.group);for(o in a)if(+o!==n)return void delete a[n];delete t.__transition}}var u,a=t.__transition;a[n]=e,e.timer=Yr(r,0,e.time)}function Ha(t,n){var e,r,i,o=t.__transition,u=!0;if(o){n=null==n?null:n+"";for(i in o)(e=o[i]).name===n?(r=e.state===Tm,e.state=Nm,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function Xa(t){return this.each(function(){Ha(this,t)})}function Va(t,n){var e,r;return function(){var i=Ya(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;u<a;++u)if(r[u].name===n){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function Wa(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Ya(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},c=0,s=i.length;c<s;++c)if(i[c].name===n){i[c]=a;break}c===s&&i.push(a)}o.tween=i}}function $a(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Ba(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Va:Wa)(e,t,n))}function Za(t,n,e){var r=t._id;return t.each(function(){var t=Ya(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Ba(t,r).value[n]}}function Ga(t,n){var e;return("number"==typeof n?rr:n instanceof be?S_:(e=be(n))?(n=e,S_):ar)(t,n)}function Ja(t){return function(){this.removeAttribute(t)}}function Qa(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ka(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}}function tc(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}function nc(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttribute(t):(u=this.getAttribute(t),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function ec(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function rc(t,n){var e=Ko(t),r="transform"===e?R_:Ga;return this.attrTween(t,"function"==typeof n?(e.local?ec:nc)(e,r,Za(this,"attr."+t,n)):null==n?(e.local?Qa:Ja)(e):(e.local?tc:Ka)(e,r,n))}function ic(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function oc(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function uc(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Ko(t);return this.tween(e,(r.local?ic:oc)(r,n))}function ac(t,n){return function(){Ia(this,t).delay=+n.apply(this,arguments)}}function cc(t,n){return n=+n,function(){Ia(this,t).delay=n}}function sc(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?ac:cc)(n,t)):Ba(this.node(),n).delay}function fc(t,n){return function(){Ya(this,t).duration=+n.apply(this,arguments)}}function lc(t,n){return n=+n,function(){Ya(this,t).duration=n}}function hc(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?fc:lc)(n,t)):Ba(this.node(),n).duration}function pc(t,n){if("function"!=typeof n)throw new Error;return function(){Ya(this,t).ease=n}}function dc(t){var n=this._id;return arguments.length?this.each(pc(n,t)):Ba(this.node(),n).ease}function vc(t){"function"!=typeof t&&(t=dm(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,c=r[i]=[],s=0;s<a;++s)(o=u[s])&&t.call(o,o.__data__,s,u)&&c.push(o);return new Uc(r,this._parents,this._name,this._id)}function _c(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var c,s=n[a],f=e[a],l=s.length,h=u[a]=new Array(l),p=0;p<l;++p)(c=s[p]||f[p])&&(h[p]=c);for(;a<r;++a)u[a]=n[a];return new Uc(u,this._parents,this._name,this._id)}function yc(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function gc(t,n,e){var r,i,o=yc(n)?Ia:Ya;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function mc(t,n){var e=this._id;return arguments.length<2?Ba(this.node(),e).on.on(t):this.each(gc(e,t,n))}function xc(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function bc(){return this.on("end.remove",xc(this._id))}function wc(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=_u(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,c,s=r[u],f=s.length,l=o[u]=new Array(f),h=0;h<f;++h)(a=s[h])&&(c=t.call(a,a.__data__,h,s))&&("__data__"in a&&(c.__data__=a.__data__),l[h]=c,Fa(l[h],n,e,h,l,Ba(a,e)));return new Uc(o,this._parents,n,e)}function Mc(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=mu(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var c,s=r[a],f=s.length,l=0;l<f;++l)if(c=s[l]){for(var h,p=t.call(c,c.__data__,l,s),d=Ba(c,e),v=0,_=p.length;v<_;++v)(h=p[v])&&Fa(h,n,e,v,p,d);o.push(p),u.push(c)}return new Uc(o,u,n,e)}function Tc(){return new Sm(this._groups,this._parents)}function kc(t,n){var e,r,i;return function(){var o=Wu(this).getComputedStyle(this,null),u=o.getPropertyValue(t),a=(this.style.removeProperty(t),o.getPropertyValue(t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}function Nc(t){return function(){this.style.removeProperty(t)}}function Sc(t,n,e){var r,i;return function(){var o=Wu(this).getComputedStyle(this,null).getPropertyValue(t);return o===e?null:o===r?i:i=n(r=o,e)}}function Ac(t,n,e){var r,i,o;return function(){var u=Wu(this).getComputedStyle(this,null),a=u.getPropertyValue(t),c=e(this);return null==c&&(this.style.removeProperty(t),c=u.getPropertyValue(t)),a===c?null:a===r&&c===i?o:o=n(r=a,i=c)}}function Ec(t,n,e){var r="transform"==(t+="")?L_:Ga;return null==n?this.styleTween(t,kc(t,r)).on("end.style."+t,Nc(t)):this.styleTween(t,"function"==typeof n?Ac(t,r,Za(this,"style."+t,n)):Sc(t,r,n),e)}function Cc(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function zc(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,Cc(t,n,null==e?"":e))}function Pc(t){return function(){this.textContent=t}}function qc(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function Lc(t){return this.tween("text","function"==typeof t?qc(Za(this,"text",t)):Pc(null==t?"":t+""))}function Rc(){for(var t=this._name,n=this._id,e=Oc(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],c=a.length,s=0;s<c;++s)if(u=a[s]){var f=Ba(u,n);Fa(u,t,e,s,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Uc(r,this._parents,t,e)}function Uc(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Dc(t){return La().transition(t)}function Oc(){return++Am}function Fc(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return Cm.time=Or(),Cm;return e}function Ic(t){var n,e;t instanceof Uc?(n=t._id,t=t._name):(n=Oc(),(e=Cm).time=Or(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],c=a.length,s=0;s<c;++s)(u=a[s])&&Fa(u,t,n,s,a,e||Fc(u,n));return new Uc(r,this._parents,t,n)}function Yc(t,n){var e,r,i=t.__transition;if(i){n=null==n?null:n+"";for(r in i)if((e=i[r]).state>wm&&e.name===n)return new Uc([[t]],zm,n,(+r))}return null}function Bc(t){return t}function jc(t,n,e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"}function Hc(t,n,e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"}function Xc(t){var n=t.bandwidth()/2;return function(e){return t(e)+n}}function Vc(){return!this.__axis}function Wc(t,n){function e(e){var s,f=null==i?n.ticks?n.ticks.apply(n,r):n.domain():i,l=null==o?n.tickFormat?n.tickFormat.apply(n,r):Bc:o,h=Math.max(u,0)+c,p=t===qm||t===Rm?jc:Hc,d=n.range(),v=d[0]+.5,_=d[d.length-1]+.5,y=(n.bandwidth?Xc:Bc)(n.copy()),g=e.selection?e.selection():e,m=g.selectAll(".domain").data([null]),x=g.selectAll(".tick").data(f,n).order(),b=x.exit(),w=x.enter().append("g").attr("class","tick"),M=x.select("line"),T=x.select("text"),k=t===qm||t===Um?-1:1,N=t===Um||t===Lm?(s="x","y"):(s="y","x");m=m.merge(m.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),x=x.merge(w),M=M.merge(w.append("line").attr("stroke","#000").attr(s+"2",k*u).attr(N+"1",.5).attr(N+"2",.5)),T=T.merge(w.append("text").attr("fill","#000").attr(s,k*h).attr(N,.5).attr("dy",t===qm?"0em":t===Rm?".71em":".32em")),e!==g&&(m=m.transition(e),x=x.transition(e),M=M.transition(e),T=T.transition(e),b=b.transition(e).attr("opacity",Dm).attr("transform",function(t){return p(y,this.parentNode.__axis||y,t)}),w.attr("opacity",Dm).attr("transform",function(t){return p(this.parentNode.__axis||y,y,t)})),b.remove(),m.attr("d",t===Um||t==Lm?"M"+k*a+","+v+"H0.5V"+_+"H"+k*a:"M"+v+","+k*a+"V0.5H"+_+"V"+k*a),x.attr("opacity",1).attr("transform",function(t){return p(y,y,t)}),M.attr(s+"2",k*u),T.attr(s,k*h).text(l),g.filter(Vc).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Lm?"start":t===Um?"end":"middle"),g.each(function(){this.__axis=y})}var r=[],i=null,o=null,u=6,a=6,c=3;return e.scale=function(t){return arguments.length?(n=t,e):n},e.ticks=function(){return r=Pm.call(arguments),e},e.tickArguments=function(t){return arguments.length?(r=null==t?[]:Pm.call(t),e):r.slice()},e.tickValues=function(t){return arguments.length?(i=null==t?null:Pm.call(t),e):i&&i.slice()},e.tickFormat=function(t){return arguments.length?(o=t,e):o},e.tickSize=function(t){return arguments.length?(u=a=+t,e):u},e.tickSizeInner=function(t){return arguments.length?(u=+t,e):u},e.tickSizeOuter=function(t){return arguments.length?(a=+t,e):a},e.tickPadding=function(t){return arguments.length?(c=+t,e):c},e}function $c(t){return Wc(qm,t)}function Zc(t){return Wc(Lm,t)}function Gc(t){return Wc(Rm,t)}function Jc(t){return Wc(Um,t)}function Qc(t,n){return t.parent===n.parent?1:2}function Kc(t){return t.reduce(ts,0)/t.length}function ts(t,n){return t+n.x}function ns(t){return 1+t.reduce(es,0)}function es(t,n){return Math.max(t,n.y)}function rs(t){for(var n;n=t.children;)t=n[0];return t}function is(t){for(var n;n=t.children;)t=n[n.length-1];return t}function os(){function t(t){var o,u=0;t.eachAfter(function(t){var e=t.children;e?(t.x=Kc(e),t.y=ns(e)):(t.x=o?u+=n(t,o):0,t.y=0,o=t)});var a=rs(t),c=is(t),s=a.x-n(a,c)/2,f=c.x+n(c,a)/2;return t.eachAfter(i?function(n){n.x=(n.x-t.x)*e,n.y=(t.y-n.y)*r}:function(n){n.x=(n.x-s)/(f-s)*e,n.y=(1-(t.y?n.y/t.y:1))*r})}var n=Qc,e=1,r=1,i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(n){return arguments.length?(i=!1,e=+n[0],r=+n[1],t):i?null:[e,r]},t.nodeSize=function(n){return arguments.length?(i=!0,e=+n[0],r=+n[1],t):i?[e,r]:null},t}function us(t){var n,e,r,i,o=this,u=[o];do for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r<i;++r)u.push(e[r]);while(u.length);return this}function as(t){for(var n,e,r=this,i=[r];r=i.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)i.push(n[e]);return this}function cs(t){for(var n,e,r,i=this,o=[i],u=[];i=o.pop();)if(u.push(i),n=i.children)for(e=0,r=n.length;e<r;++e)o.push(n[e]);for(;i=u.pop();)t(i);return this}function ss(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})}function fs(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})}function ls(t){for(var n=this,e=hs(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r}function hs(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}function ps(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n}function ds(){var t=[];return this.each(function(n){t.push(n)}),t}function vs(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t}function _s(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n}function ys(t,n){var e,r,i,o,u,a=new ws(t),c=+t.value&&(a.value=t.value),s=[a];for(null==n&&(n=ms);e=s.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)s.push(r=e.children[o]=new ws(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(bs)}function gs(){return ys(this).eachBefore(xs)}function ms(t){return t.children}function xs(t){t.data=t.data.data}function bs(t){var n=0;do t.height=n;while((t=t.parent)&&t.height<++n)}function ws(t){this.data=t,this.depth=this.height=0,this.parent=null}function Ms(t){this._=t,this.next=null}function Ts(t){for(var n,e=(t=t.slice()).length,r=null,i=r;e;){var o=new Ms(t[e-1]);i=i?i.next=o:r=o,t[n]=t[--e]}return{head:r,tail:i}}function ks(t){return Ss(Ts(t),[])}function Ns(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r-n.r;return i*i+1e-6>e*e+r*r}function Ss(t,n){var e,r,i,o=null,u=t.head;switch(n.length){case 1:e=As(n[0]);break;case 2:e=Es(n[0],n[1]);break;case 3:e=Cs(n[0],n[1],n[2])}for(;u;)i=u._,r=u.next,e&&Ns(e,i)?o=u:(o?(t.tail=o,o.next=null):t.head=t.tail=null,n.push(i),e=Ss(t,n),n.pop(),t.head?(u.next=t.head,t.head=u):(u.next=null,t.head=t.tail=u),o=t.tail,o.next=r),u=r;return t.tail=o,e}function As(t){return{x:t.x,y:t.y,r:t.r}}function Es(t,n){var e=t.x,r=t.y,i=t.r,o=n.x,u=n.y,a=n.r,c=o-e,s=u-r,f=a-i,l=Math.sqrt(c*c+s*s);return{x:(e+o+c/l*f)/2,y:(r+u+s/l*f)/2,r:(l+i+a)/2}}function Cs(t,n,e){var r=t.x,i=t.y,o=t.r,u=n.x,a=n.y,c=n.r,s=e.x,f=e.y,l=e.r,h=2*(r-u),p=2*(i-a),d=2*(c-o),v=r*r+i*i-o*o-u*u-a*a+c*c,_=2*(r-s),y=2*(i-f),g=2*(l-o),m=r*r+i*i-o*o-s*s-f*f+l*l,x=_*p-h*y,b=(p*m-y*v)/x-r,w=(y*d-p*g)/x,M=(_*v-h*m)/x-i,T=(h*g-_*d)/x,k=w*w+T*T-1,N=2*(b*w+M*T+o),S=b*b+M*M-o*o,A=(-N-Math.sqrt(N*N-4*k*S))/(2*k);return{x:b+w*A+r,y:M+T*A+i,r:A}}function zs(t,n,e){var r=t.x,i=t.y,o=n.r+e.r,u=t.r+e.r,a=n.x-r,c=n.y-i,s=a*a+c*c;if(s){var f=.5+((u*=u)-(o*=o))/(2*s),l=Math.sqrt(Math.max(0,2*o*(u+s)-(u-=s)*u-o*o))/(2*s);e.x=r+f*a+l*c,e.y=i+f*c-l*a}else e.x=r+u,e.y=i}function Ps(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return i*i>e*e+r*r}function qs(t,n,e){var r=t.x-n,i=t.y-e;return r*r+i*i}function Ls(t){this._=t,this.next=null,this.previous=null}function Rs(t){if(!(i=t.length))return 0;var n,e,r,i;if(n=t[0],n.x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;zs(e,n,r=t[2]);var o,u,a,c,s,f,l,h=n.r*n.r,p=e.r*e.r,d=r.r*r.r,v=h+p+d,_=h*n.x+p*e.x+d*r.x,y=h*n.y+p*e.y+d*r.y;n=new Ls(n),e=new Ls(e),r=new Ls(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a<i;++a){if(zs(n._,e._,r=t[a]),r=new Ls(r),(s=n.previous)===(c=e.next)){if(Ps(c._,r._)){n=e,e=c,--a;continue t}}else{f=c._.r,l=s._.r;do if(f<=l){if(Ps(c._,r._)){e=c,n.next=e,e.previous=n,--a;continue t}c=c.next,f+=c._.r}else{if(Ps(s._,r._)){n=s,n.next=e,e.previous=n,--a;continue t}s=s.previous,l+=s._.r}while(c!==s.next)}for(r.previous=n,r.next=e,n.next=e.previous=e=r,v+=d=r._.r*r._.r,_+=d*r._.x,y+=d*r._.y,h=qs(n._,o=_/v,u=y/v);(r=r.next)!==e;)(d=qs(r._,o,u))<h&&(n=r,h=d);e=n.next}for(n=[e._],r=e;(r=r.next)!==e;)n.push(r._);for(r=ks(n),a=0;a<i;++a)n=t[a],n.x-=r.x,n.y-=r.y;return r.r}function Us(t){return Rs(t),t}function Ds(t){return null==t?null:Os(t)}function Os(t){if("function"!=typeof t)throw new Error;return t}function Fs(){return 0}function Is(t){return function(){return t}}function Ys(t){return Math.sqrt(t.value)}function Bs(){function t(t){return t.x=e/2,t.y=r/2,n?t.eachBefore(js(n)).eachAfter(Hs(i,.5)).eachBefore(Xs(1)):t.eachBefore(js(Ys)).eachAfter(Hs(Fs,1)).eachAfter(Hs(i,t.r/Math.min(e,r))).eachBefore(Xs(Math.min(e,r)/(2*t.r))),t}var n=null,e=1,r=1,i=Fs;return t.radius=function(e){return arguments.length?(n=Ds(e),t):n},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i="function"==typeof n?n:Is(+n),t):i},t}function js(t){return function(n){n.children||(n.r=Math.max(0,+t(n)||0))}}function Hs(t,n){return function(e){if(r=e.children){var r,i,o,u=r.length,a=t(e)*n||0;if(a)for(i=0;i<u;++i)r[i].r+=a;if(o=Rs(r),a)for(i=0;i<u;++i)r[i].r-=a;e.r=o+a}}}function Xs(t){return function(n){var e=n.parent;n.r*=t,e&&(n.x=e.x+t*n.x,n.y=e.y+t*n.y)}}function Vs(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ws(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(r-n)/t.value;++a<c;)o=u[a],o.y0=e,o.y1=i,o.x0=n,o.x1=n+=o.value*s}function $s(){function t(t){var u=t.height+1;return t.x0=t.y0=i,t.x1=e,t.y1=r/u,t.eachBefore(n(r,u)),o&&t.eachBefore(Vs),t}function n(t,n){return function(e){e.children&&Ws(e,e.x0,t*(e.depth+1)/n,e.x1,t*(e.depth+2)/n);var r=e.x0,o=e.y0,u=e.x1-i,a=e.y1-i;u<r&&(r=u=(r+u)/2),a<o&&(o=a=(o+a)/2),e.x0=r,e.y0=o,e.x1=u,e.y1=a}}var e=1,r=1,i=0,o=!1;return t.round=function(n){return arguments.length?(o=!!n,t):o},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i=+n,t):i},t}function Zs(t){return t.id}function Gs(t){return t.parentId}function Js(){function t(t){var r,i,o,u,a,c,s,f=t.length,l=new Array(f),h={};for(i=0;i<f;++i)r=t[i],a=l[i]=new ws(r),null!=(c=n(r,i,t))&&(c+="")&&(s=Om+(a.id=c),h[s]=s in h?Im:a);for(i=0;i<f;++i)if(a=l[i],c=e(t[i],i,t),null!=c&&(c+="")){if(u=h[Om+c],!u)throw new Error("missing: "+c);if(u===Im)throw new Error("ambiguous: "+c);u.children?u.children.push(a):u.children=[a],a.parent=u}else{if(o)throw new Error("multiple roots");o=a}if(!o)throw new Error("no root");if(o.parent=Fm,o.eachBefore(function(t){t.depth=t.parent.depth+1,--f}).eachBefore(bs),o.parent=null,f>0)throw new Error("cycle");return o}var n=Zs,e=Gs;return t.id=function(e){return arguments.length?(n=Os(e),t):n},t.parentId=function(n){return arguments.length?(e=Os(n),t):e},t}function Qs(t,n){return t.parent===n.parent?1:2}function Ks(t){var n=t.children;return n?n[0]:t.t}function tf(t){var n=t.children;return n?n[n.length-1]:t.t}function nf(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function ef(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)n=i[o],n.z+=e,n.m+=e,e+=n.s+(r+=n.c)}function rf(t,n,e){return t.a.parent===n.parent?t.a:e}function of(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function uf(t){for(var n,e,r,i,o,u=new of(t,0),a=[u];n=a.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)a.push(e=n.children[i]=new of(r[i],i)),e.parent=n;return(u.parent=new of(null,0)).children=[u],u}function af(){function t(t){var r=uf(t);if(r.eachAfter(n),r.parent.m=-r.z,r.eachBefore(e),c)t.eachBefore(i);else{var s=t,f=t,l=t;t.eachBefore(function(t){t.x<s.x&&(s=t),t.x>f.x&&(f=t),t.depth>l.depth&&(l=t)});var h=s===f?1:o(s,f)/2,p=h-s.x,d=u/(f.x+h+p),v=a/(l.depth||1);t.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}return t}function n(t){var n=t.children,e=t.parent.children,i=t.i?e[t.i-1]:null;if(n){ef(t);var u=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+o(t._,i._),t.m=t.z-u):t.z=u}else i&&(t.z=i.z+o(t._,i._));t.parent.A=r(t,i,t.parent.A||e[0])}function e(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function r(t,n,e){if(n){for(var r,i=t,u=t,a=n,c=i.parent.children[0],s=i.m,f=u.m,l=a.m,h=c.m;a=tf(a),i=Ks(i),a&&i;)c=Ks(c),u=tf(u),u.a=t,r=a.z+l-i.z-s+o(a._,i._),r>0&&(nf(rf(a,t,e),t,r),s+=r,f+=r),l+=a.m,s+=i.m,h+=c.m,f+=u.m;a&&!tf(u)&&(u.t=a,u.m+=l-f),i&&!Ks(c)&&(c.t=i,c.m+=s-h,e=t)}return e}function i(t){t.x*=u,t.y=t.depth*a}var o=Qs,u=1,a=1,c=null;return t.separation=function(n){return arguments.length?(o=n,t):o},t.size=function(n){return arguments.length?(c=!1,u=+n[0],a=+n[1],t):c?null:[u,a]},t.nodeSize=function(n){return arguments.length?(c=!0,u=+n[0],a=+n[1],t):c?[u,a]:null},t}function cf(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(i-e)/t.value;++a<c;)o=u[a],o.x0=n,o.x1=r,o.y0=e,o.y1=e+=o.value*s}function sf(t,n,e,r,i,o){for(var u,a,c,s,f,l,h,p,d,v,_,y,g=[],m=n.children,x=0,b=m.length,w=n.value;x<b;){for(s=i-e,f=o-r,h=p=l=m[x].value,_=Math.max(f/s,s/f)/(w*t),y=l*l*_,v=Math.max(p/y,y/h),c=x+1;c<b;++c){if(l+=a=m[c].value,a<h&&(h=a),a>p&&(p=a),y=l*l*_,d=Math.max(p/y,y/h),d>v){l-=a;break}v=d}g.push(u={value:l,dice:s<f,children:m.slice(x,c)}),u.dice?Ws(u,e,r,i,w?r+=f*l/w:o):cf(u,e,r,w?e+=s*l/w:i,o),w-=l,x=c}return g}function ff(){function t(t){return t.x0=t.y0=0,t.x1=i,t.y1=o,t.eachBefore(n),u=[0],r&&t.eachBefore(Vs),t}function n(t){var n=u[t.depth],r=t.x0+n,i=t.y0+n,o=t.x1-n,h=t.y1-n;
+o<r&&(r=o=(r+o)/2),h<i&&(i=h=(i+h)/2),t.x0=r,t.y0=i,t.x1=o,t.y1=h,t.children&&(n=u[t.depth+1]=a(t)/2,r+=l(t)-n,i+=c(t)-n,o-=s(t)-n,h-=f(t)-n,o<r&&(r=o=(r+o)/2),h<i&&(i=h=(i+h)/2),e(t,r,i,o,h))}var e=Bm,r=!1,i=1,o=1,u=[0],a=Fs,c=Fs,s=Fs,f=Fs,l=Fs;return t.round=function(n){return arguments.length?(r=!!n,t):r},t.size=function(n){return arguments.length?(i=+n[0],o=+n[1],t):[i,o]},t.tile=function(n){return arguments.length?(e=Os(n),t):e},t.padding=function(n){return arguments.length?t.paddingInner(n).paddingOuter(n):t.paddingInner()},t.paddingInner=function(n){return arguments.length?(a="function"==typeof n?n:Is(+n),t):a},t.paddingOuter=function(n){return arguments.length?t.paddingTop(n).paddingRight(n).paddingBottom(n).paddingLeft(n):t.paddingTop()},t.paddingTop=function(n){return arguments.length?(c="function"==typeof n?n:Is(+n),t):c},t.paddingRight=function(n){return arguments.length?(s="function"==typeof n?n:Is(+n),t):s},t.paddingBottom=function(n){return arguments.length?(f="function"==typeof n?n:Is(+n),t):f},t.paddingLeft=function(n){return arguments.length?(l="function"==typeof n?n:Is(+n),t):l},t}function lf(t,n,e,r,i){function o(t,n,e,r,i,u,a){if(t>=n-1){var s=c[t];return s.x0=r,s.y0=i,s.x1=u,s.y1=a,void 0}for(var l=f[t],h=e/2+l,p=t+1,d=n-1;p<d;){var v=p+d>>>1;f[v]<h?p=v+1:d=v}var _=f[p]-l,y=e-_;if(a-i>u-r){var g=(i*y+a*_)/e;o(t,p,_,r,i,u,g),o(p,n,y,r,g,u,a)}else{var m=(r*y+u*_)/e;o(t,p,_,r,i,m,a),o(p,n,y,m,i,u,a)}}var u,a,c=t.children,s=c.length,f=new Array(s+1);for(f[0]=a=u=0;u<s;++u)f[u+1]=a+=c[u].value;o(0,s,t.value,n,e,r,i)}function hf(t,n,e,r,i){(1&t.depth?cf:Ws)(t,n,e,r,i)}function pf(t,n){function e(){var e,i,o=r.length,u=0,a=0;for(e=0;e<o;++e)i=r[e],u+=i.x,a+=i.y;for(u=u/o-t,a=a/o-n,e=0;e<o;++e)i=r[e],i.x-=u,i.y-=a}var r;return null==t&&(t=0),null==n&&(n=0),e.initialize=function(t){r=t},e.x=function(n){return arguments.length?(t=+n,e):t},e.y=function(t){return arguments.length?(n=+t,e):n},e}function df(t){return function(){return t}}function vf(){return 1e-6*(Math.random()-.5)}function _f(t){return t.x+t.vx}function yf(t){return t.y+t.vy}function gf(t){function n(){function t(t,e,r,i,u){var a=t.data,p=t.r,d=l+p;{if(!a)return e>s+d||i<s-d||r>f+d||u<f-d;if(a.index>n){var v=s-a.x-a.vx,_=f-a.y-a.vy,y=v*v+_*_;y<d*d&&(0===v&&(v=vf(),y+=v*v),0===_&&(_=vf(),y+=_*_),y=(d-(y=Math.sqrt(y)))/y*o,c.vx+=(v*=y)*(d=(p*=p)/(h+p)),c.vy+=(_*=y)*d,a.vx-=v*(d=1-d),a.vy-=_*d)}}}for(var n,a,c,s,f,l,h,p=r.length,d=0;d<u;++d)for(a=jt(r,_f,yf).visitAfter(e),n=0;n<p;++n)c=r[n],l=i[n],h=l*l,s=c.x+c.vx,f=c.y+c.vy,a.visit(t)}function e(t){if(t.data)return t.r=i[t.data.index];for(var n=t.r=0;n<4;++n)t[n]&&t[n].r>t.r&&(t.r=t[n].r)}var r,i,o=1,u=1;return"function"!=typeof t&&(t=df(null==t?1:+t)),n.initialize=function(n){var e,o=(r=n).length;for(i=new Array(o),e=0;e<o;++e)i[e]=+t(r[e],e,r)},n.iterations=function(t){return arguments.length?(u=+t,n):u},n.strength=function(t){return arguments.length?(o=+t,n):o},n.radius=function(e){return arguments.length?(t="function"==typeof e?e:df(+e),n):t},n}function mf(t,n){return n}function xf(t){function n(t){return 1/Math.min(s[t.source.index],s[t.target.index])}function e(n){for(var e=0,r=t.length;e<d;++e)for(var i,o,c,s,l,h,p,v=0;v<r;++v)i=t[v],o=i.source,c=i.target,s=c.x+c.vx-o.x-o.vx||vf(),l=c.y+c.vy-o.y-o.vy||vf(),h=Math.sqrt(s*s+l*l),h=(h-a[v])/h*n*u[v],s*=h,l*=h,c.vx-=s*(p=f[v]),c.vy-=l*p,o.vx+=s*(p=1-p),o.vy+=l*p}function r(){if(c){var n,e,r=c.length,h=t.length,p=q(c,l);for(n=0,s=new Array(r);n<r;++n)s[n]=0;for(n=0;n<h;++n)e=t[n],e.index=n,"object"!=typeof e.source&&(e.source=p.get(e.source)),"object"!=typeof e.target&&(e.target=p.get(e.target)),++s[e.source.index],++s[e.target.index];for(n=0,f=new Array(h);n<h;++n)e=t[n],f[n]=s[e.source.index]/(s[e.source.index]+s[e.target.index]);u=new Array(h),i(),a=new Array(h),o()}}function i(){if(c)for(var n=0,e=t.length;n<e;++n)u[n]=+h(t[n],n,t)}function o(){if(c)for(var n=0,e=t.length;n<e;++n)a[n]=+p(t[n],n,t)}var u,a,c,s,f,l=mf,h=n,p=df(30),d=1;return null==t&&(t=[]),e.initialize=function(t){c=t,r()},e.links=function(n){return arguments.length?(t=n,r(),e):t},e.id=function(t){return arguments.length?(l=t,e):l},e.iterations=function(t){return arguments.length?(d=+t,e):d},e.strength=function(t){return arguments.length?(h="function"==typeof t?t:df(+t),i(),e):h},e.distance=function(t){return arguments.length?(p="function"==typeof t?t:df(+t),o(),e):p},e}function bf(t){return t.x}function wf(t){return t.y}function Mf(t){function n(){e(),p.call("tick",o),u<a&&(h.stop(),p.call("end",o))}function e(){var n,e,r=t.length;for(u+=(s-u)*c,l.each(function(t){t(u)}),n=0;n<r;++n)e=t[n],null==e.fx?e.x+=e.vx*=f:(e.x=e.fx,e.vx=0),null==e.fy?e.y+=e.vy*=f:(e.y=e.fy,e.vy=0)}function r(){for(var n,e=0,r=t.length;e<r;++e){if(n=t[e],n.index=e,isNaN(n.x)||isNaN(n.y)){var i=Hm*Math.sqrt(e),o=e*Xm;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function i(n){return n.initialize&&n.initialize(t),n}var o,u=1,a=.001,c=1-Math.pow(a,1/300),s=0,f=.6,l=q(),h=Yr(n),p=Mr("tick","end");return null==t&&(t=[]),r(),o={tick:e,restart:function(){return h.restart(n),o},stop:function(){return h.stop(),o},nodes:function(n){return arguments.length?(t=n,r(),l.each(i),o):t},alpha:function(t){return arguments.length?(u=+t,o):u},alphaMin:function(t){return arguments.length?(a=+t,o):a},alphaDecay:function(t){return arguments.length?(c=+t,o):+c},alphaTarget:function(t){return arguments.length?(s=+t,o):s},velocityDecay:function(t){return arguments.length?(f=1-t,o):1-f},force:function(t,n){return arguments.length>1?(null==n?l.remove(t):l.set(t,i(n)),o):l.get(t)},find:function(n,e,r){var i,o,u,a,c,s=0,f=t.length;for(null==r?r=1/0:r*=r,s=0;s<f;++s)a=t[s],i=n-a.x,o=e-a.y,u=i*i+o*o,u<r&&(c=a,r=u);return c},on:function(t,n){return arguments.length>1?(p.on(t,n),o):p.on(t)}}}function Tf(){function t(t){var n,a=i.length,c=jt(i,bf,wf).visitAfter(e);for(u=t,n=0;n<a;++n)o=i[n],c.visit(r)}function n(){if(i){var t,n=i.length;for(a=new Array(n),t=0;t<n;++t)a[t]=+c(i[t],t,i)}}function e(t){var n,e,r,i,o,u=0;if(t.length){for(r=i=o=0;o<4;++o)(n=t[o])&&(e=n.value)&&(u+=e,r+=e*n.x,i+=e*n.y);t.x=r/u,t.y=i/u}else{n=t,n.x=n.data.x,n.y=n.data.y;do u+=a[n.data.index];while(n=n.next)}t.value=u}function r(t,n,e,r){if(!t.value)return!0;var i=t.x-o.x,c=t.y-o.y,h=r-n,p=i*i+c*c;if(h*h/l<p)return p<f&&(0===i&&(i=vf(),p+=i*i),0===c&&(c=vf(),p+=c*c),p<s&&(p=Math.sqrt(s*p)),o.vx+=i*t.value*u/p,o.vy+=c*t.value*u/p),!0;if(!(t.length||p>=f)){(t.data!==o||t.next)&&(0===i&&(i=vf(),p+=i*i),0===c&&(c=vf(),p+=c*c),p<s&&(p=Math.sqrt(s*p)));do t.data!==o&&(h=a[t.data.index]*u/p,o.vx+=i*h,o.vy+=c*h);while(t=t.next)}}var i,o,u,a,c=df(-30),s=1,f=1/0,l=.81;return t.initialize=function(t){i=t,n()},t.strength=function(e){return arguments.length?(c="function"==typeof e?e:df(+e),n(),t):c},t.distanceMin=function(n){return arguments.length?(s=n*n,t):Math.sqrt(s)},t.distanceMax=function(n){return arguments.length?(f=n*n,t):Math.sqrt(f)},t.theta=function(n){return arguments.length?(l=n*n,t):Math.sqrt(l)},t}function kf(t){function n(t){for(var n,e=0,u=r.length;e<u;++e)n=r[e],n.vx+=(o[e]-n.x)*i[e]*t}function e(){if(r){var n,e=r.length;for(i=new Array(e),o=new Array(e),n=0;n<e;++n)i[n]=isNaN(o[n]=+t(r[n],n,r))?0:+u(r[n],n,r)}}var r,i,o,u=df(.1);return"function"!=typeof t&&(t=df(null==t?0:+t)),n.initialize=function(t){r=t,e()},n.strength=function(t){return arguments.length?(u="function"==typeof t?t:df(+t),e(),n):u},n.x=function(r){return arguments.length?(t="function"==typeof r?r:df(+r),e(),n):t},n}function Nf(t){function n(t){for(var n,e=0,u=r.length;e<u;++e)n=r[e],n.vy+=(o[e]-n.y)*i[e]*t}function e(){if(r){var n,e=r.length;for(i=new Array(e),o=new Array(e),n=0;n<e;++n)i[n]=isNaN(o[n]=+t(r[n],n,r))?0:+u(r[n],n,r)}}var r,i,o,u=df(.1);return"function"!=typeof t&&(t=df(null==t?0:+t)),n.initialize=function(t){r=t,e()},n.strength=function(t){return arguments.length?(u="function"==typeof t?t:df(+t),e(),n):u},n.y=function(r){return arguments.length?(t="function"==typeof r?r:df(+r),e(),n):t},n}function Sf(){t.event.stopImmediatePropagation()}function Af(){t.event.preventDefault(),t.event.stopImmediatePropagation()}function Ef(t){var n=t.document.documentElement,e=Ra(t).on("dragstart.drag",Af,!0);"onselectstart"in n?e.on("selectstart.drag",Af,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Cf(t,n){var e=t.document.documentElement,r=Ra(t).on("dragstart.drag",null);n&&(r.on("click.drag",Af,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function zf(t){return function(){return t}}function Pf(t,n,e,r,i,o,u,a,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=u,this.dx=a,this.dy=c,this._=s}function qf(){return!t.event.button}function Lf(){return this.parentNode}function Rf(n){return null==n?{x:t.event.x,y:t.event.y}:n}function Uf(){function n(t){t.on("mousedown.drag",e).on("touchstart.drag",o).on("touchmove.drag",u).on("touchend.drag touchcancel.drag",a).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function e(){if(!f&&l.apply(this,arguments)){var n=c("mouse",h.apply(this,arguments),du,this,arguments);n&&(Ra(t.event.view).on("mousemove.drag",r,!0).on("mouseup.drag",i,!0),Ef(t.event.view),Sf(),s=!1,n("start"))}}function r(){Af(),s=!0,d.mouse("drag")}function i(){Ra(t.event.view).on("mousemove.drag mouseup.drag",null),Cf(t.event.view,s),Af(),d.mouse("end")}function o(){if(l.apply(this,arguments)){var n,e,r=t.event.changedTouches,i=h.apply(this,arguments),o=r.length;for(n=0;n<o;++n)(e=c(r[n].identifier,i,Da,this,arguments))&&(Sf(),e("start"))}}function u(){var n,e,r=t.event.changedTouches,i=r.length;for(n=0;n<i;++n)(e=d[r[n].identifier])&&(Af(),e("drag"))}function a(){var n,e,r=t.event.changedTouches,i=r.length;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),n=0;n<i;++n)(e=d[r[n].identifier])&&(Sf(),e("end"))}function c(e,r,i,o,u){var a,c,s,f=i(r,e),l=v.copy();if(lu(new Pf(n,"beforestart",a,e,_,f[0],f[1],0,0,l),function(){return null!=(t.event.subject=a=p.apply(o,u))&&(c=a.x-f[0]||0,s=a.y-f[1]||0,!0)}))return function t(h){var p,v=f;switch(h){case"start":d[e]=t,p=_++;break;case"end":delete d[e],--_;case"drag":f=i(r,e),p=_}lu(new Pf(n,h,a,e,p,f[0]+c,f[1]+s,f[0]-v[0],f[1]-v[1],l),l.apply,l,[h,o,u])}}var s,f,l=qf,h=Lf,p=Rf,d={},v=Mr("start","drag","end"),_=0;return n.filter=function(t){return arguments.length?(l="function"==typeof t?t:zf(!!t),n):l},n.container=function(t){return arguments.length?(h="function"==typeof t?t:zf(t),n):h},n.subject=function(t){return arguments.length?(p="function"==typeof t?t:zf(t),n):p},n.on=function(){var t=v.on.apply(v,arguments);return t===v?n:t},n}function Df(t){return function(){return t}}function Of(t){return t[0]}function Ff(t){return t[1]}function If(){this._=null}function Yf(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Bf(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function jf(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Hf(t){for(;t.L;)t=t.L;return t}function Xf(t,n,e,r){var i=[null,null],o=Gm.push(i)-1;return i.left=t,i.right=n,e&&Wf(i,t,n,e),r&&Wf(i,n,t,r),$m[t.index].halfedges.push(o),$m[n.index].halfedges.push(o),i}function Vf(t,n,e){var r=[n,e];return r.left=t,r}function Wf(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function $f(t,n,e,r,i){var o,u=t[0],a=t[1],c=u[0],s=u[1],f=a[0],l=a[1],h=0,p=1,d=f-c,v=l-s;if(o=n-c,d||!(o>0)){if(o/=d,d<0){if(o<h)return;o<p&&(p=o)}else if(d>0){if(o>p)return;o>h&&(h=o)}if(o=r-c,d||!(o<0)){if(o/=d,d<0){if(o>p)return;o>h&&(h=o)}else if(d>0){if(o<h)return;o<p&&(p=o)}if(o=e-s,v||!(o>0)){if(o/=v,v<0){if(o<h)return;o<p&&(p=o)}else if(v>0){if(o>p)return;o>h&&(h=o)}if(o=i-s,v||!(o<0)){if(o/=v,v<0){if(o>p)return;o>h&&(h=o)}else if(v>0){if(o<h)return;o<p&&(p=o)}return!(h>0||p<1)||(h>0&&(t[0]=[c+h*d,s+h*v]),p<1&&(t[1]=[c+p*d,s+p*v]),!0)}}}}}function Zf(t,n,e,r,i){var o=t[1];if(o)return!0;var u,a,c=t[0],s=t.left,f=t.right,l=s[0],h=s[1],p=f[0],d=f[1],v=(l+p)/2,_=(h+d)/2;if(d===h){if(v<n||v>=r)return;if(l>p){if(c){if(c[1]>=i)return}else c=[v,e];o=[v,i]}else{if(c){if(c[1]<e)return}else c=[v,i];o=[v,e]}}else if(u=(l-p)/(d-h),a=_-u*v,u<-1||u>1)if(l>p){if(c){if(c[1]>=i)return}else c=[(e-a)/u,e];o=[(i-a)/u,i]}else{if(c){if(c[1]<e)return}else c=[(i-a)/u,i];o=[(e-a)/u,e]}else if(h<d){if(c){if(c[0]>=r)return}else c=[n,u*n+a];o=[r,u*r+a]}else{if(c){if(c[0]<n)return}else c=[r,u*r+a];o=[n,u*n+a]}return t[0]=c,t[1]=o,!0}function Gf(t,n,e,r){for(var i,o=Gm.length;o--;)Zf(i=Gm[o],t,n,e,r)&&$f(i,t,n,e,r)&&(Math.abs(i[0][0]-i[1][0])>Km||Math.abs(i[0][1]-i[1][1])>Km)||delete Gm[o]}function Jf(t){return $m[t.index]={site:t,halfedges:[]}}function Qf(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Kf(t,n){return n[+(n.left!==t.site)]}function tl(t,n){return n[+(n.left===t.site)]}function nl(){for(var t,n,e,r,i=0,o=$m.length;i<o;++i)if((t=$m[i])&&(r=(n=t.halfedges).length)){var u=new Array(r),a=new Array(r);for(e=0;e<r;++e)u[e]=e,a[e]=Qf(t,Gm[n[e]]);for(u.sort(function(t,n){return a[n]-a[t]}),e=0;e<r;++e)a[e]=n[u[e]];for(e=0;e<r;++e)n[e]=a[e]}}function el(t,n,e,r){var i,o,u,a,c,s,f,l,h,p,d,v,_=$m.length,y=!0;for(i=0;i<_;++i)if(o=$m[i]){for(u=o.site,c=o.halfedges,a=c.length;a--;)Gm[c[a]]||c.splice(a,1);for(a=0,s=c.length;a<s;)p=tl(o,Gm[c[a]]),d=p[0],v=p[1],f=Kf(o,Gm[c[++a%s]]),l=f[0],h=f[1],(Math.abs(d-l)>Km||Math.abs(v-h)>Km)&&(c.splice(a,0,Gm.push(Vf(u,p,Math.abs(d-t)<Km&&r-v>Km?[t,Math.abs(l-t)<Km?h:r]:Math.abs(v-r)<Km&&e-d>Km?[Math.abs(h-r)<Km?l:e,r]:Math.abs(d-e)<Km&&v-n>Km?[e,Math.abs(l-e)<Km?h:n]:Math.abs(v-n)<Km&&d-t>Km?[Math.abs(h-n)<Km?l:t,n]:null))-1),++s);s&&(y=!1)}if(y){var g,m,x,b=1/0;for(i=0,y=null;i<_;++i)(o=$m[i])&&(u=o.site,g=u[0]-t,m=u[1]-n,x=g*g+m*m,x<b&&(b=x,y=o));if(y){var w=[t,n],M=[t,r],T=[e,r],k=[e,n];y.halfedges.push(Gm.push(Vf(u=y.site,w,M))-1,Gm.push(Vf(u,M,T))-1,Gm.push(Vf(u,T,k))-1,Gm.push(Vf(u,k,w))-1)}}for(i=0;i<_;++i)(o=$m[i])&&(o.halfedges.length||delete $m[i])}function rl(){Yf(this),this.x=this.y=this.arc=this.site=this.cy=null}function il(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,o=e.site;if(r!==o){var u=i[0],a=i[1],c=r[0]-u,s=r[1]-a,f=o[0]-u,l=o[1]-a,h=2*(c*l-s*f);if(!(h>=-tx)){var p=c*c+s*s,d=f*f+l*l,v=(l*p-s*d)/h,_=(c*d-f*p)/h,y=Jm.pop()||new rl;y.arc=t,y.site=i,y.x=v+u,y.y=(y.cy=_+a)+Math.sqrt(v*v+_*_),t.circle=y;for(var g=null,m=Zm._;m;)if(y.y<m.y||y.y===m.y&&y.x<=m.x){if(!m.L){g=m.P;break}m=m.L}else{if(!m.R){g=m;break}m=m.R}Zm.insert(g,y),g||(Vm=y)}}}}function ol(t){var n=t.circle;n&&(n.P||(Vm=n.N),Zm.remove(n),Jm.push(n),Yf(n),t.circle=null)}function ul(){Yf(this),this.edge=this.site=this.circle=null}function al(t){var n=Qm.pop()||new ul;return n.site=t,n}function cl(t){ol(t),Wm.remove(t),Qm.push(t),Yf(t)}function sl(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],o=t.P,u=t.N,a=[t];cl(t);for(var c=o;c.circle&&Math.abs(e-c.circle.x)<Km&&Math.abs(r-c.circle.cy)<Km;)o=c.P,a.unshift(c),cl(c),c=o;a.unshift(c),ol(c);for(var s=u;s.circle&&Math.abs(e-s.circle.x)<Km&&Math.abs(r-s.circle.cy)<Km;)u=s.N,a.push(s),cl(s),s=u;a.push(s),ol(s);var f,l=a.length;for(f=1;f<l;++f)s=a[f],c=a[f-1],Wf(s.edge,c.site,s.site,i);c=a[0],s=a[l-1],s.edge=Xf(c.site,s.site,null,i),il(c),il(s)}function fl(t){for(var n,e,r,i,o=t[0],u=t[1],a=Wm._;a;)if(r=ll(a,u)-o,r>Km)a=a.L;else{if(i=o-hl(a,u),!(i>Km)){r>-Km?(n=a.P,e=a):i>-Km?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}Jf(t);var c=al(t);if(Wm.insert(n,c),n||e){if(n===e)return ol(n),e=al(n.site),Wm.insert(c,e),c.edge=e.edge=Xf(n.site,c.site),il(n),void il(e);if(!e)return void(c.edge=Xf(n.site,c.site));ol(n),ol(e);var s=n.site,f=s[0],l=s[1],h=t[0]-f,p=t[1]-l,d=e.site,v=d[0]-f,_=d[1]-l,y=2*(h*_-p*v),g=h*h+p*p,m=v*v+_*_,x=[(_*g-p*m)/y+f,(h*m-v*g)/y+l];Wf(e.edge,s,d,x),c.edge=Xf(s,t,null,x),e.edge=Xf(t,d,null,x),il(n),il(e)}}function ll(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var u=t.P;if(!u)return-(1/0);e=u.site;var a=e[0],c=e[1],s=c-n;if(!s)return a;var f=a-r,l=1/o-1/s,h=f/s;return l?(-h+Math.sqrt(h*h-2*l*(f*f/(-2*s)-c+s/2+i-o/2)))/l+r:(r+a)/2}function hl(t,n){var e=t.N;if(e)return ll(e,n);var r=t.site;return r[1]===n?r[0]:1/0}function pl(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function dl(t,n){return n[1]-t[1]||n[0]-t[0]}function vl(t,n){var e,r,i,o=t.sort(dl).pop();for(Gm=[],$m=new Array(t.length),Wm=new If,Zm=new If;;)if(i=Vm,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===e&&o[1]===r||(fl(o),e=o[0],r=o[1]),o=t.pop();else{if(!i)break;sl(i.arc)}if(nl(),n){var u=+n[0][0],a=+n[0][1],c=+n[1][0],s=+n[1][1];Gf(u,a,c,s),el(u,a,c,s)}this.edges=Gm,this.cells=$m,Wm=Zm=Gm=$m=null}function _l(){function t(t){return new vl(t.map(function(r,i){var o=[Math.round(n(r,i,t)/Km)*Km,Math.round(e(r,i,t)/Km)*Km];return o.index=i,o.data=r,o}),r)}var n=Of,e=Ff,r=null;return t.polygons=function(n){return t(n).polygons()},t.links=function(n){return t(n).links()},t.triangles=function(n){return t(n).triangles()},t.x=function(e){return arguments.length?(n="function"==typeof e?e:Df(+e),t):n},t.y=function(n){return arguments.length?(e="function"==typeof n?n:Df(+n),t):e},t.extent=function(n){return arguments.length?(r=null==n?null:[[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]],t):r&&[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},t.size=function(n){return arguments.length?(r=null==n?null:[[0,0],[+n[0],+n[1]]],t):r&&[r[1][0]-r[0][0],r[1][1]-r[0][1]]},t}function yl(t){return function(){return t}}function gl(t,n,e){this.target=t,this.type=n,this.transform=e}function ml(t,n,e){this.k=t,this.x=n,this.y=e}function xl(t){return t.__zoom||nx}function bl(){t.event.stopImmediatePropagation()}function wl(){t.event.preventDefault(),t.event.stopImmediatePropagation()}function Ml(){return!t.event.button}function Tl(){var t,n,e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,t=e.width.baseVal.value,n=e.height.baseVal.value):(t=e.clientWidth,n=e.clientHeight),[[0,0],[t,n]]}function kl(){return this.__zoom||nx}function Nl(){function n(t){t.on("wheel.zoom",s).on("mousedown.zoom",f).on("dblclick.zoom",l).on("touchstart.zoom",h).on("touchmove.zoom",p).on("touchend.zoom touchcancel.zoom",d).style("-webkit-tap-highlight-color","rgba(0,0,0,0)").property("__zoom",kl)}function e(t,n){return n=Math.max(m,Math.min(x,n)),n===t.k?t:new ml(n,t.x,t.y)}function r(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ml(t.k,r,i)}function i(t,n){var e=Math.min(0,t.invertX(n[0][0])-b)||Math.max(0,t.invertX(n[1][0])-w),r=Math.min(0,t.invertY(n[0][1])-M)||Math.max(0,t.invertY(n[1][1])-T);return e||r?t.translate(e,r):t}function o(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function u(t,n,e){t.on("start.zoom",function(){a(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){a(this,arguments).end()}).tween("zoom",function(){var t=this,r=arguments,i=a(t,r),u=g.apply(t,r),c=e||o(u),s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,l="function"==typeof n?n.apply(t,r):n,h=yr(f.invert(c).concat(s/f.k),l.invert(c).concat(s/l.k));return function(t){if(1===t)t=l;else{var n=h(t),e=s/n[2];t=new ml(e,c[0]-n[0]*e,c[1]-n[1]*e)}i.zoom(null,t)}})}function a(t,n){for(var e,r=0,i=N.length;r<i;++r)if((e=N[r]).that===t)return e;return new c(t,n)}function c(t,n){this.that=t,this.args=n,this.index=-1,this.active=0,this.extent=g.apply(t,n)}function s(){function n(){o.wheel=null,o.end()}if(y.apply(this,arguments)){var o=a(this,arguments),u=this.__zoom,c=Math.max(m,Math.min(x,u.k*Math.pow(2,-t.event.deltaY*(t.event.deltaMode?120:1)/500))),s=du(this);if(o.wheel)o.mouse[0][0]===s[0]&&o.mouse[0][1]===s[1]||(o.mouse[1]=u.invert(o.mouse[0]=s)),clearTimeout(o.wheel);else{if(u.k===c)return;o.mouse=[s,u.invert(s)],Ha(this),o.start()}wl(),o.wheel=setTimeout(n,E),o.zoom("mouse",i(r(e(u,c),o.mouse[0],o.mouse[1]),o.extent))}}function f(){function n(){wl(),o.moved=!0,o.zoom("mouse",i(r(o.that.__zoom,o.mouse[0]=du(o.that),o.mouse[1]),o.extent))}function e(){u.on("mousemove.zoom mouseup.zoom",null),Cf(t.event.view,o.moved),wl(),o.end()}if(!_&&y.apply(this,arguments)){var o=a(this,arguments),u=Ra(t.event.view).on("mousemove.zoom",n,!0).on("mouseup.zoom",e,!0),c=du(this);Ef(t.event.view),bl(),o.mouse=[c,this.__zoom.invert(c)],Ha(this),o.start()}}function l(){if(y.apply(this,arguments)){var o=this.__zoom,a=du(this),c=o.invert(a),s=o.k*(t.event.shiftKey?.5:2),f=i(r(e(o,s),a,c),g.apply(this,arguments));wl(),k>0?Ra(this).transition().duration(k).call(u,f,a):Ra(this).call(n.transform,f)}}function h(){if(y.apply(this,arguments)){var n,e,r,i=a(this,arguments),o=t.event.changedTouches,u=o.length;for(bl(),n=0;n<u;++n)e=o[n],r=Da(this,o,e.identifier),r=[r,this.__zoom.invert(r),e.identifier],i.touch0?i.touch1||(i.touch1=r):i.touch0=r;return v&&(v=clearTimeout(v),!i.touch1)?(i.end(),l.apply(this,arguments)):void(t.event.touches.length===u&&(v=setTimeout(function(){v=null},A),Ha(this),i.start()))}}function p(){var n,o,u,c,s=a(this,arguments),f=t.event.changedTouches,l=f.length;for(wl(),v&&(v=clearTimeout(v)),n=0;n<l;++n)o=f[n],u=Da(this,f,o.identifier),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=u:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=u);if(o=s.that.__zoom,s.touch1){var h=s.touch0[0],p=s.touch0[1],d=s.touch1[0],_=s.touch1[1],y=(y=d[0]-h[0])*y+(y=d[1]-h[1])*y,g=(g=_[0]-p[0])*g+(g=_[1]-p[1])*g;o=e(o,Math.sqrt(y/g)),u=[(h[0]+d[0])/2,(h[1]+d[1])/2],c=[(p[0]+_[0])/2,(p[1]+_[1])/2]}else{if(!s.touch0)return;u=s.touch0[0],c=s.touch0[1]}s.zoom("touch",i(r(o,u,c),s.extent))}function d(){var n,e,r=a(this,arguments),i=t.event.changedTouches,o=i.length;for(bl(),_&&clearTimeout(_),_=setTimeout(function(){_=null},A),n=0;n<o;++n)e=i[n],r.touch0&&r.touch0[2]===e.identifier?delete r.touch0:r.touch1&&r.touch1[2]===e.identifier&&delete r.touch1;r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0||r.end()}var v,_,y=Ml,g=Tl,m=0,x=1/0,b=-x,w=x,M=b,T=w,k=250,N=[],S=Mr("start","zoom","end"),A=500,E=150;return n.transform=function(t,n){var e=t.selection?t.selection():t;e.property("__zoom",kl),t!==e?u(t,n):e.interrupt().each(function(){a(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()})},n.scaleBy=function(t,e){n.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n})},n.scaleTo=function(t,u){n.transform(t,function(){var t=g.apply(this,arguments),n=this.__zoom,a=o(t),c=n.invert(a),s="function"==typeof u?u.apply(this,arguments):u;return i(r(e(n,s),a,c),t)})},n.translateBy=function(t,e,r){n.transform(t,function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof r?r.apply(this,arguments):r),g.apply(this,arguments))})},c.prototype={start:function(){return 1===++this.active&&(this.index=N.push(this)-1,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0===--this.active&&(N.splice(this.index,1),this.index=-1,this.emit("end")),this},emit:function(t){lu(new gl(n,t,this.that.__zoom),S.apply,S,[t,this.that,this.args])}},n.filter=function(t){return arguments.length?(y="function"==typeof t?t:yl(!!t),n):y},n.extent=function(t){return arguments.length?(g="function"==typeof t?t:yl([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),n):g},n.scaleExtent=function(t){return arguments.length?(m=+t[0],x=+t[1],n):[m,x]},n.translateExtent=function(t){return arguments.length?(b=+t[0][0],w=+t[1][0],M=+t[0][1],T=+t[1][1],n):[[b,M],[w,T]]},n.duration=function(t){return arguments.length?(k=+t,n):k},n.on=function(){var t=S.on.apply(S,arguments);return t===S?n:t},n}function Sl(t){return function(){return t}}function Al(t,n,e){this.target=t,this.type=n,this.selection=e}function El(){t.event.stopImmediatePropagation()}function Cl(){t.event.preventDefault(),t.event.stopImmediatePropagation()}function zl(t){return{type:t}}function Pl(){return!t.event.button}function ql(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ll(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Rl(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ul(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Dl(){return Il(ux)}function Ol(){return Il(ax)}function Fl(){return Il(cx)}function Il(n){function e(t){var e=t.property("__brush",a).selectAll(".overlay").data([zl("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",sx.overlay).merge(e).each(function(){var t=Ll(this).extent;Ra(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),t.selectAll(".selection").data([zl("selection")]).enter().append("rect").attr("class","selection").attr("cursor",sx.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=t.selectAll(".handle").data(n.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return sx[t.type]}),t.each(r).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",u)}function r(){var t=Ra(this),n=Ll(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?n[1][0]-h/2:n[0][0]-h/2}).attr("y",function(t){return"s"===t.type[0]?n[1][1]-h/2:n[0][1]-h/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+h:h}).attr("height",function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+h:h})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function i(t,n){return t.__brush.emitter||new o(t,n)}function o(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function u(){function e(){var t=du(T);!U||w||M||(Math.abs(t[0]-O[0])>Math.abs(t[1]-O[1])?M=!0:w=!0),O=t,b=!0,Cl(),o()}function o(){var t;switch(m=O[0]-D[0],x=O[1]-D[1],N){case rx:case ex:S&&(m=Math.max(P-l,Math.min(L-v,m)),h=l+m,_=v+m),A&&(x=Math.max(q-p,Math.min(R-y,x)),d=p+x,g=y+x);break;case ix:S<0?(m=Math.max(P-l,Math.min(L-l,m)),h=l+m,_=v):S>0&&(m=Math.max(P-v,Math.min(L-v,m)),h=l,_=v+m),A<0?(x=Math.max(q-p,Math.min(R-p,x)),d=p+x,g=y):A>0&&(x=Math.max(q-y,Math.min(R-y,x)),d=p,g=y+x);break;case ox:S&&(h=Math.max(P,Math.min(L,l-m*S)),_=Math.max(P,Math.min(L,v+m*S))),A&&(d=Math.max(q,Math.min(R,p-x*A)),g=Math.max(q,Math.min(R,y+x*A)))}_<h&&(S*=-1,t=l,l=v,v=t,t=h,h=_,_=t,k in fx&&Y.attr("cursor",sx[k=fx[k]])),g<d&&(A*=-1,t=p,p=y,y=t,t=d,d=g,g=t,k in lx&&Y.attr("cursor",sx[k=lx[k]])),z=E.selection,w&&(h=z[0][0],_=z[1][0]),M&&(d=z[0][1],g=z[1][1]),z[0][0]===h&&z[0][1]===d&&z[1][0]===_&&z[1][1]===g||(E.selection=[[h,d],[_,g]],r.call(T),F.brush())}function u(){if(El(),t.event.touches){if(t.event.touches.length)return;c&&clearTimeout(c),c=setTimeout(function(){c=null},500),I.on("touchmove.brush touchend.brush touchcancel.brush",null)}else Cf(t.event.view,b),B.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);I.attr("pointer-events","all"),Y.attr("cursor",sx.overlay),Rl(z)&&(E.selection=null,r.call(T)),F.end()}function a(){switch(t.event.keyCode){case 16:U=S&&A;break;case 18:N===ix&&(S&&(v=_-m*S,l=h+m*S),A&&(y=g-x*A,p=d+x*A),N=ox,o());break;case 32:N!==ix&&N!==ox||(S<0?v=_-m:S>0&&(l=h-m),A<0?y=g-x:A>0&&(p=d-x),N=rx,Y.attr("cursor",sx.selection),o());break;default:return}Cl()}function s(){switch(t.event.keyCode){case 16:U&&(w=M=U=!1,o());break;case 18:N===ox&&(S<0?v=_:S>0&&(l=h),A<0?y=g:A>0&&(p=d),N=ix,o());break;case 32:N===rx&&(t.event.altKey?(S&&(v=_-m*S,l=h+m*S),A&&(y=g-x*A,p=d+x*A),N=ox):(S<0?v=_:S>0&&(l=h),A<0?y=g:A>0&&(p=d),N=ix),Y.attr("cursor",sx[k]),o());break;default:return}Cl()}if(t.event.touches){if(t.event.changedTouches.length<t.event.touches.length)return Cl()}else if(c)return;if(f.apply(this,arguments)){var l,h,p,d,v,_,y,g,m,x,b,w,M,T=this,k=t.event.target.__data__.type,N="selection"===(t.event.metaKey?k="overlay":k)?ex:t.event.altKey?ox:ix,S=n===ax?null:hx[k],A=n===ux?null:px[k],E=Ll(T),C=E.extent,z=E.selection,P=C[0][0],q=C[0][1],L=C[1][0],R=C[1][1],U=S&&A&&t.event.shiftKey,D=du(T),O=D,F=i(T,arguments).beforestart();"overlay"===k?E.selection=z=[[l=n===ax?P:D[0],p=n===ux?q:D[1]],[v=n===ax?L:l,y=n===ux?R:p]]:(l=z[0][0],p=z[0][1],v=z[1][0],y=z[1][1]),h=l,d=p,_=v,g=y;var I=Ra(T).attr("pointer-events","none"),Y=I.selectAll(".overlay").attr("cursor",sx[k]);if(t.event.touches)I.on("touchmove.brush",e,!0).on("touchend.brush touchcancel.brush",u,!0);else{var B=Ra(t.event.view).on("keydown.brush",a,!0).on("keyup.brush",s,!0).on("mousemove.brush",e,!0).on("mouseup.brush",u,!0);Ef(t.event.view)}El(),Ha(T),r.call(T),F.start()}}function a(){var t=this.__brush||{selection:null};return t.extent=s.apply(this,arguments),t.dim=n,t}var c,s=ql,f=Pl,l=Mr(e,"start","brush","end"),h=6;return e.move=function(t,e){t.selection?t.on("start.brush",function(){i(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){i(this,arguments).end()}).tween("brush",function(){function t(t){u.selection=1===t&&Rl(s)?null:f(t),r.call(o),a.brush()}var o=this,u=o.__brush,a=i(o,arguments),c=u.selection,s=n.input("function"==typeof e?e.apply(this,arguments):e,u.extent),f=cr(c,s);return c&&s?t:t(1)}):t.each(function(){var t=this,o=arguments,u=t.__brush,a=n.input("function"==typeof e?e.apply(t,o):e,u.extent),c=i(t,o).beforestart();Ha(t),u.selection=null==a||Rl(a)?null:a,r.call(t),c.start().brush().end()})},o.prototype={beforestart:function(){return 1===++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0===--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(t){lu(new Al(e,t,n.output(this.state.selection)),l.apply,l,[t,this.that,this.args])}},e.extent=function(t){return arguments.length?(s="function"==typeof t?t:Sl([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),e):s},e.filter=function(t){return arguments.length?(f="function"==typeof t?t:Sl(!!t),e):f},e.handleSize=function(t){return arguments.length?(h=+t,e):h},e.on=function(){var t=l.on.apply(l,arguments);return t===l?e:t},e}function Yl(t){return function(n,e){return t(n.source.value+n.target.value,e.source.value+e.target.value)}}function Bl(){function t(t){var o,u,a,c,s,f,h=t.length,p=[],d=l(h),v=[],_=[],y=_.groups=new Array(h),g=new Array(h*h);for(o=0,s=-1;++s<h;){for(u=0,f=-1;++f<h;)u+=t[s][f];p.push(u),v.push(l(h)),o+=u}for(e&&d.sort(function(t,n){return e(p[t],p[n])}),r&&v.forEach(function(n,e){n.sort(function(n,i){return r(t[e][n],t[e][i])})}),o=mx(0,gx-n*h)/o,c=o?n:gx/h,u=0,s=-1;++s<h;){for(a=u,f=-1;++f<h;){var m=d[s],x=v[m][f],b=t[m][x],w=u,M=u+=b*o;g[x*h+m]={index:m,subindex:x,startAngle:w,endAngle:M,value:b}}y[m]={index:m,startAngle:a,endAngle:u,value:p[m]},u+=c}for(s=-1;++s<h;)for(f=s-1;++f<h;){var T=g[f*h+s],k=g[s*h+f];(T.value||k.value)&&_.push(T.value<k.value?{source:k,target:T}:{source:T,target:k})}return i?_.sort(i):_}var n=0,e=null,r=null,i=null;return t.padAngle=function(e){return arguments.length?(n=mx(0,e),t):n},t.sortGroups=function(n){return arguments.length?(e=n,t):e},t.sortSubgroups=function(n){return arguments.length?(r=n,t):r},t.sortChords=function(n){return arguments.length?(null==n?i=null:(i=Yl(n))._=n,
+t):i&&i._},t}function jl(t){return function(){return t}}function Hl(t){return t.source}function Xl(t){return t.target}function Vl(t){return t.radius}function Wl(t){return t.startAngle}function $l(t){return t.endAngle}function Zl(){function t(){var t,a=xx.call(arguments),c=n.apply(this,a),s=e.apply(this,a),f=+r.apply(this,(a[0]=c,a)),l=i.apply(this,a)-yx,h=o.apply(this,a)-yx,p=f*dx(l),d=f*vx(l),v=+r.apply(this,(a[0]=s,a)),_=i.apply(this,a)-yx,y=o.apply(this,a)-yx;if(u||(u=t=Tt()),u.moveTo(p,d),u.arc(0,0,f,l,h),l===_&&h===y||(u.quadraticCurveTo(0,0,v*dx(_),v*vx(_)),u.arc(0,0,v,_,y)),u.quadraticCurveTo(0,0,p,d),u.closePath(),t)return u=null,t+""||null}var n=Hl,e=Xl,r=Vl,i=Wl,o=$l,u=null;return t.radius=function(n){return arguments.length?(r="function"==typeof n?n:jl(+n),t):r},t.startAngle=function(n){return arguments.length?(i="function"==typeof n?n:jl(+n),t):i},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:jl(+n),t):o},t.source=function(e){return arguments.length?(n=e,t):n},t.target=function(n){return arguments.length?(e=n,t):e},t.context=function(n){return arguments.length?(u=null==n?null:n,t):u},t}function Gl(){return new Jl}function Jl(){this.reset()}function Ql(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}function Kl(t){return t>1?0:t<-1?ib:Math.acos(t)}function th(t){return t>1?ob:t<-1?-ob:Math.asin(t)}function nh(t){return(t=gb(t/2))*t}function eh(){}function rh(t,n){t&&Mb.hasOwnProperty(t.type)&&Mb[t.type](t,n)}function ih(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function oh(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)ih(t[e],n,1);n.polygonEnd()}function uh(t,n){t&&wb.hasOwnProperty(t.type)?wb[t.type](t,n):rh(t,n)}function ah(){Tb.point=sh}function ch(){fh(Mx,Tx)}function sh(t,n){Tb.point=fh,Mx=t,Tx=n,t*=sb,n*=sb,kx=t,Nx=pb(n=n/2+ub),Sx=gb(n)}function fh(t,n){t*=sb,n*=sb,n=n/2+ub;var e=t-kx,r=e>=0?1:-1,i=r*e,o=pb(n),u=gb(n),a=Sx*u,c=Nx*o+a*pb(i),s=a*r*gb(i);bx.add(hb(s,c)),kx=t,Nx=o,Sx=u}function lh(t){return wx?wx.reset():(wx=Gl(),bx=Gl()),uh(t,Tb),2*wx}function hh(t){return[hb(t[1],t[0]),th(t[2])]}function ph(t){var n=t[0],e=t[1],r=pb(e);return[r*pb(n),r*gb(n),gb(e)]}function dh(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function vh(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function _h(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function yh(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function gh(t){var n=xb(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function mh(t,n){Dx.push(Ox=[Ax=t,Cx=t]),n<Ex&&(Ex=n),n>zx&&(zx=n)}function xh(t,n){var e=ph([t*sb,n*sb]);if(Rx){var r=vh(Rx,e),i=[r[1],-r[0],0],o=vh(i,r);gh(o),o=hh(o);var u,a=t-Px,c=a>0?1:-1,s=o[0]*cb*c,f=fb(a)>180;f^(c*Px<s&&s<c*t)?(u=o[1]*cb,u>zx&&(zx=u)):(s=(s+360)%360-180,f^(c*Px<s&&s<c*t)?(u=-o[1]*cb,u<Ex&&(Ex=u)):(n<Ex&&(Ex=n),n>zx&&(zx=n))),f?t<Px?Nh(Ax,t)>Nh(Ax,Cx)&&(Cx=t):Nh(t,Cx)>Nh(Ax,Cx)&&(Ax=t):Cx>=Ax?(t<Ax&&(Ax=t),t>Cx&&(Cx=t)):t>Px?Nh(Ax,t)>Nh(Ax,Cx)&&(Cx=t):Nh(t,Cx)>Nh(Ax,Cx)&&(Ax=t)}else mh(t,n);Rx=e,Px=t}function bh(){kb.point=xh}function wh(){Ox[0]=Ax,Ox[1]=Cx,kb.point=mh,Rx=null}function Mh(t,n){if(Rx){var e=t-Px;Ux.add(fb(e)>180?e+(e>0?360:-360):e)}else qx=t,Lx=n;Tb.point(t,n),xh(t,n)}function Th(){Tb.lineStart()}function kh(){Mh(qx,Lx),Tb.lineEnd(),fb(Ux)>eb&&(Ax=-(Cx=180)),Ox[0]=Ax,Ox[1]=Cx,Rx=null}function Nh(t,n){return(n-=t)<0?n+360:n}function Sh(t,n){return t[0]-n[0]}function Ah(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}function Eh(t){var n,e,r,i,o,u,a;if(Ux?Ux.reset():Ux=Gl(),zx=Cx=-(Ax=Ex=1/0),Dx=[],uh(t,kb),e=Dx.length){for(Dx.sort(Sh),n=1,r=Dx[0],o=[r];n<e;++n)i=Dx[n],Ah(r,i[0])||Ah(r,i[1])?(Nh(r[0],i[1])>Nh(r[0],r[1])&&(r[1]=i[1]),Nh(i[0],r[1])>Nh(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(u=-(1/0),e=o.length-1,n=0,r=o[e];n<=e;r=i,++n)i=o[n],(a=Nh(r[1],i[0]))>u&&(u=a,Ax=i[0],Cx=r[1])}return Dx=Ox=null,Ax===1/0||Ex===1/0?[[NaN,NaN],[NaN,NaN]]:[[Ax,Ex],[Cx,zx]]}function Ch(t,n){t*=sb,n*=sb;var e=pb(n);zh(e*pb(t),e*gb(t),gb(n))}function zh(t,n,e){++Fx,Yx+=(t-Yx)/Fx,Bx+=(n-Bx)/Fx,jx+=(e-jx)/Fx}function Ph(){Nb.point=qh}function qh(t,n){t*=sb,n*=sb;var e=pb(n);Qx=e*pb(t),Kx=e*gb(t),tb=gb(n),Nb.point=Lh,zh(Qx,Kx,tb)}function Lh(t,n){t*=sb,n*=sb;var e=pb(n),r=e*pb(t),i=e*gb(t),o=gb(n),u=hb(xb((u=Kx*o-tb*i)*u+(u=tb*r-Qx*o)*u+(u=Qx*i-Kx*r)*u),Qx*r+Kx*i+tb*o);Ix+=u,Hx+=u*(Qx+(Qx=r)),Xx+=u*(Kx+(Kx=i)),Vx+=u*(tb+(tb=o)),zh(Qx,Kx,tb)}function Rh(){Nb.point=Ch}function Uh(){Nb.point=Oh}function Dh(){Fh(Gx,Jx),Nb.point=Ch}function Oh(t,n){Gx=t,Jx=n,t*=sb,n*=sb,Nb.point=Fh;var e=pb(n);Qx=e*pb(t),Kx=e*gb(t),tb=gb(n),zh(Qx,Kx,tb)}function Fh(t,n){t*=sb,n*=sb;var e=pb(n),r=e*pb(t),i=e*gb(t),o=gb(n),u=Kx*o-tb*i,a=tb*r-Qx*o,c=Qx*i-Kx*r,s=xb(u*u+a*a+c*c),f=Qx*r+Kx*i+tb*o,l=s&&-Kl(f)/s,h=hb(s,f);Wx+=l*u,$x+=l*a,Zx+=l*c,Ix+=h,Hx+=h*(Qx+(Qx=r)),Xx+=h*(Kx+(Kx=i)),Vx+=h*(tb+(tb=o)),zh(Qx,Kx,tb)}function Ih(t){Fx=Ix=Yx=Bx=jx=Hx=Xx=Vx=Wx=$x=Zx=0,uh(t,Nb);var n=Wx,e=$x,r=Zx,i=n*n+e*e+r*r;return i<rb&&(n=Hx,e=Xx,r=Vx,Ix<eb&&(n=Yx,e=Bx,r=jx),i=n*n+e*e+r*r,i<rb)?[NaN,NaN]:[hb(e,n)*cb,th(r/xb(i))*cb]}function Yh(t){return function(){return t}}function Bh(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return e=n.invert(e,r),e&&t.invert(e[0],e[1])}),e}function jh(t,n){return[t>ib?t-ab:t<-ib?t+ab:t,n]}function Hh(t,n,e){return(t%=ab)?n||e?Bh(Vh(t),Wh(n,e)):Vh(t):n||e?Wh(n,e):jh}function Xh(t){return function(n,e){return n+=t,[n>ib?n-ab:n<-ib?n+ab:n,e]}}function Vh(t){var n=Xh(t);return n.invert=Xh(-t),n}function Wh(t,n){function e(t,n){var e=pb(n),a=pb(t)*e,c=gb(t)*e,s=gb(n),f=s*r+a*i;return[hb(c*o-f*u,a*r-s*i),th(f*o+c*u)]}var r=pb(t),i=gb(t),o=pb(n),u=gb(n);return e.invert=function(t,n){var e=pb(n),a=pb(t)*e,c=gb(t)*e,s=gb(n),f=s*o-c*u;return[hb(c*o+s*u,a*r+f*i),th(f*r-a*i)]},e}function $h(t){function n(n){return n=t(n[0]*sb,n[1]*sb),n[0]*=cb,n[1]*=cb,n}return t=Hh(t[0]*sb,t[1]*sb,t.length>2?t[2]*sb:0),n.invert=function(n){return n=t.invert(n[0]*sb,n[1]*sb),n[0]*=cb,n[1]*=cb,n},n}function Zh(t,n,e,r,i,o){if(e){var u=pb(n),a=gb(n),c=r*e;null==i?(i=n+r*ab,o=n-c/2):(i=Gh(u,i),o=Gh(u,o),(r>0?i<o:i>o)&&(i+=r*ab));for(var s,f=i;r>0?f>o:f<o;f-=c)s=hh([u,-a*pb(f),-a*gb(f)]),t.point(s[0],s[1])}}function Gh(t,n){n=ph(n),n[0]-=t,gh(n);var e=Kl(-n[1]);return((-n[2]<0?-e:e)+ab-eb)%ab}function Jh(){function t(t,n){e.push(t=r(t,n)),t[0]*=cb,t[1]*=cb}function n(){var t=i.apply(this,arguments),n=o.apply(this,arguments)*sb,c=u.apply(this,arguments)*sb;return e=[],r=Hh(-t[0]*sb,-t[1]*sb,0).invert,Zh(a,n,c,1),t={type:"Polygon",coordinates:[e]},e=r=null,t}var e,r,i=Yh([0,0]),o=Yh(90),u=Yh(6),a={point:t};return n.center=function(t){return arguments.length?(i="function"==typeof t?t:Yh([+t[0],+t[1]]),n):i},n.radius=function(t){return arguments.length?(o="function"==typeof t?t:Yh(+t),n):o},n.precision=function(t){return arguments.length?(u="function"==typeof t?t:Yh(+t),n):u},n}function Qh(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:eh,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Kh(t,n,e,r,i,o){var u,a=t[0],c=t[1],s=n[0],f=n[1],l=0,h=1,p=s-a,d=f-c;if(u=e-a,p||!(u>0)){if(u/=p,p<0){if(u<l)return;u<h&&(h=u)}else if(p>0){if(u>h)return;u>l&&(l=u)}if(u=i-a,p||!(u<0)){if(u/=p,p<0){if(u>h)return;u>l&&(l=u)}else if(p>0){if(u<l)return;u<h&&(h=u)}if(u=r-c,d||!(u>0)){if(u/=d,d<0){if(u<l)return;u<h&&(h=u)}else if(d>0){if(u>h)return;u>l&&(l=u)}if(u=o-c,d||!(u<0)){if(u/=d,d<0){if(u>h)return;u>l&&(l=u)}else if(d>0){if(u<l)return;u<h&&(h=u)}return l>0&&(t[0]=a+l*p,t[1]=c+l*d),h<1&&(n[0]=a+h*p,n[1]=c+h*d),!0}}}}}function tp(t,n){return fb(t[0]-n[0])<eb&&fb(t[1]-n[1])<eb}function np(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function ep(t,n,e,r,i){var o,u,a=[],c=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],u=t[n];if(tp(r,u)){for(i.lineStart(),o=0;o<n;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a.push(e=new np(r,t,null,(!0))),c.push(e.o=new np(r,null,e,(!1))),a.push(e=new np(u,t,null,(!1))),c.push(e.o=new np(u,null,e,(!0)))}}),a.length){for(c.sort(n),rp(a),rp(c),o=0,u=c.length;o<u;++o)c[o].e=e=!e;for(var s,f,l=a[0];;){for(var h=l,p=!0;h.v;)if((h=h.n)===l)return;s=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,u=s.length;o<u;++o)i.point((f=s[o])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(s=h.p.z,o=s.length-1;o>=0;--o)i.point((f=s[o])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,s=h.z,p=!p}while(!h.v);i.lineEnd()}}}function rp(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.n=e=t[r],e.p=i,i=e;i.n=e=t[0],e.p=i}}function ip(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,a,s){var f=0,l=0;if(null==i||(f=u(i,a))!==(l=u(o,a))||c(i,o)<0^a>0){do s.point(0===f||3===f?t:e,f>1?r:n);while((f=(f+a+4)%4)!==l)}else s.point(o[0],o[1])}function u(r,i){return fb(r[0]-t)<eb?i>0?0:3:fb(r[0]-e)<eb?i>0?2:1:fb(r[1]-n)<eb?i>0?1:0:i>0?3:2}function a(t,n){return c(t.x,n.x)}function c(t,n){var e=u(t,1),r=u(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(u){function c(t,n){i(t,n)&&S.point(t,n)}function s(){for(var n=0,e=0,i=_.length;e<i;++e)for(var o,u,a=_[e],c=1,s=a.length,f=a[0],l=f[0],h=f[1];c<s;++c)o=l,u=h,f=a[c],l=f[0],h=f[1],u<=r?h>r&&(l-o)*(r-u)>(h-u)*(t-o)&&++n:h<=r&&(l-o)*(r-u)<(h-u)*(t-o)&&--n;return n}function f(){S=A,v=[],_=[],N=!0}function l(){var t=s(),n=N&&t,e=(v=w(v)).length;(n||e)&&(u.polygonStart(),n&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),e&&ep(v,a,t,o,u),u.polygonEnd()),S=u,v=_=y=null}function h(){E.point=d,_&&_.push(y=[]),k=!0,T=!1,b=M=NaN}function p(){v&&(d(g,m),x&&T&&A.rejoin(),v.push(A.result())),E.point=c,T&&S.lineEnd()}function d(o,u){var a=i(o,u);if(_&&y.push([o,u]),k)g=o,m=u,x=a,k=!1,a&&(S.lineStart(),S.point(o,u));else if(a&&T)S.point(o,u);else{var c=[b=Math.max(Ib,Math.min(Fb,b)),M=Math.max(Ib,Math.min(Fb,M))],s=[o=Math.max(Ib,Math.min(Fb,o)),u=Math.max(Ib,Math.min(Fb,u))];Kh(c,s,t,n,e,r)?(T||(S.lineStart(),S.point(c[0],c[1])),S.point(s[0],s[1]),a||S.lineEnd(),N=!1):a&&(S.lineStart(),S.point(o,u),N=!1)}b=o,M=u,T=a}var v,_,y,g,m,x,b,M,T,k,N,S=u,A=Qh(),E={point:c,lineStart:h,lineEnd:p,polygonStart:f,polygonEnd:l};return E}}function op(){var t,n,e,r=0,i=0,o=960,u=500;return e={stream:function(e){return t&&n===e?t:t=ip(r,i,o,u)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],o=+a[1][0],u=+a[1][1],t=n=null,e):[[r,i],[o,u]]}}}function up(){Yb.point=cp,Yb.lineEnd=ap}function ap(){Yb.point=Yb.lineEnd=eh}function cp(t,n){t*=sb,n*=sb,Ab=t,Eb=gb(n),Cb=pb(n),Yb.point=sp}function sp(t,n){t*=sb,n*=sb;var e=gb(n),r=pb(n),i=fb(t-Ab),o=pb(i),u=gb(i),a=r*u,c=Cb*e-Eb*r*o,s=Eb*e+Cb*r*o;Sb.add(hb(xb(a*a+c*c),s)),Ab=t,Eb=e,Cb=r}function fp(t){return Sb?Sb.reset():Sb=Gl(),uh(t,Yb),+Sb}function lp(t,n){return Bb[0]=t,Bb[1]=n,fp(jb)}function hp(t,n,e){var r=l(t,n-eb,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function pp(t,n,e){var r=l(t,n-eb,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function dp(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return l(db(o/y)*y,i,y).map(p).concat(l(db(s/g)*g,c,g).map(d)).concat(l(db(r/v)*v,e,v).filter(function(t){return fb(t%y)>eb}).map(f)).concat(l(db(a/_)*_,u,_).filter(function(t){return fb(t%g)>eb}).map(h))}var e,r,i,o,u,a,c,s,f,h,p,d,v=10,_=v,y=90,g=360,m=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[p(o).concat(d(c).slice(1),p(i).reverse().slice(1),d(s).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.extentMajor(n).extentMinor(n):t.extentMinor()},t.extentMajor=function(n){return arguments.length?(o=+n[0][0],i=+n[1][0],s=+n[0][1],c=+n[1][1],o>i&&(n=o,o=i,i=n),s>c&&(n=s,s=c,c=n),t.precision(m)):[[o,s],[i,c]]},t.extentMinor=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],a=+n[0][1],u=+n[1][1],r>e&&(n=r,r=e,e=n),a>u&&(n=a,a=u,u=n),t.precision(m)):[[r,a],[e,u]]},t.step=function(n){return arguments.length?t.stepMajor(n).stepMinor(n):t.stepMinor()},t.stepMajor=function(n){return arguments.length?(y=+n[0],g=+n[1],t):[y,g]},t.stepMinor=function(n){return arguments.length?(v=+n[0],_=+n[1],t):[v,_]},t.precision=function(n){return arguments.length?(m=+n,f=hp(a,u,90),h=pp(r,e,m),p=hp(s,c,90),d=pp(o,i,m),t):m},t.extentMajor([[-180,-90+eb],[180,90-eb]]).extentMinor([[-180,-80-eb],[180,80+eb]])}function vp(t,n){var e=t[0]*sb,r=t[1]*sb,i=n[0]*sb,o=n[1]*sb,u=pb(r),a=gb(r),c=pb(o),s=gb(o),f=u*pb(e),l=u*gb(e),h=c*pb(i),p=c*gb(i),d=2*th(xb(nh(o-r)+u*c*nh(i-e))),v=gb(d),_=d?function(t){var n=gb(t*=d)/v,e=gb(d-t)/v,r=e*f+n*h,i=e*l+n*p,o=e*a+n*s;return[hb(i,r)*cb,hb(o,xb(r*r+i*i))*cb]}:function(){return[e*cb,r*cb]};return _.distance=d,_}function _p(t){return t}function yp(){Vb.point=gp}function gp(t,n){Vb.point=mp,zb=qb=t,Pb=Lb=n}function mp(t,n){Xb.add(Lb*t-qb*n),qb=t,Lb=n}function xp(){mp(zb,Pb)}function bp(t,n){t<Wb&&(Wb=t),t>Zb&&(Zb=t),n<$b&&($b=n),n>Gb&&(Gb=n)}function wp(t,n){Qb+=t,Kb+=n,++tw}function Mp(){aw.point=Tp}function Tp(t,n){aw.point=kp,wp(Db=t,Ob=n)}function kp(t,n){var e=t-Db,r=n-Ob,i=xb(e*e+r*r);nw+=i*(Db+t)/2,ew+=i*(Ob+n)/2,rw+=i,wp(Db=t,Ob=n)}function Np(){aw.point=wp}function Sp(){aw.point=Ep}function Ap(){Cp(Rb,Ub)}function Ep(t,n){aw.point=Cp,wp(Rb=Db=t,Ub=Ob=n)}function Cp(t,n){var e=t-Db,r=n-Ob,i=xb(e*e+r*r);nw+=i*(Db+t)/2,ew+=i*(Ob+n)/2,rw+=i,i=Ob*t-Db*n,iw+=i*(Db+t),ow+=i*(Ob+n),uw+=3*i,wp(Db=t,Ob=n)}function zp(t){function n(n,e){t.moveTo(n+u,e),t.arc(n,e,u,0,ab)}function e(n,e){t.moveTo(n,e),a.point=r}function r(n,e){t.lineTo(n,e)}function i(){a.point=n}function o(){t.closePath()}var u=4.5,a={point:n,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=o},polygonEnd:function(){a.lineEnd=i,a.point=n},pointRadius:function(t){return u=t,a},result:eh};return a}function Pp(){function t(t,n){a.push("M",t,",",n,u)}function n(t,n){a.push("M",t,",",n),c.point=e}function e(t,n){a.push("L",t,",",n)}function r(){c.point=n}function i(){c.point=t}function o(){a.push("Z")}var u=qp(4.5),a=[],c={point:t,lineStart:r,lineEnd:i,polygonStart:function(){c.lineEnd=o},polygonEnd:function(){c.lineEnd=i,c.point=t},pointRadius:function(t){return u=qp(t),c},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return c}function qp(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Lp(){function t(t){return t&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),uh(t,e(i))),i.result()}var n,e,r,i,o=4.5;return t.area=function(t){return uh(t,e(Vb)),Vb.result()},t.bounds=function(t){return uh(t,e(Jb)),Jb.result()},t.centroid=function(t){return uh(t,e(aw)),aw.result()},t.projection=function(r){return arguments.length?(e=null==(n=r)?_p:r.stream,t):n},t.context=function(n){return arguments.length?(i=null==(r=n)?new Pp:new zp(n),"function"!=typeof o&&i.pointRadius(o),t):r},t.pointRadius=function(n){return arguments.length?(o="function"==typeof n?n:(i.pointRadius(+n),+n),t):o},t.projection(null).context(null)}function Rp(t,n){for(var e=n[0],r=n[1],i=[gb(e),-pb(e),0],o=0,u=0,a=0,c=t.length;a<c;++a)if(f=(s=t[a]).length)for(var s,f,l=s[f-1],h=l[0],p=l[1]/2+ub,d=gb(p),v=pb(p),_=0;_<f;++_,h=g,d=x,v=b,l=y){var y=s[_],g=y[0],m=y[1]/2+ub,x=gb(m),b=pb(m),w=g-h,M=w>=0?1:-1,T=M*w,k=T>ib,N=d*x;if(cw.add(hb(N*M*gb(T),v*b+N*pb(T))),o+=k?w+M*ab:w,k^h>=e^g>=e){var S=vh(ph(l),ph(y));gh(S);var A=vh(i,S);gh(A);var E=(k^w>=0?-1:1)*th(A[2]);(r>E||r===E&&(S[0]||S[1]))&&(u+=k^w>=0?1:-1)}}var C=(o<-eb||o<eb&&cw<-eb)^1&u;return cw.reset(),C}function Up(t,n,e,r){return function(i,o){function u(n,e){var r=i(n,e);t(n=r[0],e=r[1])&&o.point(n,e)}function a(t,n){var e=i(t,n);_.point(e[0],e[1])}function c(){b.point=a,_.lineStart()}function s(){b.point=u,_.lineEnd()}function f(t,n){v.push([t,n]);var e=i(t,n);m.point(e[0],e[1])}function l(){m.lineStart(),v=[]}function h(){f(v[0][0],v[0][1]),m.lineEnd();var t,n,e,r,i=m.clean(),u=g.result(),a=u.length;if(v.pop(),p.push(v),v=null,a)if(1&i){if(e=u[0],(n=e.length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t<n;++t)o.point((r=e[t])[0],r[1]);o.lineEnd()}}else a>1&&2&i&&u.push(u.pop().concat(u.shift())),d.push(u.filter(Dp))}var p,d,v,_=n(o),y=i.invert(r[0],r[1]),g=Qh(),m=n(g),x=!1,b={point:u,lineStart:c,lineEnd:s,polygonStart:function(){b.point=f,b.lineStart=l,b.lineEnd=h,d=[],p=[]},polygonEnd:function(){b.point=u,b.lineStart=c,b.lineEnd=s,d=w(d);var t=Rp(p,y);d.length?(x||(o.polygonStart(),x=!0),ep(d,Op,t,e,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),d=p=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return b}}function Dp(t){return t.length>1}function Op(t,n){return((t=t.x)[0]<0?t[1]-ob-eb:ob-t[1])-((n=n.x)[0]<0?n[1]-ob-eb:ob-n[1])}function Fp(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,u){var a=o>0?ib:-ib,c=fb(o-e);fb(c-ib)<eb?(t.point(e,r=(r+u)/2>0?ob:-ob),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),n=0):i!==a&&c>=ib&&(fb(e-i)<eb&&(e-=i*eb),fb(o-a)<eb&&(o-=a*eb),r=Ip(e,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=o,r=u),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}function Ip(t,n,e,r){var i,o,u=gb(t-e);return fb(u)>eb?lb((gb(n)*(o=pb(r))*gb(e)-gb(r)*(i=pb(n))*gb(t))/(i*o*u)):(n+r)/2}function Yp(t,n,e,r){var i;if(null==t)i=e*ob,r.point(-ib,i),r.point(0,i),r.point(ib,i),r.point(ib,0),r.point(ib,-i),r.point(0,-i),r.point(-ib,-i),r.point(-ib,0),r.point(-ib,i);else if(fb(t[0]-n[0])>eb){var o=t[0]<n[0]?ib:-ib;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])}function Bp(t,n){function e(e,r,i,o){Zh(o,t,n,i,e,r)}function r(t,n){return pb(t)*pb(n)>a}function i(t){var n,e,i,a,f;return{lineStart:function(){a=i=!1,f=1},point:function(l,h){var p,d=[l,h],v=r(l,h),_=c?v?0:u(l,h):v?u(l+(l<0?ib:-ib),h):0;if(!n&&(a=i=v)&&t.lineStart(),v!==i&&(p=o(n,d),(tp(n,p)||tp(d,p))&&(d[0]+=eb,d[1]+=eb,v=r(d[0],d[1]))),v!==i)f=0,v?(t.lineStart(),p=o(d,n),t.point(p[0],p[1])):(p=o(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(s&&n&&c^v){var y;_&e||!(y=o(d,n,!0))||(f=0,c?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&tp(n,d)||t.point(d[0],d[1]),n=d,i=v,e=_},lineEnd:function(){i&&t.lineEnd(),n=null},clean:function(){return f|(a&&i)<<1}}}function o(t,n,e){var r=ph(t),i=ph(n),o=[1,0,0],u=vh(r,i),c=dh(u,u),s=u[0],f=c-s*s;if(!f)return!e&&t;var l=a*c/f,h=-a*s/f,p=vh(o,u),d=yh(o,l),v=yh(u,h);_h(d,v);var _=p,y=dh(d,_),g=dh(_,_),m=y*y-g*(dh(d,d)-1);if(!(m<0)){var x=xb(m),b=yh(_,(-y-x)/g);if(_h(b,d),b=hh(b),!e)return b;var w,M=t[0],T=n[0],k=t[1],N=n[1];T<M&&(w=M,M=T,T=w);var S=T-M,A=fb(S-ib)<eb,E=A||S<eb;if(!A&&N<k&&(w=k,k=N,N=w),E?A?k+N>0^b[1]<(fb(b[0]-M)<eb?k:N):k<=b[1]&&b[1]<=N:S>ib^(M<=b[0]&&b[0]<=T)){var C=yh(_,(-y+x)/g);return _h(C,d),[b,hh(C)]}}}function u(n,e){var r=c?t:ib-t,i=0;return n<-r?i|=1:n>r&&(i|=2),e<-r?i|=4:e>r&&(i|=8),i}var a=pb(t),c=a>0,s=fb(a)>eb;return Up(r,i,e,c?[0,-t]:[-ib,t-ib])}function jp(t){return{stream:Hp(t)}}function Hp(t){function n(){}var e=n.prototype=Object.create(Xp.prototype);for(var r in t)e[r]=t[r];return function(t){var e=new n;return e.stream=t,e}}function Xp(){}function Vp(t,n){return+n?$p(t,n):Wp(t)}function Wp(t){return Hp({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function $p(t,n){function e(r,i,o,u,a,c,s,f,l,h,p,d,v,_){var y=s-r,g=f-i,m=y*y+g*g;if(m>4*n&&v--){var x=u+h,b=a+p,w=c+d,M=xb(x*x+b*b+w*w),T=th(w/=M),k=fb(fb(w)-1)<eb||fb(o-l)<eb?(o+l)/2:hb(b,x),N=t(k,T),S=N[0],A=N[1],E=S-r,C=A-i,z=g*E-y*C;(z*z/m>n||fb((y*E+g*C)/m-.5)>.3||u*h+a*p+c*d<lw)&&(e(r,i,o,u,a,c,S,A,k,x/=M,b/=M,w,v,_),_.point(S,A),e(S,A,k,x,b,w,s,f,l,h,p,d,v,_))}}return function(n){function r(e,r){e=t(e,r),n.point(e[0],e[1])}function i(){y=NaN,w.point=o,n.lineStart()}function o(r,i){var o=ph([r,i]),u=t(r,i);e(y,g,_,m,x,b,y=u[0],g=u[1],_=r,m=o[0],x=o[1],b=o[2],fw,n),n.point(y,g)}function u(){w.point=r,n.lineEnd()}function a(){i(),w.point=c,w.lineEnd=s}function c(t,n){o(f=t,n),l=y,h=g,p=m,d=x,v=b,w.point=o}function s(){e(y,g,_,m,x,b,l,h,f,p,d,v,fw,n),w.lineEnd=u,u()}var f,l,h,p,d,v,_,y,g,m,x,b,w={point:r,lineStart:i,lineEnd:u,polygonStart:function(){n.polygonStart(),w.lineStart=a},polygonEnd:function(){n.polygonEnd(),w.lineStart=i}};return w}}function Zp(t){return Gp(function(){return t})()}function Gp(t){function n(t){return t=f(t[0]*sb,t[1]*sb),[t[0]*_+a,c-t[1]*_]}function e(t){return t=f.invert((t[0]-a)/_,(c-t[1])/_),t&&[t[0]*cb,t[1]*cb]}function r(t,n){return t=u(t,n),[t[0]*_+a,c-t[1]*_]}function i(){f=Bh(s=Hh(b,w,M),u);var t=u(m,x);return a=y-t[0]*_,c=g+t[1]*_,o()}function o(){return d=v=null,n}var u,a,c,s,f,l,h,p,d,v,_=150,y=480,g=250,m=0,x=0,b=0,w=0,M=0,T=null,k=sw,N=null,S=_p,A=.5,E=Vp(r,A);return n.stream=function(t){return d&&v===t?d:d=hw(k(s,E(S(v=t))))},n.clipAngle=function(t){return arguments.length?(k=+t?Bp(T=t*sb,6*sb):(T=null,sw),o()):T*cb},n.clipExtent=function(t){return arguments.length?(S=null==t?(N=l=h=p=null,_p):ip(N=+t[0][0],l=+t[0][1],h=+t[1][0],p=+t[1][1]),o()):null==N?null:[[N,l],[h,p]]},n.scale=function(t){return arguments.length?(_=+t,i()):_},n.translate=function(t){return arguments.length?(y=+t[0],g=+t[1],i()):[y,g]},n.center=function(t){return arguments.length?(m=t[0]%360*sb,x=t[1]%360*sb,i()):[m*cb,x*cb]},n.rotate=function(t){return arguments.length?(b=t[0]%360*sb,w=t[1]%360*sb,M=t.length>2?t[2]%360*sb:0,i()):[b*cb,w*cb,M*cb]},n.precision=function(t){return arguments.length?(E=Vp(r,A=t*t),o()):xb(A)},function(){return u=t.apply(this,arguments),n.invert=u.invert&&e,i()}}function Jp(t){var n=0,e=ib/3,r=Gp(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*sb,e=t[1]*sb):[n*cb,e*cb]},i}function Qp(t,n){function e(t,n){var e=xb(o-2*i*gb(n))/i;return[e*gb(t*=i),u-e*pb(t)]}var r=gb(t),i=(r+gb(n))/2,o=1+r*(2*i-r),u=xb(o)/i;return e.invert=function(t,n){var e=u-n;return[hb(t,e)/i,th((o-(t*t+e*e)*i*i)/(2*i))]},e}function Kp(){return Jp(Qp).scale(155.424).center([0,33.6442])}function td(){return Kp().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function nd(t){var n=t.length;return{point:function(e,r){for(var i=-1;++i<n;)t[i].point(e,r)},sphere:function(){for(var e=-1;++e<n;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<n;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<n;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<n;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<n;)t[e].polygonEnd()}}}function ed(){function t(t){var n=t[0],e=t[1];return u=null,r.point(n,e),u||(i.point(n,e),u)||(o.point(n,e),u)}var n,e,r,i,o,u,a=td(),c=Kp().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Kp().rotate([157,0]).center([-3,19.9]).parallels([8,18]),f={point:function(t,n){u=[t,n]}};return t.invert=function(t){var n=a.scale(),e=a.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},t.stream=function(t){return n&&e===t?n:n=nd([a.stream(e=t),c.stream(t),s.stream(t)])},t.precision=function(n){return arguments.length?(a.precision(n),c.precision(n),s.precision(n),t):a.precision()},t.scale=function(n){return arguments.length?(a.scale(n),c.scale(.35*n),s.scale(n),t.translate(a.translate())):a.scale()},t.translate=function(n){if(!arguments.length)return a.translate();var e=a.scale(),u=+n[0],l=+n[1];return r=a.translate(n).clipExtent([[u-.455*e,l-.238*e],[u+.455*e,l+.238*e]]).stream(f),i=c.translate([u-.307*e,l+.201*e]).clipExtent([[u-.425*e+eb,l+.12*e+eb],[u-.214*e-eb,l+.234*e-eb]]).stream(f),o=s.translate([u-.205*e,l+.212*e]).clipExtent([[u-.214*e+eb,l+.166*e+eb],[u-.115*e-eb,l+.234*e-eb]]).stream(f),t},t.scale(1070)}function rd(t){return function(n,e){var r=pb(n),i=pb(e),o=t(r*i);return[o*i*gb(n),o*gb(e)]}}function id(t){return function(n,e){var r=xb(n*n+e*e),i=t(r),o=gb(i),u=pb(i);return[hb(n*o,r*u),th(r&&e*o/r)]}}function od(){return Zp(pw).scale(124.75).clipAngle(179.999)}function ud(){return Zp(dw).scale(79.4188).clipAngle(179.999)}function ad(t,n){return[t,_b(bb((ob+n)/2))]}function cd(){return sd(ad).scale(961/ab)}function sd(t){var n,e=Zp(t),r=e.scale,i=e.translate,o=e.clipExtent;return e.scale=function(t){return arguments.length?(r(t),n&&e.clipExtent(null),e):r()},e.translate=function(t){return arguments.length?(i(t),n&&e.clipExtent(null),e):i()},e.clipExtent=function(t){if(!arguments.length)return n?null:o();if(n=null==t){var u=ib*r(),a=i();t=[[a[0]-u,a[1]-u],[a[0]+u,a[1]+u]]}return o(t),e},e.clipExtent(null)}function fd(t){return bb((ob+t)/2)}function ld(t,n){function e(t,n){o>0?n<-ob+eb&&(n=-ob+eb):n>ob-eb&&(n=ob-eb);var e=o/yb(fd(n),i);return[e*gb(i*t),o-e*pb(i*t)]}var r=pb(t),i=t===n?gb(t):_b(r/pb(n))/_b(fd(n)/fd(t)),o=r*yb(fd(t),i)/i;return i?(e.invert=function(t,n){var e=o-n,r=mb(i)*xb(t*t+e*e);return[hb(t,e)/i,2*lb(yb(o/r,1/i))-ob]},e):ad}function hd(){return Jp(ld).scale(109.5).parallels([30,30])}function pd(t,n){return[t,n]}function dd(){return Zp(pd).scale(152.63)}function vd(t,n){function e(t,n){var e=o-n,r=i*t;return[e*gb(r),o-e*pb(r)]}var r=pb(t),i=t===n?gb(t):(r-pb(n))/(n-t),o=r/i+t;return fb(i)<eb?pd:(e.invert=function(t,n){var e=o-n;return[hb(t,e)/i,o-mb(i)*xb(t*t+e*e)]},e)}function _d(){return Jp(vd).scale(131.154).center([0,13.9389])}function yd(t,n){var e=pb(n),r=pb(t)*e;return[e*gb(t)/r,gb(n)/r]}function gd(){return Zp(yd).scale(144.049).clipAngle(60)}function md(t,n){return[pb(n)*gb(t),gb(n)]}function xd(){return Zp(md).scale(249.5).clipAngle(90+eb)}function bd(t,n){var e=pb(n),r=1+pb(t)*e;return[e*gb(t)/r,gb(n)/r]}function wd(){return Zp(bd).scale(250).clipAngle(142)}function Md(t,n){return[_b(bb((ob+n)/2)),-t]}function Td(){var t=sd(Md),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90]).scale(159.155)}var kd="4.1.1",Nd=e(n),Sd=Nd.right,Ad=Nd.left,Ed=Array.prototype,Cd=Ed.slice,zd=Ed.map,Pd=Math.sqrt(50),qd=Math.sqrt(10),Ld=Math.sqrt(2),Rd="$";P.prototype=q.prototype={constructor:P,has:function(t){return Rd+t in this},get:function(t){return this[Rd+t]},set:function(t,n){return this[Rd+t]=n,this},remove:function(t){var n=Rd+t;return n in this&&delete this[n]},clear:function(){for(var t in this)t[0]===Rd&&delete this[t]},keys:function(){var t=[];for(var n in this)n[0]===Rd&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)n[0]===Rd&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)n[0]===Rd&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)n[0]===Rd&&++t;return t},empty:function(){for(var t in this)if(t[0]===Rd)return!1;return!0},each:function(t){for(var n in this)n[0]===Rd&&t(this[n],n.slice(1),this)}};var Ud=q.prototype;F.prototype=I.prototype={constructor:F,has:Ud.has,add:function(t){return t+="",this[Rd+t]=t,this},remove:Ud.remove,clear:Ud.clear,values:Ud.keys,size:Ud.size,empty:Ud.empty,each:Ud.each};var Dd=3,Od=function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(Dd),Fd=function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(Dd),Id=function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(Dd),Yd=Math.PI,Bd=Yd/2,jd=4/11,Hd=6/11,Xd=8/11,Vd=.75,Wd=9/11,$d=10/11,Zd=.9375,Gd=21/22,Jd=63/64,Qd=1/jd/jd,Kd=1.70158,tv=function t(n){function e(t){return t*t*((n+1)*t-n)}return n=+n,e.overshoot=t,e}(Kd),nv=function t(n){function e(t){return--t*t*((n+1)*t+n)+1}return n=+n,e.overshoot=t,e}(Kd),ev=function t(n){function e(t){return((t*=2)<1?t*t*((n+1)*t-n):(t-=2)*t*((n+1)*t+n)+2)/2}return n=+n,e.overshoot=t,e}(Kd),rv=2*Math.PI,iv=1,ov=.3,uv=function t(n,e){function r(t){return n*Math.pow(2,10*--t)*Math.sin((i-t)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=rv);return r.amplitude=function(n){return t(n,e*rv)},r.period=function(e){return t(n,e)},r}(iv,ov),av=function t(n,e){function r(t){return 1-n*Math.pow(2,-10*(t=+t))*Math.sin((t+i)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=rv);return r.amplitude=function(n){return t(n,e*rv)},r.period=function(e){return t(n,e)},r}(iv,ov),cv=function t(n,e){function r(t){return((t=2*t-1)<0?n*Math.pow(2,10*t)*Math.sin((i-t)/e):2-n*Math.pow(2,-10*t)*Math.sin((i+t)/e))/2}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=rv);return r.amplitude=function(n){return t(n,e*rv)},r.period=function(e){return t(n,e)},r}(iv,ov),sv=Math.PI,fv=2*sv,lv=1e-6,hv=fv-lv;Mt.prototype=Tt.prototype={constructor:Mt,moveTo:function(t,n){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._.push("Z"))},lineTo:function(t,n){this._.push("L",this._x1=+t,",",this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._.push("Q",+t,",",+n,",",this._x1=+e,",",this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._.push("C",+t,",",+n,",",+e,",",+r,",",this._x1=+i,",",this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,u=this._y1,a=e-t,c=r-n,s=o-t,f=u-n,l=s*s+f*f;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._.push("M",this._x1=t,",",this._y1=n);else if(l>lv)if(Math.abs(f*a-c*s)>lv&&i){var h=e-o,p=r-u,d=a*a+c*c,v=h*h+p*p,_=Math.sqrt(d),y=Math.sqrt(l),g=i*Math.tan((sv-Math.acos((d+l-v)/(2*_*y)))/2),m=g/y,x=g/_;Math.abs(m-1)>lv&&this._.push("L",t+m*s,",",n+m*f),this._.push("A",i,",",i,",0,0,",+(f*h>s*p),",",this._x1=t+x*a,",",this._y1=n+x*c)}else this._.push("L",this._x1=t,",",this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var u=e*Math.cos(r),a=e*Math.sin(r),c=t+u,s=n+a,f=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._.push("M",c,",",s):(Math.abs(this._x1-c)>lv||Math.abs(this._y1-s)>lv)&&this._.push("L",c,",",s),e&&(l>hv?this._.push("A",e,",",e,",0,1,",f,",",t-u,",",n-a,"A",e,",",e,",0,1,",f,",",this._x1=c,",",this._y1=s):(l<0&&(l=l%fv+fv),this._.push("A",e,",",e,",0,",+(l>=sv),",",f,",",this._x1=t+e*Math.cos(i),",",this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+n,"h",+e,"v",+r,"h",-e,"Z")},toString:function(){return this._.join("")}};var pv=jt.prototype=Ht.prototype;pv.copy=function(){var t,n,e=new Ht(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Xt(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Xt(n));return e},pv.add=kt,pv.addAll=St,pv.cover=At,pv.data=Et,pv.extent=Ct,pv.find=Pt,pv.remove=qt,pv.removeAll=Lt,pv.root=Rt,pv.size=Ut,pv.visit=Dt,pv.visitAfter=Ot,pv.x=It,pv.y=Bt;var dv=[].slice,vv={};Vt.prototype=Qt.prototype={constructor:Vt,defer:function(t){if("function"!=typeof t||this._call)throw new Error;if(null!=this._error)return this;var n=dv.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),Wt(this),this},abort:function(){return null==this._error&&Gt(this,new Error("abort")),this},await:function(t){if("function"!=typeof t||this._call)throw new Error;return this._call=function(n,e){t.apply(null,[n].concat(e))},Jt(this),this},awaitAll:function(t){if("function"!=typeof t||this._call)throw new Error;return this._call=t,Jt(this),this}};var _v=1e-12,yv=Math.PI,gv=yv/2,mv=2*yv;fn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line;
+},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var xv=xn(ln);mn.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var bv={draw:function(t,n){var e=Math.sqrt(n/yv);t.moveTo(e,0),t.arc(0,0,e,0,mv)}},wv={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Mv=Math.sqrt(1/3),Tv=2*Mv,kv={draw:function(t,n){var e=Math.sqrt(n/Tv),r=e*Mv;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Nv=.8908130915292852,Sv=Math.sin(yv/10)/Math.sin(7*yv/10),Av=Math.sin(mv/10)*Sv,Ev=-Math.cos(mv/10)*Sv,Cv={draw:function(t,n){var e=Math.sqrt(n*Nv),r=Av*e,i=Ev*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var u=mv*o/5,a=Math.cos(u),c=Math.sin(u);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},zv={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Pv=Math.sqrt(3),qv={draw:function(t,n){var e=-Math.sqrt(n/(3*Pv));t.moveTo(0,2*e),t.lineTo(-Pv*e,-e),t.lineTo(Pv*e,-e),t.closePath()}},Lv=-.5,Rv=Math.sqrt(3)/2,Uv=1/Math.sqrt(12),Dv=3*(Uv/2+1),Ov={draw:function(t,n){var e=Math.sqrt(n/Dv),r=e/2,i=e*Uv,o=r,u=e*Uv+e,a=-o,c=u;t.moveTo(r,i),t.lineTo(o,u),t.lineTo(a,c),t.lineTo(Lv*r-Rv*i,Rv*r+Lv*i),t.lineTo(Lv*o-Rv*u,Rv*o+Lv*u),t.lineTo(Lv*a-Rv*c,Rv*a+Lv*c),t.lineTo(Lv*r+Rv*i,Lv*i-Rv*r),t.lineTo(Lv*o+Rv*u,Lv*u-Rv*o),t.lineTo(Lv*a+Rv*c,Lv*c-Rv*a),t.closePath()}},Fv=[bv,wv,kv,zv,Cv,qv,Ov];Sn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Nn(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Nn(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},En.prototype={areaStart:kn,areaEnd:kn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Nn(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Nn(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},qn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],u=t[e]-i,a=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*u),this._beta*n[c]+(1-this._beta)*(o+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Iv=function t(n){function e(t){return 1===n?new Sn(t):new qn(t,n)}return e.beta=function(n){return t(+n)},e}(.85);Rn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ln(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Ln(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Yv=function t(n){function e(t){return new Rn(t,n)}return e.tension=function(n){return t(+n)},e}(0);Un.prototype={areaStart:kn,areaEnd:kn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Ln(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Bv=function t(n){function e(t){return new Un(t,n)}return e.tension=function(n){return t(+n)},e}(0);Dn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ln(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var jv=function t(n){function e(t){return new Dn(t,n)}return e.tension=function(n){return t(+n)},e}(0);Fn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this,this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:On(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Hv=function t(n){function e(t){return n?new Fn(t,n):new Rn(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);In.prototype={areaStart:kn,areaEnd:kn,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:On(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Xv=function t(n){function e(t){return n?new In(t,n):new Un(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Yn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:On(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Vv=function t(n){function e(t){return n?new Yn(t,n):new Dn(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Bn.prototype={areaStart:kn,areaEnd:kn,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}},$n.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Wn(this,this._t0,Vn(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,Wn(this,Vn(this,e=Xn(this,t,n)),e);break;default:Wn(this,this._t0,e=Xn(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(Zn.prototype=Object.create($n.prototype)).point=function(t,n){$n.prototype.point.call(this,n,t)},Gn.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}},Kn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var r=te(t),i=te(n),o=0,u=1;u<e;++o,++u)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[u],n[u]);(this._line||0!==this._line&&1===e)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}},ee.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Wv=Array.prototype.slice,$v=.7,Zv=1/$v,Gv=/^#([0-9a-f]{3})$/,Jv=/^#([0-9a-f]{6})$/,Qv=/^rgb\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*\)$/,Kv=/^rgb\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,t_=/^rgba\(\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+)\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,n_=/^rgba\(\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,e_=/^hsl\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*\)$/,r_=/^hsla\(\s*([-+]?\d+(?:\.\d+)?)\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)%\s*,\s*([-+]?\d+(?:\.\d+)?)\s*\)$/,i_={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};ge(xe,be,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),ge(Ne,ke,me(xe,{brighter:function(t){return t=null==t?Zv:Math.pow(Zv,t),new Ne(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?$v:Math.pow($v,t),new Ne(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),ge(Ce,Ee,me(xe,{brighter:function(t){return t=null==t?Zv:Math.pow(Zv,t),new Ce(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?$v:Math.pow($v,t),new Ce(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Ne(ze(t>=240?t-240:t+120,i,r),ze(t,i,r),ze(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var o_=Math.PI/180,u_=180/Math.PI,a_=18,c_=.95047,s_=1,f_=1.08883,l_=4/29,h_=6/29,p_=3*h_*h_,d_=h_*h_*h_;ge(Le,qe,me(xe,{brighter:function(t){return new Le(this.l+a_*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Le(this.l-a_*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=s_*Ue(t),n=c_*Ue(n),e=f_*Ue(e),new Ne(De(3.2404542*n-1.5371385*t-.4985314*e),De(-.969266*n+1.8760108*t+.041556*e),De(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),ge(Ye,Ie,me(xe,{brighter:function(t){return new Ye(this.h,this.c,this.l+a_*(null==t?1:t),this.opacity)},darker:function(t){return new Ye(this.h,this.c,this.l-a_*(null==t?1:t),this.opacity)},rgb:function(){return Pe(this).rgb()}}));var v_=-.14861,__=1.78277,y_=-.29227,g_=-.90649,m_=1.97294,x_=m_*g_,b_=m_*__,w_=__*y_-g_*v_;ge(He,je,me(xe,{brighter:function(t){return t=null==t?Zv:Math.pow(Zv,t),new He(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?$v:Math.pow($v,t),new He(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*o_,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Ne(255*(n+e*(v_*r+__*i)),255*(n+e*(y_*r+g_*i)),255*(n+e*(m_*r)),this.opacity)}}));var M_,T_,k_,N_,S_=function t(n){function e(t,n){var e=r((t=ke(t)).r,(n=ke(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),u=r(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}var r=Qe(n);return e.gamma=t,e}(1),A_=tr(Ve),E_=tr(We),C_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,z_=new RegExp(C_.source,"g"),P_=180/Math.PI,q_={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},L_=pr(lr,"px, ","px)","deg)"),R_=pr(hr,", ",")",")"),U_=Math.SQRT2,D_=2,O_=4,F_=1e-12,I_=gr(Je),Y_=gr(Ke),B_=xr(Je),j_=xr(Ke),H_=br(Je),X_=br(Ke),V_={value:function(){}};Tr.prototype=Mr.prototype={constructor:Tr,on:function(t,n){var e,r=this._,i=kr(t+"",r),o=-1,u=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=Sr(r[e],t.name,n);else if(null==n)for(e in r)r[e]=Sr(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=Nr(r[e],t.name)))return e}},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Tr(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,e=r.length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var W_,$_,Z_=zr(","),G_=Z_.parse,J_=Z_.parseRows,Q_=Z_.format,K_=Z_.formatRows,ty=zr("\t"),ny=ty.parse,ey=ty.parseRows,ry=ty.format,iy=ty.formatRows,oy=Rr("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),uy=Rr("application/json",function(t){return JSON.parse(t.responseText)}),ay=Rr("text/plain",function(t){return t.responseText}),cy=Rr("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n}),sy=Ur("text/csv",G_),fy=Ur("text/tab-separated-values",ny),ly=0,hy=0,py=0,dy=1e3,vy=0,_y=0,yy=0,gy="object"==typeof performance&&performance.now?performance:Date,my="function"==typeof requestAnimationFrame?gy===Date?function(t){requestAnimationFrame(function(){t(gy.now())})}:requestAnimationFrame:function(t){setTimeout(t,17)};Ir.prototype=Yr.prototype={constructor:Ir,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Or():+e)+(null==n?0:+n),this._next||$_===this||($_?$_._next=this:W_=this,$_=this),this._call=t,this._time=e,Vr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vr())}};var xy=new Date,by=new Date,wy=Zr(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});wy.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Zr(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):wy:null};var My=wy.range,Ty=1e3,ky=6e4,Ny=36e5,Sy=864e5,Ay=6048e5,Ey=Zr(function(t){t.setTime(Math.floor(t/Ty)*Ty)},function(t,n){t.setTime(+t+n*Ty)},function(t,n){return(n-t)/Ty},function(t){return t.getUTCSeconds()}),Cy=Ey.range,zy=Zr(function(t){t.setTime(Math.floor(t/ky)*ky)},function(t,n){t.setTime(+t+n*ky)},function(t,n){return(n-t)/ky},function(t){return t.getMinutes()}),Py=zy.range,qy=Zr(function(t){var n=t.getTimezoneOffset()*ky%Ny;n<0&&(n+=Ny),t.setTime(Math.floor((+t-n)/Ny)*Ny+n)},function(t,n){t.setTime(+t+n*Ny)},function(t,n){return(n-t)/Ny},function(t){return t.getHours()}),Ly=qy.range,Ry=Zr(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*ky)/Sy},function(t){return t.getDate()-1}),Uy=Ry.range,Dy=Gr(0),Oy=Gr(1),Fy=Gr(2),Iy=Gr(3),Yy=Gr(4),By=Gr(5),jy=Gr(6),Hy=Dy.range,Xy=Oy.range,Vy=Fy.range,Wy=Iy.range,$y=Yy.range,Zy=By.range,Gy=jy.range,Jy=Zr(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),Qy=Jy.range,Ky=Zr(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Ky.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Zr(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var tg=Ky.range,ng=Zr(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*ky)},function(t,n){return(n-t)/ky},function(t){return t.getUTCMinutes()}),eg=ng.range,rg=Zr(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+n*Ny)},function(t,n){return(n-t)/Ny},function(t){return t.getUTCHours()}),ig=rg.range,og=Zr(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/Sy},function(t){return t.getUTCDate()-1}),ug=og.range,ag=Jr(0),cg=Jr(1),sg=Jr(2),fg=Jr(3),lg=Jr(4),hg=Jr(5),pg=Jr(6),dg=ag.range,vg=cg.range,_g=sg.range,yg=fg.range,gg=lg.range,mg=hg.range,xg=pg.range,bg=Zr(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),wg=bg.range,Mg=Zr(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Mg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Zr(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Tg,kg=Mg.range,Ng={"":ni,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return ri(100*t,n)},r:ri,s:ei,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Sg=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;oi.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Ag,Eg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];t.format,t.formatPrefix,ci({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Cg,zg={"-":"",_:" ",0:"0"},Pg=/^\s*\d+/,qg=/^%/,Lg=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;t.timeFormat,t.timeParse,t.utcFormat,t.utcParse,so({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",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 Rg="%Y-%m-%dT%H:%M:%S.%LZ",Ug=Date.prototype.toISOString?fo:t.utcFormat(Rg),Dg=+new Date("2000-01-01T00:00:00.000Z")?lo:t.utcParse(Rg),Og=Array.prototype,Fg=Og.map,Ig=Og.slice,Yg={name:"implicit"},Bg=[0,1],jg=1e3,Hg=60*jg,Xg=60*Hg,Vg=24*Xg,Wg=7*Vg,$g=30*Vg,Zg=365*Vg,Gg=Zo("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Jg=Zo("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),Qg=Zo("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),Kg=Zo("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),tm=X_(je(300,.5,0),je(-240,.5,1)),nm=X_(je(-100,.75,.35),je(80,1.5,.8)),em=X_(je(260,.75,.35),je(80,1.5,.8)),rm=je(),im=Jo(Zo("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),om=Jo(Zo("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),um=Jo(Zo("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),am=Jo(Zo("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),cm="http://www.w3.org/1999/xhtml",sm={
+svg:"http://www.w3.org/2000/svg",xhtml:cm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},fm=0;iu.prototype=ru.prototype={constructor:iu,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var lm=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var hm=document.documentElement;if(!hm.matches){var pm=hm.webkitMatchesSelector||hm.msMatchesSelector||hm.mozMatchesSelector||hm.oMatchesSelector;lm=function(t){return function(){return pm.call(this,t)}}}}var dm=lm,vm={};if(t.event=null,"undefined"!=typeof document){var _m=document.documentElement;"onmouseenter"in _m||(vm={mouseenter:"mouseover",mouseleave:"mouseout"})}Tu.prototype={constructor:Tu,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var ym="$";ia.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var gm=[null];qa.prototype=La.prototype={constructor:qa,select:yu,selectAll:xu,filter:bu,data:Au,enter:Mu,exit:Eu,merge:Cu,order:zu,sort:Pu,call:Lu,nodes:Ru,node:Uu,size:Du,empty:Ou,each:Fu,attr:Vu,style:Ju,property:na,classed:fa,text:da,html:ga,raise:xa,lower:wa,append:Ma,insert:ka,remove:Sa,datum:Aa,on:fu,dispatch:Pa};var mm=Mr("start","end","interrupt"),xm=[],bm=0,wm=1,Mm=2,Tm=3,km=4,Nm=5,Sm=La.prototype.constructor,Am=0,Em=La.prototype;Uc.prototype=Dc.prototype={constructor:Uc,select:wc,selectAll:Mc,filter:vc,merge:_c,selection:Tc,transition:Rc,call:Em.call,nodes:Em.nodes,node:Em.node,size:Em.size,empty:Em.empty,each:Em.each,on:mc,attr:rc,attrTween:uc,style:Ec,styleTween:zc,text:Lc,remove:bc,tween:$a,delay:sc,duration:hc,ease:dc};var Cm={time:null,delay:0,duration:250,ease:et};La.prototype.interrupt=Xa,La.prototype.transition=Ic;var zm=[null],Pm=Array.prototype.slice,qm=1,Lm=2,Rm=3,Um=4,Dm=1e-6;ws.prototype=ys.prototype={constructor:ws,each:us,eachAfter:cs,eachBefore:as,sum:ss,sort:fs,path:ls,ancestors:ps,descendants:ds,leaves:vs,links:_s,copy:gs};var Om="$",Fm={depth:-1},Im={};of.prototype=Object.create(ws.prototype);var Ym=(1+Math.sqrt(5))/2,Bm=function t(n){function e(t,e,r,i,o){sf(n,t,e,r,i,o)}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}(Ym),jm=function t(n){function e(t,e,r,i,o){if((u=t._squarify)&&u.ratio===n)for(var u,a,c,s,f,l=-1,h=u.length,p=t.value;++l<h;){for(a=u[l],c=a.children,s=a.value=0,f=c.length;s<f;++s)a.value+=c[s].value;a.dice?Ws(a,e,r,i,r+=(o-r)*a.value/p):cf(a,e,r,e+=(i-e)*a.value/p,o),p-=a.value}else t._squarify=u=sf(n,t,e,r,i,o),u.ratio=n}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}(Ym),Hm=10,Xm=Math.PI*(3-Math.sqrt(5));Pf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t},If.prototype={constructor:If,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=Hf(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(Bf(this,e),t=e,e=t.U),e.C=!1,r.C=!0,jf(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(jf(this,e),t=e,e=t.U),e.C=!1,r.C=!0,Bf(this,r))),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,u=t.R;if(e=o?u?Hf(u):o:u,i?i.L===t?i.L=e:i.R=e:this._=e,o&&u?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==u?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=u,u.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(n=i.R,n.C&&(n.C=!1,i.C=!0,Bf(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,jf(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,Bf(this,i),t=this._;break}}else if(n=i.L,n.C&&(n.C=!1,i.C=!0,jf(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,Bf(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,jf(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Vm,Wm,$m,Zm,Gm,Jm=[],Qm=[],Km=1e-6,tx=1e-12;vl.prototype={constructor:vl,polygons:function(){var t=this.edges;return this.cells.map(function(n){var e=n.halfedges.map(function(e){return Kf(n,t[e])});return e.data=n.site.data,e})},triangles:function(){var t=[],n=this.edges;return this.cells.forEach(function(e,r){for(var i,o=e.site,u=e.halfedges,a=-1,c=u.length,s=n[u[c-1]],f=s.left===o?s.right:s.left;++a<c;)i=f,s=n[u[a]],f=s.left===o?s.right:s.left,r<i.index&&r<f.index&&pl(o,i,f)<0&&t.push([o.data,i.data,f.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})}},ml.prototype={constructor:ml,scale:function(t){return 1===t?this:new ml(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new ml(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var nx=new ml(1,0,0);xl.prototype=ml.prototype;var ex={name:"drag"},rx={name:"space"},ix={name:"handle"},ox={name:"center"},ux={name:"x",handles:["e","w"].map(zl),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},ax={name:"y",handles:["n","s"].map(zl),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},cx={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(zl),input:function(t){return t},output:function(t){return t}},sx={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},fx={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},lx={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},hx={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},px={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1},dx=Math.cos,vx=Math.sin,_x=Math.PI,yx=_x/2,gx=2*_x,mx=Math.max,xx=Array.prototype.slice;Jl.prototype={constructor:Jl,reset:function(){this.s=this.t=0},add:function(t){Ql(nb,t,this.t),Ql(this,nb.s,this.s),this.s?this.t+=nb.t:this.s=nb.t},valueOf:function(){return this.s}};var bx,wx,Mx,Tx,kx,Nx,Sx,Ax,Ex,Cx,zx,Px,qx,Lx,Rx,Ux,Dx,Ox,Fx,Ix,Yx,Bx,jx,Hx,Xx,Vx,Wx,$x,Zx,Gx,Jx,Qx,Kx,tb,nb=new Jl,eb=1e-6,rb=1e-12,ib=Math.PI,ob=ib/2,ub=ib/4,ab=2*ib,cb=180/ib,sb=ib/180,fb=Math.abs,lb=Math.atan,hb=Math.atan2,pb=Math.cos,db=Math.ceil,vb=Math.exp,_b=Math.log,yb=Math.pow,gb=Math.sin,mb=Math.sign||function(t){return t>0?1:t<0?-1:0},xb=Math.sqrt,bb=Math.tan,wb={Feature:function(t,n){rh(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)rh(e[r].geometry,n)}},Mb={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){ih(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)ih(e[r],n,0)},Polygon:function(t,n){oh(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)oh(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)rh(e[r],n)}},Tb={point:eh,lineStart:eh,lineEnd:eh,polygonStart:function(){bx.reset(),Tb.lineStart=ah,Tb.lineEnd=ch},polygonEnd:function(){var t=+bx;wx.add(t<0?ab+t:t),this.lineStart=this.lineEnd=this.point=eh},sphere:function(){wx.add(ab)}},kb={point:mh,lineStart:bh,lineEnd:wh,polygonStart:function(){kb.point=Mh,kb.lineStart=Th,kb.lineEnd=kh,Ux.reset(),Tb.polygonStart()},polygonEnd:function(){Tb.polygonEnd(),kb.point=mh,kb.lineStart=bh,kb.lineEnd=wh,bx<0?(Ax=-(Cx=180),Ex=-(zx=90)):Ux>eb?zx=90:Ux<-eb&&(Ex=-90),Ox[0]=Ax,Ox[1]=Cx}},Nb={sphere:eh,point:Ch,lineStart:Ph,lineEnd:Rh,polygonStart:function(){Nb.lineStart=Uh,Nb.lineEnd=Dh},polygonEnd:function(){Nb.lineStart=Ph,Nb.lineEnd=Rh}};jh.invert=jh;var Sb,Ab,Eb,Cb,zb,Pb,qb,Lb,Rb,Ub,Db,Ob,Fb=1e9,Ib=-Fb,Yb={sphere:eh,point:eh,lineStart:up,lineEnd:eh,polygonStart:eh,polygonEnd:eh},Bb=[null,null],jb={type:"LineString",coordinates:Bb},Hb=Gl(),Xb=Gl(),Vb={point:eh,lineStart:eh,lineEnd:eh,polygonStart:function(){Vb.lineStart=yp,Vb.lineEnd=xp},polygonEnd:function(){Vb.lineStart=Vb.lineEnd=Vb.point=eh,Hb.add(fb(Xb)),Xb.reset()},result:function(){var t=Hb/2;return Hb.reset(),t}},Wb=1/0,$b=Wb,Zb=-Wb,Gb=Zb,Jb={point:bp,lineStart:eh,lineEnd:eh,polygonStart:eh,polygonEnd:eh,result:function(){var t=[[Wb,$b],[Zb,Gb]];return Zb=Gb=-($b=Wb=1/0),t}},Qb=0,Kb=0,tw=0,nw=0,ew=0,rw=0,iw=0,ow=0,uw=0,aw={point:wp,lineStart:Mp,lineEnd:Np,polygonStart:function(){aw.lineStart=Sp,aw.lineEnd=Ap},polygonEnd:function(){aw.point=wp,aw.lineStart=Mp,aw.lineEnd=Np},result:function(){var t=uw?[iw/uw,ow/uw]:rw?[nw/rw,ew/rw]:tw?[Qb/tw,Kb/tw]:[NaN,NaN];return Qb=Kb=tw=nw=ew=rw=iw=ow=uw=0,t}},cw=Gl(),sw=Up(function(){return!0},Fp,Yp,[-ib,-ob]);Xp.prototype={point:function(t,n){this.stream.point(t,n)},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()}};var fw=16,lw=pb(30*sb),hw=Hp({point:function(t,n){this.stream.point(t*sb,n*sb)}}),pw=rd(function(t){return xb(2/(1+t))});pw.invert=id(function(t){return 2*th(t/2)});var dw=rd(function(t){return(t=Kl(t))&&t/gb(t)});dw.invert=id(function(t){return t}),ad.invert=function(t,n){return[t,2*lb(vb(n))-ob]},pd.invert=pd,yd.invert=id(lb),md.invert=id(th),bd.invert=id(function(t){return 2+lb(t)}),Md.invert=function(t,n){return[-n,2*lb(vb(t))-ob]},t.version=kd,t.bisect=Sd,t.bisectRight=Sd,t.bisectLeft=Ad,t.ascending=n,t.bisector=e,t.descending=i,t.deviation=a,t.extent=c,t.histogram=v,t.thresholdFreedmanDiaconis=y,t.thresholdScott=g,t.thresholdSturges=d,t.max=m,t.mean=x,t.median=b,t.merge=w,t.min=M,t.pairs=T,t.permute=k,t.quantile=_,t.range=l,t.scan=N,t.shuffle=S,t.sum=A,t.ticks=h,t.tickStep=p,t.transpose=E,t.variance=u,t.zip=z,t.entries=j,t.keys=Y,t.values=B,t.map=q,t.set=I,t.nest=L,t.randomUniform=H,t.randomNormal=X,t.randomLogNormal=V,t.randomBates=$,t.randomIrwinHall=W,t.randomExponential=Z,t.easeLinear=G,t.easeQuad=K,t.easeQuadIn=J,t.easeQuadOut=Q,t.easeQuadInOut=K,t.easeCubic=et,t.easeCubicIn=tt,t.easeCubicOut=nt,t.easeCubicInOut=et,t.easePoly=Id,t.easePolyIn=Od,t.easePolyOut=Fd,t.easePolyInOut=Id,t.easeSin=ot,t.easeSinIn=rt,t.easeSinOut=it,t.easeSinInOut=ot,t.easeExp=ct,t.easeExpIn=ut,t.easeExpOut=at,t.easeExpInOut=ct,t.easeCircle=lt,t.easeCircleIn=st,t.easeCircleOut=ft,t.easeCircleInOut=lt,t.easeBounce=pt,t.easeBounceIn=ht,t.easeBounceOut=pt,t.easeBounceInOut=dt,t.easeBack=ev,t.easeBackIn=tv,t.easeBackOut=nv,t.easeBackInOut=ev,t.easeElastic=av,t.easeElasticIn=uv,t.easeElasticOut=av,t.easeElasticInOut=cv,t.polygonArea=vt,t.polygonCentroid=_t,t.polygonHull=xt,t.polygonContains=bt,t.polygonLength=wt,t.path=Tt,t.quadtree=jt,t.queue=Qt,t.arc=sn,t.area=vn,t.line=dn,t.pie=gn,t.radialArea=Mn,t.radialLine=wn,t.symbol=Tn,t.symbols=Fv,t.symbolCircle=bv,t.symbolCross=wv,t.symbolDiamond=kv,t.symbolSquare=zv,t.symbolStar=Cv,t.symbolTriangle=qv,t.symbolWye=Ov,t.curveBasisClosed=Cn,t.curveBasisOpen=Pn,t.curveBasis=An,t.curveBundle=Iv,t.curveCardinalClosed=Bv,t.curveCardinalOpen=jv,t.curveCardinal=Yv,t.curveCatmullRomClosed=Xv,t.curveCatmullRomOpen=Vv,t.curveCatmullRom=Hv,t.curveLinearClosed=jn,t.curveLinear=ln,t.curveMonotoneX=Jn,t.curveMonotoneY=Qn,t.curveNatural=ne,t.curveStep=re,t.curveStepAfter=oe,t.curveStepBefore=ie,t.stack=se,t.stackOffsetExpand=fe,t.stackOffsetNone=ue,t.stackOffsetSilhouette=le,t.stackOffsetWiggle=he,t.stackOrderAscending=pe,t.stackOrderDescending=ve,t.stackOrderInsideOut=_e,t.stackOrderNone=ae,t.stackOrderReverse=ye,t.color=be,t.rgb=ke,t.hsl=Ee,t.lab=qe,t.hcl=Ie,t.cubehelix=je,t.interpolate=cr,t.interpolateArray=nr,t.interpolateDate=er,t.interpolateNumber=rr,t.interpolateObject=ir,t.interpolateRound=sr,t.interpolateString=ar,t.interpolateTransformCss=L_,t.interpolateTransformSvg=R_,t.interpolateZoom=yr,t.interpolateRgb=S_,t.interpolateRgbBasis=A_,t.interpolateRgbBasisClosed=E_,t.interpolateHsl=I_,t.interpolateHslLong=Y_,t.interpolateLab=mr,t.interpolateHcl=B_,t.interpolateHclLong=j_,t.interpolateCubehelix=H_,t.interpolateCubehelixLong=X_,t.interpolateBasis=Ve,t.interpolateBasisClosed=We,t.quantize=wr,t.dispatch=Mr,t.dsvFormat=zr,t.csvParse=G_,t.csvParseRows=J_,t.csvFormat=Q_,t.csvFormatRows=K_,t.tsvParse=ny,t.tsvParseRows=ey,t.tsvFormat=ry,t.tsvFormatRows=iy,t.request=Pr,t.html=oy,t.json=uy,t.text=ay,t.xml=cy,t.csv=sy,t.tsv=fy,t.now=Or,t.timer=Yr,t.timerFlush=Br,t.timeout=Wr,t.interval=$r,t.timeInterval=Zr,t.timeMillisecond=wy,t.timeMilliseconds=My,t.timeSecond=Ey,t.timeSeconds=Cy,t.timeMinute=zy,t.timeMinutes=Py,t.timeHour=qy,t.timeHours=Ly,t.timeDay=Ry,t.timeDays=Uy,t.timeWeek=Dy;t.timeWeeks=Hy;t.timeSunday=Dy,t.timeSundays=Hy,t.timeMonday=Oy,t.timeMondays=Xy,t.timeTuesday=Fy,t.timeTuesdays=Vy,t.timeWednesday=Iy,t.timeWednesdays=Wy,t.timeThursday=Yy,t.timeThursdays=$y,t.timeFriday=By,t.timeFridays=Zy,t.timeSaturday=jy,t.timeSaturdays=Gy,t.timeMonth=Jy,t.timeMonths=Qy,t.timeYear=Ky,t.timeYears=tg,t.utcMillisecond=wy,t.utcMilliseconds=My,t.utcSecond=Ey,t.utcSeconds=Cy,t.utcMinute=ng,t.utcMinutes=eg,t.utcHour=rg,t.utcHours=ig,t.utcDay=og,t.utcDays=ug,t.utcWeek=ag,t.utcWeeks=dg,t.utcSunday=ag,t.utcSundays=dg,t.utcMonday=cg,t.utcMondays=vg,t.utcTuesday=sg,t.utcTuesdays=_g,t.utcWednesday=fg,t.utcWednesdays=yg,t.utcThursday=lg,t.utcThursdays=gg,t.utcFriday=hg,t.utcFridays=mg,t.utcSaturday=pg,t.utcSaturdays=xg,t.utcMonth=bg,t.utcMonths=wg,t.utcYear=Mg,t.utcYears=kg,t.formatLocale=ai,t.formatDefaultLocale=ci,t.formatSpecifier=ii,t.precisionFixed=si,t.precisionPrefix=fi,t.precisionRound=li,t.isoFormat=Ug,t.isoParse=Dg,t.timeFormatLocale=vi,t.timeFormatDefaultLocale=so,t.scaleBand=po,t.scalePoint=_o,t.scaleIdentity=Eo,t.scaleLinear=Ao,t.scaleLog=Do,t.scaleOrdinal=ho,t.scaleImplicit=Yg,t.scalePow=Fo,t.scaleSqrt=Io,t.scaleQuantile=Yo,t.scaleQuantize=Bo,t.scaleThreshold=jo,t.scaleTime=Wo,t.scaleUtc=$o,t.schemeCategory10=Gg,t.schemeCategory20b=Jg,t.schemeCategory20c=Qg,t.schemeCategory20=Kg,t.scaleSequential=Qo,t.interpolateCubehelixDefault=tm,t.interpolateRainbow=Go,t.interpolateWarm=nm,t.interpolateCool=em,t.interpolateViridis=im,t.interpolateMagma=om,t.interpolateInferno=um,t.interpolatePlasma=am,t.creator=eu,t.customEvent=lu,t.local=ru,t.matcher=dm,t.mouse=du,t.namespace=Ko,t.namespaces=sm,t.select=Ra,t.selectAll=Ua,t.selection=La,t.selector=_u,t.selectorAll=mu,t.touch=Da,t.touches=Oa,t.window=Wu,t.active=Yc,t.interrupt=Ha,t.transition=Dc,t.axisTop=$c,t.axisRight=Zc,t.axisBottom=Gc,t.axisLeft=Jc,t.cluster=os,t.hierarchy=ys,t.pack=Bs,t.packSiblings=Us,t.packEnclose=ks,t.partition=$s,t.stratify=Js,t.tree=af,t.treemap=ff,t.treemapBinary=lf,t.treemapDice=Ws,t.treemapSlice=cf,t.treemapSliceDice=hf,t.treemapSquarify=Bm,t.treemapResquarify=jm,t.forceCenter=pf,t.forceCollide=gf,t.forceLink=xf,t.forceManyBody=Tf,t.forceSimulation=Mf,t.forceX=kf,t.forceY=Nf,t.drag=Uf,t.dragDisable=Ef,t.dragEnable=Cf,t.voronoi=_l,t.zoom=Nl,t.zoomIdentity=nx,t.zoomTransform=xl,t.brush=Fl,t.brushX=Dl,t.brushY=Ol,t.brushSelection=Ul,t.chord=Bl,t.ribbon=Zl,t.geoAlbers=td,t.geoAlbersUsa=ed,t.geoArea=lh,t.geoAzimuthalEqualArea=od,t.geoAzimuthalEqualAreaRaw=pw,t.geoAzimuthalEquidistant=ud,t.geoAzimuthalEquidistantRaw=dw,t.geoBounds=Eh,t.geoCentroid=Ih,t.geoCircle=Jh,t.geoClipExtent=op,t.geoConicConformal=hd,t.geoConicConformalRaw=ld,t.geoConicEqualArea=Kp,t.geoConicEqualAreaRaw=Qp,t.geoConicEquidistant=_d,t.geoConicEquidistantRaw=vd,t.geoDistance=lp,t.geoEquirectangular=dd,t.geoEquirectangularRaw=pd,t.geoGnomonic=gd,t.geoGnomonicRaw=yd,t.geoGraticule=dp,t.geoInterpolate=vp,t.geoLength=fp,t.geoMercator=cd,t.geoMercatorRaw=ad,t.geoOrthographic=xd,t.geoOrthographicRaw=md,t.geoPath=Lp,t.geoProjection=Zp,t.geoProjectionMutator=Gp,t.geoRotation=$h,t.geoStereographic=wd,t.geoStereographicRaw=bd,t.geoStream=uh,t.geoTransform=jp,t.geoTransverseMercator=Td,t.geoTransverseMercatorRaw=Md,Object.defineProperty(t,"__esModule",{value:!0})});
\ No newline at end of file
diff --git a/contrail-webui/common/event-drops-v0.3.0-alpha1.tar.gz b/contrail-webui/common/event-drops-v0.3.0-alpha1.tar.gz
new file mode 100644
index 0000000..aaf516f
--- /dev/null
+++ b/contrail-webui/common/event-drops-v0.3.0-alpha1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/gridstack.js-0.2.5.tar.gz b/contrail-webui/common/gridstack.js-0.2.5.tar.gz
new file mode 100644
index 0000000..61030d6
--- /dev/null
+++ b/contrail-webui/common/gridstack.js-0.2.5.tar.gz
Binary files differ
diff --git a/contrail-webui/common/grunt-karma-0.8.2.tar.gz b/contrail-webui/common/grunt-karma-0.8.2.tar.gz
new file mode 100644
index 0000000..60d5a82
--- /dev/null
+++ b/contrail-webui/common/grunt-karma-0.8.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/jdorn-jsoneditor-0.7.25.js b/contrail-webui/common/jdorn-jsoneditor-0.7.25.js
new file mode 100644
index 0000000..1d0cf75
--- /dev/null
+++ b/contrail-webui/common/jdorn-jsoneditor-0.7.25.js
@@ -0,0 +1,8010 @@
+/*! JSON Editor v0.7.25 - JSON Schema -> HTML Editor
+ * By Jeremy Dorn - https://github.com/jdorn/json-editor/
+ * Released under the MIT license
+ *
+ * Date: 2016-04-12
+ */
+
+/**
+ * See README.md for requirements and usage info
+ */
+
+(function() {
+
+/*jshint loopfunc: true */
+/* Simple JavaScript Inheritance
+ * By John Resig http://ejohn.org/
+ * MIT Licensed.
+ */
+// Inspired by base2 and Prototype
+var Class;
+(function(){
+ var initializing = false, fnTest = /xyz/.test(function(){window.postMessage("xyz");}) ? /\b_super\b/ : /.*/;
+
+ // The base Class implementation (does nothing)
+ Class = function(){};
+
+ // Create a new Class that inherits from this class
+ Class.extend = function(prop) {
+ var _super = this.prototype;
+
+ // Instantiate a base class (but only create the instance,
+ // don't run the init constructor)
+ initializing = true;
+ var prototype = new this();
+ initializing = false;
+
+ // Copy the properties over onto the new prototype
+ for (var name in prop) {
+ // Check if we're overwriting an existing function
+ prototype[name] = typeof prop[name] == "function" &&
+ typeof _super[name] == "function" && fnTest.test(prop[name]) ?
+ (function(name, fn){
+ return function() {
+ var tmp = this._super;
+
+ // Add a new ._super() method that is the same method
+ // but on the super-class
+ this._super = _super[name];
+
+ // The method only need to be bound temporarily, so we
+ // remove it when we're done executing
+ var ret = fn.apply(this, arguments);
+ this._super = tmp;
+
+ return ret;
+ };
+ })(name, prop[name]) :
+ prop[name];
+ }
+
+ // The dummy class constructor
+ function Class() {
+ // All construction is actually done in the init method
+ if ( !initializing && this.init )
+ this.init.apply(this, arguments);
+ }
+
+ // Populate our constructed prototype object
+ Class.prototype = prototype;
+
+ // Enforce the constructor to be what we expect
+ Class.prototype.constructor = Class;
+
+ // And make this class extendable
+ Class.extend = arguments.callee;
+
+ return Class;
+ };
+
+ return Class;
+})();
+
+// CustomEvent constructor polyfill
+// From MDN
+(function () {
+ function CustomEvent ( event, params ) {
+ params = params || { bubbles: false, cancelable: false, detail: undefined };
+ var evt = document.createEvent( 'CustomEvent' );
+ evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
+ return evt;
+ }
+
+ CustomEvent.prototype = window.Event.prototype;
+
+ window.CustomEvent = CustomEvent;
+})();
+
+// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
+// MIT license
+(function() {
+ var lastTime = 0;
+ var vendors = ['ms', 'moz', 'webkit', 'o'];
+ for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
+ window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
+ window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] ||
+ window[vendors[x]+'CancelRequestAnimationFrame'];
+ }
+
+ if (!window.requestAnimationFrame)
+ window.requestAnimationFrame = function(callback, element) {
+ var currTime = new Date().getTime();
+ var timeToCall = Math.max(0, 16 - (currTime - lastTime));
+ var id = window.setTimeout(function() { callback(currTime + timeToCall); },
+ timeToCall);
+ lastTime = currTime + timeToCall;
+ return id;
+ };
+
+ if (!window.cancelAnimationFrame)
+ window.cancelAnimationFrame = function(id) {
+ clearTimeout(id);
+ };
+}());
+
+// Array.isArray polyfill
+// From MDN
+(function() {
+ if(!Array.isArray) {
+ Array.isArray = function(arg) {
+ return Object.prototype.toString.call(arg) === '[object Array]';
+ };
+ }
+}());
+/**
+ * Taken from jQuery 2.1.3
+ *
+ * @param obj
+ * @returns {boolean}
+ */
+var $isplainobject = function( obj ) {
+ // Not plain objects:
+ // - Any object or value whose internal [[Class]] property is not "[object Object]"
+ // - DOM nodes
+ // - window
+ if (typeof obj !== "object" || obj.nodeType || (obj !== null && obj === obj.window)) {
+ return false;
+ }
+
+ if (obj.constructor && !Object.prototype.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) {
+ return false;
+ }
+
+ // If the function hasn't returned already, we're confident that
+ // |obj| is a plain object, created by {} or constructed with new Object
+ return true;
+};
+
+var $extend = function(destination) {
+ var source, i,property;
+ for(i=1; i<arguments.length; i++) {
+ source = arguments[i];
+ for (property in source) {
+ if(!source.hasOwnProperty(property)) continue;
+ if(source[property] && $isplainobject(source[property])) {
+ if(!destination.hasOwnProperty(property)) destination[property] = {};
+ $extend(destination[property], source[property]);
+ }
+ else {
+ destination[property] = source[property];
+ }
+ }
+ }
+ return destination;
+};
+
+var $each = function(obj,callback) {
+ if(!obj || typeof obj !== "object") return;
+ var i;
+ if(Array.isArray(obj) || (typeof obj.length === 'number' && obj.length > 0 && (obj.length - 1) in obj)) {
+ for(i=0; i<obj.length; i++) {
+ if(callback(i,obj[i])===false) return;
+ }
+ }
+ else {
+ if (Object.keys) {
+ var keys = Object.keys(obj);
+ for(i=0; i<keys.length; i++) {
+ if(callback(keys[i],obj[keys[i]])===false) return;
+ }
+ }
+ else {
+ for(i in obj) {
+ if(!obj.hasOwnProperty(i)) continue;
+ if(callback(i,obj[i])===false) return;
+ }
+ }
+ }
+};
+
+var $trigger = function(el,event) {
+ var e = document.createEvent('HTMLEvents');
+ e.initEvent(event, true, true);
+ el.dispatchEvent(e);
+};
+var $triggerc = function(el,event) {
+ var e = new CustomEvent(event,{
+ bubbles: true,
+ cancelable: true
+ });
+
+ el.dispatchEvent(e);
+};
+
+var JSONEditor = function(element,options) {
+ if (!(element instanceof Element)) {
+ throw new Error('element should be an instance of Element');
+ }
+ options = $extend({},JSONEditor.defaults.options,options||{});
+ this.element = element;
+ this.options = options;
+ this.init();
+};
+JSONEditor.prototype = {
+ // necessary since we remove the ctor property by doing a literal assignment. Without this
+ // the $isplainobject function will think that this is a plain object.
+ constructor: JSONEditor,
+ init: function() {
+ var self = this;
+
+ this.ready = false;
+
+ var theme_class = JSONEditor.defaults.themes[this.options.theme || JSONEditor.defaults.theme];
+ if(!theme_class) throw "Unknown theme " + (this.options.theme || JSONEditor.defaults.theme);
+
+ this.schema = this.options.schema;
+ this.theme = new theme_class();
+ this.template = this.options.template;
+ this.refs = this.options.refs || {};
+ this.uuid = 0;
+ this.__data = {};
+
+ var icon_class = JSONEditor.defaults.iconlibs[this.options.iconlib || JSONEditor.defaults.iconlib];
+ if(icon_class) this.iconlib = new icon_class();
+
+ this.root_container = this.theme.getContainer();
+ this.element.appendChild(this.root_container);
+
+ this.translate = this.options.translate || JSONEditor.defaults.translate;
+
+ // Fetch all external refs via ajax
+ this._loadExternalRefs(this.schema, function() {
+ self._getDefinitions(self.schema);
+
+ // Validator options
+ var validator_options = {};
+ if(self.options.custom_validators) {
+ validator_options.custom_validators = self.options.custom_validators;
+ }
+ self.validator = new JSONEditor.Validator(self,null,validator_options);
+
+ // Create the root editor
+ var editor_class = self.getEditorClass(self.schema);
+ self.root = self.createEditor(editor_class, {
+ jsoneditor: self,
+ schema: self.schema,
+ required: true,
+ container: self.root_container
+ });
+
+ self.root.preBuild();
+ self.root.build();
+ self.root.postBuild();
+
+ // Starting data
+ if(self.options.startval) self.root.setValue(self.options.startval);
+
+ self.validation_results = self.validator.validate(self.root.getValue());
+ self.root.showValidationErrors(self.validation_results);
+ self.ready = true;
+
+ // Fire ready event asynchronously
+ window.requestAnimationFrame(function() {
+ if(!self.ready) return;
+ self.validation_results = self.validator.validate(self.root.getValue());
+ self.root.showValidationErrors(self.validation_results);
+ self.trigger('ready');
+ self.trigger('change');
+ });
+ });
+ },
+ getValue: function() {
+ if(!this.ready) throw "JSON Editor not ready yet. Listen for 'ready' event before getting the value";
+
+ return this.root.getValue();
+ },
+ setValue: function(value) {
+ if(!this.ready) throw "JSON Editor not ready yet. Listen for 'ready' event before setting the value";
+
+ this.root.setValue(value);
+ return this;
+ },
+ validate: function(value) {
+ if(!this.ready) throw "JSON Editor not ready yet. Listen for 'ready' event before validating";
+
+ // Custom value
+ if(arguments.length === 1) {
+ return this.validator.validate(value);
+ }
+ // Current value (use cached result)
+ else {
+ return this.validation_results;
+ }
+ },
+ destroy: function() {
+ if(this.destroyed) return;
+ if(!this.ready) return;
+
+ this.schema = null;
+ this.options = null;
+ this.root.destroy();
+ this.root = null;
+ this.root_container = null;
+ this.validator = null;
+ this.validation_results = null;
+ this.theme = null;
+ this.iconlib = null;
+ this.template = null;
+ this.__data = null;
+ this.ready = false;
+ this.element.innerHTML = '';
+
+ this.destroyed = true;
+ },
+ on: function(event, callback) {
+ this.callbacks = this.callbacks || {};
+ this.callbacks[event] = this.callbacks[event] || [];
+ this.callbacks[event].push(callback);
+
+ return this;
+ },
+ off: function(event, callback) {
+ // Specific callback
+ if(event && callback) {
+ this.callbacks = this.callbacks || {};
+ this.callbacks[event] = this.callbacks[event] || [];
+ var newcallbacks = [];
+ for(var i=0; i<this.callbacks[event].length; i++) {
+ if(this.callbacks[event][i]===callback) continue;
+ newcallbacks.push(this.callbacks[event][i]);
+ }
+ this.callbacks[event] = newcallbacks;
+ }
+ // All callbacks for a specific event
+ else if(event) {
+ this.callbacks = this.callbacks || {};
+ this.callbacks[event] = [];
+ }
+ // All callbacks for all events
+ else {
+ this.callbacks = {};
+ }
+
+ return this;
+ },
+ trigger: function(event) {
+ if(this.callbacks && this.callbacks[event] && this.callbacks[event].length) {
+ for(var i=0; i<this.callbacks[event].length; i++) {
+ this.callbacks[event][i]();
+ }
+ }
+
+ return this;
+ },
+ setOption: function(option, value) {
+ if(option === "show_errors") {
+ this.options.show_errors = value;
+ this.onChange();
+ }
+ // Only the `show_errors` option is supported for now
+ else {
+ throw "Option "+option+" must be set during instantiation and cannot be changed later";
+ }
+
+ return this;
+ },
+ getEditorClass: function(schema) {
+ var classname;
+
+ schema = this.expandSchema(schema);
+
+ $each(JSONEditor.defaults.resolvers,function(i,resolver) {
+ var tmp = resolver(schema);
+ if(tmp) {
+ if(JSONEditor.defaults.editors[tmp]) {
+ classname = tmp;
+ return false;
+ }
+ }
+ });
+
+ if(!classname) throw "Unknown editor for schema "+JSON.stringify(schema);
+ if(!JSONEditor.defaults.editors[classname]) throw "Unknown editor "+classname;
+
+ return JSONEditor.defaults.editors[classname];
+ },
+ createEditor: function(editor_class, options) {
+ options = $extend({},editor_class.options||{},options);
+ return new editor_class(options);
+ },
+ onChange: function() {
+ if(!this.ready) return;
+
+ if(this.firing_change) return;
+ this.firing_change = true;
+
+ var self = this;
+
+ window.requestAnimationFrame(function() {
+ self.firing_change = false;
+ if(!self.ready) return;
+
+ // Validate and cache results
+ self.validation_results = self.validator.validate(self.root.getValue());
+
+ if(self.options.show_errors !== "never") {
+ self.root.showValidationErrors(self.validation_results);
+ }
+ else {
+ self.root.showValidationErrors([]);
+ }
+
+ // Fire change event
+ self.trigger('change');
+ });
+
+ return this;
+ },
+ compileTemplate: function(template, name) {
+ name = name || JSONEditor.defaults.template;
+
+ var engine;
+
+ // Specifying a preset engine
+ if(typeof name === 'string') {
+ if(!JSONEditor.defaults.templates[name]) throw "Unknown template engine "+name;
+ engine = JSONEditor.defaults.templates[name]();
+
+ if(!engine) throw "Template engine "+name+" missing required library.";
+ }
+ // Specifying a custom engine
+ else {
+ engine = name;
+ }
+
+ if(!engine) throw "No template engine set";
+ if(!engine.compile) throw "Invalid template engine set";
+
+ return engine.compile(template);
+ },
+ _data: function(el,key,value) {
+ // Setting data
+ if(arguments.length === 3) {
+ var uuid;
+ if(el.hasAttribute('data-jsoneditor-'+key)) {
+ uuid = el.getAttribute('data-jsoneditor-'+key);
+ }
+ else {
+ uuid = this.uuid++;
+ el.setAttribute('data-jsoneditor-'+key,uuid);
+ }
+
+ this.__data[uuid] = value;
+ }
+ // Getting data
+ else {
+ // No data stored
+ if(!el.hasAttribute('data-jsoneditor-'+key)) return null;
+
+ return this.__data[el.getAttribute('data-jsoneditor-'+key)];
+ }
+ },
+ registerEditor: function(editor) {
+ this.editors = this.editors || {};
+ this.editors[editor.path] = editor;
+ return this;
+ },
+ unregisterEditor: function(editor) {
+ this.editors = this.editors || {};
+ this.editors[editor.path] = null;
+ return this;
+ },
+ getEditor: function(path) {
+ if(!this.editors) return;
+ return this.editors[path];
+ },
+ watch: function(path,callback) {
+ this.watchlist = this.watchlist || {};
+ this.watchlist[path] = this.watchlist[path] || [];
+ this.watchlist[path].push(callback);
+
+ return this;
+ },
+ unwatch: function(path,callback) {
+ if(!this.watchlist || !this.watchlist[path]) return this;
+ // If removing all callbacks for a path
+ if(!callback) {
+ this.watchlist[path] = null;
+ return this;
+ }
+
+ var newlist = [];
+ for(var i=0; i<this.watchlist[path].length; i++) {
+ if(this.watchlist[path][i] === callback) continue;
+ else newlist.push(this.watchlist[path][i]);
+ }
+ this.watchlist[path] = newlist.length? newlist : null;
+ return this;
+ },
+ notifyWatchers: function(path) {
+ if(!this.watchlist || !this.watchlist[path]) return this;
+ for(var i=0; i<this.watchlist[path].length; i++) {
+ this.watchlist[path][i]();
+ }
+ },
+ isEnabled: function() {
+ return !this.root || this.root.isEnabled();
+ },
+ enable: function() {
+ this.root.enable();
+ },
+ disable: function() {
+ this.root.disable();
+ },
+ _getDefinitions: function(schema,path) {
+ path = path || '#/definitions/';
+ if(schema.definitions) {
+ for(var i in schema.definitions) {
+ if(!schema.definitions.hasOwnProperty(i)) continue;
+ this.refs[path+i] = schema.definitions[i];
+ if(schema.definitions[i].definitions) {
+ this._getDefinitions(schema.definitions[i],path+i+'/definitions/');
+ }
+ }
+ }
+ },
+ _getExternalRefs: function(schema) {
+ var refs = {};
+ var merge_refs = function(newrefs) {
+ for(var i in newrefs) {
+ if(newrefs.hasOwnProperty(i)) {
+ refs[i] = true;
+ }
+ }
+ };
+
+ if(schema.$ref && typeof schema.$ref !== "object" && schema.$ref.substr(0,1) !== "#" && !this.refs[schema.$ref]) {
+ refs[schema.$ref] = true;
+ }
+
+ for(var i in schema) {
+ if(!schema.hasOwnProperty(i)) continue;
+ if(schema[i] && typeof schema[i] === "object" && Array.isArray(schema[i])) {
+ for(var j=0; j<schema[i].length; j++) {
+ if(typeof schema[i][j]==="object") {
+ merge_refs(this._getExternalRefs(schema[i][j]));
+ }
+ }
+ }
+ else if(schema[i] && typeof schema[i] === "object") {
+ merge_refs(this._getExternalRefs(schema[i]));
+ }
+ }
+
+ return refs;
+ },
+ _loadExternalRefs: function(schema, callback) {
+ var self = this;
+ var refs = this._getExternalRefs(schema);
+
+ var done = 0, waiting = 0, callback_fired = false;
+
+ $each(refs,function(url) {
+ if(self.refs[url]) return;
+ if(!self.options.ajax) throw "Must set ajax option to true to load external ref "+url;
+ self.refs[url] = 'loading';
+ waiting++;
+
+ var r = new XMLHttpRequest();
+ r.open("GET", url, true);
+ r.onreadystatechange = function () {
+ if (r.readyState != 4) return;
+ // Request succeeded
+ if(r.status === 200) {
+ var response;
+ try {
+ response = JSON.parse(r.responseText);
+ }
+ catch(e) {
+ window.console.log(e);
+ throw "Failed to parse external ref "+url;
+ }
+ if(!response || typeof response !== "object") throw "External ref does not contain a valid schema - "+url;
+
+ self.refs[url] = response;
+ self._loadExternalRefs(response,function() {
+ done++;
+ if(done >= waiting && !callback_fired) {
+ callback_fired = true;
+ callback();
+ }
+ });
+ }
+ // Request failed
+ else {
+ window.console.log(r);
+ throw "Failed to fetch ref via ajax- "+url;
+ }
+ };
+ r.send();
+ });
+
+ if(!waiting) {
+ callback();
+ }
+ },
+ expandRefs: function(schema) {
+ schema = $extend({},schema);
+
+ while (schema.$ref) {
+ var ref = schema.$ref;
+ delete schema.$ref;
+
+ if(!this.refs[ref]) ref = decodeURIComponent(ref);
+
+ schema = this.extendSchemas(schema,this.refs[ref]);
+ }
+ return schema;
+ },
+ expandSchema: function(schema) {
+ var self = this;
+ var extended = $extend({},schema);
+ var i;
+
+ // Version 3 `type`
+ if(typeof schema.type === 'object') {
+ // Array of types
+ if(Array.isArray(schema.type)) {
+ $each(schema.type, function(key,value) {
+ // Schema
+ if(typeof value === 'object') {
+ schema.type[key] = self.expandSchema(value);
+ }
+ });
+ }
+ // Schema
+ else {
+ schema.type = self.expandSchema(schema.type);
+ }
+ }
+ // Version 3 `disallow`
+ if(typeof schema.disallow === 'object') {
+ // Array of types
+ if(Array.isArray(schema.disallow)) {
+ $each(schema.disallow, function(key,value) {
+ // Schema
+ if(typeof value === 'object') {
+ schema.disallow[key] = self.expandSchema(value);
+ }
+ });
+ }
+ // Schema
+ else {
+ schema.disallow = self.expandSchema(schema.disallow);
+ }
+ }
+ // Version 4 `anyOf`
+ if(schema.anyOf) {
+ $each(schema.anyOf, function(key,value) {
+ schema.anyOf[key] = self.expandSchema(value);
+ });
+ }
+ // Version 4 `dependencies` (schema dependencies)
+ if(schema.dependencies) {
+ $each(schema.dependencies,function(key,value) {
+ if(typeof value === "object" && !(Array.isArray(value))) {
+ schema.dependencies[key] = self.expandSchema(value);
+ }
+ });
+ }
+ // Version 4 `not`
+ if(schema.not) {
+ schema.not = this.expandSchema(schema.not);
+ }
+
+ // allOf schemas should be merged into the parent
+ if(schema.allOf) {
+ for(i=0; i<schema.allOf.length; i++) {
+ extended = this.extendSchemas(extended,this.expandSchema(schema.allOf[i]));
+ }
+ delete extended.allOf;
+ }
+ // extends schemas should be merged into parent
+ if(schema["extends"]) {
+ // If extends is a schema
+ if(!(Array.isArray(schema["extends"]))) {
+ extended = this.extendSchemas(extended,this.expandSchema(schema["extends"]));
+ }
+ // If extends is an array of schemas
+ else {
+ for(i=0; i<schema["extends"].length; i++) {
+ extended = this.extendSchemas(extended,this.expandSchema(schema["extends"][i]));
+ }
+ }
+ delete extended["extends"];
+ }
+ // parent should be merged into oneOf schemas
+ if(schema.oneOf) {
+ var tmp = $extend({},extended);
+ delete tmp.oneOf;
+ for(i=0; i<schema.oneOf.length; i++) {
+ extended.oneOf[i] = this.extendSchemas(this.expandSchema(schema.oneOf[i]),tmp);
+ }
+ }
+
+ return this.expandRefs(extended);
+ },
+ extendSchemas: function(obj1, obj2) {
+ obj1 = $extend({},obj1);
+ obj2 = $extend({},obj2);
+
+ var self = this;
+ var extended = {};
+ $each(obj1, function(prop,val) {
+ // If this key is also defined in obj2, merge them
+ if(typeof obj2[prop] !== "undefined") {
+ // Required arrays should be unioned together
+ if(prop === 'required' && typeof val === "object" && Array.isArray(val)) {
+ // Union arrays and unique
+ extended.required = val.concat(obj2[prop]).reduce(function(p, c) {
+ if (p.indexOf(c) < 0) p.push(c);
+ return p;
+ }, []);
+ }
+ // Type should be intersected and is either an array or string
+ else if(prop === 'type' && (typeof val === "string" || Array.isArray(val))) {
+ // Make sure we're dealing with arrays
+ if(typeof val === "string") val = [val];
+ if(typeof obj2.type === "string") obj2.type = [obj2.type];
+
+
+ extended.type = val.filter(function(n) {
+ return obj2.type.indexOf(n) !== -1;
+ });
+
+ // If there's only 1 type and it's a primitive, use a string instead of array
+ if(extended.type.length === 1 && typeof extended.type[0] === "string") {
+ extended.type = extended.type[0];
+ }
+ }
+ // All other arrays should be intersected (enum, etc.)
+ else if(typeof val === "object" && Array.isArray(val)){
+ extended[prop] = val.filter(function(n) {
+ return obj2[prop].indexOf(n) !== -1;
+ });
+ }
+ // Objects should be recursively merged
+ else if(typeof val === "object" && val !== null) {
+ extended[prop] = self.extendSchemas(val,obj2[prop]);
+ }
+ // Otherwise, use the first value
+ else {
+ extended[prop] = val;
+ }
+ }
+ // Otherwise, just use the one in obj1
+ else {
+ extended[prop] = val;
+ }
+ });
+ // Properties in obj2 that aren't in obj1
+ $each(obj2, function(prop,val) {
+ if(typeof obj1[prop] === "undefined") {
+ extended[prop] = val;
+ }
+ });
+
+ return extended;
+ }
+};
+
+JSONEditor.defaults = {
+ themes: {},
+ templates: {},
+ iconlibs: {},
+ editors: {},
+ languages: {},
+ resolvers: [],
+ custom_validators: []
+};
+
+JSONEditor.Validator = Class.extend({
+ init: function(jsoneditor,schema,options) {
+ this.jsoneditor = jsoneditor;
+ this.schema = schema || this.jsoneditor.schema;
+ this.options = options || {};
+ this.translate = this.jsoneditor.translate || JSONEditor.defaults.translate;
+ },
+ validate: function(value) {
+ return this._validateSchema(this.schema, value);
+ },
+ _validateSchema: function(schema,value,path) {
+ var self = this;
+ var errors = [];
+ var valid, i, j;
+ var stringified = JSON.stringify(value);
+
+ path = path || 'root';
+
+ // Work on a copy of the schema
+ schema = $extend({},this.jsoneditor.expandRefs(schema));
+
+ /*
+ * Type Agnostic Validation
+ */
+
+ // Version 3 `required`
+ if(schema.required && schema.required === true) {
+ if(typeof value === "undefined") {
+ errors.push({
+ path: path,
+ property: 'required',
+ message: this.translate("error_notset")
+ });
+
+ // Can't do any more validation at this point
+ return errors;
+ }
+ }
+ // Value not defined
+ else if(typeof value === "undefined") {
+ // If required_by_default is set, all fields are required
+ if(this.jsoneditor.options.required_by_default) {
+ errors.push({
+ path: path,
+ property: 'required',
+ message: this.translate("error_notset")
+ });
+ }
+ // Not required, no further validation needed
+ else {
+ return errors;
+ }
+ }
+
+ // `enum`
+ if(schema["enum"]) {
+ valid = false;
+ for(i=0; i<schema["enum"].length; i++) {
+ if(stringified === JSON.stringify(schema["enum"][i])) valid = true;
+ }
+ if(!valid) {
+ errors.push({
+ path: path,
+ property: 'enum',
+ message: this.translate("error_enum")
+ });
+ }
+ }
+
+ // `extends` (version 3)
+ if(schema["extends"]) {
+ for(i=0; i<schema["extends"].length; i++) {
+ errors = errors.concat(this._validateSchema(schema["extends"][i],value,path));
+ }
+ }
+
+ // `allOf`
+ if(schema.allOf) {
+ for(i=0; i<schema.allOf.length; i++) {
+ errors = errors.concat(this._validateSchema(schema.allOf[i],value,path));
+ }
+ }
+
+ // `anyOf`
+ if(schema.anyOf) {
+ valid = false;
+ for(i=0; i<schema.anyOf.length; i++) {
+ if(!this._validateSchema(schema.anyOf[i],value,path).length) {
+ valid = true;
+ break;
+ }
+ }
+ if(!valid) {
+ errors.push({
+ path: path,
+ property: 'anyOf',
+ message: this.translate('error_anyOf')
+ });
+ }
+ }
+
+ // `oneOf`
+ if(schema.oneOf) {
+ valid = 0;
+ var oneof_errors = [];
+ for(i=0; i<schema.oneOf.length; i++) {
+ // Set the error paths to be path.oneOf[i].rest.of.path
+ var tmp = this._validateSchema(schema.oneOf[i],value,path);
+ if(!tmp.length) {
+ valid++;
+ }
+
+ for(j=0; j<tmp.length; j++) {
+ tmp[j].path = path+'.oneOf['+i+']'+tmp[j].path.substr(path.length);
+ }
+ oneof_errors = oneof_errors.concat(tmp);
+
+ }
+ if(valid !== 1) {
+ errors.push({
+ path: path,
+ property: 'oneOf',
+ message: this.translate('error_oneOf', [valid])
+ });
+ errors = errors.concat(oneof_errors);
+ }
+ }
+
+ // `not`
+ if(schema.not) {
+ if(!this._validateSchema(schema.not,value,path).length) {
+ errors.push({
+ path: path,
+ property: 'not',
+ message: this.translate('error_not')
+ });
+ }
+ }
+
+ // `type` (both Version 3 and Version 4 support)
+ if(schema.type) {
+ // Union type
+ if(Array.isArray(schema.type)) {
+ valid = false;
+ for(i=0;i<schema.type.length;i++) {
+ if(this._checkType(schema.type[i], value)) {
+ valid = true;
+ break;
+ }
+ }
+ if(!valid) {
+ errors.push({
+ path: path,
+ property: 'type',
+ message: this.translate('error_type_union')
+ });
+ }
+ }
+ // Simple type
+ else {
+ if(!this._checkType(schema.type, value)) {
+ errors.push({
+ path: path,
+ property: 'type',
+ message: this.translate('error_type', [schema.type])
+ });
+ }
+ }
+ }
+
+
+ // `disallow` (version 3)
+ if(schema.disallow) {
+ // Union type
+ if(Array.isArray(schema.disallow)) {
+ valid = true;
+ for(i=0;i<schema.disallow.length;i++) {
+ if(this._checkType(schema.disallow[i], value)) {
+ valid = false;
+ break;
+ }
+ }
+ if(!valid) {
+ errors.push({
+ path: path,
+ property: 'disallow',
+ message: this.translate('error_disallow_union')
+ });
+ }
+ }
+ // Simple type
+ else {
+ if(this._checkType(schema.disallow, value)) {
+ errors.push({
+ path: path,
+ property: 'disallow',
+ message: this.translate('error_disallow', [schema.disallow])
+ });
+ }
+ }
+ }
+
+ /*
+ * Type Specific Validation
+ */
+
+ // Number Specific Validation
+ if(typeof value === "number") {
+ // `multipleOf` and `divisibleBy`
+ if(schema.multipleOf || schema.divisibleBy) {
+ var divisor = schema.multipleOf || schema.divisibleBy;
+ // Vanilla JS, prone to floating point rounding errors (e.g. 1.14 / .01 == 113.99999)
+ valid = (value/divisor === Math.floor(value/divisor));
+
+ // Use math.js is available
+ if(window.math) {
+ valid = window.math.mod(window.math.bignumber(value), window.math.bignumber(divisor)).equals(0);
+ }
+ // Use decimal.js is available
+ else if(window.Decimal) {
+ valid = (new window.Decimal(value)).mod(new window.Decimal(divisor)).equals(0);
+ }
+
+ if(!valid) {
+ errors.push({
+ path: path,
+ property: schema.multipleOf? 'multipleOf' : 'divisibleBy',
+ message: this.translate('error_multipleOf', [divisor])
+ });
+ }
+ }
+
+ // `maximum`
+ if(schema.hasOwnProperty('maximum')) {
+ // Vanilla JS, prone to floating point rounding errors (e.g. .999999999999999 == 1)
+ valid = schema.exclusiveMaximum? (value < schema.maximum) : (value <= schema.maximum);
+
+ // Use math.js is available
+ if(window.math) {
+ valid = window.math[schema.exclusiveMaximum?'smaller':'smallerEq'](
+ window.math.bignumber(value),
+ window.math.bignumber(schema.maximum)
+ );
+ }
+ // Use Decimal.js if available
+ else if(window.Decimal) {
+ valid = (new window.Decimal(value))[schema.exclusiveMaximum?'lt':'lte'](new window.Decimal(schema.maximum));
+ }
+
+ if(!valid) {
+ errors.push({
+ path: path,
+ property: 'maximum',
+ message: this.translate(
+ (schema.exclusiveMaximum?'error_maximum_excl':'error_maximum_incl'),
+ [schema.maximum]
+ )
+ });
+ }
+ }
+
+ // `minimum`
+ if(schema.hasOwnProperty('minimum')) {
+ // Vanilla JS, prone to floating point rounding errors (e.g. .999999999999999 == 1)
+ valid = schema.exclusiveMinimum? (value > schema.minimum) : (value >= schema.minimum);
+
+ // Use math.js is available
+ if(window.math) {
+ valid = window.math[schema.exclusiveMinimum?'larger':'largerEq'](
+ window.math.bignumber(value),
+ window.math.bignumber(schema.minimum)
+ );
+ }
+ // Use Decimal.js if available
+ else if(window.Decimal) {
+ valid = (new window.Decimal(value))[schema.exclusiveMinimum?'gt':'gte'](new window.Decimal(schema.minimum));
+ }
+
+ if(!valid) {
+ errors.push({
+ path: path,
+ property: 'minimum',
+ message: this.translate(
+ (schema.exclusiveMinimum?'error_minimum_excl':'error_minimum_incl'),
+ [schema.minimum]
+ )
+ });
+ }
+ }
+ }
+ // String specific validation
+ else if(typeof value === "string") {
+ // `maxLength`
+ if(schema.maxLength) {
+ if((value+"").length > schema.maxLength) {
+ errors.push({
+ path: path,
+ property: 'maxLength',
+ message: this.translate('error_maxLength', [schema.maxLength])
+ });
+ }
+ }
+
+ // `minLength`
+ if(schema.minLength) {
+ if((value+"").length < schema.minLength) {
+ errors.push({
+ path: path,
+ property: 'minLength',
+ message: this.translate((schema.minLength===1?'error_notempty':'error_minLength'), [schema.minLength])
+ });
+ }
+ }
+
+ // `pattern`
+ if(schema.pattern) {
+ if(!(new RegExp(schema.pattern)).test(value)) {
+ errors.push({
+ path: path,
+ property: 'pattern',
+ message: this.translate('error_pattern', [schema.pattern])
+ });
+ }
+ }
+ }
+ // Array specific validation
+ else if(typeof value === "object" && value !== null && Array.isArray(value)) {
+ // `items` and `additionalItems`
+ if(schema.items) {
+ // `items` is an array
+ if(Array.isArray(schema.items)) {
+ for(i=0; i<value.length; i++) {
+ // If this item has a specific schema tied to it
+ // Validate against it
+ if(schema.items[i]) {
+ errors = errors.concat(this._validateSchema(schema.items[i],value[i],path+'.'+i));
+ }
+ // If all additional items are allowed
+ else if(schema.additionalItems === true) {
+ break;
+ }
+ // If additional items is a schema
+ // TODO: Incompatibility between version 3 and 4 of the spec
+ else if(schema.additionalItems) {
+ errors = errors.concat(this._validateSchema(schema.additionalItems,value[i],path+'.'+i));
+ }
+ // If no additional items are allowed
+ else if(schema.additionalItems === false) {
+ errors.push({
+ path: path,
+ property: 'additionalItems',
+ message: this.translate('error_additionalItems')
+ });
+ break;
+ }
+ // Default for `additionalItems` is an empty schema
+ else {
+ break;
+ }
+ }
+ }
+ // `items` is a schema
+ else {
+ // Each item in the array must validate against the schema
+ for(i=0; i<value.length; i++) {
+ errors = errors.concat(this._validateSchema(schema.items,value[i],path+'.'+i));
+ }
+ }
+ }
+
+ // `maxItems`
+ if(schema.maxItems) {
+ if(value.length > schema.maxItems) {
+ errors.push({
+ path: path,
+ property: 'maxItems',
+ message: this.translate('error_maxItems', [schema.maxItems])
+ });
+ }
+ }
+
+ // `minItems`
+ if(schema.minItems) {
+ if(value.length < schema.minItems) {
+ errors.push({
+ path: path,
+ property: 'minItems',
+ message: this.translate('error_minItems', [schema.minItems])
+ });
+ }
+ }
+
+ // `uniqueItems`
+ if(schema.uniqueItems) {
+ var seen = {};
+ for(i=0; i<value.length; i++) {
+ valid = JSON.stringify(value[i]);
+ if(seen[valid]) {
+ errors.push({
+ path: path,
+ property: 'uniqueItems',
+ message: this.translate('error_uniqueItems')
+ });
+ break;
+ }
+ seen[valid] = true;
+ }
+ }
+ }
+ // Object specific validation
+ else if(typeof value === "object" && value !== null) {
+ // `maxProperties`
+ if(schema.maxProperties) {
+ valid = 0;
+ for(i in value) {
+ if(!value.hasOwnProperty(i)) continue;
+ valid++;
+ }
+ if(valid > schema.maxProperties) {
+ errors.push({
+ path: path,
+ property: 'maxProperties',
+ message: this.translate('error_maxProperties', [schema.maxProperties])
+ });
+ }
+ }
+
+ // `minProperties`
+ if(schema.minProperties) {
+ valid = 0;
+ for(i in value) {
+ if(!value.hasOwnProperty(i)) continue;
+ valid++;
+ }
+ if(valid < schema.minProperties) {
+ errors.push({
+ path: path,
+ property: 'minProperties',
+ message: this.translate('error_minProperties', [schema.minProperties])
+ });
+ }
+ }
+
+ // Version 4 `required`
+ if(schema.required && Array.isArray(schema.required)) {
+ for(i=0; i<schema.required.length; i++) {
+ if(typeof value[schema.required[i]] === "undefined") {
+ errors.push({
+ path: path,
+ property: 'required',
+ message: this.translate('error_required', [schema.required[i]])
+ });
+ }
+ }
+ }
+
+ // `properties`
+ var validated_properties = {};
+ if(schema.properties) {
+ for(i in schema.properties) {
+ if(!schema.properties.hasOwnProperty(i)) continue;
+ validated_properties[i] = true;
+ errors = errors.concat(this._validateSchema(schema.properties[i],value[i],path+'.'+i));
+ }
+ }
+
+ // `patternProperties`
+ if(schema.patternProperties) {
+ for(i in schema.patternProperties) {
+ if(!schema.patternProperties.hasOwnProperty(i)) continue;
+
+ var regex = new RegExp(i);
+
+ // Check which properties match
+ for(j in value) {
+ if(!value.hasOwnProperty(j)) continue;
+ if(regex.test(j)) {
+ validated_properties[j] = true;
+ errors = errors.concat(this._validateSchema(schema.patternProperties[i],value[j],path+'.'+j));
+ }
+ }
+ }
+ }
+
+ // The no_additional_properties option currently doesn't work with extended schemas that use oneOf or anyOf
+ if(typeof schema.additionalProperties === "undefined" && this.jsoneditor.options.no_additional_properties && !schema.oneOf && !schema.anyOf) {
+ schema.additionalProperties = false;
+ }
+
+ // `additionalProperties`
+ if(typeof schema.additionalProperties !== "undefined") {
+ for(i in value) {
+ if(!value.hasOwnProperty(i)) continue;
+ if(!validated_properties[i]) {
+ // No extra properties allowed
+ if(!schema.additionalProperties) {
+ errors.push({
+ path: path,
+ property: 'additionalProperties',
+ message: this.translate('error_additional_properties', [i])
+ });
+ break;
+ }
+ // Allowed
+ else if(schema.additionalProperties === true) {
+ break;
+ }
+ // Must match schema
+ // TODO: incompatibility between version 3 and 4 of the spec
+ else {
+ errors = errors.concat(this._validateSchema(schema.additionalProperties,value[i],path+'.'+i));
+ }
+ }
+ }
+ }
+
+ // `dependencies`
+ if(schema.dependencies) {
+ for(i in schema.dependencies) {
+ if(!schema.dependencies.hasOwnProperty(i)) continue;
+
+ // Doesn't need to meet the dependency
+ if(typeof value[i] === "undefined") continue;
+
+ // Property dependency
+ if(Array.isArray(schema.dependencies[i])) {
+ for(j=0; j<schema.dependencies[i].length; j++) {
+ if(typeof value[schema.dependencies[i][j]] === "undefined") {
+ errors.push({
+ path: path,
+ property: 'dependencies',
+ message: this.translate('error_dependency', [schema.dependencies[i][j]])
+ });
+ }
+ }
+ }
+ // Schema dependency
+ else {
+ errors = errors.concat(this._validateSchema(schema.dependencies[i],value,path));
+ }
+ }
+ }
+ }
+
+ // Custom type validation (global)
+ $each(JSONEditor.defaults.custom_validators,function(i,validator) {
+ errors = errors.concat(validator.call(self,schema,value,path));
+ });
+ // Custom type validation (instance specific)
+ if(this.options.custom_validators) {
+ $each(this.options.custom_validators,function(i,validator) {
+ errors = errors.concat(validator.call(self,schema,value,path));
+ });
+ }
+
+ return errors;
+ },
+ _checkType: function(type, value) {
+ // Simple types
+ if(typeof type === "string") {
+ if(type==="string") return typeof value === "string";
+ else if(type==="number") return typeof value === "number";
+ else if(type==="integer") return typeof value === "number" && value === Math.floor(value);
+ else if(type==="boolean") return typeof value === "boolean";
+ else if(type==="array") return Array.isArray(value);
+ else if(type === "object") return value !== null && !(Array.isArray(value)) && typeof value === "object";
+ else if(type === "null") return value === null;
+ else return true;
+ }
+ // Schema
+ else {
+ return !this._validateSchema(type,value).length;
+ }
+ }
+});
+
+/**
+ * All editors should extend from this class
+ */
+JSONEditor.AbstractEditor = Class.extend({
+ onChildEditorChange: function(editor) {
+ this.onChange(true);
+ },
+ notify: function() {
+ this.jsoneditor.notifyWatchers(this.path);
+ },
+ change: function() {
+ if(this.parent) this.parent.onChildEditorChange(this);
+ else this.jsoneditor.onChange();
+ },
+ onChange: function(bubble) {
+ this.notify();
+ if(this.watch_listener) this.watch_listener();
+ if(bubble) this.change();
+ },
+ register: function() {
+ this.jsoneditor.registerEditor(this);
+ this.onChange();
+ },
+ unregister: function() {
+ if(!this.jsoneditor) return;
+ this.jsoneditor.unregisterEditor(this);
+ },
+ getNumColumns: function() {
+ return 12;
+ },
+ init: function(options) {
+ this.jsoneditor = options.jsoneditor;
+
+ this.theme = this.jsoneditor.theme;
+ this.template_engine = this.jsoneditor.template;
+ this.iconlib = this.jsoneditor.iconlib;
+
+ this.translate = this.jsoneditor.translate || JSONEditor.defaults.translate;
+
+ this.original_schema = options.schema;
+ this.schema = this.jsoneditor.expandSchema(this.original_schema);
+
+ this.options = $extend({}, (this.options || {}), (options.schema.options || {}), options);
+
+ if(!options.path && !this.schema.id) this.schema.id = 'root';
+ this.path = options.path || 'root';
+ this.formname = options.formname || this.path.replace(/\.([^.]+)/g,'[$1]');
+ if(this.jsoneditor.options.form_name_root) this.formname = this.formname.replace(/^root\[/,this.jsoneditor.options.form_name_root+'[');
+ this.key = this.path.split('.').pop();
+ this.parent = options.parent;
+
+ this.link_watchers = [];
+
+ if(options.container) this.setContainer(options.container);
+ },
+ setContainer: function(container) {
+ this.container = container;
+ if(this.schema.id) this.container.setAttribute('data-schemaid',this.schema.id);
+ if(this.schema.type && typeof this.schema.type === "string") this.container.setAttribute('data-schematype',this.schema.type);
+ this.container.setAttribute('data-schemapath',this.path);
+ },
+
+ preBuild: function() {
+
+ },
+ build: function() {
+
+ },
+ postBuild: function() {
+ this.setupWatchListeners();
+ this.addLinks();
+ this.setValue(this.getDefault(), true);
+ this.updateHeaderText();
+ this.register();
+ this.onWatchedFieldChange();
+ },
+
+ setupWatchListeners: function() {
+ var self = this;
+
+ // Watched fields
+ this.watched = {};
+ if(this.schema.vars) this.schema.watch = this.schema.vars;
+ this.watched_values = {};
+ this.watch_listener = function() {
+ if(self.refreshWatchedFieldValues()) {
+ self.onWatchedFieldChange();
+ }
+ };
+
+ this.register();
+ if(this.schema.hasOwnProperty('watch')) {
+ var path,path_parts,first,root,adjusted_path;
+
+ for(var name in this.schema.watch) {
+ if(!this.schema.watch.hasOwnProperty(name)) continue;
+ path = this.schema.watch[name];
+
+ if(Array.isArray(path)) {
+ path_parts = [path[0]].concat(path[1].split('.'));
+ }
+ else {
+ path_parts = path.split('.');
+ if(!self.theme.closest(self.container,'[data-schemaid="'+path_parts[0]+'"]')) path_parts.unshift('#');
+ }
+ first = path_parts.shift();
+
+ if(first === '#') first = self.jsoneditor.schema.id || 'root';
+
+ // Find the root node for this template variable
+ root = self.theme.closest(self.container,'[data-schemaid="'+first+'"]');
+ if(!root) throw "Could not find ancestor node with id "+first;
+
+ // Keep track of the root node and path for use when rendering the template
+ adjusted_path = root.getAttribute('data-schemapath') + '.' + path_parts.join('.');
+
+ self.jsoneditor.watch(adjusted_path,self.watch_listener);
+
+ self.watched[name] = adjusted_path;
+ }
+ }
+
+ // Dynamic header
+ if(this.schema.headerTemplate) {
+ this.header_template = this.jsoneditor.compileTemplate(this.schema.headerTemplate, this.template_engine);
+ }
+ },
+
+ addLinks: function() {
+ // Add links
+ if(!this.no_link_holder) {
+ this.link_holder = this.theme.getLinksHolder();
+ this.container.appendChild(this.link_holder);
+ if(this.schema.links) {
+ for(var i=0; i<this.schema.links.length; i++) {
+ this.addLink(this.getLink(this.schema.links[i]));
+ }
+ }
+ }
+ },
+
+
+ getButton: function(text, icon, title) {
+ var btnClass = 'json-editor-btn-'+icon;
+ if(!this.iconlib) icon = null;
+ else icon = this.iconlib.getIcon(icon);
+
+ if(!icon && title) {
+ text = title;
+ title = null;
+ }
+
+ var btn = this.theme.getButton(text, icon, title);
+ btn.className += ' ' + btnClass + ' ';
+ return btn;
+ },
+ setButtonText: function(button, text, icon, title) {
+ if(!this.iconlib) icon = null;
+ else icon = this.iconlib.getIcon(icon);
+
+ if(!icon && title) {
+ text = title;
+ title = null;
+ }
+
+ return this.theme.setButtonText(button, text, icon, title);
+ },
+ addLink: function(link) {
+ if(this.link_holder) this.link_holder.appendChild(link);
+ },
+ getLink: function(data) {
+ var holder, link;
+
+ // Get mime type of the link
+ var mime = data.mediaType || 'application/javascript';
+ var type = mime.split('/')[0];
+
+ // Template to generate the link href
+ var href = this.jsoneditor.compileTemplate(data.href,this.template_engine);
+
+ // Template to generate the link's download attribute
+ var download = null;
+ if(data.download) download = data.download;
+
+ if(download && download !== true) {
+ download = this.jsoneditor.compileTemplate(download, this.template_engine);
+ }
+
+ // Image links
+ if(type === 'image') {
+ holder = this.theme.getBlockLinkHolder();
+ link = document.createElement('a');
+ link.setAttribute('target','_blank');
+ var image = document.createElement('img');
+
+ this.theme.createImageLink(holder,link,image);
+
+ // When a watched field changes, update the url
+ this.link_watchers.push(function(vars) {
+ var url = href(vars);
+ link.setAttribute('href',url);
+ link.setAttribute('title',data.rel || url);
+ image.setAttribute('src',url);
+ });
+ }
+ // Audio/Video links
+ else if(['audio','video'].indexOf(type) >=0) {
+ holder = this.theme.getBlockLinkHolder();
+
+ link = this.theme.getBlockLink();
+ link.setAttribute('target','_blank');
+
+ var media = document.createElement(type);
+ media.setAttribute('controls','controls');
+
+ this.theme.createMediaLink(holder,link,media);
+
+ // When a watched field changes, update the url
+ this.link_watchers.push(function(vars) {
+ var url = href(vars);
+ link.setAttribute('href',url);
+ link.textContent = data.rel || url;
+ media.setAttribute('src',url);
+ });
+ }
+ // Text links
+ else {
+ link = holder = this.theme.getBlockLink();
+ holder.setAttribute('target','_blank');
+ holder.textContent = data.rel;
+
+ // When a watched field changes, update the url
+ this.link_watchers.push(function(vars) {
+ var url = href(vars);
+ holder.setAttribute('href',url);
+ holder.textContent = data.rel || url;
+ });
+ }
+
+ if(download && link) {
+ if(download === true) {
+ link.setAttribute('download','');
+ }
+ else {
+ this.link_watchers.push(function(vars) {
+ link.setAttribute('download',download(vars));
+ });
+ }
+ }
+
+ return holder;
+ },
+ refreshWatchedFieldValues: function() {
+ if(!this.watched_values) return;
+ var watched = {};
+ var changed = false;
+ var self = this;
+
+ if(this.watched) {
+ var val,editor;
+ for(var name in this.watched) {
+ if(!this.watched.hasOwnProperty(name)) continue;
+ editor = self.jsoneditor.getEditor(this.watched[name]);
+ val = editor? editor.getValue() : null;
+ if(self.watched_values[name] !== val) changed = true;
+ watched[name] = val;
+ }
+ }
+
+ watched.self = this.getValue();
+ if(this.watched_values.self !== watched.self) changed = true;
+
+ this.watched_values = watched;
+
+ return changed;
+ },
+ getWatchedFieldValues: function() {
+ return this.watched_values;
+ },
+ updateHeaderText: function() {
+ if(this.header) {
+ // If the header has children, only update the text node's value
+ if(this.header.children.length) {
+ for(var i=0; i<this.header.childNodes.length; i++) {
+ if(this.header.childNodes[i].nodeType===3) {
+ this.header.childNodes[i].nodeValue = this.getHeaderText();
+ break;
+ }
+ }
+ }
+ // Otherwise, just update the entire node
+ else {
+ this.header.textContent = this.getHeaderText();
+ }
+ }
+ },
+ getHeaderText: function(title_only) {
+ if(this.header_text) return this.header_text;
+ else if(title_only) return this.schema.title;
+ else return this.getTitle();
+ },
+ onWatchedFieldChange: function() {
+ var vars;
+ if(this.header_template) {
+ vars = $extend(this.getWatchedFieldValues(),{
+ key: this.key,
+ i: this.key,
+ i0: (this.key*1),
+ i1: (this.key*1+1),
+ title: this.getTitle()
+ });
+ var header_text = this.header_template(vars);
+
+ if(header_text !== this.header_text) {
+ this.header_text = header_text;
+ this.updateHeaderText();
+ this.notify();
+ //this.fireChangeHeaderEvent();
+ }
+ }
+ if(this.link_watchers.length) {
+ vars = this.getWatchedFieldValues();
+ for(var i=0; i<this.link_watchers.length; i++) {
+ this.link_watchers[i](vars);
+ }
+ }
+ },
+ setValue: function(value) {
+ this.value = value;
+ },
+ getValue: function() {
+ return this.value;
+ },
+ refreshValue: function() {
+
+ },
+ getChildEditors: function() {
+ return false;
+ },
+ destroy: function() {
+ var self = this;
+ this.unregister(this);
+ $each(this.watched,function(name,adjusted_path) {
+ self.jsoneditor.unwatch(adjusted_path,self.watch_listener);
+ });
+ this.watched = null;
+ this.watched_values = null;
+ this.watch_listener = null;
+ this.header_text = null;
+ this.header_template = null;
+ this.value = null;
+ if(this.container && this.container.parentNode) this.container.parentNode.removeChild(this.container);
+ this.container = null;
+ this.jsoneditor = null;
+ this.schema = null;
+ this.path = null;
+ this.key = null;
+ this.parent = null;
+ },
+ getDefault: function() {
+ if(this.schema["default"]) return this.schema["default"];
+ if(this.schema["enum"]) return this.schema["enum"][0];
+
+ var type = this.schema.type || this.schema.oneOf;
+ if(type && Array.isArray(type)) type = type[0];
+ if(type && typeof type === "object") type = type.type;
+ if(type && Array.isArray(type)) type = type[0];
+
+ if(typeof type === "string") {
+ if(type === "number") return 0.0;
+ if(type === "boolean") return false;
+ if(type === "integer") return 0;
+ if(type === "string") return "";
+ if(type === "object") return {};
+ if(type === "array") return [];
+ }
+
+ return null;
+ },
+ getTitle: function() {
+ return this.schema.title || this.key;
+ },
+ enable: function() {
+ this.disabled = false;
+ },
+ disable: function() {
+ this.disabled = true;
+ },
+ isEnabled: function() {
+ return !this.disabled;
+ },
+ isRequired: function() {
+ if(typeof this.schema.required === "boolean") return this.schema.required;
+ else if(this.parent && this.parent.schema && Array.isArray(this.parent.schema.required)) return this.parent.schema.required.indexOf(this.key) > -1;
+ else if(this.jsoneditor.options.required_by_default) return true;
+ else return false;
+ },
+ getDisplayText: function(arr) {
+ var disp = [];
+ var used = {};
+
+ // Determine how many times each attribute name is used.
+ // This helps us pick the most distinct display text for the schemas.
+ $each(arr,function(i,el) {
+ if(el.title) {
+ used[el.title] = used[el.title] || 0;
+ used[el.title]++;
+ }
+ if(el.description) {
+ used[el.description] = used[el.description] || 0;
+ used[el.description]++;
+ }
+ if(el.format) {
+ used[el.format] = used[el.format] || 0;
+ used[el.format]++;
+ }
+ if(el.type) {
+ used[el.type] = used[el.type] || 0;
+ used[el.type]++;
+ }
+ });
+
+ // Determine display text for each element of the array
+ $each(arr,function(i,el) {
+ var name;
+
+ // If it's a simple string
+ if(typeof el === "string") name = el;
+ // Object
+ else if(el.title && used[el.title]<=1) name = el.title;
+ else if(el.format && used[el.format]<=1) name = el.format;
+ else if(el.type && used[el.type]<=1) name = el.type;
+ else if(el.description && used[el.description]<=1) name = el.descripton;
+ else if(el.title) name = el.title;
+ else if(el.format) name = el.format;
+ else if(el.type) name = el.type;
+ else if(el.description) name = el.description;
+ else if(JSON.stringify(el).length < 50) name = JSON.stringify(el);
+ else name = "type";
+
+ disp.push(name);
+ });
+
+ // Replace identical display text with "text 1", "text 2", etc.
+ var inc = {};
+ $each(disp,function(i,name) {
+ inc[name] = inc[name] || 0;
+ inc[name]++;
+
+ if(used[name] > 1) disp[i] = name + " " + inc[name];
+ });
+
+ return disp;
+ },
+ getOption: function(key) {
+ try {
+ throw "getOption is deprecated";
+ }
+ catch(e) {
+ window.console.error(e);
+ }
+
+ return this.options[key];
+ },
+ showValidationErrors: function(errors) {
+
+ }
+});
+
+JSONEditor.defaults.editors["null"] = JSONEditor.AbstractEditor.extend({
+ getValue: function() {
+ return null;
+ },
+ setValue: function() {
+ this.onChange();
+ },
+ getNumColumns: function() {
+ return 2;
+ }
+});
+
+JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({
+ register: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.setAttribute('name',this.formname);
+ },
+ unregister: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.removeAttribute('name');
+ },
+ setValue: function(value,initial,from_template) {
+ var self = this;
+
+ if(this.template && !from_template) {
+ return;
+ }
+
+ if(value === null || typeof value === 'undefined') value = "";
+ else if(typeof value === "object") value = JSON.stringify(value);
+ else if(typeof value !== "string") value = ""+value;
+
+ if(value === this.serialized) return;
+
+ // Sanitize value before setting it
+ var sanitized = this.sanitize(value);
+
+ if(this.input.value === sanitized) {
+ return;
+ }
+
+ this.input.value = sanitized;
+
+ // If using SCEditor, update the WYSIWYG
+ if(this.sceditor_instance) {
+ this.sceditor_instance.val(sanitized);
+ }
+ else if(this.epiceditor) {
+ this.epiceditor.importFile(null,sanitized);
+ }
+ else if(this.ace_editor) {
+ this.ace_editor.setValue(sanitized);
+ }
+
+ var changed = from_template || this.getValue() !== value;
+
+ this.refreshValue();
+
+ if(initial) this.is_dirty = false;
+ else if(this.jsoneditor.options.show_errors === "change") this.is_dirty = true;
+
+ if(this.adjust_height) this.adjust_height(this.input);
+
+ // Bubble this setValue to parents if the value changed
+ this.onChange(changed);
+ },
+ getNumColumns: function() {
+ var min = Math.ceil(Math.max(this.getTitle().length,this.schema.maxLength||0,this.schema.minLength||0)/5);
+ var num;
+
+ if(this.input_type === 'textarea') num = 6;
+ else if(['text','email'].indexOf(this.input_type) >= 0) num = 4;
+ else num = 2;
+
+ return Math.min(12,Math.max(min,num));
+ },
+ build: function() {
+ var self = this, i;
+ if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+ if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
+
+ this.format = this.schema.format;
+ if(!this.format && this.schema.media && this.schema.media.type) {
+ this.format = this.schema.media.type.replace(/(^(application|text)\/(x-)?(script\.)?)|(-source$)/g,'');
+ }
+ if(!this.format && this.options.default_format) {
+ this.format = this.options.default_format;
+ }
+ if(this.options.format) {
+ this.format = this.options.format;
+ }
+
+ // Specific format
+ if(this.format) {
+ // Text Area
+ if(this.format === 'textarea') {
+ this.input_type = 'textarea';
+ this.input = this.theme.getTextareaInput();
+ }
+ // Range Input
+ else if(this.format === 'range') {
+ this.input_type = 'range';
+ var min = this.schema.minimum || 0;
+ var max = this.schema.maximum || Math.max(100,min+1);
+ var step = 1;
+ if(this.schema.multipleOf) {
+ if(min%this.schema.multipleOf) min = Math.ceil(min/this.schema.multipleOf)*this.schema.multipleOf;
+ if(max%this.schema.multipleOf) max = Math.floor(max/this.schema.multipleOf)*this.schema.multipleOf;
+ step = this.schema.multipleOf;
+ }
+
+ this.input = this.theme.getRangeInput(min,max,step);
+ }
+ // Source Code
+ else if([
+ 'actionscript',
+ 'batchfile',
+ 'bbcode',
+ 'c',
+ 'c++',
+ 'cpp',
+ 'coffee',
+ 'csharp',
+ 'css',
+ 'dart',
+ 'django',
+ 'ejs',
+ 'erlang',
+ 'golang',
+ 'groovy',
+ 'handlebars',
+ 'haskell',
+ 'haxe',
+ 'html',
+ 'ini',
+ 'jade',
+ 'java',
+ 'javascript',
+ 'json',
+ 'less',
+ 'lisp',
+ 'lua',
+ 'makefile',
+ 'markdown',
+ 'matlab',
+ 'mysql',
+ 'objectivec',
+ 'pascal',
+ 'perl',
+ 'pgsql',
+ 'php',
+ 'python',
+ 'r',
+ 'ruby',
+ 'sass',
+ 'scala',
+ 'scss',
+ 'smarty',
+ 'sql',
+ 'stylus',
+ 'svg',
+ 'twig',
+ 'vbscript',
+ 'xml',
+ 'yaml'
+ ].indexOf(this.format) >= 0
+ ) {
+ this.input_type = this.format;
+ this.source_code = true;
+
+ this.input = this.theme.getTextareaInput();
+ }
+ // HTML5 Input type
+ else {
+ this.input_type = this.format;
+ this.input = this.theme.getFormInputField(this.input_type);
+ }
+ }
+ // Normal text input
+ else {
+ this.input_type = 'text';
+ this.input = this.theme.getFormInputField(this.input_type);
+ }
+
+ // minLength, maxLength, and pattern
+ if(typeof this.schema.maxLength !== "undefined") this.input.setAttribute('maxlength',this.schema.maxLength);
+ if(typeof this.schema.pattern !== "undefined") this.input.setAttribute('pattern',this.schema.pattern);
+ else if(typeof this.schema.minLength !== "undefined") this.input.setAttribute('pattern','.{'+this.schema.minLength+',}');
+
+ if(this.options.compact) {
+ this.container.className += ' compact';
+ }
+ else {
+ if(this.options.input_width) this.input.style.width = this.options.input_width;
+ }
+
+ if(this.schema.readOnly || this.schema.readonly || this.schema.template) {
+ this.always_disabled = true;
+ this.input.disabled = true;
+ }
+
+ this.input
+ .addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ // Don't allow changing if this field is a template
+ if(self.schema.template) {
+ this.value = self.value;
+ return;
+ }
+
+ var val = this.value;
+
+ // sanitize value
+ var sanitized = self.sanitize(val);
+ if(val !== sanitized) {
+ this.value = sanitized;
+ }
+
+ self.is_dirty = true;
+
+ self.refreshValue();
+ self.onChange(true);
+ });
+
+ if(this.options.input_height) this.input.style.height = this.options.input_height;
+ if(this.options.expand_height) {
+ this.adjust_height = function(el) {
+ if(!el) return;
+ var i, ch=el.offsetHeight;
+ // Input too short
+ if(el.offsetHeight < el.scrollHeight) {
+ i=0;
+ while(el.offsetHeight < el.scrollHeight+3) {
+ if(i>100) break;
+ i++;
+ ch++;
+ el.style.height = ch+'px';
+ }
+ }
+ else {
+ i=0;
+ while(el.offsetHeight >= el.scrollHeight+3) {
+ if(i>100) break;
+ i++;
+ ch--;
+ el.style.height = ch+'px';
+ }
+ el.style.height = (ch+1)+'px';
+ }
+ };
+
+ this.input.addEventListener('keyup',function(e) {
+ self.adjust_height(this);
+ });
+ this.input.addEventListener('change',function(e) {
+ self.adjust_height(this);
+ });
+ this.adjust_height();
+ }
+
+ if(this.format) this.input.setAttribute('data-schemaformat',this.format);
+
+ this.control = this.theme.getFormControl(this.label, this.input, this.description);
+ this.container.appendChild(this.control);
+
+ // Any special formatting that needs to happen after the input is added to the dom
+ window.requestAnimationFrame(function() {
+ // Skip in case the input is only a temporary editor,
+ // otherwise, in the case of an ace_editor creation,
+ // it will generate an error trying to append it to the missing parentNode
+ if(self.input.parentNode) self.afterInputReady();
+ if(self.adjust_height) self.adjust_height(self.input);
+ });
+
+ // Compile and store the template
+ if(this.schema.template) {
+ this.template = this.jsoneditor.compileTemplate(this.schema.template, this.template_engine);
+ this.refreshValue();
+ }
+ else {
+ this.refreshValue();
+ }
+ },
+ enable: function() {
+ if(!this.always_disabled) {
+ this.input.disabled = false;
+ // TODO: WYSIWYG and Markdown editors
+ }
+ this._super();
+ },
+ disable: function() {
+ this.input.disabled = true;
+ // TODO: WYSIWYG and Markdown editors
+ this._super();
+ },
+ afterInputReady: function() {
+ var self = this, options;
+
+ // Code editor
+ if(this.source_code) {
+ // WYSIWYG html and bbcode editor
+ if(this.options.wysiwyg &&
+ ['html','bbcode'].indexOf(this.input_type) >= 0 &&
+ window.jQuery && window.jQuery.fn && window.jQuery.fn.sceditor
+ ) {
+ options = $extend({},{
+ plugins: self.input_type==='html'? 'xhtml' : 'bbcode',
+ emoticonsEnabled: false,
+ width: '100%',
+ height: 300
+ },JSONEditor.plugins.sceditor,self.options.sceditor_options||{});
+
+ window.jQuery(self.input).sceditor(options);
+
+ self.sceditor_instance = window.jQuery(self.input).sceditor('instance');
+
+ self.sceditor_instance.blur(function() {
+ // Get editor's value
+ var val = window.jQuery("<div>"+self.sceditor_instance.val()+"</div>");
+ // Remove sceditor spans/divs
+ window.jQuery('#sceditor-start-marker,#sceditor-end-marker,.sceditor-nlf',val).remove();
+ // Set the value and update
+ self.input.value = val.html();
+ self.value = self.input.value;
+ self.is_dirty = true;
+ self.onChange(true);
+ });
+ }
+ // EpicEditor for markdown (if it's loaded)
+ else if (this.input_type === 'markdown' && window.EpicEditor) {
+ this.epiceditor_container = document.createElement('div');
+ this.input.parentNode.insertBefore(this.epiceditor_container,this.input);
+ this.input.style.display = 'none';
+
+ options = $extend({},JSONEditor.plugins.epiceditor,{
+ container: this.epiceditor_container,
+ clientSideStorage: false
+ });
+
+ this.epiceditor = new window.EpicEditor(options).load();
+
+ this.epiceditor.importFile(null,this.getValue());
+
+ this.epiceditor.on('update',function() {
+ var val = self.epiceditor.exportFile();
+ self.input.value = val;
+ self.value = val;
+ self.is_dirty = true;
+ self.onChange(true);
+ });
+ }
+ // ACE editor for everything else
+ else if(window.ace) {
+ var mode = this.input_type;
+ // aliases for c/cpp
+ if(mode === 'cpp' || mode === 'c++' || mode === 'c') {
+ mode = 'c_cpp';
+ }
+
+ this.ace_container = document.createElement('div');
+ this.ace_container.style.width = '100%';
+ this.ace_container.style.position = 'relative';
+ this.ace_container.style.height = '400px';
+ this.input.parentNode.insertBefore(this.ace_container,this.input);
+ this.input.style.display = 'none';
+ this.ace_editor = window.ace.edit(this.ace_container);
+
+ this.ace_editor.setValue(this.getValue());
+
+ // The theme
+ if(JSONEditor.plugins.ace.theme) this.ace_editor.setTheme('ace/theme/'+JSONEditor.plugins.ace.theme);
+ // The mode
+ mode = window.ace.require("ace/mode/"+mode);
+ if(mode) this.ace_editor.getSession().setMode(new mode.Mode());
+
+ // Listen for changes
+ this.ace_editor.on('change',function() {
+ var val = self.ace_editor.getValue();
+ self.input.value = val;
+ self.refreshValue();
+ self.is_dirty = true;
+ self.onChange(true);
+ });
+ }
+ }
+
+ self.theme.afterInputReady(self.input);
+ },
+ refreshValue: function() {
+ this.value = this.input.value;
+ if(typeof this.value !== "string") this.value = '';
+ this.serialized = this.value;
+ },
+ destroy: function() {
+ // If using SCEditor, destroy the editor instance
+ if(this.sceditor_instance) {
+ this.sceditor_instance.destroy();
+ }
+ else if(this.epiceditor) {
+ this.epiceditor.unload();
+ }
+ else if(this.ace_editor) {
+ this.ace_editor.destroy();
+ }
+
+
+ this.template = null;
+ if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input);
+ if(this.label && this.label.parentNode) this.label.parentNode.removeChild(this.label);
+ if(this.description && this.description.parentNode) this.description.parentNode.removeChild(this.description);
+
+ this._super();
+ },
+ /**
+ * This is overridden in derivative editors
+ */
+ sanitize: function(value) {
+ return value;
+ },
+ /**
+ * Re-calculates the value if needed
+ */
+ onWatchedFieldChange: function() {
+ var self = this, vars, j;
+
+ // If this editor needs to be rendered by a macro template
+ if(this.template) {
+ vars = this.getWatchedFieldValues();
+ this.setValue(this.template(vars),false,true);
+ }
+
+ this._super();
+ },
+ showValidationErrors: function(errors) {
+ var self = this;
+
+ if(this.jsoneditor.options.show_errors === "always") {}
+ else if(!this.is_dirty && this.previous_error_setting===this.jsoneditor.options.show_errors) return;
+
+ this.previous_error_setting = this.jsoneditor.options.show_errors;
+
+ var messages = [];
+ $each(errors,function(i,error) {
+ if(error.path === self.path) {
+ messages.push(error.message);
+ }
+ });
+
+ if(messages.length) {
+ this.theme.addInputError(this.input, messages.join('. ')+'.');
+ }
+ else {
+ this.theme.removeInputError(this.input);
+ }
+ }
+});
+
+JSONEditor.defaults.editors.number = JSONEditor.defaults.editors.string.extend({
+ sanitize: function(value) {
+ return (value+"").replace(/[^0-9\.\-eE]/g,'');
+ },
+ getNumColumns: function() {
+ return 2;
+ },
+ getValue: function() {
+ return this.value*1;
+ }
+});
+
+JSONEditor.defaults.editors.integer = JSONEditor.defaults.editors.number.extend({
+ sanitize: function(value) {
+ value = value + "";
+ return value.replace(/[^0-9\-]/g,'');
+ },
+ getNumColumns: function() {
+ return 2;
+ }
+});
+
+JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({
+ getDefault: function() {
+ return $extend({},this.schema["default"] || {});
+ },
+ getChildEditors: function() {
+ return this.editors;
+ },
+ register: function() {
+ this._super();
+ if(this.editors) {
+ for(var i in this.editors) {
+ if(!this.editors.hasOwnProperty(i)) continue;
+ this.editors[i].register();
+ }
+ }
+ },
+ unregister: function() {
+ this._super();
+ if(this.editors) {
+ for(var i in this.editors) {
+ if(!this.editors.hasOwnProperty(i)) continue;
+ this.editors[i].unregister();
+ }
+ }
+ },
+ getNumColumns: function() {
+ return Math.max(Math.min(12,this.maxwidth),3);
+ },
+ enable: function() {
+ if(this.editjson_button) this.editjson_button.disabled = false;
+ if(this.addproperty_button) this.addproperty_button.disabled = false;
+
+ this._super();
+ if(this.editors) {
+ for(var i in this.editors) {
+ if(!this.editors.hasOwnProperty(i)) continue;
+ this.editors[i].enable();
+ }
+ }
+ },
+ disable: function() {
+ if(this.editjson_button) this.editjson_button.disabled = true;
+ if(this.addproperty_button) this.addproperty_button.disabled = true;
+ this.hideEditJSON();
+
+ this._super();
+ if(this.editors) {
+ for(var i in this.editors) {
+ if(!this.editors.hasOwnProperty(i)) continue;
+ this.editors[i].disable();
+ }
+ }
+ },
+ layoutEditors: function() {
+ var self = this, i, j;
+
+ if(!this.row_container) return;
+
+ // Sort editors by propertyOrder
+ this.property_order = Object.keys(this.editors);
+ this.property_order = this.property_order.sort(function(a,b) {
+ var ordera = self.editors[a].schema.propertyOrder;
+ var orderb = self.editors[b].schema.propertyOrder;
+ if(typeof ordera !== "number") ordera = 1000;
+ if(typeof orderb !== "number") orderb = 1000;
+
+ return ordera - orderb;
+ });
+
+ var container;
+
+ if(this.format === 'grid') {
+ var rows = [];
+ $each(this.property_order, function(j,key) {
+ var editor = self.editors[key];
+ if(editor.property_removed) return;
+ var found = false;
+ var width = editor.options.hidden? 0 : (editor.options.grid_columns || editor.getNumColumns());
+ var height = editor.options.hidden? 0 : editor.container.offsetHeight;
+ // See if the editor will fit in any of the existing rows first
+ for(var i=0; i<rows.length; i++) {
+ // If the editor will fit in the row horizontally
+ if(rows[i].width + width <= 12) {
+ // If the editor is close to the other elements in height
+ // i.e. Don't put a really tall editor in an otherwise short row or vice versa
+ if(!height || (rows[i].minh*0.5 < height && rows[i].maxh*2 > height)) {
+ found = i;
+ }
+ }
+ }
+
+ // If there isn't a spot in any of the existing rows, start a new row
+ if(found === false) {
+ rows.push({
+ width: 0,
+ minh: 999999,
+ maxh: 0,
+ editors: []
+ });
+ found = rows.length-1;
+ }
+
+ rows[found].editors.push({
+ key: key,
+ //editor: editor,
+ width: width,
+ height: height
+ });
+ rows[found].width += width;
+ rows[found].minh = Math.min(rows[found].minh,height);
+ rows[found].maxh = Math.max(rows[found].maxh,height);
+ });
+
+ // Make almost full rows width 12
+ // Do this by increasing all editors' sizes proprotionately
+ // Any left over space goes to the biggest editor
+ // Don't touch rows with a width of 6 or less
+ for(i=0; i<rows.length; i++) {
+ if(rows[i].width < 12) {
+ var biggest = false;
+ var new_width = 0;
+ for(j=0; j<rows[i].editors.length; j++) {
+ if(biggest === false) biggest = j;
+ else if(rows[i].editors[j].width > rows[i].editors[biggest].width) biggest = j;
+ rows[i].editors[j].width *= 12/rows[i].width;
+ rows[i].editors[j].width = Math.floor(rows[i].editors[j].width);
+ new_width += rows[i].editors[j].width;
+ }
+ if(new_width < 12) rows[i].editors[biggest].width += 12-new_width;
+ rows[i].width = 12;
+ }
+ }
+
+ // layout hasn't changed
+ if(this.layout === JSON.stringify(rows)) return false;
+ this.layout = JSON.stringify(rows);
+
+ // Layout the form
+ container = document.createElement('div');
+ for(i=0; i<rows.length; i++) {
+ var row = this.theme.getGridRow();
+ container.appendChild(row);
+ for(j=0; j<rows[i].editors.length; j++) {
+ var key = rows[i].editors[j].key;
+ var editor = this.editors[key];
+
+ if(editor.options.hidden) editor.container.style.display = 'none';
+ else this.theme.setGridColumnSize(editor.container,rows[i].editors[j].width);
+ row.appendChild(editor.container);
+ }
+ }
+ }
+ // Normal layout
+ else {
+ container = document.createElement('div');
+ $each(this.property_order, function(i,key) {
+ var editor = self.editors[key];
+ if(editor.property_removed) return;
+ var row = self.theme.getGridRow();
+ container.appendChild(row);
+
+ if(editor.options.hidden) editor.container.style.display = 'none';
+ else self.theme.setGridColumnSize(editor.container,12);
+ row.appendChild(editor.container);
+ });
+ }
+ this.row_container.innerHTML = '';
+ this.row_container.appendChild(container);
+ },
+ getPropertySchema: function(key) {
+ // Schema declared directly in properties
+ var schema = this.schema.properties[key] || {};
+ schema = $extend({},schema);
+ var matched = this.schema.properties[key]? true : false;
+
+ // Any matching patternProperties should be merged in
+ if(this.schema.patternProperties) {
+ for(var i in this.schema.patternProperties) {
+ if(!this.schema.patternProperties.hasOwnProperty(i)) continue;
+ var regex = new RegExp(i);
+ if(regex.test(key)) {
+ schema.allOf = schema.allOf || [];
+ schema.allOf.push(this.schema.patternProperties[i]);
+ matched = true;
+ }
+ }
+ }
+
+ // Hasn't matched other rules, use additionalProperties schema
+ if(!matched && this.schema.additionalProperties && typeof this.schema.additionalProperties === "object") {
+ schema = $extend({},this.schema.additionalProperties);
+ }
+
+ return schema;
+ },
+ preBuild: function() {
+ this._super();
+
+ this.editors = {};
+ this.cached_editors = {};
+ var self = this;
+
+ this.format = this.options.layout || this.options.object_layout || this.schema.format || this.jsoneditor.options.object_layout || 'normal';
+
+ this.schema.properties = this.schema.properties || {};
+
+ this.minwidth = 0;
+ this.maxwidth = 0;
+
+ // If the object should be rendered as a table row
+ if(this.options.table_row) {
+ $each(this.schema.properties, function(key,schema) {
+ var editor = self.jsoneditor.getEditorClass(schema);
+ self.editors[key] = self.jsoneditor.createEditor(editor,{
+ jsoneditor: self.jsoneditor,
+ schema: schema,
+ path: self.path+'.'+key,
+ parent: self,
+ compact: true,
+ required: true
+ });
+ self.editors[key].preBuild();
+
+ var width = self.editors[key].options.hidden? 0 : (self.editors[key].options.grid_columns || self.editors[key].getNumColumns());
+
+ self.minwidth += width;
+ self.maxwidth += width;
+ });
+ this.no_link_holder = true;
+ }
+ // If the object should be rendered as a table
+ else if(this.options.table) {
+ // TODO: table display format
+ throw "Not supported yet";
+ }
+ // If the object should be rendered as a div
+ else {
+ this.defaultProperties = this.schema.defaultProperties || Object.keys(this.schema.properties);
+
+ // Increase the grid width to account for padding
+ self.maxwidth += 1;
+
+ $each(this.defaultProperties, function(i,key) {
+ self.addObjectProperty(key, true);
+
+ if(self.editors[key]) {
+ self.minwidth = Math.max(self.minwidth,(self.editors[key].options.grid_columns || self.editors[key].getNumColumns()));
+ self.maxwidth += (self.editors[key].options.grid_columns || self.editors[key].getNumColumns());
+ }
+ });
+ }
+
+ // Sort editors by propertyOrder
+ this.property_order = Object.keys(this.editors);
+ this.property_order = this.property_order.sort(function(a,b) {
+ var ordera = self.editors[a].schema.propertyOrder;
+ var orderb = self.editors[b].schema.propertyOrder;
+ if(typeof ordera !== "number") ordera = 1000;
+ if(typeof orderb !== "number") orderb = 1000;
+
+ return ordera - orderb;
+ });
+ },
+ build: function() {
+ var self = this;
+
+ // If the object should be rendered as a table row
+ if(this.options.table_row) {
+ this.editor_holder = this.container;
+ $each(this.editors, function(key,editor) {
+ var holder = self.theme.getTableCell();
+ self.editor_holder.appendChild(holder);
+
+ editor.setContainer(holder);
+ editor.build();
+ editor.postBuild();
+
+ if(self.editors[key].options.hidden) {
+ holder.style.display = 'none';
+ }
+ if(self.editors[key].options.input_width) {
+ holder.style.width = self.editors[key].options.input_width;
+ }
+ });
+ }
+ // If the object should be rendered as a table
+ else if(this.options.table) {
+ // TODO: table display format
+ throw "Not supported yet";
+ }
+ // If the object should be rendered as a div
+ else {
+ this.header = document.createElement('span');
+ this.header.textContent = this.getTitle();
+ this.title = this.theme.getHeader(this.header);
+ this.container.appendChild(this.title);
+ this.container.style.position = 'relative';
+
+ // Edit JSON modal
+ this.editjson_holder = this.theme.getModal();
+ this.editjson_textarea = this.theme.getTextareaInput();
+ this.editjson_textarea.style.height = '170px';
+ this.editjson_textarea.style.width = '300px';
+ this.editjson_textarea.style.display = 'block';
+ this.editjson_save = this.getButton('Save','save','Save');
+ this.editjson_save.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.saveJSON();
+ });
+ this.editjson_cancel = this.getButton('Cancel','cancel','Cancel');
+ this.editjson_cancel.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.hideEditJSON();
+ });
+ this.editjson_holder.appendChild(this.editjson_textarea);
+ this.editjson_holder.appendChild(this.editjson_save);
+ this.editjson_holder.appendChild(this.editjson_cancel);
+
+ // Manage Properties modal
+ this.addproperty_holder = this.theme.getModal();
+ this.addproperty_list = document.createElement('div');
+ this.addproperty_list.style.width = '295px';
+ this.addproperty_list.style.maxHeight = '160px';
+ this.addproperty_list.style.padding = '5px 0';
+ this.addproperty_list.style.overflowY = 'auto';
+ this.addproperty_list.style.overflowX = 'hidden';
+ this.addproperty_list.style.paddingLeft = '5px';
+ this.addproperty_list.setAttribute('class', 'property-selector');
+ this.addproperty_add = this.getButton('add','add','add');
+ this.addproperty_input = this.theme.getFormInputField('text');
+ this.addproperty_input.setAttribute('placeholder','Property name...');
+ this.addproperty_input.style.width = '220px';
+ this.addproperty_input.style.marginBottom = '0';
+ this.addproperty_input.style.display = 'inline-block';
+ this.addproperty_add.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ if(self.addproperty_input.value) {
+ if(self.editors[self.addproperty_input.value]) {
+ window.alert('there is already a property with that name');
+ return;
+ }
+
+ self.addObjectProperty(self.addproperty_input.value);
+ if(self.editors[self.addproperty_input.value]) {
+ self.editors[self.addproperty_input.value].disable();
+ }
+ self.onChange(true);
+ }
+ });
+ this.addproperty_holder.appendChild(this.addproperty_list);
+ this.addproperty_holder.appendChild(this.addproperty_input);
+ this.addproperty_holder.appendChild(this.addproperty_add);
+ var spacer = document.createElement('div');
+ spacer.style.clear = 'both';
+ this.addproperty_holder.appendChild(spacer);
+
+
+ // Description
+ if(this.schema.description) {
+ this.description = this.theme.getDescription(this.schema.description);
+ this.container.appendChild(this.description);
+ }
+
+ // Validation error placeholder area
+ this.error_holder = document.createElement('div');
+ this.container.appendChild(this.error_holder);
+
+ // Container for child editor area
+ this.editor_holder = this.theme.getIndentedPanel();
+ this.container.appendChild(this.editor_holder);
+
+ // Container for rows of child editors
+ this.row_container = this.theme.getGridContainer();
+ this.editor_holder.appendChild(this.row_container);
+
+ $each(this.editors, function(key,editor) {
+ var holder = self.theme.getGridColumn();
+ self.row_container.appendChild(holder);
+
+ editor.setContainer(holder);
+ editor.build();
+ editor.postBuild();
+ });
+
+ // Control buttons
+ this.title_controls = this.theme.getHeaderButtonHolder();
+ this.editjson_controls = this.theme.getHeaderButtonHolder();
+ this.addproperty_controls = this.theme.getHeaderButtonHolder();
+ this.title.appendChild(this.title_controls);
+ this.title.appendChild(this.editjson_controls);
+ this.title.appendChild(this.addproperty_controls);
+
+ // Show/Hide button
+ this.collapsed = false;
+ this.toggle_button = this.getButton('','collapse','Collapse');
+ this.title_controls.appendChild(this.toggle_button);
+ this.toggle_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ if(self.collapsed) {
+ self.editor_holder.style.display = '';
+ self.collapsed = false;
+ self.setButtonText(self.toggle_button,'','collapse','Collapse');
+ }
+ else {
+ self.editor_holder.style.display = 'none';
+ self.collapsed = true;
+ self.setButtonText(self.toggle_button,'','expand','Expand');
+ }
+ });
+
+ // If it should start collapsed
+ if(this.options.collapsed) {
+ $trigger(this.toggle_button,'click');
+ }
+
+ // Collapse button disabled
+ if(this.schema.options && typeof this.schema.options.disable_collapse !== "undefined") {
+ if(this.schema.options.disable_collapse) this.toggle_button.style.display = 'none';
+ }
+ else if(this.jsoneditor.options.disable_collapse) {
+ this.toggle_button.style.display = 'none';
+ }
+
+ // Edit JSON Button
+ this.editjson_button = this.getButton('JSON','edit','Edit JSON');
+ this.editjson_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.toggleEditJSON();
+ });
+ this.editjson_controls.appendChild(this.editjson_button);
+ this.editjson_controls.appendChild(this.editjson_holder);
+
+ // Edit JSON Buttton disabled
+ if(this.schema.options && typeof this.schema.options.disable_edit_json !== "undefined") {
+ if(this.schema.options.disable_edit_json) this.editjson_button.style.display = 'none';
+ }
+ else if(this.jsoneditor.options.disable_edit_json) {
+ this.editjson_button.style.display = 'none';
+ }
+
+ // Object Properties Button
+ this.addproperty_button = this.getButton('Properties','edit','Object Properties');
+ this.addproperty_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.toggleAddProperty();
+ });
+ this.addproperty_controls.appendChild(this.addproperty_button);
+ this.addproperty_controls.appendChild(this.addproperty_holder);
+ this.refreshAddProperties();
+ }
+
+ // Fix table cell ordering
+ if(this.options.table_row) {
+ this.editor_holder = this.container;
+ $each(this.property_order,function(i,key) {
+ self.editor_holder.appendChild(self.editors[key].container);
+ });
+ }
+ // Layout object editors in grid if needed
+ else {
+ // Initial layout
+ this.layoutEditors();
+ // Do it again now that we know the approximate heights of elements
+ this.layoutEditors();
+ }
+ },
+ showEditJSON: function() {
+ if(!this.editjson_holder) return;
+ this.hideAddProperty();
+
+ // Position the form directly beneath the button
+ // TODO: edge detection
+ this.editjson_holder.style.left = this.editjson_button.offsetLeft+"px";
+ this.editjson_holder.style.top = this.editjson_button.offsetTop + this.editjson_button.offsetHeight+"px";
+
+ // Start the textarea with the current value
+ this.editjson_textarea.value = JSON.stringify(this.getValue(),null,2);
+
+ // Disable the rest of the form while editing JSON
+ this.disable();
+
+ this.editjson_holder.style.display = '';
+ this.editjson_button.disabled = false;
+ this.editing_json = true;
+ },
+ hideEditJSON: function() {
+ if(!this.editjson_holder) return;
+ if(!this.editing_json) return;
+
+ this.editjson_holder.style.display = 'none';
+ this.enable();
+ this.editing_json = false;
+ },
+ saveJSON: function() {
+ if(!this.editjson_holder) return;
+
+ try {
+ var json = JSON.parse(this.editjson_textarea.value);
+ this.setValue(json);
+ this.hideEditJSON();
+ }
+ catch(e) {
+ window.alert('invalid JSON');
+ throw e;
+ }
+ },
+ toggleEditJSON: function() {
+ if(this.editing_json) this.hideEditJSON();
+ else this.showEditJSON();
+ },
+ insertPropertyControlUsingPropertyOrder: function (property, control, container) {
+ var propertyOrder;
+ if (this.schema.properties[property])
+ propertyOrder = this.schema.properties[property].propertyOrder;
+ if (typeof propertyOrder !== "number") propertyOrder = 1000;
+ control.propertyOrder = propertyOrder;
+
+ for (var i = 0; i < container.childNodes.length; i++) {
+ var child = container.childNodes[i];
+ if (control.propertyOrder < child.propertyOrder) {
+ this.addproperty_list.insertBefore(control, child);
+ control = null;
+ break;
+ }
+ }
+ if (control) {
+ this.addproperty_list.appendChild(control);
+ }
+ },
+ addPropertyCheckbox: function(key) {
+ var self = this;
+ var checkbox, label, labelText, control;
+
+ checkbox = self.theme.getCheckbox();
+ checkbox.style.width = 'auto';
+
+ if (this.schema.properties[key] && this.schema.properties[key].title)
+ labelText = this.schema.properties[key].title;
+ else
+ labelText = key;
+
+ label = self.theme.getCheckboxLabel(labelText);
+
+ control = self.theme.getFormControl(label,checkbox);
+ control.style.paddingBottom = control.style.marginBottom = control.style.paddingTop = control.style.marginTop = 0;
+ control.style.height = 'auto';
+ //control.style.overflowY = 'hidden';
+
+ this.insertPropertyControlUsingPropertyOrder(key, control, this.addproperty_list);
+
+ checkbox.checked = key in this.editors;
+ checkbox.addEventListener('change',function() {
+ if(checkbox.checked) {
+ self.addObjectProperty(key);
+ }
+ else {
+ self.removeObjectProperty(key);
+ }
+ self.onChange(true);
+ });
+ self.addproperty_checkboxes[key] = checkbox;
+
+ return checkbox;
+ },
+ showAddProperty: function() {
+ if(!this.addproperty_holder) return;
+ this.hideEditJSON();
+
+ // Position the form directly beneath the button
+ // TODO: edge detection
+ this.addproperty_holder.style.left = this.addproperty_button.offsetLeft+"px";
+ this.addproperty_holder.style.top = this.addproperty_button.offsetTop + this.addproperty_button.offsetHeight+"px";
+
+ // Disable the rest of the form while editing JSON
+ this.disable();
+
+ this.adding_property = true;
+ this.addproperty_button.disabled = false;
+ this.addproperty_holder.style.display = '';
+ this.refreshAddProperties();
+ },
+ hideAddProperty: function() {
+ if(!this.addproperty_holder) return;
+ if(!this.adding_property) return;
+
+ this.addproperty_holder.style.display = 'none';
+ this.enable();
+
+ this.adding_property = false;
+ },
+ toggleAddProperty: function() {
+ if(this.adding_property) this.hideAddProperty();
+ else this.showAddProperty();
+ },
+ removeObjectProperty: function(property) {
+ if(this.editors[property]) {
+ this.editors[property].unregister();
+ delete this.editors[property];
+
+ this.refreshValue();
+ this.layoutEditors();
+ }
+ },
+ addObjectProperty: function(name, prebuild_only) {
+ var self = this;
+
+ // Property is already added
+ if(this.editors[name]) return;
+
+ // Property was added before and is cached
+ if(this.cached_editors[name]) {
+ this.editors[name] = this.cached_editors[name];
+ if(prebuild_only) return;
+ this.editors[name].register();
+ }
+ // New property
+ else {
+ if(!this.canHaveAdditionalProperties() && (!this.schema.properties || !this.schema.properties[name])) {
+ return;
+ }
+
+ var schema = self.getPropertySchema(name);
+
+
+ // Add the property
+ var editor = self.jsoneditor.getEditorClass(schema);
+
+ self.editors[name] = self.jsoneditor.createEditor(editor,{
+ jsoneditor: self.jsoneditor,
+ schema: schema,
+ path: self.path+'.'+name,
+ parent: self
+ });
+ self.editors[name].preBuild();
+
+ if(!prebuild_only) {
+ var holder = self.theme.getChildEditorHolder();
+ self.editor_holder.appendChild(holder);
+ self.editors[name].setContainer(holder);
+ self.editors[name].build();
+ self.editors[name].postBuild();
+ }
+
+ self.cached_editors[name] = self.editors[name];
+ }
+
+ // If we're only prebuilding the editors, don't refresh values
+ if(!prebuild_only) {
+ self.refreshValue();
+ self.layoutEditors();
+ }
+ },
+ onChildEditorChange: function(editor) {
+ this.refreshValue();
+ this._super(editor);
+ },
+ canHaveAdditionalProperties: function() {
+ if (typeof this.schema.additionalProperties === "boolean") {
+ return this.schema.additionalProperties;
+ }
+ return !this.jsoneditor.options.no_additional_properties;
+ },
+ destroy: function() {
+ $each(this.cached_editors, function(i,el) {
+ el.destroy();
+ });
+ if(this.editor_holder) this.editor_holder.innerHTML = '';
+ if(this.title && this.title.parentNode) this.title.parentNode.removeChild(this.title);
+ if(this.error_holder && this.error_holder.parentNode) this.error_holder.parentNode.removeChild(this.error_holder);
+
+ this.editors = null;
+ this.cached_editors = null;
+ if(this.editor_holder && this.editor_holder.parentNode) this.editor_holder.parentNode.removeChild(this.editor_holder);
+ this.editor_holder = null;
+
+ this._super();
+ },
+ getValue: function() {
+ var result = this._super();
+ if(this.jsoneditor.options.remove_empty_properties || this.options.remove_empty_properties) {
+ for(var i in result) {
+ if(result.hasOwnProperty(i)) {
+ if(!result[i]) delete result[i];
+ }
+ }
+ }
+ return result;
+ },
+ refreshValue: function() {
+ this.value = {};
+ var self = this;
+
+ for(var i in this.editors) {
+ if(!this.editors.hasOwnProperty(i)) continue;
+ this.value[i] = this.editors[i].getValue();
+ }
+
+ if(this.adding_property) this.refreshAddProperties();
+ },
+ refreshAddProperties: function() {
+ if(this.options.disable_properties || (this.options.disable_properties !== false && this.jsoneditor.options.disable_properties)) {
+ this.addproperty_controls.style.display = 'none';
+ return;
+ }
+
+ var can_add = false, can_remove = false, num_props = 0, i, show_modal = false;
+
+ // Get number of editors
+ for(i in this.editors) {
+ if(!this.editors.hasOwnProperty(i)) continue;
+ num_props++;
+ }
+
+ // Determine if we can add back removed properties
+ can_add = this.canHaveAdditionalProperties() && !(typeof this.schema.maxProperties !== "undefined" && num_props >= this.schema.maxProperties);
+
+ if(this.addproperty_checkboxes) {
+ this.addproperty_list.innerHTML = '';
+ }
+ this.addproperty_checkboxes = {};
+
+ // Check for which editors can't be removed or added back
+ for(i in this.cached_editors) {
+ if(!this.cached_editors.hasOwnProperty(i)) continue;
+
+ this.addPropertyCheckbox(i);
+
+ if(this.isRequired(this.cached_editors[i]) && i in this.editors) {
+ this.addproperty_checkboxes[i].disabled = true;
+ }
+
+ if(typeof this.schema.minProperties !== "undefined" && num_props <= this.schema.minProperties) {
+ this.addproperty_checkboxes[i].disabled = this.addproperty_checkboxes[i].checked;
+ if(!this.addproperty_checkboxes[i].checked) show_modal = true;
+ }
+ else if(!(i in this.editors)) {
+ if(!can_add && !this.schema.properties.hasOwnProperty(i)) {
+ this.addproperty_checkboxes[i].disabled = true;
+ }
+ else {
+ this.addproperty_checkboxes[i].disabled = false;
+ show_modal = true;
+ }
+ }
+ else {
+ show_modal = true;
+ can_remove = true;
+ }
+ }
+
+ if(this.canHaveAdditionalProperties()) {
+ show_modal = true;
+ }
+
+ // Additional addproperty checkboxes not tied to a current editor
+ for(i in this.schema.properties) {
+ if(!this.schema.properties.hasOwnProperty(i)) continue;
+ if(this.cached_editors[i]) continue;
+ show_modal = true;
+ this.addPropertyCheckbox(i);
+ }
+
+ // If no editors can be added or removed, hide the modal button
+ if(!show_modal) {
+ this.hideAddProperty();
+ this.addproperty_controls.style.display = 'none';
+ }
+ // If additional properties are disabled
+ else if(!this.canHaveAdditionalProperties()) {
+ this.addproperty_add.style.display = 'none';
+ this.addproperty_input.style.display = 'none';
+ }
+ // If no new properties can be added
+ else if(!can_add) {
+ this.addproperty_add.disabled = true;
+ }
+ // If new properties can be added
+ else {
+ this.addproperty_add.disabled = false;
+ }
+ },
+ isRequired: function(editor) {
+ if(typeof editor.schema.required === "boolean") return editor.schema.required;
+ else if(Array.isArray(this.schema.required)) return this.schema.required.indexOf(editor.key) > -1;
+ else if(this.jsoneditor.options.required_by_default) return true;
+ else return false;
+ },
+ setValue: function(value, initial) {
+ var self = this;
+ value = value || {};
+
+ if(typeof value !== "object" || Array.isArray(value)) value = {};
+
+ // First, set the values for all of the defined properties
+ $each(this.cached_editors, function(i,editor) {
+ // Value explicitly set
+ if(typeof value[i] !== "undefined") {
+ self.addObjectProperty(i);
+ editor.setValue(value[i],initial);
+ }
+ // Otherwise, remove value unless this is the initial set or it's required
+ else if(!initial && !self.isRequired(editor)) {
+ self.removeObjectProperty(i);
+ }
+ // Otherwise, set the value to the default
+ else {
+ editor.setValue(editor.getDefault(),initial);
+ }
+ });
+
+ $each(value, function(i,val) {
+ if(!self.cached_editors[i]) {
+ self.addObjectProperty(i);
+ if(self.editors[i]) self.editors[i].setValue(val,initial);
+ }
+ });
+
+ this.refreshValue();
+ this.layoutEditors();
+ this.onChange();
+ },
+ showValidationErrors: function(errors) {
+ var self = this;
+
+ // Get all the errors that pertain to this editor
+ var my_errors = [];
+ var other_errors = [];
+ $each(errors, function(i,error) {
+ if(error.path === self.path) {
+ my_errors.push(error);
+ }
+ else {
+ other_errors.push(error);
+ }
+ });
+
+ // Show errors for this editor
+ if(this.error_holder) {
+ if(my_errors.length) {
+ var message = [];
+ this.error_holder.innerHTML = '';
+ this.error_holder.style.display = '';
+ $each(my_errors, function(i,error) {
+ self.error_holder.appendChild(self.theme.getErrorMessage(error.message));
+ });
+ }
+ // Hide error area
+ else {
+ this.error_holder.style.display = 'none';
+ }
+ }
+
+ // Show error for the table row if this is inside a table
+ if(this.options.table_row) {
+ if(my_errors.length) {
+ this.theme.addTableRowError(this.container);
+ }
+ else {
+ this.theme.removeTableRowError(this.container);
+ }
+ }
+
+ // Show errors for child editors
+ $each(this.editors, function(i,editor) {
+ editor.showValidationErrors(other_errors);
+ });
+ }
+});
+
+JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({
+ getDefault: function() {
+ return this.schema["default"] || [];
+ },
+ register: function() {
+ this._super();
+ if(this.rows) {
+ for(var i=0; i<this.rows.length; i++) {
+ this.rows[i].register();
+ }
+ }
+ },
+ unregister: function() {
+ this._super();
+ if(this.rows) {
+ for(var i=0; i<this.rows.length; i++) {
+ this.rows[i].unregister();
+ }
+ }
+ },
+ getNumColumns: function() {
+ var info = this.getItemInfo(0);
+ // Tabs require extra horizontal space
+ if(this.tabs_holder) {
+ return Math.max(Math.min(12,info.width+2),4);
+ }
+ else {
+ return info.width;
+ }
+ },
+ enable: function() {
+ if(this.add_row_button) this.add_row_button.disabled = false;
+ if(this.remove_all_rows_button) this.remove_all_rows_button.disabled = false;
+ if(this.delete_last_row_button) this.delete_last_row_button.disabled = false;
+
+ if(this.rows) {
+ for(var i=0; i<this.rows.length; i++) {
+ this.rows[i].enable();
+
+ if(this.rows[i].moveup_button) this.rows[i].moveup_button.disabled = false;
+ if(this.rows[i].movedown_button) this.rows[i].movedown_button.disabled = false;
+ if(this.rows[i].delete_button) this.rows[i].delete_button.disabled = false;
+ }
+ }
+ this._super();
+ },
+ disable: function() {
+ if(this.add_row_button) this.add_row_button.disabled = true;
+ if(this.remove_all_rows_button) this.remove_all_rows_button.disabled = true;
+ if(this.delete_last_row_button) this.delete_last_row_button.disabled = true;
+
+ if(this.rows) {
+ for(var i=0; i<this.rows.length; i++) {
+ this.rows[i].disable();
+
+ if(this.rows[i].moveup_button) this.rows[i].moveup_button.disabled = true;
+ if(this.rows[i].movedown_button) this.rows[i].movedown_button.disabled = true;
+ if(this.rows[i].delete_button) this.rows[i].delete_button.disabled = true;
+ }
+ }
+ this._super();
+ },
+ preBuild: function() {
+ this._super();
+
+ this.rows = [];
+ this.row_cache = [];
+
+ this.hide_delete_buttons = this.options.disable_array_delete || this.jsoneditor.options.disable_array_delete;
+ this.hide_delete_all_rows_buttons = this.hide_delete_buttons || this.options.disable_array_delete_all_rows || this.jsoneditor.options.disable_array_delete_all_rows;
+ this.hide_delete_last_row_buttons = this.hide_delete_buttons || this.options.disable_array_delete_last_row || this.jsoneditor.options.disable_array_delete_last_row;
+ this.hide_move_buttons = this.options.disable_array_reorder || this.jsoneditor.options.disable_array_reorder;
+ this.hide_add_button = this.options.disable_array_add || this.jsoneditor.options.disable_array_add;
+ },
+ build: function() {
+ var self = this;
+
+ if(!this.options.compact) {
+ this.header = document.createElement('span');
+ this.header.textContent = this.getTitle();
+ this.title = this.theme.getHeader(this.header);
+ this.container.appendChild(this.title);
+ this.title_controls = this.theme.getHeaderButtonHolder();
+ this.title.appendChild(this.title_controls);
+ if(this.schema.description) {
+ this.description = this.theme.getDescription(this.schema.description);
+ this.container.appendChild(this.description);
+ }
+ this.error_holder = document.createElement('div');
+ this.container.appendChild(this.error_holder);
+
+ if(this.schema.format === 'tabs') {
+ this.controls = this.theme.getHeaderButtonHolder();
+ this.title.appendChild(this.controls);
+ this.tabs_holder = this.theme.getTabHolder();
+ this.container.appendChild(this.tabs_holder);
+ this.row_holder = this.theme.getTabContentHolder(this.tabs_holder);
+
+ this.active_tab = null;
+ }
+ else {
+ this.panel = this.theme.getIndentedPanel();
+ this.container.appendChild(this.panel);
+ this.row_holder = document.createElement('div');
+ this.panel.appendChild(this.row_holder);
+ this.controls = this.theme.getButtonHolder();
+ this.panel.appendChild(this.controls);
+ }
+ }
+ else {
+ this.panel = this.theme.getIndentedPanel();
+ this.container.appendChild(this.panel);
+ this.controls = this.theme.getButtonHolder();
+ this.panel.appendChild(this.controls);
+ this.row_holder = document.createElement('div');
+ this.panel.appendChild(this.row_holder);
+ }
+
+ // Add controls
+ this.addControls();
+ },
+ onChildEditorChange: function(editor) {
+ this.refreshValue();
+ this.refreshTabs(true);
+ this._super(editor);
+ },
+ getItemTitle: function() {
+ if(!this.item_title) {
+ if(this.schema.items && !Array.isArray(this.schema.items)) {
+ var tmp = this.jsoneditor.expandRefs(this.schema.items);
+ this.item_title = tmp.title || 'item';
+ }
+ else {
+ this.item_title = 'item';
+ }
+ }
+ return this.item_title;
+ },
+ getItemSchema: function(i) {
+ if(Array.isArray(this.schema.items)) {
+ if(i >= this.schema.items.length) {
+ if(this.schema.additionalItems===true) {
+ return {};
+ }
+ else if(this.schema.additionalItems) {
+ return $extend({},this.schema.additionalItems);
+ }
+ }
+ else {
+ return $extend({},this.schema.items[i]);
+ }
+ }
+ else if(this.schema.items) {
+ return $extend({},this.schema.items);
+ }
+ else {
+ return {};
+ }
+ },
+ getItemInfo: function(i) {
+ var schema = this.getItemSchema(i);
+
+ // Check if it's cached
+ this.item_info = this.item_info || {};
+ var stringified = JSON.stringify(schema);
+ if(typeof this.item_info[stringified] !== "undefined") return this.item_info[stringified];
+
+ // Get the schema for this item
+ schema = this.jsoneditor.expandRefs(schema);
+
+ this.item_info[stringified] = {
+ title: schema.title || "item",
+ 'default': schema["default"],
+ width: 12,
+ child_editors: schema.properties || schema.items
+ };
+
+ return this.item_info[stringified];
+ },
+ getElementEditor: function(i) {
+ var item_info = this.getItemInfo(i);
+ var schema = this.getItemSchema(i);
+ schema = this.jsoneditor.expandRefs(schema);
+ schema.title = item_info.title+' '+(i+1);
+
+ var editor = this.jsoneditor.getEditorClass(schema);
+
+ var holder;
+ if(this.tabs_holder) {
+ holder = this.theme.getTabContent();
+ }
+ else if(item_info.child_editors) {
+ holder = this.theme.getChildEditorHolder();
+ }
+ else {
+ holder = this.theme.getIndentedPanel();
+ }
+
+ this.row_holder.appendChild(holder);
+
+ var ret = this.jsoneditor.createEditor(editor,{
+ jsoneditor: this.jsoneditor,
+ schema: schema,
+ container: holder,
+ path: this.path+'.'+i,
+ parent: this,
+ required: true
+ });
+ ret.preBuild();
+ ret.build();
+ ret.postBuild();
+
+ if(!ret.title_controls) {
+ ret.array_controls = this.theme.getButtonHolder();
+ holder.appendChild(ret.array_controls);
+ }
+
+ return ret;
+ },
+ destroy: function() {
+ this.empty(true);
+ if(this.title && this.title.parentNode) this.title.parentNode.removeChild(this.title);
+ if(this.description && this.description.parentNode) this.description.parentNode.removeChild(this.description);
+ if(this.row_holder && this.row_holder.parentNode) this.row_holder.parentNode.removeChild(this.row_holder);
+ if(this.controls && this.controls.parentNode) this.controls.parentNode.removeChild(this.controls);
+ if(this.panel && this.panel.parentNode) this.panel.parentNode.removeChild(this.panel);
+
+ this.rows = this.row_cache = this.title = this.description = this.row_holder = this.panel = this.controls = null;
+
+ this._super();
+ },
+ empty: function(hard) {
+ if(!this.rows) return;
+ var self = this;
+ $each(this.rows,function(i,row) {
+ if(hard) {
+ if(row.tab && row.tab.parentNode) row.tab.parentNode.removeChild(row.tab);
+ self.destroyRow(row,true);
+ self.row_cache[i] = null;
+ }
+ self.rows[i] = null;
+ });
+ self.rows = [];
+ if(hard) self.row_cache = [];
+ },
+ destroyRow: function(row,hard) {
+ var holder = row.container;
+ if(hard) {
+ row.destroy();
+ if(holder.parentNode) holder.parentNode.removeChild(holder);
+ if(row.tab && row.tab.parentNode) row.tab.parentNode.removeChild(row.tab);
+ }
+ else {
+ if(row.tab) row.tab.style.display = 'none';
+ holder.style.display = 'none';
+ row.unregister();
+ }
+ },
+ getMax: function() {
+ if((Array.isArray(this.schema.items)) && this.schema.additionalItems === false) {
+ return Math.min(this.schema.items.length,this.schema.maxItems || Infinity);
+ }
+ else {
+ return this.schema.maxItems || Infinity;
+ }
+ },
+ refreshTabs: function(refresh_headers) {
+ var self = this;
+ $each(this.rows, function(i,row) {
+ if(!row.tab) return;
+
+ if(refresh_headers) {
+ row.tab_text.textContent = row.getHeaderText();
+ }
+ else {
+ if(row.tab === self.active_tab) {
+ self.theme.markTabActive(row.tab);
+ row.container.style.display = '';
+ }
+ else {
+ self.theme.markTabInactive(row.tab);
+ row.container.style.display = 'none';
+ }
+ }
+ });
+ },
+ setValue: function(value, initial) {
+ // Update the array's value, adding/removing rows when necessary
+ value = value || [];
+
+ if(!(Array.isArray(value))) value = [value];
+
+ var serialized = JSON.stringify(value);
+ if(serialized === this.serialized) return;
+
+ // Make sure value has between minItems and maxItems items in it
+ if(this.schema.minItems) {
+ while(value.length < this.schema.minItems) {
+ value.push(this.getItemInfo(value.length)["default"]);
+ }
+ }
+ if(this.getMax() && value.length > this.getMax()) {
+ value = value.slice(0,this.getMax());
+ }
+
+ var self = this;
+ $each(value,function(i,val) {
+ if(self.rows[i]) {
+ // TODO: don't set the row's value if it hasn't changed
+ self.rows[i].setValue(val,initial);
+ }
+ else if(self.row_cache[i]) {
+ self.rows[i] = self.row_cache[i];
+ self.rows[i].setValue(val,initial);
+ self.rows[i].container.style.display = '';
+ if(self.rows[i].tab) self.rows[i].tab.style.display = '';
+ self.rows[i].register();
+ }
+ else {
+ self.addRow(val,initial);
+ }
+ });
+
+ for(var j=value.length; j<self.rows.length; j++) {
+ self.destroyRow(self.rows[j]);
+ self.rows[j] = null;
+ }
+ self.rows = self.rows.slice(0,value.length);
+
+ // Set the active tab
+ var new_active_tab = null;
+ $each(self.rows, function(i,row) {
+ if(row.tab === self.active_tab) {
+ new_active_tab = row.tab;
+ return false;
+ }
+ });
+ if(!new_active_tab && self.rows.length) new_active_tab = self.rows[0].tab;
+
+ self.active_tab = new_active_tab;
+
+ self.refreshValue(initial);
+ self.refreshTabs(true);
+ self.refreshTabs();
+
+ self.onChange();
+
+ // TODO: sortable
+ },
+ refreshValue: function(force) {
+ var self = this;
+ var oldi = this.value? this.value.length : 0;
+ this.value = [];
+
+ $each(this.rows,function(i,editor) {
+ // Get the value for this editor
+ self.value[i] = editor.getValue();
+ });
+
+ if(oldi !== this.value.length || force) {
+ // If we currently have minItems items in the array
+ var minItems = this.schema.minItems && this.schema.minItems >= this.rows.length;
+
+ $each(this.rows,function(i,editor) {
+ // Hide the move down button for the last row
+ if(editor.movedown_button) {
+ if(i === self.rows.length - 1) {
+ editor.movedown_button.style.display = 'none';
+ }
+ else {
+ editor.movedown_button.style.display = '';
+ }
+ }
+
+ // Hide the delete button if we have minItems items
+ if(editor.delete_button) {
+ if(minItems) {
+ editor.delete_button.style.display = 'none';
+ }
+ else {
+ editor.delete_button.style.display = '';
+ }
+ }
+
+ // Get the value for this editor
+ self.value[i] = editor.getValue();
+ });
+
+ var controls_needed = false;
+
+ if(!this.value.length) {
+ this.delete_last_row_button.style.display = 'none';
+ this.remove_all_rows_button.style.display = 'none';
+ }
+ else if(this.value.length === 1) {
+ this.remove_all_rows_button.style.display = 'none';
+
+ // If there are minItems items in the array, or configured to hide the delete_last_row button, hide the delete button beneath the rows
+ if(minItems || this.hide_delete_last_row_buttons) {
+ this.delete_last_row_button.style.display = 'none';
+ }
+ else {
+ this.delete_last_row_button.style.display = '';
+ controls_needed = true;
+ }
+ }
+ else {
+ if(minItems || this.hide_delete_last_row_buttons) {
+ this.delete_last_row_button.style.display = 'none';
+ }
+ else {
+ this.delete_last_row_button.style.display = '';
+ controls_needed = true;
+ }
+
+ if(minItems || this.hide_delete_all_rows_buttons) {
+ this.remove_all_rows_button.style.display = 'none';
+ }
+ else {
+ this.remove_all_rows_button.style.display = '';
+ controls_needed = true;
+ }
+ }
+
+ // If there are maxItems in the array, hide the add button beneath the rows
+ if((this.getMax() && this.getMax() <= this.rows.length) || this.hide_add_button){
+ this.add_row_button.style.display = 'none';
+ }
+ else {
+ this.add_row_button.style.display = '';
+ controls_needed = true;
+ }
+
+ if(!this.collapsed && controls_needed) {
+ this.controls.style.display = 'inline-block';
+ }
+ else {
+ this.controls.style.display = 'none';
+ }
+ }
+ },
+ addRow: function(value, initial) {
+ var self = this;
+ var i = this.rows.length;
+
+ self.rows[i] = this.getElementEditor(i);
+ self.row_cache[i] = self.rows[i];
+
+ if(self.tabs_holder) {
+ self.rows[i].tab_text = document.createElement('span');
+ self.rows[i].tab_text.textContent = self.rows[i].getHeaderText();
+ self.rows[i].tab = self.theme.getTab(self.rows[i].tab_text);
+ self.rows[i].tab.addEventListener('click', function(e) {
+ self.active_tab = self.rows[i].tab;
+ self.refreshTabs();
+ e.preventDefault();
+ e.stopPropagation();
+ });
+
+ self.theme.addTab(self.tabs_holder, self.rows[i].tab);
+ }
+
+ var controls_holder = self.rows[i].title_controls || self.rows[i].array_controls;
+
+ // Buttons to delete row, move row up, and move row down
+ if(!self.hide_delete_buttons) {
+ self.rows[i].delete_button = this.getButton(self.getItemTitle(),'delete',this.translate('button_delete_row_title',[self.getItemTitle()]));
+ self.rows[i].delete_button.className += ' delete';
+ self.rows[i].delete_button.setAttribute('data-i',i);
+ self.rows[i].delete_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var i = this.getAttribute('data-i')*1;
+
+ var value = self.getValue();
+
+ var newval = [];
+ var new_active_tab = null;
+ $each(value,function(j,row) {
+ if(j===i) {
+ // If the one we're deleting is the active tab
+ if(self.rows[j].tab === self.active_tab) {
+ // Make the next tab active if there is one
+ // Note: the next tab is going to be the current tab after deletion
+ if(self.rows[j+1]) new_active_tab = self.rows[j].tab;
+ // Otherwise, make the previous tab active if there is one
+ else if(j) new_active_tab = self.rows[j-1].tab;
+ }
+
+ return; // If this is the one we're deleting
+ }
+ newval.push(row);
+ });
+ self.setValue(newval);
+ if(new_active_tab) {
+ self.active_tab = new_active_tab;
+ self.refreshTabs();
+ }
+
+ self.onChange(true);
+ });
+
+ if(controls_holder) {
+ controls_holder.appendChild(self.rows[i].delete_button);
+ }
+ }
+
+ if(i && !self.hide_move_buttons) {
+ self.rows[i].moveup_button = this.getButton('','moveup',this.translate('button_move_up_title'));
+ self.rows[i].moveup_button.className += ' moveup';
+ self.rows[i].moveup_button.setAttribute('data-i',i);
+ self.rows[i].moveup_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var i = this.getAttribute('data-i')*1;
+
+ if(i<=0) return;
+ var rows = self.getValue();
+ var tmp = rows[i-1];
+ rows[i-1] = rows[i];
+ rows[i] = tmp;
+
+ self.setValue(rows);
+ self.active_tab = self.rows[i-1].tab;
+ self.refreshTabs();
+
+ self.onChange(true);
+ });
+
+ if(controls_holder) {
+ controls_holder.appendChild(self.rows[i].moveup_button);
+ }
+ }
+
+ if(!self.hide_move_buttons) {
+ self.rows[i].movedown_button = this.getButton('','movedown',this.translate('button_move_down_title'));
+ self.rows[i].movedown_button.className += ' movedown';
+ self.rows[i].movedown_button.setAttribute('data-i',i);
+ self.rows[i].movedown_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var i = this.getAttribute('data-i')*1;
+
+ var rows = self.getValue();
+ if(i>=rows.length-1) return;
+ var tmp = rows[i+1];
+ rows[i+1] = rows[i];
+ rows[i] = tmp;
+
+ self.setValue(rows);
+ self.active_tab = self.rows[i+1].tab;
+ self.refreshTabs();
+ self.onChange(true);
+ });
+
+ if(controls_holder) {
+ controls_holder.appendChild(self.rows[i].movedown_button);
+ }
+ }
+
+ if(value) self.rows[i].setValue(value, initial);
+ self.refreshTabs();
+ },
+ addControls: function() {
+ var self = this;
+
+ this.collapsed = false;
+ this.toggle_button = this.getButton('','collapse',this.translate('button_collapse'));
+ this.title_controls.appendChild(this.toggle_button);
+ var row_holder_display = self.row_holder.style.display;
+ var controls_display = self.controls.style.display;
+ this.toggle_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ if(self.collapsed) {
+ self.collapsed = false;
+ if(self.panel) self.panel.style.display = '';
+ self.row_holder.style.display = row_holder_display;
+ if(self.tabs_holder) self.tabs_holder.style.display = '';
+ self.controls.style.display = controls_display;
+ self.setButtonText(this,'','collapse','Collapse');
+ }
+ else {
+ self.collapsed = true;
+ self.row_holder.style.display = 'none';
+ if(self.tabs_holder) self.tabs_holder.style.display = 'none';
+ self.controls.style.display = 'none';
+ if(self.panel) self.panel.style.display = 'none';
+ self.setButtonText(this,'','expand','Expand');
+ }
+ });
+
+ // If it should start collapsed
+ if(this.options.collapsed) {
+ $trigger(this.toggle_button,'click');
+ }
+
+ // Collapse button disabled
+ if(this.schema.options && typeof this.schema.options.disable_collapse !== "undefined") {
+ if(this.schema.options.disable_collapse) this.toggle_button.style.display = 'none';
+ }
+ else if(this.jsoneditor.options.disable_collapse) {
+ this.toggle_button.style.display = 'none';
+ }
+
+ // Add "new row" and "delete last" buttons below editor
+ this.add_row_button = this.getButton(this.getItemTitle(),'add',this.translate('button_add_row_title',[this.getItemTitle()]));
+
+ this.add_row_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var i = self.rows.length;
+ if(self.row_cache[i]) {
+ self.rows[i] = self.row_cache[i];
+ self.rows[i].setValue(self.rows[i].getDefault());
+ self.rows[i].container.style.display = '';
+ if(self.rows[i].tab) self.rows[i].tab.style.display = '';
+ self.rows[i].register();
+ }
+ else {
+ self.addRow();
+ }
+ self.active_tab = self.rows[i].tab;
+ self.refreshTabs();
+ self.refreshValue();
+ self.onChange(true);
+ });
+ self.controls.appendChild(this.add_row_button);
+
+ this.delete_last_row_button = this.getButton(this.translate('button_delete_last',[this.getItemTitle()]),'delete',this.translate('button_delete_last_title',[this.getItemTitle()]));
+ this.delete_last_row_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var rows = self.getValue();
+
+ var new_active_tab = null;
+ if(self.rows.length > 1 && self.rows[self.rows.length-1].tab === self.active_tab) new_active_tab = self.rows[self.rows.length-2].tab;
+
+ rows.pop();
+ self.setValue(rows);
+ if(new_active_tab) {
+ self.active_tab = new_active_tab;
+ self.refreshTabs();
+ }
+ self.onChange(true);
+ });
+ self.controls.appendChild(this.delete_last_row_button);
+
+ this.remove_all_rows_button = this.getButton(this.translate('button_delete_all'),'delete',this.translate('button_delete_all_title'));
+ this.remove_all_rows_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.setValue([]);
+ self.onChange(true);
+ });
+ self.controls.appendChild(this.remove_all_rows_button);
+
+ if(self.tabs) {
+ this.add_row_button.style.width = '100%';
+ this.add_row_button.style.textAlign = 'left';
+ this.add_row_button.style.marginBottom = '3px';
+
+ this.delete_last_row_button.style.width = '100%';
+ this.delete_last_row_button.style.textAlign = 'left';
+ this.delete_last_row_button.style.marginBottom = '3px';
+
+ this.remove_all_rows_button.style.width = '100%';
+ this.remove_all_rows_button.style.textAlign = 'left';
+ this.remove_all_rows_button.style.marginBottom = '3px';
+ }
+ },
+ showValidationErrors: function(errors) {
+ var self = this;
+
+ // Get all the errors that pertain to this editor
+ var my_errors = [];
+ var other_errors = [];
+ $each(errors, function(i,error) {
+ if(error.path === self.path) {
+ my_errors.push(error);
+ }
+ else {
+ other_errors.push(error);
+ }
+ });
+
+ // Show errors for this editor
+ if(this.error_holder) {
+ if(my_errors.length) {
+ var message = [];
+ this.error_holder.innerHTML = '';
+ this.error_holder.style.display = '';
+ $each(my_errors, function(i,error) {
+ self.error_holder.appendChild(self.theme.getErrorMessage(error.message));
+ });
+ }
+ // Hide error area
+ else {
+ this.error_holder.style.display = 'none';
+ }
+ }
+
+ // Show errors for child editors
+ $each(this.rows, function(i,row) {
+ row.showValidationErrors(other_errors);
+ });
+ }
+});
+
+JSONEditor.defaults.editors.table = JSONEditor.defaults.editors.array.extend({
+ register: function() {
+ this._super();
+ if(this.rows) {
+ for(var i=0; i<this.rows.length; i++) {
+ this.rows[i].register();
+ }
+ }
+ },
+ unregister: function() {
+ this._super();
+ if(this.rows) {
+ for(var i=0; i<this.rows.length; i++) {
+ this.rows[i].unregister();
+ }
+ }
+ },
+ getNumColumns: function() {
+ return Math.max(Math.min(12,this.width),3);
+ },
+ preBuild: function() {
+ var item_schema = this.jsoneditor.expandRefs(this.schema.items || {});
+
+ this.item_title = item_schema.title || 'row';
+ this.item_default = item_schema["default"] || null;
+ this.item_has_child_editors = item_schema.properties || item_schema.items;
+ this.width = 12;
+ this._super();
+ },
+ build: function() {
+ var self = this;
+ this.table = this.theme.getTable();
+ this.container.appendChild(this.table);
+ this.thead = this.theme.getTableHead();
+ this.table.appendChild(this.thead);
+ this.header_row = this.theme.getTableRow();
+ this.thead.appendChild(this.header_row);
+ this.row_holder = this.theme.getTableBody();
+ this.table.appendChild(this.row_holder);
+
+ // Determine the default value of array element
+ var tmp = this.getElementEditor(0,true);
+ this.item_default = tmp.getDefault();
+ this.width = tmp.getNumColumns() + 2;
+
+ if(!this.options.compact) {
+ this.title = this.theme.getHeader(this.getTitle());
+ this.container.appendChild(this.title);
+ this.title_controls = this.theme.getHeaderButtonHolder();
+ this.title.appendChild(this.title_controls);
+ if(this.schema.description) {
+ this.description = this.theme.getDescription(this.schema.description);
+ this.container.appendChild(this.description);
+ }
+ this.panel = this.theme.getIndentedPanel();
+ this.container.appendChild(this.panel);
+ this.error_holder = document.createElement('div');
+ this.panel.appendChild(this.error_holder);
+ }
+ else {
+ this.panel = document.createElement('div');
+ this.container.appendChild(this.panel);
+ }
+
+ this.panel.appendChild(this.table);
+ this.controls = this.theme.getButtonHolder();
+ this.panel.appendChild(this.controls);
+
+ if(this.item_has_child_editors) {
+ var ce = tmp.getChildEditors();
+ var order = tmp.property_order || Object.keys(ce);
+ for(var i=0; i<order.length; i++) {
+ var th = self.theme.getTableHeaderCell(ce[order[i]].getTitle());
+ if(ce[order[i]].options.hidden) th.style.display = 'none';
+ self.header_row.appendChild(th);
+ }
+ }
+ else {
+ self.header_row.appendChild(self.theme.getTableHeaderCell(this.item_title));
+ }
+
+ tmp.destroy();
+ this.row_holder.innerHTML = '';
+
+ // Row Controls column
+ this.controls_header_cell = self.theme.getTableHeaderCell(" ");
+ self.header_row.appendChild(this.controls_header_cell);
+
+ // Add controls
+ this.addControls();
+ },
+ onChildEditorChange: function(editor) {
+ this.refreshValue();
+ this._super();
+ },
+ getItemDefault: function() {
+ return $extend({},{"default":this.item_default})["default"];
+ },
+ getItemTitle: function() {
+ return this.item_title;
+ },
+ getElementEditor: function(i,ignore) {
+ var schema_copy = $extend({},this.schema.items);
+ var editor = this.jsoneditor.getEditorClass(schema_copy, this.jsoneditor);
+ var row = this.row_holder.appendChild(this.theme.getTableRow());
+ var holder = row;
+ if(!this.item_has_child_editors) {
+ holder = this.theme.getTableCell();
+ row.appendChild(holder);
+ }
+
+ var ret = this.jsoneditor.createEditor(editor,{
+ jsoneditor: this.jsoneditor,
+ schema: schema_copy,
+ container: holder,
+ path: this.path+'.'+i,
+ parent: this,
+ compact: true,
+ table_row: true
+ });
+
+ ret.preBuild();
+ if(!ignore) {
+ ret.build();
+ ret.postBuild();
+
+ ret.controls_cell = row.appendChild(this.theme.getTableCell());
+ ret.row = row;
+ ret.table_controls = this.theme.getButtonHolder();
+ ret.controls_cell.appendChild(ret.table_controls);
+ ret.table_controls.style.margin = 0;
+ ret.table_controls.style.padding = 0;
+ }
+
+ return ret;
+ },
+ destroy: function() {
+ this.innerHTML = '';
+ if(this.title && this.title.parentNode) this.title.parentNode.removeChild(this.title);
+ if(this.description && this.description.parentNode) this.description.parentNode.removeChild(this.description);
+ if(this.row_holder && this.row_holder.parentNode) this.row_holder.parentNode.removeChild(this.row_holder);
+ if(this.table && this.table.parentNode) this.table.parentNode.removeChild(this.table);
+ if(this.panel && this.panel.parentNode) this.panel.parentNode.removeChild(this.panel);
+
+ this.rows = this.title = this.description = this.row_holder = this.table = this.panel = null;
+
+ this._super();
+ },
+ setValue: function(value, initial) {
+ // Update the array's value, adding/removing rows when necessary
+ value = value || [];
+
+ // Make sure value has between minItems and maxItems items in it
+ if(this.schema.minItems) {
+ while(value.length < this.schema.minItems) {
+ value.push(this.getItemDefault());
+ }
+ }
+ if(this.schema.maxItems && value.length > this.schema.maxItems) {
+ value = value.slice(0,this.schema.maxItems);
+ }
+
+ var serialized = JSON.stringify(value);
+ if(serialized === this.serialized) return;
+
+ var numrows_changed = false;
+
+ var self = this;
+ $each(value,function(i,val) {
+ if(self.rows[i]) {
+ // TODO: don't set the row's value if it hasn't changed
+ self.rows[i].setValue(val);
+ }
+ else {
+ self.addRow(val);
+ numrows_changed = true;
+ }
+ });
+
+ for(var j=value.length; j<self.rows.length; j++) {
+ var holder = self.rows[j].container;
+ if(!self.item_has_child_editors) {
+ self.rows[j].row.parentNode.removeChild(self.rows[j].row);
+ }
+ self.rows[j].destroy();
+ if(holder.parentNode) holder.parentNode.removeChild(holder);
+ self.rows[j] = null;
+ numrows_changed = true;
+ }
+ self.rows = self.rows.slice(0,value.length);
+
+ self.refreshValue();
+ if(numrows_changed || initial) self.refreshRowButtons();
+
+ self.onChange();
+
+ // TODO: sortable
+ },
+ refreshRowButtons: function() {
+ var self = this;
+
+ // If we currently have minItems items in the array
+ var minItems = this.schema.minItems && this.schema.minItems >= this.rows.length;
+
+ var need_row_buttons = false;
+ $each(this.rows,function(i,editor) {
+ // Hide the move down button for the last row
+ if(editor.movedown_button) {
+ if(i === self.rows.length - 1) {
+ editor.movedown_button.style.display = 'none';
+ }
+ else {
+ need_row_buttons = true;
+ editor.movedown_button.style.display = '';
+ }
+ }
+
+ // Hide the delete button if we have minItems items
+ if(editor.delete_button) {
+ if(minItems) {
+ editor.delete_button.style.display = 'none';
+ }
+ else {
+ need_row_buttons = true;
+ editor.delete_button.style.display = '';
+ }
+ }
+
+ if(editor.moveup_button) {
+ need_row_buttons = true;
+ }
+ });
+
+ // Show/hide controls column in table
+ $each(this.rows,function(i,editor) {
+ if(need_row_buttons) {
+ editor.controls_cell.style.display = '';
+ }
+ else {
+ editor.controls_cell.style.display = 'none';
+ }
+ });
+ if(need_row_buttons) {
+ this.controls_header_cell.style.display = '';
+ }
+ else {
+ this.controls_header_cell.style.display = 'none';
+ }
+
+ var controls_needed = false;
+
+ if(!this.value.length) {
+ this.delete_last_row_button.style.display = 'none';
+ this.remove_all_rows_button.style.display = 'none';
+ this.table.style.display = 'none';
+ }
+ else if(this.value.length === 1) {
+ this.table.style.display = '';
+ this.remove_all_rows_button.style.display = 'none';
+
+ // If there are minItems items in the array, or configured to hide the delete_last_row button, hide the delete button beneath the rows
+ if(minItems || this.hide_delete_last_row_buttons) {
+ this.delete_last_row_button.style.display = 'none';
+ }
+ else {
+ this.delete_last_row_button.style.display = '';
+ controls_needed = true;
+ }
+ }
+ else {
+ this.table.style.display = '';
+
+ if(minItems || this.hide_delete_last_row_buttons) {
+ this.delete_last_row_button.style.display = 'none';
+ }
+ else {
+ this.delete_last_row_button.style.display = '';
+ controls_needed = true;
+ }
+
+ if(minItems || this.hide_delete_all_rows_buttons) {
+ this.remove_all_rows_button.style.display = 'none';
+ }
+ else {
+ this.remove_all_rows_button.style.display = '';
+ controls_needed = true;
+ }
+ }
+
+ // If there are maxItems in the array, hide the add button beneath the rows
+ if((this.schema.maxItems && this.schema.maxItems <= this.rows.length) || this.hide_add_button) {
+ this.add_row_button.style.display = 'none';
+ }
+ else {
+ this.add_row_button.style.display = '';
+ controls_needed = true;
+ }
+
+ if(!controls_needed) {
+ this.controls.style.display = 'none';
+ }
+ else {
+ this.controls.style.display = '';
+ }
+ },
+ refreshValue: function() {
+ var self = this;
+ this.value = [];
+
+ $each(this.rows,function(i,editor) {
+ // Get the value for this editor
+ self.value[i] = editor.getValue();
+ });
+ this.serialized = JSON.stringify(this.value);
+ },
+ addRow: function(value) {
+ var self = this;
+ var i = this.rows.length;
+
+ self.rows[i] = this.getElementEditor(i);
+
+ var controls_holder = self.rows[i].table_controls;
+
+ // Buttons to delete row, move row up, and move row down
+ if(!this.hide_delete_buttons) {
+ self.rows[i].delete_button = this.getButton('','delete',this.translate('button_delete_row_title_short'));
+ self.rows[i].delete_button.className += ' delete';
+ self.rows[i].delete_button.setAttribute('data-i',i);
+ self.rows[i].delete_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var i = this.getAttribute('data-i')*1;
+
+ var value = self.getValue();
+
+ var newval = [];
+ $each(value,function(j,row) {
+ if(j===i) return; // If this is the one we're deleting
+ newval.push(row);
+ });
+ self.setValue(newval);
+ self.onChange(true);
+ });
+ controls_holder.appendChild(self.rows[i].delete_button);
+ }
+
+
+ if(i && !this.hide_move_buttons) {
+ self.rows[i].moveup_button = this.getButton('','moveup',this.translate('button_move_up_title'));
+ self.rows[i].moveup_button.className += ' moveup';
+ self.rows[i].moveup_button.setAttribute('data-i',i);
+ self.rows[i].moveup_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var i = this.getAttribute('data-i')*1;
+
+ if(i<=0) return;
+ var rows = self.getValue();
+ var tmp = rows[i-1];
+ rows[i-1] = rows[i];
+ rows[i] = tmp;
+
+ self.setValue(rows);
+ self.onChange(true);
+ });
+ controls_holder.appendChild(self.rows[i].moveup_button);
+ }
+
+ if(!this.hide_move_buttons) {
+ self.rows[i].movedown_button = this.getButton('','movedown',this.translate('button_move_down_title'));
+ self.rows[i].movedown_button.className += ' movedown';
+ self.rows[i].movedown_button.setAttribute('data-i',i);
+ self.rows[i].movedown_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ var i = this.getAttribute('data-i')*1;
+ var rows = self.getValue();
+ if(i>=rows.length-1) return;
+ var tmp = rows[i+1];
+ rows[i+1] = rows[i];
+ rows[i] = tmp;
+
+ self.setValue(rows);
+ self.onChange(true);
+ });
+ controls_holder.appendChild(self.rows[i].movedown_button);
+ }
+
+ if(value) self.rows[i].setValue(value);
+ },
+ addControls: function() {
+ var self = this;
+
+ this.collapsed = false;
+ this.toggle_button = this.getButton('','collapse',this.translate('button_collapse'));
+ if(this.title_controls) {
+ this.title_controls.appendChild(this.toggle_button);
+ this.toggle_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ if(self.collapsed) {
+ self.collapsed = false;
+ self.panel.style.display = '';
+ self.setButtonText(this,'','collapse','Collapse');
+ }
+ else {
+ self.collapsed = true;
+ self.panel.style.display = 'none';
+ self.setButtonText(this,'','expand','Expand');
+ }
+ });
+
+ // If it should start collapsed
+ if(this.options.collapsed) {
+ $trigger(this.toggle_button,'click');
+ }
+
+ // Collapse button disabled
+ if(this.schema.options && typeof this.schema.options.disable_collapse !== "undefined") {
+ if(this.schema.options.disable_collapse) this.toggle_button.style.display = 'none';
+ }
+ else if(this.jsoneditor.options.disable_collapse) {
+ this.toggle_button.style.display = 'none';
+ }
+ }
+
+ // Add "new row" and "delete last" buttons below editor
+ this.add_row_button = this.getButton(this.getItemTitle(),'add',this.translate('button_add_row_title',[this.getItemTitle()]));
+ this.add_row_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ self.addRow();
+ self.refreshValue();
+ self.refreshRowButtons();
+ self.onChange(true);
+ });
+ self.controls.appendChild(this.add_row_button);
+
+ this.delete_last_row_button = this.getButton(this.translate('button_delete_last',[this.getItemTitle()]),'delete',this.translate('button_delete_last_title',[this.getItemTitle()]));
+ this.delete_last_row_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ var rows = self.getValue();
+ rows.pop();
+ self.setValue(rows);
+ self.onChange(true);
+ });
+ self.controls.appendChild(this.delete_last_row_button);
+
+ this.remove_all_rows_button = this.getButton(this.translate('button_delete_all'),'delete',this.translate('button_delete_all_title'));
+ this.remove_all_rows_button.addEventListener('click',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ self.setValue([]);
+ self.onChange(true);
+ });
+ self.controls.appendChild(this.remove_all_rows_button);
+ }
+});
+
+// Multiple Editor (for when `type` is an array)
+JSONEditor.defaults.editors.multiple = JSONEditor.AbstractEditor.extend({
+ register: function() {
+ if(this.editors) {
+ for(var i=0; i<this.editors.length; i++) {
+ if(!this.editors[i]) continue;
+ this.editors[i].unregister();
+ }
+ if(this.editors[this.type]) this.editors[this.type].register();
+ }
+ this._super();
+ },
+ unregister: function() {
+ this._super();
+ if(this.editors) {
+ for(var i=0; i<this.editors.length; i++) {
+ if(!this.editors[i]) continue;
+ this.editors[i].unregister();
+ }
+ }
+ },
+ getNumColumns: function() {
+ if(!this.editors[this.type]) return 4;
+ return Math.max(this.editors[this.type].getNumColumns(),4);
+ },
+ enable: function() {
+ if(this.editors) {
+ for(var i=0; i<this.editors.length; i++) {
+ if(!this.editors[i]) continue;
+ this.editors[i].enable();
+ }
+ }
+ this.switcher.disabled = false;
+ this._super();
+ },
+ disable: function() {
+ if(this.editors) {
+ for(var i=0; i<this.editors.length; i++) {
+ if(!this.editors[i]) continue;
+ this.editors[i].disable();
+ }
+ }
+ this.switcher.disabled = true;
+ this._super();
+ },
+ switchEditor: function(i) {
+ var self = this;
+
+ if(!this.editors[i]) {
+ this.buildChildEditor(i);
+ }
+
+ self.type = i;
+
+ self.register();
+
+ var current_value = self.getValue();
+
+ $each(self.editors,function(type,editor) {
+ if(!editor) return;
+ if(self.type === type) {
+ if(self.keep_values) editor.setValue(current_value,true);
+ editor.container.style.display = '';
+ }
+ else editor.container.style.display = 'none';
+ });
+ self.refreshValue();
+ self.refreshHeaderText();
+ },
+ buildChildEditor: function(i) {
+ var self = this;
+ var type = this.types[i];
+ var holder = self.theme.getChildEditorHolder();
+ self.editor_holder.appendChild(holder);
+
+ var schema;
+
+ if(typeof type === "string") {
+ schema = $extend({},self.schema);
+ schema.type = type;
+ }
+ else {
+ schema = $extend({},self.schema,type);
+ schema = self.jsoneditor.expandRefs(schema);
+
+ // If we need to merge `required` arrays
+ if(type.required && Array.isArray(type.required) && self.schema.required && Array.isArray(self.schema.required)) {
+ schema.required = self.schema.required.concat(type.required);
+ }
+ }
+
+ var editor = self.jsoneditor.getEditorClass(schema);
+
+ self.editors[i] = self.jsoneditor.createEditor(editor,{
+ jsoneditor: self.jsoneditor,
+ schema: schema,
+ container: holder,
+ path: self.path,
+ parent: self,
+ required: true
+ });
+ self.editors[i].preBuild();
+ self.editors[i].build();
+ self.editors[i].postBuild();
+
+ if(self.editors[i].header) self.editors[i].header.style.display = 'none';
+
+ self.editors[i].option = self.switcher_options[i];
+
+ holder.addEventListener('change_header_text',function() {
+ self.refreshHeaderText();
+ });
+
+ if(i !== self.type) holder.style.display = 'none';
+ },
+ preBuild: function() {
+ var self = this;
+
+ this.types = [];
+ this.type = 0;
+ this.editors = [];
+ this.validators = [];
+
+ this.keep_values = true;
+ if(typeof this.jsoneditor.options.keep_oneof_values !== "undefined") this.keep_values = this.jsoneditor.options.keep_oneof_values;
+ if(typeof this.options.keep_oneof_values !== "undefined") this.keep_values = this.options.keep_oneof_values;
+
+ if(this.schema.oneOf) {
+ this.oneOf = true;
+ this.types = this.schema.oneOf;
+ $each(this.types,function(i,oneof) {
+ //self.types[i] = self.jsoneditor.expandSchema(oneof);
+ });
+ delete this.schema.oneOf;
+ }
+ else {
+ if(!this.schema.type || this.schema.type === "any") {
+ this.types = ['string','number','integer','boolean','object','array','null'];
+
+ // If any of these primitive types are disallowed
+ if(this.schema.disallow) {
+ var disallow = this.schema.disallow;
+ if(typeof disallow !== 'object' || !(Array.isArray(disallow))) {
+ disallow = [disallow];
+ }
+ var allowed_types = [];
+ $each(this.types,function(i,type) {
+ if(disallow.indexOf(type) === -1) allowed_types.push(type);
+ });
+ this.types = allowed_types;
+ }
+ }
+ else if(Array.isArray(this.schema.type)) {
+ this.types = this.schema.type;
+ }
+ else {
+ this.types = [this.schema.type];
+ }
+ delete this.schema.type;
+ }
+
+ this.display_text = this.getDisplayText(this.types);
+ },
+ build: function() {
+ var self = this;
+ var container = this.container;
+
+ this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+ this.container.appendChild(this.header);
+
+ this.switcher = this.theme.getSwitcher(this.display_text);
+ container.appendChild(this.switcher);
+ this.switcher.addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ self.switchEditor(self.display_text.indexOf(this.value));
+ self.onChange(true);
+ });
+
+ this.editor_holder = document.createElement('div');
+ container.appendChild(this.editor_holder);
+
+
+ var validator_options = {};
+ if(self.jsoneditor.options.custom_validators) {
+ validator_options.custom_validators = self.jsoneditor.options.custom_validators;
+ }
+
+ this.switcher_options = this.theme.getSwitcherOptions(this.switcher);
+ $each(this.types,function(i,type) {
+ self.editors[i] = false;
+
+ var schema;
+
+ if(typeof type === "string") {
+ schema = $extend({},self.schema);
+ schema.type = type;
+ }
+ else {
+ schema = $extend({},self.schema,type);
+
+ // If we need to merge `required` arrays
+ if(type.required && Array.isArray(type.required) && self.schema.required && Array.isArray(self.schema.required)) {
+ schema.required = self.schema.required.concat(type.required);
+ }
+ }
+
+ self.validators[i] = new JSONEditor.Validator(self.jsoneditor,schema,validator_options);
+ });
+
+ this.switchEditor(0);
+ },
+ onChildEditorChange: function(editor) {
+ if(this.editors[this.type]) {
+ this.refreshValue();
+ this.refreshHeaderText();
+ }
+
+ this._super();
+ },
+ refreshHeaderText: function() {
+ var display_text = this.getDisplayText(this.types);
+ $each(this.switcher_options, function(i,option) {
+ option.textContent = display_text[i];
+ });
+ },
+ refreshValue: function() {
+ this.value = this.editors[this.type].getValue();
+ },
+ setValue: function(val,initial) {
+ // Determine type by getting the first one that validates
+ var self = this;
+ $each(this.validators, function(i,validator) {
+ if(!validator.validate(val).length) {
+ self.type = i;
+ self.switcher.value = self.display_text[i];
+ return false;
+ }
+ });
+
+ this.switchEditor(this.type);
+
+ this.editors[this.type].setValue(val,initial);
+
+ this.refreshValue();
+ self.onChange();
+ },
+ destroy: function() {
+ $each(this.editors, function(type,editor) {
+ if(editor) editor.destroy();
+ });
+ if(this.editor_holder && this.editor_holder.parentNode) this.editor_holder.parentNode.removeChild(this.editor_holder);
+ if(this.switcher && this.switcher.parentNode) this.switcher.parentNode.removeChild(this.switcher);
+ this._super();
+ },
+ showValidationErrors: function(errors) {
+ var self = this;
+
+ // oneOf error paths need to remove the oneOf[i] part before passing to child editors
+ if(this.oneOf) {
+ $each(this.editors,function(i,editor) {
+ if(!editor) return;
+ var check = self.path+'.oneOf['+i+']';
+ var new_errors = [];
+ $each(errors, function(j,error) {
+ if(error.path.substr(0,check.length)===check) {
+ var new_error = $extend({},error);
+ new_error.path = self.path+new_error.path.substr(check.length);
+ new_errors.push(new_error);
+ }
+ });
+
+ editor.showValidationErrors(new_errors);
+ });
+ }
+ else {
+ $each(this.editors,function(type,editor) {
+ if(!editor) return;
+ editor.showValidationErrors(errors);
+ });
+ }
+ }
+});
+
+// Enum Editor (used for objects and arrays with enumerated values)
+JSONEditor.defaults.editors["enum"] = JSONEditor.AbstractEditor.extend({
+ getNumColumns: function() {
+ return 4;
+ },
+ build: function() {
+ var container = this.container;
+ this.title = this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+ this.container.appendChild(this.title);
+
+ this.options.enum_titles = this.options.enum_titles || [];
+
+ this["enum"] = this.schema["enum"];
+ this.selected = 0;
+ this.select_options = [];
+ this.html_values = [];
+
+ var self = this;
+ for(var i=0; i<this["enum"].length; i++) {
+ this.select_options[i] = this.options.enum_titles[i] || "Value "+(i+1);
+ this.html_values[i] = this.getHTML(this["enum"][i]);
+ }
+
+ // Switcher
+ this.switcher = this.theme.getSwitcher(this.select_options);
+ this.container.appendChild(this.switcher);
+
+ // Display area
+ this.display_area = this.theme.getIndentedPanel();
+ this.container.appendChild(this.display_area);
+
+ if(this.options.hide_display) this.display_area.style.display = "none";
+
+ this.switcher.addEventListener('change',function() {
+ self.selected = self.select_options.indexOf(this.value);
+ self.value = self["enum"][self.selected];
+ self.refreshValue();
+ self.onChange(true);
+ });
+ this.value = this["enum"][0];
+ this.refreshValue();
+
+ if(this["enum"].length === 1) this.switcher.style.display = 'none';
+ },
+ refreshValue: function() {
+ var self = this;
+ self.selected = -1;
+ var stringified = JSON.stringify(this.value);
+ $each(this["enum"], function(i, el) {
+ if(stringified === JSON.stringify(el)) {
+ self.selected = i;
+ return false;
+ }
+ });
+
+ if(self.selected<0) {
+ self.setValue(self["enum"][0]);
+ return;
+ }
+
+ this.switcher.value = this.select_options[this.selected];
+ this.display_area.innerHTML = this.html_values[this.selected];
+ },
+ enable: function() {
+ if(!this.always_disabled) this.switcher.disabled = false;
+ this._super();
+ },
+ disable: function() {
+ this.switcher.disabled = true;
+ this._super();
+ },
+ getHTML: function(el) {
+ var self = this;
+
+ if(el === null) {
+ return '<em>null</em>';
+ }
+ // Array or Object
+ else if(typeof el === "object") {
+ // TODO: use theme
+ var ret = '';
+
+ $each(el,function(i,child) {
+ var html = self.getHTML(child);
+
+ // Add the keys to object children
+ if(!(Array.isArray(el))) {
+ // TODO: use theme
+ html = '<div><em>'+i+'</em>: '+html+'</div>';
+ }
+
+ // TODO: use theme
+ ret += '<li>'+html+'</li>';
+ });
+
+ if(Array.isArray(el)) ret = '<ol>'+ret+'</ol>';
+ else ret = "<ul style='margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;'>"+ret+'</ul>';
+
+ return ret;
+ }
+ // Boolean
+ else if(typeof el === "boolean") {
+ return el? 'true' : 'false';
+ }
+ // String
+ else if(typeof el === "string") {
+ return el.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
+ }
+ // Number
+ else {
+ return el;
+ }
+ },
+ setValue: function(val) {
+ if(this.value !== val) {
+ this.value = val;
+ this.refreshValue();
+ this.onChange();
+ }
+ },
+ destroy: function() {
+ if(this.display_area && this.display_area.parentNode) this.display_area.parentNode.removeChild(this.display_area);
+ if(this.title && this.title.parentNode) this.title.parentNode.removeChild(this.title);
+ if(this.switcher && this.switcher.parentNode) this.switcher.parentNode.removeChild(this.switcher);
+
+ this._super();
+ }
+});
+
+JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
+ setValue: function(value,initial) {
+ value = this.typecast(value||'');
+
+ // Sanitize value before setting it
+ var sanitized = value;
+ if(this.enum_values.indexOf(sanitized) < 0) {
+ sanitized = this.enum_values[0];
+ }
+
+ if(this.value === sanitized) {
+ return;
+ }
+
+ this.input.value = this.enum_options[this.enum_values.indexOf(sanitized)];
+ if(this.select2) this.select2.select2('val',this.input.value);
+ this.value = sanitized;
+ this.onChange();
+ },
+ register: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.setAttribute('name',this.formname);
+ },
+ unregister: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.removeAttribute('name');
+ },
+ getNumColumns: function() {
+ if(!this.enum_options) return 3;
+ var longest_text = this.getTitle().length;
+ for(var i=0; i<this.enum_options.length; i++) {
+ longest_text = Math.max(longest_text,this.enum_options[i].length+4);
+ }
+ return Math.min(12,Math.max(longest_text/7,2));
+ },
+ typecast: function(value) {
+ if(this.schema.type === "boolean") {
+ return !!value;
+ }
+ else if(this.schema.type === "number") {
+ return 1*value;
+ }
+ else if(this.schema.type === "integer") {
+ return Math.floor(value*1);
+ }
+ else {
+ return ""+value;
+ }
+ },
+ getValue: function() {
+ return this.value;
+ },
+ preBuild: function() {
+ var self = this;
+ this.input_type = 'select';
+ this.enum_options = [];
+ this.enum_values = [];
+ this.enum_display = [];
+
+ // Enum options enumerated
+ if(this.schema["enum"]) {
+ var display = this.schema.options && this.schema.options.enum_titles || [];
+
+ $each(this.schema["enum"],function(i,option) {
+ self.enum_options[i] = ""+option;
+ self.enum_display[i] = ""+(display[i] || option);
+ self.enum_values[i] = self.typecast(option);
+ });
+
+ if(!this.isRequired()){
+ self.enum_display.unshift(' ');
+ self.enum_options.unshift('undefined');
+ self.enum_values.unshift(undefined);
+ }
+
+ }
+ // Boolean
+ else if(this.schema.type === "boolean") {
+ self.enum_display = this.schema.options && this.schema.options.enum_titles || ['true','false'];
+ self.enum_options = ['1',''];
+ self.enum_values = [true,false];
+
+ if(!this.isRequired()){
+ self.enum_display.unshift(' ');
+ self.enum_options.unshift('undefined');
+ self.enum_values.unshift(undefined);
+ }
+
+ }
+ // Dynamic Enum
+ else if(this.schema.enumSource) {
+ this.enumSource = [];
+ this.enum_display = [];
+ this.enum_options = [];
+ this.enum_values = [];
+
+ // Shortcut declaration for using a single array
+ if(!(Array.isArray(this.schema.enumSource))) {
+ if(this.schema.enumValue) {
+ this.enumSource = [
+ {
+ source: this.schema.enumSource,
+ value: this.schema.enumValue
+ }
+ ];
+ }
+ else {
+ this.enumSource = [
+ {
+ source: this.schema.enumSource
+ }
+ ];
+ }
+ }
+ else {
+ for(i=0; i<this.schema.enumSource.length; i++) {
+ // Shorthand for watched variable
+ if(typeof this.schema.enumSource[i] === "string") {
+ this.enumSource[i] = {
+ source: this.schema.enumSource[i]
+ };
+ }
+ // Make a copy of the schema
+ else if(!(Array.isArray(this.schema.enumSource[i]))) {
+ this.enumSource[i] = $extend({},this.schema.enumSource[i]);
+ }
+ else {
+ this.enumSource[i] = this.schema.enumSource[i];
+ }
+ }
+ }
+
+ // Now, enumSource is an array of sources
+ // Walk through this array and fix up the values
+ for(i=0; i<this.enumSource.length; i++) {
+ if(this.enumSource[i].value) {
+ this.enumSource[i].value = this.jsoneditor.compileTemplate(this.enumSource[i].value, this.template_engine);
+ }
+ if(this.enumSource[i].title) {
+ this.enumSource[i].title = this.jsoneditor.compileTemplate(this.enumSource[i].title, this.template_engine);
+ }
+ if(this.enumSource[i].filter) {
+ this.enumSource[i].filter = this.jsoneditor.compileTemplate(this.enumSource[i].filter, this.template_engine);
+ }
+ }
+ }
+ // Other, not supported
+ else {
+ throw "'select' editor requires the enum property to be set.";
+ }
+ },
+ build: function() {
+ var self = this;
+ if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+ if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
+
+ if(this.options.compact) this.container.className += ' compact';
+
+ this.input = this.theme.getSelectInput(this.enum_options);
+ this.theme.setSelectOptions(this.input,this.enum_options,this.enum_display);
+
+ if(this.schema.readOnly || this.schema.readonly) {
+ this.always_disabled = true;
+ this.input.disabled = true;
+ }
+
+ this.input.addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.onInputChange();
+ });
+
+ this.control = this.theme.getFormControl(this.label, this.input, this.description);
+ this.container.appendChild(this.control);
+
+ this.value = this.enum_values[0];
+ },
+ onInputChange: function() {
+ var val = this.input.value;
+
+ var new_val;
+ // Invalid option, use first option instead
+ if(this.enum_options.indexOf(val) === -1) {
+ new_val = this.enum_values[0];
+ }
+ else {
+ new_val = this.enum_values[this.enum_options.indexOf(val)];
+ }
+
+ // If valid hasn't changed
+ if(new_val === this.value) return;
+
+ // Store new value and propogate change event
+ this.value = new_val;
+ this.onChange(true);
+ },
+ setupSelect2: function() {
+ // If the Select2 library is loaded use it when we have lots of items
+ if(window.jQuery && window.jQuery.fn && window.jQuery.fn.select2 && (this.enum_options.length > 2 || (this.enum_options.length && this.enumSource))) {
+ var options = $extend({},JSONEditor.plugins.select2);
+ if(this.schema.options && this.schema.options.select2_options) options = $extend(options,this.schema.options.select2_options);
+ this.select2 = window.jQuery(this.input).select2(options);
+ var self = this;
+ this.select2.on('select2-blur',function() {
+ self.input.value = self.select2.select2('val');
+ self.onInputChange();
+ });
+ this.select2.on('change',function() {
+ self.input.value = self.select2.select2('val');
+ self.onInputChange();
+ });
+ }
+ else {
+ this.select2 = null;
+ }
+ },
+ postBuild: function() {
+ this._super();
+ this.theme.afterInputReady(this.input);
+ this.setupSelect2();
+ },
+ onWatchedFieldChange: function() {
+ var self = this, vars, j;
+
+ // If this editor uses a dynamic select box
+ if(this.enumSource) {
+ vars = this.getWatchedFieldValues();
+ var select_options = [];
+ var select_titles = [];
+
+ for(var i=0; i<this.enumSource.length; i++) {
+ // Constant values
+ if(Array.isArray(this.enumSource[i])) {
+ select_options = select_options.concat(this.enumSource[i]);
+ select_titles = select_titles.concat(this.enumSource[i]);
+ }
+ else {
+ var items = [];
+ // Static list of items
+ if(Array.isArray(this.enumSource[i].source)) {
+ items = this.enumSource[i].source;
+ // A watched field
+ } else {
+ items = vars[this.enumSource[i].source];
+ }
+
+ if(items) {
+ // Only use a predefined part of the array
+ if(this.enumSource[i].slice) {
+ items = Array.prototype.slice.apply(items,this.enumSource[i].slice);
+ }
+ // Filter the items
+ if(this.enumSource[i].filter) {
+ var new_items = [];
+ for(j=0; j<items.length; j++) {
+ if(this.enumSource[i].filter({i:j,item:items[j],watched:vars})) new_items.push(items[j]);
+ }
+ items = new_items;
+ }
+
+ var item_titles = [];
+ var item_values = [];
+ for(j=0; j<items.length; j++) {
+ var item = items[j];
+
+ // Rendered value
+ if(this.enumSource[i].value) {
+ item_values[j] = this.enumSource[i].value({
+ i: j,
+ item: item
+ });
+ }
+ // Use value directly
+ else {
+ item_values[j] = items[j];
+ }
+
+ // Rendered title
+ if(this.enumSource[i].title) {
+ item_titles[j] = this.enumSource[i].title({
+ i: j,
+ item: item
+ });
+ }
+ // Use value as the title also
+ else {
+ item_titles[j] = item_values[j];
+ }
+ }
+
+ // TODO: sort
+
+ select_options = select_options.concat(item_values);
+ select_titles = select_titles.concat(item_titles);
+ }
+ }
+ }
+
+ var prev_value = this.value;
+
+ this.theme.setSelectOptions(this.input, select_options, select_titles);
+ this.enum_options = select_options;
+ this.enum_display = select_titles;
+ this.enum_values = select_options;
+
+ if(this.select2) {
+ this.select2.select2('destroy');
+ }
+
+ // If the previous value is still in the new select options, stick with it
+ if(select_options.indexOf(prev_value) !== -1) {
+ this.input.value = prev_value;
+ this.value = prev_value;
+ }
+ // Otherwise, set the value to the first select option
+ else {
+ this.input.value = select_options[0];
+ this.value = select_options[0] || "";
+ if(this.parent) this.parent.onChildEditorChange(this);
+ else this.jsoneditor.onChange();
+ this.jsoneditor.notifyWatchers(this.path);
+ }
+
+ this.setupSelect2();
+ }
+
+ this._super();
+ },
+ enable: function() {
+ if(!this.always_disabled) {
+ this.input.disabled = false;
+ if(this.select2) this.select2.select2("enable",true);
+ }
+ this._super();
+ },
+ disable: function() {
+ this.input.disabled = true;
+ if(this.select2) this.select2.select2("enable",false);
+ this._super();
+ },
+ destroy: function() {
+ if(this.label && this.label.parentNode) this.label.parentNode.removeChild(this.label);
+ if(this.description && this.description.parentNode) this.description.parentNode.removeChild(this.description);
+ if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input);
+ if(this.select2) {
+ this.select2.select2('destroy');
+ this.select2 = null;
+ }
+
+ this._super();
+ }
+});
+
+JSONEditor.defaults.editors.selectize = JSONEditor.AbstractEditor.extend({
+ setValue: function(value,initial) {
+ value = this.typecast(value||'');
+
+ // Sanitize value before setting it
+ var sanitized = value;
+ if(this.enum_values.indexOf(sanitized) < 0) {
+ sanitized = this.enum_values[0];
+ }
+
+ if(this.value === sanitized) {
+ return;
+ }
+
+ this.input.value = this.enum_options[this.enum_values.indexOf(sanitized)];
+
+ if(this.selectize) {
+ this.selectize[0].selectize.addItem(sanitized);
+ }
+
+ this.value = sanitized;
+ this.onChange();
+ },
+ register: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.setAttribute('name',this.formname);
+ },
+ unregister: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.removeAttribute('name');
+ },
+ getNumColumns: function() {
+ if(!this.enum_options) return 3;
+ var longest_text = this.getTitle().length;
+ for(var i=0; i<this.enum_options.length; i++) {
+ longest_text = Math.max(longest_text,this.enum_options[i].length+4);
+ }
+ return Math.min(12,Math.max(longest_text/7,2));
+ },
+ typecast: function(value) {
+ if(this.schema.type === "boolean") {
+ return !!value;
+ }
+ else if(this.schema.type === "number") {
+ return 1*value;
+ }
+ else if(this.schema.type === "integer") {
+ return Math.floor(value*1);
+ }
+ else {
+ return ""+value;
+ }
+ },
+ getValue: function() {
+ return this.value;
+ },
+ preBuild: function() {
+ var self = this;
+ this.input_type = 'select';
+ this.enum_options = [];
+ this.enum_values = [];
+ this.enum_display = [];
+
+ // Enum options enumerated
+ if(this.schema.enum) {
+ var display = this.schema.options && this.schema.options.enum_titles || [];
+
+ $each(this.schema.enum,function(i,option) {
+ self.enum_options[i] = ""+option;
+ self.enum_display[i] = ""+(display[i] || option);
+ self.enum_values[i] = self.typecast(option);
+ });
+ }
+ // Boolean
+ else if(this.schema.type === "boolean") {
+ self.enum_display = this.schema.options && this.schema.options.enum_titles || ['true','false'];
+ self.enum_options = ['1','0'];
+ self.enum_values = [true,false];
+ }
+ // Dynamic Enum
+ else if(this.schema.enumSource) {
+ this.enumSource = [];
+ this.enum_display = [];
+ this.enum_options = [];
+ this.enum_values = [];
+
+ // Shortcut declaration for using a single array
+ if(!(Array.isArray(this.schema.enumSource))) {
+ if(this.schema.enumValue) {
+ this.enumSource = [
+ {
+ source: this.schema.enumSource,
+ value: this.schema.enumValue
+ }
+ ];
+ }
+ else {
+ this.enumSource = [
+ {
+ source: this.schema.enumSource
+ }
+ ];
+ }
+ }
+ else {
+ for(i=0; i<this.schema.enumSource.length; i++) {
+ // Shorthand for watched variable
+ if(typeof this.schema.enumSource[i] === "string") {
+ this.enumSource[i] = {
+ source: this.schema.enumSource[i]
+ };
+ }
+ // Make a copy of the schema
+ else if(!(Array.isArray(this.schema.enumSource[i]))) {
+ this.enumSource[i] = $extend({},this.schema.enumSource[i]);
+ }
+ else {
+ this.enumSource[i] = this.schema.enumSource[i];
+ }
+ }
+ }
+
+ // Now, enumSource is an array of sources
+ // Walk through this array and fix up the values
+ for(i=0; i<this.enumSource.length; i++) {
+ if(this.enumSource[i].value) {
+ this.enumSource[i].value = this.jsoneditor.compileTemplate(this.enumSource[i].value, this.template_engine);
+ }
+ if(this.enumSource[i].title) {
+ this.enumSource[i].title = this.jsoneditor.compileTemplate(this.enumSource[i].title, this.template_engine);
+ }
+ if(this.enumSource[i].filter) {
+ this.enumSource[i].filter = this.jsoneditor.compileTemplate(this.enumSource[i].filter, this.template_engine);
+ }
+ }
+ }
+ // Other, not supported
+ else {
+ throw "'select' editor requires the enum property to be set.";
+ }
+ },
+ build: function() {
+ var self = this;
+ if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+ if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
+
+ if(this.options.compact) this.container.className += ' compact';
+
+ this.input = this.theme.getSelectInput(this.enum_options);
+ this.theme.setSelectOptions(this.input,this.enum_options,this.enum_display);
+
+ if(this.schema.readOnly || this.schema.readonly) {
+ this.always_disabled = true;
+ this.input.disabled = true;
+ }
+
+ this.input.addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.onInputChange();
+ });
+
+ this.control = this.theme.getFormControl(this.label, this.input, this.description);
+ this.container.appendChild(this.control);
+
+ this.value = this.enum_values[0];
+ },
+ onInputChange: function() {
+ var val = this.input.value;
+
+ var sanitized = val;
+ if(this.enum_options.indexOf(val) === -1) {
+ sanitized = this.enum_options[0];
+ }
+
+ this.value = this.enum_values[this.enum_options.indexOf(val)];
+ this.onChange(true);
+ },
+ setupSelectize: function() {
+ // If the Selectize library is loaded use it when we have lots of items
+ var self = this;
+ if(window.jQuery && window.jQuery.fn && window.jQuery.fn.selectize && (this.enum_options.length >= 2 || (this.enum_options.length && this.enumSource))) {
+ var options = $extend({},JSONEditor.plugins.selectize);
+ if(this.schema.options && this.schema.options.selectize_options) options = $extend(options,this.schema.options.selectize_options);
+ this.selectize = window.jQuery(this.input).selectize($extend(options,
+ {
+ create: true,
+ onChange : function() {
+ self.onInputChange();
+ }
+ }));
+ }
+ else {
+ this.selectize = null;
+ }
+ },
+ postBuild: function() {
+ this._super();
+ this.theme.afterInputReady(this.input);
+ this.setupSelectize();
+ },
+ onWatchedFieldChange: function() {
+ var self = this, vars, j;
+
+ // If this editor uses a dynamic select box
+ if(this.enumSource) {
+ vars = this.getWatchedFieldValues();
+ var select_options = [];
+ var select_titles = [];
+
+ for(var i=0; i<this.enumSource.length; i++) {
+ // Constant values
+ if(Array.isArray(this.enumSource[i])) {
+ select_options = select_options.concat(this.enumSource[i]);
+ select_titles = select_titles.concat(this.enumSource[i]);
+ }
+ // A watched field
+ else if(vars[this.enumSource[i].source]) {
+ var items = vars[this.enumSource[i].source];
+
+ // Only use a predefined part of the array
+ if(this.enumSource[i].slice) {
+ items = Array.prototype.slice.apply(items,this.enumSource[i].slice);
+ }
+ // Filter the items
+ if(this.enumSource[i].filter) {
+ var new_items = [];
+ for(j=0; j<items.length; j++) {
+ if(this.enumSource[i].filter({i:j,item:items[j]})) new_items.push(items[j]);
+ }
+ items = new_items;
+ }
+
+ var item_titles = [];
+ var item_values = [];
+ for(j=0; j<items.length; j++) {
+ var item = items[j];
+
+ // Rendered value
+ if(this.enumSource[i].value) {
+ item_values[j] = this.enumSource[i].value({
+ i: j,
+ item: item
+ });
+ }
+ // Use value directly
+ else {
+ item_values[j] = items[j];
+ }
+
+ // Rendered title
+ if(this.enumSource[i].title) {
+ item_titles[j] = this.enumSource[i].title({
+ i: j,
+ item: item
+ });
+ }
+ // Use value as the title also
+ else {
+ item_titles[j] = item_values[j];
+ }
+ }
+
+ // TODO: sort
+
+ select_options = select_options.concat(item_values);
+ select_titles = select_titles.concat(item_titles);
+ }
+ }
+
+ var prev_value = this.value;
+
+ this.theme.setSelectOptions(this.input, select_options, select_titles);
+ this.enum_options = select_options;
+ this.enum_display = select_titles;
+ this.enum_values = select_options;
+
+ // If the previous value is still in the new select options, stick with it
+ if(select_options.indexOf(prev_value) !== -1) {
+ this.input.value = prev_value;
+ this.value = prev_value;
+ }
+
+ // Otherwise, set the value to the first select option
+ else {
+ this.input.value = select_options[0];
+ this.value = select_options[0] || "";
+ if(this.parent) this.parent.onChildEditorChange(this);
+ else this.jsoneditor.onChange();
+ this.jsoneditor.notifyWatchers(this.path);
+ }
+
+ if(this.selectize) {
+ // Update the Selectize options
+ this.updateSelectizeOptions(select_options);
+ }
+ else {
+ this.setupSelectize();
+ }
+
+ this._super();
+ }
+ },
+ updateSelectizeOptions: function(select_options) {
+ var selectized = this.selectize[0].selectize,
+ self = this;
+
+ selectized.off();
+ selectized.clearOptions();
+ for(var n in select_options) {
+ selectized.addOption({value:select_options[n],text:select_options[n]});
+ }
+ selectized.addItem(this.value);
+ selectized.on('change',function() {
+ self.onInputChange();
+ });
+ },
+ enable: function() {
+ if(!this.always_disabled) {
+ this.input.disabled = false;
+ if(this.selectize) {
+ this.selectize[0].selectize.unlock();
+ }
+ }
+ this._super();
+ },
+ disable: function() {
+ this.input.disabled = true;
+ if(this.selectize) {
+ this.selectize[0].selectize.lock();
+ }
+ this._super();
+ },
+ destroy: function() {
+ if(this.label && this.label.parentNode) this.label.parentNode.removeChild(this.label);
+ if(this.description && this.description.parentNode) this.description.parentNode.removeChild(this.description);
+ if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input);
+ if(this.selectize) {
+ this.selectize[0].selectize.destroy();
+ this.selectize = null;
+ }
+ this._super();
+ }
+});
+
+JSONEditor.defaults.editors.multiselect = JSONEditor.AbstractEditor.extend({
+ preBuild: function() {
+ this._super();
+
+ this.select_options = {};
+ this.select_values = {};
+
+ var items_schema = this.jsoneditor.expandRefs(this.schema.items || {});
+
+ var e = items_schema["enum"] || [];
+ this.option_keys = [];
+ for(i=0; i<e.length; i++) {
+ // If the sanitized value is different from the enum value, don't include it
+ if(this.sanitize(e[i]) !== e[i]) continue;
+
+ this.option_keys.push(e[i]+"");
+ this.select_values[e[i]+""] = e[i];
+ }
+ },
+ build: function() {
+ var self = this, i;
+ if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+ if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
+
+ if((!this.schema.format && this.option_keys.length < 8) || this.schema.format === "checkbox") {
+ this.input_type = 'checkboxes';
+
+ this.inputs = {};
+ this.controls = {};
+ for(i=0; i<this.option_keys.length; i++) {
+ this.inputs[this.option_keys[i]] = this.theme.getCheckbox();
+ this.select_options[this.option_keys[i]] = this.inputs[this.option_keys[i]];
+ var label = this.theme.getCheckboxLabel(this.option_keys[i]);
+ this.controls[this.option_keys[i]] = this.theme.getFormControl(label, this.inputs[this.option_keys[i]]);
+ }
+
+ this.control = this.theme.getMultiCheckboxHolder(this.controls,this.label,this.description);
+ }
+ else {
+ this.input_type = 'select';
+ this.input = this.theme.getSelectInput(this.option_keys);
+ this.input.multiple = true;
+ this.input.size = Math.min(10,this.option_keys.length);
+
+ for(i=0; i<this.option_keys.length; i++) {
+ this.select_options[this.option_keys[i]] = this.input.children[i];
+ }
+
+ if(this.schema.readOnly || this.schema.readonly) {
+ this.always_disabled = true;
+ this.input.disabled = true;
+ }
+
+ this.control = this.theme.getFormControl(this.label, this.input, this.description);
+ }
+
+ this.container.appendChild(this.control);
+ this.control.addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ var new_value = [];
+ for(i = 0; i<self.option_keys.length; i++) {
+ if(self.select_options[self.option_keys[i]].selected || self.select_options[self.option_keys[i]].checked) new_value.push(self.select_values[self.option_keys[i]]);
+ }
+
+ self.updateValue(new_value);
+ self.onChange(true);
+ });
+ },
+ setValue: function(value, initial) {
+ var i;
+ value = value || [];
+ if(typeof value !== "object") value = [value];
+ else if(!(Array.isArray(value))) value = [];
+
+ // Make sure we are dealing with an array of strings so we can check for strict equality
+ for(i=0; i<value.length; i++) {
+ if(typeof value[i] !== "string") value[i] += "";
+ }
+
+ // Update selected status of options
+ for(i in this.select_options) {
+ if(!this.select_options.hasOwnProperty(i)) continue;
+
+ this.select_options[i][this.input_type === "select"? "selected" : "checked"] = (value.indexOf(i) !== -1);
+ }
+
+ this.updateValue(value);
+ this.onChange();
+ },
+ setupSelect2: function() {
+ if(window.jQuery && window.jQuery.fn && window.jQuery.fn.select2) {
+ var options = window.jQuery.extend({},JSONEditor.plugins.select2);
+ if(this.schema.options && this.schema.options.select2_options) options = $extend(options,this.schema.options.select2_options);
+ this.select2 = window.jQuery(this.input).select2(options);
+ var self = this;
+ this.select2.on('select2-blur',function() {
+ var val =self.select2.select2('val');
+ self.value = val;
+ self.onChange(true);
+ });
+ }
+ else {
+ this.select2 = null;
+ }
+ },
+ onInputChange: function() {
+ this.value = this.input.value;
+ this.onChange(true);
+ },
+ postBuild: function() {
+ this._super();
+ this.setupSelect2();
+ },
+ register: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.setAttribute('name',this.formname);
+ },
+ unregister: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.removeAttribute('name');
+ },
+ getNumColumns: function() {
+ var longest_text = this.getTitle().length;
+ for(var i in this.select_values) {
+ if(!this.select_values.hasOwnProperty(i)) continue;
+ longest_text = Math.max(longest_text,(this.select_values[i]+"").length+4);
+ }
+
+ return Math.min(12,Math.max(longest_text/7,2));
+ },
+ updateValue: function(value) {
+ var changed = false;
+ var new_value = [];
+ for(var i=0; i<value.length; i++) {
+ if(!this.select_options[value[i]+""]) {
+ changed = true;
+ continue;
+ }
+ var sanitized = this.sanitize(this.select_values[value[i]]);
+ new_value.push(sanitized);
+ if(sanitized !== value[i]) changed = true;
+ }
+ this.value = new_value;
+ if(this.select2) this.select2.select2('val',this.value);
+ return changed;
+ },
+ sanitize: function(value) {
+ if(this.schema.items.type === "number") {
+ return 1*value;
+ }
+ else if(this.schema.items.type === "integer") {
+ return Math.floor(value*1);
+ }
+ else {
+ return ""+value;
+ }
+ },
+ enable: function() {
+ if(!this.always_disabled) {
+ if(this.input) {
+ this.input.disabled = false;
+ }
+ else if(this.inputs) {
+ for(var i in this.inputs) {
+ if(!this.inputs.hasOwnProperty(i)) continue;
+ this.inputs[i].disabled = false;
+ }
+ }
+ if(this.select2) this.select2.select2("enable",true);
+ }
+ this._super();
+ },
+ disable: function() {
+ if(this.input) {
+ this.input.disabled = true;
+ }
+ else if(this.inputs) {
+ for(var i in this.inputs) {
+ if(!this.inputs.hasOwnProperty(i)) continue;
+ this.inputs[i].disabled = true;
+ }
+ }
+ if(this.select2) this.select2.select2("enable",false);
+ this._super();
+ },
+ destroy: function() {
+ if(this.select2) {
+ this.select2.select2('destroy');
+ this.select2 = null;
+ }
+ this._super();
+ }
+});
+
+JSONEditor.defaults.editors.base64 = JSONEditor.AbstractEditor.extend({
+ getNumColumns: function() {
+ return 4;
+ },
+ build: function() {
+ var self = this;
+ this.title = this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+
+ // Input that holds the base64 string
+ this.input = this.theme.getFormInputField('hidden');
+ this.container.appendChild(this.input);
+
+ // Don't show uploader if this is readonly
+ if(!this.schema.readOnly && !this.schema.readonly) {
+ if(!window.FileReader) throw "FileReader required for base64 editor";
+
+ // File uploader
+ this.uploader = this.theme.getFormInputField('file');
+
+ this.uploader.addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ if(this.files && this.files.length) {
+ var fr = new FileReader();
+ fr.onload = function(evt) {
+ self.value = evt.target.result;
+ self.refreshPreview();
+ self.onChange(true);
+ fr = null;
+ };
+ fr.readAsDataURL(this.files[0]);
+ }
+ });
+ }
+
+ this.preview = this.theme.getFormInputDescription(this.schema.description);
+ this.container.appendChild(this.preview);
+
+ this.control = this.theme.getFormControl(this.label, this.uploader||this.input, this.preview);
+ this.container.appendChild(this.control);
+ },
+ refreshPreview: function() {
+ if(this.last_preview === this.value) return;
+ this.last_preview = this.value;
+
+ this.preview.innerHTML = '';
+
+ if(!this.value) return;
+
+ var mime = this.value.match(/^data:([^;,]+)[;,]/);
+ if(mime) mime = mime[1];
+
+ if(!mime) {
+ this.preview.innerHTML = '<em>Invalid data URI</em>';
+ }
+ else {
+ this.preview.innerHTML = '<strong>Type:</strong> '+mime+', <strong>Size:</strong> '+Math.floor((this.value.length-this.value.split(',')[0].length-1)/1.33333)+' bytes';
+ if(mime.substr(0,5)==="image") {
+ this.preview.innerHTML += '<br>';
+ var img = document.createElement('img');
+ img.style.maxWidth = '100%';
+ img.style.maxHeight = '100px';
+ img.src = this.value;
+ this.preview.appendChild(img);
+ }
+ }
+ },
+ enable: function() {
+ if(this.uploader) this.uploader.disabled = false;
+ this._super();
+ },
+ disable: function() {
+ if(this.uploader) this.uploader.disabled = true;
+ this._super();
+ },
+ setValue: function(val) {
+ if(this.value !== val) {
+ this.value = val;
+ this.input.value = this.value;
+ this.refreshPreview();
+ this.onChange();
+ }
+ },
+ destroy: function() {
+ if(this.preview && this.preview.parentNode) this.preview.parentNode.removeChild(this.preview);
+ if(this.title && this.title.parentNode) this.title.parentNode.removeChild(this.title);
+ if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input);
+ if(this.uploader && this.uploader.parentNode) this.uploader.parentNode.removeChild(this.uploader);
+
+ this._super();
+ }
+});
+
+JSONEditor.defaults.editors.upload = JSONEditor.AbstractEditor.extend({
+ getNumColumns: function() {
+ return 4;
+ },
+ build: function() {
+ var self = this;
+ this.title = this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
+
+ // Input that holds the base64 string
+ this.input = this.theme.getFormInputField('hidden');
+ this.container.appendChild(this.input);
+
+ // Don't show uploader if this is readonly
+ if(!this.schema.readOnly && !this.schema.readonly) {
+
+ if(!this.jsoneditor.options.upload) throw "Upload handler required for upload editor";
+
+ // File uploader
+ this.uploader = this.theme.getFormInputField('file');
+
+ this.uploader.addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ if(this.files && this.files.length) {
+ var fr = new FileReader();
+ fr.onload = function(evt) {
+ self.preview_value = evt.target.result;
+ self.refreshPreview();
+ self.onChange(true);
+ fr = null;
+ };
+ fr.readAsDataURL(this.files[0]);
+ }
+ });
+ }
+
+ var description = this.schema.description;
+ if (!description) description = '';
+
+ this.preview = this.theme.getFormInputDescription(description);
+ this.container.appendChild(this.preview);
+
+ this.control = this.theme.getFormControl(this.label, this.uploader||this.input, this.preview);
+ this.container.appendChild(this.control);
+ },
+ refreshPreview: function() {
+ if(this.last_preview === this.preview_value) return;
+ this.last_preview = this.preview_value;
+
+ this.preview.innerHTML = '';
+
+ if(!this.preview_value) return;
+
+ var self = this;
+
+ var mime = this.preview_value.match(/^data:([^;,]+)[;,]/);
+ if(mime) mime = mime[1];
+ if(!mime) mime = 'unknown';
+
+ var file = this.uploader.files[0];
+
+ this.preview.innerHTML = '<strong>Type:</strong> '+mime+', <strong>Size:</strong> '+file.size+' bytes';
+ if(mime.substr(0,5)==="image") {
+ this.preview.innerHTML += '<br>';
+ var img = document.createElement('img');
+ img.style.maxWidth = '100%';
+ img.style.maxHeight = '100px';
+ img.src = this.preview_value;
+ this.preview.appendChild(img);
+ }
+
+ this.preview.innerHTML += '<br>';
+ var uploadButton = this.getButton('Upload', 'upload', 'Upload');
+ this.preview.appendChild(uploadButton);
+ uploadButton.addEventListener('click',function(event) {
+ event.preventDefault();
+
+ uploadButton.setAttribute("disabled", "disabled");
+ self.theme.removeInputError(self.uploader);
+
+ if (self.theme.getProgressBar) {
+ self.progressBar = self.theme.getProgressBar();
+ self.preview.appendChild(self.progressBar);
+ }
+
+ self.jsoneditor.options.upload(self.path, file, {
+ success: function(url) {
+ self.setValue(url);
+
+ if(self.parent) self.parent.onChildEditorChange(self);
+ else self.jsoneditor.onChange();
+
+ if (self.progressBar) self.preview.removeChild(self.progressBar);
+ uploadButton.removeAttribute("disabled");
+ },
+ failure: function(error) {
+ self.theme.addInputError(self.uploader, error);
+ if (self.progressBar) self.preview.removeChild(self.progressBar);
+ uploadButton.removeAttribute("disabled");
+ },
+ updateProgress: function(progress) {
+ if (self.progressBar) {
+ if (progress) self.theme.updateProgressBar(self.progressBar, progress);
+ else self.theme.updateProgressBarUnknown(self.progressBar);
+ }
+ }
+ });
+ });
+ },
+ enable: function() {
+ if(this.uploader) this.uploader.disabled = false;
+ this._super();
+ },
+ disable: function() {
+ if(this.uploader) this.uploader.disabled = true;
+ this._super();
+ },
+ setValue: function(val) {
+ if(this.value !== val) {
+ this.value = val;
+ this.input.value = this.value;
+ this.onChange();
+ }
+ },
+ destroy: function() {
+ if(this.preview && this.preview.parentNode) this.preview.parentNode.removeChild(this.preview);
+ if(this.title && this.title.parentNode) this.title.parentNode.removeChild(this.title);
+ if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input);
+ if(this.uploader && this.uploader.parentNode) this.uploader.parentNode.removeChild(this.uploader);
+
+ this._super();
+ }
+});
+
+JSONEditor.defaults.editors.checkbox = JSONEditor.AbstractEditor.extend({
+ setValue: function(value,initial) {
+ this.value = !!value;
+ this.input.checked = this.value;
+ this.onChange();
+ },
+ register: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.setAttribute('name',this.formname);
+ },
+ unregister: function() {
+ this._super();
+ if(!this.input) return;
+ this.input.removeAttribute('name');
+ },
+ getNumColumns: function() {
+ return Math.min(12,Math.max(this.getTitle().length/7,2));
+ },
+ build: function() {
+ var self = this;
+ if(!this.options.compact) {
+ this.label = this.header = this.theme.getCheckboxLabel(this.getTitle());
+ }
+ if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
+ if(this.options.compact) this.container.className += ' compact';
+
+ this.input = this.theme.getCheckbox();
+ this.control = this.theme.getFormControl(this.label, this.input, this.description);
+
+ if(this.schema.readOnly || this.schema.readonly) {
+ this.always_disabled = true;
+ this.input.disabled = true;
+ }
+
+ this.input.addEventListener('change',function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ self.value = this.checked;
+ self.onChange(true);
+ });
+
+ this.container.appendChild(this.control);
+ },
+ enable: function() {
+ if(!this.always_disabled) {
+ this.input.disabled = false;
+ }
+ this._super();
+ },
+ disable: function() {
+ this.input.disabled = true;
+ this._super();
+ },
+ destroy: function() {
+ if(this.label && this.label.parentNode) this.label.parentNode.removeChild(this.label);
+ if(this.description && this.description.parentNode) this.description.parentNode.removeChild(this.description);
+ if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input);
+ this._super();
+ }
+});
+
+JSONEditor.defaults.editors.arraySelectize = JSONEditor.AbstractEditor.extend({
+ build: function() {
+ this.title = this.theme.getFormInputLabel(this.getTitle());
+
+ this.title_controls = this.theme.getHeaderButtonHolder();
+ this.title.appendChild(this.title_controls);
+ this.error_holder = document.createElement('div');
+
+ if(this.schema.description) {
+ this.description = this.theme.getDescription(this.schema.description);
+ }
+
+ this.input = document.createElement('select');
+ this.input.setAttribute('multiple', 'multiple');
+
+ var group = this.theme.getFormControl(this.title, this.input, this.description);
+
+ this.container.appendChild(group);
+ this.container.appendChild(this.error_holder);
+
+ window.jQuery(this.input).selectize({
+ delimiter: false,
+ createOnBlur: true,
+ create: true
+ });
+ },
+ postBuild: function() {
+ var self = this;
+ this.input.selectize.on('change', function(event) {
+ self.refreshValue();
+ self.onChange(true);
+ });
+ },
+ destroy: function() {
+ this.empty(true);
+ if(this.title && this.title.parentNode) this.title.parentNode.removeChild(this.title);
+ if(this.description && this.description.parentNode) this.description.parentNode.removeChild(this.description);
+ if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input);
+
+ this._super();
+ },
+ empty: function(hard) {},
+ setValue: function(value, initial) {
+ var self = this;
+ // Update the array's value, adding/removing rows when necessary
+ value = value || [];
+ if(!(Array.isArray(value))) value = [value];
+
+ this.input.selectize.clearOptions();
+ this.input.selectize.clear(true);
+
+ value.forEach(function(item) {
+ self.input.selectize.addOption({text: item, value: item});
+ });
+ this.input.selectize.setValue(value);
+
+ this.refreshValue(initial);
+ },
+ refreshValue: function(force) {
+ this.value = this.input.selectize.getValue();
+ },
+ showValidationErrors: function(errors) {
+ var self = this;
+
+ // Get all the errors that pertain to this editor
+ var my_errors = [];
+ var other_errors = [];
+ $each(errors, function(i,error) {
+ if(error.path === self.path) {
+ my_errors.push(error);
+ }
+ else {
+ other_errors.push(error);
+ }
+ });
+
+ // Show errors for this editor
+ if(this.error_holder) {
+
+ if(my_errors.length) {
+ var message = [];
+ this.error_holder.innerHTML = '';
+ this.error_holder.style.display = '';
+ $each(my_errors, function(i,error) {
+ self.error_holder.appendChild(self.theme.getErrorMessage(error.message));
+ });
+ }
+ // Hide error area
+ else {
+ this.error_holder.style.display = 'none';
+ }
+ }
+ }
+});
+
+var matchKey = (function () {
+ var elem = document.documentElement;
+
+ if (elem.matches) return 'matches';
+ else if (elem.webkitMatchesSelector) return 'webkitMatchesSelector';
+ else if (elem.mozMatchesSelector) return 'mozMatchesSelector';
+ else if (elem.msMatchesSelector) return 'msMatchesSelector';
+ else if (elem.oMatchesSelector) return 'oMatchesSelector';
+})();
+
+JSONEditor.AbstractTheme = Class.extend({
+ getContainer: function() {
+ return document.createElement('div');
+ },
+ getFloatRightLinkHolder: function() {
+ var el = document.createElement('div');
+ el.style = el.style || {};
+ el.style.cssFloat = 'right';
+ el.style.marginLeft = '10px';
+ return el;
+ },
+ getModal: function() {
+ var el = document.createElement('div');
+ el.style.backgroundColor = 'white';
+ el.style.border = '1px solid black';
+ el.style.boxShadow = '3px 3px black';
+ el.style.position = 'absolute';
+ el.style.zIndex = '10';
+ el.style.display = 'none';
+ return el;
+ },
+ getGridContainer: function() {
+ var el = document.createElement('div');
+ return el;
+ },
+ getGridRow: function() {
+ var el = document.createElement('div');
+ el.className = 'row';
+ return el;
+ },
+ getGridColumn: function() {
+ var el = document.createElement('div');
+ return el;
+ },
+ setGridColumnSize: function(el,size) {
+
+ },
+ getLink: function(text) {
+ var el = document.createElement('a');
+ el.setAttribute('href','#');
+ el.appendChild(document.createTextNode(text));
+ return el;
+ },
+ disableHeader: function(header) {
+ header.style.color = '#ccc';
+ },
+ disableLabel: function(label) {
+ label.style.color = '#ccc';
+ },
+ enableHeader: function(header) {
+ header.style.color = '';
+ },
+ enableLabel: function(label) {
+ label.style.color = '';
+ },
+ getFormInputLabel: function(text) {
+ var el = document.createElement('label');
+ el.appendChild(document.createTextNode(text));
+ return el;
+ },
+ getCheckboxLabel: function(text) {
+ var el = this.getFormInputLabel(text);
+ el.style.fontWeight = 'normal';
+ return el;
+ },
+ getHeader: function(text) {
+ var el = document.createElement('h3');
+ if(typeof text === "string") {
+ el.textContent = text;
+ }
+ else {
+ el.appendChild(text);
+ }
+
+ return el;
+ },
+ getCheckbox: function() {
+ var el = this.getFormInputField('checkbox');
+ el.style.display = 'inline-block';
+ el.style.width = 'auto';
+ return el;
+ },
+ getMultiCheckboxHolder: function(controls,label,description) {
+ var el = document.createElement('div');
+
+ if(label) {
+ label.style.display = 'block';
+ el.appendChild(label);
+ }
+
+ for(var i in controls) {
+ if(!controls.hasOwnProperty(i)) continue;
+ controls[i].style.display = 'inline-block';
+ controls[i].style.marginRight = '20px';
+ el.appendChild(controls[i]);
+ }
+
+ if(description) el.appendChild(description);
+
+ return el;
+ },
+ getSelectInput: function(options) {
+ var select = document.createElement('select');
+ if(options) this.setSelectOptions(select, options);
+ return select;
+ },
+ getSwitcher: function(options) {
+ var switcher = this.getSelectInput(options);
+ switcher.style.backgroundColor = 'transparent';
+ switcher.style.display = 'inline-block';
+ switcher.style.fontStyle = 'italic';
+ switcher.style.fontWeight = 'normal';
+ switcher.style.height = 'auto';
+ switcher.style.marginBottom = 0;
+ switcher.style.marginLeft = '5px';
+ switcher.style.padding = '0 0 0 3px';
+ switcher.style.width = 'auto';
+ return switcher;
+ },
+ getSwitcherOptions: function(switcher) {
+ return switcher.getElementsByTagName('option');
+ },
+ setSwitcherOptions: function(switcher, options, titles) {
+ this.setSelectOptions(switcher, options, titles);
+ },
+ setSelectOptions: function(select, options, titles) {
+ titles = titles || [];
+ select.innerHTML = '';
+ for(var i=0; i<options.length; i++) {
+ var option = document.createElement('option');
+ option.setAttribute('value',options[i]);
+ option.textContent = titles[i] || options[i];
+ select.appendChild(option);
+ }
+ },
+ getTextareaInput: function() {
+ var el = document.createElement('textarea');
+ el.style = el.style || {};
+ el.style.width = '100%';
+ el.style.height = '300px';
+ el.style.boxSizing = 'border-box';
+ return el;
+ },
+ getRangeInput: function(min,max,step) {
+ var el = this.getFormInputField('range');
+ el.setAttribute('min',min);
+ el.setAttribute('max',max);
+ el.setAttribute('step',step);
+ return el;
+ },
+ getFormInputField: function(type) {
+ var el = document.createElement('input');
+ el.setAttribute('type',type);
+ return el;
+ },
+ afterInputReady: function(input) {
+
+ },
+ getFormControl: function(label, input, description) {
+ var el = document.createElement('div');
+ el.className = 'form-control';
+ if(label) el.appendChild(label);
+ if(input.type === 'checkbox') {
+ label.insertBefore(input,label.firstChild);
+ }
+ else {
+ el.appendChild(input);
+ }
+
+ if(description) el.appendChild(description);
+ return el;
+ },
+ getIndentedPanel: function() {
+ var el = document.createElement('div');
+ el.style = el.style || {};
+ el.style.paddingLeft = '10px';
+ el.style.marginLeft = '10px';
+ el.style.borderLeft = '1px solid #ccc';
+ return el;
+ },
+ getChildEditorHolder: function() {
+ return document.createElement('div');
+ },
+ getDescription: function(text) {
+ var el = document.createElement('p');
+ el.innerHTML = text;
+ return el;
+ },
+ getCheckboxDescription: function(text) {
+ return this.getDescription(text);
+ },
+ getFormInputDescription: function(text) {
+ return this.getDescription(text);
+ },
+ getHeaderButtonHolder: function() {
+ return this.getButtonHolder();
+ },
+ getButtonHolder: function() {
+ return document.createElement('div');
+ },
+ getButton: function(text, icon, title) {
+ var el = document.createElement('button');
+ el.type = 'button';
+ this.setButtonText(el,text,icon,title);
+ return el;
+ },
+ setButtonText: function(button, text, icon, title) {
+ button.innerHTML = '';
+ if(icon) {
+ button.appendChild(icon);
+ button.innerHTML += ' ';
+ }
+ button.appendChild(document.createTextNode(text));
+ if(title) button.setAttribute('title',title);
+ },
+ getTable: function() {
+ return document.createElement('table');
+ },
+ getTableRow: function() {
+ return document.createElement('tr');
+ },
+ getTableHead: function() {
+ return document.createElement('thead');
+ },
+ getTableBody: function() {
+ return document.createElement('tbody');
+ },
+ getTableHeaderCell: function(text) {
+ var el = document.createElement('th');
+ el.textContent = text;
+ return el;
+ },
+ getTableCell: function() {
+ var el = document.createElement('td');
+ return el;
+ },
+ getErrorMessage: function(text) {
+ var el = document.createElement('p');
+ el.style = el.style || {};
+ el.style.color = 'red';
+ el.appendChild(document.createTextNode(text));
+ return el;
+ },
+ addInputError: function(input, text) {
+ },
+ removeInputError: function(input) {
+ },
+ addTableRowError: function(row) {
+ },
+ removeTableRowError: function(row) {
+ },
+ getTabHolder: function() {
+ var el = document.createElement('div');
+ el.innerHTML = "<div style='float: left; width: 130px;' class='tabs'></div><div class='content' style='margin-left: 130px;'></div><div style='clear:both;'></div>";
+ return el;
+ },
+ applyStyles: function(el,styles) {
+ el.style = el.style || {};
+ for(var i in styles) {
+ if(!styles.hasOwnProperty(i)) continue;
+ el.style[i] = styles[i];
+ }
+ },
+ closest: function(elem, selector) {
+ while (elem && elem !== document) {
+ if (matchKey) {
+ if (elem[matchKey](selector)) {
+ return elem;
+ } else {
+ elem = elem.parentNode;
+ }
+ }
+ else {
+ return false;
+ }
+ }
+ return false;
+ },
+ getTab: function(span) {
+ var el = document.createElement('div');
+ el.appendChild(span);
+ el.style = el.style || {};
+ this.applyStyles(el,{
+ border: '1px solid #ccc',
+ borderWidth: '1px 0 1px 1px',
+ textAlign: 'center',
+ lineHeight: '30px',
+ borderRadius: '5px',
+ borderBottomRightRadius: 0,
+ borderTopRightRadius: 0,
+ fontWeight: 'bold',
+ cursor: 'pointer'
+ });
+ return el;
+ },
+ getTabContentHolder: function(tab_holder) {
+ return tab_holder.children[1];
+ },
+ getTabContent: function() {
+ return this.getIndentedPanel();
+ },
+ markTabActive: function(tab) {
+ this.applyStyles(tab,{
+ opacity: 1,
+ background: 'white'
+ });
+ },
+ markTabInactive: function(tab) {
+ this.applyStyles(tab,{
+ opacity:0.5,
+ background: ''
+ });
+ },
+ addTab: function(holder, tab) {
+ holder.children[0].appendChild(tab);
+ },
+ getBlockLink: function() {
+ var link = document.createElement('a');
+ link.style.display = 'block';
+ return link;
+ },
+ getBlockLinkHolder: function() {
+ var el = document.createElement('div');
+ return el;
+ },
+ getLinksHolder: function() {
+ var el = document.createElement('div');
+ return el;
+ },
+ createMediaLink: function(holder,link,media) {
+ holder.appendChild(link);
+ media.style.width='100%';
+ holder.appendChild(media);
+ },
+ createImageLink: function(holder,link,image) {
+ holder.appendChild(link);
+ link.appendChild(image);
+ }
+});
+
+JSONEditor.defaults.themes.bootstrap2 = JSONEditor.AbstractTheme.extend({
+ getRangeInput: function(min, max, step) {
+ // TODO: use bootstrap slider
+ return this._super(min, max, step);
+ },
+ getGridContainer: function() {
+ var el = document.createElement('div');
+ el.className = 'container-fluid';
+ return el;
+ },
+ getGridRow: function() {
+ var el = document.createElement('div');
+ el.className = 'row-fluid';
+ return el;
+ },
+ getFormInputLabel: function(text) {
+ var el = this._super(text);
+ el.style.display = 'inline-block';
+ el.style.fontWeight = 'bold';
+ return el;
+ },
+ setGridColumnSize: function(el,size) {
+ el.className = 'span'+size;
+ },
+ getSelectInput: function(options) {
+ var input = this._super(options);
+ input.style.width = 'auto';
+ input.style.maxWidth = '98%';
+ return input;
+ },
+ getFormInputField: function(type) {
+ var el = this._super(type);
+ el.style.width = '98%';
+ return el;
+ },
+ afterInputReady: function(input) {
+ if(input.controlgroup) return;
+ input.controlgroup = this.closest(input,'.control-group');
+ input.controls = this.closest(input,'.controls');
+ if(this.closest(input,'.compact')) {
+ input.controlgroup.className = input.controlgroup.className.replace(/control-group/g,'').replace(/[ ]{2,}/g,' ');
+ input.controls.className = input.controlgroup.className.replace(/controls/g,'').replace(/[ ]{2,}/g,' ');
+ input.style.marginBottom = 0;
+ }
+
+ // TODO: use bootstrap slider
+ },
+ getIndentedPanel: function() {
+ var el = document.createElement('div');
+ el.className = 'well well-small';
+ el.style.paddingBottom = 0;
+ return el;
+ },
+ getFormInputDescription: function(text) {
+ var el = document.createElement('p');
+ el.className = 'help-inline';
+ el.textContent = text;
+ return el;
+ },
+ getFormControl: function(label, input, description) {
+ var ret = document.createElement('div');
+ ret.className = 'control-group';
+
+ var controls = document.createElement('div');
+ controls.className = 'controls';
+
+ if(label && input.getAttribute('type') === 'checkbox') {
+ ret.appendChild(controls);
+ label.className += ' checkbox';
+ label.appendChild(input);
+ controls.appendChild(label);
+ controls.style.height = '30px';
+ }
+ else {
+ if(label) {
+ label.className += ' control-label';
+ ret.appendChild(label);
+ }
+ controls.appendChild(input);
+ ret.appendChild(controls);
+ }
+
+ if(description) controls.appendChild(description);
+
+ return ret;
+ },
+ getHeaderButtonHolder: function() {
+ var el = this.getButtonHolder();
+ el.style.marginLeft = '10px';
+ return el;
+ },
+ getButtonHolder: function() {
+ var el = document.createElement('div');
+ el.className = 'btn-group';
+ return el;
+ },
+ getButton: function(text, icon, title) {
+ var el = this._super(text, icon, title);
+ el.className += ' btn btn-default';
+ return el;
+ },
+ getTable: function() {
+ var el = document.createElement('table');
+ el.className = 'table table-bordered';
+ el.style.width = 'auto';
+ el.style.maxWidth = 'none';
+ return el;
+ },
+ addInputError: function(input,text) {
+ if(!input.controlgroup || !input.controls) return;
+ input.controlgroup.className += ' error';
+ if(!input.errmsg) {
+ input.errmsg = document.createElement('p');
+ input.errmsg.className = 'help-block errormsg';
+ input.controls.appendChild(input.errmsg);
+ }
+ else {
+ input.errmsg.style.display = '';
+ }
+
+ input.errmsg.textContent = text;
+ },
+ removeInputError: function(input) {
+ if(!input.errmsg) return;
+ input.errmsg.style.display = 'none';
+ input.controlgroup.className = input.controlgroup.className.replace(/\s?error/g,'');
+ },
+ getTabHolder: function() {
+ var el = document.createElement('div');
+ el.className = 'tabbable tabs-left';
+ el.innerHTML = "<ul class='nav nav-tabs span2' style='margin-right: 0;'></ul><div class='tab-content span10' style='overflow:visible;'></div>";
+ return el;
+ },
+ getTab: function(text) {
+ var el = document.createElement('li');
+ var a = document.createElement('a');
+ a.setAttribute('href','#');
+ a.appendChild(text);
+ el.appendChild(a);
+ return el;
+ },
+ getTabContentHolder: function(tab_holder) {
+ return tab_holder.children[1];
+ },
+ getTabContent: function() {
+ var el = document.createElement('div');
+ el.className = 'tab-pane active';
+ return el;
+ },
+ markTabActive: function(tab) {
+ tab.className += ' active';
+ },
+ markTabInactive: function(tab) {
+ tab.className = tab.className.replace(/\s?active/g,'');
+ },
+ addTab: function(holder, tab) {
+ holder.children[0].appendChild(tab);
+ },
+ getProgressBar: function() {
+ var container = document.createElement('div');
+ container.className = 'progress';
+
+ var bar = document.createElement('div');
+ bar.className = 'bar';
+ bar.style.width = '0%';
+ container.appendChild(bar);
+
+ return container;
+ },
+ updateProgressBar: function(progressBar, progress) {
+ if (!progressBar) return;
+
+ progressBar.firstChild.style.width = progress + "%";
+ },
+ updateProgressBarUnknown: function(progressBar) {
+ if (!progressBar) return;
+
+ progressBar.className = 'progress progress-striped active';
+ progressBar.firstChild.style.width = '100%';
+ }
+});
+
+JSONEditor.defaults.themes.bootstrap3 = JSONEditor.AbstractTheme.extend({
+ getSelectInput: function(options) {
+ var el = this._super(options);
+ el.className += 'form-control';
+ //el.style.width = 'auto';
+ return el;
+ },
+ setGridColumnSize: function(el,size) {
+ el.className = 'col-md-'+size;
+ },
+ afterInputReady: function(input) {
+ if(input.controlgroup) return;
+ input.controlgroup = this.closest(input,'.form-group');
+ if(this.closest(input,'.compact')) {
+ input.controlgroup.style.marginBottom = 0;
+ }
+
+ // TODO: use bootstrap slider
+ },
+ getTextareaInput: function() {
+ var el = document.createElement('textarea');
+ el.className = 'form-control';
+ return el;
+ },
+ getRangeInput: function(min, max, step) {
+ // TODO: use better slider
+ return this._super(min, max, step);
+ },
+ getFormInputField: function(type) {
+ var el = this._super(type);
+ if(type !== 'checkbox') {
+ el.className += 'form-control';
+ }
+ return el;
+ },
+ getFormControl: function(label, input, description) {
+ var group = document.createElement('div');
+
+ if(label && input.type === 'checkbox') {
+ group.className += ' checkbox';
+ label.appendChild(input);
+ label.style.fontSize = '14px';
+ group.style.marginTop = '0';
+ group.appendChild(label);
+ input.style.position = 'relative';
+ input.style.cssFloat = 'left';
+ }
+ else {
+ group.className += ' form-group';
+ if(label) {
+ label.className += ' control-label';
+ group.appendChild(label);
+ }
+ group.appendChild(input);
+ }
+
+ if(description) group.appendChild(description);
+
+ return group;
+ },
+ getIndentedPanel: function() {
+ var el = document.createElement('div');
+ el.className = 'well well-sm';
+ el.style.paddingBottom = 0;
+ return el;
+ },
+ getFormInputDescription: function(text) {
+ var el = document.createElement('p');
+ el.className = 'help-block';
+ el.innerHTML = text;
+ return el;
+ },
+ getHeaderButtonHolder: function() {
+ var el = this.getButtonHolder();
+ el.style.marginLeft = '10px';
+ return el;
+ },
+ getButtonHolder: function() {
+ var el = document.createElement('div');
+ el.className = 'btn-group';
+ return el;
+ },
+ getButton: function(text, icon, title) {
+ var el = this._super(text, icon, title);
+ el.className += 'btn btn-default';
+ return el;
+ },
+ getTable: function() {
+ var el = document.createElement('table');
+ el.className = 'table table-bordered';
+ el.style.width = 'auto';
+ el.style.maxWidth = 'none';
+ return el;
+ },
+
+ addInputError: function(input,text) {
+ if(!input.controlgroup) return;
+ input.controlgroup.className += ' has-error';
+ if(!input.errmsg) {
+ input.errmsg = document.createElement('p');
+ input.errmsg.className = 'help-block errormsg';
+ input.controlgroup.appendChild(input.errmsg);
+ }
+ else {
+ input.errmsg.style.display = '';
+ }
+
+ input.errmsg.textContent = text;
+ },
+ removeInputError: function(input) {
+ if(!input.errmsg) return;
+ input.errmsg.style.display = 'none';
+ input.controlgroup.className = input.controlgroup.className.replace(/\s?has-error/g,'');
+ },
+ getTabHolder: function() {
+ var el = document.createElement('div');
+ el.innerHTML = "<div class='tabs list-group col-md-2'></div><div class='col-md-10'></div>";
+ el.className = 'rows';
+ return el;
+ },
+ getTab: function(text) {
+ var el = document.createElement('a');
+ el.className = 'list-group-item';
+ el.setAttribute('href','#');
+ el.appendChild(text);
+ return el;
+ },
+ markTabActive: function(tab) {
+ tab.className += ' active';
+ },
+ markTabInactive: function(tab) {
+ tab.className = tab.className.replace(/\s?active/g,'');
+ },
+ getProgressBar: function() {
+ var min = 0, max = 100, start = 0;
+
+ var container = document.createElement('div');
+ container.className = 'progress';
+
+ var bar = document.createElement('div');
+ bar.className = 'progress-bar';
+ bar.setAttribute('role', 'progressbar');
+ bar.setAttribute('aria-valuenow', start);
+ bar.setAttribute('aria-valuemin', min);
+ bar.setAttribute('aria-valuenax', max);
+ bar.innerHTML = start + "%";
+ container.appendChild(bar);
+
+ return container;
+ },
+ updateProgressBar: function(progressBar, progress) {
+ if (!progressBar) return;
+
+ var bar = progressBar.firstChild;
+ var percentage = progress + "%";
+ bar.setAttribute('aria-valuenow', progress);
+ bar.style.width = percentage;
+ bar.innerHTML = percentage;
+ },
+ updateProgressBarUnknown: function(progressBar) {
+ if (!progressBar) return;
+
+ var bar = progressBar.firstChild;
+ progressBar.className = 'progress progress-striped active';
+ bar.removeAttribute('aria-valuenow');
+ bar.style.width = '100%';
+ bar.innerHTML = '';
+ }
+});
+
+// Base Foundation theme
+JSONEditor.defaults.themes.foundation = JSONEditor.AbstractTheme.extend({
+ getChildEditorHolder: function() {
+ var el = document.createElement('div');
+ el.style.marginBottom = '15px';
+ return el;
+ },
+ getSelectInput: function(options) {
+ var el = this._super(options);
+ el.style.minWidth = 'none';
+ el.style.padding = '5px';
+ el.style.marginTop = '3px';
+ return el;
+ },
+ getSwitcher: function(options) {
+ var el = this._super(options);
+ el.style.paddingRight = '8px';
+ return el;
+ },
+ afterInputReady: function(input) {
+ if(this.closest(input,'.compact')) {
+ input.style.marginBottom = 0;
+ }
+ input.group = this.closest(input,'.form-control');
+ },
+ getFormInputLabel: function(text) {
+ var el = this._super(text);
+ el.style.display = 'inline-block';
+ return el;
+ },
+ getFormInputField: function(type) {
+ var el = this._super(type);
+ el.style.width = '100%';
+ el.style.marginBottom = type==='checkbox'? '0' : '12px';
+ return el;
+ },
+ getFormInputDescription: function(text) {
+ var el = document.createElement('p');
+ el.textContent = text;
+ el.style.marginTop = '-10px';
+ el.style.fontStyle = 'italic';
+ return el;
+ },
+ getIndentedPanel: function() {
+ var el = document.createElement('div');
+ el.className = 'panel';
+ el.style.paddingBottom = 0;
+ return el;
+ },
+ getHeaderButtonHolder: function() {
+ var el = this.getButtonHolder();
+ el.style.display = 'inline-block';
+ el.style.marginLeft = '10px';
+ el.style.verticalAlign = 'middle';
+ return el;
+ },
+ getButtonHolder: function() {
+ var el = document.createElement('div');
+ el.className = 'button-group';
+ return el;
+ },
+ getButton: function(text, icon, title) {
+ var el = this._super(text, icon, title);
+ el.className += ' small button';
+ return el;
+ },
+ addInputError: function(input,text) {
+ if(!input.group) return;
+ input.group.className += ' error';
+
+ if(!input.errmsg) {
+ input.insertAdjacentHTML('afterend','<small class="error"></small>');
+ input.errmsg = input.parentNode.getElementsByClassName('error')[0];
+ }
+ else {
+ input.errmsg.style.display = '';
+ }
+
+ input.errmsg.textContent = text;
+ },
+ removeInputError: function(input) {
+ if(!input.errmsg) return;
+ input.group.className = input.group.className.replace(/ error/g,'');
+ input.errmsg.style.display = 'none';
+ },
+ getProgressBar: function() {
+ var progressBar = document.createElement('div');
+ progressBar.className = 'progress';
+
+ var meter = document.createElement('span');
+ meter.className = 'meter';
+ meter.style.width = '0%';
+ progressBar.appendChild(meter);
+ return progressBar;
+ },
+ updateProgressBar: function(progressBar, progress) {
+ if (!progressBar) return;
+ progressBar.firstChild.style.width = progress + '%';
+ },
+ updateProgressBarUnknown: function(progressBar) {
+ if (!progressBar) return;
+ progressBar.firstChild.style.width = '100%';
+ }
+});
+
+// Foundation 3 Specific Theme
+JSONEditor.defaults.themes.foundation3 = JSONEditor.defaults.themes.foundation.extend({
+ getHeaderButtonHolder: function() {
+ var el = this._super();
+ el.style.fontSize = '.6em';
+ return el;
+ },
+ getFormInputLabel: function(text) {
+ var el = this._super(text);
+ el.style.fontWeight = 'bold';
+ return el;
+ },
+ getTabHolder: function() {
+ var el = document.createElement('div');
+ el.className = 'row';
+ el.innerHTML = "<dl class='tabs vertical two columns'></dl><div class='tabs-content ten columns'></div>";
+ return el;
+ },
+ setGridColumnSize: function(el,size) {
+ var sizes = ['zero','one','two','three','four','five','six','seven','eight','nine','ten','eleven','twelve'];
+ el.className = 'columns '+sizes[size];
+ },
+ getTab: function(text) {
+ var el = document.createElement('dd');
+ var a = document.createElement('a');
+ a.setAttribute('href','#');
+ a.appendChild(text);
+ el.appendChild(a);
+ return el;
+ },
+ getTabContentHolder: function(tab_holder) {
+ return tab_holder.children[1];
+ },
+ getTabContent: function() {
+ var el = document.createElement('div');
+ el.className = 'content active';
+ el.style.paddingLeft = '5px';
+ return el;
+ },
+ markTabActive: function(tab) {
+ tab.className += ' active';
+ },
+ markTabInactive: function(tab) {
+ tab.className = tab.className.replace(/\s*active/g,'');
+ },
+ addTab: function(holder, tab) {
+ holder.children[0].appendChild(tab);
+ }
+});
+
+// Foundation 4 Specific Theme
+JSONEditor.defaults.themes.foundation4 = JSONEditor.defaults.themes.foundation.extend({
+ getHeaderButtonHolder: function() {
+ var el = this._super();
+ el.style.fontSize = '.6em';
+ return el;
+ },
+ setGridColumnSize: function(el,size) {
+ el.className = 'columns large-'+size;
+ },
+ getFormInputDescription: function(text) {
+ var el = this._super(text);
+ el.style.fontSize = '.8rem';
+ return el;
+ },
+ getFormInputLabel: function(text) {
+ var el = this._super(text);
+ el.style.fontWeight = 'bold';
+ return el;
+ }
+});
+
+// Foundation 5 Specific Theme
+JSONEditor.defaults.themes.foundation5 = JSONEditor.defaults.themes.foundation.extend({
+ getFormInputDescription: function(text) {
+ var el = this._super(text);
+ el.style.fontSize = '.8rem';
+ return el;
+ },
+ setGridColumnSize: function(el,size) {
+ el.className = 'columns medium-'+size;
+ },
+ getButton: function(text, icon, title) {
+ var el = this._super(text,icon,title);
+ el.className = el.className.replace(/\s*small/g,'') + ' tiny';
+ return el;
+ },
+ getTabHolder: function() {
+ var el = document.createElement('div');
+ el.innerHTML = "<dl class='tabs vertical'></dl><div class='tabs-content vertical'></div>";
+ return el;
+ },
+ getTab: function(text) {
+ var el = document.createElement('dd');
+ var a = document.createElement('a');
+ a.setAttribute('href','#');
+ a.appendChild(text);
+ el.appendChild(a);
+ return el;
+ },
+ getTabContentHolder: function(tab_holder) {
+ return tab_holder.children[1];
+ },
+ getTabContent: function() {
+ var el = document.createElement('div');
+ el.className = 'content active';
+ el.style.paddingLeft = '5px';
+ return el;
+ },
+ markTabActive: function(tab) {
+ tab.className += ' active';
+ },
+ markTabInactive: function(tab) {
+ tab.className = tab.className.replace(/\s*active/g,'');
+ },
+ addTab: function(holder, tab) {
+ holder.children[0].appendChild(tab);
+ }
+});
+
+JSONEditor.defaults.themes.foundation6 = JSONEditor.defaults.themes.foundation5.extend({
+ getIndentedPanel: function() {
+ var el = document.createElement('div');
+ el.className = 'callout secondary';
+ return el;
+ },
+ getButtonHolder: function() {
+ var el = document.createElement('div');
+ el.className = 'button-group tiny';
+ el.style.marginBottom = 0;
+ return el;
+ },
+ getFormInputLabel: function(text) {
+ var el = this._super(text);
+ el.style.display = 'block';
+ return el;
+ },
+ getFormControl: function(label, input, description) {
+ var el = document.createElement('div');
+ el.className = 'form-control';
+ if(label) el.appendChild(label);
+ if(input.type === 'checkbox') {
+ label.insertBefore(input,label.firstChild);
+ }
+ else if (label) {
+ label.appendChild(input);
+ } else {
+ el.appendChild(input);
+ }
+
+ if(description) label.appendChild(description);
+ return el;
+ },
+ addInputError: function(input,text) {
+ if(!input.group) return;
+ input.group.className += ' error';
+
+ if(!input.errmsg) {
+ var errorEl = document.createElement('span');
+ errorEl.className = 'form-error is-visible';
+ input.group.getElementsByTagName('label')[0].appendChild(errorEl);
+
+ input.className = input.className + ' is-invalid-input';
+
+ input.errmsg = errorEl;
+ }
+ else {
+ input.errmsg.style.display = '';
+ input.className = '';
+ }
+
+ input.errmsg.textContent = text;
+ },
+ removeInputError: function(input) {
+ if(!input.errmsg) return;
+ input.className = input.className.replace(/ is-invalid-input/g,'');
+ if(input.errmsg.parentNode) {
+ input.errmsg.parentNode.removeChild(input.errmsg);
+ }
+ },
+});
+
+JSONEditor.defaults.themes.html = JSONEditor.AbstractTheme.extend({
+ getFormInputLabel: function(text) {
+ var el = this._super(text);
+ el.style.display = 'block';
+ el.style.marginBottom = '3px';
+ el.style.fontWeight = 'bold';
+ return el;
+ },
+ getFormInputDescription: function(text) {
+ var el = this._super(text);
+ el.style.fontSize = '.8em';
+ el.style.margin = 0;
+ el.style.display = 'inline-block';
+ el.style.fontStyle = 'italic';
+ return el;
+ },
+ getIndentedPanel: function() {
+ var el = this._super();
+ el.style.border = '1px solid #ddd';
+ el.style.padding = '5px';
+ el.style.margin = '5px';
+ el.style.borderRadius = '3px';
+ return el;
+ },
+ getChildEditorHolder: function() {
+ var el = this._super();
+ el.style.marginBottom = '8px';
+ return el;
+ },
+ getHeaderButtonHolder: function() {
+ var el = this.getButtonHolder();
+ el.style.display = 'inline-block';
+ el.style.marginLeft = '10px';
+ el.style.fontSize = '.8em';
+ el.style.verticalAlign = 'middle';
+ return el;
+ },
+ getTable: function() {
+ var el = this._super();
+ el.style.borderBottom = '1px solid #ccc';
+ el.style.marginBottom = '5px';
+ return el;
+ },
+ addInputError: function(input, text) {
+ input.style.borderColor = 'red';
+
+ if(!input.errmsg) {
+ var group = this.closest(input,'.form-control');
+ input.errmsg = document.createElement('div');
+ input.errmsg.setAttribute('class','errmsg');
+ input.errmsg.style = input.errmsg.style || {};
+ input.errmsg.style.color = 'red';
+ group.appendChild(input.errmsg);
+ }
+ else {
+ input.errmsg.style.display = 'block';
+ }
+
+ input.errmsg.innerHTML = '';
+ input.errmsg.appendChild(document.createTextNode(text));
+ },
+ removeInputError: function(input) {
+ input.style.borderColor = '';
+ if(input.errmsg) input.errmsg.style.display = 'none';
+ },
+ getProgressBar: function() {
+ var max = 100, start = 0;
+
+ var progressBar = document.createElement('progress');
+ progressBar.setAttribute('max', max);
+ progressBar.setAttribute('value', start);
+ return progressBar;
+ },
+ updateProgressBar: function(progressBar, progress) {
+ if (!progressBar) return;
+ progressBar.setAttribute('value', progress);
+ },
+ updateProgressBarUnknown: function(progressBar) {
+ if (!progressBar) return;
+ progressBar.removeAttribute('value');
+ }
+});
+
+JSONEditor.defaults.themes.jqueryui = JSONEditor.AbstractTheme.extend({
+ getTable: function() {
+ var el = this._super();
+ el.setAttribute('cellpadding',5);
+ el.setAttribute('cellspacing',0);
+ return el;
+ },
+ getTableHeaderCell: function(text) {
+ var el = this._super(text);
+ el.className = 'ui-state-active';
+ el.style.fontWeight = 'bold';
+ return el;
+ },
+ getTableCell: function() {
+ var el = this._super();
+ el.className = 'ui-widget-content';
+ return el;
+ },
+ getHeaderButtonHolder: function() {
+ var el = this.getButtonHolder();
+ el.style.marginLeft = '10px';
+ el.style.fontSize = '.6em';
+ el.style.display = 'inline-block';
+ return el;
+ },
+ getFormInputDescription: function(text) {
+ var el = this.getDescription(text);
+ el.style.marginLeft = '10px';
+ el.style.display = 'inline-block';
+ return el;
+ },
+ getFormControl: function(label, input, description) {
+ var el = this._super(label,input,description);
+ if(input.type === 'checkbox') {
+ el.style.lineHeight = '25px';
+
+ el.style.padding = '3px 0';
+ }
+ else {
+ el.style.padding = '4px 0 8px 0';
+ }
+ return el;
+ },
+ getDescription: function(text) {
+ var el = document.createElement('span');
+ el.style.fontSize = '.8em';
+ el.style.fontStyle = 'italic';
+ el.textContent = text;
+ return el;
+ },
+ getButtonHolder: function() {
+ var el = document.createElement('div');
+ el.className = 'ui-buttonset';
+ el.style.fontSize = '.7em';
+ return el;
+ },
+ getFormInputLabel: function(text) {
+ var el = document.createElement('label');
+ el.style.fontWeight = 'bold';
+ el.style.display = 'block';
+ el.textContent = text;
+ return el;
+ },
+ getButton: function(text, icon, title) {
+ var button = document.createElement("button");
+ button.className = 'ui-button ui-widget ui-state-default ui-corner-all';
+
+ // Icon only
+ if(icon && !text) {
+ button.className += ' ui-button-icon-only';
+ icon.className += ' ui-button-icon-primary ui-icon-primary';
+ button.appendChild(icon);
+ }
+ // Icon and Text
+ else if(icon) {
+ button.className += ' ui-button-text-icon-primary';
+ icon.className += ' ui-button-icon-primary ui-icon-primary';
+ button.appendChild(icon);
+ }
+ // Text only
+ else {
+ button.className += ' ui-button-text-only';
+ }
+
+ var el = document.createElement('span');
+ el.className = 'ui-button-text';
+ el.textContent = text||title||".";
+ button.appendChild(el);
+
+ button.setAttribute('title',title);
+
+ return button;
+ },
+ setButtonText: function(button,text, icon, title) {
+ button.innerHTML = '';
+ button.className = 'ui-button ui-widget ui-state-default ui-corner-all';
+
+ // Icon only
+ if(icon && !text) {
+ button.className += ' ui-button-icon-only';
+ icon.className += ' ui-button-icon-primary ui-icon-primary';
+ button.appendChild(icon);
+ }
+ // Icon and Text
+ else if(icon) {
+ button.className += ' ui-button-text-icon-primary';
+ icon.className += ' ui-button-icon-primary ui-icon-primary';
+ button.appendChild(icon);
+ }
+ // Text only
+ else {
+ button.className += ' ui-button-text-only';
+ }
+
+ var el = document.createElement('span');
+ el.className = 'ui-button-text';
+ el.textContent = text||title||".";
+ button.appendChild(el);
+
+ button.setAttribute('title',title);
+ },
+ getIndentedPanel: function() {
+ var el = document.createElement('div');
+ el.className = 'ui-widget-content ui-corner-all';
+ el.style.padding = '1em 1.4em';
+ el.style.marginBottom = '20px';
+ return el;
+ },
+ afterInputReady: function(input) {
+ if(input.controls) return;
+ input.controls = this.closest(input,'.form-control');
+ },
+ addInputError: function(input,text) {
+ if(!input.controls) return;
+ if(!input.errmsg) {
+ input.errmsg = document.createElement('div');
+ input.errmsg.className = 'ui-state-error';
+ input.controls.appendChild(input.errmsg);
+ }
+ else {
+ input.errmsg.style.display = '';
+ }
+
+ input.errmsg.textContent = text;
+ },
+ removeInputError: function(input) {
+ if(!input.errmsg) return;
+ input.errmsg.style.display = 'none';
+ },
+ markTabActive: function(tab) {
+ tab.className = tab.className.replace(/\s*ui-widget-header/g,'')+' ui-state-active';
+ },
+ markTabInactive: function(tab) {
+ tab.className = tab.className.replace(/\s*ui-state-active/g,'')+' ui-widget-header';
+ }
+});
+
+JSONEditor.defaults.themes.barebones = JSONEditor.AbstractTheme.extend({
+ getFormInputLabel: function (text) {
+ var el = this._super(text);
+ return el;
+ },
+ getFormInputDescription: function (text) {
+ var el = this._super(text);
+ return el;
+ },
+ getIndentedPanel: function () {
+ var el = this._super();
+ return el;
+ },
+ getChildEditorHolder: function () {
+ var el = this._super();
+ return el;
+ },
+ getHeaderButtonHolder: function () {
+ var el = this.getButtonHolder();
+ return el;
+ },
+ getTable: function () {
+ var el = this._super();
+ return el;
+ },
+ addInputError: function (input, text) {
+ if (!input.errmsg) {
+ var group = this.closest(input, '.form-control');
+ input.errmsg = document.createElement('div');
+ input.errmsg.setAttribute('class', 'errmsg');
+ group.appendChild(input.errmsg);
+ }
+ else {
+ input.errmsg.style.display = 'block';
+ }
+
+ input.errmsg.innerHTML = '';
+ input.errmsg.appendChild(document.createTextNode(text));
+ },
+ removeInputError: function (input) {
+ input.style.borderColor = '';
+ if (input.errmsg) input.errmsg.style.display = 'none';
+ },
+ getProgressBar: function () {
+ var max = 100, start = 0;
+
+ var progressBar = document.createElement('progress');
+ progressBar.setAttribute('max', max);
+ progressBar.setAttribute('value', start);
+ return progressBar;
+ },
+ updateProgressBar: function (progressBar, progress) {
+ if (!progressBar) return;
+ progressBar.setAttribute('value', progress);
+ },
+ updateProgressBarUnknown: function (progressBar) {
+ if (!progressBar) return;
+ progressBar.removeAttribute('value');
+ }
+});
+
+JSONEditor.AbstractIconLib = Class.extend({
+ mapping: {
+ collapse: '',
+ expand: '',
+ "delete": '',
+ edit: '',
+ add: '',
+ cancel: '',
+ save: '',
+ moveup: '',
+ movedown: ''
+ },
+ icon_prefix: '',
+ getIconClass: function(key) {
+ if(this.mapping[key]) return this.icon_prefix+this.mapping[key];
+ else return null;
+ },
+ getIcon: function(key) {
+ var iconclass = this.getIconClass(key);
+
+ if(!iconclass) return null;
+
+ var i = document.createElement('i');
+ i.className = iconclass;
+ return i;
+ }
+});
+
+JSONEditor.defaults.iconlibs.bootstrap2 = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'chevron-down',
+ expand: 'chevron-up',
+ "delete": 'trash',
+ edit: 'pencil',
+ add: 'plus',
+ cancel: 'ban-circle',
+ save: 'ok',
+ moveup: 'arrow-up',
+ movedown: 'arrow-down'
+ },
+ icon_prefix: 'icon-'
+});
+
+JSONEditor.defaults.iconlibs.bootstrap3 = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'chevron-down',
+ expand: 'chevron-right',
+ "delete": 'remove',
+ edit: 'pencil',
+ add: 'plus',
+ cancel: 'floppy-remove',
+ save: 'floppy-saved',
+ moveup: 'arrow-up',
+ movedown: 'arrow-down'
+ },
+ icon_prefix: 'glyphicon glyphicon-'
+});
+
+JSONEditor.defaults.iconlibs.fontawesome3 = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'chevron-down',
+ expand: 'chevron-right',
+ "delete": 'remove',
+ edit: 'pencil',
+ add: 'plus',
+ cancel: 'ban-circle',
+ save: 'save',
+ moveup: 'arrow-up',
+ movedown: 'arrow-down'
+ },
+ icon_prefix: 'icon-'
+});
+
+JSONEditor.defaults.iconlibs.fontawesome4 = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'caret-square-o-down',
+ expand: 'caret-square-o-right',
+ "delete": 'times',
+ edit: 'pencil',
+ add: 'plus',
+ cancel: 'ban',
+ save: 'save',
+ moveup: 'arrow-up',
+ movedown: 'arrow-down'
+ },
+ icon_prefix: 'fa fa-'
+});
+
+JSONEditor.defaults.iconlibs.foundation2 = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'minus',
+ expand: 'plus',
+ "delete": 'remove',
+ edit: 'edit',
+ add: 'add-doc',
+ cancel: 'error',
+ save: 'checkmark',
+ moveup: 'up-arrow',
+ movedown: 'down-arrow'
+ },
+ icon_prefix: 'foundicon-'
+});
+
+JSONEditor.defaults.iconlibs.foundation3 = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'minus',
+ expand: 'plus',
+ "delete": 'x',
+ edit: 'pencil',
+ add: 'page-add',
+ cancel: 'x-circle',
+ save: 'save',
+ moveup: 'arrow-up',
+ movedown: 'arrow-down'
+ },
+ icon_prefix: 'fi-'
+});
+
+JSONEditor.defaults.iconlibs.jqueryui = JSONEditor.AbstractIconLib.extend({
+ mapping: {
+ collapse: 'triangle-1-s',
+ expand: 'triangle-1-e',
+ "delete": 'trash',
+ edit: 'pencil',
+ add: 'plusthick',
+ cancel: 'closethick',
+ save: 'disk',
+ moveup: 'arrowthick-1-n',
+ movedown: 'arrowthick-1-s'
+ },
+ icon_prefix: 'ui-icon ui-icon-'
+});
+
+JSONEditor.defaults.templates["default"] = function() {
+ return {
+ compile: function(template) {
+ var matches = template.match(/{{\s*([a-zA-Z0-9\-_ \.]+)\s*}}/g);
+ var l = matches && matches.length;
+
+ // Shortcut if the template contains no variables
+ if(!l) return function() { return template; };
+
+ // Pre-compute the search/replace functions
+ // This drastically speeds up template execution
+ var replacements = [];
+ var get_replacement = function(i) {
+ var p = matches[i].replace(/[{}]+/g,'').trim().split('.');
+ var n = p.length;
+ var func;
+
+ if(n > 1) {
+ var cur;
+ func = function(vars) {
+ cur = vars;
+ for(i=0; i<n; i++) {
+ cur = cur[p[i]];
+ if(!cur) break;
+ }
+ return cur;
+ };
+ }
+ else {
+ p = p[0];
+ func = function(vars) {
+ return vars[p];
+ };
+ }
+
+ replacements.push({
+ s: matches[i],
+ r: func
+ });
+ };
+ for(var i=0; i<l; i++) {
+ get_replacement(i);
+ }
+
+ // The compiled function
+ return function(vars) {
+ var ret = template+"";
+ var r;
+ for(i=0; i<l; i++) {
+ r = replacements[i];
+ ret = ret.replace(r.s, r.r(vars));
+ }
+ return ret;
+ };
+ }
+ };
+};
+
+JSONEditor.defaults.templates.ejs = function() {
+ if(!window.EJS) return false;
+
+ return {
+ compile: function(template) {
+ var compiled = new window.EJS({
+ text: template
+ });
+
+ return function(context) {
+ return compiled.render(context);
+ };
+ }
+ };
+};
+
+JSONEditor.defaults.templates.handlebars = function() {
+ return window.Handlebars;
+};
+
+JSONEditor.defaults.templates.hogan = function() {
+ if(!window.Hogan) return false;
+
+ return {
+ compile: function(template) {
+ var compiled = window.Hogan.compile(template);
+ return function(context) {
+ return compiled.render(context);
+ };
+ }
+ };
+};
+
+JSONEditor.defaults.templates.markup = function() {
+ if(!window.Mark || !window.Mark.up) return false;
+
+ return {
+ compile: function(template) {
+ return function(context) {
+ return window.Mark.up(template,context);
+ };
+ }
+ };
+};
+
+JSONEditor.defaults.templates.mustache = function() {
+ if(!window.Mustache) return false;
+
+ return {
+ compile: function(template) {
+ return function(view) {
+ return window.Mustache.render(template, view);
+ };
+ }
+ };
+};
+
+JSONEditor.defaults.templates.swig = function() {
+ return window.swig;
+};
+
+JSONEditor.defaults.templates.underscore = function() {
+ if(!window._) return false;
+
+ return {
+ compile: function(template) {
+ return function(context) {
+ return window._.template(template, context);
+ };
+ }
+ };
+};
+
+// Set the default theme
+JSONEditor.defaults.theme = 'html';
+
+// Set the default template engine
+JSONEditor.defaults.template = 'default';
+
+// Default options when initializing JSON Editor
+JSONEditor.defaults.options = {};
+
+// String translate function
+JSONEditor.defaults.translate = function(key, variables) {
+ var lang = JSONEditor.defaults.languages[JSONEditor.defaults.language];
+ if(!lang) throw "Unknown language "+JSONEditor.defaults.language;
+
+ var string = lang[key] || JSONEditor.defaults.languages[JSONEditor.defaults.default_language][key];
+
+ if(typeof string === "undefined") throw "Unknown translate string "+key;
+
+ if(variables) {
+ for(var i=0; i<variables.length; i++) {
+ string = string.replace(new RegExp('\\{\\{'+i+'}}','g'),variables[i]);
+ }
+ }
+
+ return string;
+};
+
+// Translation strings and default languages
+JSONEditor.defaults.default_language = 'en';
+JSONEditor.defaults.language = JSONEditor.defaults.default_language;
+JSONEditor.defaults.languages.en = {
+ /**
+ * When a property is not set
+ */
+ error_notset: "Property must be set",
+ /**
+ * When a string must not be empty
+ */
+ error_notempty: "Value required",
+ /**
+ * When a value is not one of the enumerated values
+ */
+ error_enum: "Value must be one of the enumerated values",
+ /**
+ * When a value doesn't validate any schema of a 'anyOf' combination
+ */
+ error_anyOf: "Value must validate against at least one of the provided schemas",
+ /**
+ * When a value doesn't validate
+ * @variables This key takes one variable: The number of schemas the value does not validate
+ */
+ error_oneOf: 'Value must validate against exactly one of the provided schemas. It currently validates against {{0}} of the schemas.',
+ /**
+ * When a value does not validate a 'not' schema
+ */
+ error_not: "Value must not validate against the provided schema",
+ /**
+ * When a value does not match any of the provided types
+ */
+ error_type_union: "Value must be one of the provided types",
+ /**
+ * When a value does not match the given type
+ * @variables This key takes one variable: The type the value should be of
+ */
+ error_type: "Value must be of type {{0}}",
+ /**
+ * When the value validates one of the disallowed types
+ */
+ error_disallow_union: "Value must not be one of the provided disallowed types",
+ /**
+ * When the value validates a disallowed type
+ * @variables This key takes one variable: The type the value should not be of
+ */
+ error_disallow: "Value must not be of type {{0}}",
+ /**
+ * When a value is not a multiple of or divisible by a given number
+ * @variables This key takes one variable: The number mentioned above
+ */
+ error_multipleOf: "Value must be a multiple of {{0}}",
+ /**
+ * When a value is greater than it's supposed to be (exclusive)
+ * @variables This key takes one variable: The maximum
+ */
+ error_maximum_excl: "Value must be less than {{0}}",
+ /**
+ * When a value is greater than it's supposed to be (inclusive
+ * @variables This key takes one variable: The maximum
+ */
+ error_maximum_incl: "Value must be at most {{0}}",
+ /**
+ * When a value is lesser than it's supposed to be (exclusive)
+ * @variables This key takes one variable: The minimum
+ */
+ error_minimum_excl: "Value must be greater than {{0}}",
+ /**
+ * When a value is lesser than it's supposed to be (inclusive)
+ * @variables This key takes one variable: The minimum
+ */
+ error_minimum_incl: "Value must be at least {{0}}",
+ /**
+ * When a value have too many characters
+ * @variables This key takes one variable: The maximum character count
+ */
+ error_maxLength: "Value must be at most {{0}} characters long",
+ /**
+ * When a value does not have enough characters
+ * @variables This key takes one variable: The minimum character count
+ */
+ error_minLength: "Value must be at least {{0}} characters long",
+ /**
+ * When a value does not match a given pattern
+ */
+ error_pattern: "Value must match the pattern {{0}}",
+ /**
+ * When an array has additional items whereas it is not supposed to
+ */
+ error_additionalItems: "No additional items allowed in this array",
+ /**
+ * When there are to many items in an array
+ * @variables This key takes one variable: The maximum item count
+ */
+ error_maxItems: "Value must have at most {{0}} items",
+ /**
+ * When there are not enough items in an array
+ * @variables This key takes one variable: The minimum item count
+ */
+ error_minItems: "Value must have at least {{0}} items",
+ /**
+ * When an array is supposed to have unique items but has duplicates
+ */
+ error_uniqueItems: "Array must have unique items",
+ /**
+ * When there are too many properties in an object
+ * @variables This key takes one variable: The maximum property count
+ */
+ error_maxProperties: "Object must have at most {{0}} properties",
+ /**
+ * When there are not enough properties in an object
+ * @variables This key takes one variable: The minimum property count
+ */
+ error_minProperties: "Object must have at least {{0}} properties",
+ /**
+ * When a required property is not defined
+ * @variables This key takes one variable: The name of the missing property
+ */
+ error_required: "Object is missing the required property '{{0}}'",
+ /**
+ * When there is an additional property is set whereas there should be none
+ * @variables This key takes one variable: The name of the additional property
+ */
+ error_additional_properties: "No additional properties allowed, but property {{0}} is set",
+ /**
+ * When a dependency is not resolved
+ * @variables This key takes one variable: The name of the missing property for the dependency
+ */
+ error_dependency: "Must have property {{0}}",
+ /**
+ * Text on Delete All buttons
+ */
+ button_delete_all: "All",
+ /**
+ * Title on Delete All buttons
+ */
+ button_delete_all_title: "Delete All",
+ /**
+ * Text on Delete Last buttons
+ * @variable This key takes one variable: The title of object to delete
+ */
+ button_delete_last: "Last {{0}}",
+ /**
+ * Title on Delete Last buttons
+ * @variable This key takes one variable: The title of object to delete
+ */
+ button_delete_last_title: "Delete Last {{0}}",
+ /**
+ * Title on Add Row buttons
+ * @variable This key takes one variable: The title of object to add
+ */
+ button_add_row_title: "Add {{0}}",
+ /**
+ * Title on Move Down buttons
+ */
+ button_move_down_title: "Move down",
+ /**
+ * Title on Move Up buttons
+ */
+ button_move_up_title: "Move up",
+ /**
+ * Title on Delete Row buttons
+ * @variable This key takes one variable: The title of object to delete
+ */
+ button_delete_row_title: "Delete {{0}}",
+ /**
+ * Title on Delete Row buttons, short version (no parameter with the object title)
+ */
+ button_delete_row_title_short: "Delete",
+ /**
+ * Title on Collapse buttons
+ */
+ button_collapse: "Collapse"
+};
+
+// Miscellaneous Plugin Settings
+JSONEditor.plugins = {
+ ace: {
+ theme: ''
+ },
+ epiceditor: {
+
+ },
+ sceditor: {
+
+ },
+ select2: {
+
+ },
+ selectize: {
+ }
+};
+
+// Default per-editor options
+for(var i in JSONEditor.defaults.editors) {
+ if(!JSONEditor.defaults.editors.hasOwnProperty(i)) continue;
+ JSONEditor.defaults.editors[i].options = JSONEditor.defaults.editors.options || {};
+}
+
+// Set the default resolvers
+// Use "multiple" as a fall back for everything
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ if(typeof schema.type !== "string") return "multiple";
+});
+// If the type is not set but properties are defined, we can infer the type is actually object
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ // If the schema is a simple type
+ if(!schema.type && schema.properties ) return "object";
+});
+// If the type is set and it's a basic type, use the primitive editor
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ // If the schema is a simple type
+ if(typeof schema.type === "string") return schema.type;
+});
+// Boolean editors
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ if(schema.type === 'boolean') {
+ // If explicitly set to 'checkbox', use that
+ if(schema.format === "checkbox" || (schema.options && schema.options.checkbox)) {
+ return "checkbox";
+ }
+ // Otherwise, default to select menu
+ return (JSONEditor.plugins.selectize.enable) ? 'selectize' : 'select';
+ }
+});
+// Use the multiple editor for schemas where the `type` is set to "any"
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ // If the schema can be of any type
+ if(schema.type === "any") return "multiple";
+});
+// Editor for base64 encoded files
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ // If the schema can be of any type
+ if(schema.type === "string" && schema.media && schema.media.binaryEncoding==="base64") {
+ return "base64";
+ }
+});
+// Editor for uploading files
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ if(schema.type === "string" && schema.format === "url" && schema.options && schema.options.upload === true) {
+ if(window.FileReader) return "upload";
+ }
+});
+// Use the table editor for arrays with the format set to `table`
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ // Type `array` with format set to `table`
+ if(schema.type == "array" && schema.format == "table") {
+ return "table";
+ }
+});
+// Use the `select` editor for dynamic enumSource enums
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ if(schema.enumSource) return (JSONEditor.plugins.selectize.enable) ? 'selectize' : 'select';
+});
+// Use the `enum` or `select` editors for schemas with enumerated properties
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ if(schema["enum"]) {
+ if(schema.type === "array" || schema.type === "object") {
+ return "enum";
+ }
+ else if(schema.type === "number" || schema.type === "integer" || schema.type === "string") {
+ return (JSONEditor.plugins.selectize.enable) ? 'selectize' : 'select';
+ }
+ }
+});
+// Specialized editors for arrays of strings
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ if(schema.type === "array" && schema.items && !(Array.isArray(schema.items)) && schema.uniqueItems && ['string','number','integer'].indexOf(schema.items.type) >= 0) {
+ // For enumerated strings, number, or integers
+ if(schema.items.enum) {
+ return 'multiselect';
+ }
+ // For non-enumerated strings (tag editor)
+ else if(JSONEditor.plugins.selectize.enable && schema.items.type === "string") {
+ return 'arraySelectize';
+ }
+ }
+});
+// Use the multiple editor for schemas with `oneOf` set
+JSONEditor.defaults.resolvers.unshift(function(schema) {
+ // If this schema uses `oneOf`
+ if(schema.oneOf) return "multiple";
+});
+
+/**
+ * This is a small wrapper for using JSON Editor like a typical jQuery plugin.
+ */
+(function() {
+ if(window.jQuery || window.Zepto) {
+ var $ = window.jQuery || window.Zepto;
+ $.jsoneditor = JSONEditor.defaults;
+
+ $.fn.jsoneditor = function(options) {
+ var self = this;
+ var editor = this.data('jsoneditor');
+ if(options === 'value') {
+ if(!editor) throw "Must initialize jsoneditor before getting/setting the value";
+
+ // Set value
+ if(arguments.length > 1) {
+ editor.setValue(arguments[1]);
+ }
+ // Get value
+ else {
+ return editor.getValue();
+ }
+ }
+ else if(options === 'validate') {
+ if(!editor) throw "Must initialize jsoneditor before validating";
+
+ // Validate a specific value
+ if(arguments.length > 1) {
+ return editor.validate(arguments[1]);
+ }
+ // Validate current value
+ else {
+ return editor.validate();
+ }
+ }
+ else if(options === 'destroy') {
+ if(editor) {
+ editor.destroy();
+ this.data('jsoneditor',null);
+ }
+ }
+ else {
+ // Destroy first
+ if(editor) {
+ editor.destroy();
+ }
+
+ // Create editor
+ editor = new JSONEditor(this.get(0),options);
+ this.data('jsoneditor',editor);
+
+ // Setup event listeners
+ editor.on('change',function() {
+ self.trigger('change');
+ });
+ editor.on('ready',function() {
+ self.trigger('ready');
+ });
+ }
+
+ return this;
+ };
+ }
+})();
+
+ window.JSONEditor = JSONEditor;
+})();
+
+//# sourceMappingURL=jsoneditor.js.map
\ No newline at end of file
diff --git a/contrail-webui/common/jquery-linedtextarea.zip b/contrail-webui/common/jquery-linedtextarea.zip
new file mode 100644
index 0000000..01b5b83
--- /dev/null
+++ b/contrail-webui/common/jquery-linedtextarea.zip
Binary files differ
diff --git a/contrail-webui/common/jsoneditor-5.5.6.zip b/contrail-webui/common/jsoneditor-5.5.6.zip
new file mode 100644
index 0000000..f40d22c
--- /dev/null
+++ b/contrail-webui/common/jsoneditor-5.5.6.zip
Binary files differ
diff --git a/contrail-webui/common/karma-0.12.37.tar.gz b/contrail-webui/common/karma-0.12.37.tar.gz
new file mode 100644
index 0000000..c2440f2
--- /dev/null
+++ b/contrail-webui/common/karma-0.12.37.tar.gz
Binary files differ
diff --git a/contrail-webui/common/karma-phantomjs-launcher-0.2.1.tar.gz b/contrail-webui/common/karma-phantomjs-launcher-0.2.1.tar.gz
new file mode 100644
index 0000000..09f2406
--- /dev/null
+++ b/contrail-webui/common/karma-phantomjs-launcher-0.2.1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/bootstrap-sass-3.3.6.tar.gz b/contrail-webui/common/npm-sources/bootstrap-sass-3.3.6.tar.gz
new file mode 100644
index 0000000..cc97aa5
--- /dev/null
+++ b/contrail-webui/common/npm-sources/bootstrap-sass-3.3.6.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/centos/bootstrap-sass-3.3.6.tar.gz b/contrail-webui/common/npm-sources/centos/bootstrap-sass-3.3.6.tar.gz
new file mode 100644
index 0000000..1c619d1
--- /dev/null
+++ b/contrail-webui/common/npm-sources/centos/bootstrap-sass-3.3.6.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/centos/node-sass-3.8.0.tar.gz b/contrail-webui/common/npm-sources/centos/node-sass-3.8.0.tar.gz
new file mode 100644
index 0000000..3b9dc0b
--- /dev/null
+++ b/contrail-webui/common/npm-sources/centos/node-sass-3.8.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/centos/nodejs-driver-3.0.2.tar.gz b/contrail-webui/common/npm-sources/centos/nodejs-driver-3.0.2.tar.gz
new file mode 100644
index 0000000..b6c50a2
--- /dev/null
+++ b/contrail-webui/common/npm-sources/centos/nodejs-driver-3.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/centos/webworker-threads-0.7.4.tar.gz b/contrail-webui/common/npm-sources/centos/webworker-threads-0.7.4.tar.gz
new file mode 100644
index 0000000..c2ade6f
--- /dev/null
+++ b/contrail-webui/common/npm-sources/centos/webworker-threads-0.7.4.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/csslint-1.0.2.tar.gz b/contrail-webui/common/npm-sources/csslint-1.0.2.tar.gz
new file mode 100644
index 0000000..3c9a9dd
--- /dev/null
+++ b/contrail-webui/common/npm-sources/csslint-1.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/csslint-stylish-0.0.4.tar.gz b/contrail-webui/common/npm-sources/csslint-stylish-0.0.4.tar.gz
new file mode 100644
index 0000000..6654d11
--- /dev/null
+++ b/contrail-webui/common/npm-sources/csslint-stylish-0.0.4.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/d3-4.4.3.tgz b/contrail-webui/common/npm-sources/d3-4.4.3.tgz
new file mode 100644
index 0000000..a1f7d17
--- /dev/null
+++ b/contrail-webui/common/npm-sources/d3-4.4.3.tgz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/darwin/bootstrap-sass-3.3.6.tar.gz b/contrail-webui/common/npm-sources/darwin/bootstrap-sass-3.3.6.tar.gz
new file mode 100644
index 0000000..daf5ad9
--- /dev/null
+++ b/contrail-webui/common/npm-sources/darwin/bootstrap-sass-3.3.6.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/darwin/node-sass-3.8.0.tar.gz b/contrail-webui/common/npm-sources/darwin/node-sass-3.8.0.tar.gz
new file mode 100644
index 0000000..d6615de
--- /dev/null
+++ b/contrail-webui/common/npm-sources/darwin/node-sass-3.8.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/darwin/nodejs-driver-3.0.2.tar.gz b/contrail-webui/common/npm-sources/darwin/nodejs-driver-3.0.2.tar.gz
new file mode 100644
index 0000000..c35bdb0
--- /dev/null
+++ b/contrail-webui/common/npm-sources/darwin/nodejs-driver-3.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/darwin/webworker-threads-0.7.4.tar.gz b/contrail-webui/common/npm-sources/darwin/webworker-threads-0.7.4.tar.gz
new file mode 100644
index 0000000..4eea80f
--- /dev/null
+++ b/contrail-webui/common/npm-sources/darwin/webworker-threads-0.7.4.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/eslint-2.13.1.tar.gz b/contrail-webui/common/npm-sources/eslint-2.13.1.tar.gz
new file mode 100644
index 0000000..d2ea6b7
--- /dev/null
+++ b/contrail-webui/common/npm-sources/eslint-2.13.1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/event-drops-0.3.0-alpha1.tgz b/contrail-webui/common/npm-sources/event-drops-0.3.0-alpha1.tgz
new file mode 100644
index 0000000..dee2c9c
--- /dev/null
+++ b/contrail-webui/common/npm-sources/event-drops-0.3.0-alpha1.tgz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-0.4.5.tar.gz b/contrail-webui/common/npm-sources/grunt-0.4.5.tar.gz
new file mode 100644
index 0000000..d966254
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-0.4.5.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-blanket-qunit-0.2.0.tar.gz b/contrail-webui/common/npm-sources/grunt-blanket-qunit-0.2.0.tar.gz
new file mode 100644
index 0000000..3aba761
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-blanket-qunit-0.2.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-cli-0.1.13.tar.gz b/contrail-webui/common/npm-sources/grunt-cli-0.1.13.tar.gz
new file mode 100644
index 0000000..5c93eac
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-cli-0.1.13.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-contrib-concat-0.5.1.tar.gz b/contrail-webui/common/npm-sources/grunt-contrib-concat-0.5.1.tar.gz
new file mode 100644
index 0000000..9c2bf87
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-contrib-concat-0.5.1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-contrib-csslint-1.0.0.tar.gz b/contrail-webui/common/npm-sources/grunt-contrib-csslint-1.0.0.tar.gz
new file mode 100644
index 0000000..f56b3a1
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-contrib-csslint-1.0.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-contrib-jshint-0.11.3.tar.gz b/contrail-webui/common/npm-sources/grunt-contrib-jshint-0.11.3.tar.gz
new file mode 100644
index 0000000..a6880b5
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-contrib-jshint-0.11.3.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-contrib-qunit-0.7.0.tar.gz b/contrail-webui/common/npm-sources/grunt-contrib-qunit-0.7.0.tar.gz
new file mode 100644
index 0000000..ea51c51
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-contrib-qunit-0.7.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-node-qunit-2.0.2.tar.gz b/contrail-webui/common/npm-sources/grunt-node-qunit-2.0.2.tar.gz
new file mode 100644
index 0000000..143b31d
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-node-qunit-2.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/grunt-qunit-junit-0.3.1.tar.gz b/contrail-webui/common/npm-sources/grunt-qunit-junit-0.3.1.tar.gz
new file mode 100644
index 0000000..895d424
--- /dev/null
+++ b/contrail-webui/common/npm-sources/grunt-qunit-junit-0.3.1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-chrome-launcher-0.2.1.tar.gz b/contrail-webui/common/npm-sources/karma-chrome-launcher-0.2.1.tar.gz
new file mode 100644
index 0000000..bb2fe34
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-chrome-launcher-0.2.1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-chrome-launcher-2.2.0.tar.gz b/contrail-webui/common/npm-sources/karma-chrome-launcher-2.2.0.tar.gz
new file mode 100644
index 0000000..eda9215
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-chrome-launcher-2.2.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-coverage-0.5.3.tar.gz b/contrail-webui/common/npm-sources/karma-coverage-0.5.3.tar.gz
new file mode 100644
index 0000000..36db9e2
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-coverage-0.5.3.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-firefox-launcher-0.1.6.tar.gz b/contrail-webui/common/npm-sources/karma-firefox-launcher-0.1.6.tar.gz
new file mode 100644
index 0000000..0fb91a6
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-firefox-launcher-0.1.6.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-html-reporter-0.2.7.tar.gz b/contrail-webui/common/npm-sources/karma-html-reporter-0.2.7.tar.gz
new file mode 100644
index 0000000..b47ed62
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-html-reporter-0.2.7.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-html2js-preprocessor-0.1.0.tar.gz b/contrail-webui/common/npm-sources/karma-html2js-preprocessor-0.1.0.tar.gz
new file mode 100644
index 0000000..e0073b7
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-html2js-preprocessor-0.1.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-htmlfile-reporter-0.2.2.tar.gz b/contrail-webui/common/npm-sources/karma-htmlfile-reporter-0.2.2.tar.gz
new file mode 100644
index 0000000..8909e00
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-htmlfile-reporter-0.2.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-junit-reporter-0.3.8.tar.gz b/contrail-webui/common/npm-sources/karma-junit-reporter-0.3.8.tar.gz
new file mode 100644
index 0000000..1df4f0a
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-junit-reporter-0.3.8.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-phantomjs-launcher-0.2.1.tar.gz b/contrail-webui/common/npm-sources/karma-phantomjs-launcher-0.2.1.tar.gz
new file mode 100644
index 0000000..6556370
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-phantomjs-launcher-0.2.1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-qunit-0.1.7.tar.gz b/contrail-webui/common/npm-sources/karma-qunit-0.1.7.tar.gz
new file mode 100644
index 0000000..0a0e001
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-qunit-0.1.7.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-requirejs-0.2.2.tar.gz b/contrail-webui/common/npm-sources/karma-requirejs-0.2.2.tar.gz
new file mode 100644
index 0000000..3062639
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-requirejs-0.2.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-safari-launcher-0.1.1.tar.gz b/contrail-webui/common/npm-sources/karma-safari-launcher-0.1.1.tar.gz
new file mode 100644
index 0000000..44fcff2
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-safari-launcher-0.1.1.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/karma-sinon-1.0.4.tar.gz b/contrail-webui/common/npm-sources/karma-sinon-1.0.4.tar.gz
new file mode 100644
index 0000000..903faf5
--- /dev/null
+++ b/contrail-webui/common/npm-sources/karma-sinon-1.0.4.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/lodash-4.15.tar.gz b/contrail-webui/common/npm-sources/lodash-4.15.tar.gz
new file mode 100644
index 0000000..8dbe989
--- /dev/null
+++ b/contrail-webui/common/npm-sources/lodash-4.15.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/lodash-4.17.12.tar.gz b/contrail-webui/common/npm-sources/lodash-4.17.12.tar.gz
new file mode 100644
index 0000000..06503b6
--- /dev/null
+++ b/contrail-webui/common/npm-sources/lodash-4.17.12.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/lodash-4.17.2.tgz b/contrail-webui/common/npm-sources/lodash-4.17.2.tgz
new file mode 100644
index 0000000..2a08313
--- /dev/null
+++ b/contrail-webui/common/npm-sources/lodash-4.17.2.tgz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/node-sass-3.8.0.tar.gz b/contrail-webui/common/npm-sources/node-sass-3.8.0.tar.gz
new file mode 100644
index 0000000..b883a90
--- /dev/null
+++ b/contrail-webui/common/npm-sources/node-sass-3.8.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/nodejs-driver-3.0.2.tar.gz b/contrail-webui/common/npm-sources/nodejs-driver-3.0.2.tar.gz
new file mode 100644
index 0000000..85b3fbf
--- /dev/null
+++ b/contrail-webui/common/npm-sources/nodejs-driver-3.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/qunit-0.7.7.tar.gz b/contrail-webui/common/npm-sources/qunit-0.7.7.tar.gz
new file mode 100644
index 0000000..e722bc0
--- /dev/null
+++ b/contrail-webui/common/npm-sources/qunit-0.7.7.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/qunitjs-1.20.0.tar.gz b/contrail-webui/common/npm-sources/qunitjs-1.20.0.tar.gz
new file mode 100644
index 0000000..a7552e0
--- /dev/null
+++ b/contrail-webui/common/npm-sources/qunitjs-1.20.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/redhat/bootstrap-sass-3.3.6.tar.gz b/contrail-webui/common/npm-sources/redhat/bootstrap-sass-3.3.6.tar.gz
new file mode 100644
index 0000000..40fc138
--- /dev/null
+++ b/contrail-webui/common/npm-sources/redhat/bootstrap-sass-3.3.6.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/redhat/node-sass-3.8.0.tar.gz b/contrail-webui/common/npm-sources/redhat/node-sass-3.8.0.tar.gz
new file mode 100644
index 0000000..69d44ff
--- /dev/null
+++ b/contrail-webui/common/npm-sources/redhat/node-sass-3.8.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/redhat/nodejs-driver-3.0.2.tar.gz b/contrail-webui/common/npm-sources/redhat/nodejs-driver-3.0.2.tar.gz
new file mode 100644
index 0000000..8e397f8
--- /dev/null
+++ b/contrail-webui/common/npm-sources/redhat/nodejs-driver-3.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/redhat/webworker-threads-0.7.4.tar.gz b/contrail-webui/common/npm-sources/redhat/webworker-threads-0.7.4.tar.gz
new file mode 100644
index 0000000..47b8363
--- /dev/null
+++ b/contrail-webui/common/npm-sources/redhat/webworker-threads-0.7.4.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/requirejs-2.1.20.tar.gz b/contrail-webui/common/npm-sources/requirejs-2.1.20.tar.gz
new file mode 100644
index 0000000..13b96a2
--- /dev/null
+++ b/contrail-webui/common/npm-sources/requirejs-2.1.20.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/sinon-1.17.2.tar.gz b/contrail-webui/common/npm-sources/sinon-1.17.2.tar.gz
new file mode 100644
index 0000000..e3c0da8
--- /dev/null
+++ b/contrail-webui/common/npm-sources/sinon-1.17.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/ubuntu/bootstrap-sass-3.3.6.tar.gz b/contrail-webui/common/npm-sources/ubuntu/bootstrap-sass-3.3.6.tar.gz
new file mode 100644
index 0000000..69d0b0b
--- /dev/null
+++ b/contrail-webui/common/npm-sources/ubuntu/bootstrap-sass-3.3.6.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/ubuntu/node-sass-3.8.0.tar.gz b/contrail-webui/common/npm-sources/ubuntu/node-sass-3.8.0.tar.gz
new file mode 100644
index 0000000..42d67c2
--- /dev/null
+++ b/contrail-webui/common/npm-sources/ubuntu/node-sass-3.8.0.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/ubuntu/nodejs-driver-3.0.2.tar.gz b/contrail-webui/common/npm-sources/ubuntu/nodejs-driver-3.0.2.tar.gz
new file mode 100644
index 0000000..25fdb0c
--- /dev/null
+++ b/contrail-webui/common/npm-sources/ubuntu/nodejs-driver-3.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/ubuntu/webworker-threads-0.7.4.tar.gz b/contrail-webui/common/npm-sources/ubuntu/webworker-threads-0.7.4.tar.gz
new file mode 100644
index 0000000..eb6687c
--- /dev/null
+++ b/contrail-webui/common/npm-sources/ubuntu/webworker-threads-0.7.4.tar.gz
Binary files differ
diff --git a/contrail-webui/common/npm-sources/webworker-threads-0.7.4.tar.gz b/contrail-webui/common/npm-sources/webworker-threads-0.7.4.tar.gz
new file mode 100644
index 0000000..4c569a9
--- /dev/null
+++ b/contrail-webui/common/npm-sources/webworker-threads-0.7.4.tar.gz
Binary files differ
diff --git a/contrail-webui/common/paulkinzett-toolbar-1.0.0-49-gfbfde3e.zip b/contrail-webui/common/paulkinzett-toolbar-1.0.0-49-gfbfde3e.zip
new file mode 100644
index 0000000..b32bbfe
--- /dev/null
+++ b/contrail-webui/common/paulkinzett-toolbar-1.0.0-49-gfbfde3e.zip
Binary files differ
diff --git a/contrail-webui/common/phantomjs-1.9.18.tar.gz b/contrail-webui/common/phantomjs-1.9.18.tar.gz
new file mode 100644
index 0000000..aa5ce7c
--- /dev/null
+++ b/contrail-webui/common/phantomjs-1.9.18.tar.gz
Binary files differ
diff --git a/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-linux-i686.tar.bz2 b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-linux-i686.tar.bz2
new file mode 100644
index 0000000..bbb4e64
--- /dev/null
+++ b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-linux-i686.tar.bz2
Binary files differ
diff --git a/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-linux-x86_64.tar.bz2 b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-linux-x86_64.tar.bz2
new file mode 100644
index 0000000..2543ea7
--- /dev/null
+++ b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-linux-x86_64.tar.bz2
Binary files differ
diff --git a/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-macosx.zip b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-macosx.zip
new file mode 100644
index 0000000..f8d3771
--- /dev/null
+++ b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-macosx.zip
Binary files differ
diff --git a/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-windows.zip b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-windows.zip
new file mode 100644
index 0000000..6817081
--- /dev/null
+++ b/contrail-webui/common/phantomjs-bin/phantomjs-1.9.8-windows.zip
Binary files differ
diff --git a/contrail-webui/controller/DXI1ORHCpsQm3Vp6mXoaTaRDOzjiPcYnFooOUGCOsRk.woff b/contrail-webui/controller/DXI1ORHCpsQm3Vp6mXoaTaRDOzjiPcYnFooOUGCOsRk.woff
new file mode 100644
index 0000000..eb601d7
--- /dev/null
+++ b/contrail-webui/controller/DXI1ORHCpsQm3Vp6mXoaTaRDOzjiPcYnFooOUGCOsRk.woff
Binary files differ
diff --git a/contrail-webui/controller/EInbV5DfGHOiMmvb1Xr-hqRDOzjiPcYnFooOUGCOsRk.woff b/contrail-webui/controller/EInbV5DfGHOiMmvb1Xr-hqRDOzjiPcYnFooOUGCOsRk.woff
new file mode 100644
index 0000000..7a2e352
--- /dev/null
+++ b/contrail-webui/controller/EInbV5DfGHOiMmvb1Xr-hqRDOzjiPcYnFooOUGCOsRk.woff
Binary files differ
diff --git a/contrail-webui/controller/Font-Awesome-4.3.0.tar.gz b/contrail-webui/controller/Font-Awesome-4.3.0.tar.gz
new file mode 100644
index 0000000..3e8d9c2
--- /dev/null
+++ b/contrail-webui/controller/Font-Awesome-4.3.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/Font-Awesome-4.6.3.tar.gz b/contrail-webui/controller/Font-Awesome-4.6.3.tar.gz
new file mode 100644
index 0000000..4302d7f
--- /dev/null
+++ b/contrail-webui/controller/Font-Awesome-4.6.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/JSONPath-0.9.1.tgz b/contrail-webui/controller/JSONPath-0.9.1.tgz
new file mode 100644
index 0000000..0a09d03
--- /dev/null
+++ b/contrail-webui/controller/JSONPath-0.9.1.tgz
Binary files differ
diff --git a/contrail-webui/controller/MTP_ySUJH_bn48VBG8sNSqRDOzjiPcYnFooOUGCOsRk.woff b/contrail-webui/controller/MTP_ySUJH_bn48VBG8sNSqRDOzjiPcYnFooOUGCOsRk.woff
new file mode 100644
index 0000000..56c4494
--- /dev/null
+++ b/contrail-webui/controller/MTP_ySUJH_bn48VBG8sNSqRDOzjiPcYnFooOUGCOsRk.woff
Binary files differ
diff --git a/contrail-webui/controller/PRmiXeptR36kaC0GEAetxhbnBKKEOwRKgsHDreGcocg.woff b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxhbnBKKEOwRKgsHDreGcocg.woff
new file mode 100644
index 0000000..a4e29c0
--- /dev/null
+++ b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxhbnBKKEOwRKgsHDreGcocg.woff
Binary files differ
diff --git a/contrail-webui/controller/PRmiXeptR36kaC0GEAetxsBo4hlZyBvkZICS3KpNonM.woff b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxsBo4hlZyBvkZICS3KpNonM.woff
new file mode 100644
index 0000000..ce3ab2e
--- /dev/null
+++ b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxsBo4hlZyBvkZICS3KpNonM.woff
Binary files differ
diff --git a/contrail-webui/controller/PRmiXeptR36kaC0GEAetxuw_rQOTGi-AJs5XCWaKIhU.woff b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxuw_rQOTGi-AJs5XCWaKIhU.woff
new file mode 100644
index 0000000..3a439fc
--- /dev/null
+++ b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxuw_rQOTGi-AJs5XCWaKIhU.woff
Binary files differ
diff --git a/contrail-webui/controller/PRmiXeptR36kaC0GEAetxvR_54zmj3SbGZQh3vCOwvY.woff b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxvR_54zmj3SbGZQh3vCOwvY.woff
new file mode 100644
index 0000000..3f9f088
--- /dev/null
+++ b/contrail-webui/controller/PRmiXeptR36kaC0GEAetxvR_54zmj3SbGZQh3vCOwvY.woff
Binary files differ
diff --git a/contrail-webui/controller/Sinon.JS-v1.8.1.tar.gz b/contrail-webui/controller/Sinon.JS-v1.8.1.tar.gz
new file mode 100644
index 0000000..d07a7d4
--- /dev/null
+++ b/contrail-webui/controller/Sinon.JS-v1.8.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/SlickGrid-master.tar.gz b/contrail-webui/controller/SlickGrid-master.tar.gz
new file mode 100644
index 0000000..3fa8b12
--- /dev/null
+++ b/contrail-webui/controller/SlickGrid-master.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/SlickGridEnhancementPager-master.zip b/contrail-webui/controller/SlickGridEnhancementPager-master.zip
new file mode 100644
index 0000000..f9f0afd
--- /dev/null
+++ b/contrail-webui/controller/SlickGridEnhancementPager-master.zip
Binary files differ
diff --git a/contrail-webui/controller/async-0.1.22.tgz b/contrail-webui/controller/async-0.1.22.tgz
new file mode 100644
index 0000000..1de7298
--- /dev/null
+++ b/contrail-webui/controller/async-0.1.22.tgz
Binary files differ
diff --git a/contrail-webui/controller/axon-0.5.0.tgz b/contrail-webui/controller/axon-0.5.0.tgz
new file mode 100644
index 0000000..ef04bc7
--- /dev/null
+++ b/contrail-webui/controller/axon-0.5.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/backbone-1.3.3.tar.gz b/contrail-webui/controller/backbone-1.3.3.tar.gz
new file mode 100644
index 0000000..c8c9479
--- /dev/null
+++ b/contrail-webui/controller/backbone-1.3.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/bezierjs.tar.gz b/contrail-webui/controller/bezierjs.tar.gz
new file mode 100644
index 0000000..2d95748
--- /dev/null
+++ b/contrail-webui/controller/bezierjs.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/body-parser-1.19.0.tar.gz b/contrail-webui/controller/body-parser-1.19.0.tar.gz
new file mode 100644
index 0000000..ca77d9c
--- /dev/null
+++ b/contrail-webui/controller/body-parser-1.19.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/bootstrap-3.3.6.tar.gz b/contrail-webui/controller/bootstrap-3.3.6.tar.gz
new file mode 100644
index 0000000..287af1d
--- /dev/null
+++ b/contrail-webui/controller/bootstrap-3.3.6.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/bootstrap-daterangepicker-2.1.27.tar.gz b/contrail-webui/controller/bootstrap-daterangepicker-2.1.27.tar.gz
new file mode 100644
index 0000000..b15953d
--- /dev/null
+++ b/contrail-webui/controller/bootstrap-daterangepicker-2.1.27.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/bootstrap-sass-3.3.6.tar.gz b/contrail-webui/controller/bootstrap-sass-3.3.6.tar.gz
new file mode 100644
index 0000000..cc97aa5
--- /dev/null
+++ b/contrail-webui/controller/bootstrap-sass-3.3.6.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/bootstrap-v2.3.2.zip b/contrail-webui/controller/bootstrap-v2.3.2.zip
new file mode 100644
index 0000000..47536ba
--- /dev/null
+++ b/contrail-webui/controller/bootstrap-v2.3.2.zip
Binary files differ
diff --git a/contrail-webui/controller/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff b/contrail-webui/controller/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff
new file mode 100644
index 0000000..77706fa
--- /dev/null
+++ b/contrail-webui/controller/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff
Binary files differ
diff --git a/contrail-webui/controller/cluster-0.7.7.tgz b/contrail-webui/controller/cluster-0.7.7.tgz
new file mode 100644
index 0000000..d04132e
--- /dev/null
+++ b/contrail-webui/controller/cluster-0.7.7.tgz
Binary files differ
diff --git a/contrail-webui/controller/compression-1.7.4.tar.gz b/contrail-webui/controller/compression-1.7.4.tar.gz
new file mode 100644
index 0000000..0922dbc
--- /dev/null
+++ b/contrail-webui/controller/compression-1.7.4.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/connect-redis-1.4.5.tgz b/contrail-webui/controller/connect-redis-1.4.5.tgz
new file mode 100644
index 0000000..4e64263
--- /dev/null
+++ b/contrail-webui/controller/connect-redis-1.4.5.tgz
Binary files differ
diff --git a/contrail-webui/controller/connect-redis-2.5.1.tar.gz b/contrail-webui/controller/connect-redis-2.5.1.tar.gz
new file mode 100644
index 0000000..f2c419a
--- /dev/null
+++ b/contrail-webui/controller/connect-redis-2.5.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/cookie-parser-1.4.4.tar.gz b/contrail-webui/controller/cookie-parser-1.4.4.tar.gz
new file mode 100644
index 0000000..24b6cfb
--- /dev/null
+++ b/contrail-webui/controller/cookie-parser-1.4.4.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/crossfilter-1.3.11.tar.gz b/contrail-webui/controller/crossfilter-1.3.11.tar.gz
new file mode 100644
index 0000000..172ec37
--- /dev/null
+++ b/contrail-webui/controller/crossfilter-1.3.11.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/crossfilter-v1.2.0.tar.gz b/contrail-webui/controller/crossfilter-v1.2.0.tar.gz
new file mode 100644
index 0000000..ed666cb
--- /dev/null
+++ b/contrail-webui/controller/crossfilter-v1.2.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/crypto-0.0.3.tgz b/contrail-webui/controller/crypto-0.0.3.tgz
new file mode 100644
index 0000000..089e461
--- /dev/null
+++ b/contrail-webui/controller/crypto-0.0.3.tgz
Binary files differ
diff --git a/contrail-webui/controller/csurf-1.10.0.tar.gz b/contrail-webui/controller/csurf-1.10.0.tar.gz
new file mode 100644
index 0000000..e0ce277
--- /dev/null
+++ b/contrail-webui/controller/csurf-1.10.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/d3-3.5.6.tar.gz b/contrail-webui/controller/d3-3.5.6.tar.gz
new file mode 100644
index 0000000..ba3f657
--- /dev/null
+++ b/contrail-webui/controller/d3-3.5.6.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/d3-v3.2.1.tar.gz b/contrail-webui/controller/d3-v3.2.1.tar.gz
new file mode 100644
index 0000000..fd4bc1f
--- /dev/null
+++ b/contrail-webui/controller/d3-v3.2.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/dagre-0.7.1.tar.gz b/contrail-webui/controller/dagre-0.7.1.tar.gz
new file mode 100644
index 0000000..55e8296
--- /dev/null
+++ b/contrail-webui/controller/dagre-0.7.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/data2xml-0.9.0.tgz b/contrail-webui/controller/data2xml-0.9.0.tgz
new file mode 100644
index 0000000..ebfb679
--- /dev/null
+++ b/contrail-webui/controller/data2xml-0.9.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/datetimepicker-2.1.9.tar.gz b/contrail-webui/controller/datetimepicker-2.1.9.tar.gz
new file mode 100644
index 0000000..ab6eb06
--- /dev/null
+++ b/contrail-webui/controller/datetimepicker-2.1.9.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/datetimepicker-2.4.5.tar.gz b/contrail-webui/controller/datetimepicker-2.4.5.tar.gz
new file mode 100644
index 0000000..9a23bcd
--- /dev/null
+++ b/contrail-webui/controller/datetimepicker-2.4.5.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/debug-0.7.0.tgz b/contrail-webui/controller/debug-0.7.0.tgz
new file mode 100644
index 0000000..6d96f55
--- /dev/null
+++ b/contrail-webui/controller/debug-0.7.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/express-3.0.3.tgz b/contrail-webui/controller/express-3.0.3.tgz
new file mode 100644
index 0000000..6773a3a
--- /dev/null
+++ b/contrail-webui/controller/express-3.0.3.tgz
Binary files differ
diff --git a/contrail-webui/controller/express-4.8.8.tar.gz b/contrail-webui/controller/express-4.8.8.tar.gz
new file mode 100644
index 0000000..c258a30
--- /dev/null
+++ b/contrail-webui/controller/express-4.8.8.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/express-session-1.16.2.tar.gz b/contrail-webui/controller/express-session-1.16.2.tar.gz
new file mode 100644
index 0000000..806ddba
--- /dev/null
+++ b/contrail-webui/controller/express-session-1.16.2.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/font-awesome-3.2.1.zip b/contrail-webui/controller/font-awesome-3.2.1.zip
new file mode 100644
index 0000000..9b9abdc
--- /dev/null
+++ b/contrail-webui/controller/font-awesome-3.2.1.zip
Binary files differ
diff --git a/contrail-webui/controller/grunt-0.4.2.tgz b/contrail-webui/controller/grunt-0.4.2.tgz
new file mode 100644
index 0000000..48a3a2f
--- /dev/null
+++ b/contrail-webui/controller/grunt-0.4.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/grunt-blanket-qunit-0.2.0.tgz b/contrail-webui/controller/grunt-blanket-qunit-0.2.0.tgz
new file mode 100644
index 0000000..09cf44e
--- /dev/null
+++ b/contrail-webui/controller/grunt-blanket-qunit-0.2.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/grunt-cli-0.1.13.tgz b/contrail-webui/controller/grunt-cli-0.1.13.tgz
new file mode 100644
index 0000000..1c7fa1f
--- /dev/null
+++ b/contrail-webui/controller/grunt-cli-0.1.13.tgz
Binary files differ
diff --git a/contrail-webui/controller/grunt-contrib-concat-0.3.0.tgz b/contrail-webui/controller/grunt-contrib-concat-0.3.0.tgz
new file mode 100644
index 0000000..bceb0f0
--- /dev/null
+++ b/contrail-webui/controller/grunt-contrib-concat-0.3.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/grunt-contrib-qunit-0.3.0.tgz b/contrail-webui/controller/grunt-contrib-qunit-0.3.0.tgz
new file mode 100644
index 0000000..67194e3
--- /dev/null
+++ b/contrail-webui/controller/grunt-contrib-qunit-0.3.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/grunt-karma-0.6.2.tgz b/contrail-webui/controller/grunt-karma-0.6.2.tgz
new file mode 100644
index 0000000..d1b9f97
--- /dev/null
+++ b/contrail-webui/controller/grunt-karma-0.6.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/grunt-node-qunit-2.0.2.tgz b/contrail-webui/controller/grunt-node-qunit-2.0.2.tgz
new file mode 100644
index 0000000..437031c
--- /dev/null
+++ b/contrail-webui/controller/grunt-node-qunit-2.0.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/grunt-qunit-junit-0.1.0.tgz b/contrail-webui/controller/grunt-qunit-junit-0.1.0.tgz
new file mode 100644
index 0000000..54531be
--- /dev/null
+++ b/contrail-webui/controller/grunt-qunit-junit-0.1.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/handlebars-v1.3.0.js b/contrail-webui/controller/handlebars-v1.3.0.js
new file mode 100644
index 0000000..bec7085
--- /dev/null
+++ b/contrail-webui/controller/handlebars-v1.3.0.js
@@ -0,0 +1,2746 @@
+/*!
+
+ handlebars v1.3.0
+
+Copyright (C) 2011 by Yehuda Katz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+@license
+*/
+/* exported Handlebars */
+var Handlebars = (function() {
+// handlebars/safe-string.js
+var __module4__ = (function() {
+ "use strict";
+ var __exports__;
+ // Build out our basic SafeString type
+ function SafeString(string) {
+ this.string = string;
+ }
+
+ SafeString.prototype.toString = function() {
+ return "" + this.string;
+ };
+
+ __exports__ = SafeString;
+ return __exports__;
+})();
+
+// handlebars/utils.js
+var __module3__ = (function(__dependency1__) {
+ "use strict";
+ var __exports__ = {};
+ /*jshint -W004 */
+ var SafeString = __dependency1__;
+
+ var escape = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ '"': """,
+ "'": "'",
+ "`": "`"
+ };
+
+ var badChars = /[&<>"'`]/g;
+ var possible = /[&<>"'`]/;
+
+ function escapeChar(chr) {
+ return escape[chr] || "&";
+ }
+
+ function extend(obj, value) {
+ for(var key in value) {
+ if(Object.prototype.hasOwnProperty.call(value, key)) {
+ obj[key] = value[key];
+ }
+ }
+ }
+
+ __exports__.extend = extend;var toString = Object.prototype.toString;
+ __exports__.toString = toString;
+ // Sourced from lodash
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
+ var isFunction = function(value) {
+ return typeof value === 'function';
+ };
+ // fallback for older versions of Chrome and Safari
+ if (isFunction(/x/)) {
+ isFunction = function(value) {
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
+ };
+ }
+ var isFunction;
+ __exports__.isFunction = isFunction;
+ var isArray = Array.isArray || function(value) {
+ return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
+ };
+ __exports__.isArray = isArray;
+
+ function escapeExpression(string) {
+ // don't escape SafeStrings, since they're already safe
+ if (string instanceof SafeString) {
+ return string.toString();
+ } else if (!string && string !== 0) {
+ return "";
+ }
+
+ // Force a string conversion as this will be done by the append regardless and
+ // the regex test will do this transparently behind the scenes, causing issues if
+ // an object's to string has escaped characters in it.
+ string = "" + string;
+
+ if(!possible.test(string)) { return string; }
+ return string.replace(badChars, escapeChar);
+ }
+
+ __exports__.escapeExpression = escapeExpression;function isEmpty(value) {
+ if (!value && value !== 0) {
+ return true;
+ } else if (isArray(value) && value.length === 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ __exports__.isEmpty = isEmpty;
+ return __exports__;
+})(__module4__);
+
+// handlebars/exception.js
+var __module5__ = (function() {
+ "use strict";
+ var __exports__;
+
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
+
+ function Exception(message, node) {
+ var line;
+ if (node && node.firstLine) {
+ line = node.firstLine;
+
+ message += ' - ' + line + ':' + node.firstColumn;
+ }
+
+ var tmp = Error.prototype.constructor.call(this, message);
+
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
+ for (var idx = 0; idx < errorProps.length; idx++) {
+ this[errorProps[idx]] = tmp[errorProps[idx]];
+ }
+
+ if (line) {
+ this.lineNumber = line;
+ this.column = node.firstColumn;
+ }
+ }
+
+ Exception.prototype = new Error();
+
+ __exports__ = Exception;
+ return __exports__;
+})();
+
+// handlebars/base.js
+var __module2__ = (function(__dependency1__, __dependency2__) {
+ "use strict";
+ var __exports__ = {};
+ var Utils = __dependency1__;
+ var Exception = __dependency2__;
+
+ var VERSION = "1.3.0";
+ __exports__.VERSION = VERSION;var COMPILER_REVISION = 4;
+ __exports__.COMPILER_REVISION = COMPILER_REVISION;
+ var REVISION_CHANGES = {
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
+ 2: '== 1.0.0-rc.3',
+ 3: '== 1.0.0-rc.4',
+ 4: '>= 1.0.0'
+ };
+ __exports__.REVISION_CHANGES = REVISION_CHANGES;
+ var isArray = Utils.isArray,
+ isFunction = Utils.isFunction,
+ toString = Utils.toString,
+ objectType = '[object Object]';
+
+ function HandlebarsEnvironment(helpers, partials) {
+ this.helpers = helpers || {};
+ this.partials = partials || {};
+
+ registerDefaultHelpers(this);
+ }
+
+ __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
+ constructor: HandlebarsEnvironment,
+
+ logger: logger,
+ log: log,
+
+ registerHelper: function(name, fn, inverse) {
+ if (toString.call(name) === objectType) {
+ if (inverse || fn) { throw new Exception('Arg not supported with multiple helpers'); }
+ Utils.extend(this.helpers, name);
+ } else {
+ if (inverse) { fn.not = inverse; }
+ this.helpers[name] = fn;
+ }
+ },
+
+ registerPartial: function(name, str) {
+ if (toString.call(name) === objectType) {
+ Utils.extend(this.partials, name);
+ } else {
+ this.partials[name] = str;
+ }
+ }
+ };
+
+ function registerDefaultHelpers(instance) {
+ instance.registerHelper('helperMissing', function(arg) {
+ if(arguments.length === 2) {
+ return undefined;
+ } else {
+ throw new Exception("Missing helper: '" + arg + "'");
+ }
+ });
+
+ instance.registerHelper('blockHelperMissing', function(context, options) {
+ var inverse = options.inverse || function() {}, fn = options.fn;
+
+ if (isFunction(context)) { context = context.call(this); }
+
+ if(context === true) {
+ return fn(this);
+ } else if(context === false || context == null) {
+ return inverse(this);
+ } else if (isArray(context)) {
+ if(context.length > 0) {
+ return instance.helpers.each(context, options);
+ } else {
+ return inverse(this);
+ }
+ } else {
+ return fn(context);
+ }
+ });
+
+ instance.registerHelper('each', function(context, options) {
+ var fn = options.fn, inverse = options.inverse;
+ var i = 0, ret = "", data;
+
+ if (isFunction(context)) { context = context.call(this); }
+
+ if (options.data) {
+ data = createFrame(options.data);
+ }
+
+ if(context && typeof context === 'object') {
+ if (isArray(context)) {
+ for(var j = context.length; i<j; i++) {
+ if (data) {
+ data.index = i;
+ data.first = (i === 0);
+ data.last = (i === (context.length-1));
+ }
+ ret = ret + fn(context[i], { data: data });
+ }
+ } else {
+ for(var key in context) {
+ if(context.hasOwnProperty(key)) {
+ if(data) {
+ data.key = key;
+ data.index = i;
+ data.first = (i === 0);
+ }
+ ret = ret + fn(context[key], {data: data});
+ i++;
+ }
+ }
+ }
+ }
+
+ if(i === 0){
+ ret = inverse(this);
+ }
+
+ return ret;
+ });
+
+ instance.registerHelper('if', function(conditional, options) {
+ if (isFunction(conditional)) { conditional = conditional.call(this); }
+
+ // Default behavior is to render the positive path if the value is truthy and not empty.
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
+ if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+ });
+
+ instance.registerHelper('unless', function(conditional, options) {
+ return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
+ });
+
+ instance.registerHelper('with', function(context, options) {
+ if (isFunction(context)) { context = context.call(this); }
+
+ if (!Utils.isEmpty(context)) return options.fn(context);
+ });
+
+ instance.registerHelper('log', function(context, options) {
+ var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
+ instance.log(level, context);
+ });
+ }
+
+ var logger = {
+ methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
+
+ // State enum
+ DEBUG: 0,
+ INFO: 1,
+ WARN: 2,
+ ERROR: 3,
+ level: 3,
+
+ // can be overridden in the host environment
+ log: function(level, obj) {
+ if (logger.level <= level) {
+ var method = logger.methodMap[level];
+ if (typeof console !== 'undefined' && console[method]) {
+ console[method].call(console, obj);
+ }
+ }
+ }
+ };
+ __exports__.logger = logger;
+ function log(level, obj) { logger.log(level, obj); }
+
+ __exports__.log = log;var createFrame = function(object) {
+ var obj = {};
+ Utils.extend(obj, object);
+ return obj;
+ };
+ __exports__.createFrame = createFrame;
+ return __exports__;
+})(__module3__, __module5__);
+
+// handlebars/runtime.js
+var __module6__ = (function(__dependency1__, __dependency2__, __dependency3__) {
+ "use strict";
+ var __exports__ = {};
+ var Utils = __dependency1__;
+ var Exception = __dependency2__;
+ var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
+ var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
+
+ function checkRevision(compilerInfo) {
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
+ currentRevision = COMPILER_REVISION;
+
+ if (compilerRevision !== currentRevision) {
+ if (compilerRevision < currentRevision) {
+ var runtimeVersions = REVISION_CHANGES[currentRevision],
+ compilerVersions = REVISION_CHANGES[compilerRevision];
+ throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
+ "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
+ } else {
+ // Use the embedded version info since the runtime doesn't know about this revision yet
+ throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
+ "Please update your runtime to a newer version ("+compilerInfo[1]+").");
+ }
+ }
+ }
+
+ __exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
+
+ function template(templateSpec, env) {
+ if (!env) {
+ throw new Exception("No environment passed to template");
+ }
+
+ // Note: Using env.VM references rather than local var references throughout this section to allow
+ // for external users to override these as psuedo-supported APIs.
+ var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
+ var result = env.VM.invokePartial.apply(this, arguments);
+ if (result != null) { return result; }
+
+ if (env.compile) {
+ var options = { helpers: helpers, partials: partials, data: data };
+ partials[name] = env.compile(partial, { data: data !== undefined }, env);
+ return partials[name](context, options);
+ } else {
+ throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
+ }
+ };
+
+ // Just add water
+ var container = {
+ escapeExpression: Utils.escapeExpression,
+ invokePartial: invokePartialWrapper,
+ programs: [],
+ program: function(i, fn, data) {
+ var programWrapper = this.programs[i];
+ if(data) {
+ programWrapper = program(i, fn, data);
+ } else if (!programWrapper) {
+ programWrapper = this.programs[i] = program(i, fn);
+ }
+ return programWrapper;
+ },
+ merge: function(param, common) {
+ var ret = param || common;
+
+ if (param && common && (param !== common)) {
+ ret = {};
+ Utils.extend(ret, common);
+ Utils.extend(ret, param);
+ }
+ return ret;
+ },
+ programWithDepth: env.VM.programWithDepth,
+ noop: env.VM.noop,
+ compilerInfo: null
+ };
+
+ return function(context, options) {
+ options = options || {};
+ var namespace = options.partial ? options : env,
+ helpers,
+ partials;
+
+ if (!options.partial) {
+ helpers = options.helpers;
+ partials = options.partials;
+ }
+ var result = templateSpec.call(
+ container,
+ namespace, context,
+ helpers,
+ partials,
+ options.data);
+
+ if (!options.partial) {
+ env.VM.checkRevision(container.compilerInfo);
+ }
+
+ return result;
+ };
+ }
+
+ __exports__.template = template;function programWithDepth(i, fn, data /*, $depth */) {
+ var args = Array.prototype.slice.call(arguments, 3);
+
+ var prog = function(context, options) {
+ options = options || {};
+
+ return fn.apply(this, [context, options.data || data].concat(args));
+ };
+ prog.program = i;
+ prog.depth = args.length;
+ return prog;
+ }
+
+ __exports__.programWithDepth = programWithDepth;function program(i, fn, data) {
+ var prog = function(context, options) {
+ options = options || {};
+
+ return fn(context, options.data || data);
+ };
+ prog.program = i;
+ prog.depth = 0;
+ return prog;
+ }
+
+ __exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data) {
+ var options = { partial: true, helpers: helpers, partials: partials, data: data };
+
+ if(partial === undefined) {
+ throw new Exception("The partial " + name + " could not be found");
+ } else if(partial instanceof Function) {
+ return partial(context, options);
+ }
+ }
+
+ __exports__.invokePartial = invokePartial;function noop() { return ""; }
+
+ __exports__.noop = noop;
+ return __exports__;
+})(__module3__, __module5__, __module2__);
+
+// handlebars.runtime.js
+var __module1__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
+ "use strict";
+ var __exports__;
+ /*globals Handlebars: true */
+ var base = __dependency1__;
+
+ // Each of these augment the Handlebars object. No need to setup here.
+ // (This is done to easily share code between commonjs and browse envs)
+ var SafeString = __dependency2__;
+ var Exception = __dependency3__;
+ var Utils = __dependency4__;
+ var runtime = __dependency5__;
+
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
+ var create = function() {
+ var hb = new base.HandlebarsEnvironment();
+
+ Utils.extend(hb, base);
+ hb.SafeString = SafeString;
+ hb.Exception = Exception;
+ hb.Utils = Utils;
+
+ hb.VM = runtime;
+ hb.template = function(spec) {
+ return runtime.template(spec, hb);
+ };
+
+ return hb;
+ };
+
+ var Handlebars = create();
+ Handlebars.create = create;
+
+ __exports__ = Handlebars;
+ return __exports__;
+})(__module2__, __module4__, __module5__, __module3__, __module6__);
+
+// handlebars/compiler/ast.js
+var __module7__ = (function(__dependency1__) {
+ "use strict";
+ var __exports__;
+ var Exception = __dependency1__;
+
+ function LocationInfo(locInfo){
+ locInfo = locInfo || {};
+ this.firstLine = locInfo.first_line;
+ this.firstColumn = locInfo.first_column;
+ this.lastColumn = locInfo.last_column;
+ this.lastLine = locInfo.last_line;
+ }
+
+ var AST = {
+ ProgramNode: function(statements, inverseStrip, inverse, locInfo) {
+ var inverseLocationInfo, firstInverseNode;
+ if (arguments.length === 3) {
+ locInfo = inverse;
+ inverse = null;
+ } else if (arguments.length === 2) {
+ locInfo = inverseStrip;
+ inverseStrip = null;
+ }
+
+ LocationInfo.call(this, locInfo);
+ this.type = "program";
+ this.statements = statements;
+ this.strip = {};
+
+ if(inverse) {
+ firstInverseNode = inverse[0];
+ if (firstInverseNode) {
+ inverseLocationInfo = {
+ first_line: firstInverseNode.firstLine,
+ last_line: firstInverseNode.lastLine,
+ last_column: firstInverseNode.lastColumn,
+ first_column: firstInverseNode.firstColumn
+ };
+ this.inverse = new AST.ProgramNode(inverse, inverseStrip, inverseLocationInfo);
+ } else {
+ this.inverse = new AST.ProgramNode(inverse, inverseStrip);
+ }
+ this.strip.right = inverseStrip.left;
+ } else if (inverseStrip) {
+ this.strip.left = inverseStrip.right;
+ }
+ },
+
+ MustacheNode: function(rawParams, hash, open, strip, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "mustache";
+ this.strip = strip;
+
+ // Open may be a string parsed from the parser or a passed boolean flag
+ if (open != null && open.charAt) {
+ // Must use charAt to support IE pre-10
+ var escapeFlag = open.charAt(3) || open.charAt(2);
+ this.escaped = escapeFlag !== '{' && escapeFlag !== '&';
+ } else {
+ this.escaped = !!open;
+ }
+
+ if (rawParams instanceof AST.SexprNode) {
+ this.sexpr = rawParams;
+ } else {
+ // Support old AST API
+ this.sexpr = new AST.SexprNode(rawParams, hash);
+ }
+
+ this.sexpr.isRoot = true;
+
+ // Support old AST API that stored this info in MustacheNode
+ this.id = this.sexpr.id;
+ this.params = this.sexpr.params;
+ this.hash = this.sexpr.hash;
+ this.eligibleHelper = this.sexpr.eligibleHelper;
+ this.isHelper = this.sexpr.isHelper;
+ },
+
+ SexprNode: function(rawParams, hash, locInfo) {
+ LocationInfo.call(this, locInfo);
+
+ this.type = "sexpr";
+ this.hash = hash;
+
+ var id = this.id = rawParams[0];
+ var params = this.params = rawParams.slice(1);
+
+ // a mustache is an eligible helper if:
+ // * its id is simple (a single part, not `this` or `..`)
+ var eligibleHelper = this.eligibleHelper = id.isSimple;
+
+ // a mustache is definitely a helper if:
+ // * it is an eligible helper, and
+ // * it has at least one parameter or hash segment
+ this.isHelper = eligibleHelper && (params.length || hash);
+
+ // if a mustache is an eligible helper but not a definite
+ // helper, it is ambiguous, and will be resolved in a later
+ // pass or at runtime.
+ },
+
+ PartialNode: function(partialName, context, strip, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "partial";
+ this.partialName = partialName;
+ this.context = context;
+ this.strip = strip;
+ },
+
+ BlockNode: function(mustache, program, inverse, close, locInfo) {
+ LocationInfo.call(this, locInfo);
+
+ if(mustache.sexpr.id.original !== close.path.original) {
+ throw new Exception(mustache.sexpr.id.original + " doesn't match " + close.path.original, this);
+ }
+
+ this.type = 'block';
+ this.mustache = mustache;
+ this.program = program;
+ this.inverse = inverse;
+
+ this.strip = {
+ left: mustache.strip.left,
+ right: close.strip.right
+ };
+
+ (program || inverse).strip.left = mustache.strip.right;
+ (inverse || program).strip.right = close.strip.left;
+
+ if (inverse && !program) {
+ this.isInverse = true;
+ }
+ },
+
+ ContentNode: function(string, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "content";
+ this.string = string;
+ },
+
+ HashNode: function(pairs, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "hash";
+ this.pairs = pairs;
+ },
+
+ IdNode: function(parts, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "ID";
+
+ var original = "",
+ dig = [],
+ depth = 0;
+
+ for(var i=0,l=parts.length; i<l; i++) {
+ var part = parts[i].part;
+ original += (parts[i].separator || '') + part;
+
+ if (part === ".." || part === "." || part === "this") {
+ if (dig.length > 0) {
+ throw new Exception("Invalid path: " + original, this);
+ } else if (part === "..") {
+ depth++;
+ } else {
+ this.isScoped = true;
+ }
+ } else {
+ dig.push(part);
+ }
+ }
+
+ this.original = original;
+ this.parts = dig;
+ this.string = dig.join('.');
+ this.depth = depth;
+
+ // an ID is simple if it only has one part, and that part is not
+ // `..` or `this`.
+ this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
+
+ this.stringModeValue = this.string;
+ },
+
+ PartialNameNode: function(name, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "PARTIAL_NAME";
+ this.name = name.original;
+ },
+
+ DataNode: function(id, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "DATA";
+ this.id = id;
+ },
+
+ StringNode: function(string, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "STRING";
+ this.original =
+ this.string =
+ this.stringModeValue = string;
+ },
+
+ IntegerNode: function(integer, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "INTEGER";
+ this.original =
+ this.integer = integer;
+ this.stringModeValue = Number(integer);
+ },
+
+ BooleanNode: function(bool, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "BOOLEAN";
+ this.bool = bool;
+ this.stringModeValue = bool === "true";
+ },
+
+ CommentNode: function(comment, locInfo) {
+ LocationInfo.call(this, locInfo);
+ this.type = "comment";
+ this.comment = comment;
+ }
+ };
+
+ // Must be exported as an object rather than the root of the module as the jison lexer
+ // most modify the object to operate properly.
+ __exports__ = AST;
+ return __exports__;
+})(__module5__);
+
+// handlebars/compiler/parser.js
+var __module9__ = (function() {
+ "use strict";
+ var __exports__;
+ /* jshint ignore:start */
+ /* Jison generated parser */
+ var handlebars = (function(){
+ var parser = {trace: function trace() { },
+ yy: {},
+ symbols_: {"error":2,"root":3,"statements":4,"EOF":5,"program":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"sexpr":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"CLOSE_UNESCAPED":24,"OPEN_PARTIAL":25,"partialName":26,"partial_option0":27,"sexpr_repetition0":28,"sexpr_option0":29,"dataName":30,"param":31,"STRING":32,"INTEGER":33,"BOOLEAN":34,"OPEN_SEXPR":35,"CLOSE_SEXPR":36,"hash":37,"hash_repetition_plus0":38,"hashSegment":39,"ID":40,"EQUALS":41,"DATA":42,"pathSegments":43,"SEP":44,"$accept":0,"$end":1},
+ terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},
+ productions_: [0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],
+ performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 1: return new yy.ProgramNode($$[$0-1], this._$);
+ break;
+ case 2: return new yy.ProgramNode([], this._$);
+ break;
+ case 3:this.$ = new yy.ProgramNode([], $$[$0-1], $$[$0], this._$);
+ break;
+ case 4:this.$ = new yy.ProgramNode($$[$0-2], $$[$0-1], $$[$0], this._$);
+ break;
+ case 5:this.$ = new yy.ProgramNode($$[$0-1], $$[$0], [], this._$);
+ break;
+ case 6:this.$ = new yy.ProgramNode($$[$0], this._$);
+ break;
+ case 7:this.$ = new yy.ProgramNode([], this._$);
+ break;
+ case 8:this.$ = new yy.ProgramNode([], this._$);
+ break;
+ case 9:this.$ = [$$[$0]];
+ break;
+ case 10: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
+ break;
+ case 11:this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0], this._$);
+ break;
+ case 12:this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0], this._$);
+ break;
+ case 13:this.$ = $$[$0];
+ break;
+ case 14:this.$ = $$[$0];
+ break;
+ case 15:this.$ = new yy.ContentNode($$[$0], this._$);
+ break;
+ case 16:this.$ = new yy.CommentNode($$[$0], this._$);
+ break;
+ case 17:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
+ break;
+ case 18:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
+ break;
+ case 19:this.$ = {path: $$[$0-1], strip: stripFlags($$[$0-2], $$[$0])};
+ break;
+ case 20:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
+ break;
+ case 21:this.$ = new yy.MustacheNode($$[$0-1], null, $$[$0-2], stripFlags($$[$0-2], $$[$0]), this._$);
+ break;
+ case 22:this.$ = new yy.PartialNode($$[$0-2], $$[$0-1], stripFlags($$[$0-3], $$[$0]), this._$);
+ break;
+ case 23:this.$ = stripFlags($$[$0-1], $$[$0]);
+ break;
+ case 24:this.$ = new yy.SexprNode([$$[$0-2]].concat($$[$0-1]), $$[$0], this._$);
+ break;
+ case 25:this.$ = new yy.SexprNode([$$[$0]], null, this._$);
+ break;
+ case 26:this.$ = $$[$0];
+ break;
+ case 27:this.$ = new yy.StringNode($$[$0], this._$);
+ break;
+ case 28:this.$ = new yy.IntegerNode($$[$0], this._$);
+ break;
+ case 29:this.$ = new yy.BooleanNode($$[$0], this._$);
+ break;
+ case 30:this.$ = $$[$0];
+ break;
+ case 31:$$[$0-1].isHelper = true; this.$ = $$[$0-1];
+ break;
+ case 32:this.$ = new yy.HashNode($$[$0], this._$);
+ break;
+ case 33:this.$ = [$$[$0-2], $$[$0]];
+ break;
+ case 34:this.$ = new yy.PartialNameNode($$[$0], this._$);
+ break;
+ case 35:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0], this._$), this._$);
+ break;
+ case 36:this.$ = new yy.PartialNameNode(new yy.IntegerNode($$[$0], this._$));
+ break;
+ case 37:this.$ = new yy.DataNode($$[$0], this._$);
+ break;
+ case 38:this.$ = new yy.IdNode($$[$0], this._$);
+ break;
+ case 39: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2];
+ break;
+ case 40:this.$ = [{part: $$[$0]}];
+ break;
+ case 43:this.$ = [];
+ break;
+ case 44:$$[$0-1].push($$[$0]);
+ break;
+ case 47:this.$ = [$$[$0]];
+ break;
+ case 48:$$[$0-1].push($$[$0]);
+ break;
+ }
+ },
+ table: [{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],
+ defaultActions: {3:[2,2],16:[2,1],50:[2,42]},
+ parseError: function parseError(str, hash) {
+ throw new Error(str);
+ },
+ parse: function parse(input) {
+ var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
+ this.lexer.setInput(input);
+ this.lexer.yy = this.yy;
+ this.yy.lexer = this.lexer;
+ this.yy.parser = this;
+ if (typeof this.lexer.yylloc == "undefined")
+ this.lexer.yylloc = {};
+ var yyloc = this.lexer.yylloc;
+ lstack.push(yyloc);
+ var ranges = this.lexer.options && this.lexer.options.ranges;
+ if (typeof this.yy.parseError === "function")
+ this.parseError = this.yy.parseError;
+ function popStack(n) {
+ stack.length = stack.length - 2 * n;
+ vstack.length = vstack.length - n;
+ lstack.length = lstack.length - n;
+ }
+ function lex() {
+ var token;
+ token = self.lexer.lex() || 1;
+ if (typeof token !== "number") {
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ if (!recovering) {
+ expected = [];
+ for (p in table[state])
+ if (this.terminals_[p] && p > 2) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ if (this.lexer.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
+ }
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0)
+ recovering--;
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
+ if (ranges) {
+ yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
+ }
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+ }
+ };
+
+
+ function stripFlags(open, close) {
+ return {
+ left: open.charAt(2) === '~',
+ right: close.charAt(0) === '~' || close.charAt(1) === '~'
+ };
+ }
+
+ /* Jison generated lexer */
+ var lexer = (function(){
+ var lexer = ({EOF:1,
+ parseError:function parseError(str, hash) {
+ if (this.yy.parser) {
+ this.yy.parser.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+ setInput:function (input) {
+ this._input = input;
+ this._more = this._less = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = '';
+ this.conditionStack = ['INITIAL'];
+ this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
+ if (this.options.ranges) this.yylloc.range = [0,0];
+ this.offset = 0;
+ return this;
+ },
+ input:function () {
+ var ch = this._input[0];
+ this.yytext += ch;
+ this.yyleng++;
+ this.offset++;
+ this.match += ch;
+ this.matched += ch;
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno++;
+ this.yylloc.last_line++;
+ } else {
+ this.yylloc.last_column++;
+ }
+ if (this.options.ranges) this.yylloc.range[1]++;
+
+ this._input = this._input.slice(1);
+ return ch;
+ },
+ unput:function (ch) {
+ var len = ch.length;
+ var lines = ch.split(/(?:\r\n?|\n)/g);
+
+ this._input = ch + this._input;
+ this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
+ //this.yyleng -= len;
+ this.offset -= len;
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length-1);
+ this.matched = this.matched.substr(0, this.matched.length-1);
+
+ if (lines.length-1) this.yylineno -= lines.length-1;
+ var r = this.yylloc.range;
+
+ this.yylloc = {first_line: this.yylloc.first_line,
+ last_line: this.yylineno+1,
+ first_column: this.yylloc.first_column,
+ last_column: lines ?
+ (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
+ this.yylloc.first_column - len
+ };
+
+ if (this.options.ranges) {
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+ }
+ return this;
+ },
+ more:function () {
+ this._more = true;
+ return this;
+ },
+ less:function (n) {
+ this.unput(this.match.slice(n));
+ },
+ pastInput:function () {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
+ },
+ upcomingInput:function () {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20-next.length);
+ }
+ return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
+ },
+ showPosition:function () {
+ var pre = this.pastInput();
+ var c = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c+"^";
+ },
+ next:function () {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) this.done = true;
+
+ var token,
+ match,
+ tempMatch,
+ index,
+ col,
+ lines;
+ if (!this._more) {
+ this.yytext = '';
+ this.match = '';
+ }
+ var rules = this._currentRules();
+ for (var i=0;i < rules.length; i++) {
+ tempMatch = this._input.match(this.rules[rules[i]]);
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+ match = tempMatch;
+ index = i;
+ if (!this.options.flex) break;
+ }
+ }
+ if (match) {
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
+ if (lines) this.yylineno += lines.length;
+ this.yylloc = {first_line: this.yylloc.last_line,
+ last_line: this.yylineno+1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ if (this.options.ranges) {
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
+ }
+ this._more = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
+ if (this.done && this._input) this.done = false;
+ if (token) return token;
+ else return;
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
+ {text: "", token: null, line: this.yylineno});
+ }
+ },
+ lex:function lex() {
+ var r = this.next();
+ if (typeof r !== 'undefined') {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+ begin:function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+ popState:function popState() {
+ return this.conditionStack.pop();
+ },
+ _currentRules:function _currentRules() {
+ return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
+ },
+ topState:function () {
+ return this.conditionStack[this.conditionStack.length-2];
+ },
+ pushState:function begin(condition) {
+ this.begin(condition);
+ }});
+ lexer.options = {};
+ lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
+
+
+ function strip(start, end) {
+ return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
+ }
+
+
+ var YYSTATE=YY_START
+ switch($avoiding_name_collisions) {
+ case 0:
+ if(yy_.yytext.slice(-2) === "\\\\") {
+ strip(0,1);
+ this.begin("mu");
+ } else if(yy_.yytext.slice(-1) === "\\") {
+ strip(0,1);
+ this.begin("emu");
+ } else {
+ this.begin("mu");
+ }
+ if(yy_.yytext) return 14;
+
+ break;
+ case 1:return 14;
+ break;
+ case 2:
+ this.popState();
+ return 14;
+
+ break;
+ case 3:strip(0,4); this.popState(); return 15;
+ break;
+ case 4:return 35;
+ break;
+ case 5:return 36;
+ break;
+ case 6:return 25;
+ break;
+ case 7:return 16;
+ break;
+ case 8:return 20;
+ break;
+ case 9:return 19;
+ break;
+ case 10:return 19;
+ break;
+ case 11:return 23;
+ break;
+ case 12:return 22;
+ break;
+ case 13:this.popState(); this.begin('com');
+ break;
+ case 14:strip(3,5); this.popState(); return 15;
+ break;
+ case 15:return 22;
+ break;
+ case 16:return 41;
+ break;
+ case 17:return 40;
+ break;
+ case 18:return 40;
+ break;
+ case 19:return 44;
+ break;
+ case 20:// ignore whitespace
+ break;
+ case 21:this.popState(); return 24;
+ break;
+ case 22:this.popState(); return 18;
+ break;
+ case 23:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 32;
+ break;
+ case 24:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 32;
+ break;
+ case 25:return 42;
+ break;
+ case 26:return 34;
+ break;
+ case 27:return 34;
+ break;
+ case 28:return 33;
+ break;
+ case 29:return 40;
+ break;
+ case 30:yy_.yytext = strip(1,2); return 40;
+ break;
+ case 31:return 'INVALID';
+ break;
+ case 32:return 5;
+ break;
+ }
+ };
+ lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
+ lexer.conditions = {"mu":{"rules":[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"com":{"rules":[3],"inclusive":false},"INITIAL":{"rules":[0,1,32],"inclusive":true}};
+ return lexer;})()
+ parser.lexer = lexer;
+ function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
+ return new Parser;
+ })();__exports__ = handlebars;
+ /* jshint ignore:end */
+ return __exports__;
+})();
+
+// handlebars/compiler/base.js
+var __module8__ = (function(__dependency1__, __dependency2__) {
+ "use strict";
+ var __exports__ = {};
+ var parser = __dependency1__;
+ var AST = __dependency2__;
+
+ __exports__.parser = parser;
+
+ function parse(input) {
+ // Just return if an already-compile AST was passed in.
+ if(input.constructor === AST.ProgramNode) { return input; }
+
+ parser.yy = AST;
+ return parser.parse(input);
+ }
+
+ __exports__.parse = parse;
+ return __exports__;
+})(__module9__, __module7__);
+
+// handlebars/compiler/compiler.js
+var __module10__ = (function(__dependency1__) {
+ "use strict";
+ var __exports__ = {};
+ var Exception = __dependency1__;
+
+ function Compiler() {}
+
+ __exports__.Compiler = Compiler;// the foundHelper register will disambiguate helper lookup from finding a
+ // function in a context. This is necessary for mustache compatibility, which
+ // requires that context functions in blocks are evaluated by blockHelperMissing,
+ // and then proceed as if the resulting value was provided to blockHelperMissing.
+
+ Compiler.prototype = {
+ compiler: Compiler,
+
+ disassemble: function() {
+ var opcodes = this.opcodes, opcode, out = [], params, param;
+
+ for (var i=0, l=opcodes.length; i<l; i++) {
+ opcode = opcodes[i];
+
+ if (opcode.opcode === 'DECLARE') {
+ out.push("DECLARE " + opcode.name + "=" + opcode.value);
+ } else {
+ params = [];
+ for (var j=0; j<opcode.args.length; j++) {
+ param = opcode.args[j];
+ if (typeof param === "string") {
+ param = "\"" + param.replace("\n", "\\n") + "\"";
+ }
+ params.push(param);
+ }
+ out.push(opcode.opcode + " " + params.join(" "));
+ }
+ }
+
+ return out.join("\n");
+ },
+
+ equals: function(other) {
+ var len = this.opcodes.length;
+ if (other.opcodes.length !== len) {
+ return false;
+ }
+
+ for (var i = 0; i < len; i++) {
+ var opcode = this.opcodes[i],
+ otherOpcode = other.opcodes[i];
+ if (opcode.opcode !== otherOpcode.opcode || opcode.args.length !== otherOpcode.args.length) {
+ return false;
+ }
+ for (var j = 0; j < opcode.args.length; j++) {
+ if (opcode.args[j] !== otherOpcode.args[j]) {
+ return false;
+ }
+ }
+ }
+
+ len = this.children.length;
+ if (other.children.length !== len) {
+ return false;
+ }
+ for (i = 0; i < len; i++) {
+ if (!this.children[i].equals(other.children[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ guid: 0,
+
+ compile: function(program, options) {
+ this.opcodes = [];
+ this.children = [];
+ this.depths = {list: []};
+ this.options = options;
+
+ // These changes will propagate to the other compiler components
+ var knownHelpers = this.options.knownHelpers;
+ this.options.knownHelpers = {
+ 'helperMissing': true,
+ 'blockHelperMissing': true,
+ 'each': true,
+ 'if': true,
+ 'unless': true,
+ 'with': true,
+ 'log': true
+ };
+ if (knownHelpers) {
+ for (var name in knownHelpers) {
+ this.options.knownHelpers[name] = knownHelpers[name];
+ }
+ }
+
+ return this.accept(program);
+ },
+
+ accept: function(node) {
+ var strip = node.strip || {},
+ ret;
+ if (strip.left) {
+ this.opcode('strip');
+ }
+
+ ret = this[node.type](node);
+
+ if (strip.right) {
+ this.opcode('strip');
+ }
+
+ return ret;
+ },
+
+ program: function(program) {
+ var statements = program.statements;
+
+ for(var i=0, l=statements.length; i<l; i++) {
+ this.accept(statements[i]);
+ }
+ this.isSimple = l === 1;
+
+ this.depths.list = this.depths.list.sort(function(a, b) {
+ return a - b;
+ });
+
+ return this;
+ },
+
+ compileProgram: function(program) {
+ var result = new this.compiler().compile(program, this.options);
+ var guid = this.guid++, depth;
+
+ this.usePartial = this.usePartial || result.usePartial;
+
+ this.children[guid] = result;
+
+ for(var i=0, l=result.depths.list.length; i<l; i++) {
+ depth = result.depths.list[i];
+
+ if(depth < 2) { continue; }
+ else { this.addDepth(depth - 1); }
+ }
+
+ return guid;
+ },
+
+ block: function(block) {
+ var mustache = block.mustache,
+ program = block.program,
+ inverse = block.inverse;
+
+ if (program) {
+ program = this.compileProgram(program);
+ }
+
+ if (inverse) {
+ inverse = this.compileProgram(inverse);
+ }
+
+ var sexpr = mustache.sexpr;
+ var type = this.classifySexpr(sexpr);
+
+ if (type === "helper") {
+ this.helperSexpr(sexpr, program, inverse);
+ } else if (type === "simple") {
+ this.simpleSexpr(sexpr);
+
+ // now that the simple mustache is resolved, we need to
+ // evaluate it by executing `blockHelperMissing`
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+ this.opcode('emptyHash');
+ this.opcode('blockValue');
+ } else {
+ this.ambiguousSexpr(sexpr, program, inverse);
+
+ // now that the simple mustache is resolved, we need to
+ // evaluate it by executing `blockHelperMissing`
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+ this.opcode('emptyHash');
+ this.opcode('ambiguousBlockValue');
+ }
+
+ this.opcode('append');
+ },
+
+ hash: function(hash) {
+ var pairs = hash.pairs, pair, val;
+
+ this.opcode('pushHash');
+
+ for(var i=0, l=pairs.length; i<l; i++) {
+ pair = pairs[i];
+ val = pair[1];
+
+ if (this.options.stringParams) {
+ if(val.depth) {
+ this.addDepth(val.depth);
+ }
+ this.opcode('getContext', val.depth || 0);
+ this.opcode('pushStringParam', val.stringModeValue, val.type);
+
+ if (val.type === 'sexpr') {
+ // Subexpressions get evaluated and passed in
+ // in string params mode.
+ this.sexpr(val);
+ }
+ } else {
+ this.accept(val);
+ }
+
+ this.opcode('assignToHash', pair[0]);
+ }
+ this.opcode('popHash');
+ },
+
+ partial: function(partial) {
+ var partialName = partial.partialName;
+ this.usePartial = true;
+
+ if(partial.context) {
+ this.ID(partial.context);
+ } else {
+ this.opcode('push', 'depth0');
+ }
+
+ this.opcode('invokePartial', partialName.name);
+ this.opcode('append');
+ },
+
+ content: function(content) {
+ this.opcode('appendContent', content.string);
+ },
+
+ mustache: function(mustache) {
+ this.sexpr(mustache.sexpr);
+
+ if(mustache.escaped && !this.options.noEscape) {
+ this.opcode('appendEscaped');
+ } else {
+ this.opcode('append');
+ }
+ },
+
+ ambiguousSexpr: function(sexpr, program, inverse) {
+ var id = sexpr.id,
+ name = id.parts[0],
+ isBlock = program != null || inverse != null;
+
+ this.opcode('getContext', id.depth);
+
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+
+ this.opcode('invokeAmbiguous', name, isBlock);
+ },
+
+ simpleSexpr: function(sexpr) {
+ var id = sexpr.id;
+
+ if (id.type === 'DATA') {
+ this.DATA(id);
+ } else if (id.parts.length) {
+ this.ID(id);
+ } else {
+ // Simplified ID for `this`
+ this.addDepth(id.depth);
+ this.opcode('getContext', id.depth);
+ this.opcode('pushContext');
+ }
+
+ this.opcode('resolvePossibleLambda');
+ },
+
+ helperSexpr: function(sexpr, program, inverse) {
+ var params = this.setupFullMustacheParams(sexpr, program, inverse),
+ name = sexpr.id.parts[0];
+
+ if (this.options.knownHelpers[name]) {
+ this.opcode('invokeKnownHelper', params.length, name);
+ } else if (this.options.knownHelpersOnly) {
+ throw new Exception("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
+ } else {
+ this.opcode('invokeHelper', params.length, name, sexpr.isRoot);
+ }
+ },
+
+ sexpr: function(sexpr) {
+ var type = this.classifySexpr(sexpr);
+
+ if (type === "simple") {
+ this.simpleSexpr(sexpr);
+ } else if (type === "helper") {
+ this.helperSexpr(sexpr);
+ } else {
+ this.ambiguousSexpr(sexpr);
+ }
+ },
+
+ ID: function(id) {
+ this.addDepth(id.depth);
+ this.opcode('getContext', id.depth);
+
+ var name = id.parts[0];
+ if (!name) {
+ this.opcode('pushContext');
+ } else {
+ this.opcode('lookupOnContext', id.parts[0]);
+ }
+
+ for(var i=1, l=id.parts.length; i<l; i++) {
+ this.opcode('lookup', id.parts[i]);
+ }
+ },
+
+ DATA: function(data) {
+ this.options.data = true;
+ if (data.id.isScoped || data.id.depth) {
+ throw new Exception('Scoped data references are not supported: ' + data.original, data);
+ }
+
+ this.opcode('lookupData');
+ var parts = data.id.parts;
+ for(var i=0, l=parts.length; i<l; i++) {
+ this.opcode('lookup', parts[i]);
+ }
+ },
+
+ STRING: function(string) {
+ this.opcode('pushString', string.string);
+ },
+
+ INTEGER: function(integer) {
+ this.opcode('pushLiteral', integer.integer);
+ },
+
+ BOOLEAN: function(bool) {
+ this.opcode('pushLiteral', bool.bool);
+ },
+
+ comment: function() {},
+
+ // HELPERS
+ opcode: function(name) {
+ this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });
+ },
+
+ declare: function(name, value) {
+ this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });
+ },
+
+ addDepth: function(depth) {
+ if(depth === 0) { return; }
+
+ if(!this.depths[depth]) {
+ this.depths[depth] = true;
+ this.depths.list.push(depth);
+ }
+ },
+
+ classifySexpr: function(sexpr) {
+ var isHelper = sexpr.isHelper;
+ var isEligible = sexpr.eligibleHelper;
+ var options = this.options;
+
+ // if ambiguous, we can possibly resolve the ambiguity now
+ if (isEligible && !isHelper) {
+ var name = sexpr.id.parts[0];
+
+ if (options.knownHelpers[name]) {
+ isHelper = true;
+ } else if (options.knownHelpersOnly) {
+ isEligible = false;
+ }
+ }
+
+ if (isHelper) { return "helper"; }
+ else if (isEligible) { return "ambiguous"; }
+ else { return "simple"; }
+ },
+
+ pushParams: function(params) {
+ var i = params.length, param;
+
+ while(i--) {
+ param = params[i];
+
+ if(this.options.stringParams) {
+ if(param.depth) {
+ this.addDepth(param.depth);
+ }
+
+ this.opcode('getContext', param.depth || 0);
+ this.opcode('pushStringParam', param.stringModeValue, param.type);
+
+ if (param.type === 'sexpr') {
+ // Subexpressions get evaluated and passed in
+ // in string params mode.
+ this.sexpr(param);
+ }
+ } else {
+ this[param.type](param);
+ }
+ }
+ },
+
+ setupFullMustacheParams: function(sexpr, program, inverse) {
+ var params = sexpr.params;
+ this.pushParams(params);
+
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+
+ if (sexpr.hash) {
+ this.hash(sexpr.hash);
+ } else {
+ this.opcode('emptyHash');
+ }
+
+ return params;
+ }
+ };
+
+ function precompile(input, options, env) {
+ if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
+ throw new Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
+ }
+
+ options = options || {};
+ if (!('data' in options)) {
+ options.data = true;
+ }
+
+ var ast = env.parse(input);
+ var environment = new env.Compiler().compile(ast, options);
+ return new env.JavaScriptCompiler().compile(environment, options);
+ }
+
+ __exports__.precompile = precompile;function compile(input, options, env) {
+ if (input == null || (typeof input !== 'string' && input.constructor !== env.AST.ProgramNode)) {
+ throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
+ }
+
+ options = options || {};
+
+ if (!('data' in options)) {
+ options.data = true;
+ }
+
+ var compiled;
+
+ function compileInput() {
+ var ast = env.parse(input);
+ var environment = new env.Compiler().compile(ast, options);
+ var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
+ return env.template(templateSpec);
+ }
+
+ // Template is only compiled on first use and cached after that point.
+ return function(context, options) {
+ if (!compiled) {
+ compiled = compileInput();
+ }
+ return compiled.call(this, context, options);
+ };
+ }
+
+ __exports__.compile = compile;
+ return __exports__;
+})(__module5__);
+
+// handlebars/compiler/javascript-compiler.js
+var __module11__ = (function(__dependency1__, __dependency2__) {
+ "use strict";
+ var __exports__;
+ var COMPILER_REVISION = __dependency1__.COMPILER_REVISION;
+ var REVISION_CHANGES = __dependency1__.REVISION_CHANGES;
+ var log = __dependency1__.log;
+ var Exception = __dependency2__;
+
+ function Literal(value) {
+ this.value = value;
+ }
+
+ function JavaScriptCompiler() {}
+
+ JavaScriptCompiler.prototype = {
+ // PUBLIC API: You can override these methods in a subclass to provide
+ // alternative compiled forms for name lookup and buffering semantics
+ nameLookup: function(parent, name /* , type*/) {
+ var wrap,
+ ret;
+ if (parent.indexOf('depth') === 0) {
+ wrap = true;
+ }
+
+ if (/^[0-9]+$/.test(name)) {
+ ret = parent + "[" + name + "]";
+ } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
+ ret = parent + "." + name;
+ }
+ else {
+ ret = parent + "['" + name + "']";
+ }
+
+ if (wrap) {
+ return '(' + parent + ' && ' + ret + ')';
+ } else {
+ return ret;
+ }
+ },
+
+ compilerInfo: function() {
+ var revision = COMPILER_REVISION,
+ versions = REVISION_CHANGES[revision];
+ return "this.compilerInfo = ["+revision+",'"+versions+"'];\n";
+ },
+
+ appendToBuffer: function(string) {
+ if (this.environment.isSimple) {
+ return "return " + string + ";";
+ } else {
+ return {
+ appendToBuffer: true,
+ content: string,
+ toString: function() { return "buffer += " + string + ";"; }
+ };
+ }
+ },
+
+ initializeBuffer: function() {
+ return this.quotedString("");
+ },
+
+ namespace: "Handlebars",
+ // END PUBLIC API
+
+ compile: function(environment, options, context, asObject) {
+ this.environment = environment;
+ this.options = options || {};
+
+ log('debug', this.environment.disassemble() + "\n\n");
+
+ this.name = this.environment.name;
+ this.isChild = !!context;
+ this.context = context || {
+ programs: [],
+ environments: [],
+ aliases: { }
+ };
+
+ this.preamble();
+
+ this.stackSlot = 0;
+ this.stackVars = [];
+ this.registers = { list: [] };
+ this.hashes = [];
+ this.compileStack = [];
+ this.inlineStack = [];
+
+ this.compileChildren(environment, options);
+
+ var opcodes = environment.opcodes, opcode;
+
+ this.i = 0;
+
+ for(var l=opcodes.length; this.i<l; this.i++) {
+ opcode = opcodes[this.i];
+
+ if(opcode.opcode === 'DECLARE') {
+ this[opcode.name] = opcode.value;
+ } else {
+ this[opcode.opcode].apply(this, opcode.args);
+ }
+
+ // Reset the stripNext flag if it was not set by this operation.
+ if (opcode.opcode !== this.stripNext) {
+ this.stripNext = false;
+ }
+ }
+
+ // Flush any trailing content that might be pending.
+ this.pushSource('');
+
+ if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
+ throw new Exception('Compile completed with content left on stack');
+ }
+
+ return this.createFunctionContext(asObject);
+ },
+
+ preamble: function() {
+ var out = [];
+
+ if (!this.isChild) {
+ var namespace = this.namespace;
+
+ var copies = "helpers = this.merge(helpers, " + namespace + ".helpers);";
+ if (this.environment.usePartial) { copies = copies + " partials = this.merge(partials, " + namespace + ".partials);"; }
+ if (this.options.data) { copies = copies + " data = data || {};"; }
+ out.push(copies);
+ } else {
+ out.push('');
+ }
+
+ if (!this.environment.isSimple) {
+ out.push(", buffer = " + this.initializeBuffer());
+ } else {
+ out.push("");
+ }
+
+ // track the last context pushed into place to allow skipping the
+ // getContext opcode when it would be a noop
+ this.lastContext = 0;
+ this.source = out;
+ },
+
+ createFunctionContext: function(asObject) {
+ var locals = this.stackVars.concat(this.registers.list);
+
+ if(locals.length > 0) {
+ this.source[1] = this.source[1] + ", " + locals.join(", ");
+ }
+
+ // Generate minimizer alias mappings
+ if (!this.isChild) {
+ for (var alias in this.context.aliases) {
+ if (this.context.aliases.hasOwnProperty(alias)) {
+ this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
+ }
+ }
+ }
+
+ if (this.source[1]) {
+ this.source[1] = "var " + this.source[1].substring(2) + ";";
+ }
+
+ // Merge children
+ if (!this.isChild) {
+ this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
+ }
+
+ if (!this.environment.isSimple) {
+ this.pushSource("return buffer;");
+ }
+
+ var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
+
+ for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
+ params.push("depth" + this.environment.depths.list[i]);
+ }
+
+ // Perform a second pass over the output to merge content when possible
+ var source = this.mergeSource();
+
+ if (!this.isChild) {
+ source = this.compilerInfo()+source;
+ }
+
+ if (asObject) {
+ params.push(source);
+
+ return Function.apply(this, params);
+ } else {
+ var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + source + '}';
+ log('debug', functionSource + "\n\n");
+ return functionSource;
+ }
+ },
+ mergeSource: function() {
+ // WARN: We are not handling the case where buffer is still populated as the source should
+ // not have buffer append operations as their final action.
+ var source = '',
+ buffer;
+ for (var i = 0, len = this.source.length; i < len; i++) {
+ var line = this.source[i];
+ if (line.appendToBuffer) {
+ if (buffer) {
+ buffer = buffer + '\n + ' + line.content;
+ } else {
+ buffer = line.content;
+ }
+ } else {
+ if (buffer) {
+ source += 'buffer += ' + buffer + ';\n ';
+ buffer = undefined;
+ }
+ source += line + '\n ';
+ }
+ }
+ return source;
+ },
+
+ // [blockValue]
+ //
+ // On stack, before: hash, inverse, program, value
+ // On stack, after: return value of blockHelperMissing
+ //
+ // The purpose of this opcode is to take a block of the form
+ // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and
+ // replace it on the stack with the result of properly
+ // invoking blockHelperMissing.
+ blockValue: function() {
+ this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+
+ var params = ["depth0"];
+ this.setupParams(0, params);
+
+ this.replaceStack(function(current) {
+ params.splice(1, 0, current);
+ return "blockHelperMissing.call(" + params.join(", ") + ")";
+ });
+ },
+
+ // [ambiguousBlockValue]
+ //
+ // On stack, before: hash, inverse, program, value
+ // Compiler value, before: lastHelper=value of last found helper, if any
+ // On stack, after, if no lastHelper: same as [blockValue]
+ // On stack, after, if lastHelper: value
+ ambiguousBlockValue: function() {
+ this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+
+ var params = ["depth0"];
+ this.setupParams(0, params);
+
+ var current = this.topStack();
+ params.splice(1, 0, current);
+
+ this.pushSource("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
+ },
+
+ // [appendContent]
+ //
+ // On stack, before: ...
+ // On stack, after: ...
+ //
+ // Appends the string value of `content` to the current buffer
+ appendContent: function(content) {
+ if (this.pendingContent) {
+ content = this.pendingContent + content;
+ }
+ if (this.stripNext) {
+ content = content.replace(/^\s+/, '');
+ }
+
+ this.pendingContent = content;
+ },
+
+ // [strip]
+ //
+ // On stack, before: ...
+ // On stack, after: ...
+ //
+ // Removes any trailing whitespace from the prior content node and flags
+ // the next operation for stripping if it is a content node.
+ strip: function() {
+ if (this.pendingContent) {
+ this.pendingContent = this.pendingContent.replace(/\s+$/, '');
+ }
+ this.stripNext = 'strip';
+ },
+
+ // [append]
+ //
+ // On stack, before: value, ...
+ // On stack, after: ...
+ //
+ // Coerces `value` to a String and appends it to the current buffer.
+ //
+ // If `value` is truthy, or 0, it is coerced into a string and appended
+ // Otherwise, the empty string is appended
+ append: function() {
+ // Force anything that is inlined onto the stack so we don't have duplication
+ // when we examine local
+ this.flushInline();
+ var local = this.popStack();
+ this.pushSource("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
+ if (this.environment.isSimple) {
+ this.pushSource("else { " + this.appendToBuffer("''") + " }");
+ }
+ },
+
+ // [appendEscaped]
+ //
+ // On stack, before: value, ...
+ // On stack, after: ...
+ //
+ // Escape `value` and append it to the buffer
+ appendEscaped: function() {
+ this.context.aliases.escapeExpression = 'this.escapeExpression';
+
+ this.pushSource(this.appendToBuffer("escapeExpression(" + this.popStack() + ")"));
+ },
+
+ // [getContext]
+ //
+ // On stack, before: ...
+ // On stack, after: ...
+ // Compiler value, after: lastContext=depth
+ //
+ // Set the value of the `lastContext` compiler value to the depth
+ getContext: function(depth) {
+ if(this.lastContext !== depth) {
+ this.lastContext = depth;
+ }
+ },
+
+ // [lookupOnContext]
+ //
+ // On stack, before: ...
+ // On stack, after: currentContext[name], ...
+ //
+ // Looks up the value of `name` on the current context and pushes
+ // it onto the stack.
+ lookupOnContext: function(name) {
+ this.push(this.nameLookup('depth' + this.lastContext, name, 'context'));
+ },
+
+ // [pushContext]
+ //
+ // On stack, before: ...
+ // On stack, after: currentContext, ...
+ //
+ // Pushes the value of the current context onto the stack.
+ pushContext: function() {
+ this.pushStackLiteral('depth' + this.lastContext);
+ },
+
+ // [resolvePossibleLambda]
+ //
+ // On stack, before: value, ...
+ // On stack, after: resolved value, ...
+ //
+ // If the `value` is a lambda, replace it on the stack by
+ // the return value of the lambda
+ resolvePossibleLambda: function() {
+ this.context.aliases.functionType = '"function"';
+
+ this.replaceStack(function(current) {
+ return "typeof " + current + " === functionType ? " + current + ".apply(depth0) : " + current;
+ });
+ },
+
+ // [lookup]
+ //
+ // On stack, before: value, ...
+ // On stack, after: value[name], ...
+ //
+ // Replace the value on the stack with the result of looking
+ // up `name` on `value`
+ lookup: function(name) {
+ this.replaceStack(function(current) {
+ return current + " == null || " + current + " === false ? " + current + " : " + this.nameLookup(current, name, 'context');
+ });
+ },
+
+ // [lookupData]
+ //
+ // On stack, before: ...
+ // On stack, after: data, ...
+ //
+ // Push the data lookup operator
+ lookupData: function() {
+ this.pushStackLiteral('data');
+ },
+
+ // [pushStringParam]
+ //
+ // On stack, before: ...
+ // On stack, after: string, currentContext, ...
+ //
+ // This opcode is designed for use in string mode, which
+ // provides the string value of a parameter along with its
+ // depth rather than resolving it immediately.
+ pushStringParam: function(string, type) {
+ this.pushStackLiteral('depth' + this.lastContext);
+
+ this.pushString(type);
+
+ // If it's a subexpression, the string result
+ // will be pushed after this opcode.
+ if (type !== 'sexpr') {
+ if (typeof string === 'string') {
+ this.pushString(string);
+ } else {
+ this.pushStackLiteral(string);
+ }
+ }
+ },
+
+ emptyHash: function() {
+ this.pushStackLiteral('{}');
+
+ if (this.options.stringParams) {
+ this.push('{}'); // hashContexts
+ this.push('{}'); // hashTypes
+ }
+ },
+ pushHash: function() {
+ if (this.hash) {
+ this.hashes.push(this.hash);
+ }
+ this.hash = {values: [], types: [], contexts: []};
+ },
+ popHash: function() {
+ var hash = this.hash;
+ this.hash = this.hashes.pop();
+
+ if (this.options.stringParams) {
+ this.push('{' + hash.contexts.join(',') + '}');
+ this.push('{' + hash.types.join(',') + '}');
+ }
+
+ this.push('{\n ' + hash.values.join(',\n ') + '\n }');
+ },
+
+ // [pushString]
+ //
+ // On stack, before: ...
+ // On stack, after: quotedString(string), ...
+ //
+ // Push a quoted version of `string` onto the stack
+ pushString: function(string) {
+ this.pushStackLiteral(this.quotedString(string));
+ },
+
+ // [push]
+ //
+ // On stack, before: ...
+ // On stack, after: expr, ...
+ //
+ // Push an expression onto the stack
+ push: function(expr) {
+ this.inlineStack.push(expr);
+ return expr;
+ },
+
+ // [pushLiteral]
+ //
+ // On stack, before: ...
+ // On stack, after: value, ...
+ //
+ // Pushes a value onto the stack. This operation prevents
+ // the compiler from creating a temporary variable to hold
+ // it.
+ pushLiteral: function(value) {
+ this.pushStackLiteral(value);
+ },
+
+ // [pushProgram]
+ //
+ // On stack, before: ...
+ // On stack, after: program(guid), ...
+ //
+ // Push a program expression onto the stack. This takes
+ // a compile-time guid and converts it into a runtime-accessible
+ // expression.
+ pushProgram: function(guid) {
+ if (guid != null) {
+ this.pushStackLiteral(this.programExpression(guid));
+ } else {
+ this.pushStackLiteral(null);
+ }
+ },
+
+ // [invokeHelper]
+ //
+ // On stack, before: hash, inverse, program, params..., ...
+ // On stack, after: result of helper invocation
+ //
+ // Pops off the helper's parameters, invokes the helper,
+ // and pushes the helper's return value onto the stack.
+ //
+ // If the helper is not found, `helperMissing` is called.
+ invokeHelper: function(paramSize, name, isRoot) {
+ this.context.aliases.helperMissing = 'helpers.helperMissing';
+ this.useRegister('helper');
+
+ var helper = this.lastHelper = this.setupHelper(paramSize, name, true);
+ var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
+
+ var lookup = 'helper = ' + helper.name + ' || ' + nonHelper;
+ if (helper.paramsInit) {
+ lookup += ',' + helper.paramsInit;
+ }
+
+ this.push(
+ '('
+ + lookup
+ + ',helper '
+ + '? helper.call(' + helper.callParams + ') '
+ + ': helperMissing.call(' + helper.helperMissingParams + '))');
+
+ // Always flush subexpressions. This is both to prevent the compounding size issue that
+ // occurs when the code has to be duplicated for inlining and also to prevent errors
+ // due to the incorrect options object being passed due to the shared register.
+ if (!isRoot) {
+ this.flushInline();
+ }
+ },
+
+ // [invokeKnownHelper]
+ //
+ // On stack, before: hash, inverse, program, params..., ...
+ // On stack, after: result of helper invocation
+ //
+ // This operation is used when the helper is known to exist,
+ // so a `helperMissing` fallback is not required.
+ invokeKnownHelper: function(paramSize, name) {
+ var helper = this.setupHelper(paramSize, name);
+ this.push(helper.name + ".call(" + helper.callParams + ")");
+ },
+
+ // [invokeAmbiguous]
+ //
+ // On stack, before: hash, inverse, program, params..., ...
+ // On stack, after: result of disambiguation
+ //
+ // This operation is used when an expression like `{{foo}}`
+ // is provided, but we don't know at compile-time whether it
+ // is a helper or a path.
+ //
+ // This operation emits more code than the other options,
+ // and can be avoided by passing the `knownHelpers` and
+ // `knownHelpersOnly` flags at compile-time.
+ invokeAmbiguous: function(name, helperCall) {
+ this.context.aliases.functionType = '"function"';
+ this.useRegister('helper');
+
+ this.emptyHash();
+ var helper = this.setupHelper(0, name, helperCall);
+
+ var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
+
+ var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');
+ var nextStack = this.nextStack();
+
+ if (helper.paramsInit) {
+ this.pushSource(helper.paramsInit);
+ }
+ this.pushSource('if (helper = ' + helperName + ') { ' + nextStack + ' = helper.call(' + helper.callParams + '); }');
+ this.pushSource('else { helper = ' + nonHelper + '; ' + nextStack + ' = typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper; }');
+ },
+
+ // [invokePartial]
+ //
+ // On stack, before: context, ...
+ // On stack after: result of partial invocation
+ //
+ // This operation pops off a context, invokes a partial with that context,
+ // and pushes the result of the invocation back.
+ invokePartial: function(name) {
+ var params = [this.nameLookup('partials', name, 'partial'), "'" + name + "'", this.popStack(), "helpers", "partials"];
+
+ if (this.options.data) {
+ params.push("data");
+ }
+
+ this.context.aliases.self = "this";
+ this.push("self.invokePartial(" + params.join(", ") + ")");
+ },
+
+ // [assignToHash]
+ //
+ // On stack, before: value, hash, ...
+ // On stack, after: hash, ...
+ //
+ // Pops a value and hash off the stack, assigns `hash[key] = value`
+ // and pushes the hash back onto the stack.
+ assignToHash: function(key) {
+ var value = this.popStack(),
+ context,
+ type;
+
+ if (this.options.stringParams) {
+ type = this.popStack();
+ context = this.popStack();
+ }
+
+ var hash = this.hash;
+ if (context) {
+ hash.contexts.push("'" + key + "': " + context);
+ }
+ if (type) {
+ hash.types.push("'" + key + "': " + type);
+ }
+ hash.values.push("'" + key + "': (" + value + ")");
+ },
+
+ // HELPERS
+
+ compiler: JavaScriptCompiler,
+
+ compileChildren: function(environment, options) {
+ var children = environment.children, child, compiler;
+
+ for(var i=0, l=children.length; i<l; i++) {
+ child = children[i];
+ compiler = new this.compiler();
+
+ var index = this.matchExistingProgram(child);
+
+ if (index == null) {
+ this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
+ index = this.context.programs.length;
+ child.index = index;
+ child.name = 'program' + index;
+ this.context.programs[index] = compiler.compile(child, options, this.context);
+ this.context.environments[index] = child;
+ } else {
+ child.index = index;
+ child.name = 'program' + index;
+ }
+ }
+ },
+ matchExistingProgram: function(child) {
+ for (var i = 0, len = this.context.environments.length; i < len; i++) {
+ var environment = this.context.environments[i];
+ if (environment && environment.equals(child)) {
+ return i;
+ }
+ }
+ },
+
+ programExpression: function(guid) {
+ this.context.aliases.self = "this";
+
+ if(guid == null) {
+ return "self.noop";
+ }
+
+ var child = this.environment.children[guid],
+ depths = child.depths.list, depth;
+
+ var programParams = [child.index, child.name, "data"];
+
+ for(var i=0, l = depths.length; i<l; i++) {
+ depth = depths[i];
+
+ if(depth === 1) { programParams.push("depth0"); }
+ else { programParams.push("depth" + (depth - 1)); }
+ }
+
+ return (depths.length === 0 ? "self.program(" : "self.programWithDepth(") + programParams.join(", ") + ")";
+ },
+
+ register: function(name, val) {
+ this.useRegister(name);
+ this.pushSource(name + " = " + val + ";");
+ },
+
+ useRegister: function(name) {
+ if(!this.registers[name]) {
+ this.registers[name] = true;
+ this.registers.list.push(name);
+ }
+ },
+
+ pushStackLiteral: function(item) {
+ return this.push(new Literal(item));
+ },
+
+ pushSource: function(source) {
+ if (this.pendingContent) {
+ this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent)));
+ this.pendingContent = undefined;
+ }
+
+ if (source) {
+ this.source.push(source);
+ }
+ },
+
+ pushStack: function(item) {
+ this.flushInline();
+
+ var stack = this.incrStack();
+ if (item) {
+ this.pushSource(stack + " = " + item + ";");
+ }
+ this.compileStack.push(stack);
+ return stack;
+ },
+
+ replaceStack: function(callback) {
+ var prefix = '',
+ inline = this.isInline(),
+ stack,
+ createdStack,
+ usedLiteral;
+
+ // If we are currently inline then we want to merge the inline statement into the
+ // replacement statement via ','
+ if (inline) {
+ var top = this.popStack(true);
+
+ if (top instanceof Literal) {
+ // Literals do not need to be inlined
+ stack = top.value;
+ usedLiteral = true;
+ } else {
+ // Get or create the current stack name for use by the inline
+ createdStack = !this.stackSlot;
+ var name = !createdStack ? this.topStackName() : this.incrStack();
+
+ prefix = '(' + this.push(name) + ' = ' + top + '),';
+ stack = this.topStack();
+ }
+ } else {
+ stack = this.topStack();
+ }
+
+ var item = callback.call(this, stack);
+
+ if (inline) {
+ if (!usedLiteral) {
+ this.popStack();
+ }
+ if (createdStack) {
+ this.stackSlot--;
+ }
+ this.push('(' + prefix + item + ')');
+ } else {
+ // Prevent modification of the context depth variable. Through replaceStack
+ if (!/^stack/.test(stack)) {
+ stack = this.nextStack();
+ }
+
+ this.pushSource(stack + " = (" + prefix + item + ");");
+ }
+ return stack;
+ },
+
+ nextStack: function() {
+ return this.pushStack();
+ },
+
+ incrStack: function() {
+ this.stackSlot++;
+ if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
+ return this.topStackName();
+ },
+ topStackName: function() {
+ return "stack" + this.stackSlot;
+ },
+ flushInline: function() {
+ var inlineStack = this.inlineStack;
+ if (inlineStack.length) {
+ this.inlineStack = [];
+ for (var i = 0, len = inlineStack.length; i < len; i++) {
+ var entry = inlineStack[i];
+ if (entry instanceof Literal) {
+ this.compileStack.push(entry);
+ } else {
+ this.pushStack(entry);
+ }
+ }
+ }
+ },
+ isInline: function() {
+ return this.inlineStack.length;
+ },
+
+ popStack: function(wrapped) {
+ var inline = this.isInline(),
+ item = (inline ? this.inlineStack : this.compileStack).pop();
+
+ if (!wrapped && (item instanceof Literal)) {
+ return item.value;
+ } else {
+ if (!inline) {
+ if (!this.stackSlot) {
+ throw new Exception('Invalid stack pop');
+ }
+ this.stackSlot--;
+ }
+ return item;
+ }
+ },
+
+ topStack: function(wrapped) {
+ var stack = (this.isInline() ? this.inlineStack : this.compileStack),
+ item = stack[stack.length - 1];
+
+ if (!wrapped && (item instanceof Literal)) {
+ return item.value;
+ } else {
+ return item;
+ }
+ },
+
+ quotedString: function(str) {
+ return '"' + str
+ .replace(/\\/g, '\\\\')
+ .replace(/"/g, '\\"')
+ .replace(/\n/g, '\\n')
+ .replace(/\r/g, '\\r')
+ .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
+ .replace(/\u2029/g, '\\u2029') + '"';
+ },
+
+ setupHelper: function(paramSize, name, missingParams) {
+ var params = [],
+ paramsInit = this.setupParams(paramSize, params, missingParams);
+ var foundHelper = this.nameLookup('helpers', name, 'helper');
+
+ return {
+ params: params,
+ paramsInit: paramsInit,
+ name: foundHelper,
+ callParams: ["depth0"].concat(params).join(", "),
+ helperMissingParams: missingParams && ["depth0", this.quotedString(name)].concat(params).join(", ")
+ };
+ },
+
+ setupOptions: function(paramSize, params) {
+ var options = [], contexts = [], types = [], param, inverse, program;
+
+ options.push("hash:" + this.popStack());
+
+ if (this.options.stringParams) {
+ options.push("hashTypes:" + this.popStack());
+ options.push("hashContexts:" + this.popStack());
+ }
+
+ inverse = this.popStack();
+ program = this.popStack();
+
+ // Avoid setting fn and inverse if neither are set. This allows
+ // helpers to do a check for `if (options.fn)`
+ if (program || inverse) {
+ if (!program) {
+ this.context.aliases.self = "this";
+ program = "self.noop";
+ }
+
+ if (!inverse) {
+ this.context.aliases.self = "this";
+ inverse = "self.noop";
+ }
+
+ options.push("inverse:" + inverse);
+ options.push("fn:" + program);
+ }
+
+ for(var i=0; i<paramSize; i++) {
+ param = this.popStack();
+ params.push(param);
+
+ if(this.options.stringParams) {
+ types.push(this.popStack());
+ contexts.push(this.popStack());
+ }
+ }
+
+ if (this.options.stringParams) {
+ options.push("contexts:[" + contexts.join(",") + "]");
+ options.push("types:[" + types.join(",") + "]");
+ }
+
+ if(this.options.data) {
+ options.push("data:data");
+ }
+
+ return options;
+ },
+
+ // the params and contexts arguments are passed in arrays
+ // to fill in
+ setupParams: function(paramSize, params, useRegister) {
+ var options = '{' + this.setupOptions(paramSize, params).join(',') + '}';
+
+ if (useRegister) {
+ this.useRegister('options');
+ params.push('options');
+ return 'options=' + options;
+ } else {
+ params.push(options);
+ return '';
+ }
+ }
+ };
+
+ var reservedWords = (
+ "break else new var" +
+ " case finally return void" +
+ " catch for switch while" +
+ " continue function this with" +
+ " default if throw" +
+ " delete in try" +
+ " do instanceof typeof" +
+ " abstract enum int short" +
+ " boolean export interface static" +
+ " byte extends long super" +
+ " char final native synchronized" +
+ " class float package throws" +
+ " const goto private transient" +
+ " debugger implements protected volatile" +
+ " double import public let yield"
+ ).split(" ");
+
+ var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
+
+ for(var i=0, l=reservedWords.length; i<l; i++) {
+ compilerWords[reservedWords[i]] = true;
+ }
+
+ JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
+ if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)) {
+ return true;
+ }
+ return false;
+ };
+
+ __exports__ = JavaScriptCompiler;
+ return __exports__;
+})(__module2__, __module5__);
+
+// handlebars.js
+var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
+ "use strict";
+ var __exports__;
+ /*globals Handlebars: true */
+ var Handlebars = __dependency1__;
+
+ // Compiler imports
+ var AST = __dependency2__;
+ var Parser = __dependency3__.parser;
+ var parse = __dependency3__.parse;
+ var Compiler = __dependency4__.Compiler;
+ var compile = __dependency4__.compile;
+ var precompile = __dependency4__.precompile;
+ var JavaScriptCompiler = __dependency5__;
+
+ var _create = Handlebars.create;
+ var create = function() {
+ var hb = _create();
+
+ hb.compile = function(input, options) {
+ return compile(input, options, hb);
+ };
+ hb.precompile = function (input, options) {
+ return precompile(input, options, hb);
+ };
+
+ hb.AST = AST;
+ hb.Compiler = Compiler;
+ hb.JavaScriptCompiler = JavaScriptCompiler;
+ hb.Parser = Parser;
+ hb.parse = parse;
+
+ return hb;
+ };
+
+ Handlebars = create();
+ Handlebars.create = create;
+
+ __exports__ = Handlebars;
+ return __exports__;
+})(__module1__, __module7__, __module8__, __module10__, __module11__);
+
+ return __module0__;
+})();
diff --git a/contrail-webui/controller/handlebars-v4.0.5.js b/contrail-webui/controller/handlebars-v4.0.5.js
new file mode 100644
index 0000000..182c1be
--- /dev/null
+++ b/contrail-webui/controller/handlebars-v4.0.5.js
@@ -0,0 +1,4608 @@
+/*!
+
+ handlebars v4.0.5
+
+Copyright (C) 2011-2015 by Yehuda Katz
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+@license
+*/
+(function webpackUniversalModuleDefinition(root, factory) {
+ if(typeof exports === 'object' && typeof module === 'object')
+ module.exports = factory();
+ else if(typeof define === 'function' && define.amd)
+ define([], factory);
+ else if(typeof exports === 'object')
+ exports["Handlebars"] = factory();
+ else
+ root["Handlebars"] = factory();
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ // The module cache
+/******/ var installedModules = {};
+
+/******/ // The require function
+/******/ function __webpack_require__(moduleId) {
+
+/******/ // Check if module is in cache
+/******/ if(installedModules[moduleId])
+/******/ return installedModules[moduleId].exports;
+
+/******/ // Create a new module (and put it into the cache)
+/******/ var module = installedModules[moduleId] = {
+/******/ exports: {},
+/******/ id: moduleId,
+/******/ loaded: false
+/******/ };
+
+/******/ // Execute the module function
+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ // Flag the module as loaded
+/******/ module.loaded = true;
+
+/******/ // Return the exports of the module
+/******/ return module.exports;
+/******/ }
+
+
+/******/ // expose the modules object (__webpack_modules__)
+/******/ __webpack_require__.m = modules;
+
+/******/ // expose the module cache
+/******/ __webpack_require__.c = installedModules;
+
+/******/ // __webpack_public_path__
+/******/ __webpack_require__.p = "";
+
+/******/ // Load entry module and return exports
+/******/ return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+
+ var _handlebarsRuntime = __webpack_require__(2);
+
+ var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
+
+ // Compiler imports
+
+ var _handlebarsCompilerAst = __webpack_require__(21);
+
+ var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
+
+ var _handlebarsCompilerBase = __webpack_require__(22);
+
+ var _handlebarsCompilerCompiler = __webpack_require__(27);
+
+ var _handlebarsCompilerJavascriptCompiler = __webpack_require__(28);
+
+ var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
+
+ var _handlebarsCompilerVisitor = __webpack_require__(25);
+
+ var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
+
+ var _handlebarsNoConflict = __webpack_require__(20);
+
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
+
+ var _create = _handlebarsRuntime2['default'].create;
+ function create() {
+ var hb = _create();
+
+ hb.compile = function (input, options) {
+ return _handlebarsCompilerCompiler.compile(input, options, hb);
+ };
+ hb.precompile = function (input, options) {
+ return _handlebarsCompilerCompiler.precompile(input, options, hb);
+ };
+
+ hb.AST = _handlebarsCompilerAst2['default'];
+ hb.Compiler = _handlebarsCompilerCompiler.Compiler;
+ hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
+ hb.Parser = _handlebarsCompilerBase.parser;
+ hb.parse = _handlebarsCompilerBase.parse;
+
+ return hb;
+ }
+
+ var inst = create();
+ inst.create = create;
+
+ _handlebarsNoConflict2['default'](inst);
+
+ inst.Visitor = _handlebarsCompilerVisitor2['default'];
+
+ inst['default'] = inst;
+
+ exports['default'] = inst;
+ module.exports = exports['default'];
+
+/***/ },
+/* 1 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ exports["default"] = function (obj) {
+ return obj && obj.__esModule ? obj : {
+ "default": obj
+ };
+ };
+
+ exports.__esModule = true;
+
+/***/ },
+/* 2 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+
+ var _handlebarsBase = __webpack_require__(4);
+
+ var base = _interopRequireWildcard(_handlebarsBase);
+
+ // Each of these augment the Handlebars object. No need to setup here.
+ // (This is done to easily share code between commonjs and browse envs)
+
+ var _handlebarsSafeString = __webpack_require__(18);
+
+ var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
+
+ var _handlebarsException = __webpack_require__(6);
+
+ var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
+
+ var _handlebarsUtils = __webpack_require__(5);
+
+ var Utils = _interopRequireWildcard(_handlebarsUtils);
+
+ var _handlebarsRuntime = __webpack_require__(19);
+
+ var runtime = _interopRequireWildcard(_handlebarsRuntime);
+
+ var _handlebarsNoConflict = __webpack_require__(20);
+
+ var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
+
+ // For compatibility and usage outside of module systems, make the Handlebars object a namespace
+ function create() {
+ var hb = new base.HandlebarsEnvironment();
+
+ Utils.extend(hb, base);
+ hb.SafeString = _handlebarsSafeString2['default'];
+ hb.Exception = _handlebarsException2['default'];
+ hb.Utils = Utils;
+ hb.escapeExpression = Utils.escapeExpression;
+
+ hb.VM = runtime;
+ hb.template = function (spec) {
+ return runtime.template(spec, hb);
+ };
+
+ return hb;
+ }
+
+ var inst = create();
+ inst.create = create;
+
+ _handlebarsNoConflict2['default'](inst);
+
+ inst['default'] = inst;
+
+ exports['default'] = inst;
+ module.exports = exports['default'];
+
+/***/ },
+/* 3 */
+/***/ function(module, exports) {
+
+ "use strict";
+
+ exports["default"] = function (obj) {
+ if (obj && obj.__esModule) {
+ return obj;
+ } else {
+ var newObj = {};
+
+ if (obj != null) {
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
+ }
+ }
+
+ newObj["default"] = obj;
+ return newObj;
+ }
+ };
+
+ exports.__esModule = true;
+
+/***/ },
+/* 4 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+ exports.HandlebarsEnvironment = HandlebarsEnvironment;
+
+ var _utils = __webpack_require__(5);
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ var _helpers = __webpack_require__(7);
+
+ var _decorators = __webpack_require__(15);
+
+ var _logger = __webpack_require__(17);
+
+ var _logger2 = _interopRequireDefault(_logger);
+
+ var VERSION = '4.0.5';
+ exports.VERSION = VERSION;
+ var COMPILER_REVISION = 7;
+
+ exports.COMPILER_REVISION = COMPILER_REVISION;
+ var REVISION_CHANGES = {
+ 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
+ 2: '== 1.0.0-rc.3',
+ 3: '== 1.0.0-rc.4',
+ 4: '== 1.x.x',
+ 5: '== 2.0.0-alpha.x',
+ 6: '>= 2.0.0-beta.1',
+ 7: '>= 4.0.0'
+ };
+
+ exports.REVISION_CHANGES = REVISION_CHANGES;
+ var objectType = '[object Object]';
+
+ function HandlebarsEnvironment(helpers, partials, decorators) {
+ this.helpers = helpers || {};
+ this.partials = partials || {};
+ this.decorators = decorators || {};
+
+ _helpers.registerDefaultHelpers(this);
+ _decorators.registerDefaultDecorators(this);
+ }
+
+ HandlebarsEnvironment.prototype = {
+ constructor: HandlebarsEnvironment,
+
+ logger: _logger2['default'],
+ log: _logger2['default'].log,
+
+ registerHelper: function registerHelper(name, fn) {
+ if (_utils.toString.call(name) === objectType) {
+ if (fn) {
+ throw new _exception2['default']('Arg not supported with multiple helpers');
+ }
+ _utils.extend(this.helpers, name);
+ } else {
+ this.helpers[name] = fn;
+ }
+ },
+ unregisterHelper: function unregisterHelper(name) {
+ delete this.helpers[name];
+ },
+
+ registerPartial: function registerPartial(name, partial) {
+ if (_utils.toString.call(name) === objectType) {
+ _utils.extend(this.partials, name);
+ } else {
+ if (typeof partial === 'undefined') {
+ throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
+ }
+ this.partials[name] = partial;
+ }
+ },
+ unregisterPartial: function unregisterPartial(name) {
+ delete this.partials[name];
+ },
+
+ registerDecorator: function registerDecorator(name, fn) {
+ if (_utils.toString.call(name) === objectType) {
+ if (fn) {
+ throw new _exception2['default']('Arg not supported with multiple decorators');
+ }
+ _utils.extend(this.decorators, name);
+ } else {
+ this.decorators[name] = fn;
+ }
+ },
+ unregisterDecorator: function unregisterDecorator(name) {
+ delete this.decorators[name];
+ }
+ };
+
+ var log = _logger2['default'].log;
+
+ exports.log = log;
+ exports.createFrame = _utils.createFrame;
+ exports.logger = _logger2['default'];
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ exports.extend = extend;
+ exports.indexOf = indexOf;
+ exports.escapeExpression = escapeExpression;
+ exports.isEmpty = isEmpty;
+ exports.createFrame = createFrame;
+ exports.blockParams = blockParams;
+ exports.appendContextPath = appendContextPath;
+ var escape = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ '`': '`',
+ '=': '='
+ };
+
+ var badChars = /[&<>"'`=]/g,
+ possible = /[&<>"'`=]/;
+
+ function escapeChar(chr) {
+ return escape[chr];
+ }
+
+ function extend(obj /* , ...source */) {
+ for (var i = 1; i < arguments.length; i++) {
+ for (var key in arguments[i]) {
+ if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
+ obj[key] = arguments[i][key];
+ }
+ }
+ }
+
+ return obj;
+ }
+
+ var toString = Object.prototype.toString;
+
+ exports.toString = toString;
+ // Sourced from lodash
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
+ /* eslint-disable func-style */
+ var isFunction = function isFunction(value) {
+ return typeof value === 'function';
+ };
+ // fallback for older versions of Chrome and Safari
+ /* istanbul ignore next */
+ if (isFunction(/x/)) {
+ exports.isFunction = isFunction = function (value) {
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
+ };
+ }
+ exports.isFunction = isFunction;
+
+ /* eslint-enable func-style */
+
+ /* istanbul ignore next */
+ var isArray = Array.isArray || function (value) {
+ return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
+ };
+
+ exports.isArray = isArray;
+ // Older IE versions do not directly support indexOf so we must implement our own, sadly.
+
+ function indexOf(array, value) {
+ for (var i = 0, len = array.length; i < len; i++) {
+ if (array[i] === value) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ function escapeExpression(string) {
+ if (typeof string !== 'string') {
+ // don't escape SafeStrings, since they're already safe
+ if (string && string.toHTML) {
+ return string.toHTML();
+ } else if (string == null) {
+ return '';
+ } else if (!string) {
+ return string + '';
+ }
+
+ // Force a string conversion as this will be done by the append regardless and
+ // the regex test will do this transparently behind the scenes, causing issues if
+ // an object's to string has escaped characters in it.
+ string = '' + string;
+ }
+
+ if (!possible.test(string)) {
+ return string;
+ }
+ return string.replace(badChars, escapeChar);
+ }
+
+ function isEmpty(value) {
+ if (!value && value !== 0) {
+ return true;
+ } else if (isArray(value) && value.length === 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ function createFrame(object) {
+ var frame = extend({}, object);
+ frame._parent = object;
+ return frame;
+ }
+
+ function blockParams(params, ids) {
+ params.path = ids;
+ return params;
+ }
+
+ function appendContextPath(contextPath, id) {
+ return (contextPath ? contextPath + '.' : '') + id;
+ }
+
+/***/ },
+/* 6 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
+
+ function Exception(message, node) {
+ var loc = node && node.loc,
+ line = undefined,
+ column = undefined;
+ if (loc) {
+ line = loc.start.line;
+ column = loc.start.column;
+
+ message += ' - ' + line + ':' + column;
+ }
+
+ var tmp = Error.prototype.constructor.call(this, message);
+
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
+ for (var idx = 0; idx < errorProps.length; idx++) {
+ this[errorProps[idx]] = tmp[errorProps[idx]];
+ }
+
+ /* istanbul ignore else */
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, Exception);
+ }
+
+ if (loc) {
+ this.lineNumber = line;
+ this.column = column;
+ }
+ }
+
+ Exception.prototype = new Error();
+
+ exports['default'] = Exception;
+ module.exports = exports['default'];
+
+/***/ },
+/* 7 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+ exports.registerDefaultHelpers = registerDefaultHelpers;
+
+ var _helpersBlockHelperMissing = __webpack_require__(8);
+
+ var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
+
+ var _helpersEach = __webpack_require__(9);
+
+ var _helpersEach2 = _interopRequireDefault(_helpersEach);
+
+ var _helpersHelperMissing = __webpack_require__(10);
+
+ var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
+
+ var _helpersIf = __webpack_require__(11);
+
+ var _helpersIf2 = _interopRequireDefault(_helpersIf);
+
+ var _helpersLog = __webpack_require__(12);
+
+ var _helpersLog2 = _interopRequireDefault(_helpersLog);
+
+ var _helpersLookup = __webpack_require__(13);
+
+ var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
+
+ var _helpersWith = __webpack_require__(14);
+
+ var _helpersWith2 = _interopRequireDefault(_helpersWith);
+
+ function registerDefaultHelpers(instance) {
+ _helpersBlockHelperMissing2['default'](instance);
+ _helpersEach2['default'](instance);
+ _helpersHelperMissing2['default'](instance);
+ _helpersIf2['default'](instance);
+ _helpersLog2['default'](instance);
+ _helpersLookup2['default'](instance);
+ _helpersWith2['default'](instance);
+ }
+
+/***/ },
+/* 8 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _utils = __webpack_require__(5);
+
+ exports['default'] = function (instance) {
+ instance.registerHelper('blockHelperMissing', function (context, options) {
+ var inverse = options.inverse,
+ fn = options.fn;
+
+ if (context === true) {
+ return fn(this);
+ } else if (context === false || context == null) {
+ return inverse(this);
+ } else if (_utils.isArray(context)) {
+ if (context.length > 0) {
+ if (options.ids) {
+ options.ids = [options.name];
+ }
+
+ return instance.helpers.each(context, options);
+ } else {
+ return inverse(this);
+ }
+ } else {
+ if (options.data && options.ids) {
+ var data = _utils.createFrame(options.data);
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
+ options = { data: data };
+ }
+
+ return fn(context, options);
+ }
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 9 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+
+ var _utils = __webpack_require__(5);
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ exports['default'] = function (instance) {
+ instance.registerHelper('each', function (context, options) {
+ if (!options) {
+ throw new _exception2['default']('Must pass iterator to #each');
+ }
+
+ var fn = options.fn,
+ inverse = options.inverse,
+ i = 0,
+ ret = '',
+ data = undefined,
+ contextPath = undefined;
+
+ if (options.data && options.ids) {
+ contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
+ }
+
+ if (_utils.isFunction(context)) {
+ context = context.call(this);
+ }
+
+ if (options.data) {
+ data = _utils.createFrame(options.data);
+ }
+
+ function execIteration(field, index, last) {
+ if (data) {
+ data.key = field;
+ data.index = index;
+ data.first = index === 0;
+ data.last = !!last;
+
+ if (contextPath) {
+ data.contextPath = contextPath + field;
+ }
+ }
+
+ ret = ret + fn(context[field], {
+ data: data,
+ blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
+ });
+ }
+
+ if (context && typeof context === 'object') {
+ if (_utils.isArray(context)) {
+ for (var j = context.length; i < j; i++) {
+ if (i in context) {
+ execIteration(i, i, i === context.length - 1);
+ }
+ }
+ } else {
+ var priorKey = undefined;
+
+ for (var key in context) {
+ if (context.hasOwnProperty(key)) {
+ // We're running the iterations one step out of sync so we can detect
+ // the last iteration without have to scan the object twice and create
+ // an itermediate keys array.
+ if (priorKey !== undefined) {
+ execIteration(priorKey, i - 1);
+ }
+ priorKey = key;
+ i++;
+ }
+ }
+ if (priorKey !== undefined) {
+ execIteration(priorKey, i - 1, true);
+ }
+ }
+ }
+
+ if (i === 0) {
+ ret = inverse(this);
+ }
+
+ return ret;
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 10 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ exports['default'] = function (instance) {
+ instance.registerHelper('helperMissing', function () /* [args, ]options */{
+ if (arguments.length === 1) {
+ // A missing field in a {{foo}} construct.
+ return undefined;
+ } else {
+ // Someone is actually trying to call something, blow up.
+ throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
+ }
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _utils = __webpack_require__(5);
+
+ exports['default'] = function (instance) {
+ instance.registerHelper('if', function (conditional, options) {
+ if (_utils.isFunction(conditional)) {
+ conditional = conditional.call(this);
+ }
+
+ // Default behavior is to render the positive path if the value is truthy and not empty.
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
+ if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+ });
+
+ instance.registerHelper('unless', function (conditional, options) {
+ return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ exports['default'] = function (instance) {
+ instance.registerHelper('log', function () /* message, options */{
+ var args = [undefined],
+ options = arguments[arguments.length - 1];
+ for (var i = 0; i < arguments.length - 1; i++) {
+ args.push(arguments[i]);
+ }
+
+ var level = 1;
+ if (options.hash.level != null) {
+ level = options.hash.level;
+ } else if (options.data && options.data.level != null) {
+ level = options.data.level;
+ }
+ args[0] = level;
+
+ instance.log.apply(instance, args);
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 13 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ exports['default'] = function (instance) {
+ instance.registerHelper('lookup', function (obj, field) {
+ return obj && obj[field];
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 14 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _utils = __webpack_require__(5);
+
+ exports['default'] = function (instance) {
+ instance.registerHelper('with', function (context, options) {
+ if (_utils.isFunction(context)) {
+ context = context.call(this);
+ }
+
+ var fn = options.fn;
+
+ if (!_utils.isEmpty(context)) {
+ var data = options.data;
+ if (options.data && options.ids) {
+ data = _utils.createFrame(options.data);
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
+ }
+
+ return fn(context, {
+ data: data,
+ blockParams: _utils.blockParams([context], [data && data.contextPath])
+ });
+ } else {
+ return options.inverse(this);
+ }
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 15 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+ exports.registerDefaultDecorators = registerDefaultDecorators;
+
+ var _decoratorsInline = __webpack_require__(16);
+
+ var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
+
+ function registerDefaultDecorators(instance) {
+ _decoratorsInline2['default'](instance);
+ }
+
+/***/ },
+/* 16 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _utils = __webpack_require__(5);
+
+ exports['default'] = function (instance) {
+ instance.registerDecorator('inline', function (fn, props, container, options) {
+ var ret = fn;
+ if (!props.partials) {
+ props.partials = {};
+ ret = function (context, options) {
+ // Create a new partials stack frame prior to exec.
+ var original = container.partials;
+ container.partials = _utils.extend({}, original, props.partials);
+ var ret = fn(context, options);
+ container.partials = original;
+ return ret;
+ };
+ }
+
+ props.partials[options.args[0]] = options.fn;
+
+ return ret;
+ });
+ };
+
+ module.exports = exports['default'];
+
+/***/ },
+/* 17 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _utils = __webpack_require__(5);
+
+ var logger = {
+ methodMap: ['debug', 'info', 'warn', 'error'],
+ level: 'info',
+
+ // Maps a given level value to the `methodMap` indexes above.
+ lookupLevel: function lookupLevel(level) {
+ if (typeof level === 'string') {
+ var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
+ if (levelMap >= 0) {
+ level = levelMap;
+ } else {
+ level = parseInt(level, 10);
+ }
+ }
+
+ return level;
+ },
+
+ // Can be overridden in the host environment
+ log: function log(level) {
+ level = logger.lookupLevel(level);
+
+ if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
+ var method = logger.methodMap[level];
+ if (!console[method]) {
+ // eslint-disable-line no-console
+ method = 'log';
+ }
+
+ for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ message[_key - 1] = arguments[_key];
+ }
+
+ console[method].apply(console, message); // eslint-disable-line no-console
+ }
+ }
+ };
+
+ exports['default'] = logger;
+ module.exports = exports['default'];
+
+/***/ },
+/* 18 */
+/***/ function(module, exports) {
+
+ // Build out our basic SafeString type
+ 'use strict';
+
+ exports.__esModule = true;
+ function SafeString(string) {
+ this.string = string;
+ }
+
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
+ return '' + this.string;
+ };
+
+ exports['default'] = SafeString;
+ module.exports = exports['default'];
+
+/***/ },
+/* 19 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+ exports.checkRevision = checkRevision;
+ exports.template = template;
+ exports.wrapProgram = wrapProgram;
+ exports.resolvePartial = resolvePartial;
+ exports.invokePartial = invokePartial;
+ exports.noop = noop;
+
+ var _utils = __webpack_require__(5);
+
+ var Utils = _interopRequireWildcard(_utils);
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ var _base = __webpack_require__(4);
+
+ function checkRevision(compilerInfo) {
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
+ currentRevision = _base.COMPILER_REVISION;
+
+ if (compilerRevision !== currentRevision) {
+ if (compilerRevision < currentRevision) {
+ var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
+ compilerVersions = _base.REVISION_CHANGES[compilerRevision];
+ throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
+ } else {
+ // Use the embedded version info since the runtime doesn't know about this revision yet
+ throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
+ }
+ }
+ }
+
+ function template(templateSpec, env) {
+ /* istanbul ignore next */
+ if (!env) {
+ throw new _exception2['default']('No environment passed to template');
+ }
+ if (!templateSpec || !templateSpec.main) {
+ throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
+ }
+
+ templateSpec.main.decorator = templateSpec.main_d;
+
+ // Note: Using env.VM references rather than local var references throughout this section to allow
+ // for external users to override these as psuedo-supported APIs.
+ env.VM.checkRevision(templateSpec.compiler);
+
+ function invokePartialWrapper(partial, context, options) {
+ if (options.hash) {
+ context = Utils.extend({}, context, options.hash);
+ if (options.ids) {
+ options.ids[0] = true;
+ }
+ }
+
+ partial = env.VM.resolvePartial.call(this, partial, context, options);
+ var result = env.VM.invokePartial.call(this, partial, context, options);
+
+ if (result == null && env.compile) {
+ options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
+ result = options.partials[options.name](context, options);
+ }
+ if (result != null) {
+ if (options.indent) {
+ var lines = result.split('\n');
+ for (var i = 0, l = lines.length; i < l; i++) {
+ if (!lines[i] && i + 1 === l) {
+ break;
+ }
+
+ lines[i] = options.indent + lines[i];
+ }
+ result = lines.join('\n');
+ }
+ return result;
+ } else {
+ throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
+ }
+ }
+
+ // Just add water
+ var container = {
+ strict: function strict(obj, name) {
+ if (!(name in obj)) {
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj);
+ }
+ return obj[name];
+ },
+ lookup: function lookup(depths, name) {
+ var len = depths.length;
+ for (var i = 0; i < len; i++) {
+ if (depths[i] && depths[i][name] != null) {
+ return depths[i][name];
+ }
+ }
+ },
+ lambda: function lambda(current, context) {
+ return typeof current === 'function' ? current.call(context) : current;
+ },
+
+ escapeExpression: Utils.escapeExpression,
+ invokePartial: invokePartialWrapper,
+
+ fn: function fn(i) {
+ var ret = templateSpec[i];
+ ret.decorator = templateSpec[i + '_d'];
+ return ret;
+ },
+
+ programs: [],
+ program: function program(i, data, declaredBlockParams, blockParams, depths) {
+ var programWrapper = this.programs[i],
+ fn = this.fn(i);
+ if (data || depths || blockParams || declaredBlockParams) {
+ programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
+ } else if (!programWrapper) {
+ programWrapper = this.programs[i] = wrapProgram(this, i, fn);
+ }
+ return programWrapper;
+ },
+
+ data: function data(value, depth) {
+ while (value && depth--) {
+ value = value._parent;
+ }
+ return value;
+ },
+ merge: function merge(param, common) {
+ var obj = param || common;
+
+ if (param && common && param !== common) {
+ obj = Utils.extend({}, common, param);
+ }
+
+ return obj;
+ },
+
+ noop: env.VM.noop,
+ compilerInfo: templateSpec.compiler
+ };
+
+ function ret(context) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+ var data = options.data;
+
+ ret._setup(options);
+ if (!options.partial && templateSpec.useData) {
+ data = initData(context, data);
+ }
+ var depths = undefined,
+ blockParams = templateSpec.useBlockParams ? [] : undefined;
+ if (templateSpec.useDepths) {
+ if (options.depths) {
+ depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths;
+ } else {
+ depths = [context];
+ }
+ }
+
+ function main(context /*, options*/) {
+ return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
+ }
+ main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
+ return main(context, options);
+ }
+ ret.isTop = true;
+
+ ret._setup = function (options) {
+ if (!options.partial) {
+ container.helpers = container.merge(options.helpers, env.helpers);
+
+ if (templateSpec.usePartial) {
+ container.partials = container.merge(options.partials, env.partials);
+ }
+ if (templateSpec.usePartial || templateSpec.useDecorators) {
+ container.decorators = container.merge(options.decorators, env.decorators);
+ }
+ } else {
+ container.helpers = options.helpers;
+ container.partials = options.partials;
+ container.decorators = options.decorators;
+ }
+ };
+
+ ret._child = function (i, data, blockParams, depths) {
+ if (templateSpec.useBlockParams && !blockParams) {
+ throw new _exception2['default']('must pass block params');
+ }
+ if (templateSpec.useDepths && !depths) {
+ throw new _exception2['default']('must pass parent depths');
+ }
+
+ return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
+ };
+ return ret;
+ }
+
+ function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
+ function prog(context) {
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+
+ var currentDepths = depths;
+ if (depths && context !== depths[0]) {
+ currentDepths = [context].concat(depths);
+ }
+
+ return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
+ }
+
+ prog = executeDecorators(fn, prog, container, depths, data, blockParams);
+
+ prog.program = i;
+ prog.depth = depths ? depths.length : 0;
+ prog.blockParams = declaredBlockParams || 0;
+ return prog;
+ }
+
+ function resolvePartial(partial, context, options) {
+ if (!partial) {
+ if (options.name === '@partial-block') {
+ partial = options.data['partial-block'];
+ } else {
+ partial = options.partials[options.name];
+ }
+ } else if (!partial.call && !options.name) {
+ // This is a dynamic partial that returned a string
+ options.name = partial;
+ partial = options.partials[partial];
+ }
+ return partial;
+ }
+
+ function invokePartial(partial, context, options) {
+ options.partial = true;
+ if (options.ids) {
+ options.data.contextPath = options.ids[0] || options.data.contextPath;
+ }
+
+ var partialBlock = undefined;
+ if (options.fn && options.fn !== noop) {
+ options.data = _base.createFrame(options.data);
+ partialBlock = options.data['partial-block'] = options.fn;
+
+ if (partialBlock.partials) {
+ options.partials = Utils.extend({}, options.partials, partialBlock.partials);
+ }
+ }
+
+ if (partial === undefined && partialBlock) {
+ partial = partialBlock;
+ }
+
+ if (partial === undefined) {
+ throw new _exception2['default']('The partial ' + options.name + ' could not be found');
+ } else if (partial instanceof Function) {
+ return partial(context, options);
+ }
+ }
+
+ function noop() {
+ return '';
+ }
+
+ function initData(context, data) {
+ if (!data || !('root' in data)) {
+ data = data ? _base.createFrame(data) : {};
+ data.root = context;
+ }
+ return data;
+ }
+
+ function executeDecorators(fn, prog, container, depths, data, blockParams) {
+ if (fn.decorator) {
+ var props = {};
+ prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
+ Utils.extend(prog, props);
+ }
+ return prog;
+ }
+
+/***/ },
+/* 20 */
+/***/ function(module, exports) {
+
+ /* WEBPACK VAR INJECTION */(function(global) {/* global window */
+ 'use strict';
+
+ exports.__esModule = true;
+
+ exports['default'] = function (Handlebars) {
+ /* istanbul ignore next */
+ var root = typeof global !== 'undefined' ? global : window,
+ $Handlebars = root.Handlebars;
+ /* istanbul ignore next */
+ Handlebars.noConflict = function () {
+ if (root.Handlebars === Handlebars) {
+ root.Handlebars = $Handlebars;
+ }
+ return Handlebars;
+ };
+ };
+
+ module.exports = exports['default'];
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 21 */
+/***/ function(module, exports) {
+
+ 'use strict';
+
+ exports.__esModule = true;
+ var AST = {
+ // Public API used to evaluate derived attributes regarding AST nodes
+ helpers: {
+ // a mustache is definitely a helper if:
+ // * it is an eligible helper, and
+ // * it has at least one parameter or hash segment
+ helperExpression: function helperExpression(node) {
+ return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
+ },
+
+ scopedId: function scopedId(path) {
+ return (/^\.|this\b/.test(path.original)
+ );
+ },
+
+ // an ID is simple if it only has one part, and that part is not
+ // `..` or `this`.
+ simpleId: function simpleId(path) {
+ return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
+ }
+ }
+ };
+
+ // Must be exported as an object rather than the root of the module as the jison lexer
+ // must modify the object to operate properly.
+ exports['default'] = AST;
+ module.exports = exports['default'];
+
+/***/ },
+/* 22 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ var _interopRequireWildcard = __webpack_require__(3)['default'];
+
+ exports.__esModule = true;
+ exports.parse = parse;
+
+ var _parser = __webpack_require__(23);
+
+ var _parser2 = _interopRequireDefault(_parser);
+
+ var _whitespaceControl = __webpack_require__(24);
+
+ var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
+
+ var _helpers = __webpack_require__(26);
+
+ var Helpers = _interopRequireWildcard(_helpers);
+
+ var _utils = __webpack_require__(5);
+
+ exports.parser = _parser2['default'];
+
+ var yy = {};
+ _utils.extend(yy, Helpers);
+
+ function parse(input, options) {
+ // Just return if an already-compiled AST was passed in.
+ if (input.type === 'Program') {
+ return input;
+ }
+
+ _parser2['default'].yy = yy;
+
+ // Altering the shared object here, but this is ok as parser is a sync operation
+ yy.locInfo = function (locInfo) {
+ return new yy.SourceLocation(options && options.srcName, locInfo);
+ };
+
+ var strip = new _whitespaceControl2['default'](options);
+ return strip.accept(_parser2['default'].parse(input));
+ }
+
+/***/ },
+/* 23 */
+/***/ function(module, exports) {
+
+ /* istanbul ignore next */
+ /* Jison generated parser */
+ "use strict";
+
+ var handlebars = (function () {
+ var parser = { trace: function trace() {},
+ yy: {},
+ symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
+ terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
+ productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
+ /**/) {
+
+ var $0 = $$.length - 1;
+ switch (yystate) {
+ case 1:
+ return $$[$0 - 1];
+ break;
+ case 2:
+ this.$ = yy.prepareProgram($$[$0]);
+ break;
+ case 3:
+ this.$ = $$[$0];
+ break;
+ case 4:
+ this.$ = $$[$0];
+ break;
+ case 5:
+ this.$ = $$[$0];
+ break;
+ case 6:
+ this.$ = $$[$0];
+ break;
+ case 7:
+ this.$ = $$[$0];
+ break;
+ case 8:
+ this.$ = $$[$0];
+ break;
+ case 9:
+ this.$ = {
+ type: 'CommentStatement',
+ value: yy.stripComment($$[$0]),
+ strip: yy.stripFlags($$[$0], $$[$0]),
+ loc: yy.locInfo(this._$)
+ };
+
+ break;
+ case 10:
+ this.$ = {
+ type: 'ContentStatement',
+ original: $$[$0],
+ value: $$[$0],
+ loc: yy.locInfo(this._$)
+ };
+
+ break;
+ case 11:
+ this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
+ break;
+ case 12:
+ this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
+ break;
+ case 13:
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
+ break;
+ case 14:
+ this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
+ break;
+ case 15:
+ this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
+ break;
+ case 16:
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
+ break;
+ case 17:
+ this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
+ break;
+ case 18:
+ this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
+ break;
+ case 19:
+ var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
+ program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
+ program.chained = true;
+
+ this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
+
+ break;
+ case 20:
+ this.$ = $$[$0];
+ break;
+ case 21:
+ this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
+ break;
+ case 22:
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
+ break;
+ case 23:
+ this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
+ break;
+ case 24:
+ this.$ = {
+ type: 'PartialStatement',
+ name: $$[$0 - 3],
+ params: $$[$0 - 2],
+ hash: $$[$0 - 1],
+ indent: '',
+ strip: yy.stripFlags($$[$0 - 4], $$[$0]),
+ loc: yy.locInfo(this._$)
+ };
+
+ break;
+ case 25:
+ this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
+ break;
+ case 26:
+ this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
+ break;
+ case 27:
+ this.$ = $$[$0];
+ break;
+ case 28:
+ this.$ = $$[$0];
+ break;
+ case 29:
+ this.$ = {
+ type: 'SubExpression',
+ path: $$[$0 - 3],
+ params: $$[$0 - 2],
+ hash: $$[$0 - 1],
+ loc: yy.locInfo(this._$)
+ };
+
+ break;
+ case 30:
+ this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
+ break;
+ case 31:
+ this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
+ break;
+ case 32:
+ this.$ = yy.id($$[$0 - 1]);
+ break;
+ case 33:
+ this.$ = $$[$0];
+ break;
+ case 34:
+ this.$ = $$[$0];
+ break;
+ case 35:
+ this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
+ break;
+ case 36:
+ this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
+ break;
+ case 37:
+ this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
+ break;
+ case 38:
+ this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
+ break;
+ case 39:
+ this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
+ break;
+ case 40:
+ this.$ = $$[$0];
+ break;
+ case 41:
+ this.$ = $$[$0];
+ break;
+ case 42:
+ this.$ = yy.preparePath(true, $$[$0], this._$);
+ break;
+ case 43:
+ this.$ = yy.preparePath(false, $$[$0], this._$);
+ break;
+ case 44:
+ $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
+ break;
+ case 45:
+ this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
+ break;
+ case 46:
+ this.$ = [];
+ break;
+ case 47:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 48:
+ this.$ = [$$[$0]];
+ break;
+ case 49:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 50:
+ this.$ = [];
+ break;
+ case 51:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 58:
+ this.$ = [];
+ break;
+ case 59:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 64:
+ this.$ = [];
+ break;
+ case 65:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 70:
+ this.$ = [];
+ break;
+ case 71:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 78:
+ this.$ = [];
+ break;
+ case 79:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 82:
+ this.$ = [];
+ break;
+ case 83:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 86:
+ this.$ = [];
+ break;
+ case 87:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 90:
+ this.$ = [];
+ break;
+ case 91:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 94:
+ this.$ = [];
+ break;
+ case 95:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 98:
+ this.$ = [$$[$0]];
+ break;
+ case 99:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ case 100:
+ this.$ = [$$[$0]];
+ break;
+ case 101:
+ $$[$0 - 1].push($$[$0]);
+ break;
+ }
+ },
+ table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
+ defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] },
+ parseError: function parseError(str, hash) {
+ throw new Error(str);
+ },
+ parse: function parse(input) {
+ var self = this,
+ stack = [0],
+ vstack = [null],
+ lstack = [],
+ table = this.table,
+ yytext = "",
+ yylineno = 0,
+ yyleng = 0,
+ recovering = 0,
+ TERROR = 2,
+ EOF = 1;
+ this.lexer.setInput(input);
+ this.lexer.yy = this.yy;
+ this.yy.lexer = this.lexer;
+ this.yy.parser = this;
+ if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
+ var yyloc = this.lexer.yylloc;
+ lstack.push(yyloc);
+ var ranges = this.lexer.options && this.lexer.options.ranges;
+ if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
+ function popStack(n) {
+ stack.length = stack.length - 2 * n;
+ vstack.length = vstack.length - n;
+ lstack.length = lstack.length - n;
+ }
+ function lex() {
+ var token;
+ token = self.lexer.lex() || 1;
+ if (typeof token !== "number") {
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol,
+ preErrorSymbol,
+ state,
+ action,
+ a,
+ r,
+ yyval = {},
+ p,
+ len,
+ newState,
+ expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol === null || typeof symbol == "undefined") {
+ symbol = lex();
+ }
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ var errStr = "";
+ if (!recovering) {
+ expected = [];
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ if (this.lexer.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
+ }
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0) recovering--;
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
+ if (ranges) {
+ yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
+ }
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+ }
+ };
+ /* Jison generated lexer */
+ var lexer = (function () {
+ var lexer = { EOF: 1,
+ parseError: function parseError(str, hash) {
+ if (this.yy.parser) {
+ this.yy.parser.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+ setInput: function setInput(input) {
+ this._input = input;
+ this._more = this._less = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = '';
+ this.conditionStack = ['INITIAL'];
+ this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
+ if (this.options.ranges) this.yylloc.range = [0, 0];
+ this.offset = 0;
+ return this;
+ },
+ input: function input() {
+ var ch = this._input[0];
+ this.yytext += ch;
+ this.yyleng++;
+ this.offset++;
+ this.match += ch;
+ this.matched += ch;
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
+ if (lines) {
+ this.yylineno++;
+ this.yylloc.last_line++;
+ } else {
+ this.yylloc.last_column++;
+ }
+ if (this.options.ranges) this.yylloc.range[1]++;
+
+ this._input = this._input.slice(1);
+ return ch;
+ },
+ unput: function unput(ch) {
+ var len = ch.length;
+ var lines = ch.split(/(?:\r\n?|\n)/g);
+
+ this._input = ch + this._input;
+ this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
+ //this.yyleng -= len;
+ this.offset -= len;
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
+ this.match = this.match.substr(0, this.match.length - 1);
+ this.matched = this.matched.substr(0, this.matched.length - 1);
+
+ if (lines.length - 1) this.yylineno -= lines.length - 1;
+ var r = this.yylloc.range;
+
+ this.yylloc = { first_line: this.yylloc.first_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.first_column,
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
+ };
+
+ if (this.options.ranges) {
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
+ }
+ return this;
+ },
+ more: function more() {
+ this._more = true;
+ return this;
+ },
+ less: function less(n) {
+ this.unput(this.match.slice(n));
+ },
+ pastInput: function pastInput() {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
+ },
+ upcomingInput: function upcomingInput() {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20 - next.length);
+ }
+ return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
+ },
+ showPosition: function showPosition() {
+ var pre = this.pastInput();
+ var c = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c + "^";
+ },
+ next: function next() {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) this.done = true;
+
+ var token, match, tempMatch, index, col, lines;
+ if (!this._more) {
+ this.yytext = '';
+ this.match = '';
+ }
+ var rules = this._currentRules();
+ for (var i = 0; i < rules.length; i++) {
+ tempMatch = this._input.match(this.rules[rules[i]]);
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
+ match = tempMatch;
+ index = i;
+ if (!this.options.flex) break;
+ }
+ }
+ if (match) {
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
+ if (lines) this.yylineno += lines.length;
+ this.yylloc = { first_line: this.yylloc.last_line,
+ last_line: this.yylineno + 1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ if (this.options.ranges) {
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
+ }
+ this._more = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
+ if (this.done && this._input) this.done = false;
+ if (token) return token;else return;
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
+ }
+ },
+ lex: function lex() {
+ var r = this.next();
+ if (typeof r !== 'undefined') {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+ begin: function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+ popState: function popState() {
+ return this.conditionStack.pop();
+ },
+ _currentRules: function _currentRules() {
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
+ },
+ topState: function topState() {
+ return this.conditionStack[this.conditionStack.length - 2];
+ },
+ pushState: function begin(condition) {
+ this.begin(condition);
+ } };
+ lexer.options = {};
+ lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
+ /**/) {
+
+ function strip(start, end) {
+ return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
+ }
+
+ var YYSTATE = YY_START;
+ switch ($avoiding_name_collisions) {
+ case 0:
+ if (yy_.yytext.slice(-2) === "\\\\") {
+ strip(0, 1);
+ this.begin("mu");
+ } else if (yy_.yytext.slice(-1) === "\\") {
+ strip(0, 1);
+ this.begin("emu");
+ } else {
+ this.begin("mu");
+ }
+ if (yy_.yytext) return 15;
+
+ break;
+ case 1:
+ return 15;
+ break;
+ case 2:
+ this.popState();
+ return 15;
+
+ break;
+ case 3:
+ this.begin('raw');return 15;
+ break;
+ case 4:
+ this.popState();
+ // Should be using `this.topState()` below, but it currently
+ // returns the second top instead of the first top. Opened an
+ // issue about it at https://github.com/zaach/jison/issues/291
+ if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
+ return 15;
+ } else {
+ yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
+ return 'END_RAW_BLOCK';
+ }
+
+ break;
+ case 5:
+ return 15;
+ break;
+ case 6:
+ this.popState();
+ return 14;
+
+ break;
+ case 7:
+ return 65;
+ break;
+ case 8:
+ return 68;
+ break;
+ case 9:
+ return 19;
+ break;
+ case 10:
+ this.popState();
+ this.begin('raw');
+ return 23;
+
+ break;
+ case 11:
+ return 55;
+ break;
+ case 12:
+ return 60;
+ break;
+ case 13:
+ return 29;
+ break;
+ case 14:
+ return 47;
+ break;
+ case 15:
+ this.popState();return 44;
+ break;
+ case 16:
+ this.popState();return 44;
+ break;
+ case 17:
+ return 34;
+ break;
+ case 18:
+ return 39;
+ break;
+ case 19:
+ return 51;
+ break;
+ case 20:
+ return 48;
+ break;
+ case 21:
+ this.unput(yy_.yytext);
+ this.popState();
+ this.begin('com');
+
+ break;
+ case 22:
+ this.popState();
+ return 14;
+
+ break;
+ case 23:
+ return 48;
+ break;
+ case 24:
+ return 73;
+ break;
+ case 25:
+ return 72;
+ break;
+ case 26:
+ return 72;
+ break;
+ case 27:
+ return 87;
+ break;
+ case 28:
+ // ignore whitespace
+ break;
+ case 29:
+ this.popState();return 54;
+ break;
+ case 30:
+ this.popState();return 33;
+ break;
+ case 31:
+ yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
+ break;
+ case 32:
+ yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
+ break;
+ case 33:
+ return 85;
+ break;
+ case 34:
+ return 82;
+ break;
+ case 35:
+ return 82;
+ break;
+ case 36:
+ return 83;
+ break;
+ case 37:
+ return 84;
+ break;
+ case 38:
+ return 81;
+ break;
+ case 39:
+ return 75;
+ break;
+ case 40:
+ return 77;
+ break;
+ case 41:
+ return 72;
+ break;
+ case 42:
+ yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
+ break;
+ case 43:
+ return 'INVALID';
+ break;
+ case 44:
+ return 5;
+ break;
+ }
+ };
+ lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
+ lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
+ return lexer;
+ })();
+ parser.lexer = lexer;
+ function Parser() {
+ this.yy = {};
+ }Parser.prototype = parser;parser.Parser = Parser;
+ return new Parser();
+ })();exports.__esModule = true;
+ exports['default'] = handlebars;
+
+/***/ },
+/* 24 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+
+ var _visitor = __webpack_require__(25);
+
+ var _visitor2 = _interopRequireDefault(_visitor);
+
+ function WhitespaceControl() {
+ var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
+
+ this.options = options;
+ }
+ WhitespaceControl.prototype = new _visitor2['default']();
+
+ WhitespaceControl.prototype.Program = function (program) {
+ var doStandalone = !this.options.ignoreStandalone;
+
+ var isRoot = !this.isRootSeen;
+ this.isRootSeen = true;
+
+ var body = program.body;
+ for (var i = 0, l = body.length; i < l; i++) {
+ var current = body[i],
+ strip = this.accept(current);
+
+ if (!strip) {
+ continue;
+ }
+
+ var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
+ _isNextWhitespace = isNextWhitespace(body, i, isRoot),
+ openStandalone = strip.openStandalone && _isPrevWhitespace,
+ closeStandalone = strip.closeStandalone && _isNextWhitespace,
+ inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
+
+ if (strip.close) {
+ omitRight(body, i, true);
+ }
+ if (strip.open) {
+ omitLeft(body, i, true);
+ }
+
+ if (doStandalone && inlineStandalone) {
+ omitRight(body, i);
+
+ if (omitLeft(body, i)) {
+ // If we are on a standalone node, save the indent info for partials
+ if (current.type === 'PartialStatement') {
+ // Pull out the whitespace from the final line
+ current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
+ }
+ }
+ }
+ if (doStandalone && openStandalone) {
+ omitRight((current.program || current.inverse).body);
+
+ // Strip out the previous content node if it's whitespace only
+ omitLeft(body, i);
+ }
+ if (doStandalone && closeStandalone) {
+ // Always strip the next node
+ omitRight(body, i);
+
+ omitLeft((current.inverse || current.program).body);
+ }
+ }
+
+ return program;
+ };
+
+ WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
+ this.accept(block.program);
+ this.accept(block.inverse);
+
+ // Find the inverse program that is involed with whitespace stripping.
+ var program = block.program || block.inverse,
+ inverse = block.program && block.inverse,
+ firstInverse = inverse,
+ lastInverse = inverse;
+
+ if (inverse && inverse.chained) {
+ firstInverse = inverse.body[0].program;
+
+ // Walk the inverse chain to find the last inverse that is actually in the chain.
+ while (lastInverse.chained) {
+ lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
+ }
+ }
+
+ var strip = {
+ open: block.openStrip.open,
+ close: block.closeStrip.close,
+
+ // Determine the standalone candiacy. Basically flag our content as being possibly standalone
+ // so our parent can determine if we actually are standalone
+ openStandalone: isNextWhitespace(program.body),
+ closeStandalone: isPrevWhitespace((firstInverse || program).body)
+ };
+
+ if (block.openStrip.close) {
+ omitRight(program.body, null, true);
+ }
+
+ if (inverse) {
+ var inverseStrip = block.inverseStrip;
+
+ if (inverseStrip.open) {
+ omitLeft(program.body, null, true);
+ }
+
+ if (inverseStrip.close) {
+ omitRight(firstInverse.body, null, true);
+ }
+ if (block.closeStrip.open) {
+ omitLeft(lastInverse.body, null, true);
+ }
+
+ // Find standalone else statments
+ if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
+ omitLeft(program.body);
+ omitRight(firstInverse.body);
+ }
+ } else if (block.closeStrip.open) {
+ omitLeft(program.body, null, true);
+ }
+
+ return strip;
+ };
+
+ WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
+ return mustache.strip;
+ };
+
+ WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
+ /* istanbul ignore next */
+ var strip = node.strip || {};
+ return {
+ inlineStandalone: true,
+ open: strip.open,
+ close: strip.close
+ };
+ };
+
+ function isPrevWhitespace(body, i, isRoot) {
+ if (i === undefined) {
+ i = body.length;
+ }
+
+ // Nodes that end with newlines are considered whitespace (but are special
+ // cased for strip operations)
+ var prev = body[i - 1],
+ sibling = body[i - 2];
+ if (!prev) {
+ return isRoot;
+ }
+
+ if (prev.type === 'ContentStatement') {
+ return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
+ }
+ }
+ function isNextWhitespace(body, i, isRoot) {
+ if (i === undefined) {
+ i = -1;
+ }
+
+ var next = body[i + 1],
+ sibling = body[i + 2];
+ if (!next) {
+ return isRoot;
+ }
+
+ if (next.type === 'ContentStatement') {
+ return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
+ }
+ }
+
+ // Marks the node to the right of the position as omitted.
+ // I.e. {{foo}}' ' will mark the ' ' node as omitted.
+ //
+ // If i is undefined, then the first child will be marked as such.
+ //
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
+ // content is met.
+ function omitRight(body, i, multiple) {
+ var current = body[i == null ? 0 : i + 1];
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
+ return;
+ }
+
+ var original = current.value;
+ current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
+ current.rightStripped = current.value !== original;
+ }
+
+ // Marks the node to the left of the position as omitted.
+ // I.e. ' '{{foo}} will mark the ' ' node as omitted.
+ //
+ // If i is undefined then the last child will be marked as such.
+ //
+ // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
+ // content is met.
+ function omitLeft(body, i, multiple) {
+ var current = body[i == null ? body.length - 1 : i - 1];
+ if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
+ return;
+ }
+
+ // We omit the last node if it's whitespace only and not preceeded by a non-content node.
+ var original = current.value;
+ current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
+ current.leftStripped = current.value !== original;
+ return current.leftStripped;
+ }
+
+ exports['default'] = WhitespaceControl;
+ module.exports = exports['default'];
+
+/***/ },
+/* 25 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ function Visitor() {
+ this.parents = [];
+ }
+
+ Visitor.prototype = {
+ constructor: Visitor,
+ mutating: false,
+
+ // Visits a given value. If mutating, will replace the value if necessary.
+ acceptKey: function acceptKey(node, name) {
+ var value = this.accept(node[name]);
+ if (this.mutating) {
+ // Hacky sanity check: This may have a few false positives for type for the helper
+ // methods but will generally do the right thing without a lot of overhead.
+ if (value && !Visitor.prototype[value.type]) {
+ throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
+ }
+ node[name] = value;
+ }
+ },
+
+ // Performs an accept operation with added sanity check to ensure
+ // required keys are not removed.
+ acceptRequired: function acceptRequired(node, name) {
+ this.acceptKey(node, name);
+
+ if (!node[name]) {
+ throw new _exception2['default'](node.type + ' requires ' + name);
+ }
+ },
+
+ // Traverses a given array. If mutating, empty respnses will be removed
+ // for child elements.
+ acceptArray: function acceptArray(array) {
+ for (var i = 0, l = array.length; i < l; i++) {
+ this.acceptKey(array, i);
+
+ if (!array[i]) {
+ array.splice(i, 1);
+ i--;
+ l--;
+ }
+ }
+ },
+
+ accept: function accept(object) {
+ if (!object) {
+ return;
+ }
+
+ /* istanbul ignore next: Sanity code */
+ if (!this[object.type]) {
+ throw new _exception2['default']('Unknown type: ' + object.type, object);
+ }
+
+ if (this.current) {
+ this.parents.unshift(this.current);
+ }
+ this.current = object;
+
+ var ret = this[object.type](object);
+
+ this.current = this.parents.shift();
+
+ if (!this.mutating || ret) {
+ return ret;
+ } else if (ret !== false) {
+ return object;
+ }
+ },
+
+ Program: function Program(program) {
+ this.acceptArray(program.body);
+ },
+
+ MustacheStatement: visitSubExpression,
+ Decorator: visitSubExpression,
+
+ BlockStatement: visitBlock,
+ DecoratorBlock: visitBlock,
+
+ PartialStatement: visitPartial,
+ PartialBlockStatement: function PartialBlockStatement(partial) {
+ visitPartial.call(this, partial);
+
+ this.acceptKey(partial, 'program');
+ },
+
+ ContentStatement: function ContentStatement() /* content */{},
+ CommentStatement: function CommentStatement() /* comment */{},
+
+ SubExpression: visitSubExpression,
+
+ PathExpression: function PathExpression() /* path */{},
+
+ StringLiteral: function StringLiteral() /* string */{},
+ NumberLiteral: function NumberLiteral() /* number */{},
+ BooleanLiteral: function BooleanLiteral() /* bool */{},
+ UndefinedLiteral: function UndefinedLiteral() /* literal */{},
+ NullLiteral: function NullLiteral() /* literal */{},
+
+ Hash: function Hash(hash) {
+ this.acceptArray(hash.pairs);
+ },
+ HashPair: function HashPair(pair) {
+ this.acceptRequired(pair, 'value');
+ }
+ };
+
+ function visitSubExpression(mustache) {
+ this.acceptRequired(mustache, 'path');
+ this.acceptArray(mustache.params);
+ this.acceptKey(mustache, 'hash');
+ }
+ function visitBlock(block) {
+ visitSubExpression.call(this, block);
+
+ this.acceptKey(block, 'program');
+ this.acceptKey(block, 'inverse');
+ }
+ function visitPartial(partial) {
+ this.acceptRequired(partial, 'name');
+ this.acceptArray(partial.params);
+ this.acceptKey(partial, 'hash');
+ }
+
+ exports['default'] = Visitor;
+ module.exports = exports['default'];
+
+/***/ },
+/* 26 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+ exports.SourceLocation = SourceLocation;
+ exports.id = id;
+ exports.stripFlags = stripFlags;
+ exports.stripComment = stripComment;
+ exports.preparePath = preparePath;
+ exports.prepareMustache = prepareMustache;
+ exports.prepareRawBlock = prepareRawBlock;
+ exports.prepareBlock = prepareBlock;
+ exports.prepareProgram = prepareProgram;
+ exports.preparePartialBlock = preparePartialBlock;
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ function validateClose(open, close) {
+ close = close.path ? close.path.original : close;
+
+ if (open.path.original !== close) {
+ var errorNode = { loc: open.path.loc };
+
+ throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
+ }
+ }
+
+ function SourceLocation(source, locInfo) {
+ this.source = source;
+ this.start = {
+ line: locInfo.first_line,
+ column: locInfo.first_column
+ };
+ this.end = {
+ line: locInfo.last_line,
+ column: locInfo.last_column
+ };
+ }
+
+ function id(token) {
+ if (/^\[.*\]$/.test(token)) {
+ return token.substr(1, token.length - 2);
+ } else {
+ return token;
+ }
+ }
+
+ function stripFlags(open, close) {
+ return {
+ open: open.charAt(2) === '~',
+ close: close.charAt(close.length - 3) === '~'
+ };
+ }
+
+ function stripComment(comment) {
+ return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, '');
+ }
+
+ function preparePath(data, parts, loc) {
+ loc = this.locInfo(loc);
+
+ var original = data ? '@' : '',
+ dig = [],
+ depth = 0,
+ depthString = '';
+
+ for (var i = 0, l = parts.length; i < l; i++) {
+ var part = parts[i].part,
+
+ // If we have [] syntax then we do not treat path references as operators,
+ // i.e. foo.[this] resolves to approximately context.foo['this']
+ isLiteral = parts[i].original !== part;
+ original += (parts[i].separator || '') + part;
+
+ if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
+ if (dig.length > 0) {
+ throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
+ } else if (part === '..') {
+ depth++;
+ depthString += '../';
+ }
+ } else {
+ dig.push(part);
+ }
+ }
+
+ return {
+ type: 'PathExpression',
+ data: data,
+ depth: depth,
+ parts: dig,
+ original: original,
+ loc: loc
+ };
+ }
+
+ function prepareMustache(path, params, hash, open, strip, locInfo) {
+ // Must use charAt to support IE pre-10
+ var escapeFlag = open.charAt(3) || open.charAt(2),
+ escaped = escapeFlag !== '{' && escapeFlag !== '&';
+
+ var decorator = /\*/.test(open);
+ return {
+ type: decorator ? 'Decorator' : 'MustacheStatement',
+ path: path,
+ params: params,
+ hash: hash,
+ escaped: escaped,
+ strip: strip,
+ loc: this.locInfo(locInfo)
+ };
+ }
+
+ function prepareRawBlock(openRawBlock, contents, close, locInfo) {
+ validateClose(openRawBlock, close);
+
+ locInfo = this.locInfo(locInfo);
+ var program = {
+ type: 'Program',
+ body: contents,
+ strip: {},
+ loc: locInfo
+ };
+
+ return {
+ type: 'BlockStatement',
+ path: openRawBlock.path,
+ params: openRawBlock.params,
+ hash: openRawBlock.hash,
+ program: program,
+ openStrip: {},
+ inverseStrip: {},
+ closeStrip: {},
+ loc: locInfo
+ };
+ }
+
+ function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
+ if (close && close.path) {
+ validateClose(openBlock, close);
+ }
+
+ var decorator = /\*/.test(openBlock.open);
+
+ program.blockParams = openBlock.blockParams;
+
+ var inverse = undefined,
+ inverseStrip = undefined;
+
+ if (inverseAndProgram) {
+ if (decorator) {
+ throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
+ }
+
+ if (inverseAndProgram.chain) {
+ inverseAndProgram.program.body[0].closeStrip = close.strip;
+ }
+
+ inverseStrip = inverseAndProgram.strip;
+ inverse = inverseAndProgram.program;
+ }
+
+ if (inverted) {
+ inverted = inverse;
+ inverse = program;
+ program = inverted;
+ }
+
+ return {
+ type: decorator ? 'DecoratorBlock' : 'BlockStatement',
+ path: openBlock.path,
+ params: openBlock.params,
+ hash: openBlock.hash,
+ program: program,
+ inverse: inverse,
+ openStrip: openBlock.strip,
+ inverseStrip: inverseStrip,
+ closeStrip: close && close.strip,
+ loc: this.locInfo(locInfo)
+ };
+ }
+
+ function prepareProgram(statements, loc) {
+ if (!loc && statements.length) {
+ var firstLoc = statements[0].loc,
+ lastLoc = statements[statements.length - 1].loc;
+
+ /* istanbul ignore else */
+ if (firstLoc && lastLoc) {
+ loc = {
+ source: firstLoc.source,
+ start: {
+ line: firstLoc.start.line,
+ column: firstLoc.start.column
+ },
+ end: {
+ line: lastLoc.end.line,
+ column: lastLoc.end.column
+ }
+ };
+ }
+ }
+
+ return {
+ type: 'Program',
+ body: statements,
+ strip: {},
+ loc: loc
+ };
+ }
+
+ function preparePartialBlock(open, program, close, locInfo) {
+ validateClose(open, close);
+
+ return {
+ type: 'PartialBlockStatement',
+ name: open.path,
+ params: open.params,
+ hash: open.hash,
+ program: program,
+ openStrip: open.strip,
+ closeStrip: close && close.strip,
+ loc: this.locInfo(locInfo)
+ };
+ }
+
+/***/ },
+/* 27 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* eslint-disable new-cap */
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+ exports.Compiler = Compiler;
+ exports.precompile = precompile;
+ exports.compile = compile;
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ var _utils = __webpack_require__(5);
+
+ var _ast = __webpack_require__(21);
+
+ var _ast2 = _interopRequireDefault(_ast);
+
+ var slice = [].slice;
+
+ function Compiler() {}
+
+ // the foundHelper register will disambiguate helper lookup from finding a
+ // function in a context. This is necessary for mustache compatibility, which
+ // requires that context functions in blocks are evaluated by blockHelperMissing,
+ // and then proceed as if the resulting value was provided to blockHelperMissing.
+
+ Compiler.prototype = {
+ compiler: Compiler,
+
+ equals: function equals(other) {
+ var len = this.opcodes.length;
+ if (other.opcodes.length !== len) {
+ return false;
+ }
+
+ for (var i = 0; i < len; i++) {
+ var opcode = this.opcodes[i],
+ otherOpcode = other.opcodes[i];
+ if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
+ return false;
+ }
+ }
+
+ // We know that length is the same between the two arrays because they are directly tied
+ // to the opcode behavior above.
+ len = this.children.length;
+ for (var i = 0; i < len; i++) {
+ if (!this.children[i].equals(other.children[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ guid: 0,
+
+ compile: function compile(program, options) {
+ this.sourceNode = [];
+ this.opcodes = [];
+ this.children = [];
+ this.options = options;
+ this.stringParams = options.stringParams;
+ this.trackIds = options.trackIds;
+
+ options.blockParams = options.blockParams || [];
+
+ // These changes will propagate to the other compiler components
+ var knownHelpers = options.knownHelpers;
+ options.knownHelpers = {
+ 'helperMissing': true,
+ 'blockHelperMissing': true,
+ 'each': true,
+ 'if': true,
+ 'unless': true,
+ 'with': true,
+ 'log': true,
+ 'lookup': true
+ };
+ if (knownHelpers) {
+ for (var _name in knownHelpers) {
+ /* istanbul ignore else */
+ if (_name in knownHelpers) {
+ options.knownHelpers[_name] = knownHelpers[_name];
+ }
+ }
+ }
+
+ return this.accept(program);
+ },
+
+ compileProgram: function compileProgram(program) {
+ var childCompiler = new this.compiler(),
+ // eslint-disable-line new-cap
+ result = childCompiler.compile(program, this.options),
+ guid = this.guid++;
+
+ this.usePartial = this.usePartial || result.usePartial;
+
+ this.children[guid] = result;
+ this.useDepths = this.useDepths || result.useDepths;
+
+ return guid;
+ },
+
+ accept: function accept(node) {
+ /* istanbul ignore next: Sanity code */
+ if (!this[node.type]) {
+ throw new _exception2['default']('Unknown type: ' + node.type, node);
+ }
+
+ this.sourceNode.unshift(node);
+ var ret = this[node.type](node);
+ this.sourceNode.shift();
+ return ret;
+ },
+
+ Program: function Program(program) {
+ this.options.blockParams.unshift(program.blockParams);
+
+ var body = program.body,
+ bodyLength = body.length;
+ for (var i = 0; i < bodyLength; i++) {
+ this.accept(body[i]);
+ }
+
+ this.options.blockParams.shift();
+
+ this.isSimple = bodyLength === 1;
+ this.blockParams = program.blockParams ? program.blockParams.length : 0;
+
+ return this;
+ },
+
+ BlockStatement: function BlockStatement(block) {
+ transformLiteralToPath(block);
+
+ var program = block.program,
+ inverse = block.inverse;
+
+ program = program && this.compileProgram(program);
+ inverse = inverse && this.compileProgram(inverse);
+
+ var type = this.classifySexpr(block);
+
+ if (type === 'helper') {
+ this.helperSexpr(block, program, inverse);
+ } else if (type === 'simple') {
+ this.simpleSexpr(block);
+
+ // now that the simple mustache is resolved, we need to
+ // evaluate it by executing `blockHelperMissing`
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+ this.opcode('emptyHash');
+ this.opcode('blockValue', block.path.original);
+ } else {
+ this.ambiguousSexpr(block, program, inverse);
+
+ // now that the simple mustache is resolved, we need to
+ // evaluate it by executing `blockHelperMissing`
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+ this.opcode('emptyHash');
+ this.opcode('ambiguousBlockValue');
+ }
+
+ this.opcode('append');
+ },
+
+ DecoratorBlock: function DecoratorBlock(decorator) {
+ var program = decorator.program && this.compileProgram(decorator.program);
+ var params = this.setupFullMustacheParams(decorator, program, undefined),
+ path = decorator.path;
+
+ this.useDecorators = true;
+ this.opcode('registerDecorator', params.length, path.original);
+ },
+
+ PartialStatement: function PartialStatement(partial) {
+ this.usePartial = true;
+
+ var program = partial.program;
+ if (program) {
+ program = this.compileProgram(partial.program);
+ }
+
+ var params = partial.params;
+ if (params.length > 1) {
+ throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
+ } else if (!params.length) {
+ if (this.options.explicitPartialContext) {
+ this.opcode('pushLiteral', 'undefined');
+ } else {
+ params.push({ type: 'PathExpression', parts: [], depth: 0 });
+ }
+ }
+
+ var partialName = partial.name.original,
+ isDynamic = partial.name.type === 'SubExpression';
+ if (isDynamic) {
+ this.accept(partial.name);
+ }
+
+ this.setupFullMustacheParams(partial, program, undefined, true);
+
+ var indent = partial.indent || '';
+ if (this.options.preventIndent && indent) {
+ this.opcode('appendContent', indent);
+ indent = '';
+ }
+
+ this.opcode('invokePartial', isDynamic, partialName, indent);
+ this.opcode('append');
+ },
+ PartialBlockStatement: function PartialBlockStatement(partialBlock) {
+ this.PartialStatement(partialBlock);
+ },
+
+ MustacheStatement: function MustacheStatement(mustache) {
+ this.SubExpression(mustache);
+
+ if (mustache.escaped && !this.options.noEscape) {
+ this.opcode('appendEscaped');
+ } else {
+ this.opcode('append');
+ }
+ },
+ Decorator: function Decorator(decorator) {
+ this.DecoratorBlock(decorator);
+ },
+
+ ContentStatement: function ContentStatement(content) {
+ if (content.value) {
+ this.opcode('appendContent', content.value);
+ }
+ },
+
+ CommentStatement: function CommentStatement() {},
+
+ SubExpression: function SubExpression(sexpr) {
+ transformLiteralToPath(sexpr);
+ var type = this.classifySexpr(sexpr);
+
+ if (type === 'simple') {
+ this.simpleSexpr(sexpr);
+ } else if (type === 'helper') {
+ this.helperSexpr(sexpr);
+ } else {
+ this.ambiguousSexpr(sexpr);
+ }
+ },
+ ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
+ var path = sexpr.path,
+ name = path.parts[0],
+ isBlock = program != null || inverse != null;
+
+ this.opcode('getContext', path.depth);
+
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+
+ path.strict = true;
+ this.accept(path);
+
+ this.opcode('invokeAmbiguous', name, isBlock);
+ },
+
+ simpleSexpr: function simpleSexpr(sexpr) {
+ var path = sexpr.path;
+ path.strict = true;
+ this.accept(path);
+ this.opcode('resolvePossibleLambda');
+ },
+
+ helperSexpr: function helperSexpr(sexpr, program, inverse) {
+ var params = this.setupFullMustacheParams(sexpr, program, inverse),
+ path = sexpr.path,
+ name = path.parts[0];
+
+ if (this.options.knownHelpers[name]) {
+ this.opcode('invokeKnownHelper', params.length, name);
+ } else if (this.options.knownHelpersOnly) {
+ throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
+ } else {
+ path.strict = true;
+ path.falsy = true;
+
+ this.accept(path);
+ this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
+ }
+ },
+
+ PathExpression: function PathExpression(path) {
+ this.addDepth(path.depth);
+ this.opcode('getContext', path.depth);
+
+ var name = path.parts[0],
+ scoped = _ast2['default'].helpers.scopedId(path),
+ blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
+
+ if (blockParamId) {
+ this.opcode('lookupBlockParam', blockParamId, path.parts);
+ } else if (!name) {
+ // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
+ this.opcode('pushContext');
+ } else if (path.data) {
+ this.options.data = true;
+ this.opcode('lookupData', path.depth, path.parts, path.strict);
+ } else {
+ this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
+ }
+ },
+
+ StringLiteral: function StringLiteral(string) {
+ this.opcode('pushString', string.value);
+ },
+
+ NumberLiteral: function NumberLiteral(number) {
+ this.opcode('pushLiteral', number.value);
+ },
+
+ BooleanLiteral: function BooleanLiteral(bool) {
+ this.opcode('pushLiteral', bool.value);
+ },
+
+ UndefinedLiteral: function UndefinedLiteral() {
+ this.opcode('pushLiteral', 'undefined');
+ },
+
+ NullLiteral: function NullLiteral() {
+ this.opcode('pushLiteral', 'null');
+ },
+
+ Hash: function Hash(hash) {
+ var pairs = hash.pairs,
+ i = 0,
+ l = pairs.length;
+
+ this.opcode('pushHash');
+
+ for (; i < l; i++) {
+ this.pushParam(pairs[i].value);
+ }
+ while (i--) {
+ this.opcode('assignToHash', pairs[i].key);
+ }
+ this.opcode('popHash');
+ },
+
+ // HELPERS
+ opcode: function opcode(name) {
+ this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc });
+ },
+
+ addDepth: function addDepth(depth) {
+ if (!depth) {
+ return;
+ }
+
+ this.useDepths = true;
+ },
+
+ classifySexpr: function classifySexpr(sexpr) {
+ var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
+
+ var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
+
+ // a mustache is an eligible helper if:
+ // * its id is simple (a single part, not `this` or `..`)
+ var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
+
+ // if a mustache is an eligible helper but not a definite
+ // helper, it is ambiguous, and will be resolved in a later
+ // pass or at runtime.
+ var isEligible = !isBlockParam && (isHelper || isSimple);
+
+ // if ambiguous, we can possibly resolve the ambiguity now
+ // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
+ if (isEligible && !isHelper) {
+ var _name2 = sexpr.path.parts[0],
+ options = this.options;
+
+ if (options.knownHelpers[_name2]) {
+ isHelper = true;
+ } else if (options.knownHelpersOnly) {
+ isEligible = false;
+ }
+ }
+
+ if (isHelper) {
+ return 'helper';
+ } else if (isEligible) {
+ return 'ambiguous';
+ } else {
+ return 'simple';
+ }
+ },
+
+ pushParams: function pushParams(params) {
+ for (var i = 0, l = params.length; i < l; i++) {
+ this.pushParam(params[i]);
+ }
+ },
+
+ pushParam: function pushParam(val) {
+ var value = val.value != null ? val.value : val.original || '';
+
+ if (this.stringParams) {
+ if (value.replace) {
+ value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
+ }
+
+ if (val.depth) {
+ this.addDepth(val.depth);
+ }
+ this.opcode('getContext', val.depth || 0);
+ this.opcode('pushStringParam', value, val.type);
+
+ if (val.type === 'SubExpression') {
+ // SubExpressions get evaluated and passed in
+ // in string params mode.
+ this.accept(val);
+ }
+ } else {
+ if (this.trackIds) {
+ var blockParamIndex = undefined;
+ if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
+ blockParamIndex = this.blockParamIndex(val.parts[0]);
+ }
+ if (blockParamIndex) {
+ var blockParamChild = val.parts.slice(1).join('.');
+ this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
+ } else {
+ value = val.original || value;
+ if (value.replace) {
+ value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
+ }
+
+ this.opcode('pushId', val.type, value);
+ }
+ }
+ this.accept(val);
+ }
+ },
+
+ setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
+ var params = sexpr.params;
+ this.pushParams(params);
+
+ this.opcode('pushProgram', program);
+ this.opcode('pushProgram', inverse);
+
+ if (sexpr.hash) {
+ this.accept(sexpr.hash);
+ } else {
+ this.opcode('emptyHash', omitEmpty);
+ }
+
+ return params;
+ },
+
+ blockParamIndex: function blockParamIndex(name) {
+ for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
+ var blockParams = this.options.blockParams[depth],
+ param = blockParams && _utils.indexOf(blockParams, name);
+ if (blockParams && param >= 0) {
+ return [depth, param];
+ }
+ }
+ }
+ };
+
+ function precompile(input, options, env) {
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
+ throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
+ }
+
+ options = options || {};
+ if (!('data' in options)) {
+ options.data = true;
+ }
+ if (options.compat) {
+ options.useDepths = true;
+ }
+
+ var ast = env.parse(input, options),
+ environment = new env.Compiler().compile(ast, options);
+ return new env.JavaScriptCompiler().compile(environment, options);
+ }
+
+ function compile(input, options, env) {
+ if (options === undefined) options = {};
+
+ if (input == null || typeof input !== 'string' && input.type !== 'Program') {
+ throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
+ }
+
+ if (!('data' in options)) {
+ options.data = true;
+ }
+ if (options.compat) {
+ options.useDepths = true;
+ }
+
+ var compiled = undefined;
+
+ function compileInput() {
+ var ast = env.parse(input, options),
+ environment = new env.Compiler().compile(ast, options),
+ templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
+ return env.template(templateSpec);
+ }
+
+ // Template is only compiled on first use and cached after that point.
+ function ret(context, execOptions) {
+ if (!compiled) {
+ compiled = compileInput();
+ }
+ return compiled.call(this, context, execOptions);
+ }
+ ret._setup = function (setupOptions) {
+ if (!compiled) {
+ compiled = compileInput();
+ }
+ return compiled._setup(setupOptions);
+ };
+ ret._child = function (i, data, blockParams, depths) {
+ if (!compiled) {
+ compiled = compileInput();
+ }
+ return compiled._child(i, data, blockParams, depths);
+ };
+ return ret;
+ }
+
+ function argEquals(a, b) {
+ if (a === b) {
+ return true;
+ }
+
+ if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
+ for (var i = 0; i < a.length; i++) {
+ if (!argEquals(a[i], b[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
+ function transformLiteralToPath(sexpr) {
+ if (!sexpr.path.parts) {
+ var literal = sexpr.path;
+ // Casting to string here to make false and 0 literal values play nicely with the rest
+ // of the system.
+ sexpr.path = {
+ type: 'PathExpression',
+ data: false,
+ depth: 0,
+ parts: [literal.original + ''],
+ original: literal.original + '',
+ loc: literal.loc
+ };
+ }
+ }
+
+/***/ },
+/* 28 */
+/***/ function(module, exports, __webpack_require__) {
+
+ 'use strict';
+
+ var _interopRequireDefault = __webpack_require__(1)['default'];
+
+ exports.__esModule = true;
+
+ var _base = __webpack_require__(4);
+
+ var _exception = __webpack_require__(6);
+
+ var _exception2 = _interopRequireDefault(_exception);
+
+ var _utils = __webpack_require__(5);
+
+ var _codeGen = __webpack_require__(29);
+
+ var _codeGen2 = _interopRequireDefault(_codeGen);
+
+ function Literal(value) {
+ this.value = value;
+ }
+
+ function JavaScriptCompiler() {}
+
+ JavaScriptCompiler.prototype = {
+ // PUBLIC API: You can override these methods in a subclass to provide
+ // alternative compiled forms for name lookup and buffering semantics
+ nameLookup: function nameLookup(parent, name /* , type*/) {
+ if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
+ return [parent, '.', name];
+ } else {
+ return [parent, '[', JSON.stringify(name), ']'];
+ }
+ },
+ depthedLookup: function depthedLookup(name) {
+ return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
+ },
+
+ compilerInfo: function compilerInfo() {
+ var revision = _base.COMPILER_REVISION,
+ versions = _base.REVISION_CHANGES[revision];
+ return [revision, versions];
+ },
+
+ appendToBuffer: function appendToBuffer(source, location, explicit) {
+ // Force a source as this simplifies the merge logic.
+ if (!_utils.isArray(source)) {
+ source = [source];
+ }
+ source = this.source.wrap(source, location);
+
+ if (this.environment.isSimple) {
+ return ['return ', source, ';'];
+ } else if (explicit) {
+ // This is a case where the buffer operation occurs as a child of another
+ // construct, generally braces. We have to explicitly output these buffer
+ // operations to ensure that the emitted code goes in the correct location.
+ return ['buffer += ', source, ';'];
+ } else {
+ source.appendToBuffer = true;
+ return source;
+ }
+ },
+
+ initializeBuffer: function initializeBuffer() {
+ return this.quotedString('');
+ },
+ // END PUBLIC API
+
+ compile: function compile(environment, options, context, asObject) {
+ this.environment = environment;
+ this.options = options;
+ this.stringParams = this.options.stringParams;
+ this.trackIds = this.options.trackIds;
+ this.precompile = !asObject;
+
+ this.name = this.environment.name;
+ this.isChild = !!context;
+ this.context = context || {
+ decorators: [],
+ programs: [],
+ environments: []
+ };
+
+ this.preamble();
+
+ this.stackSlot = 0;
+ this.stackVars = [];
+ this.aliases = {};
+ this.registers = { list: [] };
+ this.hashes = [];
+ this.compileStack = [];
+ this.inlineStack = [];
+ this.blockParams = [];
+
+ this.compileChildren(environment, options);
+
+ this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
+ this.useBlockParams = this.useBlockParams || environment.useBlockParams;
+
+ var opcodes = environment.opcodes,
+ opcode = undefined,
+ firstLoc = undefined,
+ i = undefined,
+ l = undefined;
+
+ for (i = 0, l = opcodes.length; i < l; i++) {
+ opcode = opcodes[i];
+
+ this.source.currentLocation = opcode.loc;
+ firstLoc = firstLoc || opcode.loc;
+ this[opcode.opcode].apply(this, opcode.args);
+ }
+
+ // Flush any trailing content that might be pending.
+ this.source.currentLocation = firstLoc;
+ this.pushSource('');
+
+ /* istanbul ignore next */
+ if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
+ throw new _exception2['default']('Compile completed with content left on stack');
+ }
+
+ if (!this.decorators.isEmpty()) {
+ this.useDecorators = true;
+
+ this.decorators.prepend('var decorators = container.decorators;\n');
+ this.decorators.push('return fn;');
+
+ if (asObject) {
+ this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
+ } else {
+ this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
+ this.decorators.push('}\n');
+ this.decorators = this.decorators.merge();
+ }
+ } else {
+ this.decorators = undefined;
+ }
+
+ var fn = this.createFunctionContext(asObject);
+ if (!this.isChild) {
+ var ret = {
+ compiler: this.compilerInfo(),
+ main: fn
+ };
+
+ if (this.decorators) {
+ ret.main_d = this.decorators; // eslint-disable-line camelcase
+ ret.useDecorators = true;
+ }
+
+ var _context = this.context;
+ var programs = _context.programs;
+ var decorators = _context.decorators;
+
+ for (i = 0, l = programs.length; i < l; i++) {
+ if (programs[i]) {
+ ret[i] = programs[i];
+ if (decorators[i]) {
+ ret[i + '_d'] = decorators[i];
+ ret.useDecorators = true;
+ }
+ }
+ }
+
+ if (this.environment.usePartial) {
+ ret.usePartial = true;
+ }
+ if (this.options.data) {
+ ret.useData = true;
+ }
+ if (this.useDepths) {
+ ret.useDepths = true;
+ }
+ if (this.useBlockParams) {
+ ret.useBlockParams = true;
+ }
+ if (this.options.compat) {
+ ret.compat = true;
+ }
+
+ if (!asObject) {
+ ret.compiler = JSON.stringify(ret.compiler);
+
+ this.source.currentLocation = { start: { line: 1, column: 0 } };
+ ret = this.objectLiteral(ret);
+
+ if (options.srcName) {
+ ret = ret.toStringWithSourceMap({ file: options.destName });
+ ret.map = ret.map && ret.map.toString();
+ } else {
+ ret = ret.toString();
+ }
+ } else {
+ ret.compilerOptions = this.options;
+ }
+
+ return ret;
+ } else {
+ return fn;
+ }
+ },
+
+ preamble: function preamble() {
+ // track the last context pushed into place to allow skipping the
+ // getContext opcode when it would be a noop
+ this.lastContext = 0;
+ this.source = new _codeGen2['default'](this.options.srcName);
+ this.decorators = new _codeGen2['default'](this.options.srcName);
+ },
+
+ createFunctionContext: function createFunctionContext(asObject) {
+ var varDeclarations = '';
+
+ var locals = this.stackVars.concat(this.registers.list);
+ if (locals.length > 0) {
+ varDeclarations += ', ' + locals.join(', ');
+ }
+
+ // Generate minimizer alias mappings
+ //
+ // When using true SourceNodes, this will update all references to the given alias
+ // as the source nodes are reused in situ. For the non-source node compilation mode,
+ // aliases will not be used, but this case is already being run on the client and
+ // we aren't concern about minimizing the template size.
+ var aliasCount = 0;
+ for (var alias in this.aliases) {
+ // eslint-disable-line guard-for-in
+ var node = this.aliases[alias];
+
+ if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) {
+ varDeclarations += ', alias' + ++aliasCount + '=' + alias;
+ node.children[0] = 'alias' + aliasCount;
+ }
+ }
+
+ var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
+
+ if (this.useBlockParams || this.useDepths) {
+ params.push('blockParams');
+ }
+ if (this.useDepths) {
+ params.push('depths');
+ }
+
+ // Perform a second pass over the output to merge content when possible
+ var source = this.mergeSource(varDeclarations);
+
+ if (asObject) {
+ params.push(source);
+
+ return Function.apply(this, params);
+ } else {
+ return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
+ }
+ },
+ mergeSource: function mergeSource(varDeclarations) {
+ var isSimple = this.environment.isSimple,
+ appendOnly = !this.forceBuffer,
+ appendFirst = undefined,
+ sourceSeen = undefined,
+ bufferStart = undefined,
+ bufferEnd = undefined;
+ this.source.each(function (line) {
+ if (line.appendToBuffer) {
+ if (bufferStart) {
+ line.prepend(' + ');
+ } else {
+ bufferStart = line;
+ }
+ bufferEnd = line;
+ } else {
+ if (bufferStart) {
+ if (!sourceSeen) {
+ appendFirst = true;
+ } else {
+ bufferStart.prepend('buffer += ');
+ }
+ bufferEnd.add(';');
+ bufferStart = bufferEnd = undefined;
+ }
+
+ sourceSeen = true;
+ if (!isSimple) {
+ appendOnly = false;
+ }
+ }
+ });
+
+ if (appendOnly) {
+ if (bufferStart) {
+ bufferStart.prepend('return ');
+ bufferEnd.add(';');
+ } else if (!sourceSeen) {
+ this.source.push('return "";');
+ }
+ } else {
+ varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
+
+ if (bufferStart) {
+ bufferStart.prepend('return buffer + ');
+ bufferEnd.add(';');
+ } else {
+ this.source.push('return buffer;');
+ }
+ }
+
+ if (varDeclarations) {
+ this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
+ }
+
+ return this.source.merge();
+ },
+
+ // [blockValue]
+ //
+ // On stack, before: hash, inverse, program, value
+ // On stack, after: return value of blockHelperMissing
+ //
+ // The purpose of this opcode is to take a block of the form
+ // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
+ // replace it on the stack with the result of properly
+ // invoking blockHelperMissing.
+ blockValue: function blockValue(name) {
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
+ params = [this.contextName(0)];
+ this.setupHelperArgs(name, 0, params);
+
+ var blockName = this.popStack();
+ params.splice(1, 0, blockName);
+
+ this.push(this.source.functionCall(blockHelperMissing, 'call', params));
+ },
+
+ // [ambiguousBlockValue]
+ //
+ // On stack, before: hash, inverse, program, value
+ // Compiler value, before: lastHelper=value of last found helper, if any
+ // On stack, after, if no lastHelper: same as [blockValue]
+ // On stack, after, if lastHelper: value
+ ambiguousBlockValue: function ambiguousBlockValue() {
+ // We're being a bit cheeky and reusing the options value from the prior exec
+ var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
+ params = [this.contextName(0)];
+ this.setupHelperArgs('', 0, params, true);
+
+ this.flushInline();
+
+ var current = this.topStack();
+ params.splice(1, 0, current);
+
+ this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
+ },
+
+ // [appendContent]
+ //
+ // On stack, before: ...
+ // On stack, after: ...
+ //
+ // Appends the string value of `content` to the current buffer
+ appendContent: function appendContent(content) {
+ if (this.pendingContent) {
+ content = this.pendingContent + content;
+ } else {
+ this.pendingLocation = this.source.currentLocation;
+ }
+
+ this.pendingContent = content;
+ },
+
+ // [append]
+ //
+ // On stack, before: value, ...
+ // On stack, after: ...
+ //
+ // Coerces `value` to a String and appends it to the current buffer.
+ //
+ // If `value` is truthy, or 0, it is coerced into a string and appended
+ // Otherwise, the empty string is appended
+ append: function append() {
+ if (this.isInline()) {
+ this.replaceStack(function (current) {
+ return [' != null ? ', current, ' : ""'];
+ });
+
+ this.pushSource(this.appendToBuffer(this.popStack()));
+ } else {
+ var local = this.popStack();
+ this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
+ if (this.environment.isSimple) {
+ this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
+ }
+ }
+ },
+
+ // [appendEscaped]
+ //
+ // On stack, before: value, ...
+ // On stack, after: ...
+ //
+ // Escape `value` and append it to the buffer
+ appendEscaped: function appendEscaped() {
+ this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
+ },
+
+ // [getContext]
+ //
+ // On stack, before: ...
+ // On stack, after: ...
+ // Compiler value, after: lastContext=depth
+ //
+ // Set the value of the `lastContext` compiler value to the depth
+ getContext: function getContext(depth) {
+ this.lastContext = depth;
+ },
+
+ // [pushContext]
+ //
+ // On stack, before: ...
+ // On stack, after: currentContext, ...
+ //
+ // Pushes the value of the current context onto the stack.
+ pushContext: function pushContext() {
+ this.pushStackLiteral(this.contextName(this.lastContext));
+ },
+
+ // [lookupOnContext]
+ //
+ // On stack, before: ...
+ // On stack, after: currentContext[name], ...
+ //
+ // Looks up the value of `name` on the current context and pushes
+ // it onto the stack.
+ lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
+ var i = 0;
+
+ if (!scoped && this.options.compat && !this.lastContext) {
+ // The depthed query is expected to handle the undefined logic for the root level that
+ // is implemented below, so we evaluate that directly in compat mode
+ this.push(this.depthedLookup(parts[i++]));
+ } else {
+ this.pushContext();
+ }
+
+ this.resolvePath('context', parts, i, falsy, strict);
+ },
+
+ // [lookupBlockParam]
+ //
+ // On stack, before: ...
+ // On stack, after: blockParam[name], ...
+ //
+ // Looks up the value of `parts` on the given block param and pushes
+ // it onto the stack.
+ lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
+ this.useBlockParams = true;
+
+ this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
+ this.resolvePath('context', parts, 1);
+ },
+
+ // [lookupData]
+ //
+ // On stack, before: ...
+ // On stack, after: data, ...
+ //
+ // Push the data lookup operator
+ lookupData: function lookupData(depth, parts, strict) {
+ if (!depth) {
+ this.pushStackLiteral('data');
+ } else {
+ this.pushStackLiteral('container.data(data, ' + depth + ')');
+ }
+
+ this.resolvePath('data', parts, 0, true, strict);
+ },
+
+ resolvePath: function resolvePath(type, parts, i, falsy, strict) {
+ // istanbul ignore next
+
+ var _this = this;
+
+ if (this.options.strict || this.options.assumeObjects) {
+ this.push(strictLookup(this.options.strict && strict, this, parts, type));
+ return;
+ }
+
+ var len = parts.length;
+ for (; i < len; i++) {
+ /* eslint-disable no-loop-func */
+ this.replaceStack(function (current) {
+ var lookup = _this.nameLookup(current, parts[i], type);
+ // We want to ensure that zero and false are handled properly if the context (falsy flag)
+ // needs to have the special handling for these values.
+ if (!falsy) {
+ return [' != null ? ', lookup, ' : ', current];
+ } else {
+ // Otherwise we can use generic falsy handling
+ return [' && ', lookup];
+ }
+ });
+ /* eslint-enable no-loop-func */
+ }
+ },
+
+ // [resolvePossibleLambda]
+ //
+ // On stack, before: value, ...
+ // On stack, after: resolved value, ...
+ //
+ // If the `value` is a lambda, replace it on the stack by
+ // the return value of the lambda
+ resolvePossibleLambda: function resolvePossibleLambda() {
+ this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
+ },
+
+ // [pushStringParam]
+ //
+ // On stack, before: ...
+ // On stack, after: string, currentContext, ...
+ //
+ // This opcode is designed for use in string mode, which
+ // provides the string value of a parameter along with its
+ // depth rather than resolving it immediately.
+ pushStringParam: function pushStringParam(string, type) {
+ this.pushContext();
+ this.pushString(type);
+
+ // If it's a subexpression, the string result
+ // will be pushed after this opcode.
+ if (type !== 'SubExpression') {
+ if (typeof string === 'string') {
+ this.pushString(string);
+ } else {
+ this.pushStackLiteral(string);
+ }
+ }
+ },
+
+ emptyHash: function emptyHash(omitEmpty) {
+ if (this.trackIds) {
+ this.push('{}'); // hashIds
+ }
+ if (this.stringParams) {
+ this.push('{}'); // hashContexts
+ this.push('{}'); // hashTypes
+ }
+ this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
+ },
+ pushHash: function pushHash() {
+ if (this.hash) {
+ this.hashes.push(this.hash);
+ }
+ this.hash = { values: [], types: [], contexts: [], ids: [] };
+ },
+ popHash: function popHash() {
+ var hash = this.hash;
+ this.hash = this.hashes.pop();
+
+ if (this.trackIds) {
+ this.push(this.objectLiteral(hash.ids));
+ }
+ if (this.stringParams) {
+ this.push(this.objectLiteral(hash.contexts));
+ this.push(this.objectLiteral(hash.types));
+ }
+
+ this.push(this.objectLiteral(hash.values));
+ },
+
+ // [pushString]
+ //
+ // On stack, before: ...
+ // On stack, after: quotedString(string), ...
+ //
+ // Push a quoted version of `string` onto the stack
+ pushString: function pushString(string) {
+ this.pushStackLiteral(this.quotedString(string));
+ },
+
+ // [pushLiteral]
+ //
+ // On stack, before: ...
+ // On stack, after: value, ...
+ //
+ // Pushes a value onto the stack. This operation prevents
+ // the compiler from creating a temporary variable to hold
+ // it.
+ pushLiteral: function pushLiteral(value) {
+ this.pushStackLiteral(value);
+ },
+
+ // [pushProgram]
+ //
+ // On stack, before: ...
+ // On stack, after: program(guid), ...
+ //
+ // Push a program expression onto the stack. This takes
+ // a compile-time guid and converts it into a runtime-accessible
+ // expression.
+ pushProgram: function pushProgram(guid) {
+ if (guid != null) {
+ this.pushStackLiteral(this.programExpression(guid));
+ } else {
+ this.pushStackLiteral(null);
+ }
+ },
+
+ // [registerDecorator]
+ //
+ // On stack, before: hash, program, params..., ...
+ // On stack, after: ...
+ //
+ // Pops off the decorator's parameters, invokes the decorator,
+ // and inserts the decorator into the decorators list.
+ registerDecorator: function registerDecorator(paramSize, name) {
+ var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
+ options = this.setupHelperArgs(name, paramSize);
+
+ this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
+ },
+
+ // [invokeHelper]
+ //
+ // On stack, before: hash, inverse, program, params..., ...
+ // On stack, after: result of helper invocation
+ //
+ // Pops off the helper's parameters, invokes the helper,
+ // and pushes the helper's return value onto the stack.
+ //
+ // If the helper is not found, `helperMissing` is called.
+ invokeHelper: function invokeHelper(paramSize, name, isSimple) {
+ var nonHelper = this.popStack(),
+ helper = this.setupHelper(paramSize, name),
+ simple = isSimple ? [helper.name, ' || '] : '';
+
+ var lookup = ['('].concat(simple, nonHelper);
+ if (!this.options.strict) {
+ lookup.push(' || ', this.aliasable('helpers.helperMissing'));
+ }
+ lookup.push(')');
+
+ this.push(this.source.functionCall(lookup, 'call', helper.callParams));
+ },
+
+ // [invokeKnownHelper]
+ //
+ // On stack, before: hash, inverse, program, params..., ...
+ // On stack, after: result of helper invocation
+ //
+ // This operation is used when the helper is known to exist,
+ // so a `helperMissing` fallback is not required.
+ invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
+ var helper = this.setupHelper(paramSize, name);
+ this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
+ },
+
+ // [invokeAmbiguous]
+ //
+ // On stack, before: hash, inverse, program, params..., ...
+ // On stack, after: result of disambiguation
+ //
+ // This operation is used when an expression like `{{foo}}`
+ // is provided, but we don't know at compile-time whether it
+ // is a helper or a path.
+ //
+ // This operation emits more code than the other options,
+ // and can be avoided by passing the `knownHelpers` and
+ // `knownHelpersOnly` flags at compile-time.
+ invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
+ this.useRegister('helper');
+
+ var nonHelper = this.popStack();
+
+ this.emptyHash();
+ var helper = this.setupHelper(0, name, helperCall);
+
+ var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
+
+ var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
+ if (!this.options.strict) {
+ lookup[0] = '(helper = ';
+ lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing'));
+ }
+
+ this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
+ },
+
+ // [invokePartial]
+ //
+ // On stack, before: context, ...
+ // On stack after: result of partial invocation
+ //
+ // This operation pops off a context, invokes a partial with that context,
+ // and pushes the result of the invocation back.
+ invokePartial: function invokePartial(isDynamic, name, indent) {
+ var params = [],
+ options = this.setupParams(name, 1, params);
+
+ if (isDynamic) {
+ name = this.popStack();
+ delete options.name;
+ }
+
+ if (indent) {
+ options.indent = JSON.stringify(indent);
+ }
+ options.helpers = 'helpers';
+ options.partials = 'partials';
+ options.decorators = 'container.decorators';
+
+ if (!isDynamic) {
+ params.unshift(this.nameLookup('partials', name, 'partial'));
+ } else {
+ params.unshift(name);
+ }
+
+ if (this.options.compat) {
+ options.depths = 'depths';
+ }
+ options = this.objectLiteral(options);
+ params.push(options);
+
+ this.push(this.source.functionCall('container.invokePartial', '', params));
+ },
+
+ // [assignToHash]
+ //
+ // On stack, before: value, ..., hash, ...
+ // On stack, after: ..., hash, ...
+ //
+ // Pops a value off the stack and assigns it to the current hash
+ assignToHash: function assignToHash(key) {
+ var value = this.popStack(),
+ context = undefined,
+ type = undefined,
+ id = undefined;
+
+ if (this.trackIds) {
+ id = this.popStack();
+ }
+ if (this.stringParams) {
+ type = this.popStack();
+ context = this.popStack();
+ }
+
+ var hash = this.hash;
+ if (context) {
+ hash.contexts[key] = context;
+ }
+ if (type) {
+ hash.types[key] = type;
+ }
+ if (id) {
+ hash.ids[key] = id;
+ }
+ hash.values[key] = value;
+ },
+
+ pushId: function pushId(type, name, child) {
+ if (type === 'BlockParam') {
+ this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
+ } else if (type === 'PathExpression') {
+ this.pushString(name);
+ } else if (type === 'SubExpression') {
+ this.pushStackLiteral('true');
+ } else {
+ this.pushStackLiteral('null');
+ }
+ },
+
+ // HELPERS
+
+ compiler: JavaScriptCompiler,
+
+ compileChildren: function compileChildren(environment, options) {
+ var children = environment.children,
+ child = undefined,
+ compiler = undefined;
+
+ for (var i = 0, l = children.length; i < l; i++) {
+ child = children[i];
+ compiler = new this.compiler(); // eslint-disable-line new-cap
+
+ var index = this.matchExistingProgram(child);
+
+ if (index == null) {
+ this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
+ index = this.context.programs.length;
+ child.index = index;
+ child.name = 'program' + index;
+ this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
+ this.context.decorators[index] = compiler.decorators;
+ this.context.environments[index] = child;
+
+ this.useDepths = this.useDepths || compiler.useDepths;
+ this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
+ } else {
+ child.index = index;
+ child.name = 'program' + index;
+
+ this.useDepths = this.useDepths || child.useDepths;
+ this.useBlockParams = this.useBlockParams || child.useBlockParams;
+ }
+ }
+ },
+ matchExistingProgram: function matchExistingProgram(child) {
+ for (var i = 0, len = this.context.environments.length; i < len; i++) {
+ var environment = this.context.environments[i];
+ if (environment && environment.equals(child)) {
+ return i;
+ }
+ }
+ },
+
+ programExpression: function programExpression(guid) {
+ var child = this.environment.children[guid],
+ programParams = [child.index, 'data', child.blockParams];
+
+ if (this.useBlockParams || this.useDepths) {
+ programParams.push('blockParams');
+ }
+ if (this.useDepths) {
+ programParams.push('depths');
+ }
+
+ return 'container.program(' + programParams.join(', ') + ')';
+ },
+
+ useRegister: function useRegister(name) {
+ if (!this.registers[name]) {
+ this.registers[name] = true;
+ this.registers.list.push(name);
+ }
+ },
+
+ push: function push(expr) {
+ if (!(expr instanceof Literal)) {
+ expr = this.source.wrap(expr);
+ }
+
+ this.inlineStack.push(expr);
+ return expr;
+ },
+
+ pushStackLiteral: function pushStackLiteral(item) {
+ this.push(new Literal(item));
+ },
+
+ pushSource: function pushSource(source) {
+ if (this.pendingContent) {
+ this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
+ this.pendingContent = undefined;
+ }
+
+ if (source) {
+ this.source.push(source);
+ }
+ },
+
+ replaceStack: function replaceStack(callback) {
+ var prefix = ['('],
+ stack = undefined,
+ createdStack = undefined,
+ usedLiteral = undefined;
+
+ /* istanbul ignore next */
+ if (!this.isInline()) {
+ throw new _exception2['default']('replaceStack on non-inline');
+ }
+
+ // We want to merge the inline statement into the replacement statement via ','
+ var top = this.popStack(true);
+
+ if (top instanceof Literal) {
+ // Literals do not need to be inlined
+ stack = [top.value];
+ prefix = ['(', stack];
+ usedLiteral = true;
+ } else {
+ // Get or create the current stack name for use by the inline
+ createdStack = true;
+ var _name = this.incrStack();
+
+ prefix = ['((', this.push(_name), ' = ', top, ')'];
+ stack = this.topStack();
+ }
+
+ var item = callback.call(this, stack);
+
+ if (!usedLiteral) {
+ this.popStack();
+ }
+ if (createdStack) {
+ this.stackSlot--;
+ }
+ this.push(prefix.concat(item, ')'));
+ },
+
+ incrStack: function incrStack() {
+ this.stackSlot++;
+ if (this.stackSlot > this.stackVars.length) {
+ this.stackVars.push('stack' + this.stackSlot);
+ }
+ return this.topStackName();
+ },
+ topStackName: function topStackName() {
+ return 'stack' + this.stackSlot;
+ },
+ flushInline: function flushInline() {
+ var inlineStack = this.inlineStack;
+ this.inlineStack = [];
+ for (var i = 0, len = inlineStack.length; i < len; i++) {
+ var entry = inlineStack[i];
+ /* istanbul ignore if */
+ if (entry instanceof Literal) {
+ this.compileStack.push(entry);
+ } else {
+ var stack = this.incrStack();
+ this.pushSource([stack, ' = ', entry, ';']);
+ this.compileStack.push(stack);
+ }
+ }
+ },
+ isInline: function isInline() {
+ return this.inlineStack.length;
+ },
+
+ popStack: function popStack(wrapped) {
+ var inline = this.isInline(),
+ item = (inline ? this.inlineStack : this.compileStack).pop();
+
+ if (!wrapped && item instanceof Literal) {
+ return item.value;
+ } else {
+ if (!inline) {
+ /* istanbul ignore next */
+ if (!this.stackSlot) {
+ throw new _exception2['default']('Invalid stack pop');
+ }
+ this.stackSlot--;
+ }
+ return item;
+ }
+ },
+
+ topStack: function topStack() {
+ var stack = this.isInline() ? this.inlineStack : this.compileStack,
+ item = stack[stack.length - 1];
+
+ /* istanbul ignore if */
+ if (item instanceof Literal) {
+ return item.value;
+ } else {
+ return item;
+ }
+ },
+
+ contextName: function contextName(context) {
+ if (this.useDepths && context) {
+ return 'depths[' + context + ']';
+ } else {
+ return 'depth' + context;
+ }
+ },
+
+ quotedString: function quotedString(str) {
+ return this.source.quotedString(str);
+ },
+
+ objectLiteral: function objectLiteral(obj) {
+ return this.source.objectLiteral(obj);
+ },
+
+ aliasable: function aliasable(name) {
+ var ret = this.aliases[name];
+ if (ret) {
+ ret.referenceCount++;
+ return ret;
+ }
+
+ ret = this.aliases[name] = this.source.wrap(name);
+ ret.aliasable = true;
+ ret.referenceCount = 1;
+
+ return ret;
+ },
+
+ setupHelper: function setupHelper(paramSize, name, blockHelper) {
+ var params = [],
+ paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
+ var foundHelper = this.nameLookup('helpers', name, 'helper'),
+ callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : {}');
+
+ return {
+ params: params,
+ paramsInit: paramsInit,
+ name: foundHelper,
+ callParams: [callContext].concat(params)
+ };
+ },
+
+ setupParams: function setupParams(helper, paramSize, params) {
+ var options = {},
+ contexts = [],
+ types = [],
+ ids = [],
+ objectArgs = !params,
+ param = undefined;
+
+ if (objectArgs) {
+ params = [];
+ }
+
+ options.name = this.quotedString(helper);
+ options.hash = this.popStack();
+
+ if (this.trackIds) {
+ options.hashIds = this.popStack();
+ }
+ if (this.stringParams) {
+ options.hashTypes = this.popStack();
+ options.hashContexts = this.popStack();
+ }
+
+ var inverse = this.popStack(),
+ program = this.popStack();
+
+ // Avoid setting fn and inverse if neither are set. This allows
+ // helpers to do a check for `if (options.fn)`
+ if (program || inverse) {
+ options.fn = program || 'container.noop';
+ options.inverse = inverse || 'container.noop';
+ }
+
+ // The parameters go on to the stack in order (making sure that they are evaluated in order)
+ // so we need to pop them off the stack in reverse order
+ var i = paramSize;
+ while (i--) {
+ param = this.popStack();
+ params[i] = param;
+
+ if (this.trackIds) {
+ ids[i] = this.popStack();
+ }
+ if (this.stringParams) {
+ types[i] = this.popStack();
+ contexts[i] = this.popStack();
+ }
+ }
+
+ if (objectArgs) {
+ options.args = this.source.generateArray(params);
+ }
+
+ if (this.trackIds) {
+ options.ids = this.source.generateArray(ids);
+ }
+ if (this.stringParams) {
+ options.types = this.source.generateArray(types);
+ options.contexts = this.source.generateArray(contexts);
+ }
+
+ if (this.options.data) {
+ options.data = 'data';
+ }
+ if (this.useBlockParams) {
+ options.blockParams = 'blockParams';
+ }
+ return options;
+ },
+
+ setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
+ var options = this.setupParams(helper, paramSize, params);
+ options = this.objectLiteral(options);
+ if (useRegister) {
+ this.useRegister('options');
+ params.push('options');
+ return ['options=', options];
+ } else if (params) {
+ params.push(options);
+ return '';
+ } else {
+ return options;
+ }
+ }
+ };
+
+ (function () {
+ var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');
+
+ var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
+
+ for (var i = 0, l = reservedWords.length; i < l; i++) {
+ compilerWords[reservedWords[i]] = true;
+ }
+ })();
+
+ JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
+ return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
+ };
+
+ function strictLookup(requireTerminal, compiler, parts, type) {
+ var stack = compiler.popStack(),
+ i = 0,
+ len = parts.length;
+ if (requireTerminal) {
+ len--;
+ }
+
+ for (; i < len; i++) {
+ stack = compiler.nameLookup(stack, parts[i], type);
+ }
+
+ if (requireTerminal) {
+ return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
+ } else {
+ return stack;
+ }
+ }
+
+ exports['default'] = JavaScriptCompiler;
+ module.exports = exports['default'];
+
+/***/ },
+/* 29 */
+/***/ function(module, exports, __webpack_require__) {
+
+ /* global define */
+ 'use strict';
+
+ exports.__esModule = true;
+
+ var _utils = __webpack_require__(5);
+
+ var SourceNode = undefined;
+
+ try {
+ /* istanbul ignore next */
+ if (false) {
+ // We don't support this in AMD environments. For these environments, we asusme that
+ // they are running on the browser and thus have no need for the source-map library.
+ var SourceMap = require('source-map');
+ SourceNode = SourceMap.SourceNode;
+ }
+ } catch (err) {}
+ /* NOP */
+
+ /* istanbul ignore if: tested but not covered in istanbul due to dist build */
+ if (!SourceNode) {
+ SourceNode = function (line, column, srcFile, chunks) {
+ this.src = '';
+ if (chunks) {
+ this.add(chunks);
+ }
+ };
+ /* istanbul ignore next */
+ SourceNode.prototype = {
+ add: function add(chunks) {
+ if (_utils.isArray(chunks)) {
+ chunks = chunks.join('');
+ }
+ this.src += chunks;
+ },
+ prepend: function prepend(chunks) {
+ if (_utils.isArray(chunks)) {
+ chunks = chunks.join('');
+ }
+ this.src = chunks + this.src;
+ },
+ toStringWithSourceMap: function toStringWithSourceMap() {
+ return { code: this.toString() };
+ },
+ toString: function toString() {
+ return this.src;
+ }
+ };
+ }
+
+ function castChunk(chunk, codeGen, loc) {
+ if (_utils.isArray(chunk)) {
+ var ret = [];
+
+ for (var i = 0, len = chunk.length; i < len; i++) {
+ ret.push(codeGen.wrap(chunk[i], loc));
+ }
+ return ret;
+ } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
+ // Handle primitives that the SourceNode will throw up on
+ return chunk + '';
+ }
+ return chunk;
+ }
+
+ function CodeGen(srcFile) {
+ this.srcFile = srcFile;
+ this.source = [];
+ }
+
+ CodeGen.prototype = {
+ isEmpty: function isEmpty() {
+ return !this.source.length;
+ },
+ prepend: function prepend(source, loc) {
+ this.source.unshift(this.wrap(source, loc));
+ },
+ push: function push(source, loc) {
+ this.source.push(this.wrap(source, loc));
+ },
+
+ merge: function merge() {
+ var source = this.empty();
+ this.each(function (line) {
+ source.add([' ', line, '\n']);
+ });
+ return source;
+ },
+
+ each: function each(iter) {
+ for (var i = 0, len = this.source.length; i < len; i++) {
+ iter(this.source[i]);
+ }
+ },
+
+ empty: function empty() {
+ var loc = this.currentLocation || { start: {} };
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
+ },
+ wrap: function wrap(chunk) {
+ var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
+
+ if (chunk instanceof SourceNode) {
+ return chunk;
+ }
+
+ chunk = castChunk(chunk, this, loc);
+
+ return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
+ },
+
+ functionCall: function functionCall(fn, type, params) {
+ params = this.generateList(params);
+ return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
+ },
+
+ quotedString: function quotedString(str) {
+ return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
+ .replace(/\u2029/g, '\\u2029') + '"';
+ },
+
+ objectLiteral: function objectLiteral(obj) {
+ var pairs = [];
+
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ var value = castChunk(obj[key], this);
+ if (value !== 'undefined') {
+ pairs.push([this.quotedString(key), ':', value]);
+ }
+ }
+ }
+
+ var ret = this.generateList(pairs);
+ ret.prepend('{');
+ ret.add('}');
+ return ret;
+ },
+
+ generateList: function generateList(entries) {
+ var ret = this.empty();
+
+ for (var i = 0, len = entries.length; i < len; i++) {
+ if (i) {
+ ret.add(',');
+ }
+
+ ret.add(castChunk(entries[i], this));
+ }
+
+ return ret;
+ },
+
+ generateArray: function generateArray(entries) {
+ var ret = this.generateList(entries);
+ ret.prepend('[');
+ ret.add(']');
+
+ return ret;
+ }
+ };
+
+ exports['default'] = CodeGen;
+ module.exports = exports['default'];
+
+/***/ }
+/******/ ])
+});
+;
\ No newline at end of file
diff --git a/contrail-webui/controller/handlebars-v4.4.3.tar.gz b/contrail-webui/controller/handlebars-v4.4.3.tar.gz
new file mode 100644
index 0000000..9b15082
--- /dev/null
+++ b/contrail-webui/controller/handlebars-v4.4.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/helenus-0.6.2.tgz b/contrail-webui/controller/helenus-0.6.2.tgz
new file mode 100644
index 0000000..fe42e59
--- /dev/null
+++ b/contrail-webui/controller/helenus-0.6.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/ipv6-3.1.1.tgz b/contrail-webui/controller/ipv6-3.1.1.tgz
new file mode 100644
index 0000000..3ea9efe
--- /dev/null
+++ b/contrail-webui/controller/ipv6-3.1.1.tgz
Binary files differ
diff --git a/contrail-webui/controller/jQuery-contextMenu-1.6.5.tar.gz b/contrail-webui/controller/jQuery-contextMenu-1.6.5.tar.gz
new file mode 100644
index 0000000..0199c4e
--- /dev/null
+++ b/contrail-webui/controller/jQuery-contextMenu-1.6.5.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/joint-0.9.0.tar.gz b/contrail-webui/controller/joint-0.9.0.tar.gz
new file mode 100644
index 0000000..2653897
--- /dev/null
+++ b/contrail-webui/controller/joint-0.9.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/joint-0.9.2.tar.gz b/contrail-webui/controller/joint-0.9.2.tar.gz
new file mode 100644
index 0000000..004b686
--- /dev/null
+++ b/contrail-webui/controller/joint-0.9.2.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/joint-0.9.3.tar.gz b/contrail-webui/controller/joint-0.9.3.tar.gz
new file mode 100644
index 0000000..54f597d
--- /dev/null
+++ b/contrail-webui/controller/joint-0.9.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery-2.2.4.tar.gz b/contrail-webui/controller/jquery-2.2.4.tar.gz
new file mode 100644
index 0000000..4866098
--- /dev/null
+++ b/contrail-webui/controller/jquery-2.2.4.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery-steps-1.1.0.tar.gz b/contrail-webui/controller/jquery-steps-1.1.0.tar.gz
new file mode 100644
index 0000000..2688fdb
--- /dev/null
+++ b/contrail-webui/controller/jquery-steps-1.1.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery-ui-1.11.4.zip b/contrail-webui/controller/jquery-ui-1.11.4.zip
new file mode 100644
index 0000000..0ce11b4
--- /dev/null
+++ b/contrail-webui/controller/jquery-ui-1.11.4.zip
Binary files differ
diff --git a/contrail-webui/controller/jquery-ui-multiselect-widget-1.13.tar.gz b/contrail-webui/controller/jquery-ui-multiselect-widget-1.13.tar.gz
new file mode 100644
index 0000000..0f2986d
--- /dev/null
+++ b/contrail-webui/controller/jquery-ui-multiselect-widget-1.13.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery-ui-multiselect-widget-1.15.tar.gz b/contrail-webui/controller/jquery-ui-multiselect-widget-1.15.tar.gz
new file mode 100644
index 0000000..279ce80
--- /dev/null
+++ b/contrail-webui/controller/jquery-ui-multiselect-widget-1.15.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery-validation-1.11.1.tar.gz b/contrail-webui/controller/jquery-validation-1.11.1.tar.gz
new file mode 100644
index 0000000..c5900e2
--- /dev/null
+++ b/contrail-webui/controller/jquery-validation-1.11.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery-validation-1.15.1.tar.gz b/contrail-webui/controller/jquery-validation-1.15.1.tar.gz
new file mode 100644
index 0000000..1d6dcb4
--- /dev/null
+++ b/contrail-webui/controller/jquery-validation-1.15.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery.ba-bbq.min-v1.3pre.js b/contrail-webui/controller/jquery.ba-bbq.min-v1.3pre.js
new file mode 100644
index 0000000..80de36f
--- /dev/null
+++ b/contrail-webui/controller/jquery.ba-bbq.min-v1.3pre.js
@@ -0,0 +1,18 @@
+/*
+ * jQuery BBQ: Back Button & Query Library - v1.3pre - 8/26/2010
+ * http://benalman.com/projects/jquery-bbq-plugin/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,r){var h,n=Array.prototype.slice,t=decodeURIComponent,a=$.param,j,c,m,y,b=$.bbq=$.bbq||{},s,x,k,e=$.event.special,d="hashchange",B="querystring",F="fragment",z="elemUrlAttr",l="href",w="src",p=/^.*\?|#.*$/g,u,H,g,i,C,E={};function G(I){return typeof I==="string"}function D(J){var I=n.call(arguments,1);return function(){return J.apply(this,I.concat(n.call(arguments)))}}function o(I){return I.replace(H,"$2")}function q(I){return I.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(K,P,I,L,J){var R,O,N,Q,M;if(L!==h){N=I.match(K?H:/^([^#?]*)\??([^#]*)(#?.*)/);M=N[3]||"";if(J===2&&G(L)){O=L.replace(K?u:p,"")}else{Q=m(N[2]);L=G(L)?m[K?F:B](L):L;O=J===2?L:J===1?$.extend({},L,Q):$.extend({},Q,L);O=j(O);if(K){O=O.replace(g,t)}}R=N[1]+(K?C:O||!N[1]?"?":"")+O+M}else{R=P(I!==h?I:location.href)}return R}a[B]=D(f,0,q);a[F]=c=D(f,1,o);a.sorted=j=function(J,K){var I=[],L={};$.each(a(J,K).split("&"),function(P,M){var O=M.replace(/(?:%5B|=).*$/,""),N=L[O];if(!N){N=L[O]=[];I.push(O)}N.push(M)});return $.map(I.sort(),function(M){return L[M]}).join("&")};c.noEscape=function(J){J=J||"";var I=$.map(J.split(""),encodeURIComponent);g=new RegExp(I.join("|"),"g")};c.noEscape(",/");c.ajaxCrawlable=function(I){if(I!==h){if(I){u=/^.*(?:#!|#)/;H=/^([^#]*)(?:#!|#)?(.*)$/;C="#!"}else{u=/^.*#/;H=/^([^#]*)#?(.*)$/;C="#"}i=!!I}return i};c.ajaxCrawlable(0);$.deparam=m=function(L,I){var K={},J={"true":!0,"false":!1,"null":null};$.each(L.replace(/\+/g," ").split("&"),function(O,T){var N=T.split("="),S=t(N[0]),M,R=K,P=0,U=S.split("]["),Q=U.length-1;if(/\[/.test(U[0])&&/\]$/.test(U[Q])){U[Q]=U[Q].replace(/\]$/,"");U=U.shift().split("[").concat(U);Q=U.length-1}else{Q=0}if(N.length===2){M=t(N[1]);if(I){M=M&&!isNaN(M)?+M:M==="undefined"?h:J[M]!==h?J[M]:M}if(Q){for(;P<=Q;P++){S=U[P]===""?R.length:U[P];R=R[S]=P<Q?R[S]||(U[P+1]&&isNaN(U[P+1])?{}:[]):M}}else{if($.isArray(K[S])){K[S].push(M)}else{if(K[S]!==h){K[S]=[K[S],M]}else{K[S]=M}}}}else{if(S){K[S]=I?h:""}}});return K};function A(K,I,J){if(I===h||typeof I==="boolean"){J=I;I=a[K?F:B]()}else{I=G(I)?I.replace(K?u:p,""):I}return m(I,J)}m[B]=D(A,0);m[F]=y=D(A,1);$[z]||($[z]=function(I){return $.extend(E,I)})({a:l,base:l,iframe:w,img:w,input:w,form:"action",link:l,script:w});k=$[z];function v(L,J,K,I){if(!G(K)&&typeof K!=="object"){I=K;K=J;J=h}return this.each(function(){var O=$(this),M=J||k()[(this.nodeName||"").toLowerCase()]||"",N=M&&O.attr(M)||"";O.attr(M,a[L](N,K,I))})}$.fn[B]=D(v,B);$.fn[F]=D(v,F);b.pushState=s=function(L,I){if(G(L)&&/^#/.test(L)&&I===h){I=2}var K=L!==h,J=c(location.href,K?L:{},K?I:2);location.href=J};b.getState=x=function(I,J){return I===h||typeof I==="boolean"?y(I):y(J)[I]};b.removeState=function(I){var J={};if(I!==h){J=x();$.each($.isArray(I)?I:arguments,function(L,K){delete J[K]})}s(J,2)};e[d]=$.extend(e[d],{add:function(I){var K;function J(M){var L=M[F]=c();M.getState=function(N,O){return N===h||typeof N==="boolean"?m(L,N):m(L,O)[N]};K.apply(this,arguments)}if($.isFunction(I)){K=I;return J}else{K=I.handler;I.handler=J}}})})(jQuery,this);
+/*
+ * jQuery hashchange event - v1.3 - 7/21/2010
+ * http://benalman.com/projects/jquery-hashchange-plugin/
+ *
+ * Copyright (c) 2010 "Cowboy" Ben Alman
+ * Dual licensed under the MIT and GPL licenses.
+ * http://benalman.com/about/license/
+ */
+(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
\ No newline at end of file
diff --git a/contrail-webui/controller/jquery.dataTables.min-1.10.0.js b/contrail-webui/controller/jquery.dataTables.min-1.10.0.js
new file mode 100644
index 0000000..7cad3e3
--- /dev/null
+++ b/contrail-webui/controller/jquery.dataTables.min-1.10.0.js
@@ -0,0 +1,152 @@
+/*! DataTables 1.10.0
+ * ©2008-2014 SpryMedia Ltd - datatables.net/license
+ */
+(function(za,N,l){var M=function(g){function S(a){var b,c,d={};g.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()),d[c]=e,"o"===b[1]&&S(a[e])});a._hungarianMap=d}function G(a,b,c){a._hungarianMap||S(a);var d;g.each(b,function(e){d=a._hungarianMap[e];if(d!==l&&(c||b[d]===l))"o"===d.charAt(0)?(b[d]||(b[d]={}),g.extend(!0,b[d],b[e]),G(a[d],b[d],c)):b[d]=b[e]})}function M(a){var b=p.defaults.oLanguage,c=a.sZeroRecords;
+!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&D(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&D(a,a,"sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&bb(a)}function cb(a){w(a,"ordering","bSort");w(a,"orderMulti","bSortMulti");w(a,"orderClasses","bSortClasses");w(a,"orderCellsTop","bSortCellsTop");w(a,"order","aaSorting");w(a,"orderFixed","aaSortingFixed");w(a,"paging","bPaginate");
+w(a,"pagingType","sPaginationType");w(a,"pageLength","iDisplayLength");w(a,"searching","bFilter")}function db(a){w(a,"orderable","bSortable");w(a,"orderData","aDataSort");w(a,"orderSequence","asSorting");w(a,"orderDataType","sortDataType")}function eb(a){var a=a.oBrowser,b=g("<div/>").css({position:"absolute",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(g("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(g('<div class="test"/>').css({width:"100%",height:10}))).appendTo("body"),
+c=b.find(".test");a.bScrollOversize=100===c[0].offsetWidth;a.bScrollbarLeft=1!==c.offset().left;b.remove()}function fb(a,b,c,d,e,f){var h,i=!1;c!==l&&(h=c,i=!0);for(;d!==e;)a.hasOwnProperty(d)&&(h=i?b(h,a[d],d,a):a[d],i=!0,d+=f);return h}function Aa(a,b){var c=p.defaults.column,d=a.aoColumns.length,c=g.extend({},p.models.oColumn,c,{nTh:b?b:N.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;
+c[d]=g.extend({},p.models.oSearch,c[d]);fa(a,d,null)}function fa(a,b,c){var d=a.aoColumns[b],b=a.oClasses,e=g(d.nTh);if(!d.sWidthOrig){d.sWidthOrig=e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%])/);f&&(d.sWidthOrig=f[1])}c!==l&&null!==c&&(db(c),G(p.defaults.column,c),c.mDataProp!==l&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(d._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),g.extend(d,c),D(d,c,"sWidth","sWidthOrig"),"number"===typeof c.iDataSort&&
+(d.aDataSort=[c.iDataSort]),D(d,c,"aDataSort"));var c=d.mData,h=T(c),i=d.mRender?T(d.mRender):null,f=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};d._bAttrSrc=g.isPlainObject(c)&&(f(c.sort)||f(c.type)||f(c.filter));d.fnGetData=function(a,b){var c=h(a,b);return d.mRender&&b&&""!==b?i(c,b,a):c};d.fnSetData=Ba(c);a.oFeatures.bSort||(d.bSortable=!1,e.addClass(b.sSortableNone));a=-1!==g.inArray("asc",d.asSorting);e=-1!==g.inArray("desc",d.asSorting);!d.bSortable||!a&&!e?(d.sSortingClass=
+b.sSortableNone,d.sSortingClassJUI=""):a&&!e?(d.sSortingClass=b.sSortableAsc,d.sSortingClassJUI=b.sSortJUIAscAllowed):!a&&e?(d.sSortingClass=b.sSortableDesc,d.sSortingClassJUI=b.sSortJUIDescAllowed):(d.sSortingClass=b.sSortable,d.sSortingClassJUI=b.sSortJUI)}function U(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ca(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;(""!==b.sY||""!==b.sX)&&V(a);t(a,null,"column-sizing",[a])}function ga(a,b){var c=W(a,"bVisible");
+return"number"===typeof c[b]?c[b]:null}function X(a,b){var c=W(a,"bVisible"),c=g.inArray(b,c);return-1!==c?c:null}function Y(a){return W(a,"bVisible").length}function W(a,b){var c=[];g.map(a.aoColumns,function(a,e){a[b]&&c.push(e)});return c}function Da(a){var b=a.aoColumns,c=a.aoData,d=p.ext.type.detect,e,f,h,i,j,g,m,o,k;e=0;for(f=b.length;e<f;e++)if(m=b[e],k=[],!m.sType&&m._sManualType)m.sType=m._sManualType;else if(!m.sType){h=0;for(i=d.length;h<i;h++){j=0;for(g=c.length;j<g&&!(k[j]===l&&(k[j]=
+A(a,j,e,"type")),o=d[h](k[j],a),!o||"html"===o);j++);if(o){m.sType=o;break}}m.sType||(m.sType="string")}}function gb(a,b,c,d){var e,f,h,i,j,n,m=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){n=b[e];var o=n.targets!==l?n.targets:n.aTargets;g.isArray(o)||(o=[o]);f=0;for(h=o.length;f<h;f++)if("number"===typeof o[f]&&0<=o[f]){for(;m.length<=o[f];)Aa(a);d(o[f],n)}else if("number"===typeof o[f]&&0>o[f])d(m.length+o[f],n);else if("string"===typeof o[f]){i=0;for(j=m.length;i<j;i++)("_all"==o[f]||g(m[i].nTh).hasClass(o[f]))&&
+d(i,n)}}if(c){e=0;for(a=c.length;e<a;e++)d(e,c[e])}}function H(a,b,c,d){var e=a.aoData.length,f=g.extend(!0,{},p.models.oRow,{src:c?"dom":"data"});f._aData=b;a.aoData.push(f);for(var b=a.aoColumns,f=0,h=b.length;f<h;f++)c&&Ea(a,e,f,A(a,e,f)),b[f].sType=null;a.aiDisplayMaster.push(e);a.oFeatures.bDeferRender||Fa(a,e,c,d);return e}function ha(a,b){var c;b instanceof g||(b=g(b));return b.map(function(b,e){c=ia(a,e);return H(a,c.data,e,c.cells)})}function A(a,b,c,d){var c=a.aoColumns[c],e=a.aoData[b]._aData,
+f=c.fnGetData(e,d);if(f===l)return a.iDrawError!=a.iDraw&&null===c.sDefaultContent&&(O(a,0,"Requested unknown parameter "+("function"==typeof c.mData?"{function}":"'"+c.mData+"'")+" for row "+b,4),a.iDrawError=a.iDraw),c.sDefaultContent;if((f===e||null===f)&&null!==c.sDefaultContent)f=c.sDefaultContent;else if("function"===typeof f)return f();return null===f&&"display"==d?"":f}function Ea(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Ga(a){return g.map(a.match(/(\\.|[^\.])+/g),
+function(a){return a.replace("\\.",".")})}function T(a){if(g.isPlainObject(a)){var b={};g.each(a,function(a,c){c&&(b[a]=T(c))});return function(a,c,f){var h=b[c]||b._;return h!==l?h(a,c,f):a}}if(null===a)return function(a){return a};if("function"===typeof a)return function(b,c,f){return a(b,c,f)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var c=function(a,b,f){var h,i;if(""!==f){i=Ga(f);for(var j=0,g=i.length;j<g;j++){f=i[j].match(Z);h=i[j].match(P);if(f){i[j]=
+i[j].replace(Z,"");""!==i[j]&&(a=a[i[j]]);h=[];i.splice(0,j+1);i=i.join(".");j=0;for(g=a.length;j<g;j++)h.push(c(a[j],b,i));a=f[0].substring(1,f[0].length-1);a=""===a?h:h.join(a);break}else if(h){i[j]=i[j].replace(P,"");a=a[i[j]]();continue}if(null===a||a[i[j]]===l)return l;a=a[i[j]]}}return a};return function(b,e){return c(b,e,a)}}return function(b){return b[a]}}function Ba(a){if(g.isPlainObject(a))return Ba(a._);if(null===a)return function(){};if("function"===typeof a)return function(b,d){a(b,"set",
+d)};if("string"===typeof a&&(-1!==a.indexOf(".")||-1!==a.indexOf("[")||-1!==a.indexOf("("))){var b=function(a,d,e){var e=Ga(e),f;f=e[e.length-1];for(var h,i,j=0,g=e.length-1;j<g;j++){h=e[j].match(Z);i=e[j].match(P);if(h){e[j]=e[j].replace(Z,"");a[e[j]]=[];f=e.slice();f.splice(0,j+1);h=f.join(".");i=0;for(g=d.length;i<g;i++)f={},b(f,d[i],h),a[e[j]].push(f);return}i&&(e[j]=e[j].replace(P,""),a=a[e[j]](d));if(null===a[e[j]]||a[e[j]]===l)a[e[j]]={};a=a[e[j]]}if(f.match(P))a[f.replace(P,"")](d);else a[f.replace(Z,
+"")]=d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ha(a){return B(a.aoData,"_aData")}function ja(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0}function ka(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===l&&a.splice(d,1)}function la(a,b,c,d){var e=a.aoData[b],f;if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=ia(a,e).data;else{var h=e.anCells;if(h){c=0;for(f=h.length;c<f;c++)h[c].innerHTML=A(a,b,c,"display")}}e._aSortData=
+null;e._aFilterData=null;a=a.aoColumns;if(d!==l)a[d].sType=null;else{c=0;for(f=a.length;c<f;c++)a[c].sType=null}Ia(e)}function ia(a,b){var c=[],d=[],e=b.firstChild,f,h,i,j=0,n,m=a.aoColumns,o=function(a,b,c){"string"===typeof a&&(b=a.indexOf("@"),-1!==b&&(a=a.substring(b+1),i["@"+a]=c.getAttribute(a)))},k=function(a){h=m[j];n=g.trim(a.innerHTML);h&&h._bAttrSrc?(i={display:n},o(h.mData.sort,i,a),o(h.mData.type,i,a),o(h.mData.filter,i,a),c.push(i)):c.push(n);d.push(a);j++};if(e)for(;e;)f=e.nodeName.toUpperCase(),
+("TD"==f||"TH"==f)&&k(e),e=e.nextSibling;else{d=b.anCells;e=0;for(f=d.length;e<f;e++)k(d[e])}return{data:c,cells:d}}function Fa(a,b,c,d){var e=a.aoData[b],f=e._aData,h=[],i,j,g,m,o;if(null===e.nTr){i=c||N.createElement("tr");e.nTr=i;e.anCells=h;i._DT_RowIndex=b;Ia(e);m=0;for(o=a.aoColumns.length;m<o;m++){g=a.aoColumns[m];j=c?d[m]:N.createElement(g.sCellType);h.push(j);if(!c||g.mRender||g.mData!==m)j.innerHTML=A(a,b,m,"display");g.sClass&&(j.className+=" "+g.sClass);g.bVisible&&!c?i.appendChild(j):
+!g.bVisible&&c&&j.parentNode.removeChild(j);g.fnCreatedCell&&g.fnCreatedCell.call(a.oInstance,j,A(a,b,m,"display"),f,b,m)}t(a,"aoRowCreatedCallback",null,[i,f,b])}e.nTr.setAttribute("role","row")}function Ia(a){var b=a.nTr,c=a._aData;if(b){c.DT_RowId&&(b.id=c.DT_RowId);if(c.DT_RowClass){var d=c.DT_RowClass.split(" ");a.__rowc=a.__rowc?Ja(a.__rowc.concat(d)):d;g(b).removeClass(a.__rowc.join(" ")).addClass(c.DT_RowClass)}c.DT_RowData&&g(b).data(c.DT_RowData)}}function hb(a){var b,c,d,e,f,h=a.nTHead,
+i=a.nTFoot,j=0===g("th, td",h).length,n=a.oClasses,m=a.aoColumns;j&&(e=g("<tr/>").appendTo(h));b=0;for(c=m.length;b<c;b++)f=m[b],d=g(f.nTh).addClass(f.sClass),j&&d.appendTo(e),a.oFeatures.bSort&&(d.addClass(f.sSortingClass),!1!==f.bSortable&&(d.attr("tabindex",a.iTabIndex).attr("aria-controls",a.sTableId),Ka(a,f.nTh,b))),f.sTitle!=d.html()&&d.html(f.sTitle),La(a,"header")(a,d,f,n);j&&$(a.aoHeader,h);g(h).find(">tr").attr("role","row");g(h).find(">tr>th, >tr>td").addClass(n.sHeaderTH);g(i).find(">tr>th, >tr>td").addClass(n.sFooterTH);
+if(null!==i){a=a.aoFooter[0];b=0;for(c=a.length;b<c;b++)f=m[b],f.nTf=a[b].cell,f.sClass&&g(f.nTf).addClass(f.sClass)}}function I(a,b,c){var d,e,f,h=[],i=[],j=a.aoColumns.length,n;if(b){c===l&&(c=!1);d=0;for(e=b.length;d<e;d++){h[d]=b[d].slice();h[d].nTr=b[d].nTr;for(f=j-1;0<=f;f--)!a.aoColumns[f].bVisible&&!c&&h[d].splice(f,1);i.push([])}d=0;for(e=h.length;d<e;d++){if(a=h[d].nTr)for(;f=a.firstChild;)a.removeChild(f);f=0;for(b=h[d].length;f<b;f++)if(n=j=1,i[d][f]===l){a.appendChild(h[d][f].cell);for(i[d][f]=
+1;h[d+j]!==l&&h[d][f].cell==h[d+j][f].cell;)i[d+j][f]=1,j++;for(;h[d][f+n]!==l&&h[d][f].cell==h[d][f+n].cell;){for(c=0;c<j;c++)i[d+c][f+n]=1;n++}g(h[d][f].cell).attr("rowspan",j).attr("colspan",n)}}}}function J(a){var b=t(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==g.inArray(!1,b))C(a,!1);else{var b=[],c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,h=a.iInitDisplayStart,i="ssp"==z(a),j=a.aiDisplay;a.bDrawing=!0;h!==l&&-1!==h&&(a._iDisplayStart=i?h:h>=a.fnRecordsDisplay()?0:h,a.iInitDisplayStart=
+-1);var h=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(i){if(!a.bDestroying&&!ib(a))return}else a.iDraw++;if(0!==j.length){f=i?a.aoData.length:n;for(i=i?0:h;i<f;i++){var m=j[i],o=a.aoData[m];null===o.nTr&&Fa(a,m);m=o.nTr;if(0!==e){var k=d[c%e];o._sRowStripe!=k&&(g(m).removeClass(o._sRowStripe).addClass(k),o._sRowStripe=k)}t(a,"aoRowCallback",null,[m,o._aData,c,i]);b.push(m);c++}}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==z(a)?c=f.sLoadingRecords:
+f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=g("<tr/>",{"class":e?d[0]:""}).append(g("<td />",{valign:"top",colSpan:Y(a),"class":a.oClasses.sRowEmpty}).html(c))[0];t(a,"aoHeaderCallback","header",[g(a.nTHead).children("tr")[0],Ha(a),h,n,j]);t(a,"aoFooterCallback","footer",[g(a.nTFoot).children("tr")[0],Ha(a),h,n,j]);d=g(a.nTBody);d.children().detach();d.append(g(b));t(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function K(a,b){var c=a.oFeatures,d=c.bFilter;
+c.bSort&&jb(a);d?aa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);J(a)}function kb(a){var b=a.oClasses,c=g(a.nTable),c=g("<div/>").insertBefore(c),d=a.oFeatures,e=g("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),h,i,j,n,m,o,k=0;k<f.length;k++){h=null;i=f[k];if("<"==i){j=g("<div/>")[0];n=f[k+1];if("'"==n||'"'==n){m=
+"";for(o=2;f[k+o]!=n;)m+=f[k+o],o++;"H"==m?m=b.sJUIHeader:"F"==m&&(m=b.sJUIFooter);-1!=m.indexOf(".")?(n=m.split("."),j.id=n[0].substr(1,n[0].length-1),j.className=n[1]):"#"==m.charAt(0)?j.id=m.substr(1,m.length-1):j.className=m;k+=o}e.append(j);e=g(j)}else if(">"==i)e=e.parent();else if("l"==i&&d.bPaginate&&d.bLengthChange)h=lb(a);else if("f"==i&&d.bFilter)h=mb(a);else if("r"==i&&d.bProcessing)h=nb(a);else if("t"==i)h=ob(a);else if("i"==i&&d.bInfo)h=pb(a);else if("p"==i&&d.bPaginate)h=qb(a);else if(0!==
+p.ext.feature.length){j=p.ext.feature;o=0;for(n=j.length;o<n;o++)if(i==j[o].cFeature){h=j[o].fnInit(a);break}}h&&(j=a.aanFeatures,j[i]||(j[i]=[]),j[i].push(h),e.append(h))}c.replaceWith(e)}function $(a,b){var c=g(b).children("tr"),d,e,f,h,i,j,n,m,o,k;a.splice(0,a.length);f=0;for(j=c.length;f<j;f++)a.push([]);f=0;for(j=c.length;f<j;f++){d=c[f];for(e=d.firstChild;e;){if("TD"==e.nodeName.toUpperCase()||"TH"==e.nodeName.toUpperCase()){m=1*e.getAttribute("colspan");o=1*e.getAttribute("rowspan");m=!m||
+0===m||1===m?1:m;o=!o||0===o||1===o?1:o;h=0;for(i=a[f];i[h];)h++;n=h;k=1===m?!0:!1;for(i=0;i<m;i++)for(h=0;h<o;h++)a[f+h][n+i]={cell:e,unique:k},a[f+h].nTr=d}e=e.nextSibling}}}function ma(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],$(c,b)));for(var b=0,e=c.length;b<e;b++)for(var f=0,h=c[b].length;f<h;f++)if(c[b][f].unique&&(!d[f]||!a.bSortCellsTop))d[f]=c[b][f].cell;return d}function na(a,b,c){t(a,"aoServerParams","serverParams",[b]);if(b&&g.isArray(b)){var d={},e=/(.*?)\[\]$/;g.each(b,function(a,b){var c=
+b.name.match(e);c?(c=c[0],d[c]||(d[c]=[]),d[c].push(b.value)):d[b.name]=b.value});b=d}var f,h=a.ajax,i=a.oInstance;if(g.isPlainObject(h)&&h.data){f=h.data;var j=g.isFunction(f)?f(b):f,b=g.isFunction(f)&&j?j:g.extend(!0,b,j);delete h.data}j={data:b,success:function(b){var d=b.error||b.sError;d&&a.oApi._fnLog(a,0,d);a.json=b;t(a,null,"xhr",[a,b]);c(b)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(b,c){var d=a.oApi._fnLog;"parsererror"==c?d(a,0,"Invalid JSON response",1):4===b.readyState&&
+d(a,0,"Ajax error",7);C(a,!1)}};a.oAjaxData=b;t(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(i,a.sAjaxSource,g.map(b,function(a,b){return{name:b,value:a}}),c,a):a.sAjaxSource||"string"===typeof h?a.jqXHR=g.ajax(g.extend(j,{url:h||a.sAjaxSource})):g.isFunction(h)?a.jqXHR=h.call(i,b,c,a):(a.jqXHR=g.ajax(g.extend(j,h)),h.data=f)}function ib(a){if(a.bAjaxDataGet){a.iDraw++;C(a,!0);var b=rb(a);na(a,b,function(b){sb(a,b)},a);return!1}return!0}function rb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,
+e=a.oPreviousSearch,f=a.aoPreSearchCols,h,i=[],j,n,m,o=Q(a);h=a._iDisplayStart;j=!1!==d.bPaginate?a._iDisplayLength:-1;var k=function(a,b){i.push({name:a,value:b})};k("sEcho",a.iDraw);k("iColumns",c);k("sColumns",B(b,"sName").join(","));k("iDisplayStart",h);k("iDisplayLength",j);var l={draw:a.iDraw,columns:[],order:[],start:h,length:j,search:{value:e.sSearch,regex:e.bRegex}};for(h=0;h<c;h++)n=b[h],m=f[h],j="function"==typeof n.mData?"function":n.mData,l.columns.push({data:j,name:n.sName,searchable:n.bSearchable,
+orderable:n.bSortable,search:{value:m.sSearch,regex:m.bRegex}}),k("mDataProp_"+h,j),d.bFilter&&(k("sSearch_"+h,m.sSearch),k("bRegex_"+h,m.bRegex),k("bSearchable_"+h,n.bSearchable)),d.bSort&&k("bSortable_"+h,n.bSortable);d.bFilter&&(k("sSearch",e.sSearch),k("bRegex",e.bRegex));d.bSort&&(g.each(o,function(a,b){l.order.push({column:b.col,dir:b.dir});k("iSortCol_"+a,b.col);k("sSortDir_"+a,b.dir)}),k("iSortingCols",o.length));b=p.ext.legacy.ajax;return null===b?a.sAjaxSource?i:l:b?i:l}function sb(a,b){var c=
+b.sEcho!==l?b.sEcho:b.draw,d=b.iTotalRecords!==l?b.iTotalRecords:b.recordsTotal,e=b.iTotalDisplayRecords!==l?b.iTotalDisplayRecords:b.recordsFiltered;if(c){if(1*c<a.iDraw)return;a.iDraw=1*c}ja(a);a._iRecordsTotal=parseInt(d,10);a._iRecordsDisplay=parseInt(e,10);c=oa(a,b);d=0;for(e=c.length;d<e;d++)H(a,c[d]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;J(a);a._bInitComplete||pa(a,b);a.bAjaxDataGet=!0;C(a,!1)}function oa(a,b){var c=g.isPlainObject(a.ajax)&&a.ajax.dataSrc!==l?a.ajax.dataSrc:
+a.sAjaxDataProp;return"data"===c?b.aaData||b[c]:""!==c?T(c)(b):b}function mb(a){var b=a.oClasses,c=a.sTableId,d=a.oPreviousSearch,e=a.aanFeatures,f='<input type="search" class="'+b.sFilterInput+'"/>',h=a.oLanguage.sSearch,h=h.match(/_INPUT_/)?h.replace("_INPUT_",f):h+f,b=g("<div/>",{id:!e.f?c+"_filter":null,"class":b.sFilter}).append(g("<label/>").append(h)),e=function(){var b=!this.value?"":this.value;b!=d.sSearch&&(aa(a,{sSearch:b,bRegex:d.bRegex,bSmart:d.bSmart,bCaseInsensitive:d.bCaseInsensitive}),
+a._iDisplayStart=0,J(a))},i=g("input",b).val(d.sSearch.replace('"',""")).bind("keyup.DT search.DT input.DT paste.DT cut.DT","ssp"===z(a)?Ma(e,400):e).bind("keypress.DT",function(a){if(13==a.keyCode)return!1}).attr("aria-controls",c);g(a.nTable).on("filter.DT",function(){try{i[0]!==N.activeElement&&i.val(d.sSearch)}catch(a){}});return b[0]}function aa(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(a){d.sSearch=a.sSearch;d.bRegex=a.bRegex;d.bSmart=a.bSmart;d.bCaseInsensitive=a.bCaseInsensitive};
+Da(a);if("ssp"!=z(a)){tb(a,b.sSearch,c,b.bEscapeRegex!==l?!b.bEscapeRegex:b.bRegex,b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)ub(a,e[b].sSearch,b,e[b].bEscapeRegex!==l?!e[b].bEscapeRegex:e[b].bRegex,e[b].bSmart,e[b].bCaseInsensitive);vb(a)}else f(b);a.bFiltered=!0;t(a,null,"search",[a])}function vb(a){for(var b=p.ext.search,c=a.aiDisplay,d,e,f=0,h=b.length;f<h;f++)for(var i=c.length-1;0<=i;i--)e=c[i],d=a.aoData[e],b[f](a,d._aFilterData,e,d._aData)||c.splice(i,1)}function ub(a,b,c,d,
+e,f){if(""!==b)for(var h=a.aiDisplay,d=Na(b,d,e,f),e=h.length-1;0<=e;e--)b=a.aoData[h[e]]._aFilterData[c],d.test(b)||h.splice(e,1)}function tb(a,b,c,d,e,f){var d=Na(b,d,e,f),e=a.oPreviousSearch.sSearch,f=a.aiDisplayMaster,h;0!==p.ext.search.length&&(c=!0);h=wb(a);if(0>=b.length)a.aiDisplay=f.slice();else{if(h||c||e.length>b.length||0!==b.indexOf(e)||a.bSorted)a.aiDisplay=f.slice();b=a.aiDisplay;for(c=b.length-1;0<=c;c--)d.test(a.aoData[b[c]]._sFilterRow)||b.splice(c,1)}}function Na(a,b,c,d){a=b?a:
+Oa(a);c&&(a="^(?=.*?"+g.map(a.match(/"[^"]+"|[^ ]+/g)||"",function(a){return'"'===a.charAt(0)?a.match(/^"(.*)"$/)[1]:a}).join(")(?=.*?")+").*$");return RegExp(a,d?"i":"")}function Oa(a){return a.replace(Sb,"\\$1")}function wb(a){var b=a.aoColumns,c,d,e,f,h,i,j,g,m=p.ext.type.search;c=!1;d=0;for(f=a.aoData.length;d<f;d++)if(g=a.aoData[d],!g._aFilterData){i=[];e=0;for(h=b.length;e<h;e++)c=b[e],c.bSearchable?(j=A(a,d,e,"filter"),j=m[c.sType]?m[c.sType](j):null!==j?j:""):j="",j.indexOf&&-1!==j.indexOf("&")&&
+(qa.innerHTML=j,j=Tb?qa.textContent:qa.innerText),j.replace&&(j=j.replace(/[\r\n]/g,"")),i.push(j);g._aFilterData=i;g._sFilterRow=i.join(" ");c=!0}return c}function pb(a){var b=a.sTableId,c=a.aanFeatures.i,d=g("<div/>",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:xb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),g(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function xb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,
+d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),h=a.fnRecordsDisplay(),i=h?c.sInfo:c.sInfoEmpty;h!==f&&(i+=" "+c.sInfoFiltered);i+=c.sInfoPostFix;i=yb(a,i);c=c.fnInfoCallback;null!==c&&(i=c.call(a.oInstance,a,d,e,f,h,i));g(b).html(i)}}function yb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),h=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,
+c.call(a,f)).replace(/_PAGE_/g,c.call(a,h?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,h?1:Math.ceil(f/e)))}function ra(a){var b,c,d=a.iInitDisplayStart,e=a.aoColumns,f;c=a.oFeatures;if(a.bInitialised){kb(a);hb(a);I(a,a.aoHeader);I(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ca(a);b=0;for(c=e.length;b<c;b++)f=e[b],f.sWidth&&(f.nTh.style.width=s(f.sWidth));K(a);e=z(a);"ssp"!=e&&("ajax"==e?na(a,[],function(c){var f=oa(a,c);for(b=0;b<f.length;b++)H(a,f[b]);a.iInitDisplayStart=d;K(a);C(a,!1);pa(a,c)},a):(C(a,
+!1),pa(a)))}else setTimeout(function(){ra(a)},200)}function pa(a,b){a._bInitComplete=!0;b&&U(a);t(a,"aoInitComplete","init",[a,b])}function Pa(a,b){var c=parseInt(b,10);a._iDisplayLength=c;Qa(a);t(a,null,"length",[a,c])}function lb(a){for(var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=g.isArray(d[0]),f=e?d[0]:d,e=e?d[1]:d,d=g("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect}),h=0,i=f.length;h<i;h++)d[0][h]=new Option(e[h],f[h]);var j=g("<div><label/></div>").addClass(b.sLength);
+a.aanFeatures.l||(j[0].id=c+"_length");b=a.oLanguage.sLengthMenu.split(/(_MENU_)/);j.children().append(1<b.length?[b[0],d,b[2]]:b[0]);g("select",j).val(a._iDisplayLength).bind("change.DT",function(){Pa(a,g(this).val());J(a)});g(a.nTable).bind("length.dt.DT",function(a,b,c){g("select",j).val(c)});return j[0]}function qb(a){var b=a.sPaginationType,c=p.ext.pager[b],d="function"===typeof c,e=function(a){J(a)},b=g("<div/>").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=
+a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,j=a._iDisplayLength,g=a.fnRecordsDisplay(),m=-1===j,b=m?0:Math.ceil(b/j),j=m?1:Math.ceil(g/j),g=c(b,j),o,m=0;for(o=f.p.length;m<o;m++)La(a,"pageButton")(a,f.p[m],m,g,b,j)}else c.fnUpdate(a,e)},sName:"pagination"}));return b}function Ra(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&(d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>
+d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:O(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(t(a,null,"page",[a]),c&&J(a));return b}function nb(a){return g("<div/>",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&g(a.aanFeatures.r).css("display",b?"block":"none");t(a,null,"processing",[a,b])}function ob(a){var b=
+g(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,h=b.children("caption"),i=h.length?h[0]._captionSide:null,j=g(b[0].cloneNode(!1)),n=g(b[0].cloneNode(!1)),m=b.children("tfoot");c.sX&&"100%"===b.attr("width")&&b.removeAttr("width");m.length||(m=null);c=g("<div/>",{"class":f.sScrollWrapper}).append(g("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:s(d):"100%"}).append(g("<div/>",
+{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(j.removeAttr("id").css("margin-left",0).append(b.children("thead")))).append("top"===i?h:null)).append(g("<div/>",{"class":f.sScrollBody}).css({overflow:"auto",height:!e?null:s(e),width:!d?null:s(d)}).append(b));m&&c.append(g("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:s(d):"100%"}).append(g("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",
+0).append(b.children("tfoot")))).append("bottom"===i?h:null));var b=c.children(),o=b[0],f=b[1],k=m?b[2]:null;d&&g(f).scroll(function(){var a=this.scrollLeft;o.scrollLeft=a;m&&(k.scrollLeft=a)});a.nScrollHead=o;a.nScrollBody=f;a.nScrollFoot=k;a.aoDrawCallback.push({fn:V,sName:"scrolling"});return c[0]}function V(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,f=b.iBarWidth,h=g(a.nScrollHead),i=h[0].style,j=h.children("div"),n=j[0].style,m=j.children("table"),j=a.nScrollBody,o=g(j),k=j.style,l=g(a.nScrollFoot).children("div"),
+p=l.children("table"),r=g(a.nTHead),q=g(a.nTable),ba=q[0],L=ba.style,t=a.nTFoot?g(a.nTFoot):null,ca=a.oBrowser,v=ca.bScrollOversize,x,u,y,w,z,A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};q.children("thead, tfoot").remove();z=r.clone().prependTo(q);x=r.find("tr");y=z.find("tr");z.find("th, td").removeAttr("tabindex");t&&(w=t.clone().prependTo(q),u=t.find("tr"),w=w.find("tr"));c||(k.width="100%",h[0].style.width=
+"100%");g.each(ma(a,z),function(b,c){D=ga(a,b);c.style.width=a.aoColumns[D].sWidth});t&&F(function(a){a.style.width=""},w);b.bCollapse&&""!==e&&(k.height=o[0].offsetHeight+r[0].offsetHeight+"px");h=q.outerWidth();if(""===c){if(L.width="100%",v&&(q.find("tbody").height()>j.offsetHeight||"scroll"==o.css("overflow-y")))L.width=s(q.outerWidth()-f)}else""!==d?L.width=s(d):h==o.width()&&o.height()<q.height()?(L.width=s(h-f),q.outerWidth()>h-f&&(L.width=s(h))):L.width=s(h);h=q.outerWidth();F(E,y);F(function(a){C.push(a.innerHTML);
+A.push(s(g(a).css("width")))},y);F(function(a,b){a.style.width=A[b]},x);g(y).height(0);t&&(F(E,w),F(function(a){B.push(s(g(a).css("width")))},w),F(function(a,b){a.style.width=B[b]},u),g(w).height(0));F(function(a,b){a.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+C[b]+"</div>";a.style.width=A[b]},y);t&&F(function(a,b){a.innerHTML="";a.style.width=B[b]},w);if(q.outerWidth()<h){u=j.scrollHeight>j.offsetHeight||"scroll"==o.css("overflow-y")?h+f:h;if(v&&(j.scrollHeight>
+j.offsetHeight||"scroll"==o.css("overflow-y")))L.width=s(u-f);(""===c||""!==d)&&O(a,1,"Possible column misalignment",6)}else u="100%";k.width=s(u);i.width=s(u);t&&(a.nScrollFoot.style.width=s(u));!e&&v&&(k.height=s(ba.offsetHeight+f));e&&b.bCollapse&&(k.height=s(e),b=c&&ba.offsetWidth>j.offsetWidth?f:0,ba.offsetHeight<j.offsetHeight&&(k.height=s(ba.offsetHeight+b)));b=q.outerWidth();m[0].style.width=s(b);n.width=s(b);m=q.height()>j.clientHeight||"scroll"==o.css("overflow-y");ca="padding"+(ca.bScrollbarLeft?
+"Left":"Right");n[ca]=m?f+"px":"0px";t&&(p[0].style.width=s(b),l[0].style.width=s(b),l[0].style[ca]=m?f+"px":"0px");o.scroll();if(a.bSorted||a.bFiltered)j.scrollTop=0}function F(a,b,c){for(var d=0,e=0,f=b.length,h,i;e<f;){h=b[e].firstChild;for(i=c?c[e].firstChild:null;h;)1===h.nodeType&&(c?a(h,i,d):a(h,d),d++),h=h.nextSibling,i=c?i.nextSibling:null;e++}}function Ca(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,h=d.sXInner,i=c.length,d=W(a,"bVisible"),j=g("th",a.nTHead),n=b.getAttribute("width"),
+m=b.parentNode,o=!1,k,l;for(k=0;k<d.length;k++)l=c[d[k]],null!==l.sWidth&&(l.sWidth=zb(l.sWidthOrig,m),o=!0);if(!o&&!f&&!e&&i==Y(a)&&i==j.length)for(k=0;k<i;k++)c[k].sWidth=s(j.eq(k).width());else{i=g(b.cloneNode(!1)).css("visibility","hidden").removeAttr("id").append(g(a.nTHead).clone(!1)).append(g(a.nTFoot).clone(!1)).append(g("<tbody><tr/></tbody>"));i.find("tfoot th, tfoot td").css("width","");var p=i.find("tbody tr"),j=ma(a,i.find("thead")[0]);for(k=0;k<d.length;k++)l=c[d[k]],j[k].style.width=
+null!==l.sWidthOrig&&""!==l.sWidthOrig?s(l.sWidthOrig):"";if(a.aoData.length)for(k=0;k<d.length;k++)o=d[k],l=c[o],g(Ab(a,o)).clone(!1).append(l.sContentPadding).appendTo(p);i.appendTo(m);f&&h?i.width(h):f?(i.css("width","auto"),i.width()<m.offsetWidth&&i.width(m.offsetWidth)):e?i.width(m.offsetWidth):n&&i.width(n);Bb(a,i[0]);if(f){for(k=h=0;k<d.length;k++)l=c[d[k]],e=g(j[k]).outerWidth(),h+=null===l.sWidthOrig?e:parseInt(l.sWidth,10)+e-g(j[k]).width();i.width(s(h));b.style.width=s(h)}for(k=0;k<d.length;k++)if(l=
+c[d[k]],e=g(j[k]).width())l.sWidth=s(e);b.style.width=s(i.css("width"));i.remove()}n&&(b.style.width=s(n));if((n||f)&&!a._reszEvt)g(za).bind("resize.DT-"+a.sInstance,Ma(function(){U(a)})),a._reszEvt=!0}function Ma(a,b){var c=b||200,d,e;return function(){var b=this,h=+new Date,i=arguments;d&&h<d+c?(clearTimeout(e),e=setTimeout(function(){d=l;a.apply(b,i)},c)):d?(d=h,a.apply(b,i)):d=h}}function zb(a,b){if(!a)return 0;var c=g("<div/>").css("width",s(a)).appendTo(b||N.body),d=c[0].offsetWidth;c.remove();
+return d}function Bb(a,b){var c=a.oScroll;if(c.sX||c.sY)c=!c.sX?c.iBarWidth:0,b.style.width=s(g(b).outerWidth()-c)}function Ab(a,b){var c=Cb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?g("<td/>").html(A(a,c,b,"display"))[0]:d.anCells[b]}function Cb(a,b){for(var c,d=-1,e=-1,f=0,h=a.aoData.length;f<h;f++)c=A(a,f,b,"display")+"",c=c.replace(Ub,""),c.length>d&&(d=c.length,e=f);return e}function s(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function Db(){if(!p.__scrollbarWidth){var a=
+g("<p/>").css({width:"100%",height:200,padding:0})[0],b=g("<div/>").css({position:"absolute",top:0,left:0,width:200,height:150,padding:0,overflow:"hidden",visibility:"hidden"}).append(a).appendTo("body"),c=a.offsetWidth;b.css("overflow","scroll");a=a.offsetWidth;c===a&&(a=b[0].clientWidth);b.remove();p.__scrollbarWidth=c-a}return p.__scrollbarWidth}function Q(a){var b,c,d=[],e=a.aoColumns,f,h,i,j;b=a.aaSortingFixed;c=g.isPlainObject(b);var n=[];f=function(a){a.length&&!g.isArray(a[0])?n.push(a):n.push.apply(n,
+a)};g.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;a<n.length;a++){j=n[a][0];f=e[j].aDataSort;b=0;for(c=f.length;b<c;b++)h=f[b],i=e[h].sType||"string",d.push({src:j,col:h,dir:n[a][1],index:n[a][2],type:i,formatter:p.ext.type.order[i+"-pre"]})}return d}function jb(a){var b,c,d=[],e=p.ext.type.order,f=a.aoData,h=0,i,g=a.aiDisplayMaster,n;Da(a);n=Q(a);b=0;for(c=n.length;b<c;b++)i=n[b],i.formatter&&h++,Eb(a,i.col);if("ssp"!=z(a)&&0!==n.length){b=0;for(c=g.length;b<c;b++)d[g[b]]=
+b;h===n.length?g.sort(function(a,b){var c,e,h,g,i=n.length,j=f[a]._aSortData,l=f[b]._aSortData;for(h=0;h<i;h++)if(g=n[h],c=j[g.col],e=l[g.col],c=c<e?-1:c>e?1:0,0!==c)return"asc"===g.dir?c:-c;c=d[a];e=d[b];return c<e?-1:c>e?1:0}):g.sort(function(a,b){var c,h,g,i,j=n.length,l=f[a]._aSortData,p=f[b]._aSortData;for(g=0;g<j;g++)if(i=n[g],c=l[i.col],h=p[i.col],i=e[i.type+"-"+i.dir]||e["string-"+i.dir],c=i(c,h),0!==c)return c;c=d[a];h=d[b];return c<h?-1:c>h?1:0})}a.bSorted=!0}function Fb(a){for(var b,c,
+d=a.aoColumns,e=Q(a),a=a.oLanguage.oAria,f=0,h=d.length;f<h;f++){c=d[f];var i=c.asSorting;b=c.sTitle.replace(/<.*?>/g,"");var g=c.nTh;g.removeAttribute("aria-sort");c.bSortable&&(0<e.length&&e[0].col==f?(g.setAttribute("aria-sort","asc"==e[0].dir?"ascending":"descending"),c=i[e[0].index+1]||i[0]):c=i[0],b+="asc"===c?a.sSortAscending:a.sSortDescending);g.setAttribute("aria-label",b)}}function Sa(a,b,c,d){var e=a.aaSorting,f=a.aoColumns[b].asSorting,h=function(a){var b=a._idx;b===l&&(b=g.inArray(a[1],
+f));return b+1>=f.length?0:b+1};c&&a.oFeatures.bSortMulti?(c=g.inArray(b,B(e,"0")),-1!==c?(b=h(e[c]),e[c][1]=f[b],e[c]._idx=b):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=h(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);K(a);"function"==typeof d&&d(a)}function Ka(a,b,c,d){var e=a.aoColumns[c];Ta(b,{},function(b){!1!==e.bSortable&&(a.oFeatures.bProcessing?(C(a,!0),setTimeout(function(){Sa(a,c,b.shiftKey,d);"ssp"!==z(a)&&C(a,!1)},0)):Sa(a,
+c,b.shiftKey,d))})}function sa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=Q(a),e=a.oFeatures,f,h;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++)h=b[e].src,g(B(a.aoData,"anCells",h)).removeClass(c+(2>e?e+1:3));e=0;for(f=d.length;e<f;e++)h=d[e].src,g(B(a.aoData,"anCells",h)).addClass(c+(2>e?e+1:3))}a.aLastSort=d}function Eb(a,b){var c=a.aoColumns[b],d=p.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,X(a,b)));for(var f,h=p.ext.type.order[c.sType+"-pre"],g=0,j=a.aoData.length;g<
+j;g++)if(c=a.aoData[g],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[g]:A(a,g,b,"sort"),c._aSortData[b]=h?h(f):f}function ta(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={iCreate:+new Date,iStart:a._iDisplayStart,iLength:a._iDisplayLength,aaSorting:g.extend(!0,[],a.aaSorting),oSearch:g.extend(!0,{},a.oPreviousSearch),aoSearchCols:g.extend(!0,[],a.aoPreSearchCols),abVisCols:B(a.aoColumns,"bVisible")};t(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.fnStateSaveCallback.call(a.oInstance,
+a,b)}}function Gb(a){var b,c,d=a.aoColumns;if(a.oFeatures.bStateSave){var e=a.fnStateLoadCallback.call(a.oInstance,a);if(e&&(b=t(a,"aoStateLoadParams","stateLoadParams",[a,e]),-1===g.inArray(!1,b)&&(b=a.iStateDuration,!(0<b&&e.iCreate<+new Date-1E3*b)&&d.length===e.aoSearchCols.length))){a.oLoadedState=g.extend(!0,{},e);a._iDisplayStart=e.iStart;a.iInitDisplayStart=e.iStart;a._iDisplayLength=e.iLength;a.aaSorting=g.map(e.aaSorting,function(a){return a[0]>=d.length?[0,a[1]]:a});g.extend(a.oPreviousSearch,
+e.oSearch);g.extend(!0,a.aoPreSearchCols,e.aoSearchCols);var f=e.abVisCols;b=0;for(c=f.length;b<c;b++)d[b].bVisible=f[b];t(a,"aoStateLoaded","stateLoaded",[a,e])}}}function ua(a){var b=p.settings,a=g.inArray(a,B(b,"nTable"));return-1!==a?b[a]:null}function O(a,b,c,d){c="DataTables warning: "+(null!==a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)za.console&&console.log&&console.log(c);else if(a=p.ext,"alert"==(a.sErrMode||
+a.errMode))alert(c);else throw Error(c);}function D(a,b,c,d){g.isArray(c)?g.each(c,function(c,d){g.isArray(d)?D(a,b,d[0],d[1]):D(a,b,d)}):(d===l&&(d=c),b[c]!==l&&(a[d]=b[c]))}function Hb(a,b,c){var d,e;for(e in b)b.hasOwnProperty(e)&&(d=b[e],g.isPlainObject(d)?(g.isPlainObject(a[e])||(a[e]={}),g.extend(!0,a[e],d)):a[e]=c&&"data"!==e&&"aaData"!==e&&g.isArray(d)?d.slice():d);return a}function Ta(a,b,c){g(a).bind("click.DT",b,function(b){a.blur();c(b)}).bind("keypress.DT",b,function(a){13===a.which&&
+(a.preventDefault(),c(a))}).bind("selectstart.DT",function(){return!1})}function y(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function t(a,b,c,d){var e=[];b&&(e=g.map(a[b].slice().reverse(),function(b){return b.fn.apply(a.oInstance,d)}));null!==c&&g(a.nTable).trigger(c+".dt",d);return e}function Qa(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;c===a.fnRecordsDisplay()&&(b=c-d);if(-1===d||0>b)b=0;a._iDisplayStart=b}function La(a,b){var c=a.renderer,d=p.ext.renderer[b];return g.isPlainObject(c)&&
+c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function z(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Ua(a,b){var c=[],c=Ib.numbers_length,d=Math.floor(c/2);b<=c?c=R(0,b):a<=d?(c=R(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=R(b-(c-2),b):(c=R(a-1,a+2),c.push("ellipsis"),c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function bb(a){g.each({num:function(b){return va(b,a)},"num-fmt":function(b){return va(b,a,Va)},"html-num":function(b){return va(b,
+a,wa)},"html-num-fmt":function(b){return va(b,a,wa,Va)}},function(b,c){u.type.order[b+a+"-pre"]=c})}function Jb(a){return function(){var b=[ua(this[p.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return p.ext.internal[a].apply(this,b)}}var p,u,q,r,x,Wa={},Kb=/[\r\n]/g,wa=/<.*?>/g,Vb=/^[\d\+\-a-zA-Z]/,Sb=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Va=/[',$\u00a3\u20ac\u00a5%\u2009\u202F]/g,da=function(a){return!a||"-"===a?!0:!1},Lb=function(a){var b=
+parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Mb=function(a,b){Wa[b]||(Wa[b]=RegExp(Oa(b),"g"));return"string"===typeof a?a.replace(/\./g,"").replace(Wa[b],"."):a},Xa=function(a,b,c){var d="string"===typeof a;b&&d&&(a=Mb(a,b));c&&d&&(a=a.replace(Va,""));return!a||"-"===a||!isNaN(parseFloat(a))&&isFinite(a)},Nb=function(a,b,c){return da(a)?!0:a&&"string"!==typeof a?null:Xa(a.replace(wa,""),b,c)?!0:null},B=function(a,b,c){var d=[],e=0,f=a.length;if(c!==l)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);
+else for(;e<f;e++)a[e]&&d.push(a[e][b]);return d},xa=function(a,b,c,d){var e=[],f=0,h=b.length;if(d!==l)for(;f<h;f++)e.push(a[b[f]][c][d]);else for(;f<h;f++)e.push(a[b[f]][c]);return e},R=function(a,b){var c=[],d;b===l?(b=0,d=a):(d=b,b=a);for(var e=b;e<d;e++)c.push(e);return c},Ja=function(a){var b=[],c,d,e=a.length,f,h=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<h;f++)if(b[f]===c)continue a;b.push(c);h++}return b},w=function(a,b,c){a[b]!==l&&(a[c]=a[b])},Z=/\[.*?\]$/,P=/\(\)$/,qa=g("<div>")[0],Tb=qa.textContent!==
+l,Ub=/<.*?>/g;p=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new q(ua(this[u.iApiIndex])):new q(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=g.isArray(a)&&(g.isArray(a[0])||g.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===l||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===l||
+a?b.draw(!1):(""!==d.sX||""!==d.sY)&&V(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===l||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],g=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,g);(c===l||c)&&d.draw();return g};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(!a)};this.fnFilter=function(a,b,c,d,e,g){e=this.api(!0);null===
+b||b===l?e.search(a,c,d,g):e.column(b).search(a,c,d,g);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==l){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==l||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==l?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==
+c?(a=b.cell(a).index(),[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===l||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===l||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return ua(this[u.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};
+this.fnSortListener=function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var g=this.api(!0);c===l||null===c?g.row(b).data(a):g.cell(b,c).data(a);(e===l||e)&&g.columns.adjust();(d===l||d)&&g.draw();return 0};this.fnVersionCheck=u.fnVersionCheck;var b=this,c=a===l,d=this.length;c&&(a={});this.oApi=this.internal=u.internal;for(var e in p.ext.internal)e&&(this[e]=Jb(e));this.each(function(){var e={},h=1<d?Hb(e,a,!0):a,i=0,j,n=this.getAttribute("id"),e=!1,m=p.defaults;
+if("table"!=this.nodeName.toLowerCase())O(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{cb(m);db(m.column);G(m,m,!0);G(m.column,m.column,!0);G(m,h);var o=p.settings,i=0;for(j=o.length;i<j;i++){if(o[i].nTable==this){j=h.bRetrieve!==l?h.bRetrieve:m.bRetrieve;if(c||j)return o[i].oInstance;if(h.bDestroy!==l?h.bDestroy:m.bDestroy){o[i].oInstance.fnDestroy();break}else{O(o[i],0,"Cannot reinitialise DataTable",3);return}}if(o[i].sTableId==this.id){o.splice(i,1);break}}if(null===n||""===
+n)this.id=n="DataTables_Table_"+p.ext._unique++;var k=g.extend(!0,{},p.models.oSettings,{nTable:this,oApi:b.internal,oInit:h,sDestroyWidth:g(this)[0].style.width,sInstance:n,sTableId:n});o.push(k);k.oInstance=1===b.length?b:g(this).dataTable();cb(h);h.oLanguage&&M(h.oLanguage);h.aLengthMenu&&!h.iDisplayLength&&(h.iDisplayLength=g.isArray(h.aLengthMenu[0])?h.aLengthMenu[0][0]:h.aLengthMenu[0]);h=Hb(g.extend(!0,{},m),h);D(k.oFeatures,h,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));
+D(k,h,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"],["bJQueryUI","bJUI"]]);D(k.oScroll,h,[["sScrollX","sX"],["sScrollXInner","sXInner"],
+["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);D(k.oLanguage,h,"fnInfoCallback");y(k,"aoDrawCallback",h.fnDrawCallback,"user");y(k,"aoServerParams",h.fnServerParams,"user");y(k,"aoStateSaveParams",h.fnStateSaveParams,"user");y(k,"aoStateLoadParams",h.fnStateLoadParams,"user");y(k,"aoStateLoaded",h.fnStateLoaded,"user");y(k,"aoRowCallback",h.fnRowCallback,"user");y(k,"aoRowCreatedCallback",h.fnCreatedRow,"user");y(k,"aoHeaderCallback",h.fnHeaderCallback,"user");y(k,"aoFooterCallback",h.fnFooterCallback,
+"user");y(k,"aoInitComplete",h.fnInitComplete,"user");y(k,"aoPreDrawCallback",h.fnPreDrawCallback,"user");n=k.oClasses;h.bJQueryUI?(g.extend(n,p.ext.oJUIClasses,h.oClasses),h.sDom===m.sDom&&"lfrtip"===m.sDom&&(k.sDom='<"H"lfr>t<"F"ip>'),k.renderer)?g.isPlainObject(k.renderer)&&!k.renderer.header&&(k.renderer.header="jqueryui"):k.renderer="jqueryui":g.extend(n,p.ext.classes,h.oClasses);g(this).addClass(n.sTable);if(""!==k.oScroll.sX||""!==k.oScroll.sY)k.oScroll.iBarWidth=Db();!0===k.oScroll.sX&&(k.oScroll.sX=
+"100%");k.iInitDisplayStart===l&&(k.iInitDisplayStart=h.iDisplayStart,k._iDisplayStart=h.iDisplayStart);null!==h.iDeferLoading&&(k.bDeferLoading=!0,i=g.isArray(h.iDeferLoading),k._iRecordsDisplay=i?h.iDeferLoading[0]:h.iDeferLoading,k._iRecordsTotal=i?h.iDeferLoading[1]:h.iDeferLoading);""!==h.oLanguage.sUrl?(k.oLanguage.sUrl=h.oLanguage.sUrl,g.getJSON(k.oLanguage.sUrl,null,function(a){M(a);G(m.oLanguage,a);g.extend(true,k.oLanguage,h.oLanguage,a);ra(k)}),e=!0):g.extend(!0,k.oLanguage,h.oLanguage);
+null===h.asStripeClasses&&(k.asStripeClasses=[n.sStripeOdd,n.sStripeEven]);var i=k.asStripeClasses,r=g("tbody tr:eq(0)",this);-1!==g.inArray(!0,g.map(i,function(a){return r.hasClass(a)}))&&(g("tbody tr",this).removeClass(i.join(" ")),k.asDestroyStripes=i.slice());var o=[],q,i=this.getElementsByTagName("thead");0!==i.length&&($(k.aoHeader,i[0]),o=ma(k));if(null===h.aoColumns){q=[];i=0;for(j=o.length;i<j;i++)q.push(null)}else q=h.aoColumns;i=0;for(j=q.length;i<j;i++)Aa(k,o?o[i]:null);gb(k,h.aoColumnDefs,
+q,function(a,b){fa(k,a,b)});if(r.length){var s=function(a,b){return a.getAttribute("data-"+b)?b:null};g.each(ia(k,r[0]).cells,function(a,b){var c=k.aoColumns[a];if(c.mData===a){var d=s(b,"sort")||s(b,"order"),e=s(b,"filter")||s(b,"search");if(d!==null||e!==null){c.mData={_:a+".display",sort:d!==null?a+".@data-"+d:l,type:d!==null?a+".@data-"+d:l,filter:e!==null?a+".@data-"+e:l};fa(k,a)}}})}var u=k.oFeatures;h.bStateSave&&(u.bStateSave=!0,Gb(k,h),y(k,"aoDrawCallback",ta,"state_save"));if(h.aaSorting===
+l){o=k.aaSorting;i=0;for(j=o.length;i<j;i++)o[i][1]=k.aoColumns[i].asSorting[0]}sa(k);u.bSort&&y(k,"aoDrawCallback",function(){if(k.bSorted){var a=Q(k),b={};g.each(a,function(a,c){b[c.src]=c.dir});t(k,null,"order",[k,a,b]);Fb(k)}});y(k,"aoDrawCallback",function(){(k.bSorted||z(k)==="ssp"||u.bDeferRender)&&sa(k)},"sc");eb(k);i=g(this).children("caption").each(function(){this._captionSide=g(this).css("caption-side")});j=g(this).children("thead");0===j.length&&(j=g("<thead/>").appendTo(this));k.nTHead=
+j[0];j=g(this).children("tbody");0===j.length&&(j=g("<tbody/>").appendTo(this));k.nTBody=j[0];j=g(this).children("tfoot");if(0===j.length&&0<i.length&&(""!==k.oScroll.sX||""!==k.oScroll.sY))j=g("<tfoot/>").appendTo(this);0===j.length||0===j.children().length?g(this).addClass(n.sNoFooter):0<j.length&&(k.nTFoot=j[0],$(k.aoFooter,k.nTFoot));if(h.aaData)for(i=0;i<h.aaData.length;i++)H(k,h.aaData[i]);else(k.bDeferLoading||"dom"==z(k))&&ha(k,g(k.nTBody).children("tr"));k.aiDisplay=k.aiDisplayMaster.slice();
+k.bInitialised=!0;!1===e&&ra(k)}});b=null;return this};var Ob=[],v=Array.prototype,Wb=function(a){var b,c,d=p.settings,e=g.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=g.inArray(a,e),-1!==b?[d[b]]:null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=g(a):a instanceof g&&(c=a)}else return[];if(c)return c.map(function(){b=g.inArray(this,e);return-1!==b?d[b]:null}).toArray()};
+p.Api=q=function(a,b){if(!this instanceof q)throw"DT API must be constructed as a new object";var c=[],d=function(a){(a=Wb(a))&&c.push.apply(c,a)};if(g.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=Ja(c);b&&this.push.apply(this,b.toArray?b.toArray():b);this.selector={rows:null,cols:null,opts:null};q.extend(this,this,Ob)};q.prototype={concat:v.concat,context:[],each:function(a){if(v.forEach)v.forEach.call(this,a,this);else for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],
+b,this);return this},eq:function(a){var b=this.context;return b.length>a?new q(b[a],this[a]):null},filter:function(a){var b=[];if(v.filter)b=v.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);return new q(this.context,b)},flatten:function(){var a=[];return new q(this.context,a.concat.apply(a,this.toArray()))},join:v.join,indexOf:v.indexOf||function(a,b){for(var c=b||0,d=this.length;c<d;c++)if(this[c]===a)return c;return-1},iterator:function(a,
+b,c){var d=[],e,f,h,g,j,n=this.context,m,o,k=this.selector;"string"===typeof a&&(c=b,b=a,a=!1);f=0;for(h=n.length;f<h;f++)if("table"===b)e=c(n[f],f),e!==l&&d.push(e);else if("columns"===b||"rows"===b)e=c(n[f],this[f],f),e!==l&&d.push(e);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){o=this[f];"column-rows"===b&&(m=Ya(n[f],k.opts));g=0;for(j=o.length;g<j;g++)e=o[g],e="cell"===b?c(n[f],e.row,e.column,f,g):c(n[f],e,f,g,m),e!==l&&d.push(e)}return d.length?(a=new q(n,a?d.concat.apply([],
+d):d),b=a.selector,b.rows=k.rows,b.cols=k.cols,b.opts=k.opts,a):this},lastIndexOf:v.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(a){var b=[];if(v.map)b=v.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new q(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:v.pop,push:v.push,reduce:v.reduce||function(a,b){return fb(this,a,b,0,this.length,1)},reduceRight:v.reduceRight||
+function(a,b){return fb(this,a,b,this.length-1,-1,-1)},reverse:v.reverse,selector:null,shift:v.shift,sort:v.sort,splice:v.splice,toArray:function(){return v.slice.call(this)},to$:function(){return g(this)},toJQuery:function(){return g(this)},unique:function(){return new q(this.context,Ja(this))},unshift:v.unshift};q.extend=function(a,b,c){if(b&&(b instanceof q||b.__dt_wrapper)){var d,e,f,h=function(b,c){return function(){var d=b.apply(a,arguments);q.extend(d,d,c.methodExt);return d}};d=0;for(e=c.length;d<
+e;d++)f=c[d],b[f.name]="function"===typeof f.val?h(f.val,f):g.isPlainObject(f.val)?{}:f.val,b[f.name].__dt_wrapper=!0,q.extend(a,b[f.name],f.propExt)}};q.register=r=function(a,b){if(g.isArray(a))for(var c=0,d=a.length;c<d;c++)q.register(a[c],b);else{for(var e=a.split("."),f=Ob,h,i,c=0,d=e.length;c<d;c++){h=(i=-1!==e[c].indexOf("()"))?e[c].replace("()",""):e[c];var j;a:{j=0;for(var n=f.length;j<n;j++)if(f[j].name===h){j=f[j];break a}j=null}j||(j={name:h,val:{},methodExt:[],propExt:[]},f.push(j));c===
+d-1?j.val=b:f=i?j.methodExt:j.propExt}q.ready&&p.api.build()}};q.registerPlural=x=function(a,b,c){q.register(a,c);q.register(b,function(){var a=c.apply(this,arguments);return a===this?this:a instanceof q?a.length?g.isArray(a[0])?new q(a.context,a[0]):a[0]:l:a})};r("tables()",function(a){var b;if(a){b=q;var c=this.context;if("number"===typeof a)a=[c[a]];else var d=g.map(c,function(a){return a.nTable}),a=g(d).filter(a).map(function(){var a=g.inArray(this,d);return c[a]}).toArray();b=new b(a)}else b=
+this;return b});r("table()",function(a){var a=this.tables(a),b=a.context;return b.length?new q(b[0]):a});x("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable})});x("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody})});x("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead})});x("tables().footer()","table().footer()",function(){return this.iterator("table",
+function(a){return a.nTFoot})});r("draw()",function(a){return this.iterator("table",function(b){K(b,!1===a)})});r("page()",function(a){return a===l?this.page.info().page:this.iterator("table",function(b){Ra(b,a)})});r("page.info()",function(){if(0===this.context.length)return l;var a=this.context[0],b=a._iDisplayStart,c=a._iDisplayLength,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d}});
+r("page.len()",function(a){return a===l?0!==this.context.length?this.context[0]._iDisplayLength:l:this.iterator("table",function(b){Pa(b,a)})});var Pb=function(a,b,c){"ssp"==z(a)?K(a,b):(C(a,!0),na(a,[],function(c){ja(a);for(var c=oa(a,c),d=0,h=c.length;d<h;d++)H(a,c[d]);K(a,b);C(a,!1)}));if(c){var d=new q(a);d.one("draw",function(){c(d.ajax.json())})}};r("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});r("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});
+r("ajax.reload()",function(a,b){return this.iterator("table",function(c){Pb(c,!1===b,a)})});r("ajax.url()",function(a){var b=this.context;if(a===l){if(0===b.length)return l;b=b[0];return b.ajax?g.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(b){g.isPlainObject(b.ajax)?b.ajax.url=a:b.ajax=a})});r("ajax.url().load()",function(a,b){return this.iterator("table",function(c){Pb(c,!1===b,a)})});var Za=function(a,b){var c=[],d,e,f,h,i,j;if(!a||"string"===typeof a||
+a.length===l)a=[a];f=0;for(h=a.length;f<h;f++){e=a[f]&&a[f].split?a[f].split(","):[a[f]];i=0;for(j=e.length;i<j;i++)(d=b("string"===typeof e[i]?g.trim(e[i]):e[i]))&&d.length&&c.push.apply(c,d)}return c},$a=function(a){a||(a={});a.filter&&!a.search&&(a.search=a.filter);return{search:a.search||"none",order:a.order||"current",page:a.page||"all"}},ab=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ya=function(a,b){var c,
+d,e,f=[],h=a.aiDisplay;c=a.aiDisplayMaster;var i=b.search;d=b.order;e=b.page;if("ssp"==z(a))return"removed"===i?[]:R(0,c.length);if("current"==e){c=a._iDisplayStart;for(d=a.fnDisplayEnd();c<d;c++)f.push(h[c])}else if("current"==d||"applied"==d)f="none"==i?c.slice():"applied"==i?h.slice():g.map(c,function(a){return-1===g.inArray(a,h)?a:null});else if("index"==d||"original"==d){c=0;for(d=a.aoData.length;c<d;c++)"none"==i?f.push(c):(e=g.inArray(c,h),(-1===e&&"removed"==i||1===e&&"applied"==i)&&f.push(c))}return f};
+r("rows()",function(a,b){a===l?a="":g.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(c){var e=b;return Za(a,function(a){var b=Lb(a);if(b!==null&&!e)return[b];var i=Ya(c,e);if(b!==null&&g.inArray(b,i)!==-1)return[b];if(!a)return i;for(var b=[],j=0,n=i.length;j<n;j++)b.push(c.aoData[i[j]].nTr);return a.nodeName&&g.inArray(a,b)!==-1?[a._DT_RowIndex]:g(b).filter(a).map(function(){return this._DT_RowIndex}).toArray()})});c.selector.rows=a;c.selector.opts=b;return c});r("rows().nodes()",
+function(){return this.iterator("row",function(a,b){return a.aoData[b].nTr||l})});r("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return xa(a.aoData,b,"_aData")})});x("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){var d=b.aoData[c];return"search"===a?d._aFilterData:d._aSortData})});x("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){la(b,c,a)})});x("rows().indexes()","row().index()",function(){return this.iterator("row",
+function(a,b){return b})});x("rows().remove()","row().remove()",function(){var a=this;return this.iterator("row",function(b,c,d){var e=b.aoData;e.splice(c,1);for(var f=0,h=e.length;f<h;f++)null!==e[f].nTr&&(e[f].nTr._DT_RowIndex=f);g.inArray(c,b.aiDisplay);ka(b.aiDisplayMaster,c);ka(b.aiDisplay,c);ka(a[d],c,!1);Qa(b)})});r("rows.add()",function(a){var b=this.iterator("table",function(b){var c,f,h,g=[];f=0;for(h=a.length;f<h;f++)c=a[f],c.nodeName&&"TR"===c.nodeName.toUpperCase()?g.push(ha(b,c)[0]):
+g.push(H(b,c));return g}),c=this.rows(-1);c.pop();c.push.apply(c,b.toArray());return c});r("row()",function(a,b){return ab(this.rows(a,b))});r("row().data()",function(a){var b=this.context;if(a===l)return b.length&&this.length?b[0].aoData[this[0]]._aData:l;b[0].aoData[this[0]]._aData=a;la(b[0],this[0],"data");return this});r("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});r("row.add()",function(a){a instanceof g&&a.length&&(a=a[0]);var b=
+this.iterator("table",function(b){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?ha(b,a)[0]:H(b,a)});return this.row(b[0])});var Qb=function(a){var b=this.context;if(b.length&&this.length){var c=b[0].aoData[this[0]];if(c._details){(c._detailsShow=a)?c._details.insertAfter(c.nTr):c._details.remove();var d=b[0],e=new q(d);e.off("draw.dt.DT_details column-visibility.dt.DT_details");0<B(d.aoData,"_details").length&&(e.on("draw.dt.DT_details",function(){e.rows({page:"current"}).eq(0).each(function(a){a=
+d.aoData[a];a._detailsShow&&a._details.insertAfter(a.nTr)})}),e.on("column-visibility.dt.DT_details",function(a,b){for(var c,d=Y(b),e=0,g=b.aoData.length;e<g;e++)c=b.aoData[e],c._details&&c._details.children("td[colspan]").attr("colspan",d)}))}}return this};r("row().child()",function(a,b){var c=this.context;if(a===l)return c.length&&this.length?c[0].aoData[this[0]]._details:l;if(c.length&&this.length){var d=c[0],c=c[0].aoData[this[0]],e=[],f=function(a,b){if(a.nodeName&&"tr"===a.nodeName.toLowerCase())e.push(a);
+else{var c=g("<tr><td/></tr>");g("td",c).addClass(b).html(a)[0].colSpan=Y(d);e.push(c[0])}};if(g.isArray(a)||a instanceof g)for(var h=0,i=a.length;h<i;h++)f(a[h],b);else f(a,b);c._details&&c._details.remove();c._details=g(e);c._detailsShow&&c._details.insertAfter(c.nTr)}return this});r(["row().child.show()","row().child().show()"],function(){Qb.call(this,!0);return this});r(["row().child.hide()","row().child().hide()"],function(){Qb.call(this,!1);return this});r("row().child.isShown()",function(){var a=
+this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var Xb=/^(.*):(name|visIdx|visible)$/;r("columns()",function(a,b){a===l?a="":g.isPlainObject(a)&&(b=a,a="");var b=$a(b),c=this.iterator("table",function(b){var c=a,f=b.aoColumns,h=B(f,"sName"),i=B(f,"nTh");return Za(c,function(a){var c=Lb(a);if(a==="")return R(f.length);if(c!==null)return[c>=0?c:f.length+c];var e=typeof a==="string"?a.match(Xb):"";if(e)switch(e[2]){case "visIdx":case "visible":a=parseInt(e[1],10);
+if(a<0){c=g.map(f,function(a,b){return a.bVisible?b:null});return[c[c.length+a]]}return[ga(b,a)];case "name":return g.map(h,function(a,b){return a===e[1]?b:null})}else return g(i).filter(a).map(function(){return g.inArray(this,i)}).toArray()})});c.selector.cols=a;c.selector.opts=b;return c});x("columns().header()","column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh})});x("columns().footer()","column().footer()",function(){return this.iterator("column",
+function(a,b){return a.aoColumns[b].nTf})});x("columns().data()","column().data()",function(){return this.iterator("column-rows",function(a,b,c,d,e){for(var c=[],d=0,f=e.length;d<f;d++)c.push(A(a,e[d],b,""));return c})});x("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return xa(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)})});x("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,
+e){return xa(a.aoData,e,"anCells",b)})});x("columns().visible()","column().visible()",function(a){return this.iterator("column",function(b,c){var d;if(a===l)d=b.aoColumns[c].bVisible;else{var e=b.aoColumns;d=e[c];var f=b.aoData,h,i,j;if(a===l)d=d.bVisible;else{if(d.bVisible!==a){if(a){var n=g.inArray(!0,B(e,"bVisible"),c+1);h=0;for(i=f.length;h<i;h++)j=f[h].nTr,e=f[h].anCells,j&&j.insertBefore(e[c],e[n]||null)}else g(B(b.aoData,"anCells",c)).detach(),d.bVisible=!1,I(b,b.aoHeader),I(b,b.aoFooter),
+ta(b);d.bVisible=a;I(b,b.aoHeader);I(b,b.aoFooter);U(b);(b.oScroll.sX||b.oScroll.sY)&&V(b);t(b,null,"column-visibility",[b,c,a]);ta(b)}d=void 0}}return d})});x("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?X(b,c):c})});r("columns.adjust()",function(){return this.iterator("table",function(a){U(a)})});r("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return ga(c,
+b);if("fromData"===a||"toVisible"===a)return X(c,b)}});r("column()",function(a,b){return ab(this.columns(a,b))});r("cells()",function(a,b,c){g.isPlainObject(a)&&(a.row?(c=b,b=null):(c=a,a=null));g.isPlainObject(b)&&(c=b,b=null);if(null===b||b===l)return this.iterator("table",function(b){var d=a,e=$a(c),f=b.aoData,h=Ya(b,e),e=xa(f,h,"anCells"),i=g([].concat.apply([],e)),j,m=b.aoColumns.length,n,l,p,r;return Za(d,function(a){if(a){if(g.isPlainObject(a))return[a]}else{n=[];l=0;for(p=h.length;l<p;l++){j=
+h[l];for(r=0;r<m;r++)n.push({row:j,column:r})}return n}return i.filter(a).map(function(a,b){j=b.parentNode._DT_RowIndex;return{row:j,column:g.inArray(b,f[j].anCells)}}).toArray()})});var d=this.columns(b,c),e=this.rows(a,c),f,h,i,j,n,m=this.iterator("table",function(a,b){f=[];h=0;for(i=e[b].length;h<i;h++){j=0;for(n=d[b].length;j<n;j++)f.push({row:e[b][h],column:d[b][j]})}return f});g.extend(m.selector,{cols:b,rows:a,opts:c});return m});x("cells().nodes()","cell().node()",function(){return this.iterator("cell",
+function(a,b,c){return a.aoData[b].anCells[c]})});r("cells().data()",function(){return this.iterator("cell",function(a,b,c){return A(a,b,c)})});x("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]})});x("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,column:c,columnVisible:X(a,c)}})});r(["cells().invalidate()","cell().invalidate()"],function(a){var b=
+this.selector;this.rows(b.rows,b.opts).invalidate(a);return this});r("cell()",function(a,b,c){return ab(this.cells(a,b,c))});r("cell().data()",function(a){var b=this.context,c=this[0];if(a===l)return b.length&&c.length?A(b[0],c[0].row,c[0].column):l;Ea(b[0],c[0].row,c[0].column,a);la(b[0],c[0].row,"data",c[0].column);return this});r("order()",function(a,b){var c=this.context;if(a===l)return 0!==c.length?c[0].aaSorting:l;"number"===typeof a?a=[[a,b]]:g.isArray(a[0])||(a=Array.prototype.slice.call(arguments));
+return this.iterator("table",function(b){b.aaSorting=a.slice()})});r("order.listener()",function(a,b,c){return this.iterator("table",function(d){Ka(d,a,b,c)})});r(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];g.each(b[d],function(b,c){e.push([c,a])});c.aaSorting=e})});r("search()",function(a,b,c,d){var e=this.context;return a===l?0!==e.length?e[0].oPreviousSearch.sSearch:l:this.iterator("table",function(e){e.oFeatures.bFilter&&
+aa(e,g.extend({},e.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});r(["columns().search()","column().search()"],function(a,b,c,d){return this.iterator("column",function(e,f){var h=e.aoPreSearchCols;if(a===l)return h[f].sSearch;e.oFeatures.bFilter&&(g.extend(h[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),aa(e,e.oPreviousSearch,1))})});p.versionCheck=p.fnVersionCheck=function(a){for(var b=
+p.version.split("."),a=a.split("."),c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};p.isDataTable=p.fnIsDataTable=function(a){var b=g(a).get(0),c=!1;g.each(p.settings,function(a,e){if(e.nTable===b||e.nScrollHead===b||e.nScrollFoot===b)c=!0});return c};p.tables=p.fnTables=function(a){return jQuery.map(p.settings,function(b){if(!a||a&&g(b.nTable).is(":visible"))return b.nTable})};p.camelToHungarian=G;r("$()",function(a,b){var c=this.rows(b).nodes(),
+c=g(c);return g([].concat(c.filter(a).toArray(),c.find(a).toArray()))});g.each(["on","one","off"],function(a,b){r(b+"()",function(){var a=Array.prototype.slice.call(arguments);-1===a[0].indexOf(".dt")&&(a[0]+=".dt");var d=g(this.tables().nodes());d[b].apply(d,a);return this})});r("clear()",function(){return this.iterator("table",function(a){ja(a)})});r("settings()",function(){return new q(this.context,this.context)});r("data()",function(){return this.iterator("table",function(a){return B(a.aoData,
+"_aData")}).flatten()});r("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,h=b.nTHead,i=b.nTFoot,j=g(e),f=g(f),n=g(b.nTableWrapper),m=g.map(b.aoData,function(a){return a.nTr}),l;b.bDestroying=!0;t(b,"aoDestroyCallback","destroy",[b]);a||(new q(b)).columns().visible(!0);n.unbind(".DT").find(":not(tbody *)").unbind(".DT");g(za).unbind(".DT-"+b.sInstance);e!=h.parentNode&&(j.children("thead").detach(),j.append(h));
+i&&e!=i.parentNode&&(j.children("tfoot").detach(),j.append(i));j.detach();n.detach();b.aaSorting=[];b.aaSortingFixed=[];sa(b);g(m).removeClass(b.asStripeClasses.join(" "));g("th, td",h).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(g("th span."+d.sSortIcon+", td span."+d.sSortIcon,h).detach(),g("th, td",h).each(function(){var a=g("div."+d.sSortJUIWrapper,this);g(this).append(a.contents());a.detach()}));!a&&c&&c.insertBefore(e,b.nTableReinsertBefore);
+f.children().detach();f.append(m);j.css("width",b.sDestroyWidth).removeClass(d.sTable);(l=b.asDestroyStripes.length)&&f.children().each(function(a){g(this).addClass(b.asDestroyStripes[a%l])});c=g.inArray(b,p.settings);-1!==c&&p.settings.splice(c,1)})});p.version="1.10.0";p.settings=[];p.models={};p.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};p.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null};p.models.oColumn=
+{idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};p.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,
+aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,
+fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,
+iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",
+sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:g.extend({},p.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null};S(p.defaults);p.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,
+mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};S(p.defaults.column);p.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,
+bScrollbarLeft:!1},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,
+nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:l,oAjaxData:l,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,
+oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==z(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==z(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,
+nScrollFoot:null,aLastSort:[],oPlugins:{}};p.ext=u={classes:{},errMode:"alert",feature:[],search:[],internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:p.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:p.version};g.extend(u,{afnFiltering:u.search,aTypes:u.type.detect,ofnSearch:u.type.search,oSort:u.type.order,afnSortData:u.order,aoFeatures:u.feature,oApi:u.internal,oStdClasses:u.classes,oPagination:u.pager});
+g.extend(p.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",
+sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",
+sJUIHeader:"",sJUIFooter:""});var ya="",ya="",E=ya+"ui-state-default",ea=ya+"css_right ui-icon ui-icon-",Rb=ya+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";g.extend(p.ext.oJUIClasses,p.ext.classes,{sPageButton:"fg-button ui-button "+E,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:E+" sorting_asc",sSortDesc:E+" sorting_desc",sSortable:E+" sorting",
+sSortableAsc:E+" sorting_asc_disabled",sSortableDesc:E+" sorting_desc_disabled",sSortableNone:E+" sorting_disabled",sSortJUIAsc:ea+"triangle-1-n",sSortJUIDesc:ea+"triangle-1-s",sSortJUI:ea+"carat-2-n-s",sSortJUIAscAllowed:ea+"carat-1-n",sSortJUIDescAllowed:ea+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+E,sScrollFoot:"dataTables_scrollFoot "+E,sHeaderTH:E,sFooterTH:E,sJUIHeader:Rb+" ui-corner-tl ui-corner-tr",sJUIFooter:Rb+
+" ui-corner-bl ui-corner-br"});var Ib=p.ext.pager;g.extend(Ib,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},simple_numbers:function(a,b){return["previous",Ua(a,b),"next"]},full_numbers:function(a,b){return["first","previous",Ua(a,b),"next","last"]},_numbers:Ua,numbers_length:7});g.extend(!0,p.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var h=a.oClasses,i=a.oLanguage.oPaginate,j,l,m=0,o=function(b,d){var k,p,r,q,s=function(b){Ra(a,b.data.action,
+true)};k=0;for(p=d.length;k<p;k++){q=d[k];if(g.isArray(q)){r=g("<"+(q.DT_el||"div")+"/>").appendTo(b);o(r,q)}else{l=j="";switch(q){case "ellipsis":b.append("<span>…</span>");break;case "first":j=i.sFirst;l=q+(e>0?"":" "+h.sPageButtonDisabled);break;case "previous":j=i.sPrevious;l=q+(e>0?"":" "+h.sPageButtonDisabled);break;case "next":j=i.sNext;l=q+(e<f-1?"":" "+h.sPageButtonDisabled);break;case "last":j=i.sLast;l=q+(e<f-1?"":" "+h.sPageButtonDisabled);break;default:j=q+1;l=e===q?h.sPageButtonActive:
+""}if(j){r=g("<a>",{"class":h.sPageButton+" "+l,"aria-controls":a.sTableId,"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof q==="string"?a.sTableId+"_"+q:null}).html(j).appendTo(b);Ta(r,{action:q},s);m++}}}},k=g(N.activeElement).data("dt-idx");o(g(b).empty(),d);k!==null&&g(b).find("[data-dt-idx="+k+"]").focus()}}});var va=function(a,b,c,d){if(!a||"-"===a)return-Infinity;b&&(a=Mb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};g.extend(u.type.order,{"date-pre":function(a){return Date.parse(a)||
+0},"html-pre":function(a){return!a?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return"string"===typeof a?a.toLowerCase():!a||!a.toString?"":a.toString()},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<b?1:a>b?-1:0}});bb("");g.extend(p.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Xa(a,c)?"num"+c:null},function(a){if(a&&!Vb.test(a))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||da(a)?"date":
+null},function(a,b){var c=b.oLanguage.sDecimal;return Xa(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Nb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Nb(a,c,!0)?"html-num-fmt"+c:null},function(a){return da(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);g.extend(p.ext.type.search,{html:function(a){return da(a)?"":"string"===typeof a?a.replace(Kb," ").replace(wa,""):""},string:function(a){return da(a)?"":"string"===typeof a?a.replace(Kb,
+" "):a}});g.extend(!0,p.ext.renderer,{header:{_:function(a,b,c,d){g(a.nTable).on("order.dt.DT",function(a,f,g,i){a=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(i[a]=="asc"?d.sSortAsc:i[a]=="desc"?d.sSortDesc:c.sSortingClass)})},jqueryui:function(a,b,c,d){var e=c.idx;g("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(g("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);g(a.nTable).on("order.dt.DT",function(a,g,i,j){b.removeClass(d.sSortAsc+
+" "+d.sSortDesc).addClass(j[e]=="asc"?d.sSortAsc:j[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(j[e]=="asc"?d.sSortJUIAsc:j[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)})}}});p.render={number:function(a,b,c,d){return{display:function(e){var e=parseFloat(e),f=parseInt(e,10),e=c?(b+(e-f).toFixed(c)).substring(2):"";return(d||"")+f.toString().replace(/\B(?=(\d{3})+(?!\d))/g,
+a)+e}}}};g.extend(p.ext.internal,{_fnExternApiFunc:Jb,_fnBuildAjax:na,_fnAjaxUpdate:ib,_fnAjaxParameters:rb,_fnAjaxUpdateDraw:sb,_fnAjaxDataSrc:oa,_fnAddColumn:Aa,_fnColumnOptions:fa,_fnAdjustColumnSizing:U,_fnVisibleToColumnIndex:ga,_fnColumnIndexToVisible:X,_fnVisbleColumns:Y,_fnGetColumns:W,_fnColumnTypes:Da,_fnApplyColumnDefs:gb,_fnHungarianMap:S,_fnCamelToHungarian:G,_fnLanguageCompat:M,_fnBrowserDetect:eb,_fnAddData:H,_fnAddTr:ha,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==l?b._DT_RowIndex:
+null},_fnNodeToColumnIndex:function(a,b,c){return g.inArray(c,a.aoData[b].anCells)},_fnGetCellData:A,_fnSetCellData:Ea,_fnSplitObjNotation:Ga,_fnGetObjectDataFn:T,_fnSetObjectDataFn:Ba,_fnGetDataMaster:Ha,_fnClearTable:ja,_fnDeleteIndex:ka,_fnInvalidateRow:la,_fnGetRowElements:ia,_fnCreateTr:Fa,_fnBuildHead:hb,_fnDrawHead:I,_fnDraw:J,_fnReDraw:K,_fnAddOptionsHtml:kb,_fnDetectHeader:$,_fnGetUniqueThs:ma,_fnFeatureHtmlFilter:mb,_fnFilterComplete:aa,_fnFilterCustom:vb,_fnFilterColumn:ub,_fnFilter:tb,
+_fnFilterCreateSearch:Na,_fnEscapeRegex:Oa,_fnFilterData:wb,_fnFeatureHtmlInfo:pb,_fnUpdateInfo:xb,_fnInfoMacros:yb,_fnInitialise:ra,_fnInitComplete:pa,_fnLengthChange:Pa,_fnFeatureHtmlLength:lb,_fnFeatureHtmlPaginate:qb,_fnPageChange:Ra,_fnFeatureHtmlProcessing:nb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:ob,_fnScrollDraw:V,_fnApplyToChildren:F,_fnCalculateColumnWidths:Ca,_fnThrottle:Ma,_fnConvertToWidth:zb,_fnScrollingWidthAdjust:Bb,_fnGetWidestNode:Ab,_fnGetMaxLenString:Cb,_fnStringToCss:s,_fnScrollBarWidth:Db,
+_fnSortFlatten:Q,_fnSort:jb,_fnSortAria:Fb,_fnSortListener:Sa,_fnSortAttachListener:Ka,_fnSortingClasses:sa,_fnSortData:Eb,_fnSaveState:ta,_fnLoadState:Gb,_fnSettingsFromNode:ua,_fnLog:O,_fnMap:D,_fnBindAction:Ta,_fnCallbackReg:y,_fnCallbackFire:t,_fnLengthOverflow:Qa,_fnRenderer:La,_fnDataSource:z,_fnRowAttributes:Ia,_fnCalculateEnd:function(){}});g.fn.dataTable=p;g.fn.dataTableSettings=p.settings;g.fn.dataTableExt=p.ext;g.fn.DataTable=function(a){return g(this).dataTable(a).api()};g.each(p,function(a,
+b){g.fn.DataTable[a]=b});return g.fn.dataTable};"function"===typeof define&&define.amd?define("datatables",["jquery"],M):"object"===typeof exports?M(require("jquery")):jQuery&&!jQuery.fn.dataTable&&M(jQuery)})(window,document);
diff --git a/contrail-webui/controller/jquery.json.min-2.4.js b/contrail-webui/controller/jquery.json.min-2.4.js
new file mode 100644
index 0000000..87050c9
--- /dev/null
+++ b/contrail-webui/controller/jquery.json.min-2.4.js
@@ -0,0 +1,23 @@
+/*! jQuery JSON plugin 2.4.0 | code.google.com/p/jquery-json */
+(function($){'use strict';var escape=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},hasOwn=Object.prototype.hasOwnProperty;$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
+var pairs,k,name,val,type=$.type(o);if(type==='undefined'){return undefined;}
+if(type==='number'||type==='boolean'){return String(o);}
+if(type==='string'){return $.quoteString(o);}
+if(typeof o.toJSON==='function'){return $.toJSON(o.toJSON());}
+if(type==='date'){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;}
+if(day<10){day='0'+day;}
+if(hours<10){hours='0'+hours;}
+if(minutes<10){minutes='0'+minutes;}
+if(seconds<10){seconds='0'+seconds;}
+if(milli<100){milli='0'+milli;}
+if(milli<10){milli='0'+milli;}
+return'"'+year+'-'+month+'-'+day+'T'+
+hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
+pairs=[];if($.isArray(o)){for(k=0;k<o.length;k++){pairs.push($.toJSON(o[k])||'null');}
+return'['+pairs.join(',')+']';}
+if(typeof o==='object'){for(k in o){if(hasOwn.call(o,k)){type=typeof k;if(type==='number'){name='"'+k+'"';}else if(type==='string'){name=$.quoteString(k);}else{continue;}
+type=typeof o[k];if(type!=='function'&&type!=='undefined'){val=$.toJSON(o[k]);pairs.push(name+':'+val);}}}
+return'{'+pairs.join(',')+'}';}};$.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(str){return eval('('+str+')');};$.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(str){var filtered=str.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval('('+str+')');}
+throw new SyntaxError('Error parsing JSON, source is not valid.');};$.quoteString=function(str){if(str.match(escape)){return'"'+str.replace(escape,function(a){var c=meta[a];if(typeof c==='string'){return c;}
+c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
+return'"'+str+'"';};}(jQuery));
\ No newline at end of file
diff --git a/contrail-webui/controller/jquery.min-1.8.3.js b/contrail-webui/controller/jquery.min-1.8.3.js
new file mode 100644
index 0000000..3883779
--- /dev/null
+++ b/contrail-webui/controller/jquery.min-1.8.3.js
@@ -0,0 +1,2 @@
+/*! jQuery v1.8.3 jquery.com | jquery.org/license */
+(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.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(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);
\ No newline at end of file
diff --git a/contrail-webui/controller/jquery.min-1.9.1.js b/contrail-webui/controller/jquery.min-1.9.1.js
new file mode 100644
index 0000000..006e953
--- /dev/null
+++ b/contrail-webui/controller/jquery.min-1.9.1.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery.min.map
+*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},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(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
+return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
+}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.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(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,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"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
\ No newline at end of file
diff --git a/contrail-webui/controller/jquery.panzoom-2.0.5.tar.gz b/contrail-webui/controller/jquery.panzoom-2.0.5.tar.gz
new file mode 100644
index 0000000..0548e7b
--- /dev/null
+++ b/contrail-webui/controller/jquery.panzoom-2.0.5.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery.panzoom-3.2.1.tar.gz b/contrail-webui/controller/jquery.panzoom-3.2.1.tar.gz
new file mode 100644
index 0000000..0fe4fa8
--- /dev/null
+++ b/contrail-webui/controller/jquery.panzoom-3.2.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jquery.timer.js b/contrail-webui/controller/jquery.timer.js
new file mode 100644
index 0000000..55aedf4
--- /dev/null
+++ b/contrail-webui/controller/jquery.timer.js
@@ -0,0 +1,111 @@
+/**
+ * jquery.timer.js
+ *
+ * Copyright (c) 2011 Jason Chavannes <jason.chavannes@gmail.com>
+ *
+ * http://jchavannes.com/jquery-timer
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+;(function($) {
+ $.timer = function(func, time, autostart) {
+ this.set = function(func, time, autostart) {
+ this.init = true;
+ if(typeof func == 'object') {
+ var paramList = ['autostart', 'time'];
+ for(var arg in paramList) {if(func[paramList[arg]] != undefined) {eval(paramList[arg] + " = func[paramList[arg]]");}};
+ func = func.action;
+ }
+ if(typeof func == 'function') {this.action = func;}
+ if(!isNaN(time)) {this.intervalTime = time;}
+ if(autostart && !this.active) {
+ this.active = true;
+ this.setTimer();
+ }
+ return this;
+ };
+ this.once = function(time) {
+ var timer = this;
+ if(isNaN(time)) {time = 0;}
+ window.setTimeout(function() {timer.action();}, time);
+ return this;
+ };
+ this.play = function(reset) {
+ if(!this.active) {
+ if(reset) {this.setTimer();}
+ else {this.setTimer(this.remaining);}
+ this.active = true;
+ }
+ return this;
+ };
+ this.pause = function() {
+ if(this.active) {
+ this.active = false;
+ this.remaining -= new Date() - this.last;
+ this.clearTimer();
+ }
+ return this;
+ };
+ this.stop = function() {
+ this.active = false;
+ this.remaining = this.intervalTime;
+ this.clearTimer();
+ return this;
+ };
+ this.toggle = function(reset) {
+ if(this.active) {this.pause();}
+ else if(reset) {this.play(true);}
+ else {this.play();}
+ return this;
+ };
+ this.reset = function() {
+ this.active = false;
+ this.play(true);
+ return this;
+ };
+ this.clearTimer = function() {
+ window.clearTimeout(this.timeoutObject);
+ };
+ this.setTimer = function(time) {
+ var timer = this;
+ if(typeof this.action != 'function') {return;}
+ if(isNaN(time)) {time = this.intervalTime;}
+ this.remaining = time;
+ this.last = new Date();
+ this.clearTimer();
+ this.timeoutObject = window.setTimeout(function() {timer.go();}, time);
+ };
+ this.go = function() {
+ if(this.active) {
+ this.action();
+ this.setTimer();
+ }
+ };
+
+ if(this.init) {
+ return new $.timer(func, time, autostart);
+ } else {
+ this.set(func, time, autostart);
+ return this;
+ }
+ };
+})(jQuery);
\ No newline at end of file
diff --git a/contrail-webui/controller/jquery.ui.touch-punch.min-0.2.2.js b/contrail-webui/controller/jquery.ui.touch-punch.min-0.2.2.js
new file mode 100644
index 0000000..33d6f97
--- /dev/null
+++ b/contrail-webui/controller/jquery.ui.touch-punch.min-0.2.2.js
@@ -0,0 +1,11 @@
+/*
+ * jQuery UI Touch Punch 0.2.2
+ *
+ * Copyright 2011, Dave Furfero
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ */
+(function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return;}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return;}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f);}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return;}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown");};c._touchMove=function(f){if(!a){return;}this._touchMoved=true;d(f,"mousemove");};c._touchEnd=function(f){if(!a){return;}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click");}a=false;};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f);};})(jQuery);
\ No newline at end of file
diff --git a/contrail-webui/controller/jquery.xml2json-v1.3.js b/contrail-webui/controller/jquery.xml2json-v1.3.js
new file mode 100644
index 0000000..b8053ba
--- /dev/null
+++ b/contrail-webui/controller/jquery.xml2json-v1.3.js
@@ -0,0 +1,193 @@
+/*
+ ### jQuery XML to JSON Plugin v1.3 - 2013-02-18 ###
+ * http://www.fyneworks.com/ - diego@fyneworks.com
+ * Licensed under http://en.wikipedia.org/wiki/MIT_License
+ ###
+ Website: http://www.fyneworks.com/jquery/xml-to-json/
+*//*
+ # INSPIRED BY: http://www.terracoder.com/
+ AND: http://www.thomasfrank.se/xml_to_json.html
+ AND: http://www.kawa.net/works/js/xml/objtree-e.html
+*//*
+ This simple script converts XML (document of code) into a JSON object. It is the combination of 2
+ 'xml to json' great parsers (see below) which allows for both 'simple' and 'extended' parsing modes.
+*/
+// Avoid collisions
+;if(window.jQuery) (function($){
+
+ // Add function to jQuery namespace
+ $.extend({
+
+ // converts xml documents and xml text to json object
+ xml2json: function(xml, extended) {
+ if(!xml) return {}; // quick fail
+
+ //### PARSER LIBRARY
+ // Core function
+ function parseXML(node, simple){
+ if(!node) return null;
+ var txt = '', obj = null, att = null;
+ var nt = node.nodeType, nn = jsVar(node.localName || node.nodeName);
+ var nv = node.text || node.nodeValue || '';
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,nt,nv.length+' bytes']);
+ if(node.childNodes){
+ if(node.childNodes.length>0){
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'CHILDREN',node.childNodes]);
+ $.each(node.childNodes, function(n,cn){
+ var cnt = cn.nodeType, cnn = jsVar(cn.localName || cn.nodeName);
+ var cnv = cn.text || cn.nodeValue || '';
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>a',cnn,cnt,cnv]);
+ if(cnt == 8){
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>b',cnn,'COMMENT (ignore)']);
+ return; // ignore comment node
+ }
+ else if(cnt == 3 || cnt == 4 || !cnn){
+ // ignore white-space in between tags
+ if(cnv.match(/^\s+$/)){
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>c',cnn,'WHITE-SPACE (ignore)']);
+ return;
+ };
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>d',cnn,'TEXT']);
+ txt += cnv.replace(/^\s+/,'').replace(/\s+$/,'');
+ // make sure we ditch trailing spaces from markup
+ }
+ else{
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>e',cnn,'OBJECT']);
+ obj = obj || {};
+ if(obj[cnn]){
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>f',cnn,'ARRAY']);
+
+ // http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
+ if(!obj[cnn].length) obj[cnn] = myArr(obj[cnn]);
+ obj[cnn] = myArr(obj[cnn]);
+
+ obj[cnn][ obj[cnn].length ] = parseXML(cn, true/* simple */);
+ obj[cnn].length = obj[cnn].length;
+ }
+ else{
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'node>g',cnn,'dig deeper...']);
+ obj[cnn] = parseXML(cn);
+ };
+ };
+ });
+ };//node.childNodes.length>0
+ };//node.childNodes
+ if(node.attributes){
+ if(node.attributes.length>0){
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'ATTRIBUTES',node.attributes])
+ att = {}; obj = obj || {};
+ $.each(node.attributes, function(a,at){
+ var atn = jsVar(at.name), atv = at.value;
+ att[atn] = atv;
+ if(obj[atn]){
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'attr>',atn,'ARRAY']);
+
+ // http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
+ //if(!obj[atn].length) obj[atn] = myArr(obj[atn]);//[ obj[ atn ] ];
+ obj[cnn] = myArr(obj[cnn]);
+
+ obj[atn][ obj[atn].length ] = atv;
+ obj[atn].length = obj[atn].length;
+ }
+ else{
+ /*DBG*/ //if(window.console) console.log(['x2j',nn,'attr>',atn,'TEXT']);
+ obj[atn] = atv;
+ };
+ });
+ //obj['attributes'] = att;
+ };//node.attributes.length>0
+ };//node.attributes
+ if(obj){
+ obj = $.extend( (txt!='' ? new String(txt) : {}),/* {text:txt},*/ obj || {}/*, att || {}*/);
+ //txt = (obj.text) ? (typeof(obj.text)=='object' ? obj.text : [obj.text || '']).concat([txt]) : txt;
+ txt = (obj.text) ? ([obj.text || '']).concat([txt]) : txt;
+ if(txt) obj.text = txt;
+ txt = '';
+ };
+ var out = obj || txt;
+ //console.log([extended, simple, out]);
+ if(extended){
+ if(txt) out = {};//new String(out);
+ txt = out.text || txt || '';
+ if(txt) out.text = txt;
+ if(!simple) out = myArr(out);
+ };
+ return out;
+ };// parseXML
+ // Core Function End
+ // Utility functions
+ var jsVar = function(s){ return String(s || '').replace(/-/g,"_"); };
+
+ // NEW isNum function: 01/09/2010
+ // Thanks to Emile Grau, GigaTecnologies S.L., www.gigatransfer.com, www.mygigamail.com
+ function isNum(s){
+ // based on utility function isNum from xml2json plugin (http://www.fyneworks.com/ - diego@fyneworks.com)
+ // few bugs corrected from original function :
+ // - syntax error : regexp.test(string) instead of string.test(reg)
+ // - regexp modified to accept comma as decimal mark (latin syntax : 25,24 )
+ // - regexp modified to reject if no number before decimal mark : ".7" is not accepted
+ // - string is "trimmed", allowing to accept space at the beginning and end of string
+ var regexp=/^((-)?([0-9]+)(([\.\,]{0,1})([0-9]+))?$)/
+ return (typeof s == "number") || regexp.test(String((s && typeof s == "string") ? jQuery.trim(s) : ''));
+ };
+ // OLD isNum function: (for reference only)
+ //var isNum = function(s){ return (typeof s == "number") || String((s && typeof s == "string") ? s : '').test(/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/); };
+
+ var myArr = function(o){
+
+ // http://forum.jquery.com/topic/jquery-jquery-xml2json-problems-when-siblings-of-the-same-tagname-only-have-a-textnode-as-a-child
+ //if(!o.length) o = [ o ]; o.length=o.length;
+ if(!$.isArray(o)) o = [ o ]; o.length=o.length;
+
+ // here is where you can attach additional functionality, such as searching and sorting...
+ return o;
+ };
+ // Utility functions End
+ //### PARSER LIBRARY END
+
+ // Convert plain text to xml
+ if(typeof xml=='string') xml = $.text2xml(xml);
+
+ // Quick fail if not xml (or if this is a node)
+ if(!xml.nodeType) return;
+ if(xml.nodeType == 3 || xml.nodeType == 4) return xml.nodeValue;
+
+ // Find xml root node
+ var root = (xml.nodeType == 9) ? xml.documentElement : xml;
+
+ // Convert xml to json
+ var out = parseXML(root, true /* simple */);
+
+ // Clean-up memory
+ xml = null; root = null;
+
+ // Send output
+ return out;
+ },
+
+ // Convert text to XML DOM
+ text2xml: function(str) {
+ // NOTE: I'd like to use jQuery for this, but jQuery makes all tags uppercase
+ //return $(xml)[0];
+
+ /* prior to jquery 1.9 */
+ /*
+ var out;
+ try{
+ var xml = ((!$.support.opacity && !$.support.style))?new ActiveXObject("Microsoft.XMLDOM"):new DOMParser();
+ xml.async = false;
+ }catch(e){ throw new Error("XML Parser could not be instantiated") };
+ try{
+ if((!$.support.opacity && !$.support.style)) out = (xml.loadXML(str))?xml:false;
+ else out = xml.parseFromString(str, "text/xml");
+ }catch(e){ throw new Error("Error parsing XML string") };
+ return out;
+ */
+
+ /* jquery 1.9+ */
+ return $.parseXML(str);
+ }
+
+ }); // extend $
+
+})(jQuery);
diff --git a/contrail-webui/controller/jqueryui-1.10.4.tar.gz b/contrail-webui/controller/jqueryui-1.10.4.tar.gz
new file mode 100644
index 0000000..39a71db
--- /dev/null
+++ b/contrail-webui/controller/jqueryui-1.10.4.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/jsonpath-0.8.0.js.txt b/contrail-webui/controller/jsonpath-0.8.0.js.txt
new file mode 100644
index 0000000..dcc4038
--- /dev/null
+++ b/contrail-webui/controller/jsonpath-0.8.0.js.txt
@@ -0,0 +1,87 @@
+/* JSONPath 0.8.0 - XPath for JSON
+ *
+ * Copyright (c) 2007 Stefan Goessner (goessner.net)
+ * Licensed under the MIT (MIT-LICENSE.txt) licence.
+ */
+function jsonPath(obj, expr, arg) {
+ var P = {
+ resultType: arg && arg.resultType || "VALUE",
+ result: [],
+ normalize: function(expr) {
+ var subx = [];
+ return expr.replace(/[\['](\??\(.*?\))[\]']/g, function($0,$1){return "[#"+(subx.push($1)-1)+"]";})
+ .replace(/'?\.'?|\['?/g, ";")
+ .replace(/;;;|;;/g, ";..;")
+ .replace(/;$|'?\]|'$/g, "")
+ .replace(/#([0-9]+)/g, function($0,$1){return subx[$1];});
+ },
+ asPath: function(path) {
+ var x = path.split(";"), p = "$";
+ for (var i=1,n=x.length; i<n; i++)
+ p += /^[0-9*]+$/.test(x[i]) ? ("["+x[i]+"]") : ("['"+x[i]+"']");
+ return p;
+ },
+ store: function(p, v) {
+ if (p) P.result[P.result.length] = P.resultType == "PATH" ? P.asPath(p) : v;
+ return !!p;
+ },
+ trace: function(expr, val, path) {
+ if (expr) {
+ var x = expr.split(";"), loc = x.shift();
+ x = x.join(";");
+ if (val && val.hasOwnProperty(loc))
+ P.trace(x, val[loc], path + ";" + loc);
+ else if (loc === "*")
+ P.walk(loc, x, val, path, function(m,l,x,v,p) { P.trace(m+";"+x,v,p); });
+ else if (loc === "..") {
+ P.trace(x, val, path);
+ P.walk(loc, x, val, path, function(m,l,x,v,p) { typeof v[m] === "object" && P.trace("..;"+x,v[m],p+";"+m); });
+ }
+ else if (/,/.test(loc)) { // [name1,name2,...]
+ for (var s=loc.split(/'?,'?/),i=0,n=s.length; i<n; i++)
+ P.trace(s[i]+";"+x, val, path);
+ }
+ else if (/^\(.*?\)$/.test(loc)) // [(expr)]
+ P.trace(P.eval(loc, val, path.substr(path.lastIndexOf(";")+1))+";"+x, val, path);
+ else if (/^\?\(.*?\)$/.test(loc)) // [?(expr)]
+ P.walk(loc, x, val, path, function(m,l,x,v,p) { if (P.eval(l.replace(/^\?\((.*?)\)$/,"$1"),v[m],m)) P.trace(m+";"+x,v,p); });
+ else if (/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc)) // [start:end:step] phyton slice syntax
+ P.slice(loc, x, val, path);
+ }
+ else
+ P.store(path, val);
+ },
+ walk: function(loc, expr, val, path, f) {
+ if (val instanceof Array) {
+ for (var i=0,n=val.length; i<n; i++)
+ if (i in val)
+ f(i,loc,expr,val,path);
+ }
+ else if (typeof val === "object") {
+ for (var m in val)
+ if (val.hasOwnProperty(m))
+ f(m,loc,expr,val,path);
+ }
+ },
+ slice: function(loc, expr, val, path) {
+ if (val instanceof Array) {
+ var len=val.length, start=0, end=len, step=1;
+ loc.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g, function($0,$1,$2,$3){start=parseInt($1||start);end=parseInt($2||end);step=parseInt($3||step);});
+ start = (start < 0) ? Math.max(0,start+len) : Math.min(len,start);
+ end = (end < 0) ? Math.max(0,end+len) : Math.min(len,end);
+ for (var i=start; i<end; i+=step)
+ P.trace(i+";"+expr, val, path);
+ }
+ },
+ eval: function(x, _v, _vname) {
+ try { return $ && _v && eval(x.replace(/@/g, "_v")); }
+ catch(e) { throw new SyntaxError("jsonPath: " + e.message + ": " + x.replace(/@/g, "_v").replace(/\^/g, "_a")); }
+ }
+ };
+
+ var $ = obj;
+ if (expr && obj && (P.resultType == "VALUE" || P.resultType == "PATH")) {
+ P.trace(P.normalize(expr).replace(/^\$;/,""), obj, "$");
+ return P.result.length ? P.result : false;
+ }
+}
diff --git a/contrail-webui/controller/k3k702ZOKiLJc3WVjuplzKRDOzjiPcYnFooOUGCOsRk.woff b/contrail-webui/controller/k3k702ZOKiLJc3WVjuplzKRDOzjiPcYnFooOUGCOsRk.woff
new file mode 100644
index 0000000..dacf3c9
--- /dev/null
+++ b/contrail-webui/controller/k3k702ZOKiLJc3WVjuplzKRDOzjiPcYnFooOUGCOsRk.woff
Binary files differ
diff --git a/contrail-webui/controller/karma-0.10.2.tgz b/contrail-webui/controller/karma-0.10.2.tgz
new file mode 100644
index 0000000..536c73a
--- /dev/null
+++ b/contrail-webui/controller/karma-0.10.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-chrome-launcher-0.1.2.tgz b/contrail-webui/controller/karma-chrome-launcher-0.1.2.tgz
new file mode 100644
index 0000000..563554d
--- /dev/null
+++ b/contrail-webui/controller/karma-chrome-launcher-0.1.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-coverage-0.1.5.tgz b/contrail-webui/controller/karma-coverage-0.1.5.tgz
new file mode 100644
index 0000000..c2cbf1f
--- /dev/null
+++ b/contrail-webui/controller/karma-coverage-0.1.5.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-firefox-launcher-0.1.3.tgz b/contrail-webui/controller/karma-firefox-launcher-0.1.3.tgz
new file mode 100644
index 0000000..a7d1374
--- /dev/null
+++ b/contrail-webui/controller/karma-firefox-launcher-0.1.3.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-html2js-preprocessor-0.1.0.tgz b/contrail-webui/controller/karma-html2js-preprocessor-0.1.0.tgz
new file mode 100644
index 0000000..96ac506
--- /dev/null
+++ b/contrail-webui/controller/karma-html2js-preprocessor-0.1.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-htmlfile-reporter-0.1.0.tgz b/contrail-webui/controller/karma-htmlfile-reporter-0.1.0.tgz
new file mode 100644
index 0000000..1aae63e
--- /dev/null
+++ b/contrail-webui/controller/karma-htmlfile-reporter-0.1.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-junit-reporter-0.2.1.tgz b/contrail-webui/controller/karma-junit-reporter-0.2.1.tgz
new file mode 100644
index 0000000..6861210
--- /dev/null
+++ b/contrail-webui/controller/karma-junit-reporter-0.2.1.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-phantomjs-launcher-0.1.2.tgz b/contrail-webui/controller/karma-phantomjs-launcher-0.1.2.tgz
new file mode 100644
index 0000000..0c05aa9
--- /dev/null
+++ b/contrail-webui/controller/karma-phantomjs-launcher-0.1.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-qunit-0.1.1.tgz b/contrail-webui/controller/karma-qunit-0.1.1.tgz
new file mode 100644
index 0000000..3fc9c5f
--- /dev/null
+++ b/contrail-webui/controller/karma-qunit-0.1.1.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-requirejs-0.2.2.tar.gz b/contrail-webui/controller/karma-requirejs-0.2.2.tar.gz
new file mode 100644
index 0000000..fc83baa
--- /dev/null
+++ b/contrail-webui/controller/karma-requirejs-0.2.2.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/karma-safari-launcher-0.1.1.tgz b/contrail-webui/controller/karma-safari-launcher-0.1.1.tgz
new file mode 100644
index 0000000..fb685bf
--- /dev/null
+++ b/contrail-webui/controller/karma-safari-launcher-0.1.1.tgz
Binary files differ
diff --git a/contrail-webui/controller/karma-sinon-1.0.3.tgz b/contrail-webui/controller/karma-sinon-1.0.3.tgz
new file mode 100644
index 0000000..c95f960
--- /dev/null
+++ b/contrail-webui/controller/karma-sinon-1.0.3.tgz
Binary files differ
diff --git a/contrail-webui/controller/knockback-1.1.0.tar.gz b/contrail-webui/controller/knockback-1.1.0.tar.gz
new file mode 100644
index 0000000..ae13b64
--- /dev/null
+++ b/contrail-webui/controller/knockback-1.1.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/knockout-3.0.0.js b/contrail-webui/controller/knockout-3.0.0.js
new file mode 100644
index 0000000..1c6945a
--- /dev/null
+++ b/contrail-webui/controller/knockout-3.0.0.js
@@ -0,0 +1,94 @@
+// Knockout JavaScript library v3.0.0
+// (c) Steven Sanderson - http://knockoutjs.com/
+// License: MIT (http://www.opensource.org/licenses/mit-license.php)
+
+(function() {(function(q){var y=this||(0,eval)("this"),w=y.document,K=y.navigator,u=y.jQuery,B=y.JSON;(function(q){"function"===typeof require&&"object"===typeof exports&&"object"===typeof module?q(module.exports||exports):"function"===typeof define&&define.amd?define(["exports"],q):q(y.ko={})})(function(F){function G(a,c){return null===a||typeof a in N?a===c:!1}function H(b,c,d,e){a.d[b]={init:function(b){a.a.f.set(b,L,{});return{controlsDescendantBindings:!0}},update:function(b,h,k,m,f){k=a.a.f.get(b,L);h=a.a.c(h());
+m=!d!==!h;var p=!k.ob;if(p||c||m!==k.Db)p&&(k.ob=a.a.Ya(a.e.childNodes(b),!0)),m?(p||a.e.S(b,a.a.Ya(k.ob)),a.Ta(e?e(f,h):f,b)):a.e.Z(b),k.Db=m}};a.g.Y[b]=!1;a.e.P[b]=!0}var a="undefined"!==typeof F?F:{};a.b=function(b,c){for(var d=b.split("."),e=a,g=0;g<d.length-1;g++)e=e[d[g]];e[d[d.length-1]]=c};a.s=function(a,c,d){a[c]=d};a.version="3.0.0";a.b("version",a.version);a.a=function(){function b(a,b){for(var f in a)a.hasOwnProperty(f)&&b(f,a[f])}function c(k,b){if("input"!==a.a.v(k)||!k.type||"click"!=
+b.toLowerCase())return!1;var f=k.type;return"checkbox"==f||"radio"==f}var d={},e={};d[K&&/Firefox\/2/i.test(K.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];d.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(d,function(a,b){if(b.length)for(var f=0,c=b.length;f<c;f++)e[b[f]]=a});var g={propertychange:!0},h=w&&function(){for(var a=3,b=w.createElement("div"),f=b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+
+++a+"]><i></i><![endif]--\x3e",f[0];);return 4<a?a:q}();return{$a:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],n:function(a,b){for(var f=0,c=a.length;f<c;f++)b(a[f])},l:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var f=0,c=a.length;f<c;f++)if(a[f]===b)return f;return-1},Ua:function(a,b,f){for(var c=0,d=a.length;c<d;c++)if(b.call(f,a[c]))return a[c];return null},ia:function(b,c){var f=a.a.l(b,c);0<=f&&b.splice(f,1)},Va:function(b){b=
+b||[];for(var c=[],f=0,d=b.length;f<d;f++)0>a.a.l(c,b[f])&&c.push(b[f]);return c},ha:function(a,b){a=a||[];for(var f=[],c=0,d=a.length;c<d;c++)f.push(b(a[c]));return f},ga:function(a,b){a=a||[];for(var f=[],c=0,d=a.length;c<d;c++)b(a[c])&&f.push(a[c]);return f},X:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var f=0,c=b.length;f<c;f++)a.push(b[f]);return a},V:function(b,c,f){var d=a.a.l(a.a.Ha(b),c);0>d?f&&b.push(c):f||b.splice(d,1)},extend:function(a,b){if(b)for(var f in b)b.hasOwnProperty(f)&&
+(a[f]=b[f]);return a},K:b,Da:function(a,b){if(!a)return a;var f={},c;for(c in a)a.hasOwnProperty(c)&&(f[c]=b(a[c],c,a));return f},wa:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Vb:function(b){b=a.a.Q(b);for(var c=w.createElement("div"),f=0,d=b.length;f<d;f++)c.appendChild(a.L(b[f]));return c},Ya:function(b,c){for(var f=0,d=b.length,e=[];f<d;f++){var g=b[f].cloneNode(!0);e.push(c?a.L(g):g)}return e},S:function(b,c){a.a.wa(b);if(c)for(var f=0,d=c.length;f<d;f++)b.appendChild(c[f])},nb:function(b,
+c){var f=b.nodeType?[b]:b;if(0<f.length){for(var d=f[0],e=d.parentNode,g=0,n=c.length;g<n;g++)e.insertBefore(c[g],d);g=0;for(n=f.length;g<n;g++)a.removeNode(f[g])}},$:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);if(1<a.length){var f=a[0],c=a[a.length-1];for(a.length=0;f!==c;)if(a.push(f),f=f.nextSibling,!f)return;a.push(c)}}return a},qb:function(a,b){7>h?a.setAttribute("selected",b):a.selected=b},la:function(a){return null===a||a===
+q?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},ec:function(b,c){for(var f=[],d=(b||"").split(c),e=0,g=d.length;e<g;e++){var n=a.a.la(d[e]);""!==n&&f.push(n)}return f},ac:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},Gb:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(3===a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;
+return!!a},va:function(b){return a.a.Gb(b,b.ownerDocument.documentElement)},Ra:function(b){return!!a.a.Ua(b,a.a.va)},v:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},r:function(b,d,f){var e=h&&g[d];if(e||"undefined"==typeof u)if(e||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var s=function(a){f.call(b,a)},l="on"+d;b.attachEvent(l,s);a.a.C.ea(b,function(){b.detachEvent(l,s)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(d,
+f,!1);else{if(c(b,d)){var n=f;f=function(a,b){var f=this.checked;b&&(this.checked=!0!==b.Ab);n.call(this,a);this.checked=f}}u(b).bind(d,f)}},da:function(a,b){if(!a||!a.nodeType)throw Error("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof u){var f=[];c(a,b)&&f.push({Ab:a.checked});u(a).trigger(b,f)}else if("function"==typeof w.createEvent)if("function"==typeof a.dispatchEvent)f=w.createEvent(e[b]||"HTMLEvents"),f.initEvent(b,!0,!0,y,0,0,0,0,0,!1,!1,!1,!1,0,a),a.dispatchEvent(f);
+else throw Error("The supplied element doesn't support dispatchEvent");else if("undefined"!=typeof a.fireEvent)c(a,b)&&(a.checked=!0!==a.checked),a.fireEvent("on"+b);else throw Error("Browser doesn't support triggering events");},c:function(b){return a.M(b)?b():b},Ha:function(b){return a.M(b)?b.t():b},ma:function(b,c,f){if(c){var d=/\S+/g,e=b.className.match(d)||[];a.a.n(c.match(d),function(b){a.a.V(e,b,f)});b.className=e.join(" ")}},Ma:function(b,c){var f=a.a.c(c);if(null===f||f===q)f="";var d=a.e.firstChild(b);
+!d||3!=d.nodeType||a.e.nextSibling(d)?a.e.S(b,[w.createTextNode(f)]):d.data=f;a.a.Jb(b)},pb:function(a,b){a.name=b;if(7>=h)try{a.mergeAttributes(w.createElement("<input name='"+a.name+"'/>"),!1)}catch(f){}},Jb:function(a){9<=h&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},Hb:function(a){if(h){var b=a.style.width;a.style.width=0;a.style.width=b}},Zb:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var f=[],d=b;d<=c;d++)f.push(d);return f},Q:function(a){for(var b=[],c=0,d=a.length;c<
+d;c++)b.push(a[c]);return b},cc:6===h,dc:7===h,ja:h,ab:function(b,c){for(var f=a.a.Q(b.getElementsByTagName("input")).concat(a.a.Q(b.getElementsByTagName("textarea"))),d="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},e=[],g=f.length-1;0<=g;g--)d(f[g])&&e.push(f[g]);return e},Wb:function(b){return"string"==typeof b&&(b=a.a.la(b))?B&&B.parse?B.parse(b):(new Function("return "+b))():null},Na:function(b,c,f){if(!B||!B.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
+return B.stringify(a.a.c(b),c,f)},Xb:function(c,d,f){f=f||{};var e=f.params||{},g=f.includeFields||this.$a,h=c;if("object"==typeof c&&"form"===a.a.v(c))for(var h=c.action,n=g.length-1;0<=n;n--)for(var r=a.a.ab(c,g[n]),v=r.length-1;0<=v;v--)e[r[v].name]=r[v].value;d=a.a.c(d);var t=w.createElement("form");t.style.display="none";t.action=h;t.method="post";for(var E in d)c=w.createElement("input"),c.name=E,c.value=a.a.Na(a.a.c(d[E])),t.appendChild(c);b(e,function(a,b){var c=w.createElement("input");c.name=
+a;c.value=b;t.appendChild(c)});w.body.appendChild(t);f.submitter?f.submitter(t):t.submit();setTimeout(function(){t.parentNode.removeChild(t)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.n);a.b("utils.arrayFirst",a.a.Ua);a.b("utils.arrayFilter",a.a.ga);a.b("utils.arrayGetDistinctValues",a.a.Va);a.b("utils.arrayIndexOf",a.a.l);a.b("utils.arrayMap",a.a.ha);a.b("utils.arrayPushAll",a.a.X);a.b("utils.arrayRemoveItem",a.a.ia);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",
+a.a.$a);a.b("utils.getFormFields",a.a.ab);a.b("utils.peekObservable",a.a.Ha);a.b("utils.postJson",a.a.Xb);a.b("utils.parseJson",a.a.Wb);a.b("utils.registerEventHandler",a.a.r);a.b("utils.stringifyJson",a.a.Na);a.b("utils.range",a.a.Zb);a.b("utils.toggleDomNodeCssClass",a.a.ma);a.b("utils.triggerEvent",a.a.da);a.b("utils.unwrapObservable",a.a.c);a.b("utils.objectForEach",a.a.K);a.b("utils.addOrRemoveItem",a.a.V);a.b("unwrap",a.a.c);Function.prototype.bind||(Function.prototype.bind=function(a){var c=
+this,d=Array.prototype.slice.call(arguments);a=d.shift();return function(){return c.apply(a,d.concat(Array.prototype.slice.call(arguments)))}});a.a.f=new function(){function a(b,h){var k=b[d];if(!k||"null"===k||!e[k]){if(!h)return q;k=b[d]="ko"+c++;e[k]={}}return e[k]}var c=0,d="__ko__"+(new Date).getTime(),e={};return{get:function(c,d){var e=a(c,!1);return e===q?q:e[d]},set:function(c,d,e){if(e!==q||a(c,!1)!==q)a(c,!0)[d]=e},clear:function(a){var b=a[d];return b?(delete e[b],a[d]=null,!0):!1},D:function(){return c++ +
+d}}};a.b("utils.domData",a.a.f);a.b("utils.domData.clear",a.a.f.clear);a.a.C=new function(){function b(b,c){var e=a.a.f.get(b,d);e===q&&c&&(e=[],a.a.f.set(b,d,e));return e}function c(d){var e=b(d,!1);if(e)for(var e=e.slice(0),m=0;m<e.length;m++)e[m](d);a.a.f.clear(d);"function"==typeof u&&"function"==typeof u.cleanData&&u.cleanData([d]);if(g[d.nodeType])for(e=d.firstChild;d=e;)e=d.nextSibling,8===d.nodeType&&c(d)}var d=a.a.f.D(),e={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{ea:function(a,c){if("function"!=
+typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},mb:function(c,e){var g=b(c,!1);g&&(a.a.ia(g,e),0==g.length&&a.a.f.set(c,d,q))},L:function(b){if(e[b.nodeType]&&(c(b),g[b.nodeType])){var d=[];a.a.X(d,b.getElementsByTagName("*"));for(var m=0,f=d.length;m<f;m++)c(d[m])}return b},removeNode:function(b){a.L(b);b.parentNode&&b.parentNode.removeChild(b)}}};a.L=a.a.C.L;a.removeNode=a.a.C.removeNode;a.b("cleanNode",a.L);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.C);
+a.b("utils.domNodeDisposal.addDisposeCallback",a.a.C.ea);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.C.mb);(function(){a.a.Fa=function(b){var c;if("undefined"!=typeof u)if(u.parseHTML)c=u.parseHTML(b)||[];else{if((c=u.clean([b]))&&c[0]){for(b=c[0];b.parentNode&&11!==b.parentNode.nodeType;)b=b.parentNode;b.parentNode&&b.parentNode.removeChild(b)}}else{var d=a.a.la(b).toLowerCase();c=w.createElement("div");d=d.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","</table>"]||!d.indexOf("<tr")&&[2,
+"<table><tbody>","</tbody></table>"]||(!d.indexOf("<td")||!d.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||[0,"",""];b="ignored<div>"+d[1]+b+d[2]+"</div>";for("function"==typeof y.innerShiv?c.appendChild(y.innerShiv(b)):c.innerHTML=b;d[0]--;)c=c.lastChild;c=a.a.Q(c.lastChild.childNodes)}return c};a.a.Ka=function(b,c){a.a.wa(b);c=a.a.c(c);if(null!==c&&c!==q)if("string"!=typeof c&&(c=c.toString()),"undefined"!=typeof u)u(b).html(c);else for(var d=a.a.Fa(c),e=0;e<d.length;e++)b.appendChild(d[e])}})();
+a.b("utils.parseHtmlFragment",a.a.Fa);a.b("utils.setHtml",a.a.Ka);a.u=function(){function b(c,e){if(c)if(8==c.nodeType){var g=a.u.jb(c.nodeValue);null!=g&&e.push({Fb:c,Tb:g})}else if(1==c.nodeType)for(var g=0,h=c.childNodes,k=h.length;g<k;g++)b(h[g],e)}var c={};return{Ca:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);
+c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},ub:function(a,b){var g=c[a];if(g===q)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return g.apply(null,b||[]),!0}finally{delete c[a]}},vb:function(c,e){var g=[];b(c,g);for(var h=0,k=g.length;h<k;h++){var m=g[h].Fb,f=[m];e&&a.a.X(f,e);a.u.ub(g[h].Tb,f);m.nodeValue="";m.parentNode&&m.parentNode.removeChild(m)}},jb:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.u);a.b("memoization.memoize",
+a.u.Ca);a.b("memoization.unmemoize",a.u.ub);a.b("memoization.parseMemoText",a.u.jb);a.b("memoization.unmemoizeDomNodeAndDescendants",a.u.vb);a.xa={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.h({read:b,write:function(a){clearTimeout(d);d=setTimeout(function(){b(a)},c)}})},notify:function(a,c){a.equalityComparer="always"==c?null:G}};var N={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.xa);a.sb=function(b,c,d){this.target=b;this.qa=c;this.Eb=d;a.s(this,"dispose",
+this.B)};a.sb.prototype.B=function(){this.Qb=!0;this.Eb()};a.ca=function(){this.F={};a.a.extend(this,a.ca.fn);a.s(this,"subscribe",this.T);a.s(this,"extend",this.extend);a.s(this,"getSubscriptionsCount",this.Lb)};var I="change";a.ca.fn={T:function(b,c,d){d=d||I;var e=new a.sb(this,c?b.bind(c):b,function(){a.a.ia(this.F[d],e)}.bind(this));this.F[d]||(this.F[d]=[]);this.F[d].push(e);return e},notifySubscribers:function(b,c){c=c||I;if(this.cb(c))try{a.i.Wa();for(var d=this.F[c].slice(0),e=0,g;g=d[e];++e)g&&
+!0!==g.Qb&&g.qa(b)}finally{a.i.end()}},cb:function(a){return this.F[a]&&this.F[a].length},Lb:function(){var b=0;a.a.K(this.F,function(a,d){b+=d.length});return b},extend:function(b){var c=this;b&&a.a.K(b,function(b,e){var g=a.xa[b];"function"==typeof g&&(c=g(c,e)||c)});return c}};a.fb=function(a){return null!=a&&"function"==typeof a.T&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.ca);a.b("isSubscribable",a.fb);a.i=function(){var b=[];return{Wa:function(a){b.push(a&&{qa:a,Za:[]})},
+end:function(){b.pop()},lb:function(c){if(!a.fb(c))throw Error("Only subscribable things can act as dependencies");if(0<b.length){var d=b[b.length-1];!d||0<=a.a.l(d.Za,c)||(d.Za.push(c),d.qa(c))}},p:function(a,d,e){try{return b.push(null),a.apply(d,e||[])}finally{b.pop()}}}}();a.q=function(b){function c(){if(0<arguments.length)return c.equalityComparer&&c.equalityComparer(d,arguments[0])||(c.O(),d=arguments[0],c.N()),this;a.i.lb(c);return d}var d=b;a.ca.call(c);c.t=function(){return d};c.N=function(){c.notifySubscribers(d)};
+c.O=function(){c.notifySubscribers(d,"beforeChange")};a.a.extend(c,a.q.fn);a.s(c,"peek",c.t);a.s(c,"valueHasMutated",c.N);a.s(c,"valueWillMutate",c.O);return c};a.q.fn={equalityComparer:G};var C=a.q.Yb="__ko_proto__";a.q.fn[C]=a.q;a.ya=function(b,c){return null===b||b===q||b[C]===q?!1:b[C]===c?!0:a.ya(b[C],c)};a.M=function(b){return a.ya(b,a.q)};a.gb=function(b){return"function"==typeof b&&b[C]===a.q||"function"==typeof b&&b[C]===a.h&&b.Nb?!0:!1};a.b("observable",a.q);a.b("isObservable",a.M);a.b("isWriteableObservable",
+a.gb);a.ba=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.q(b);a.a.extend(b,a.ba.fn);return b.extend({trackArrayChanges:!0})};a.ba.fn={remove:function(b){for(var c=this.t(),d=[],e="function"!=typeof b||a.M(b)?function(a){return a===b}:b,g=0;g<c.length;g++){var h=c[g];e(h)&&(0===d.length&&this.O(),d.push(h),c.splice(g,1),g--)}d.length&&this.N();return d},removeAll:function(b){if(b===
+q){var c=this.t(),d=c.slice(0);this.O();c.splice(0,c.length);this.N();return d}return b?this.remove(function(c){return 0<=a.a.l(b,c)}):[]},destroy:function(b){var c=this.t(),d="function"!=typeof b||a.M(b)?function(a){return a===b}:b;this.O();for(var e=c.length-1;0<=e;e--)d(c[e])&&(c[e]._destroy=!0);this.N()},destroyAll:function(b){return b===q?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.l(b,c)}):[]},indexOf:function(b){var c=this();return a.a.l(c,b)},replace:function(a,
+c){var d=this.indexOf(a);0<=d&&(this.O(),this.t()[d]=c,this.N())}};a.a.n("pop push reverse shift sort splice unshift".split(" "),function(b){a.ba.fn[b]=function(){var a=this.t();this.O();this.Xa(a,b,arguments);a=a[b].apply(a,arguments);this.N();return a}});a.a.n(["slice"],function(b){a.ba.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.b("observableArray",a.ba);var J="arrayChange";a.xa.trackArrayChanges=function(b){function c(){if(!d){d=!0;var c=b.notifySubscribers;b.notifySubscribers=
+function(a,b){b&&b!==I||++g;return c.apply(this,arguments)};var m=[].concat(b.t()||[]);e=null;b.T(function(c){c=[].concat(c||[]);if(b.cb(J)){var d;if(!e||1<g)e=a.a.ra(m,c,{sparse:!0});d=e;d.length&&b.notifySubscribers(d,J)}m=c;e=null;g=0})}}if(!b.Xa){var d=!1,e=null,g=0,h=b.T;b.T=b.subscribe=function(a,b,f){f===J&&c();return h.apply(this,arguments)};b.Xa=function(a,b,c){function p(a,b,c){h.push({status:a,value:b,index:c})}if(d&&!g){var h=[],l=a.length,n=c.length,r=0;switch(b){case "push":r=l;case "unshift":for(b=
+0;b<n;b++)p("added",c[b],r+b);break;case "pop":r=l-1;case "shift":l&&p("deleted",a[r],r);break;case "splice":b=Math.min(Math.max(0,0>c[0]?l+c[0]:c[0]),l);for(var l=1===n?l:Math.min(b+(c[1]||0),l),n=b+n-2,r=Math.max(l,n),v=2;b<r;++b,++v)b<l&&p("deleted",a[b],b),b<n&&p("added",c[v],b);break;default:return}e=h}}}};a.h=function(b,c,d){function e(){a.a.n(z,function(a){a.B()});z=[]}function g(){var a=k.throttleEvaluation;a&&0<=a?(clearTimeout(x),x=setTimeout(h,a)):h()}function h(){if(!s){if(E&&E()){if(!l){D();
+p=!0;return}}else l=!1;s=!0;try{var b=a.a.ha(z,function(a){return a.target});a.i.Wa(function(c){var d;0<=(d=a.a.l(b,c))?b[d]=q:z.push(c.T(g))});for(var d=c?n.call(c):n(),e=b.length-1;0<=e;e--)b[e]&&z.splice(e,1)[0].B();p=!0;k.equalityComparer&&k.equalityComparer(f,d)||(k.notifySubscribers(f,"beforeChange"),f=d,k.notifySubscribers(f))}finally{a.i.end(),s=!1}z.length||D()}}function k(){if(0<arguments.length){if("function"===typeof r)r.apply(c,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
+return this}p||h();a.i.lb(k);return f}function m(){return!p||0<z.length}var f,p=!1,s=!1,l=!1,n=b;n&&"object"==typeof n?(d=n,n=d.read):(d=d||{},n||(n=d.read));if("function"!=typeof n)throw Error("Pass a function that returns the value of the ko.computed");var r=d.write,v=d.disposeWhenNodeIsRemoved||d.I||null,t=d.disposeWhen||d.ua,E=t,D=e,z=[],x=null;c||(c=d.owner);k.t=function(){p||h();return f};k.Kb=function(){return z.length};k.Nb="function"===typeof d.write;k.B=function(){D()};k.aa=m;a.ca.call(k);
+a.a.extend(k,a.h.fn);a.s(k,"peek",k.t);a.s(k,"dispose",k.B);a.s(k,"isActive",k.aa);a.s(k,"getDependenciesCount",k.Kb);v&&(l=!0,v.nodeType&&(E=function(){return!a.a.va(v)||t&&t()}));!0!==d.deferEvaluation&&h();v&&m()&&(D=function(){a.a.C.mb(v,D);e()},a.a.C.ea(v,D));return k};a.Pb=function(b){return a.ya(b,a.h)};F=a.q.Yb;a.h[F]=a.q;a.h.fn={equalityComparer:G};a.h.fn[F]=a.h;a.b("dependentObservable",a.h);a.b("computed",a.h);a.b("isComputed",a.Pb);(function(){function b(a,g,h){h=h||new d;a=g(a);if("object"!=
+typeof a||null===a||a===q||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var k=a instanceof Array?[]:{};h.save(a,k);c(a,function(c){var d=g(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":k[c]=d;break;case "object":case "undefined":var p=h.get(d);k[c]=p!==q?p:b(d,g,h)}});return k}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=
+[];this.Qa=[]}a.tb=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(c,function(b){for(var c=0;a.M(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.tb(b);return a.a.Na(b,c,d)};d.prototype={save:function(b,c){var d=a.a.l(this.keys,b);0<=d?this.Qa[d]=c:(this.keys.push(b),this.Qa.push(c))},get:function(b){b=a.a.l(this.keys,b);return 0<=b?this.Qa[b]:q}}})();a.b("toJS",a.tb);a.b("toJSON",a.toJSON);(function(){a.k={o:function(b){switch(a.a.v(b)){case "option":return!0===
+b.__ko__hasDomDataOptionValue__?a.a.f.get(b,a.d.options.Ea):7>=a.a.ja?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.k.o(b.options[b.selectedIndex]):q;default:return b.value}},na:function(b,c){switch(a.a.v(b)){case "option":switch(typeof c){case "string":a.a.f.set(b,a.d.options.Ea,q);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.f.set(b,a.d.options.Ea,c),b.__ko__hasDomDataOptionValue__=
+!0,b.value="number"===typeof c?c:""}break;case "select":""===c&&(c=q);if(null===c||c===q)b.selectedIndex=-1;for(var d=b.options.length-1;0<=d;d--)if(a.k.o(b.options[d])==c){b.selectedIndex=d;break}1<b.size||-1!==b.selectedIndex||(b.selectedIndex=0);break;default:if(null===c||c===q)c="";b.value=c}}}})();a.b("selectExtensions",a.k);a.b("selectExtensions.readValue",a.k.o);a.b("selectExtensions.writeValue",a.k.na);a.g=function(){function b(b){b=a.a.la(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));var c=
+[],d=b.match(e),k,l,n=0;if(d){d.push(",");for(var r=0,v;v=d[r];++r){var t=v.charCodeAt(0);if(44===t){if(0>=n){k&&c.push(l?{key:k,value:l.join("")}:{unknown:k});k=l=n=0;continue}}else if(58===t){if(!l)continue}else if(47===t&&r&&1<v.length)(t=d[r-1].match(g))&&!h[t[0]]&&(b=b.substr(b.indexOf(v)+1),d=b.match(e),d.push(","),r=-1,v="/");else if(40===t||123===t||91===t)++n;else if(41===t||125===t||93===t)--n;else if(!k&&!l){k=34===t||39===t?v.slice(1,-1):v;continue}l?l.push(v):l=[v]}}return c}var c=["true",
+"false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,e=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),g=/[\])"'A-Za-z0-9_$]+$/,h={"in":1,"return":1,"typeof":1},k={};return{Y:[],U:k,Ga:b,ka:function(e,f){function g(b,f){var e,r=a.getBindingHandler(b);if(r&&r.preprocess?f=r.preprocess(f,b,g):1){if(r=k[b])e=f,0<=a.a.l(c,e)?e=!1:(r=e.match(d),e=null===r?!1:r[1]?"Object("+r[1]+")"+
+r[2]:e),r=e;r&&l.push("'"+b+"':function(_z){"+e+"=_z}");n&&(f="function(){return "+f+" }");h.push("'"+b+"':"+f)}}f=f||{};var h=[],l=[],n=f.valueAccessors,r="string"===typeof e?b(e):e;a.a.n(r,function(a){g(a.key||a.unknown,a.value)});l.length&&g("_ko_property_writers","{"+l.join(",")+"}");return h.join(",")},Sb:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},oa:function(b,c,d,e,k){if(b&&a.M(b))!a.gb(b)||k&&b.t()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();
+a.b("expressionRewriting",a.g);a.b("expressionRewriting.bindingRewriteValidators",a.g.Y);a.b("expressionRewriting.parseObjectLiteral",a.g.Ga);a.b("expressionRewriting.preProcessBindings",a.g.ka);a.b("expressionRewriting._twoWayBindings",a.g.U);a.b("jsonExpressionRewriting",a.g);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.g.ka);(function(){function b(a){return 8==a.nodeType&&h.test(g?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&k.test(g?a.text:a.nodeValue)}function d(a,
+d){for(var e=a,k=1,n=[];e=e.nextSibling;){if(c(e)&&(k--,0===k))return n;n.push(e);b(e)&&k++}if(!d)throw Error("Cannot find closing comment tag to match: "+a.nodeValue);return null}function e(a,b){var c=d(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var g=w&&"\x3c!--test--\x3e"===w.createComment("test").text,h=g?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=g?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,m={ul:!0,ol:!0};a.e={P:{},childNodes:function(a){return b(a)?
+d(a):a.childNodes},Z:function(c){if(b(c)){c=a.e.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.wa(c)},S:function(c,d){if(b(c)){a.e.Z(c);for(var e=c.nextSibling,k=0,n=d.length;k<n;k++)e.parentNode.insertBefore(d[k],e)}else a.a.S(c,d)},kb:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},eb:function(c,d,e){e?b(c)?c.parentNode.insertBefore(d,e.nextSibling):e.nextSibling?c.insertBefore(d,e.nextSibling):
+c.appendChild(d):a.e.kb(c,d)},firstChild:function(a){return b(a)?!a.nextSibling||c(a.nextSibling)?null:a.nextSibling:a.firstChild},nextSibling:function(a){b(a)&&(a=e(a));return a.nextSibling&&c(a.nextSibling)?null:a.nextSibling},Mb:b,bc:function(a){return(a=(g?a.text:a.nodeValue).match(h))?a[1]:null},ib:function(d){if(m[a.a.v(d)]){var k=d.firstChild;if(k){do if(1===k.nodeType){var g;g=k.firstChild;var h=null;if(g){do if(h)h.push(g);else if(b(g)){var n=e(g,!0);n?g=n:h=[g]}else c(g)&&(h=[g]);while(g=
+g.nextSibling)}if(g=h)for(h=k.nextSibling,n=0;n<g.length;n++)h?d.insertBefore(g[n],h):d.appendChild(g[n])}while(k=k.nextSibling)}}}}})();a.b("virtualElements",a.e);a.b("virtualElements.allowedBindings",a.e.P);a.b("virtualElements.emptyNode",a.e.Z);a.b("virtualElements.insertAfter",a.e.eb);a.b("virtualElements.prepend",a.e.kb);a.b("virtualElements.setDomNodeChildren",a.e.S);(function(){a.H=function(){this.zb={}};a.a.extend(a.H.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=
+b.getAttribute("data-bind");case 8:return a.e.Mb(b);default:return!1}},getBindings:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a):null},getBindingAccessors:function(a,c){var d=this.getBindingsString(a,c);return d?this.parseBindingsString(d,c,a,{valueAccessors:!0}):null},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.e.bc(b);default:return null}},parseBindingsString:function(b,c,d,e){try{var g=this.zb,
+h=b+(e&&e.valueAccessors||""),k;if(!(k=g[h])){var m,f="with($context){with($data||{}){return{"+a.g.ka(b,e)+"}}}";m=new Function("$context","$element",f);k=g[h]=m}return k(c,d)}catch(p){throw p.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+p.message,p;}}});a.H.instance=new a.H})();a.b("bindingProvider",a.H);(function(){function b(a){return function(){return a}}function c(a){return a()}function d(b){return a.a.Da(a.i.p(b),function(a,c){return function(){return b()[c]}})}function e(a,
+b){return d(this.getBindings.bind(this,a,b))}function g(b,c,d){var f,e=a.e.firstChild(c),k=a.H.instance,g=k.preprocessNode;if(g){for(;f=e;)e=a.e.nextSibling(f),g.call(k,f);e=a.e.firstChild(c)}for(;f=e;)e=a.e.nextSibling(f),h(b,f,d)}function h(b,c,d){var f=!0,e=1===c.nodeType;e&&a.e.ib(c);if(e&&d||a.H.instance.nodeHasBindings(c))f=m(c,null,b,d).shouldBindDescendants;f&&!p[a.a.v(c)]&&g(b,c,!e)}function k(b){var c=[],d={},f=[];a.a.K(b,function D(e){if(!d[e]){var k=a.getBindingHandler(e);k&&(k.after&&
+(f.push(e),a.a.n(k.after,function(c){if(b[c]){if(-1!==a.a.l(f,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+f.join(", "));D(c)}}),f.pop()),c.push({key:e,bb:k}));d[e]=!0}});return c}function m(b,d,f,g){var h=a.a.f.get(b,s);if(!d){if(h)throw Error("You cannot apply bindings multiple times to the same element.");a.a.f.set(b,s,!0)}!h&&g&&a.rb(b,f);var m;if(d&&"function"!==typeof d)m=d;else{var p=a.H.instance,l=p.getBindingAccessors||e;if(d||f.A){var A=
+a.h(function(){(m=d?d(f,b):l.call(p,b,f))&&f.A&&f.A();return m},null,{I:b});m&&A.aa()||(A=null)}else m=a.i.p(l,p,[b,f])}var u;if(m){var w=A?function(a){return function(){return c(A()[a])}}:function(a){return m[a]},y=function(){return a.a.Da(A?A():m,c)};y.get=function(a){return m[a]&&c(w(a))};y.has=function(a){return a in m};g=k(m);a.a.n(g,function(c){var d=c.bb.init,e=c.bb.update,k=c.key;if(8===b.nodeType&&!a.e.P[k])throw Error("The binding '"+k+"' cannot be used with virtual elements");try{"function"==
+typeof d&&a.i.p(function(){var a=d(b,w(k),y,f.$data,f);if(a&&a.controlsDescendantBindings){if(u!==q)throw Error("Multiple bindings ("+u+" and "+k+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=k}}),"function"==typeof e&&a.h(function(){e(b,w(k),y,f.$data,f)},null,{I:b})}catch(g){throw g.message='Unable to process binding "'+k+": "+m[k]+'"\nMessage: '+g.message,g;}})}return{shouldBindDescendants:u===q}}function f(b){return b&&
+b instanceof a.G?b:new a.G(b)}a.d={};var p={script:!0};a.getBindingHandler=function(b){return a.d[b]};a.G=function(b,c,d,f){var e=this,k="function"==typeof b,g,h=a.h(function(){var g=k?b():b;c?(c.A&&c.A(),a.a.extend(e,c),h&&(e.A=h)):(e.$parents=[],e.$root=g,e.ko=a);e.$rawData=b;e.$data=g;d&&(e[d]=g);f&&f(e,c,g);return e.$data},null,{ua:function(){return g&&!a.a.Ra(g)},I:!0});h.aa()&&(e.A=h,h.equalityComparer=null,g=[],h.wb=function(b){g.push(b);a.a.C.ea(b,function(b){a.a.ia(g,b);g.length||(h.B(),
+e.A=h=q)})})};a.G.prototype.createChildContext=function(b,c,d){return new a.G(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)})};a.G.prototype.extend=function(b){return new a.G(this.$rawData,this,null,function(c){a.a.extend(c,"function"==typeof b?b():b)})};var s=a.a.f.D(),l=a.a.f.D();a.rb=function(b,c){if(2==arguments.length)a.a.f.set(b,l,c),c.A&&c.A.wb(b);else return a.a.f.get(b,l)};a.pa=function(b,c,d){1===b.nodeType&&
+a.e.ib(b);return m(b,c,f(d),!0)};a.xb=function(c,e,k){k=f(k);return a.pa(c,"function"===typeof e?d(e.bind(null,k,c)):a.a.Da(e,b),k)};a.Ta=function(a,b){1!==b.nodeType&&8!==b.nodeType||g(f(a),b,!0)};a.Sa=function(a,b){if(b&&1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");b=b||y.document.body;h(f(a),b,!0)};a.ta=function(b){switch(b.nodeType){case 1:case 8:var c=a.rb(b);if(c)return c;if(b.parentNode)return a.ta(b.parentNode)}return q};
+a.Cb=function(b){return(b=a.ta(b))?b.$data:q};a.b("bindingHandlers",a.d);a.b("applyBindings",a.Sa);a.b("applyBindingsToDescendants",a.Ta);a.b("applyBindingAccessorsToNode",a.pa);a.b("applyBindingsToNode",a.xb);a.b("contextFor",a.ta);a.b("dataFor",a.Cb)})();var M={"class":"className","for":"htmlFor"};a.d.attr={update:function(b,c){var d=a.a.c(c())||{};a.a.K(d,function(c,d){d=a.a.c(d);var h=!1===d||null===d||d===q;h&&b.removeAttribute(c);8>=a.a.ja&&c in M?(c=M[c],h?b.removeAttribute(c):b[c]=d):h||b.setAttribute(c,
+d.toString());"name"===c&&a.a.pb(b,h?"":d.toString())})}};(function(){a.d.checked={after:["value","attr"],init:function(b,c,d){function e(){return d.has("checkedValue")?a.a.c(d.get("checkedValue")):b.value}function g(){var k=b.checked,g=s?e():k;if(l&&(!m||k)){var h=a.i.p(c);f?p!==g?(k&&(a.a.V(h,g,!0),a.a.V(h,p,!1)),p=g):a.a.V(h,g,k):a.g.oa(h,d,"checked",g,!0)}}function h(){var d=a.a.c(c());b.checked=f?0<=a.a.l(d,e()):k?d:e()===d}var k="checkbox"==b.type,m="radio"==b.type;if(k||m){var f=k&&a.a.c(c())instanceof
+Array,p=f?e():q,s=m||f,l=!1;m&&!b.name&&a.d.uniqueName.init(b,function(){return!0});a.h(g,null,{I:b});a.a.r(b,"click",g);a.h(h,null,{I:b});l=!0}}};a.g.U.checked=!0;a.d.checkedValue={update:function(b,c){b.value=a.a.c(c())}}})();a.d.css={update:function(b,c){var d=a.a.c(c());"object"==typeof d?a.a.K(d,function(c,d){d=a.a.c(d);a.a.ma(b,c,d)}):(d=String(d||""),a.a.ma(b,b.__ko__cssValue,!1),b.__ko__cssValue=d,a.a.ma(b,d,!0))}};a.d.enable={update:function(b,c){var d=a.a.c(c());d&&b.disabled?b.removeAttribute("disabled"):
+d||b.disabled||(b.disabled=!0)}};a.d.disable={update:function(b,c){a.d.enable.update(b,function(){return!a.a.c(c())})}};a.d.event={init:function(b,c,d,e,g){var h=c()||{};a.a.K(h,function(k){"string"==typeof k&&a.a.r(b,k,function(b){var f,h=c()[k];if(h){try{var s=a.a.Q(arguments);e=g.$data;s.unshift(e);f=h.apply(e,s)}finally{!0!==f&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(k+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.d.foreach={hb:function(b){return function(){var c=
+b(),d=a.a.Ha(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.J.Aa};a.a.c(c);return{foreach:d.data,as:d.as,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.J.Aa}}},init:function(b,c){return a.d.template.init(b,a.d.foreach.hb(c))},update:function(b,c,d,e,g){return a.d.template.update(b,a.d.foreach.hb(c),d,e,g)}};a.g.Y.foreach=!1;a.e.P.foreach=!0;a.d.hasfocus=
+{init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var g=b.ownerDocument;if("activeElement"in g){var f;try{f=g.activeElement}catch(h){f=g.body}e=f===b}g=c();a.g.oa(g,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var g=e.bind(null,!0),h=e.bind(null,!1);a.a.r(b,"focus",g);a.a.r(b,"focusin",g);a.a.r(b,"blur",h);a.a.r(b,"focusout",h)},update:function(b,c){var d=!!a.a.c(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),a.i.p(a.a.da,
+null,[b,d?"focusin":"focusout"]))}};a.g.U.hasfocus=!0;a.d.hasFocus=a.d.hasfocus;a.g.U.hasFocus=!0;a.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ka(b,c())}};var L=a.a.f.D();H("if");H("ifnot",!1,!0);H("with",!0,!1,function(a,c){return a.createChildContext(c)});a.d.options={init:function(b){if("select"!==a.a.v(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,
+c,d){function e(){return a.a.ga(b.options,function(a){return a.selected})}function g(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function h(c,d){if(p.length){var f=0<=a.a.l(p,a.k.o(d[0]));a.a.qb(d[0],f);l&&!f&&a.i.p(a.a.da,null,[b,"change"])}}var k=0!=b.length&&b.multiple?b.scrollTop:null;c=a.a.c(c());var m=d.get("optionsIncludeDestroyed"),f={},p;p=b.multiple?a.a.ha(e(),a.k.o):0<=b.selectedIndex?[a.k.o(b.options[b.selectedIndex])]:[];if(c){"undefined"==typeof c.length&&(c=[c]);
+var s=a.a.ga(c,function(b){return m||b===q||null===b||!a.a.c(b._destroy)});d.has("optionsCaption")&&(c=a.a.c(d.get("optionsCaption")),null!==c&&c!==q&&s.unshift(f))}else c=[];var l=!1;c=h;d.has("optionsAfterRender")&&(c=function(b,c){h(0,c);a.i.p(d.get("optionsAfterRender"),null,[c[0],b!==f?b:q])});a.a.Ja(b,s,function(b,c,e){e.length&&(p=e[0].selected?[a.k.o(e[0])]:[],l=!0);c=w.createElement("option");b===f?(a.a.Ma(c,d.get("optionsCaption")),a.k.na(c,q)):(e=g(b,d.get("optionsValue"),b),a.k.na(c,a.a.c(e)),
+b=g(b,d.get("optionsText"),e),a.a.Ma(c,b));return[c]},null,c);(b.multiple?p.length&&e().length<p.length:p.length&&0<=b.selectedIndex?a.k.o(b.options[b.selectedIndex])!==p[0]:p.length||0<=b.selectedIndex)&&a.i.p(a.a.da,null,[b,"change"]);a.a.Hb(b);k&&20<Math.abs(k-b.scrollTop)&&(b.scrollTop=k)}};a.d.options.Ea=a.a.f.D();a.d.selectedOptions={after:["options","foreach"],init:function(b,c,d){a.a.r(b,"change",function(){var e=c(),g=[];a.a.n(b.getElementsByTagName("option"),function(b){b.selected&&g.push(a.k.o(b))});
+a.g.oa(e,d,"selectedOptions",g)})},update:function(b,c){if("select"!=a.a.v(b))throw Error("values binding applies only to SELECT elements");var d=a.a.c(c());d&&"number"==typeof d.length&&a.a.n(b.getElementsByTagName("option"),function(b){var c=0<=a.a.l(d,a.k.o(b));a.a.qb(b,c)})}};a.g.U.selectedOptions=!0;a.d.style={update:function(b,c){var d=a.a.c(c()||{});a.a.K(d,function(c,d){d=a.a.c(d);b.style[c]=d||""})}};a.d.submit={init:function(b,c,d,e,g){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");
+a.a.r(b,"submit",function(a){var d,e=c();try{d=e.call(g.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ma(b,c())}};a.e.P.text=!0;a.d.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.d.uniqueName.Bb;a.a.pb(b,d)}}};a.d.uniqueName.Bb=0;a.d.value={after:["options","foreach"],init:function(b,c,d){function e(){k=!1;var e=c(),f=a.k.o(b);a.g.oa(e,d,"value",f)}var g=
+["change"],h=d.get("valueUpdate"),k=!1;h&&("string"==typeof h&&(h=[h]),a.a.X(g,h),g=a.a.Va(g));!a.a.ja||"input"!=b.tagName.toLowerCase()||"text"!=b.type||"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.l(g,"propertychange")||(a.a.r(b,"propertychange",function(){k=!0}),a.a.r(b,"blur",function(){k&&e()}));a.a.n(g,function(c){var d=e;a.a.ac(c,"after")&&(d=function(){setTimeout(e,0)},c=c.substring(5));a.a.r(b,c,d)})},update:function(b,c){var d="select"===a.a.v(b),e=a.a.c(c()),g=a.k.o(b);
+e!==g&&(g=function(){a.k.na(b,e)},g(),d&&(e!==a.k.o(b)?a.i.p(a.a.da,null,[b,"change"]):setTimeout(g,0)))}};a.g.U.value=!0;a.d.visible={update:function(b,c){var d=a.a.c(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};(function(b){a.d[b]={init:function(c,d,e,g,h){return a.d.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,g,h)}}})("click");a.w=function(){};a.w.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");
+};a.w.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.w.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.m.j(d)}if(1==b.nodeType||8==b.nodeType)return new a.m.W(b);throw Error("Unknown template type: "+b);};a.w.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,
+d)};a.w.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.w.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.w);a.Oa=function(){function b(b,c,d,k){b=a.g.Ga(b);for(var m=a.g.Y,f=0;f<b.length;f++){var p=b[f].key;if(m.hasOwnProperty(p)){var s=m[p];if("function"===typeof s){if(p=s(b[f].value))throw Error(p);}else if(!s)throw Error("This template engine does not support the '"+
+p+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.g.ka(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return k.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ib:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.Oa.Ub(b,c)},
+d)},Ub:function(a,g){return a.replace(c,function(a,c,d,f,e){return b(e,c,d,g)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",g)})},yb:function(b,c){return a.u.Ca(function(d,k){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.pa(m,b,k)})}}}();a.b("__tr_ambtns",a.Oa.yb);(function(){a.m={};a.m.j=function(a){this.j=a};a.m.j.prototype.text=function(){var b=a.a.v(this.j),b="script"===b?"text":"textarea"===b?"value":"innerHTML";if(0==arguments.length)return this.j[b];var c=arguments[0];
+"innerHTML"===b?a.a.Ka(this.j,c):this.j[b]=c};var b=a.a.f.D()+"_";a.m.j.prototype.data=function(c){if(1===arguments.length)return a.a.f.get(this.j,b+c);a.a.f.set(this.j,b+c,arguments[1])};var c=a.a.f.D();a.m.W=function(a){this.j=a};a.m.W.prototype=new a.m.j;a.m.W.prototype.text=function(){if(0==arguments.length){var b=a.a.f.get(this.j,c)||{};b.Pa===q&&b.sa&&(b.Pa=b.sa.innerHTML);return b.Pa}a.a.f.set(this.j,c,{Pa:arguments[0]})};a.m.j.prototype.nodes=function(){if(0==arguments.length)return(a.a.f.get(this.j,
+c)||{}).sa;a.a.f.set(this.j,c,{sa:arguments[0]})};a.b("templateSources",a.m);a.b("templateSources.domElement",a.m.j);a.b("templateSources.anonymousTemplate",a.m.W)})();(function(){function b(b,c,d){var e;for(c=a.e.nextSibling(c);b&&(e=b)!==c;)b=a.e.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var f=c[0],e=c[c.length-1],g=f.parentNode,h=a.H.instance,n=h.preprocessNode;if(n){b(f,e,function(a,b){var c=a.previousSibling,d=n.call(h,a);d&&(a===f&&(f=d[0]||b),a===e&&(e=d[d.length-1]||c))});c.length=
+0;if(!f)return;f===e?c.push(f):(c.push(f,e),a.a.$(c,g))}b(f,e,function(b){1!==b.nodeType&&8!==b.nodeType||a.Sa(d,b)});b(f,e,function(b){1!==b.nodeType&&8!==b.nodeType||a.u.vb(b,[d])});a.a.$(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,s){s=s||{};var l=b&&d(b),l=l&&l.ownerDocument,n=s.templateEngine||g;a.Oa.Ib(f,n,l);f=n.renderTemplate(f,h,s,l);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");
+l=!1;switch(e){case "replaceChildren":a.e.S(b,f);l=!0;break;case "replaceNode":a.a.nb(b,f);l=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}l&&(c(f,h),s.afterRender&&a.i.p(s.afterRender,null,[f,h.$data]));return f}var g;a.La=function(b){if(b!=q&&!(b instanceof a.w))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.Ia=function(b,c,f,h,s){f=f||{};if((f.templateEngine||g)==q)throw Error("Set a template engine before calling renderTemplate");
+s=s||"replaceChildren";if(h){var l=d(h);return a.h(function(){var g=c&&c instanceof a.G?c:new a.G(a.a.c(c)),r="function"==typeof b?b(g.$data,g):b,g=e(h,s,r,g,f);"replaceNode"==s&&(h=g,l=d(h))},null,{ua:function(){return!l||!a.a.va(l)},I:l&&"replaceNode"==s?l.parentNode:l})}return a.u.Ca(function(d){a.Ia(b,c,f,d,"replaceNode")})};a.$b=function(b,d,f,g,h){function l(a,b){c(b,r);f.afterRender&&f.afterRender(b,a)}function n(a,c){r=h.createChildContext(a,f.as,function(a){a.$index=c});var d="function"==
+typeof b?b(a,r):b;return e(null,"ignoreTargetNode",d,r,f)}var r;return a.h(function(){var b=a.a.c(d)||[];"undefined"==typeof b.length&&(b=[b]);b=a.a.ga(b,function(b){return f.includeDestroyed||b===q||null===b||!a.a.c(b._destroy)});a.i.p(a.a.Ja,null,[g,b,n,f,l])},null,{I:g})};var h=a.a.f.D();a.d.template={init:function(b,c){var d=a.a.c(c());"string"==typeof d||d.name?a.e.Z(b):(d=a.e.childNodes(b),d=a.a.Vb(d),(new a.m.W(b)).nodes(d));return{controlsDescendantBindings:!0}},update:function(b,c,d,e,g){c=
+a.a.c(c());d={};e=!0;var l,n=null;"string"!=typeof c&&(d=c,c=a.a.c(d.name),"if"in d&&(e=a.a.c(d["if"])),e&&"ifnot"in d&&(e=!a.a.c(d.ifnot)),l=a.a.c(d.data));"foreach"in d?n=a.$b(c||b,e&&d.foreach||[],d,b,g):e?(g="data"in d?g.createChildContext(l,d.as):g,n=a.Ia(c||b,g,d,b)):a.e.Z(b);g=n;(l=a.a.f.get(b,h))&&"function"==typeof l.B&&l.B();a.a.f.set(b,h,g&&g.aa()?g:q)}};a.g.Y.template=function(b){b=a.g.Ga(b);return 1==b.length&&b[0].unknown||a.g.Sb(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};
+a.e.P.template=!0})();a.b("setTemplateEngine",a.La);a.b("renderTemplate",a.Ia);a.a.ra=function(){function a(b,d,e,g,h){var k=Math.min,m=Math.max,f=[],p,q=b.length,l,n=d.length,r=n-q||1,v=q+n+1,t,u,w;for(p=0;p<=q;p++)for(u=t,f.push(t=[]),w=k(n,p+r),l=m(0,p-1);l<=w;l++)t[l]=l?p?b[p-1]===d[l-1]?u[l-1]:k(u[l]||v,t[l-1]||v)+1:l+1:p+1;k=[];m=[];r=[];p=q;for(l=n;p||l;)n=f[p][l]-1,l&&n===f[p][l-1]?m.push(k[k.length]={status:e,value:d[--l],index:l}):p&&n===f[p-1][l]?r.push(k[k.length]={status:g,value:b[--p],
+index:p}):(--l,--p,h.sparse||k.push({status:"retained",value:d[l]}));if(m.length&&r.length){b=10*q;var z;for(d=e=0;(h.dontLimitMoves||d<b)&&(z=m[e]);e++){for(g=0;f=r[g];g++)if(z.value===f.value){z.moved=f.index;f.moved=z.index;r.splice(g,1);d=g=0;break}d+=g}}return k.reverse()}return function(c,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};c=c||[];d=d||[];return c.length<=d.length?a(c,d,"added","deleted",e):a(d,c,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.ra);(function(){function b(b,
+c,g,h,k){var m=[],f=a.h(function(){var f=c(g,k,a.a.$(m,b))||[];0<m.length&&(a.a.nb(m,f),h&&a.i.p(h,null,[g,f,k]));m.splice(0,m.length);a.a.X(m,f)},null,{I:b,ua:function(){return!a.a.Ra(m)}});return{R:m,h:f.aa()?f:q}}var c=a.a.f.D();a.a.Ja=function(d,e,g,h,k){function m(b,c){x=s[c];t!==c&&(z[b]=x);x.za(t++);a.a.$(x.R,d);r.push(x);w.push(x)}function f(b,c){if(b)for(var d=0,e=c.length;d<e;d++)c[d]&&a.a.n(c[d].R,function(a){b(a,d,c[d].fa)})}e=e||[];h=h||{};var p=a.a.f.get(d,c)===q,s=a.a.f.get(d,c)||[],
+l=a.a.ha(s,function(a){return a.fa}),n=a.a.ra(l,e,h.dontLimitMoves),r=[],v=0,t=0,u=[],w=[];e=[];for(var z=[],l=[],x,A=0,y,B;y=n[A];A++)switch(B=y.moved,y.status){case "deleted":B===q&&(x=s[v],x.h&&x.h.B(),u.push.apply(u,a.a.$(x.R,d)),h.beforeRemove&&(e[A]=x,w.push(x)));v++;break;case "retained":m(A,v++);break;case "added":B!==q?m(A,B):(x={fa:y.value,za:a.q(t++)},r.push(x),w.push(x),p||(l[A]=x))}f(h.beforeMove,z);a.a.n(u,h.beforeRemove?a.L:a.removeNode);for(var A=0,p=a.e.firstChild(d),C;x=w[A];A++){x.R||
+a.a.extend(x,b(d,g,x.fa,k,x.za));for(v=0;n=x.R[v];p=n.nextSibling,C=n,v++)n!==p&&a.e.eb(d,n,C);!x.Ob&&k&&(k(x.fa,x.R,x.za),x.Ob=!0)}f(h.beforeRemove,e);f(h.afterMove,z);f(h.afterAdd,l);a.a.f.set(d,c,r)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Ja);a.J=function(){this.allowTemplateRewriting=!1};a.J.prototype=new a.w;a.J.prototype.renderTemplateSource=function(b){var c=(9>a.a.ja?0:b.nodes)?b.nodes():null;if(c)return a.a.Q(c.cloneNode(!0).childNodes);b=b.text();return a.a.Fa(b)};a.J.Aa=
+new a.J;a.La(a.J.Aa);a.b("nativeTemplateEngine",a.J);(function(){a.Ba=function(){var a=this.Rb=function(){if("undefined"==typeof u||!u.tmpl)return 0;try{if(0<=u.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,g){g=g||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var h=b.data("precompiled");h||(h=b.text()||"",h=u.template(null,"{{ko_with $item.koBindingContext}}"+h+
+"{{/ko_with}}"),b.data("precompiled",h));b=[e.$data];e=u.extend({koBindingContext:e},g.templateOptions);e=u.tmpl(h,b,e);e.appendTo(w.createElement("div"));u.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){w.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(u.tmpl.tag.ko_code={open:"__.push($1 || '');"},u.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.Ba.prototype=
+new a.w;var b=new a.Ba;0<b.Rb&&a.La(b);a.b("jqueryTmplTemplateEngine",a.Ba)})()})})();})();
diff --git a/contrail-webui/controller/knockout-3.4.0.tar.gz b/contrail-webui/controller/knockout-3.4.0.tar.gz
new file mode 100644
index 0000000..2e48053
--- /dev/null
+++ b/contrail-webui/controller/knockout-3.4.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/knockout-v3.0.0.tar.gz b/contrail-webui/controller/knockout-v3.0.0.tar.gz
new file mode 100644
index 0000000..9b9ee70
--- /dev/null
+++ b/contrail-webui/controller/knockout-v3.0.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/kue-0.5.0.tgz b/contrail-webui/controller/kue-0.5.0.tgz
new file mode 100644
index 0000000..087f1b8
--- /dev/null
+++ b/contrail-webui/controller/kue-0.5.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/lodash.min.js b/contrail-webui/controller/lodash.min.js
new file mode 100644
index 0000000..256bb8e
--- /dev/null
+++ b/contrail-webui/controller/lodash.min.js
@@ -0,0 +1,98 @@
+/**
+ * @license
+ * lodash 3.10.1 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
+ * Build: `lodash modern -o ./lodash.js`
+ */
+;(function(){function n(n,t){if(n!==t){var r=null===n,e=n===w,u=n===n,o=null===t,i=t===w,f=t===t;if(n>t&&!o||!u||r&&!i&&f||e&&f)return 1;if(n<t&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function t(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function r(n,t,r){if(t!==t)return p(n,r);r-=1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function e(n){return typeof n=="function"||false}function u(n){return null==n?"":n+""}function o(n,t){for(var r=-1,e=n.length;++r<e&&-1<t.indexOf(n.charAt(r)););
+return r}function i(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function f(t,r){return n(t.a,r.a)||t.b-r.b}function a(n){return Nn[n]}function c(n){return Tn[n]}function l(n,t,r){return t?n=Bn[n]:r&&(n=Dn[n]),"\\"+n}function s(n){return"\\"+Dn[n]}function p(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return!!n&&typeof n=="object"}function _(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n);
+}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=z,o[++u]=r);return o}function g(n){for(var t=-1,r=n.length;++t<r&&_(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&_(n.charCodeAt(t)););return t}function d(n){return Ln[n]}function m(_){function Nn(n){if(h(n)&&!(Oo(n)||n instanceof zn)){if(n instanceof Ln)return n;if(nu.call(n,"__chain__")&&nu.call(n,"__wrapped__"))return Mr(n)}return new Ln(n)}function Tn(){}function Ln(n,t,r){this.__wrapped__=n,this.__actions__=r||[],
+this.__chain__=!!t}function zn(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=Ru,this.__views__=[]}function Bn(){this.__data__={}}function Dn(n){var t=n?n.length:0;for(this.data={hash:gu(null),set:new lu};t--;)this.push(n[t])}function Mn(n,t){var r=n.data;return(typeof t=="string"||ge(t)?r.set.has(t):r.hash[t])?0:-1}function qn(n,t){var r=-1,e=n.length;for(t||(t=Be(e));++r<e;)t[r]=n[r];return t}function Pn(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););
+return n}function Kn(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Vn(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function Gn(n,t){for(var r=-1,e=n.length,u=Be(e);++r<e;)u[r]=t(n[r],r,n);return u}function Jn(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function Xn(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r}function Hn(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;
+return false}function Qn(n,t,r,e){return n!==w&&nu.call(e,r)?n:t}function nt(n,t,r){for(var e=-1,u=zo(t),o=u.length;++e<o;){var i=u[e],f=n[i],a=r(f,t[i],i,n,t);(a===a?a===f:f!==f)&&(f!==w||i in n)||(n[i]=a)}return n}function tt(n,t){return null==t?n:et(t,zo(t),n)}function rt(n,t){for(var r=-1,e=null==n,u=!e&&Er(n),o=u?n.length:0,i=t.length,f=Be(i);++r<i;){var a=t[r];f[r]=u?Cr(a,o)?n[a]:w:e?w:n[a]}return f}function et(n,t,r){r||(r={});for(var e=-1,u=t.length;++e<u;){var o=t[e];r[o]=n[o]}return r}function ut(n,t,r){
+var e=typeof n;return"function"==e?t===w?n:Bt(n,t,r):null==n?Fe:"object"==e?bt(n):t===w?ze(n):xt(n,t)}function ot(n,t,r,e,u,o,i){var f;if(r&&(f=u?r(n,e,u):r(n)),f!==w)return f;if(!ge(n))return n;if(e=Oo(n)){if(f=kr(n),!t)return qn(n,f)}else{var a=ru.call(n),c=a==K;if(a!=Z&&a!=B&&(!c||u))return Fn[a]?Rr(n,a,t):u?n:{};if(f=Ir(c?{}:n),!t)return tt(f,n)}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(f),(e?Pn:_t)(n,function(e,u){f[u]=ot(e,t,r,u,n,o,i)}),f}function it(n,t,r){
+if(typeof n!="function")throw new Ge(L);return su(function(){n.apply(w,r)},t)}function ft(n,t){var e=n?n.length:0,u=[];if(!e)return u;var o=-1,i=xr(),f=i===r,a=f&&t.length>=F&&gu&&lu?new Dn(t):null,c=t.length;a&&(i=Mn,f=false,t=a);n:for(;++o<e;)if(a=n[o],f&&a===a){for(var l=c;l--;)if(t[l]===a)continue n;u.push(a)}else 0>i(t,a,0)&&u.push(a);return u}function at(n,t){var r=true;return Su(n,function(n,e,u){return r=!!t(n,e,u)}),r}function ct(n,t,r,e){var u=e,o=u;return Su(n,function(n,i,f){i=+t(n,i,f),(r(i,u)||i===e&&i===o)&&(u=i,
+o=n)}),o}function lt(n,t){var r=[];return Su(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function st(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function pt(n,t,r,e){e||(e=[]);for(var u=-1,o=n.length;++u<o;){var i=n[u];h(i)&&Er(i)&&(r||Oo(i)||pe(i))?t?pt(i,t,r,e):Jn(e,i):r||(e[e.length]=i)}return e}function ht(n,t){Nu(n,t,Re)}function _t(n,t){return Nu(n,t,zo)}function vt(n,t){return Tu(n,t,zo)}function gt(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];
+ve(n[i])&&(o[++u]=i)}return o}function yt(n,t,r){if(null!=n){r!==w&&r in Br(n)&&(t=[r]),r=0;for(var e=t.length;null!=n&&r<e;)n=n[t[r++]];return r&&r==e?n:w}}function dt(n,t,r,e,u,o){if(n===t)n=true;else if(null==n||null==t||!ge(n)&&!h(t))n=n!==n&&t!==t;else n:{var i=dt,f=Oo(n),a=Oo(t),c=D,l=D;f||(c=ru.call(n),c==B?c=Z:c!=Z&&(f=xe(n))),a||(l=ru.call(t),l==B?l=Z:l!=Z&&xe(t));var s=c==Z,a=l==Z,l=c==l;if(!l||f||s){if(!e&&(c=s&&nu.call(n,"__wrapped__"),a=a&&nu.call(t,"__wrapped__"),c||a)){n=i(c?n.value():n,a?t.value():t,r,e,u,o);
+break n}if(l){for(u||(u=[]),o||(o=[]),c=u.length;c--;)if(u[c]==n){n=o[c]==t;break n}u.push(n),o.push(t),n=(f?yr:mr)(n,t,i,r,e,u,o),u.pop(),o.pop()}else n=false}else n=dr(n,t,c)}return n}function mt(n,t,r){var e=t.length,u=e,o=!r;if(null==n)return!u;for(n=Br(n);e--;){var i=t[e];if(o&&i[2]?i[1]!==n[i[0]]:!(i[0]in n))return false}for(;++e<u;){var i=t[e],f=i[0],a=n[f],c=i[1];if(o&&i[2]){if(a===w&&!(f in n))return false}else if(i=r?r(a,c,f):w,i===w?!dt(c,a,r,true):!i)return false}return true}function wt(n,t){var r=-1,e=Er(n)?Be(n.length):[];
+return Su(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function bt(n){var t=Ar(n);if(1==t.length&&t[0][2]){var r=t[0][0],e=t[0][1];return function(n){return null==n?false:n[r]===e&&(e!==w||r in Br(n))}}return function(n){return mt(n,t)}}function xt(n,t){var r=Oo(n),e=Wr(n)&&t===t&&!ge(t),u=n+"";return n=Dr(n),function(o){if(null==o)return false;var i=u;if(o=Br(o),!(!r&&e||i in o)){if(o=1==n.length?o:yt(o,Et(n,0,-1)),null==o)return false;i=Zr(n),o=Br(o)}return o[i]===t?t!==w||i in o:dt(t,o[i],w,true)}}function At(n,t,r,e,u){
+if(!ge(n))return n;var o=Er(t)&&(Oo(t)||xe(t)),i=o?w:zo(t);return Pn(i||t,function(f,a){if(i&&(a=f,f=t[a]),h(f)){e||(e=[]),u||(u=[]);n:{for(var c=a,l=e,s=u,p=l.length,_=t[c];p--;)if(l[p]==_){n[c]=s[p];break n}var p=n[c],v=r?r(p,_,c,n,t):w,g=v===w;g&&(v=_,Er(_)&&(Oo(_)||xe(_))?v=Oo(p)?p:Er(p)?qn(p):[]:me(_)||pe(_)?v=pe(p)?ke(p):me(p)?p:{}:g=false),l.push(_),s.push(v),g?n[c]=At(v,_,r,l,s):(v===v?v!==p:p===p)&&(n[c]=v)}}else c=n[a],l=r?r(c,f,a,n,t):w,(s=l===w)&&(l=f),l===w&&(!o||a in n)||!s&&(l===l?l===c:c!==c)||(n[a]=l);
+}),n}function jt(n){return function(t){return null==t?w:t[n]}}function kt(n){var t=n+"";return n=Dr(n),function(r){return yt(r,n,t)}}function It(n,t){for(var r=n?t.length:0;r--;){var e=t[r];if(e!=u&&Cr(e)){var u=e;pu.call(n,e,1)}}}function Rt(n,t){return n+yu(ku()*(t-n+1))}function Ot(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function Et(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r=r===w||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Be(u);++e<u;)r[e]=n[e+t];
+return r}function Ct(n,t){var r;return Su(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function Ut(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function Wt(t,r,e){var u=wr(),o=-1;return r=Gn(r,function(n){return u(n)}),t=wt(t,function(n){return{a:Gn(r,function(t){return t(n)}),b:++o,c:n}}),Ut(t,function(t,r){var u;n:{for(var o=-1,i=t.a,f=r.a,a=i.length,c=e.length;++o<a;)if(u=n(i[o],f[o])){if(o>=c)break n;o=e[o],u*="asc"===o||true===o?1:-1;break n}u=t.b-r.b}return u})}function $t(n,t){
+var r=0;return Su(n,function(n,e,u){r+=+t(n,e,u)||0}),r}function St(n,t){var e=-1,u=xr(),o=n.length,i=u===r,f=i&&o>=F,a=f&&gu&&lu?new Dn(void 0):null,c=[];a?(u=Mn,i=false):(f=false,a=t?[]:c);n:for(;++e<o;){var l=n[e],s=t?t(l,e,n):l;if(i&&l===l){for(var p=a.length;p--;)if(a[p]===s)continue n;t&&a.push(s),c.push(l)}else 0>u(a,s,0)&&((t||f)&&a.push(s),c.push(l))}return c}function Ft(n,t){for(var r=-1,e=t.length,u=Be(e);++r<e;)u[r]=n[t[r]];return u}function Nt(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););
+return r?Et(n,e?0:o,e?o+1:u):Et(n,e?o+1:0,e?u:o)}function Tt(n,t){var r=n;r instanceof zn&&(r=r.value());for(var e=-1,u=t.length;++e<u;)var o=t[e],r=o.func.apply(o.thisArg,Jn([r],o.args));return r}function Lt(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&u<=Eu){for(;e<u;){var o=e+u>>>1,i=n[o];(r?i<=t:i<t)&&null!==i?e=o+1:u=o}return u}return zt(n,t,Fe,r)}function zt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,a=t===w;u<o;){var c=yu((u+o)/2),l=r(n[c]),s=l!==w,p=l===l;
+(i?p||e:f?p&&s&&(e||null!=l):a?p&&(e||s):null==l?0:e?l<=t:l<t)?u=c+1:o=c}return xu(o,Ou)}function Bt(n,t,r){if(typeof n!="function")return Fe;if(t===w)return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o)};case 5:return function(r,e,u,o,i){return n.call(t,r,e,u,o,i)}}return function(){return n.apply(t,arguments)}}function Dt(n){var t=new ou(n.byteLength);return new hu(t).set(new hu(n)),
+t}function Mt(n,t,r){for(var e=r.length,u=-1,o=bu(n.length-e,0),i=-1,f=t.length,a=Be(f+o);++i<f;)a[i]=t[i];for(;++u<e;)a[r[u]]=n[u];for(;o--;)a[i++]=n[u++];return a}function qt(n,t,r){for(var e=-1,u=r.length,o=-1,i=bu(n.length-u,0),f=-1,a=t.length,c=Be(i+a);++o<i;)c[o]=n[o];for(i=o;++f<a;)c[i+f]=t[f];for(;++e<u;)c[i+r[e]]=n[o++];return c}function Pt(n,t){return function(r,e,u){var o=t?t():{};if(e=wr(e,u,3),Oo(r)){u=-1;for(var i=r.length;++u<i;){var f=r[u];n(o,f,e(f,u,r),r)}}else Su(r,function(t,r,u){
+n(o,t,e(t,r,u),u)});return o}}function Kt(n){return le(function(t,r){var e=-1,u=null==t?0:r.length,o=2<u?r[u-2]:w,i=2<u?r[2]:w,f=1<u?r[u-1]:w;for(typeof o=="function"?(o=Bt(o,f,5),u-=2):(o=typeof f=="function"?f:w,u-=o?1:0),i&&Ur(r[0],r[1],i)&&(o=3>u?w:o,u=1);++e<u;)(i=r[e])&&n(t,i,o);return t})}function Vt(n,t){return function(r,e){var u=r?Bu(r):0;if(!Sr(u))return n(r,e);for(var o=t?u:-1,i=Br(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}function Zt(n){return function(t,r,e){var u=Br(t);e=e(t);for(var o=e.length,i=n?o:-1;n?i--:++i<o;){
+var f=e[i];if(false===r(u[f],f,u))break}return t}}function Yt(n,t){function r(){return(this&&this!==Zn&&this instanceof r?e:n).apply(t,arguments)}var e=Jt(n);return r}function Gt(n){return function(t){var r=-1;t=$e(Ce(t));for(var e=t.length,u="";++r<e;)u=n(u,t[r],r);return u}}function Jt(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:
+return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=$u(n.prototype),t=n.apply(r,t);return ge(t)?t:r}}function Xt(n){function t(r,e,u){return u&&Ur(r,e,u)&&(e=w),r=gr(r,n,w,w,w,w,w,e),r.placeholder=t.placeholder,r}return t}function Ht(n,t){return le(function(r){var e=r[0];return null==e?e:(r.push(t),n.apply(w,r))})}function Qt(n,t){return function(r,e,u){if(u&&Ur(r,e,u)&&(e=w),e=wr(e,u,3),1==e.length){
+u=r=Oo(r)?r:zr(r);for(var o=e,i=-1,f=u.length,a=t,c=a;++i<f;){var l=u[i],s=+o(l);n(s,a)&&(a=s,c=l)}if(u=c,!r.length||u!==t)return u}return ct(r,e,n,t)}}function nr(n,r){return function(e,u,o){return u=wr(u,o,3),Oo(e)?(u=t(e,u,r),-1<u?e[u]:w):st(e,u,n)}}function tr(n){return function(r,e,u){return r&&r.length?(e=wr(e,u,3),t(r,e,n)):-1}}function rr(n){return function(t,r,e){return r=wr(r,e,3),st(t,r,n,true)}}function er(n){return function(){for(var t,r=arguments.length,e=n?r:-1,u=0,o=Be(r);n?e--:++e<r;){
+var i=o[u++]=arguments[e];if(typeof i!="function")throw new Ge(L);!t&&Ln.prototype.thru&&"wrapper"==br(i)&&(t=new Ln([],true))}for(e=t?-1:r;++e<r;){var i=o[e],u=br(i),f="wrapper"==u?zu(i):w;t=f&&$r(f[0])&&f[1]==(E|k|R|C)&&!f[4].length&&1==f[9]?t[br(f[0])].apply(t,f[3]):1==i.length&&$r(i)?t[u]():t.thru(i)}return function(){var n=arguments,e=n[0];if(t&&1==n.length&&Oo(e)&&e.length>=F)return t.plant(e).value();for(var u=0,n=r?o[u].apply(this,n):e;++u<r;)n=o[u].call(this,n);return n}}}function ur(n,t){
+return function(r,e,u){return typeof e=="function"&&u===w&&Oo(r)?n(r,e):t(r,Bt(e,u,3))}}function or(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Bt(r,e,3)),n(t,r,Re)}}function ir(n){return function(t,r,e){return(typeof r!="function"||e!==w)&&(r=Bt(r,e,3)),n(t,r)}}function fr(n){return function(t,r,e){var u={};return r=wr(r,e,3),_t(t,function(t,e,o){o=r(t,e,o),e=n?o:e,t=n?t:o,u[e]=t}),u}}function ar(n){return function(t,r,e){return t=u(t),(n?t:"")+pr(t,r,e)+(n?"":t)}}function cr(n){
+var t=le(function(r,e){var u=v(e,t.placeholder);return gr(r,n,w,e,u)});return t}function lr(n,t){return function(r,e,u,o){var i=3>arguments.length;return typeof e=="function"&&o===w&&Oo(r)?n(r,e,u,i):Ot(r,wr(e,o,4),u,i,t)}}function sr(n,t,r,e,u,o,i,f,a,c){function l(){for(var m=arguments.length,b=m,j=Be(m);b--;)j[b]=arguments[b];if(e&&(j=Mt(j,e,u)),o&&(j=qt(j,o,i)),_||y){var b=l.placeholder,k=v(j,b),m=m-k.length;if(m<c){var I=f?qn(f):w,m=bu(c-m,0),E=_?k:w,k=_?w:k,C=_?j:w,j=_?w:j;return t|=_?R:O,t&=~(_?O:R),
+g||(t&=~(x|A)),j=[n,t,r,C,E,j,k,I,a,m],I=sr.apply(w,j),$r(n)&&Du(I,j),I.placeholder=b,I}}if(b=p?r:this,I=h?b[n]:n,f)for(m=j.length,E=xu(f.length,m),k=qn(j);E--;)C=f[E],j[E]=Cr(C,m)?k[C]:w;return s&&a<j.length&&(j.length=a),this&&this!==Zn&&this instanceof l&&(I=d||Jt(n)),I.apply(b,j)}var s=t&E,p=t&x,h=t&A,_=t&k,g=t&j,y=t&I,d=h?w:Jt(n);return l}function pr(n,t,r){return n=n.length,t=+t,n<t&&mu(t)?(t-=n,r=null==r?" ":r+"",Ue(r,vu(t/r.length)).slice(0,t)):""}function hr(n,t,r,e){function u(){for(var t=-1,f=arguments.length,a=-1,c=e.length,l=Be(c+f);++a<c;)l[a]=e[a];
+for(;f--;)l[a++]=arguments[++t];return(this&&this!==Zn&&this instanceof u?i:n).apply(o?r:this,l)}var o=t&x,i=Jt(n);return u}function _r(n){var t=Pe[n];return function(n,r){return(r=r===w?0:+r||0)?(r=au(10,r),t(n*r)/r):t(n)}}function vr(n){return function(t,r,e,u){var o=wr(e);return null==e&&o===ut?Lt(t,r,n):zt(t,r,o(e,u,1),n)}}function gr(n,t,r,e,u,o,i,f){var a=t&A;if(!a&&typeof n!="function")throw new Ge(L);var c=e?e.length:0;if(c||(t&=~(R|O),e=u=w),c-=u?u.length:0,t&O){var l=e,s=u;e=u=w}var p=a?w:zu(n);
+return r=[n,t,r,e,u,l,s,o,i,f],p&&(e=r[1],t=p[1],f=e|t,u=t==E&&e==k||t==E&&e==C&&r[7].length<=p[8]||t==(E|C)&&e==k,(f<E||u)&&(t&x&&(r[2]=p[2],f|=e&x?0:j),(e=p[3])&&(u=r[3],r[3]=u?Mt(u,e,p[4]):qn(e),r[4]=u?v(r[3],z):qn(p[4])),(e=p[5])&&(u=r[5],r[5]=u?qt(u,e,p[6]):qn(e),r[6]=u?v(r[5],z):qn(p[6])),(e=p[7])&&(r[7]=qn(e)),t&E&&(r[8]=null==r[8]?p[8]:xu(r[8],p[8])),null==r[9]&&(r[9]=p[9]),r[0]=p[0],r[1]=f),t=r[1],f=r[9]),r[9]=null==f?a?0:n.length:bu(f-c,0)||0,(p?Lu:Du)(t==x?Yt(r[0],r[2]):t!=R&&t!=(x|R)||r[4].length?sr.apply(w,r):hr.apply(w,r),r);
+}function yr(n,t,r,e,u,o,i){var f=-1,a=n.length,c=t.length;if(a!=c&&(!u||c<=a))return false;for(;++f<a;){var l=n[f],c=t[f],s=e?e(u?c:l,u?l:c,f):w;if(s!==w){if(s)continue;return false}if(u){if(!Hn(t,function(n){return l===n||r(l,n,e,u,o,i)}))return false}else if(l!==c&&!r(l,c,e,u,o,i))return false}return true}function dr(n,t,r){switch(r){case M:case q:return+n==+t;case P:return n.name==t.name&&n.message==t.message;case V:return n!=+n?t!=+t:n==+t;case Y:case G:return n==t+""}return false}function mr(n,t,r,e,u,o,i){var f=zo(n),a=f.length,c=zo(t).length;
+if(a!=c&&!u)return false;for(c=a;c--;){var l=f[c];if(!(u?l in t:nu.call(t,l)))return false}for(var s=u;++c<a;){var l=f[c],p=n[l],h=t[l],_=e?e(u?h:p,u?p:h,l):w;if(_===w?!r(p,h,e,u,o,i):!_)return false;s||(s="constructor"==l)}return s||(r=n.constructor,e=t.constructor,!(r!=e&&"constructor"in n&&"constructor"in t)||typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)?true:false}function wr(n,t,r){var e=Nn.callback||Se,e=e===Se?ut:e;return r?e(n,t,r):e}function br(n){for(var t=n.name+"",r=Wu[t],e=r?r.length:0;e--;){
+var u=r[e],o=u.func;if(null==o||o==n)return u.name}return t}function xr(n,t,e){var u=Nn.indexOf||Vr,u=u===Vr?r:u;return n?u(n,t,e):u}function Ar(n){n=Oe(n);for(var t=n.length;t--;){var r=n[t][1];n[t][2]=r===r&&!ge(r)}return n}function jr(n,t){var r=null==n?w:n[t];return ye(r)?r:w}function kr(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&nu.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ir(n){return n=n.constructor,typeof n=="function"&&n instanceof n||(n=Ve),
+new n}function Rr(n,t,r){var e=n.constructor;switch(t){case J:return Dt(n);case M:case q:return new e(+n);case X:case H:case Q:case nn:case tn:case rn:case en:case un:case on:return t=n.buffer,new e(r?Dt(t):t,n.byteOffset,n.length);case V:case G:return new e(n);case Y:var u=new e(n.source,kn.exec(n));u.lastIndex=n.lastIndex}return u}function Or(n,t,r){return null==n||Wr(t,n)||(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),t=Zr(t)),t=null==n?n:n[t],null==t?w:t.apply(n,r)}function Er(n){return null!=n&&Sr(Bu(n));
+}function Cr(n,t){return n=typeof n=="number"||On.test(n)?+n:-1,t=null==t?Cu:t,-1<n&&0==n%1&&n<t}function Ur(n,t,r){if(!ge(r))return false;var e=typeof t;return("number"==e?Er(r)&&Cr(t,r.length):"string"==e&&t in r)?(t=r[t],n===n?n===t:t!==t):false}function Wr(n,t){var r=typeof n;return"string"==r&&dn.test(n)||"number"==r?true:Oo(n)?false:!yn.test(n)||null!=t&&n in Br(t)}function $r(n){var t=br(n),r=Nn[t];return typeof r=="function"&&t in zn.prototype?n===r?true:(t=zu(r),!!t&&n===t[0]):false}function Sr(n){return typeof n=="number"&&-1<n&&0==n%1&&n<=Cu;
+}function Fr(n,t){return n===w?t:Eo(n,t,Fr)}function Nr(n,t){n=Br(n);for(var r=-1,e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u}function Tr(n,t){var r={};return ht(n,function(n,e,u){t(n,e,u)&&(r[e]=n)}),r}function Lr(n){for(var t=Re(n),r=t.length,e=r&&n.length,u=!!e&&Sr(e)&&(Oo(n)||pe(n)),o=-1,i=[];++o<r;){var f=t[o];(u&&Cr(f,e)||nu.call(n,f))&&i.push(f)}return i}function zr(n){return null==n?[]:Er(n)?ge(n)?n:Ve(n):Ee(n)}function Br(n){return ge(n)?n:Ve(n)}function Dr(n){if(Oo(n))return n;
+var t=[];return u(n).replace(mn,function(n,r,e,u){t.push(e?u.replace(An,"$1"):r||n)}),t}function Mr(n){return n instanceof zn?n.clone():new Ln(n.__wrapped__,n.__chain__,qn(n.__actions__))}function qr(n,t,r){return n&&n.length?((r?Ur(n,t,r):null==t)&&(t=1),Et(n,0>t?0:t)):[]}function Pr(n,t,r){var e=n?n.length:0;return e?((r?Ur(n,t,r):null==t)&&(t=1),t=e-(+t||0),Et(n,0,0>t?0:t)):[]}function Kr(n){return n?n[0]:w}function Vr(n,t,e){var u=n?n.length:0;if(!u)return-1;if(typeof e=="number")e=0>e?bu(u+e,0):e;else if(e)return e=Lt(n,t),
+e<u&&(t===t?t===n[e]:n[e]!==n[e])?e:-1;return r(n,t,e||0)}function Zr(n){var t=n?n.length:0;return t?n[t-1]:w}function Yr(n){return qr(n,1)}function Gr(n,t,e,u){if(!n||!n.length)return[];null!=t&&typeof t!="boolean"&&(u=e,e=Ur(n,t,u)?w:t,t=false);var o=wr();if((null!=e||o!==ut)&&(e=o(e,u,3)),t&&xr()===r){t=e;var i;e=-1,u=n.length;for(var o=-1,f=[];++e<u;){var a=n[e],c=t?t(a,e,n):a;e&&i===c||(i=c,f[++o]=a)}n=f}else n=St(n,e);return n}function Jr(n){if(!n||!n.length)return[];var t=-1,r=0;n=Vn(n,function(n){
+return Er(n)?(r=bu(n.length,r),true):void 0});for(var e=Be(r);++t<r;)e[t]=Gn(n,jt(t));return e}function Xr(n,t,r){return n&&n.length?(n=Jr(n),null==t?n:(t=Bt(t,r,4),Gn(n,function(n){return Xn(n,t,w,true)}))):[]}function Hr(n,t){var r=-1,e=n?n.length:0,u={};for(!e||t||Oo(n[0])||(t=[]);++r<e;){var o=n[r];t?u[o]=t[r]:o&&(u[o[0]]=o[1])}return u}function Qr(n){return n=Nn(n),n.__chain__=true,n}function ne(n,t,r){return t.call(r,n)}function te(n,t,r){var e=Oo(n)?Kn:at;return r&&Ur(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=wr(t,r,3)),
+e(n,t)}function re(n,t,r){var e=Oo(n)?Vn:lt;return t=wr(t,r,3),e(n,t)}function ee(n,t,r,e){var u=n?Bu(n):0;return Sr(u)||(n=Ee(n),u=n.length),r=typeof r!="number"||e&&Ur(t,r,e)?0:0>r?bu(u+r,0):r||0,typeof n=="string"||!Oo(n)&&be(n)?r<=u&&-1<n.indexOf(t,r):!!u&&-1<xr(n,t,r)}function ue(n,t,r){var e=Oo(n)?Gn:wt;return t=wr(t,r,3),e(n,t)}function oe(n,t,r){if(r?Ur(n,t,r):null==t){n=zr(n);var e=n.length;return 0<e?n[Rt(0,e-1)]:w}r=-1,n=je(n);var e=n.length,u=e-1;for(t=xu(0>t?0:+t||0,e);++r<t;){var e=Rt(r,u),o=n[e];
+n[e]=n[r],n[r]=o}return n.length=t,n}function ie(n,t,r){var e=Oo(n)?Hn:Ct;return r&&Ur(n,t,r)&&(t=w),(typeof t!="function"||r!==w)&&(t=wr(t,r,3)),e(n,t)}function fe(n,t){var r;if(typeof t!="function"){if(typeof n!="function")throw new Ge(L);var e=n;n=t,t=e}return function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=w),r}}function ae(n,t,r){function e(t,r){r&&iu(r),a=p=h=w,t&&(_=ho(),c=n.apply(s,f),p||a||(f=s=w))}function u(){var n=t-(ho()-l);0>=n||n>t?e(h,a):p=su(u,n)}function o(){e(g,p);
+}function i(){if(f=arguments,l=ho(),s=this,h=g&&(p||!y),false===v)var r=y&&!p;else{a||y||(_=l);var e=v-(l-_),i=0>=e||e>v;i?(a&&(a=iu(a)),_=l,c=n.apply(s,f)):a||(a=su(o,e))}return i&&p?p=iu(p):p||t===v||(p=su(u,t)),r&&(i=true,c=n.apply(s,f)),!i||p||a||(f=s=w),c}var f,a,c,l,s,p,h,_=0,v=false,g=true;if(typeof n!="function")throw new Ge(L);if(t=0>t?0:+t||0,true===r)var y=true,g=false;else ge(r)&&(y=!!r.leading,v="maxWait"in r&&bu(+r.maxWait||0,t),g="trailing"in r?!!r.trailing:g);return i.cancel=function(){p&&iu(p),a&&iu(a),
+_=0,a=p=h=w},i}function ce(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new Ge(L);return r.cache=new ce.Cache,r}function le(n,t){if(typeof n!="function")throw new Ge(L);return t=bu(t===w?n.length-1:+t||0,0),function(){for(var r=arguments,e=-1,u=bu(r.length-t,0),o=Be(u);++e<u;)o[e]=r[t+e];switch(t){case 0:return n.call(this,o);case 1:return n.call(this,r[0],o);
+case 2:return n.call(this,r[0],r[1],o)}for(u=Be(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function se(n,t){return n>t}function pe(n){return h(n)&&Er(n)&&nu.call(n,"callee")&&!cu.call(n,"callee")}function he(n,t,r,e){return e=(r=typeof r=="function"?Bt(r,e,3):w)?r(n,t):w,e===w?dt(n,t,r):!!e}function _e(n){return h(n)&&typeof n.message=="string"&&ru.call(n)==P}function ve(n){return ge(n)&&ru.call(n)==K}function ge(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function ye(n){
+return null==n?false:ve(n)?uu.test(Qe.call(n)):h(n)&&Rn.test(n)}function de(n){return typeof n=="number"||h(n)&&ru.call(n)==V}function me(n){var t;if(!h(n)||ru.call(n)!=Z||pe(n)||!(nu.call(n,"constructor")||(t=n.constructor,typeof t!="function"||t instanceof t)))return false;var r;return ht(n,function(n,t){r=t}),r===w||nu.call(n,r)}function we(n){return ge(n)&&ru.call(n)==Y}function be(n){return typeof n=="string"||h(n)&&ru.call(n)==G}function xe(n){return h(n)&&Sr(n.length)&&!!Sn[ru.call(n)]}function Ae(n,t){
+return n<t}function je(n){var t=n?Bu(n):0;return Sr(t)?t?qn(n):[]:Ee(n)}function ke(n){return et(n,Re(n))}function Ie(n){return gt(n,Re(n))}function Re(n){if(null==n)return[];ge(n)||(n=Ve(n));for(var t=n.length,t=t&&Sr(t)&&(Oo(n)||pe(n))&&t||0,r=n.constructor,e=-1,r=typeof r=="function"&&r.prototype===n,u=Be(t),o=0<t;++e<t;)u[e]=e+"";for(var i in n)o&&Cr(i,t)||"constructor"==i&&(r||!nu.call(n,i))||u.push(i);return u}function Oe(n){n=Br(n);for(var t=-1,r=zo(n),e=r.length,u=Be(e);++t<e;){var o=r[t];
+u[t]=[o,n[o]]}return u}function Ee(n){return Ft(n,zo(n))}function Ce(n){return(n=u(n))&&n.replace(En,a).replace(xn,"")}function Ue(n,t){var r="";if(n=u(n),t=+t,1>t||!n||!mu(t))return r;do t%2&&(r+=n),t=yu(t/2),n+=n;while(t);return r}function We(n,t,r){var e=n;return(n=u(n))?(r?Ur(e,t,r):null==t)?n.slice(g(n),y(n)+1):(t+="",n.slice(o(n,t),i(n,t)+1)):n}function $e(n,t,r){return r&&Ur(n,t,r)&&(t=w),n=u(n),n.match(t||Wn)||[]}function Se(n,t,r){return r&&Ur(n,t,r)&&(t=w),h(n)?Ne(n):ut(n,t)}function Fe(n){
+return n}function Ne(n){return bt(ot(n,true))}function Te(n,t,r){if(null==r){var e=ge(t),u=e?zo(t):w;((u=u&&u.length?gt(t,u):w)?u.length:e)||(u=false,r=t,t=n,n=this)}u||(u=gt(t,zo(t)));var o=true,e=-1,i=ve(n),f=u.length;false===r?o=false:ge(r)&&"chain"in r&&(o=r.chain);for(;++e<f;){r=u[e];var a=t[r];n[r]=a,i&&(n.prototype[r]=function(t){return function(){var r=this.__chain__;if(o||r){var e=n(this.__wrapped__);return(e.__actions__=qn(this.__actions__)).push({func:t,args:arguments,thisArg:n}),e.__chain__=r,e}return t.apply(n,Jn([this.value()],arguments));
+}}(a))}return n}function Le(){}function ze(n){return Wr(n)?jt(n):kt(n)}_=_?Yn.defaults(Zn.Object(),_,Yn.pick(Zn,$n)):Zn;var Be=_.Array,De=_.Date,Me=_.Error,qe=_.Function,Pe=_.Math,Ke=_.Number,Ve=_.Object,Ze=_.RegExp,Ye=_.String,Ge=_.TypeError,Je=Be.prototype,Xe=Ve.prototype,He=Ye.prototype,Qe=qe.prototype.toString,nu=Xe.hasOwnProperty,tu=0,ru=Xe.toString,eu=Zn._,uu=Ze("^"+Qe.call(nu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ou=_.ArrayBuffer,iu=_.clearTimeout,fu=_.parseFloat,au=Pe.pow,cu=Xe.propertyIsEnumerable,lu=jr(_,"Set"),su=_.setTimeout,pu=Je.splice,hu=_.Uint8Array,_u=jr(_,"WeakMap"),vu=Pe.ceil,gu=jr(Ve,"create"),yu=Pe.floor,du=jr(Be,"isArray"),mu=_.isFinite,wu=jr(Ve,"keys"),bu=Pe.max,xu=Pe.min,Au=jr(De,"now"),ju=_.parseInt,ku=Pe.random,Iu=Ke.NEGATIVE_INFINITY,Ru=Ke.POSITIVE_INFINITY,Ou=4294967294,Eu=2147483647,Cu=9007199254740991,Uu=_u&&new _u,Wu={};
+Nn.support={},Nn.templateSettings={escape:_n,evaluate:vn,interpolate:gn,variable:"",imports:{_:Nn}};var $u=function(){function n(){}return function(t){if(ge(t)){n.prototype=t;var r=new n;n.prototype=w}return r||{}}}(),Su=Vt(_t),Fu=Vt(vt,true),Nu=Zt(),Tu=Zt(true),Lu=Uu?function(n,t){return Uu.set(n,t),n}:Fe,zu=Uu?function(n){return Uu.get(n)}:Le,Bu=jt("length"),Du=function(){var n=0,t=0;return function(r,e){var u=ho(),o=S-(u-t);if(t=u,0<o){if(++n>=$)return r}else n=0;return Lu(r,e)}}(),Mu=le(function(n,t){
+return h(n)&&Er(n)?ft(n,pt(t,false,true)):[]}),qu=tr(),Pu=tr(true),Ku=le(function(n){for(var t=n.length,e=t,u=Be(l),o=xr(),i=o===r,f=[];e--;){var a=n[e]=Er(a=n[e])?a:[];u[e]=i&&120<=a.length&&gu&&lu?new Dn(e&&a):null}var i=n[0],c=-1,l=i?i.length:0,s=u[0];n:for(;++c<l;)if(a=i[c],0>(s?Mn(s,a):o(f,a,0))){for(e=t;--e;){var p=u[e];if(0>(p?Mn(p,a):o(n[e],a,0)))continue n}s&&s.push(a),f.push(a)}return f}),Vu=le(function(t,r){r=pt(r);var e=rt(t,r);return It(t,r.sort(n)),e}),Zu=vr(),Yu=vr(true),Gu=le(function(n){return St(pt(n,false,true));
+}),Ju=le(function(n,t){return Er(n)?ft(n,t):[]}),Xu=le(Jr),Hu=le(function(n){var t=n.length,r=2<t?n[t-2]:w,e=1<t?n[t-1]:w;return 2<t&&typeof r=="function"?t-=2:(r=1<t&&typeof e=="function"?(--t,e):w,e=w),n.length=t,Xr(n,r,e)}),Qu=le(function(n){return n=pt(n),this.thru(function(t){t=Oo(t)?t:[Br(t)];for(var r=n,e=-1,u=t.length,o=-1,i=r.length,f=Be(u+i);++e<u;)f[e]=t[e];for(;++o<i;)f[e++]=r[o];return f})}),no=le(function(n,t){return rt(n,pt(t))}),to=Pt(function(n,t,r){nu.call(n,r)?++n[r]:n[r]=1}),ro=nr(Su),eo=nr(Fu,true),uo=ur(Pn,Su),oo=ur(function(n,t){
+for(var r=n.length;r--&&false!==t(n[r],r,n););return n},Fu),io=Pt(function(n,t,r){nu.call(n,r)?n[r].push(t):n[r]=[t]}),fo=Pt(function(n,t,r){n[r]=t}),ao=le(function(n,t,r){var e=-1,u=typeof t=="function",o=Wr(t),i=Er(n)?Be(n.length):[];return Su(n,function(n){var f=u?t:o&&null!=n?n[t]:w;i[++e]=f?f.apply(n,r):Or(n,t,r)}),i}),co=Pt(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),lo=lr(Xn,Su),so=lr(function(n,t,r,e){var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r},Fu),po=le(function(n,t){
+if(null==n)return[];var r=t[2];return r&&Ur(t[0],t[1],r)&&(t.length=1),Wt(n,pt(t),[])}),ho=Au||function(){return(new De).getTime()},_o=le(function(n,t,r){var e=x;if(r.length)var u=v(r,_o.placeholder),e=e|R;return gr(n,e,t,r,u)}),vo=le(function(n,t){t=t.length?pt(t):Ie(n);for(var r=-1,e=t.length;++r<e;){var u=t[r];n[u]=gr(n[u],x,n)}return n}),go=le(function(n,t,r){var e=x|A;if(r.length)var u=v(r,go.placeholder),e=e|R;return gr(t,e,n,r,u)}),yo=Xt(k),mo=Xt(I),wo=le(function(n,t){return it(n,1,t)}),bo=le(function(n,t,r){
+return it(n,t,r)}),xo=er(),Ao=er(true),jo=le(function(n,t){if(t=pt(t),typeof n!="function"||!Kn(t,e))throw new Ge(L);var r=t.length;return le(function(e){for(var u=xu(e.length,r);u--;)e[u]=t[u](e[u]);return n.apply(this,e)})}),ko=cr(R),Io=cr(O),Ro=le(function(n,t){return gr(n,C,w,w,w,pt(t))}),Oo=du||function(n){return h(n)&&Sr(n.length)&&ru.call(n)==D},Eo=Kt(At),Co=Kt(function(n,t,r){return r?nt(n,t,r):tt(n,t)}),Uo=Ht(Co,function(n,t){return n===w?t:n}),Wo=Ht(Eo,Fr),$o=rr(_t),So=rr(vt),Fo=or(Nu),No=or(Tu),To=ir(_t),Lo=ir(vt),zo=wu?function(n){
+var t=null==n?w:n.constructor;return typeof t=="function"&&t.prototype===n||typeof n!="function"&&Er(n)?Lr(n):ge(n)?wu(n):[]}:Lr,Bo=fr(true),Do=fr(),Mo=le(function(n,t){if(null==n)return{};if("function"!=typeof t[0])return t=Gn(pt(t),Ye),Nr(n,ft(Re(n),t));var r=Bt(t[0],t[1],3);return Tr(n,function(n,t,e){return!r(n,t,e)})}),qo=le(function(n,t){return null==n?{}:"function"==typeof t[0]?Tr(n,Bt(t[0],t[1],3)):Nr(n,pt(t))}),Po=Gt(function(n,t,r){return t=t.toLowerCase(),n+(r?t.charAt(0).toUpperCase()+t.slice(1):t);
+}),Ko=Gt(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Vo=ar(),Zo=ar(true),Yo=Gt(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Go=Gt(function(n,t,r){return n+(r?" ":"")+(t.charAt(0).toUpperCase()+t.slice(1))}),Jo=le(function(n,t){try{return n.apply(w,t)}catch(r){return _e(r)?r:new Me(r)}}),Xo=le(function(n,t){return function(r){return Or(r,n,t)}}),Ho=le(function(n,t){return function(r){return Or(n,r,t)}}),Qo=_r("ceil"),ni=_r("floor"),ti=Qt(se,Iu),ri=Qt(Ae,Ru),ei=_r("round");return Nn.prototype=Tn.prototype,
+Ln.prototype=$u(Tn.prototype),Ln.prototype.constructor=Ln,zn.prototype=$u(Tn.prototype),zn.prototype.constructor=zn,Bn.prototype["delete"]=function(n){return this.has(n)&&delete this.__data__[n]},Bn.prototype.get=function(n){return"__proto__"==n?w:this.__data__[n]},Bn.prototype.has=function(n){return"__proto__"!=n&&nu.call(this.__data__,n)},Bn.prototype.set=function(n,t){return"__proto__"!=n&&(this.__data__[n]=t),this},Dn.prototype.push=function(n){var t=this.data;typeof n=="string"||ge(n)?t.set.add(n):t.hash[n]=true;
+},ce.Cache=Bn,Nn.after=function(n,t){if(typeof t!="function"){if(typeof n!="function")throw new Ge(L);var r=n;n=t,t=r}return n=mu(n=+n)?n:0,function(){return 1>--n?t.apply(this,arguments):void 0}},Nn.ary=function(n,t,r){return r&&Ur(n,t,r)&&(t=w),t=n&&null==t?n.length:bu(+t||0,0),gr(n,E,w,w,w,w,t)},Nn.assign=Co,Nn.at=no,Nn.before=fe,Nn.bind=_o,Nn.bindAll=vo,Nn.bindKey=go,Nn.callback=Se,Nn.chain=Qr,Nn.chunk=function(n,t,r){t=(r?Ur(n,t,r):null==t)?1:bu(yu(t)||1,1),r=0;for(var e=n?n.length:0,u=-1,o=Be(vu(e/t));r<e;)o[++u]=Et(n,r,r+=t);
+return o},Nn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){var o=n[t];o&&(u[++e]=o)}return u},Nn.constant=function(n){return function(){return n}},Nn.countBy=to,Nn.create=function(n,t,r){var e=$u(n);return r&&Ur(n,t,r)&&(t=w),t?tt(e,t):e},Nn.curry=yo,Nn.curryRight=mo,Nn.debounce=ae,Nn.defaults=Uo,Nn.defaultsDeep=Wo,Nn.defer=wo,Nn.delay=bo,Nn.difference=Mu,Nn.drop=qr,Nn.dropRight=Pr,Nn.dropRightWhile=function(n,t,r){return n&&n.length?Nt(n,wr(t,r,3),true,true):[]},Nn.dropWhile=function(n,t,r){
+return n&&n.length?Nt(n,wr(t,r,3),true):[]},Nn.fill=function(n,t,r,e){var u=n?n.length:0;if(!u)return[];for(r&&typeof r!="number"&&Ur(n,t,r)&&(r=0,e=u),u=n.length,r=null==r?0:+r||0,0>r&&(r=-r>u?0:u+r),e=e===w||e>u?u:+e||0,0>e&&(e+=u),u=r>e?0:e>>>0,r>>>=0;r<u;)n[r++]=t;return n},Nn.filter=re,Nn.flatten=function(n,t,r){var e=n?n.length:0;return r&&Ur(n,t,r)&&(t=false),e?pt(n,t):[]},Nn.flattenDeep=function(n){return n&&n.length?pt(n,true):[]},Nn.flow=xo,Nn.flowRight=Ao,Nn.forEach=uo,Nn.forEachRight=oo,Nn.forIn=Fo,
+Nn.forInRight=No,Nn.forOwn=To,Nn.forOwnRight=Lo,Nn.functions=Ie,Nn.groupBy=io,Nn.indexBy=fo,Nn.initial=function(n){return Pr(n,1)},Nn.intersection=Ku,Nn.invert=function(n,t,r){r&&Ur(n,t,r)&&(t=w),r=-1;for(var e=zo(n),u=e.length,o={};++r<u;){var i=e[r],f=n[i];t?nu.call(o,f)?o[f].push(i):o[f]=[i]:o[f]=i}return o},Nn.invoke=ao,Nn.keys=zo,Nn.keysIn=Re,Nn.map=ue,Nn.mapKeys=Bo,Nn.mapValues=Do,Nn.matches=Ne,Nn.matchesProperty=function(n,t){return xt(n,ot(t,true))},Nn.memoize=ce,Nn.merge=Eo,Nn.method=Xo,Nn.methodOf=Ho,
+Nn.mixin=Te,Nn.modArgs=jo,Nn.negate=function(n){if(typeof n!="function")throw new Ge(L);return function(){return!n.apply(this,arguments)}},Nn.omit=Mo,Nn.once=function(n){return fe(2,n)},Nn.pairs=Oe,Nn.partial=ko,Nn.partialRight=Io,Nn.partition=co,Nn.pick=qo,Nn.pluck=function(n,t){return ue(n,ze(t))},Nn.property=ze,Nn.propertyOf=function(n){return function(t){return yt(n,Dr(t),t+"")}},Nn.pull=function(){var n=arguments,t=n[0];if(!t||!t.length)return t;for(var r=0,e=xr(),u=n.length;++r<u;)for(var o=0,i=n[r];-1<(o=e(t,i,o));)pu.call(t,o,1);
+return t},Nn.pullAt=Vu,Nn.range=function(n,t,r){r&&Ur(n,t,r)&&(t=r=w),n=+n||0,r=null==r?1:+r||0,null==t?(t=n,n=0):t=+t||0;var e=-1;t=bu(vu((t-n)/(r||1)),0);for(var u=Be(t);++e<t;)u[e]=n,n+=r;return u},Nn.rearg=Ro,Nn.reject=function(n,t,r){var e=Oo(n)?Vn:lt;return t=wr(t,r,3),e(n,function(n,r,e){return!t(n,r,e)})},Nn.remove=function(n,t,r){var e=[];if(!n||!n.length)return e;var u=-1,o=[],i=n.length;for(t=wr(t,r,3);++u<i;)r=n[u],t(r,u,n)&&(e.push(r),o.push(u));return It(n,o),e},Nn.rest=Yr,Nn.restParam=le,
+Nn.set=function(n,t,r){if(null==n)return n;var e=t+"";t=null!=n[e]||Wr(t,n)?[e]:Dr(t);for(var e=-1,u=t.length,o=u-1,i=n;null!=i&&++e<u;){var f=t[e];ge(i)&&(e==o?i[f]=r:null==i[f]&&(i[f]=Cr(t[e+1])?[]:{})),i=i[f]}return n},Nn.shuffle=function(n){return oe(n,Ru)},Nn.slice=function(n,t,r){var e=n?n.length:0;return e?(r&&typeof r!="number"&&Ur(n,t,r)&&(t=0,r=e),Et(n,t,r)):[]},Nn.sortBy=function(n,t,r){if(null==n)return[];r&&Ur(n,t,r)&&(t=w);var e=-1;return t=wr(t,r,3),n=wt(n,function(n,r,u){return{a:t(n,r,u),
+b:++e,c:n}}),Ut(n,f)},Nn.sortByAll=po,Nn.sortByOrder=function(n,t,r,e){return null==n?[]:(e&&Ur(t,r,e)&&(r=w),Oo(t)||(t=null==t?[]:[t]),Oo(r)||(r=null==r?[]:[r]),Wt(n,t,r))},Nn.spread=function(n){if(typeof n!="function")throw new Ge(L);return function(t){return n.apply(this,t)}},Nn.take=function(n,t,r){return n&&n.length?((r?Ur(n,t,r):null==t)&&(t=1),Et(n,0,0>t?0:t)):[]},Nn.takeRight=function(n,t,r){var e=n?n.length:0;return e?((r?Ur(n,t,r):null==t)&&(t=1),t=e-(+t||0),Et(n,0>t?0:t)):[]},Nn.takeRightWhile=function(n,t,r){
+return n&&n.length?Nt(n,wr(t,r,3),false,true):[]},Nn.takeWhile=function(n,t,r){return n&&n.length?Nt(n,wr(t,r,3)):[]},Nn.tap=function(n,t,r){return t.call(r,n),n},Nn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new Ge(L);return false===r?e=false:ge(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ae(n,t,{leading:e,maxWait:+t,trailing:u})},Nn.thru=ne,Nn.times=function(n,t,r){if(n=yu(n),1>n||!mu(n))return[];var e=-1,u=Be(xu(n,4294967295));for(t=Bt(t,r,1);++e<n;)4294967295>e?u[e]=t(e):t(e);
+return u},Nn.toArray=je,Nn.toPlainObject=ke,Nn.transform=function(n,t,r,e){var u=Oo(n)||xe(n);return t=wr(t,e,4),null==r&&(u||ge(n)?(e=n.constructor,r=u?Oo(n)?new e:[]:$u(ve(e)?e.prototype:w)):r={}),(u?Pn:_t)(n,function(n,e,u){return t(r,n,e,u)}),r},Nn.union=Gu,Nn.uniq=Gr,Nn.unzip=Jr,Nn.unzipWith=Xr,Nn.values=Ee,Nn.valuesIn=function(n){return Ft(n,Re(n))},Nn.where=function(n,t){return re(n,bt(t))},Nn.without=Ju,Nn.wrap=function(n,t){return t=null==t?Fe:t,gr(t,R,w,[n],[])},Nn.xor=function(){for(var n=-1,t=arguments.length;++n<t;){
+var r=arguments[n];if(Er(r))var e=e?Jn(ft(e,r),ft(r,e)):r}return e?St(e):[]},Nn.zip=Xu,Nn.zipObject=Hr,Nn.zipWith=Hu,Nn.backflow=Ao,Nn.collect=ue,Nn.compose=Ao,Nn.each=uo,Nn.eachRight=oo,Nn.extend=Co,Nn.iteratee=Se,Nn.methods=Ie,Nn.object=Hr,Nn.select=re,Nn.tail=Yr,Nn.unique=Gr,Te(Nn,Nn),Nn.add=function(n,t){return(+n||0)+(+t||0)},Nn.attempt=Jo,Nn.camelCase=Po,Nn.capitalize=function(n){return(n=u(n))&&n.charAt(0).toUpperCase()+n.slice(1)},Nn.ceil=Qo,Nn.clone=function(n,t,r,e){return t&&typeof t!="boolean"&&Ur(n,t,r)?t=false:typeof t=="function"&&(e=r,
+r=t,t=false),typeof r=="function"?ot(n,t,Bt(r,e,3)):ot(n,t)},Nn.cloneDeep=function(n,t,r){return typeof t=="function"?ot(n,true,Bt(t,r,3)):ot(n,true)},Nn.deburr=Ce,Nn.endsWith=function(n,t,r){n=u(n),t+="";var e=n.length;return r=r===w?e:xu(0>r?0:+r||0,e),r-=t.length,0<=r&&n.indexOf(t,r)==r},Nn.escape=function(n){return(n=u(n))&&hn.test(n)?n.replace(sn,c):n},Nn.escapeRegExp=function(n){return(n=u(n))&&bn.test(n)?n.replace(wn,l):n||"(?:)"},Nn.every=te,Nn.find=ro,Nn.findIndex=qu,Nn.findKey=$o,Nn.findLast=eo,
+Nn.findLastIndex=Pu,Nn.findLastKey=So,Nn.findWhere=function(n,t){return ro(n,bt(t))},Nn.first=Kr,Nn.floor=ni,Nn.get=function(n,t,r){return n=null==n?w:yt(n,Dr(t),t+""),n===w?r:n},Nn.gt=se,Nn.gte=function(n,t){return n>=t},Nn.has=function(n,t){if(null==n)return false;var r=nu.call(n,t);if(!r&&!Wr(t)){if(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),null==n)return false;t=Zr(t),r=nu.call(n,t)}return r||Sr(n.length)&&Cr(t,n.length)&&(Oo(n)||pe(n))},Nn.identity=Fe,Nn.includes=ee,Nn.indexOf=Vr,Nn.inRange=function(n,t,r){
+return t=+t||0,r===w?(r=t,t=0):r=+r||0,n>=xu(t,r)&&n<bu(t,r)},Nn.isArguments=pe,Nn.isArray=Oo,Nn.isBoolean=function(n){return true===n||false===n||h(n)&&ru.call(n)==M},Nn.isDate=function(n){return h(n)&&ru.call(n)==q},Nn.isElement=function(n){return!!n&&1===n.nodeType&&h(n)&&!me(n)},Nn.isEmpty=function(n){return null==n?true:Er(n)&&(Oo(n)||be(n)||pe(n)||h(n)&&ve(n.splice))?!n.length:!zo(n).length},Nn.isEqual=he,Nn.isError=_e,Nn.isFinite=function(n){return typeof n=="number"&&mu(n)},Nn.isFunction=ve,Nn.isMatch=function(n,t,r,e){
+return r=typeof r=="function"?Bt(r,e,3):w,mt(n,Ar(t),r)},Nn.isNaN=function(n){return de(n)&&n!=+n},Nn.isNative=ye,Nn.isNull=function(n){return null===n},Nn.isNumber=de,Nn.isObject=ge,Nn.isPlainObject=me,Nn.isRegExp=we,Nn.isString=be,Nn.isTypedArray=xe,Nn.isUndefined=function(n){return n===w},Nn.kebabCase=Ko,Nn.last=Zr,Nn.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?bu(e+r,0):xu(r||0,e-1))+1;else if(r)return u=Lt(n,t,true)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;
+if(t!==t)return p(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Nn.lt=Ae,Nn.lte=function(n,t){return n<=t},Nn.max=ti,Nn.min=ri,Nn.noConflict=function(){return Zn._=eu,this},Nn.noop=Le,Nn.now=ho,Nn.pad=function(n,t,r){n=u(n),t=+t;var e=n.length;return e<t&&mu(t)?(e=(t-e)/2,t=yu(e),e=vu(e),r=pr("",e,r),r.slice(0,t)+n+r):n},Nn.padLeft=Vo,Nn.padRight=Zo,Nn.parseInt=function(n,t,r){return(r?Ur(n,t,r):null==t)?t=0:t&&(t=+t),n=We(n),ju(n,t||(In.test(n)?16:10))},Nn.random=function(n,t,r){r&&Ur(n,t,r)&&(t=r=w);
+var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=ku(),xu(n+r*(t-n+fu("1e-"+((r+"").length-1))),t)):Rt(n,t)},Nn.reduce=lo,Nn.reduceRight=so,Nn.repeat=Ue,Nn.result=function(n,t,r){var e=null==n?w:n[t];return e===w&&(null==n||Wr(t,n)||(t=Dr(t),n=1==t.length?n:yt(n,Et(t,0,-1)),e=null==n?w:n[Zr(t)]),e=e===w?r:e),ve(e)?e.call(n):e},Nn.round=ei,Nn.runInContext=m,Nn.size=function(n){var t=n?Bu(n):0;
+return Sr(t)?t:zo(n).length},Nn.snakeCase=Yo,Nn.some=ie,Nn.sortedIndex=Zu,Nn.sortedLastIndex=Yu,Nn.startCase=Go,Nn.startsWith=function(n,t,r){return n=u(n),r=null==r?0:xu(0>r?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Nn.sum=function(n,t,r){if(r&&Ur(n,t,r)&&(t=w),t=wr(t,r,3),1==t.length){n=Oo(n)?n:zr(n),r=n.length;for(var e=0;r--;)e+=+t(n[r])||0;n=e}else n=$t(n,t);return n},Nn.template=function(n,t,r){var e=Nn.templateSettings;r&&Ur(n,t,r)&&(t=r=w),n=u(n),t=nt(tt({},r||t),e,Qn),r=nt(tt({},t.imports),e.imports,Qn);
+var o,i,f=zo(r),a=Ft(r,f),c=0;r=t.interpolate||Cn;var l="__p+='";r=Ze((t.escape||Cn).source+"|"+r.source+"|"+(r===gn?jn:Cn).source+"|"+(t.evaluate||Cn).source+"|$","g");var p="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,u,f,a){return e||(e=u),l+=n.slice(c,a).replace(Un,s),r&&(o=true,l+="'+__e("+r+")+'"),f&&(i=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),c=a+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(i?l.replace(fn,""):l).replace(an,"$1").replace(cn,"$1;"),
+l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(o?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Jo(function(){return qe(f,p+"return "+l).apply(w,a)}),t.source=l,_e(t))throw t;return t},Nn.trim=We,Nn.trimLeft=function(n,t,r){var e=n;return(n=u(n))?n.slice((r?Ur(e,t,r):null==t)?g(n):o(n,t+"")):n},Nn.trimRight=function(n,t,r){var e=n;return(n=u(n))?(r?Ur(e,t,r):null==t)?n.slice(0,y(n)+1):n.slice(0,i(n,t+"")+1):n;
+},Nn.trunc=function(n,t,r){r&&Ur(n,t,r)&&(t=w);var e=U;if(r=W,null!=t)if(ge(t)){var o="separator"in t?t.separator:o,e="length"in t?+t.length||0:e;r="omission"in t?u(t.omission):r}else e=+t||0;if(n=u(n),e>=n.length)return n;if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==o)return t+r;if(we(o)){if(n.slice(e).search(o)){var i,f=n.slice(0,e);for(o.global||(o=Ze(o.source,(kn.exec(o)||"")+"g")),o.lastIndex=0;n=o.exec(f);)i=n.index;t=t.slice(0,null==i?e:i)}}else n.indexOf(o,e)!=e&&(o=t.lastIndexOf(o),
+-1<o&&(t=t.slice(0,o)));return t+r},Nn.unescape=function(n){return(n=u(n))&&pn.test(n)?n.replace(ln,d):n},Nn.uniqueId=function(n){var t=++tu;return u(n)+t},Nn.words=$e,Nn.all=te,Nn.any=ie,Nn.contains=ee,Nn.eq=he,Nn.detect=ro,Nn.foldl=lo,Nn.foldr=so,Nn.head=Kr,Nn.include=ee,Nn.inject=lo,Te(Nn,function(){var n={};return _t(Nn,function(t,r){Nn.prototype[r]||(n[r]=t)}),n}(),false),Nn.sample=oe,Nn.prototype.sample=function(n){return this.__chain__||null!=n?this.thru(function(t){return oe(t,n)}):oe(this.value());
+},Nn.VERSION=b,Pn("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Nn[n].placeholder=Nn}),Pn(["drop","take"],function(n,t){zn.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new zn(this);r=null==r?1:bu(yu(r)||0,0);var u=this.clone();return e?u.__takeCount__=xu(u.__takeCount__,r):u.__views__.push({size:r,type:n+(0>u.__dir__?"Right":"")}),u},zn.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Pn(["filter","map","takeWhile"],function(n,t){
+var r=t+1,e=r!=T;zn.prototype[n]=function(n,t){var u=this.clone();return u.__iteratees__.push({iteratee:wr(n,t,1),type:r}),u.__filtered__=u.__filtered__||e,u}}),Pn(["first","last"],function(n,t){var r="take"+(t?"Right":"");zn.prototype[n]=function(){return this[r](1).value()[0]}}),Pn(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");zn.prototype[n]=function(){return this.__filtered__?new zn(this):this[r](1)}}),Pn(["pluck","where"],function(n,t){var r=t?"filter":"map",e=t?bt:ze;zn.prototype[n]=function(n){
+return this[r](e(n))}}),zn.prototype.compact=function(){return this.filter(Fe)},zn.prototype.reject=function(n,t){return n=wr(n,t,1),this.filter(function(t){return!n(t)})},zn.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=this;return r.__filtered__&&(0<n||0>t)?new zn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==w&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r)},zn.prototype.takeRightWhile=function(n,t){return this.reverse().takeWhile(n,t).reverse()},zn.prototype.toArray=function(){return this.take(Ru);
+},_t(zn.prototype,function(n,t){var r=/^(?:filter|map|reject)|While$/.test(t),e=/^(?:first|last)$/.test(t),u=Nn[e?"take"+("last"==t?"Right":""):t];u&&(Nn.prototype[t]=function(){function t(n){return e&&i?u(n,1)[0]:u.apply(w,Jn([n],o))}var o=e?[1]:arguments,i=this.__chain__,f=this.__wrapped__,a=!!this.__actions__.length,c=f instanceof zn,l=o[0],s=c||Oo(f);return s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false),l={func:ne,args:[t],thisArg:w},a=c&&!a,e&&!i?a?(f=f.clone(),f.__actions__.push(l),n.call(f)):u.call(w,this.value())[0]:!e&&s?(f=a?f:new zn(this),
+f=n.apply(f,o),f.__actions__.push(l),new Ln(f,i)):this.thru(t)})}),Pn("join pop push replace shift sort splice split unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?He:Je)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|replace|shift)$/.test(n);Nn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),_t(zn.prototype,function(n,t){var r=Nn[t];if(r){var e=r.name+"";(Wu[e]||(Wu[e]=[])).push({
+name:t,func:r})}}),Wu[sr(w,A).name]=[{name:"wrapper",func:w}],zn.prototype.clone=function(){var n=new zn(this.__wrapped__);return n.__actions__=qn(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=qn(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=qn(this.__views__),n},zn.prototype.reverse=function(){if(this.__filtered__){var n=new zn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},zn.prototype.value=function(){
+var n,t=this.__wrapped__.value(),r=this.__dir__,e=Oo(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,a=-1,c=i.length;++a<c;){var l=i[a],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=xu(n,f+s);break;case"takeRight":f=bu(f,n-s)}}if(n={start:f,end:n},i=n.start,f=n.end,n=f-i,u=u?f:i-1,i=this.__iteratees__,f=i.length,a=0,c=xu(n,this.__takeCount__),!e||o<F||o==n&&c==n)return Tt(t,this.__actions__);e=[];n:for(;n--&&a<c;){for(u+=r,o=-1,l=t[u];++o<f;){var p=i[o],s=p.type,p=p.iteratee(l);
+if(s==T)l=p;else if(!p){if(s==N)continue n;break n}}e[a++]=l}return e},Nn.prototype.chain=function(){return Qr(this)},Nn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Nn.prototype.concat=Qu,Nn.prototype.plant=function(n){for(var t,r=this;r instanceof Tn;){var e=Mr(r);t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},Nn.prototype.reverse=function(){function n(n){return n.reverse()}var t=this.__wrapped__;return t instanceof zn?(this.__actions__.length&&(t=new zn(this)),
+t=t.reverse(),t.__actions__.push({func:ne,args:[n],thisArg:w}),new Ln(t,this.__chain__)):this.thru(n)},Nn.prototype.toString=function(){return this.value()+""},Nn.prototype.run=Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return Tt(this.__wrapped__,this.__actions__)},Nn.prototype.collect=Nn.prototype.map,Nn.prototype.head=Nn.prototype.first,Nn.prototype.select=Nn.prototype.filter,Nn.prototype.tail=Nn.prototype.rest,Nn}var w,b="3.10.1",x=1,A=2,j=4,k=8,I=16,R=32,O=64,E=128,C=256,U=30,W="...",$=150,S=16,F=200,N=1,T=2,L="Expected a function",z="__lodash_placeholder__",B="[object Arguments]",D="[object Array]",M="[object Boolean]",q="[object Date]",P="[object Error]",K="[object Function]",V="[object Number]",Z="[object Object]",Y="[object RegExp]",G="[object String]",J="[object ArrayBuffer]",X="[object Float32Array]",H="[object Float64Array]",Q="[object Int8Array]",nn="[object Int16Array]",tn="[object Int32Array]",rn="[object Uint8Array]",en="[object Uint8ClampedArray]",un="[object Uint16Array]",on="[object Uint32Array]",fn=/\b__p\+='';/g,an=/\b(__p\+=)''\+/g,cn=/(__e\(.*?\)|\b__t\))\+'';/g,ln=/&(?:amp|lt|gt|quot|#39|#96);/g,sn=/[&<>"'`]/g,pn=RegExp(ln.source),hn=RegExp(sn.source),_n=/<%-([\s\S]+?)%>/g,vn=/<%([\s\S]+?)%>/g,gn=/<%=([\s\S]+?)%>/g,yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,dn=/^\w*$/,mn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,wn=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,bn=RegExp(wn.source),xn=/[\u0300-\u036f\ufe20-\ufe23]/g,An=/\\(\\)?/g,jn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,kn=/\w*$/,In=/^0[xX]/,Rn=/^\[object .+?Constructor\]$/,On=/^\d+$/,En=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Cn=/($^)/,Un=/['\n\r\u2028\u2029\\]/g,Wn=RegExp("[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?=[A-Z\\xc0-\\xd6\\xd8-\\xde][a-z\\xdf-\\xf6\\xf8-\\xff]+)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|[0-9]+","g"),$n="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout isFinite parseFloat parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap".split(" "),Sn={};
+Sn[X]=Sn[H]=Sn[Q]=Sn[nn]=Sn[tn]=Sn[rn]=Sn[en]=Sn[un]=Sn[on]=true,Sn[B]=Sn[D]=Sn[J]=Sn[M]=Sn[q]=Sn[P]=Sn[K]=Sn["[object Map]"]=Sn[V]=Sn[Z]=Sn[Y]=Sn["[object Set]"]=Sn[G]=Sn["[object WeakMap]"]=false;var Fn={};Fn[B]=Fn[D]=Fn[J]=Fn[M]=Fn[q]=Fn[X]=Fn[H]=Fn[Q]=Fn[nn]=Fn[tn]=Fn[V]=Fn[Z]=Fn[Y]=Fn[G]=Fn[rn]=Fn[en]=Fn[un]=Fn[on]=true,Fn[P]=Fn[K]=Fn["[object Map]"]=Fn["[object Set]"]=Fn["[object WeakMap]"]=false;var Nn={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a",
+"\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y",
+"\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Tn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ln={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},zn={"function":true,object:true},Bn={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Dn={"\\":"\\",
+"'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mn=zn[typeof exports]&&exports&&!exports.nodeType&&exports,qn=zn[typeof module]&&module&&!module.nodeType&&module,Pn=zn[typeof self]&&self&&self.Object&&self,Kn=zn[typeof window]&&window&&window.Object&&window,Vn=qn&&qn.exports===Mn&&Mn,Zn=Mn&&qn&&typeof global=="object"&&global&&global.Object&&global||Kn!==(this&&this.window)&&Kn||Pn||this,Yn=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Zn._=Yn, define(function(){
+return Yn})):Mn&&qn?Vn?(qn.exports=Yn)._=Yn:Mn._=Yn:Zn._=Yn}).call(this);
diff --git a/contrail-webui/controller/method-override-3.0.0.tar.gz b/contrail-webui/controller/method-override-3.0.0.tar.gz
new file mode 100644
index 0000000..335eedc
--- /dev/null
+++ b/contrail-webui/controller/method-override-3.0.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/mime-1.2.9.tgz b/contrail-webui/controller/mime-1.2.9.tgz
new file mode 100644
index 0000000..4991f23
--- /dev/null
+++ b/contrail-webui/controller/mime-1.2.9.tgz
Binary files differ
diff --git a/contrail-webui/controller/moment-2.14.1.tar.gz b/contrail-webui/controller/moment-2.14.1.tar.gz
new file mode 100644
index 0000000..8319f18
--- /dev/null
+++ b/contrail-webui/controller/moment-2.14.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/moment-2.19.3.tar.gz b/contrail-webui/controller/moment-2.19.3.tar.gz
new file mode 100644
index 0000000..51217ab
--- /dev/null
+++ b/contrail-webui/controller/moment-2.19.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/moment-2.6.0.tar.gz b/contrail-webui/controller/moment-2.6.0.tar.gz
new file mode 100644
index 0000000..4e6e4d5
--- /dev/null
+++ b/contrail-webui/controller/moment-2.6.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/multiselect-master.zip b/contrail-webui/controller/multiselect-master.zip
new file mode 100644
index 0000000..fc7310d
--- /dev/null
+++ b/contrail-webui/controller/multiselect-master.zip
Binary files differ
diff --git a/contrail-webui/controller/node-dir-0.1.5.tgz b/contrail-webui/controller/node-dir-0.1.5.tgz
new file mode 100644
index 0000000..9df3e3f
--- /dev/null
+++ b/contrail-webui/controller/node-dir-0.1.5.tgz
Binary files differ
diff --git a/contrail-webui/controller/node-sass-3.8.0.tar.gz b/contrail-webui/controller/node-sass-3.8.0.tar.gz
new file mode 100644
index 0000000..14b4823
--- /dev/null
+++ b/contrail-webui/controller/node-sass-3.8.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/JSONPath-0.9.1.tar.gz b/contrail-webui/controller/npm-sources/JSONPath-0.9.1.tar.gz
new file mode 100644
index 0000000..63c51ad
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/JSONPath-0.9.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/async-0.1.22.tar.gz b/contrail-webui/controller/npm-sources/async-0.1.22.tar.gz
new file mode 100644
index 0000000..624ba7e
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/async-0.1.22.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/async-0.9.0.tar.gz b/contrail-webui/controller/npm-sources/async-0.9.0.tar.gz
new file mode 100644
index 0000000..8e60aee
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/async-0.9.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/axon-0.5.0.tar.gz b/contrail-webui/controller/npm-sources/axon-0.5.0.tar.gz
new file mode 100644
index 0000000..2015b3d
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/axon-0.5.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/cluster-0.7.7.tar.gz b/contrail-webui/controller/npm-sources/cluster-0.7.7.tar.gz
new file mode 100644
index 0000000..092c699
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/cluster-0.7.7.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/connect-redis-1.4.5.tar.gz b/contrail-webui/controller/npm-sources/connect-redis-1.4.5.tar.gz
new file mode 100644
index 0000000..6513014
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/connect-redis-1.4.5.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/crypto-0.0.3.tar.gz b/contrail-webui/controller/npm-sources/crypto-0.0.3.tar.gz
new file mode 100644
index 0000000..24633f7
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/crypto-0.0.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/data2xml-0.9.0.tar.gz b/contrail-webui/controller/npm-sources/data2xml-0.9.0.tar.gz
new file mode 100644
index 0000000..ee1a6fd
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/data2xml-0.9.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/debug-0.7.0.tar.gz b/contrail-webui/controller/npm-sources/debug-0.7.0.tar.gz
new file mode 100644
index 0000000..9105506
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/debug-0.7.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/deferred-0.7.1.tar.gz b/contrail-webui/controller/npm-sources/deferred-0.7.1.tar.gz
new file mode 100644
index 0000000..2595622
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/deferred-0.7.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/easysoap-0.6.13.tar.gz b/contrail-webui/controller/npm-sources/easysoap-0.6.13.tar.gz
new file mode 100644
index 0000000..038c024
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/easysoap-0.6.13.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/express-3.0.3.tar.gz b/contrail-webui/controller/npm-sources/express-3.0.3.tar.gz
new file mode 100644
index 0000000..71f5f2e
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/express-3.0.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/helenus-0.6.2.tar.gz b/contrail-webui/controller/npm-sources/helenus-0.6.2.tar.gz
new file mode 100644
index 0000000..e211292
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/helenus-0.6.2.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/helmet-0.14.0.tar.gz b/contrail-webui/controller/npm-sources/helmet-0.14.0.tar.gz
new file mode 100644
index 0000000..01f2159
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/helmet-0.14.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/helmet-3.13.0.tar.gz b/contrail-webui/controller/npm-sources/helmet-3.13.0.tar.gz
new file mode 100644
index 0000000..bef99c1
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/helmet-3.13.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/ipv6-3.1.1.tar.gz b/contrail-webui/controller/npm-sources/ipv6-3.1.1.tar.gz
new file mode 100644
index 0000000..383ea0b
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/ipv6-3.1.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/jsdiff-3.5.0.tar.gz b/contrail-webui/controller/npm-sources/jsdiff-3.5.0.tar.gz
new file mode 100644
index 0000000..3c59f6f
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/jsdiff-3.5.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/jsondiffpatch-0.1.27.tar.gz b/contrail-webui/controller/npm-sources/jsondiffpatch-0.1.27.tar.gz
new file mode 100644
index 0000000..a1849f9
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/jsondiffpatch-0.1.27.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/kue-0.5.0.tar.gz b/contrail-webui/controller/npm-sources/kue-0.5.0.tar.gz
new file mode 100644
index 0000000..33467f0
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/kue-0.5.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/mime-1.2.9.tar.gz b/contrail-webui/controller/npm-sources/mime-1.2.9.tar.gz
new file mode 100644
index 0000000..ba8566f
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/mime-1.2.9.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/moment-2.10.3.tar.gz b/contrail-webui/controller/npm-sources/moment-2.10.3.tar.gz
new file mode 100644
index 0000000..c74087f
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/moment-2.10.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/node-dir-0.1.5.tar.gz b/contrail-webui/controller/npm-sources/node-dir-0.1.5.tar.gz
new file mode 100644
index 0000000..7c65a98
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/node-dir-0.1.5.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/pretty-data-0.40.0.tar.gz b/contrail-webui/controller/npm-sources/pretty-data-0.40.0.tar.gz
new file mode 100644
index 0000000..0229ada
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/pretty-data-0.40.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/promise-6.0.1.tar.gz b/contrail-webui/controller/npm-sources/promise-6.0.1.tar.gz
new file mode 100644
index 0000000..c62bede
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/promise-6.0.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/redis-0.8.3.tar.gz b/contrail-webui/controller/npm-sources/redis-0.8.3.tar.gz
new file mode 100644
index 0000000..7bf7b7f
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/redis-0.8.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/redis-rstream-0.1.2.tar.gz b/contrail-webui/controller/npm-sources/redis-rstream-0.1.2.tar.gz
new file mode 100644
index 0000000..4729626
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/redis-rstream-0.1.2.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/request-2.12.0.tar.gz b/contrail-webui/controller/npm-sources/request-2.12.0.tar.gz
new file mode 100644
index 0000000..04bc592
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/request-2.12.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/request-timeout-0.0.2.tar.gz b/contrail-webui/controller/npm-sources/request-timeout-0.0.2.tar.gz
new file mode 100644
index 0000000..a386af0
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/request-timeout-0.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/restler-2.0.1.tar.gz b/contrail-webui/controller/npm-sources/restler-2.0.1.tar.gz
new file mode 100644
index 0000000..fbd18ec
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/restler-2.0.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/restler-3.1.0.tar.gz b/contrail-webui/controller/npm-sources/restler-3.1.0.tar.gz
new file mode 100644
index 0000000..39ac7c4
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/restler-3.1.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/ssh2-0.2.12.tar.gz b/contrail-webui/controller/npm-sources/ssh2-0.2.12.tar.gz
new file mode 100644
index 0000000..65678a5
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/ssh2-0.2.12.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/underscore-1.4.3.tar.gz b/contrail-webui/controller/npm-sources/underscore-1.4.3.tar.gz
new file mode 100644
index 0000000..d5efd90
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/underscore-1.4.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/uuid-js-0.7.4.tar.gz b/contrail-webui/controller/npm-sources/uuid-js-0.7.4.tar.gz
new file mode 100644
index 0000000..1469a81
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/uuid-js-0.7.4.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/uuid-js-0.7.5.tar.gz b/contrail-webui/controller/npm-sources/uuid-js-0.7.5.tar.gz
new file mode 100644
index 0000000..19af902
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/uuid-js-0.7.5.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/winston-0.6.2.tar.gz b/contrail-webui/controller/npm-sources/winston-0.6.2.tar.gz
new file mode 100644
index 0000000..34ecc00
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/winston-0.6.2.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/npm-sources/xml2js-0.2.3.tar.gz b/contrail-webui/controller/npm-sources/xml2js-0.2.3.tar.gz
new file mode 100644
index 0000000..34dd835
--- /dev/null
+++ b/contrail-webui/controller/npm-sources/xml2js-0.2.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/nvd3-1.8.1.tar.gz b/contrail-webui/controller/nvd3-1.8.1.tar.gz
new file mode 100644
index 0000000..4b7c8e3
--- /dev/null
+++ b/contrail-webui/controller/nvd3-1.8.1.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/nvd3-v1.0.0-beta.tar.gz b/contrail-webui/controller/nvd3-v1.0.0-beta.tar.gz
new file mode 100644
index 0000000..95695a4
--- /dev/null
+++ b/contrail-webui/controller/nvd3-v1.0.0-beta.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/palette.js-master.zip b/contrail-webui/controller/palette.js-master.zip
new file mode 100644
index 0000000..d82d676
--- /dev/null
+++ b/contrail-webui/controller/palette.js-master.zip
Binary files differ
diff --git a/contrail-webui/controller/pretty-data-0.40.0.tgz b/contrail-webui/controller/pretty-data-0.40.0.tgz
new file mode 100644
index 0000000..a604778
--- /dev/null
+++ b/contrail-webui/controller/pretty-data-0.40.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/qunit-0.5.18.tgz b/contrail-webui/controller/qunit-0.5.18.tgz
new file mode 100644
index 0000000..e9f3a9c
--- /dev/null
+++ b/contrail-webui/controller/qunit-0.5.18.tgz
Binary files differ
diff --git a/contrail-webui/controller/qunitjs-1.14.0.tgz b/contrail-webui/controller/qunitjs-1.14.0.tgz
new file mode 100644
index 0000000..ce1802f
--- /dev/null
+++ b/contrail-webui/controller/qunitjs-1.14.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/redis-0.8.3.tgz b/contrail-webui/controller/redis-0.8.3.tgz
new file mode 100644
index 0000000..c54eeca
--- /dev/null
+++ b/contrail-webui/controller/redis-0.8.3.tgz
Binary files differ
diff --git a/contrail-webui/controller/redis-rstream-0.1.2.tgz b/contrail-webui/controller/redis-rstream-0.1.2.tgz
new file mode 100644
index 0000000..3ffe93e
--- /dev/null
+++ b/contrail-webui/controller/redis-rstream-0.1.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/request-2.12.0.tgz b/contrail-webui/controller/request-2.12.0.tgz
new file mode 100644
index 0000000..0741fbc
--- /dev/null
+++ b/contrail-webui/controller/request-2.12.0.tgz
Binary files differ
diff --git a/contrail-webui/controller/request-timeout-0.0.2.tgz b/contrail-webui/controller/request-timeout-0.0.2.tgz
new file mode 100644
index 0000000..f881173
--- /dev/null
+++ b/contrail-webui/controller/request-timeout-0.0.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/require.js b/contrail-webui/controller/require.js
new file mode 100644
index 0000000..7f31fa2
--- /dev/null
+++ b/contrail-webui/controller/require.js
@@ -0,0 +1,2076 @@
+/** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Not using strict: uneven strict support in browsers, #392, and causes
+//problems with requirejs.exec()/transpiler plugins that may not be strict.
+/*jslint regexp: true, nomen: true, sloppy: true */
+/*global window, navigator, document, importScripts, setTimeout, opera */
+
+var requirejs, require, define;
+(function (global) {
+ var req, s, head, baseElement, dataMain, src,
+ interactiveScript, currentlyAddingScript, mainScript, subPath,
+ version = '2.1.14',
+ commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
+ cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
+ jsSuffixRegExp = /\.js$/,
+ currDirRegExp = /^\.\//,
+ op = Object.prototype,
+ ostring = op.toString,
+ hasOwn = op.hasOwnProperty,
+ ap = Array.prototype,
+ apsp = ap.splice,
+ isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
+ isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
+ //PS3 indicates loaded and complete, but need to wait for complete
+ //specifically. Sequence is 'loading', 'loaded', execution,
+ // then 'complete'. The UA check is unfortunate, but not sure how
+ //to feature test w/o causing perf issues.
+ readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
+ /^complete$/ : /^(complete|loaded)$/,
+ defContextName = '_',
+ //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
+ isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
+ contexts = {},
+ cfg = {},
+ globalDefQueue = [],
+ useInteractive = false;
+
+ function isFunction(it) {
+ return ostring.call(it) === '[object Function]';
+ }
+
+ function isArray(it) {
+ return ostring.call(it) === '[object Array]';
+ }
+
+ /**
+ * Helper function for iterating over an array. If the func returns
+ * a true value, it will break out of the loop.
+ */
+ function each(ary, func) {
+ if (ary) {
+ var i;
+ for (i = 0; i < ary.length; i += 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Helper function for iterating over an array backwards. If the func
+ * returns a true value, it will break out of the loop.
+ */
+ function eachReverse(ary, func) {
+ if (ary) {
+ var i;
+ for (i = ary.length - 1; i > -1; i -= 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ function getOwn(obj, prop) {
+ return hasProp(obj, prop) && obj[prop];
+ }
+
+ /**
+ * Cycles over properties in an object and calls a function for each
+ * property value. If the function returns a truthy value, then the
+ * iteration is stopped.
+ */
+ function eachProp(obj, func) {
+ var prop;
+ for (prop in obj) {
+ if (hasProp(obj, prop)) {
+ if (func(obj[prop], prop)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Simple function to mix in properties from source into target,
+ * but only if target does not already have a property of the same name.
+ */
+ function mixin(target, source, force, deepStringMixin) {
+ if (source) {
+ eachProp(source, function (value, prop) {
+ if (force || !hasProp(target, prop)) {
+ if (deepStringMixin && typeof value === 'object' && value &&
+ !isArray(value) && !isFunction(value) &&
+ !(value instanceof RegExp)) {
+
+ if (!target[prop]) {
+ target[prop] = {};
+ }
+ mixin(target[prop], value, force, deepStringMixin);
+ } else {
+ target[prop] = value;
+ }
+ }
+ });
+ }
+ return target;
+ }
+
+ //Similar to Function.prototype.bind, but the 'this' object is specified
+ //first, since it is easier to read/figure out what 'this' will be.
+ function bind(obj, fn) {
+ return function () {
+ return fn.apply(obj, arguments);
+ };
+ }
+
+ function scripts() {
+ return document.getElementsByTagName('script');
+ }
+
+ function defaultOnError(err) {
+ throw err;
+ }
+
+ //Allow getting a global that is expressed in
+ //dot notation, like 'a.b.c'.
+ function getGlobal(value) {
+ if (!value) {
+ return value;
+ }
+ var g = global;
+ each(value.split('.'), function (part) {
+ g = g[part];
+ });
+ return g;
+ }
+
+ /**
+ * Constructs an error with a pointer to an URL with more information.
+ * @param {String} id the error ID that maps to an ID on a web page.
+ * @param {String} message human readable error.
+ * @param {Error} [err] the original error, if there is one.
+ *
+ * @returns {Error}
+ */
+ function makeError(id, msg, err, requireModules) {
+ var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
+ e.requireType = id;
+ e.requireModules = requireModules;
+ if (err) {
+ e.originalError = err;
+ }
+ return e;
+ }
+
+ if (typeof define !== 'undefined') {
+ //If a define is already in play via another AMD loader,
+ //do not overwrite.
+ return;
+ }
+
+ if (typeof requirejs !== 'undefined') {
+ if (isFunction(requirejs)) {
+ //Do not overwrite an existing requirejs instance.
+ return;
+ }
+ cfg = requirejs;
+ requirejs = undefined;
+ }
+
+ //Allow for a require config object
+ if (typeof require !== 'undefined' && !isFunction(require)) {
+ //assume it is a config object.
+ cfg = require;
+ require = undefined;
+ }
+
+ function newContext(contextName) {
+ var inCheckLoaded, Module, context, handlers,
+ checkLoadedTimeoutId,
+ config = {
+ //Defaults. Do not set a default for map
+ //config to speed up normalize(), which
+ //will run faster if there is no default.
+ waitSeconds: 7,
+ baseUrl: './',
+ paths: {},
+ bundles: {},
+ pkgs: {},
+ shim: {},
+ config: {}
+ },
+ registry = {},
+ //registry of just enabled modules, to speed
+ //cycle breaking code when lots of modules
+ //are registered, but not activated.
+ enabledRegistry = {},
+ undefEvents = {},
+ defQueue = [],
+ defined = {},
+ urlFetched = {},
+ bundlesMap = {},
+ requireCounter = 1,
+ unnormalizedCounter = 1;
+
+ /**
+ * Trims the . and .. from an array of path segments.
+ * It will keep a leading path segment if a .. will become
+ * the first path segment, to help with module name lookups,
+ * which act like paths, but can be remapped. But the end result,
+ * all paths that use this function should look normalized.
+ * NOTE: this method MODIFIES the input array.
+ * @param {Array} ary the array of path segments.
+ */
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; i < ary.length; i++) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ // If at the start, or previous value is still ..,
+ // keep them so that when converted to a path it may
+ // still work when converted to a path, even though
+ // as an ID it is less than ideal. In larger point
+ // releases, may be better to just kick out an error.
+ if (i === 0 || (i == 1 && ary[2] === '..') || ary[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @param {Boolean} applyMap apply the map config to the value. Should
+ * only be done if this normalization is for a dependency ID.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName, applyMap) {
+ var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
+ foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
+ baseParts = (baseName && baseName.split('/')),
+ map = config.map,
+ starMap = map && map['*'];
+
+ //Adjust any relative paths.
+ if (name) {
+ name = name.split('/');
+ lastIndex = name.length - 1;
+
+ // If wanting node ID compatibility, strip .js from end
+ // of IDs. Have to do this here, and not in nameToUrl
+ // because node allows either .js or non .js to map
+ // to same file.
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+ }
+
+ // Starts with a '.' so need the baseName
+ if (name[0].charAt(0) === '.' && baseParts) {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+
+ trimDots(name);
+ name = name.join('/');
+ }
+
+ //Apply map config if available.
+ if (applyMap && map && (baseParts || starMap)) {
+ nameParts = name.split('/');
+
+ outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join('/');
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = getOwn(mapValue, nameSegment);
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break outerLoop;
+ }
+ }
+ }
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
+ foundStarMap = getOwn(starMap, nameSegment);
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ // If the name points to a package's name, use
+ // the package main instead.
+ pkgMain = getOwn(config.pkgs, name);
+
+ return pkgMain ? pkgMain : name;
+ }
+
+ function removeScript(name) {
+ if (isBrowser) {
+ each(scripts(), function (scriptNode) {
+ if (scriptNode.getAttribute('data-requiremodule') === name &&
+ scriptNode.getAttribute('data-requirecontext') === context.contextName) {
+ scriptNode.parentNode.removeChild(scriptNode);
+ return true;
+ }
+ });
+ }
+ }
+
+ function hasPathFallback(id) {
+ var pathConfig = getOwn(config.paths, id);
+ if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+ //Pop off the first array value, since it failed, and
+ //retry
+ pathConfig.shift();
+ context.require.undef(id);
+
+ //Custom require that does not do map translation, since
+ //ID is "absolute", already mapped/resolved.
+ context.makeRequire(null, {
+ skipMap: true
+ })([id]);
+
+ return true;
+ }
+ }
+
+ //Turns a plugin!resource to [plugin, resource]
+ //with the plugin being undefined if the name
+ //did not have a plugin prefix.
+ function splitPrefix(name) {
+ var prefix,
+ index = name ? name.indexOf('!') : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+
+ /**
+ * Creates a module mapping that includes plugin prefix, module
+ * name, and path. If parentModuleMap is provided it will
+ * also normalize the name via require.normalize()
+ *
+ * @param {String} name the module name
+ * @param {String} [parentModuleMap] parent module map
+ * for the module name, used to resolve relative names.
+ * @param {Boolean} isNormalized: is the ID already normalized.
+ * This is true if this call is done for a define() module ID.
+ * @param {Boolean} applyMap: apply the map config to the ID.
+ * Should only be true if this map is for a dependency.
+ *
+ * @returns {Object}
+ */
+ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+ var url, pluginModule, suffix, nameParts,
+ prefix = null,
+ parentName = parentModuleMap ? parentModuleMap.name : null,
+ originalName = name,
+ isDefine = true,
+ normalizedName = '';
+
+ //If no name, then it means it is a require call, generate an
+ //internal name.
+ if (!name) {
+ isDefine = false;
+ name = '_@r' + (requireCounter += 1);
+ }
+
+ nameParts = splitPrefix(name);
+ prefix = nameParts[0];
+ name = nameParts[1];
+
+ if (prefix) {
+ prefix = normalize(prefix, parentName, applyMap);
+ pluginModule = getOwn(defined, prefix);
+ }
+
+ //Account for relative paths if there is a base name.
+ if (name) {
+ if (prefix) {
+ if (pluginModule && pluginModule.normalize) {
+ //Plugin is loaded, use its normalize method.
+ normalizedName = pluginModule.normalize(name, function (name) {
+ return normalize(name, parentName, applyMap);
+ });
+ } else {
+ // If nested plugin references, then do not try to
+ // normalize, as it will not normalize correctly. This
+ // places a restriction on resourceIds, and the longer
+ // term solution is not to normalize until plugins are
+ // loaded and all normalizations to allow for async
+ // loading of a loader plugin. But for now, fixes the
+ // common uses. Details in #1131
+ normalizedName = name.indexOf('!') === -1 ?
+ normalize(name, parentName, applyMap) :
+ name;
+ }
+ } else {
+ //A regular module.
+ normalizedName = normalize(name, parentName, applyMap);
+
+ //Normalized name may be a plugin ID due to map config
+ //application in normalize. The map config values must
+ //already be normalized, so do not need to redo that part.
+ nameParts = splitPrefix(normalizedName);
+ prefix = nameParts[0];
+ normalizedName = nameParts[1];
+ isNormalized = true;
+
+ url = context.nameToUrl(normalizedName);
+ }
+ }
+
+ //If the id is a plugin id that cannot be determined if it needs
+ //normalization, stamp it with a unique ID so two matching relative
+ //ids that may conflict can be separate.
+ suffix = prefix && !pluginModule && !isNormalized ?
+ '_unnormalized' + (unnormalizedCounter += 1) :
+ '';
+
+ return {
+ prefix: prefix,
+ name: normalizedName,
+ parentMap: parentModuleMap,
+ unnormalized: !!suffix,
+ url: url,
+ originalName: originalName,
+ isDefine: isDefine,
+ id: (prefix ?
+ prefix + '!' + normalizedName :
+ normalizedName) + suffix
+ };
+ }
+
+ function getModule(depMap) {
+ var id = depMap.id,
+ mod = getOwn(registry, id);
+
+ if (!mod) {
+ mod = registry[id] = new context.Module(depMap);
+ }
+
+ return mod;
+ }
+
+ function on(depMap, name, fn) {
+ var id = depMap.id,
+ mod = getOwn(registry, id);
+
+ if (hasProp(defined, id) &&
+ (!mod || mod.defineEmitComplete)) {
+ if (name === 'defined') {
+ fn(defined[id]);
+ }
+ } else {
+ mod = getModule(depMap);
+ if (mod.error && name === 'error') {
+ fn(mod.error);
+ } else {
+ mod.on(name, fn);
+ }
+ }
+ }
+
+ function onError(err, errback) {
+ var ids = err.requireModules,
+ notified = false;
+
+ if (errback) {
+ errback(err);
+ } else {
+ each(ids, function (id) {
+ var mod = getOwn(registry, id);
+ if (mod) {
+ //Set error on module, so it skips timeout checks.
+ mod.error = err;
+ if (mod.events.error) {
+ notified = true;
+ mod.emit('error', err);
+ }
+ }
+ });
+
+ if (!notified) {
+ req.onError(err);
+ }
+ }
+ }
+
+ /**
+ * Internal method to transfer globalQueue items to this context's
+ * defQueue.
+ */
+ function takeGlobalQueue() {
+ //Push all the globalDefQueue items into the context's defQueue
+ if (globalDefQueue.length) {
+ //Array splice in the values since the context code has a
+ //local var ref to defQueue, so cannot just reassign the one
+ //on context.
+ apsp.apply(defQueue,
+ [defQueue.length, 0].concat(globalDefQueue));
+ globalDefQueue = [];
+ }
+ }
+
+ handlers = {
+ 'require': function (mod) {
+ if (mod.require) {
+ return mod.require;
+ } else {
+ return (mod.require = context.makeRequire(mod.map));
+ }
+ },
+ 'exports': function (mod) {
+ mod.usingExports = true;
+ if (mod.map.isDefine) {
+ if (mod.exports) {
+ return (defined[mod.map.id] = mod.exports);
+ } else {
+ return (mod.exports = defined[mod.map.id] = {});
+ }
+ }
+ },
+ 'module': function (mod) {
+ if (mod.module) {
+ return mod.module;
+ } else {
+ return (mod.module = {
+ id: mod.map.id,
+ uri: mod.map.url,
+ config: function () {
+ return getOwn(config.config, mod.map.id) || {};
+ },
+ exports: mod.exports || (mod.exports = {})
+ });
+ }
+ }
+ };
+
+ function cleanRegistry(id) {
+ //Clean up machinery used for waiting modules.
+ delete registry[id];
+ delete enabledRegistry[id];
+ }
+
+ function breakCycle(mod, traced, processed) {
+ var id = mod.map.id;
+
+ if (mod.error) {
+ mod.emit('error', mod.error);
+ } else {
+ traced[id] = true;
+ each(mod.depMaps, function (depMap, i) {
+ var depId = depMap.id,
+ dep = getOwn(registry, depId);
+
+ //Only force things that have not completed
+ //being defined, so still in the registry,
+ //and only if it has not been matched up
+ //in the module already.
+ if (dep && !mod.depMatched[i] && !processed[depId]) {
+ if (getOwn(traced, depId)) {
+ mod.defineDep(i, defined[depId]);
+ mod.check(); //pass false?
+ } else {
+ breakCycle(dep, traced, processed);
+ }
+ }
+ });
+ processed[id] = true;
+ }
+ }
+
+ function checkLoaded() {
+ var err, usingPathFallback,
+ waitInterval = config.waitSeconds * 1000,
+ //It is possible to disable the wait interval by using waitSeconds of 0.
+ expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
+ noLoads = [],
+ reqCalls = [],
+ stillLoading = false,
+ needCycleCheck = true;
+
+ //Do not bother if this call was a result of a cycle break.
+ if (inCheckLoaded) {
+ return;
+ }
+
+ inCheckLoaded = true;
+
+ //Figure out the state of all the modules.
+ eachProp(enabledRegistry, function (mod) {
+ var map = mod.map,
+ modId = map.id;
+
+ //Skip things that are not enabled or in error state.
+ if (!mod.enabled) {
+ return;
+ }
+
+ if (!map.isDefine) {
+ reqCalls.push(mod);
+ }
+
+ if (!mod.error) {
+ //If the module should be executed, and it has not
+ //been inited and time is up, remember it.
+ if (!mod.inited && expired) {
+ if (hasPathFallback(modId)) {
+ usingPathFallback = true;
+ stillLoading = true;
+ } else {
+ noLoads.push(modId);
+ removeScript(modId);
+ }
+ } else if (!mod.inited && mod.fetched && map.isDefine) {
+ stillLoading = true;
+ if (!map.prefix) {
+ //No reason to keep looking for unfinished
+ //loading. If the only stillLoading is a
+ //plugin resource though, keep going,
+ //because it may be that a plugin resource
+ //is waiting on a non-plugin cycle.
+ return (needCycleCheck = false);
+ }
+ }
+ }
+ });
+
+ if (expired && noLoads.length) {
+ //If wait time expired, throw error of unloaded modules.
+ err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
+ err.contextName = context.contextName;
+ return onError(err);
+ }
+
+ //Not expired, check for a cycle.
+ if (needCycleCheck) {
+ each(reqCalls, function (mod) {
+ breakCycle(mod, {}, {});
+ });
+ }
+
+ //If still waiting on loads, and the waiting load is something
+ //other than a plugin resource, or there are still outstanding
+ //scripts, then just try back later.
+ if ((!expired || usingPathFallback) && stillLoading) {
+ //Something is still waiting to load. Wait for it, but only
+ //if a timeout is not already in effect.
+ if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+ checkLoadedTimeoutId = setTimeout(function () {
+ checkLoadedTimeoutId = 0;
+ checkLoaded();
+ }, 50);
+ }
+ }
+
+ inCheckLoaded = false;
+ }
+
+ Module = function (map) {
+ this.events = getOwn(undefEvents, map.id) || {};
+ this.map = map;
+ this.shim = getOwn(config.shim, map.id);
+ this.depExports = [];
+ this.depMaps = [];
+ this.depMatched = [];
+ this.pluginMaps = {};
+ this.depCount = 0;
+
+ /* this.exports this.factory
+ this.depMaps = [],
+ this.enabled, this.fetched
+ */
+ };
+
+ Module.prototype = {
+ init: function (depMaps, factory, errback, options) {
+ options = options || {};
+
+ //Do not do more inits if already done. Can happen if there
+ //are multiple define calls for the same module. That is not
+ //a normal, common case, but it is also not unexpected.
+ if (this.inited) {
+ return;
+ }
+
+ this.factory = factory;
+
+ if (errback) {
+ //Register for errors on this module.
+ this.on('error', errback);
+ } else if (this.events.error) {
+ //If no errback already, but there are error listeners
+ //on this module, set up an errback to pass to the deps.
+ errback = bind(this, function (err) {
+ this.emit('error', err);
+ });
+ }
+
+ //Do a copy of the dependency array, so that
+ //source inputs are not modified. For example
+ //"shim" deps are passed in here directly, and
+ //doing a direct modification of the depMaps array
+ //would affect that config.
+ this.depMaps = depMaps && depMaps.slice(0);
+
+ this.errback = errback;
+
+ //Indicate this module has be initialized
+ this.inited = true;
+
+ this.ignore = options.ignore;
+
+ //Could have option to init this module in enabled mode,
+ //or could have been previously marked as enabled. However,
+ //the dependencies are not known until init is called. So
+ //if enabled previously, now trigger dependencies as enabled.
+ if (options.enabled || this.enabled) {
+ //Enable this module and dependencies.
+ //Will call this.check()
+ this.enable();
+ } else {
+ this.check();
+ }
+ },
+
+ defineDep: function (i, depExports) {
+ //Because of cycles, defined callback for a given
+ //export can be called more than once.
+ if (!this.depMatched[i]) {
+ this.depMatched[i] = true;
+ this.depCount -= 1;
+ this.depExports[i] = depExports;
+ }
+ },
+
+ fetch: function () {
+ if (this.fetched) {
+ return;
+ }
+ this.fetched = true;
+
+ context.startTime = (new Date()).getTime();
+
+ var map = this.map;
+
+ //If the manager is for a plugin managed resource,
+ //ask the plugin to load it now.
+ if (this.shim) {
+ context.makeRequire(this.map, {
+ enableBuildCallback: true
+ })(this.shim.deps || [], bind(this, function () {
+ return map.prefix ? this.callPlugin() : this.load();
+ }));
+ } else {
+ //Regular dependency.
+ return map.prefix ? this.callPlugin() : this.load();
+ }
+ },
+
+ load: function () {
+ var url = this.map.url;
+
+ //Regular dependency.
+ if (!urlFetched[url]) {
+ urlFetched[url] = true;
+ context.load(this.map.id, url);
+ }
+ },
+
+ /**
+ * Checks if the module is ready to define itself, and if so,
+ * define it.
+ */
+ check: function () {
+ if (!this.enabled || this.enabling) {
+ return;
+ }
+
+ var err, cjsModule,
+ id = this.map.id,
+ depExports = this.depExports,
+ exports = this.exports,
+ factory = this.factory;
+
+ if (!this.inited) {
+ this.fetch();
+ } else if (this.error) {
+ this.emit('error', this.error);
+ } else if (!this.defining) {
+ //The factory could trigger another require call
+ //that would result in checking this module to
+ //define itself again. If already in the process
+ //of doing that, skip this work.
+ this.defining = true;
+
+ if (this.depCount < 1 && !this.defined) {
+ if (isFunction(factory)) {
+ //If there is an error listener, favor passing
+ //to that instead of throwing an error. However,
+ //only do it for define()'d modules. require
+ //errbacks should not be called for failures in
+ //their callbacks (#699). However if a global
+ //onError is set, use that.
+ if ((this.events.error && this.map.isDefine) ||
+ req.onError !== defaultOnError) {
+ try {
+ exports = context.execCb(id, factory, depExports, exports);
+ } catch (e) {
+ err = e;
+ }
+ } else {
+ exports = context.execCb(id, factory, depExports, exports);
+ }
+
+ // Favor return value over exports. If node/cjs in play,
+ // then will not have a return value anyway. Favor
+ // module.exports assignment over exports object.
+ if (this.map.isDefine && exports === undefined) {
+ cjsModule = this.module;
+ if (cjsModule) {
+ exports = cjsModule.exports;
+ } else if (this.usingExports) {
+ //exports already set the defined value.
+ exports = this.exports;
+ }
+ }
+
+ if (err) {
+ err.requireMap = this.map;
+ err.requireModules = this.map.isDefine ? [this.map.id] : null;
+ err.requireType = this.map.isDefine ? 'define' : 'require';
+ return onError((this.error = err));
+ }
+
+ } else {
+ //Just a literal value
+ exports = factory;
+ }
+
+ this.exports = exports;
+
+ if (this.map.isDefine && !this.ignore) {
+ defined[id] = exports;
+
+ if (req.onResourceLoad) {
+ req.onResourceLoad(context, this.map, this.depMaps);
+ }
+ }
+
+ //Clean up
+ cleanRegistry(id);
+
+ this.defined = true;
+ }
+
+ //Finished the define stage. Allow calling check again
+ //to allow define notifications below in the case of a
+ //cycle.
+ this.defining = false;
+
+ if (this.defined && !this.defineEmitted) {
+ this.defineEmitted = true;
+ this.emit('defined', this.exports);
+ this.defineEmitComplete = true;
+ }
+
+ }
+ },
+
+ callPlugin: function () {
+ var map = this.map,
+ id = map.id,
+ //Map already normalized the prefix.
+ pluginMap = makeModuleMap(map.prefix);
+
+ //Mark this as a dependency for this plugin, so it
+ //can be traced for cycles.
+ this.depMaps.push(pluginMap);
+
+ on(pluginMap, 'defined', bind(this, function (plugin) {
+ var load, normalizedMap, normalizedMod,
+ bundleId = getOwn(bundlesMap, this.map.id),
+ name = this.map.name,
+ parentName = this.map.parentMap ? this.map.parentMap.name : null,
+ localRequire = context.makeRequire(map.parentMap, {
+ enableBuildCallback: true
+ });
+
+ //If current map is not normalized, wait for that
+ //normalized name to load instead of continuing.
+ if (this.map.unnormalized) {
+ //Normalize the ID if the plugin allows it.
+ if (plugin.normalize) {
+ name = plugin.normalize(name, function (name) {
+ return normalize(name, parentName, true);
+ }) || '';
+ }
+
+ //prefix and name should already be normalized, no need
+ //for applying map config again either.
+ normalizedMap = makeModuleMap(map.prefix + '!' + name,
+ this.map.parentMap);
+ on(normalizedMap,
+ 'defined', bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true,
+ ignore: true
+ });
+ }));
+
+ normalizedMod = getOwn(registry, normalizedMap.id);
+ if (normalizedMod) {
+ //Mark this as a dependency for this plugin, so it
+ //can be traced for cycles.
+ this.depMaps.push(normalizedMap);
+
+ if (this.events.error) {
+ normalizedMod.on('error', bind(this, function (err) {
+ this.emit('error', err);
+ }));
+ }
+ normalizedMod.enable();
+ }
+
+ return;
+ }
+
+ //If a paths config, then just load that file instead to
+ //resolve the plugin, as it is built into that paths layer.
+ if (bundleId) {
+ this.map.url = context.nameToUrl(bundleId);
+ this.load();
+ return;
+ }
+
+ load = bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true
+ });
+ });
+
+ load.error = bind(this, function (err) {
+ this.inited = true;
+ this.error = err;
+ err.requireModules = [id];
+
+ //Remove temp unnormalized modules for this module,
+ //since they will never be resolved otherwise now.
+ eachProp(registry, function (mod) {
+ if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
+ cleanRegistry(mod.map.id);
+ }
+ });
+
+ onError(err);
+ });
+
+ //Allow plugins to load other code without having to know the
+ //context or how to 'complete' the load.
+ load.fromText = bind(this, function (text, textAlt) {
+ /*jslint evil: true */
+ var moduleName = map.name,
+ moduleMap = makeModuleMap(moduleName),
+ hasInteractive = useInteractive;
+
+ //As of 2.1.0, support just passing the text, to reinforce
+ //fromText only being called once per resource. Still
+ //support old style of passing moduleName but discard
+ //that moduleName in favor of the internal ref.
+ if (textAlt) {
+ text = textAlt;
+ }
+
+ //Turn off interactive script matching for IE for any define
+ //calls in the text, then turn it back on at the end.
+ if (hasInteractive) {
+ useInteractive = false;
+ }
+
+ //Prime the system by creating a module instance for
+ //it.
+ getModule(moduleMap);
+
+ //Transfer any config to this other module.
+ if (hasProp(config.config, id)) {
+ config.config[moduleName] = config.config[id];
+ }
+
+ try {
+ req.exec(text);
+ } catch (e) {
+ return onError(makeError('fromtexteval',
+ 'fromText eval for ' + id +
+ ' failed: ' + e,
+ e,
+ [id]));
+ }
+
+ if (hasInteractive) {
+ useInteractive = true;
+ }
+
+ //Mark this as a dependency for the plugin
+ //resource
+ this.depMaps.push(moduleMap);
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+
+ //Bind the value of that module to the value for this
+ //resource ID.
+ localRequire([moduleName], load);
+ });
+
+ //Use parentName here since the plugin's name is not reliable,
+ //could be some weird string with no path that actually wants to
+ //reference the parentName's path.
+ plugin.load(map.name, localRequire, load, config);
+ }));
+
+ context.enable(pluginMap, this);
+ this.pluginMaps[pluginMap.id] = pluginMap;
+ },
+
+ enable: function () {
+ enabledRegistry[this.map.id] = this;
+ this.enabled = true;
+
+ //Set flag mentioning that the module is enabling,
+ //so that immediate calls to the defined callbacks
+ //for dependencies do not trigger inadvertent load
+ //with the depCount still being zero.
+ this.enabling = true;
+
+ //Enable each dependency
+ each(this.depMaps, bind(this, function (depMap, i) {
+ var id, mod, handler;
+
+ if (typeof depMap === 'string') {
+ //Dependency needs to be converted to a depMap
+ //and wired up to this module.
+ depMap = makeModuleMap(depMap,
+ (this.map.isDefine ? this.map : this.map.parentMap),
+ false,
+ !this.skipMap);
+ this.depMaps[i] = depMap;
+
+ handler = getOwn(handlers, depMap.id);
+
+ if (handler) {
+ this.depExports[i] = handler(this);
+ return;
+ }
+
+ this.depCount += 1;
+
+ on(depMap, 'defined', bind(this, function (depExports) {
+ this.defineDep(i, depExports);
+ this.check();
+ }));
+
+ if (this.errback) {
+ on(depMap, 'error', bind(this, this.errback));
+ }
+ }
+
+ id = depMap.id;
+ mod = registry[id];
+
+ //Skip special modules like 'require', 'exports', 'module'
+ //Also, don't call enable if it is already enabled,
+ //important in circular dependency cases.
+ if (!hasProp(handlers, id) && mod && !mod.enabled) {
+ context.enable(depMap, this);
+ }
+ }));
+
+ //Enable each plugin that is used in
+ //a dependency
+ eachProp(this.pluginMaps, bind(this, function (pluginMap) {
+ var mod = getOwn(registry, pluginMap.id);
+ if (mod && !mod.enabled) {
+ context.enable(pluginMap, this);
+ }
+ }));
+
+ this.enabling = false;
+
+ this.check();
+ },
+
+ on: function (name, cb) {
+ var cbs = this.events[name];
+ if (!cbs) {
+ cbs = this.events[name] = [];
+ }
+ cbs.push(cb);
+ },
+
+ emit: function (name, evt) {
+ each(this.events[name], function (cb) {
+ cb(evt);
+ });
+ if (name === 'error') {
+ //Now that the error handler was triggered, remove
+ //the listeners, since this broken Module instance
+ //can stay around for a while in the registry.
+ delete this.events[name];
+ }
+ }
+ };
+
+ function callGetModule(args) {
+ //Skip modules already defined.
+ if (!hasProp(defined, args[0])) {
+ getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+ }
+ }
+
+ function removeListener(node, func, name, ieName) {
+ //Favor detachEvent because of IE9
+ //issue, see attachEvent/addEventListener comment elsewhere
+ //in this file.
+ if (node.detachEvent && !isOpera) {
+ //Probably IE. If not it will throw an error, which will be
+ //useful to know.
+ if (ieName) {
+ node.detachEvent(ieName, func);
+ }
+ } else {
+ node.removeEventListener(name, func, false);
+ }
+ }
+
+ /**
+ * Given an event from a script node, get the requirejs info from it,
+ * and then removes the event listeners on the node.
+ * @param {Event} evt
+ * @returns {Object}
+ */
+ function getScriptData(evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ var node = evt.currentTarget || evt.srcElement;
+
+ //Remove the listeners once here.
+ removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
+ removeListener(node, context.onScriptError, 'error');
+
+ return {
+ node: node,
+ id: node && node.getAttribute('data-requiremodule')
+ };
+ }
+
+ function intakeDefines() {
+ var args;
+
+ //Any defined modules in the global queue, intake them now.
+ takeGlobalQueue();
+
+ //Make sure any remaining defQueue items get properly processed.
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
+ } else {
+ //args are id, deps, factory. Should be normalized by the
+ //define() function.
+ callGetModule(args);
+ }
+ }
+ }
+
+ context = {
+ config: config,
+ contextName: contextName,
+ registry: registry,
+ defined: defined,
+ urlFetched: urlFetched,
+ defQueue: defQueue,
+ Module: Module,
+ makeModuleMap: makeModuleMap,
+ nextTick: req.nextTick,
+ onError: onError,
+
+ /**
+ * Set a configuration for the context.
+ * @param {Object} cfg config object to integrate.
+ */
+ configure: function (cfg) {
+ //Make sure the baseUrl ends in a slash.
+ if (cfg.baseUrl) {
+ if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
+ cfg.baseUrl += '/';
+ }
+ }
+
+ //Save off the paths since they require special processing,
+ //they are additive.
+ var shim = config.shim,
+ objs = {
+ paths: true,
+ bundles: true,
+ config: true,
+ map: true
+ };
+
+ eachProp(cfg, function (value, prop) {
+ if (objs[prop]) {
+ if (!config[prop]) {
+ config[prop] = {};
+ }
+ mixin(config[prop], value, true, true);
+ } else {
+ config[prop] = value;
+ }
+ });
+
+ //Reverse map the bundles
+ if (cfg.bundles) {
+ eachProp(cfg.bundles, function (value, prop) {
+ each(value, function (v) {
+ if (v !== prop) {
+ bundlesMap[v] = prop;
+ }
+ });
+ });
+ }
+
+ //Merge shim
+ if (cfg.shim) {
+ eachProp(cfg.shim, function (value, id) {
+ //Normalize the structure
+ if (isArray(value)) {
+ value = {
+ deps: value
+ };
+ }
+ if ((value.exports || value.init) && !value.exportsFn) {
+ value.exportsFn = context.makeShimExports(value);
+ }
+ shim[id] = value;
+ });
+ config.shim = shim;
+ }
+
+ //Adjust packages if necessary.
+ if (cfg.packages) {
+ each(cfg.packages, function (pkgObj) {
+ var location, name;
+
+ pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
+
+ name = pkgObj.name;
+ location = pkgObj.location;
+ if (location) {
+ config.paths[name] = pkgObj.location;
+ }
+
+ //Save pointer to main module ID for pkg name.
+ //Remove leading dot in main, so main paths are normalized,
+ //and remove any trailing .js, since different package
+ //envs have different conventions: some use a module name,
+ //some use a file name.
+ config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
+ .replace(currDirRegExp, '')
+ .replace(jsSuffixRegExp, '');
+ });
+ }
+
+ //If there are any "waiting to execute" modules in the registry,
+ //update the maps for them, since their info, like URLs to load,
+ //may have changed.
+ eachProp(registry, function (mod, id) {
+ //If module already has init called, since it is too
+ //late to modify them, and ignore unnormalized ones
+ //since they are transient.
+ if (!mod.inited && !mod.map.unnormalized) {
+ mod.map = makeModuleMap(id);
+ }
+ });
+
+ //If a deps array or a config callback is specified, then call
+ //require with those args. This is useful when require is defined as a
+ //config object before require.js is loaded.
+ if (cfg.deps || cfg.callback) {
+ context.require(cfg.deps || [], cfg.callback);
+ }
+ },
+
+ makeShimExports: function (value) {
+ function fn() {
+ var ret;
+ if (value.init) {
+ ret = value.init.apply(global, arguments);
+ }
+ return ret || (value.exports && getGlobal(value.exports));
+ }
+ return fn;
+ },
+
+ makeRequire: function (relMap, options) {
+ options = options || {};
+
+ function localRequire(deps, callback, errback) {
+ var id, map, requireMod;
+
+ if (options.enableBuildCallback && callback && isFunction(callback)) {
+ callback.__requireJsBuild = true;
+ }
+
+ if (typeof deps === 'string') {
+ if (isFunction(callback)) {
+ //Invalid call
+ return onError(makeError('requireargs', 'Invalid require call'), errback);
+ }
+
+ //If require|exports|module are requested, get the
+ //value for them from the special handlers. Caveat:
+ //this only works while module is being defined.
+ if (relMap && hasProp(handlers, deps)) {
+ return handlers[deps](registry[relMap.id]);
+ }
+
+ //Synchronous access to one module. If require.get is
+ //available (as in the Node adapter), prefer that.
+ if (req.get) {
+ return req.get(context, deps, relMap, localRequire);
+ }
+
+ //Normalize module name, if it contains . or ..
+ map = makeModuleMap(deps, relMap, false, true);
+ id = map.id;
+
+ if (!hasProp(defined, id)) {
+ return onError(makeError('notloaded', 'Module name "' +
+ id +
+ '" has not been loaded yet for context: ' +
+ contextName +
+ (relMap ? '' : '. Use require([])')));
+ }
+ return defined[id];
+ }
+
+ //Grab defines waiting in the global queue.
+ intakeDefines();
+
+ //Mark all the dependencies as needing to be loaded.
+ context.nextTick(function () {
+ //Some defines could have been added since the
+ //require call, collect them.
+ intakeDefines();
+
+ requireMod = getModule(makeModuleMap(null, relMap));
+
+ //Store if map config should be applied to this require
+ //call for dependencies.
+ requireMod.skipMap = options.skipMap;
+
+ requireMod.init(deps, callback, errback, {
+ enabled: true
+ });
+
+ checkLoaded();
+ });
+
+ return localRequire;
+ }
+
+ mixin(localRequire, {
+ isBrowser: isBrowser,
+
+ /**
+ * Converts a module name + .extension into an URL path.
+ * *Requires* the use of a module name. It does not support using
+ * plain URLs like nameToUrl.
+ */
+ toUrl: function (moduleNamePlusExt) {
+ var ext,
+ index = moduleNamePlusExt.lastIndexOf('.'),
+ segment = moduleNamePlusExt.split('/')[0],
+ isRelative = segment === '.' || segment === '..';
+
+ //Have a file extension alias, and it is not the
+ //dots from a relative path.
+ if (index !== -1 && (!isRelative || index > 1)) {
+ ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
+ moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+ }
+
+ return context.nameToUrl(normalize(moduleNamePlusExt,
+ relMap && relMap.id, true), ext, true);
+ },
+
+ defined: function (id) {
+ return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+ },
+
+ specified: function (id) {
+ id = makeModuleMap(id, relMap, false, true).id;
+ return hasProp(defined, id) || hasProp(registry, id);
+ }
+ });
+
+ //Only allow undef on top level require calls
+ if (!relMap) {
+ localRequire.undef = function (id) {
+ //Bind any waiting define() calls to this context,
+ //fix for #408
+ takeGlobalQueue();
+
+ var map = makeModuleMap(id, relMap, true),
+ mod = getOwn(registry, id);
+
+ removeScript(id);
+
+ delete defined[id];
+ delete urlFetched[map.url];
+ delete undefEvents[id];
+
+ //Clean queued defines too. Go backwards
+ //in array so that the splices do not
+ //mess up the iteration.
+ eachReverse(defQueue, function(args, i) {
+ if(args[0] === id) {
+ defQueue.splice(i, 1);
+ }
+ });
+
+ if (mod) {
+ //Hold on to listeners in case the
+ //module will be attempted to be reloaded
+ //using a different config.
+ if (mod.events.defined) {
+ undefEvents[id] = mod.events;
+ }
+
+ cleanRegistry(id);
+ }
+ };
+ }
+
+ return localRequire;
+ },
+
+ /**
+ * Called to enable a module if it is still in the registry
+ * awaiting enablement. A second arg, parent, the parent module,
+ * is passed in for context, when this method is overridden by
+ * the optimizer. Not shown here to keep code compact.
+ */
+ enable: function (depMap) {
+ var mod = getOwn(registry, depMap.id);
+ if (mod) {
+ getModule(depMap).enable();
+ }
+ },
+
+ /**
+ * Internal method used by environment adapters to complete a load event.
+ * A load event could be a script load or just a load pass from a synchronous
+ * load call.
+ * @param {String} moduleName the name of the module to potentially complete.
+ */
+ completeLoad: function (moduleName) {
+ var found, args, mod,
+ shim = getOwn(config.shim, moduleName) || {},
+ shExports = shim.exports;
+
+ takeGlobalQueue();
+
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ args[0] = moduleName;
+ //If already found an anonymous module and bound it
+ //to this name, then this is some other anon module
+ //waiting for its completeLoad to fire.
+ if (found) {
+ break;
+ }
+ found = true;
+ } else if (args[0] === moduleName) {
+ //Found matching define call for this script!
+ found = true;
+ }
+
+ callGetModule(args);
+ }
+
+ //Do this after the cycle of callGetModule in case the result
+ //of those calls/init calls changes the registry.
+ mod = getOwn(registry, moduleName);
+
+ if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
+ if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+ if (hasPathFallback(moduleName)) {
+ return;
+ } else {
+ return onError(makeError('nodefine',
+ 'No define call for ' + moduleName,
+ null,
+ [moduleName]));
+ }
+ } else {
+ //A script that does not call define(), so just simulate
+ //the call for it.
+ callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
+ }
+ }
+
+ checkLoaded();
+ },
+
+ /**
+ * Converts a module name to a file path. Supports cases where
+ * moduleName may actually be just an URL.
+ * Note that it **does not** call normalize on the moduleName,
+ * it is assumed to have already been normalized. This is an
+ * internal API, not a public one. Use toUrl for the public API.
+ */
+ nameToUrl: function (moduleName, ext, skipExt) {
+ var paths, syms, i, parentModule, url,
+ parentPath, bundleId,
+ pkgMain = getOwn(config.pkgs, moduleName);
+
+ if (pkgMain) {
+ moduleName = pkgMain;
+ }
+
+ bundleId = getOwn(bundlesMap, moduleName);
+
+ if (bundleId) {
+ return context.nameToUrl(bundleId, ext, skipExt);
+ }
+
+ //If a colon is in the URL, it indicates a protocol is used and it is just
+ //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+ //or ends with .js, then assume the user meant to use an url and not a module id.
+ //The slash is important for protocol-less URLs as well as full paths.
+ if (req.jsExtRegExp.test(moduleName)) {
+ //Just a plain path, not module name lookup, so just return it.
+ //Add extension if it is included. This is a bit wonky, only non-.js things pass
+ //an extension, this method probably needs to be reworked.
+ url = moduleName + (ext || '');
+ } else {
+ //A module that needs to be converted to a path.
+ paths = config.paths;
+
+ syms = moduleName.split('/');
+ //For each module name segment, see if there is a path
+ //registered for it. Start with most specific name
+ //and work up from it.
+ for (i = syms.length; i > 0; i -= 1) {
+ parentModule = syms.slice(0, i).join('/');
+
+ parentPath = getOwn(paths, parentModule);
+ if (parentPath) {
+ //If an array, it means there are a few choices,
+ //Choose the one that is desired
+ if (isArray(parentPath)) {
+ parentPath = parentPath[0];
+ }
+ syms.splice(0, i, parentPath);
+ break;
+ }
+ }
+
+ //Join the path parts together, then figure out if baseUrl is needed.
+ url = syms.join('/');
+ url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
+ url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
+ }
+
+ return config.urlArgs ? url +
+ ((url.indexOf('?') === -1 ? '?' : '&') +
+ config.urlArgs) : url;
+ },
+
+ //Delegates to req.load. Broken out as a separate function to
+ //allow overriding in the optimizer.
+ load: function (id, url) {
+ req.load(context, id, url);
+ },
+
+ /**
+ * Executes a module callback function. Broken out as a separate function
+ * solely to allow the build system to sequence the files in the built
+ * layer in the right sequence.
+ *
+ * @private
+ */
+ execCb: function (name, callback, args, exports) {
+ return callback.apply(exports, args);
+ },
+
+ /**
+ * callback for script loads, used to check status of loading.
+ *
+ * @param {Event} evt the event from the browser for the script
+ * that was loaded.
+ */
+ onScriptLoad: function (evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ if (evt.type === 'load' ||
+ (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
+ //Reset interactive script so a script node is not held onto for
+ //to long.
+ interactiveScript = null;
+
+ //Pull out the name of the module and the context.
+ var data = getScriptData(evt);
+ context.completeLoad(data.id);
+ }
+ },
+
+ /**
+ * Callback for script errors.
+ */
+ onScriptError: function (evt) {
+ var data = getScriptData(evt);
+ if (!hasPathFallback(data.id)) {
+ return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
+ }
+ }
+ };
+
+ context.require = context.makeRequire();
+ return context;
+ }
+
+ /**
+ * Main entry point.
+ *
+ * If the only argument to require is a string, then the module that
+ * is represented by that string is fetched for the appropriate context.
+ *
+ * If the first argument is an array, then it will be treated as an array
+ * of dependency string names to fetch. An optional function callback can
+ * be specified to execute when all of those dependencies are available.
+ *
+ * Make a local req variable to help Caja compliance (it assumes things
+ * on a require that are not standardized), and to give a short
+ * name for minification/local scope use.
+ */
+ req = requirejs = function (deps, callback, errback, optional) {
+
+ //Find the right context, use default
+ var context, config,
+ contextName = defContextName;
+
+ // Determine if have config object in the call.
+ if (!isArray(deps) && typeof deps !== 'string') {
+ // deps is a config object
+ config = deps;
+ if (isArray(callback)) {
+ // Adjust args if there are dependencies
+ deps = callback;
+ callback = errback;
+ errback = optional;
+ } else {
+ deps = [];
+ }
+ }
+
+ if (config && config.context) {
+ contextName = config.context;
+ }
+
+ context = getOwn(contexts, contextName);
+ if (!context) {
+ context = contexts[contextName] = req.s.newContext(contextName);
+ }
+
+ if (config) {
+ context.configure(config);
+ }
+
+ return context.require(deps, callback, errback);
+ };
+
+ /**
+ * Support require.config() to make it easier to cooperate with other
+ * AMD loaders on globally agreed names.
+ */
+ req.config = function (config) {
+ return req(config);
+ };
+
+ /**
+ * Execute something after the current tick
+ * of the event loop. Override for other envs
+ * that have a better solution than setTimeout.
+ * @param {Function} fn function to execute later.
+ */
+ req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
+ setTimeout(fn, 4);
+ } : function (fn) { fn(); };
+
+ /**
+ * Export require as a global, but only if it does not already exist.
+ */
+ if (!require) {
+ require = req;
+ }
+
+ req.version = version;
+
+ //Used to filter out dependencies that are already paths.
+ req.jsExtRegExp = /^\/|:|\?|\.js$/;
+ req.isBrowser = isBrowser;
+ s = req.s = {
+ contexts: contexts,
+ newContext: newContext
+ };
+
+ //Create default context.
+ req({});
+
+ //Exports some context-sensitive methods on global require.
+ each([
+ 'toUrl',
+ 'undef',
+ 'defined',
+ 'specified'
+ ], function (prop) {
+ //Reference from contexts instead of early binding to default context,
+ //so that during builds, the latest instance of the default context
+ //with its config gets used.
+ req[prop] = function () {
+ var ctx = contexts[defContextName];
+ return ctx.require[prop].apply(ctx, arguments);
+ };
+ });
+
+ if (isBrowser) {
+ head = s.head = document.getElementsByTagName('head')[0];
+ //If BASE tag is in play, using appendChild is a problem for IE6.
+ //When that browser dies, this can be removed. Details in this jQuery bug:
+ //http://dev.jquery.com/ticket/2709
+ baseElement = document.getElementsByTagName('base')[0];
+ if (baseElement) {
+ head = s.head = baseElement.parentNode;
+ }
+ }
+
+ /**
+ * Any errors that require explicitly generates will be passed to this
+ * function. Intercept/override it if you want custom error handling.
+ * @param {Error} err the error object.
+ */
+ req.onError = defaultOnError;
+
+ /**
+ * Creates the node for the load command. Only used in browser envs.
+ */
+ req.createNode = function (config, moduleName, url) {
+ var node = config.xhtml ?
+ document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
+ document.createElement('script');
+ node.type = config.scriptType || 'text/javascript';
+ node.charset = 'utf-8';
+ node.async = true;
+ return node;
+ };
+
+ /**
+ * Does the request to load a module for the browser case.
+ * Make this a separate function to allow other environments
+ * to override it.
+ *
+ * @param {Object} context the require context to find state.
+ * @param {String} moduleName the name of the module.
+ * @param {Object} url the URL to the module.
+ */
+ req.load = function (context, moduleName, url) {
+ var config = (context && context.config) || {},
+ node;
+ if (isBrowser) {
+ //In the browser so use a script tag
+ node = req.createNode(config, moduleName, url);
+
+ node.setAttribute('data-requirecontext', context.contextName);
+ node.setAttribute('data-requiremodule', moduleName);
+
+ //Set up load listener. Test attachEvent first because IE9 has
+ //a subtle issue in its addEventListener and script onload firings
+ //that do not match the behavior of all other browsers with
+ //addEventListener support, which fire the onload event for a
+ //script right after the script execution. See:
+ //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
+ //UNFORTUNATELY Opera implements attachEvent but does not follow the script
+ //script execution mode.
+ if (node.attachEvent &&
+ //Check if node.attachEvent is artificially added by custom script or
+ //natively supported by browser
+ //read https://github.com/jrburke/requirejs/issues/187
+ //if we can NOT find [native code] then it must NOT natively supported.
+ //in IE8, node.attachEvent does not have toString()
+ //Note the test for "[native code" with no closing brace, see:
+ //https://github.com/jrburke/requirejs/issues/273
+ !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
+ !isOpera) {
+ //Probably IE. IE (at least 6-8) do not fire
+ //script onload right after executing the script, so
+ //we cannot tie the anonymous define call to a name.
+ //However, IE reports the script as being in 'interactive'
+ //readyState at the time of the define call.
+ useInteractive = true;
+
+ node.attachEvent('onreadystatechange', context.onScriptLoad);
+ //It would be great to add an error handler here to catch
+ //404s in IE9+. However, onreadystatechange will fire before
+ //the error handler, so that does not help. If addEventListener
+ //is used, then IE will fire error before load, but we cannot
+ //use that pathway given the connect.microsoft.com issue
+ //mentioned above about not doing the 'script execute,
+ //then fire the script load event listener before execute
+ //next script' that other browsers do.
+ //Best hope: IE10 fixes the issues,
+ //and then destroys all installs of IE 6-9.
+ //node.attachEvent('onerror', context.onScriptError);
+ } else {
+ node.addEventListener('load', context.onScriptLoad, false);
+ node.addEventListener('error', context.onScriptError, false);
+ }
+ node.src = url;
+
+ //For some cache cases in IE 6-8, the script executes before the end
+ //of the appendChild execution, so to tie an anonymous define
+ //call to the module name (which is stored on the node), hold on
+ //to a reference to this node, but clear after the DOM insertion.
+ currentlyAddingScript = node;
+ if (baseElement) {
+ head.insertBefore(node, baseElement);
+ } else {
+ head.appendChild(node);
+ }
+ currentlyAddingScript = null;
+
+ return node;
+ } else if (isWebWorker) {
+ try {
+ //In a web worker, use importScripts. This is not a very
+ //efficient use of importScripts, importScripts will block until
+ //its script is downloaded and evaluated. However, if web workers
+ //are in play, the expectation that a build has been done so that
+ //only one script needs to be loaded anyway. This may need to be
+ //reevaluated if other use cases become common.
+ importScripts(url);
+
+ //Account for anonymous modules
+ context.completeLoad(moduleName);
+ } catch (e) {
+ context.onError(makeError('importscripts',
+ 'importScripts failed for ' +
+ moduleName + ' at ' + url,
+ e,
+ [moduleName]));
+ }
+ }
+ };
+
+ function getInteractiveScript() {
+ if (interactiveScript && interactiveScript.readyState === 'interactive') {
+ return interactiveScript;
+ }
+
+ eachReverse(scripts(), function (script) {
+ if (script.readyState === 'interactive') {
+ return (interactiveScript = script);
+ }
+ });
+ return interactiveScript;
+ }
+
+ //Look for a data-main script attribute, which could also adjust the baseUrl.
+ if (isBrowser && !cfg.skipDataMain) {
+ //Figure out baseUrl. Get it from the script tag with require.js in it.
+ eachReverse(scripts(), function (script) {
+ //Set the 'head' where we can append children by
+ //using the script's parent.
+ if (!head) {
+ head = script.parentNode;
+ }
+
+ //Look for a data-main attribute to set main script for the page
+ //to load. If it is there, the path to data main becomes the
+ //baseUrl, if it is not already set.
+ dataMain = script.getAttribute('data-main');
+ if (dataMain) {
+ //Preserve dataMain in case it is a path (i.e. contains '?')
+ mainScript = dataMain;
+
+ //Set final baseUrl if there is not already an explicit one.
+ if (!cfg.baseUrl) {
+ //Pull off the directory of data-main for use as the
+ //baseUrl.
+ src = mainScript.split('/');
+ mainScript = src.pop();
+ subPath = src.length ? src.join('/') + '/' : './';
+
+ cfg.baseUrl = subPath;
+ }
+
+ //Strip off any trailing .js since mainScript is now
+ //like a module name.
+ mainScript = mainScript.replace(jsSuffixRegExp, '');
+
+ //If mainScript is still a path, fall back to dataMain
+ if (req.jsExtRegExp.test(mainScript)) {
+ mainScript = dataMain;
+ }
+
+ //Put the data-main script in the files to load.
+ cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
+
+ return true;
+ }
+ });
+ }
+
+ /**
+ * The function that handles definitions of modules. Differs from
+ * require() in that a string for the module should be the first argument,
+ * and the function to execute after dependencies are loaded should
+ * return a value to define the module corresponding to the first argument's
+ * name.
+ */
+ define = function (name, deps, callback) {
+ var node, context;
+
+ //Allow for anonymous modules
+ if (typeof name !== 'string') {
+ //Adjust args appropriately
+ callback = deps;
+ deps = name;
+ name = null;
+ }
+
+ //This module may not have dependencies
+ if (!isArray(deps)) {
+ callback = deps;
+ deps = null;
+ }
+
+ //If no name, and callback is a function, then figure out if it a
+ //CommonJS thing with dependencies.
+ if (!deps && isFunction(callback)) {
+ deps = [];
+ //Remove comments from the callback string,
+ //look for require calls, and pull them into the dependencies,
+ //but only if there are function args.
+ if (callback.length) {
+ callback
+ .toString()
+ .replace(commentRegExp, '')
+ .replace(cjsRequireRegExp, function (match, dep) {
+ deps.push(dep);
+ });
+
+ //May be a CommonJS thing even without require calls, but still
+ //could use exports, and module. Avoid doing exports and module
+ //work though if it just needs require.
+ //REQUIRES the function to expect the CommonJS variables in the
+ //order listed below.
+ deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);
+ }
+ }
+
+ //If in IE 6-8 and hit an anonymous define() call, do the interactive
+ //work.
+ if (useInteractive) {
+ node = currentlyAddingScript || getInteractiveScript();
+ if (node) {
+ if (!name) {
+ name = node.getAttribute('data-requiremodule');
+ }
+ context = contexts[node.getAttribute('data-requirecontext')];
+ }
+ }
+
+ //Always save off evaluating the def call until the script onload handler.
+ //This allows multiple modules to be in a file without prematurely
+ //tracing dependencies, and allows for anonymous module support,
+ //where the module name is not known until the script onload event
+ //occurs. If no context, use the global queue, and get it processed
+ //in the onscript load callback.
+ (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+
+
+ /**
+ * Executes the text. Normally just uses eval, but can be modified
+ * to use a better, environment-specific call. Only used for transpiling
+ * loader plugins, not for plain JS modules.
+ * @param {String} text the text to execute/evaluate.
+ */
+ req.exec = function (text) {
+ /*jslint evil: true */
+ return eval(text);
+ };
+
+ //Set up with config info.
+ req(cfg);
+}(this));
diff --git a/contrail-webui/controller/require.min.js b/contrail-webui/controller/require.min.js
new file mode 100644
index 0000000..a1099cf
--- /dev/null
+++ b/contrail-webui/controller/require.min.js
@@ -0,0 +1,36 @@
+/*
+ RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+var requirejs,require,define;
+(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
+RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
+Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1==c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
+g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
+k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
+k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
+d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
+f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
+for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
+a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
+c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
+this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
+(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
+this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
+if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
+"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b,
+a);this.check()}));this.errback&&q(a,"error",u(this,this.errback))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b,registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,
+nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,
+a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n,q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=
+!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d,e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==
+e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&&s(a).enable()},completeLoad:function(a){var b,
+c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths;a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,
+e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)},onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror",
+"Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,
+Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p));n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};
+g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.14";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=
+b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&&!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):
+(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=
+O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b}),e=N;e&&(b||
+(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);
diff --git a/contrail-webui/controller/requirejs-2.1.15.tar.gz b/contrail-webui/controller/requirejs-2.1.15.tar.gz
new file mode 100644
index 0000000..f2e380e
--- /dev/null
+++ b/contrail-webui/controller/requirejs-2.1.15.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/restler-2.0.1.tgz b/contrail-webui/controller/restler-2.0.1.tgz
new file mode 100644
index 0000000..69eaf26
--- /dev/null
+++ b/contrail-webui/controller/restler-2.0.1.tgz
Binary files differ
diff --git a/contrail-webui/controller/select2-3.4.6.tar.gz b/contrail-webui/controller/select2-3.4.6.tar.gz
new file mode 100644
index 0000000..bb48d99
--- /dev/null
+++ b/contrail-webui/controller/select2-3.4.6.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/sinon-1.9.1.tgz b/contrail-webui/controller/sinon-1.9.1.tgz
new file mode 100644
index 0000000..846fe9a
--- /dev/null
+++ b/contrail-webui/controller/sinon-1.9.1.tgz
Binary files differ
diff --git a/contrail-webui/controller/ssh2-0.2.12.tgz b/contrail-webui/controller/ssh2-0.2.12.tgz
new file mode 100644
index 0000000..36b175c
--- /dev/null
+++ b/contrail-webui/controller/ssh2-0.2.12.tgz
Binary files differ
diff --git a/contrail-webui/controller/text.min.js b/contrail-webui/controller/text.min.js
new file mode 100644
index 0000000..07e8ab7
--- /dev/null
+++ b/contrail-webui/controller/text.min.js
@@ -0,0 +1 @@
+define(["module"],function(module){var text,fs,Cc,Ci,xpcIsWindows,progIds=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],xmlRegExp=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,bodyRegExp=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,hasLocation=typeof location!=="undefined"&&location.href,defaultProtocol=hasLocation&&location.protocol&&location.protocol.replace(/\:/,""),defaultHostName=hasLocation&&location.hostname,defaultPort=hasLocation&&(location.port||undefined),buildMap={},masterConfig=(module.config&&module.config())||{};text={version:"2.0.12",strip:function(content){if(content){content=content.replace(xmlRegExp,"");var matches=content.match(bodyRegExp);if(matches){content=matches[1]}}else{content=""}return content},jsEscape:function(content){return content.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:masterConfig.createXhr||function(){var xhr,i,progId;if(typeof XMLHttpRequest!=="undefined"){return new XMLHttpRequest()}else{if(typeof ActiveXObject!=="undefined"){for(i=0;i<3;i+=1){progId=progIds[i];try{xhr=new ActiveXObject(progId)}catch(e){}if(xhr){progIds=[progId];break}}}}return xhr},parseName:function(name){var modName,ext,temp,strip=false,index=name.indexOf("."),isRelative=name.indexOf("./")===0||name.indexOf("../")===0;if(index!==-1&&(!isRelative||index>1)){modName=name.substring(0,index);ext=name.substring(index+1,name.length)}else{modName=name}temp=ext||modName;index=temp.indexOf("!");if(index!==-1){strip=temp.substring(index+1)==="strip";temp=temp.substring(0,index);if(ext){ext=temp}else{modName=temp}}return{moduleName:modName,ext:ext,strip:strip}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(url,protocol,hostname,port){var uProtocol,uHostName,uPort,match=text.xdRegExp.exec(url);if(!match){return true}uProtocol=match[2];uHostName=match[3];uHostName=uHostName.split(":");uPort=uHostName[1];uHostName=uHostName[0];return(!uProtocol||uProtocol===protocol)&&(!uHostName||uHostName.toLowerCase()===hostname.toLowerCase())&&((!uPort&&!uHostName)||uPort===port)},finishLoad:function(name,strip,content,onLoad){content=strip?text.strip(content):content;if(masterConfig.isBuild){buildMap[name]=content}onLoad(content)},load:function(name,req,onLoad,config){if(config&&config.isBuild&&!config.inlineText){onLoad();return}masterConfig.isBuild=config&&config.isBuild;var parsed=text.parseName(name),nonStripName=parsed.moduleName+(parsed.ext?"."+parsed.ext:""),url=req.toUrl(nonStripName),useXhr=(masterConfig.useXhr)||text.useXhr;if(url.indexOf("empty:")===0){onLoad();return}if(!hasLocation||useXhr(url,defaultProtocol,defaultHostName,defaultPort)){text.get(url,function(content){text.finishLoad(name,parsed.strip,content,onLoad)},function(err){if(onLoad.error){onLoad.error(err)}})}else{req([nonStripName],function(content){text.finishLoad(parsed.moduleName+"."+parsed.ext,parsed.strip,content,onLoad)})}},write:function(pluginName,moduleName,write,config){if(buildMap.hasOwnProperty(moduleName)){var content=text.jsEscape(buildMap[moduleName]);write.asModule(pluginName+"!"+moduleName,"define(function () { return '"+content+"';});\n")}},writeFile:function(pluginName,moduleName,req,write,config){var parsed=text.parseName(moduleName),extPart=parsed.ext?"."+parsed.ext:"",nonStripName=parsed.moduleName+extPart,fileName=req.toUrl(parsed.moduleName+extPart)+".js";text.load(nonStripName,req,function(value){var textWrite=function(contents){return write(fileName,contents)};textWrite.asModule=function(moduleName,contents){return write.asModule(moduleName,fileName,contents)};text.write(pluginName,nonStripName,textWrite,config)},config)}};if(masterConfig.env==="node"||(!masterConfig.env&&typeof process!=="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"])){fs=require.nodeRequire("fs");text.get=function(url,callback,errback){try{var file=fs.readFileSync(url,"utf8");if(file.indexOf("\uFEFF")===0){file=file.substring(1)}callback(file)}catch(e){if(errback){errback(e)}}}}else{if(masterConfig.env==="xhr"||(!masterConfig.env&&text.createXhr())){text.get=function(url,callback,errback,headers){var xhr=text.createXhr(),header;xhr.open("GET",url,true);if(headers){for(header in headers){if(headers.hasOwnProperty(header)){xhr.setRequestHeader(header.toLowerCase(),headers[header])}}}if(masterConfig.onXhr){masterConfig.onXhr(xhr,url)}xhr.onreadystatechange=function(evt){var status,err;if(xhr.readyState===4){status=xhr.status||0;if(status>399&&status<600){err=new Error(url+" HTTP status: "+status);err.xhr=xhr;if(errback){errback(err)}}else{callback(xhr.responseText)}if(masterConfig.onXhrComplete){masterConfig.onXhrComplete(xhr,url)}}};xhr.send(null)}}else{if(masterConfig.env==="rhino"||(!masterConfig.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")){text.get=function(url,callback){var stringBuffer,line,encoding="utf-8",file=new java.io.File(url),lineSeparator=java.lang.System.getProperty("line.separator"),input=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file),encoding)),content="";try{stringBuffer=new java.lang.StringBuffer();line=input.readLine();if(line&&line.length()&&line.charAt(0)===65279){line=line.substring(1)}if(line!==null){stringBuffer.append(line)}while((line=input.readLine())!==null){stringBuffer.append(lineSeparator);stringBuffer.append(line)}content=String(stringBuffer.toString())}finally{input.close()}callback(content)}}else{if(masterConfig.env==="xpconnect"||(!masterConfig.env&&typeof Components!=="undefined"&&Components.classes&&Components.interfaces)){Cc=Components.classes;Ci=Components.interfaces;Components.utils["import"]("resource://gre/modules/FileUtils.jsm");xpcIsWindows=("@mozilla.org/windows-registry-key;1" in Cc);text.get=function(url,callback){var inStream,convertStream,fileObj,readData={};if(xpcIsWindows){url=url.replace(/\//g,"\\")}fileObj=new FileUtils.File(url);try{inStream=Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);inStream.init(fileObj,1,0,false);convertStream=Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(Ci.nsIConverterInputStream);convertStream.init(inStream,"utf-8",inStream.available(),Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);convertStream.readString(inStream.available(),readData);convertStream.close();inStream.close();callback(readData.value)}catch(e){throw new Error((fileObj&&fileObj.path||"")+": "+e)}}}}}}return text});
diff --git a/contrail-webui/controller/tristate-master.zip b/contrail-webui/controller/tristate-master.zip
new file mode 100644
index 0000000..c5647a2
--- /dev/null
+++ b/contrail-webui/controller/tristate-master.zip
Binary files differ
diff --git a/contrail-webui/controller/underscore-1.4.3.tgz b/contrail-webui/controller/underscore-1.4.3.tgz
new file mode 100644
index 0000000..065b510
--- /dev/null
+++ b/contrail-webui/controller/underscore-1.4.3.tgz
Binary files differ
diff --git a/contrail-webui/controller/underscore-1.8.3.tar.gz b/contrail-webui/controller/underscore-1.8.3.tar.gz
new file mode 100644
index 0000000..1c5323c
--- /dev/null
+++ b/contrail-webui/controller/underscore-1.8.3.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/uuid-js-0.7.4.tgz b/contrail-webui/controller/uuid-js-0.7.4.tgz
new file mode 100644
index 0000000..1af1dd6
--- /dev/null
+++ b/contrail-webui/controller/uuid-js-0.7.4.tgz
Binary files differ
diff --git a/contrail-webui/controller/uuid-js.0.7.5.js b/contrail-webui/controller/uuid-js.0.7.5.js
new file mode 100644
index 0000000..e962dee
--- /dev/null
+++ b/contrail-webui/controller/uuid-js.0.7.5.js
@@ -0,0 +1,240 @@
+/*
+ * UUID-js: A js library to generate and parse UUIDs, TimeUUIDs and generate
+ * TimeUUID based on dates for range selections.
+ * @see http://www.ietf.org/rfc/rfc4122.txt
+ **/
+
+function UUIDjs() {
+};
+
+UUIDjs.maxFromBits = function(bits) {
+ return Math.pow(2, bits);
+};
+
+UUIDjs.limitUI04 = UUIDjs.maxFromBits(4);
+UUIDjs.limitUI06 = UUIDjs.maxFromBits(6);
+UUIDjs.limitUI08 = UUIDjs.maxFromBits(8);
+UUIDjs.limitUI12 = UUIDjs.maxFromBits(12);
+UUIDjs.limitUI14 = UUIDjs.maxFromBits(14);
+UUIDjs.limitUI16 = UUIDjs.maxFromBits(16);
+UUIDjs.limitUI32 = UUIDjs.maxFromBits(32);
+UUIDjs.limitUI40 = UUIDjs.maxFromBits(40);
+UUIDjs.limitUI48 = UUIDjs.maxFromBits(48);
+
+// Returns a random integer between min and max
+// Using Math.round() will give you a non-uniform distribution!
+// @see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math/random
+function getRandomInt(min, max) {
+ return Math.floor(Math.random() * (max - min + 1)) + min;
+}
+
+UUIDjs.randomUI04 = function() {
+ return getRandomInt(0, UUIDjs.limitUI04-1);
+};
+UUIDjs.randomUI06 = function() {
+ return getRandomInt(0, UUIDjs.limitUI06-1);
+};
+UUIDjs.randomUI08 = function() {
+ return getRandomInt(0, UUIDjs.limitUI08-1);
+};
+UUIDjs.randomUI12 = function() {
+ return getRandomInt(0, UUIDjs.limitUI12-1);
+};
+UUIDjs.randomUI14 = function() {
+ return getRandomInt(0, UUIDjs.limitUI14-1);
+};
+UUIDjs.randomUI16 = function() {
+ return getRandomInt(0, UUIDjs.limitUI16-1);
+};
+UUIDjs.randomUI32 = function() {
+ return getRandomInt(0, UUIDjs.limitUI32-1);
+};
+UUIDjs.randomUI40 = function() {
+ return (0 | Math.random() * (1 << 30)) + (0 | Math.random() * (1 << 40 - 30)) * (1 << 30);
+};
+UUIDjs.randomUI48 = function() {
+ return (0 | Math.random() * (1 << 30)) + (0 | Math.random() * (1 << 48 - 30)) * (1 << 30);
+};
+
+UUIDjs.paddedString = function(string, length, z) {
+ string = String(string);
+ z = (!z) ? '0' : z;
+ var i = length - string.length;
+ for (; i > 0; i >>>= 1, z += z) {
+ if (i & 1) {
+ string = z + string;
+ }
+ }
+ return string;
+};
+
+UUIDjs.prototype.fromParts = function(timeLow, timeMid, timeHiAndVersion, clockSeqHiAndReserved, clockSeqLow, node) {
+ this.version = (timeHiAndVersion >> 12) & 0xF;
+ this.hex = UUIDjs.paddedString(timeLow.toString(16), 8)
+ + '-'
+ + UUIDjs.paddedString(timeMid.toString(16), 4)
+ + '-'
+ + UUIDjs.paddedString(timeHiAndVersion.toString(16), 4)
+ + '-'
+ + UUIDjs.paddedString(clockSeqHiAndReserved.toString(16), 2)
+ + UUIDjs.paddedString(clockSeqLow.toString(16), 2)
+ + '-'
+ + UUIDjs.paddedString(node.toString(16), 12);
+ return this;
+};
+
+UUIDjs.prototype.toString = function() {
+ return this.hex;
+};
+UUIDjs.prototype.toURN = function() {
+ return 'urn:uuid:' + this.hex;
+};
+
+UUIDjs.prototype.toBytes = function() {
+ var parts = this.hex.split('-');
+ var ints = [];
+ var intPos = 0;
+ for (var i = 0; i < parts.length; i++) {
+ for (var j = 0; j < parts[i].length; j+=2) {
+ ints[intPos++] = parseInt(parts[i].substr(j, 2), 16);
+ }
+ }
+ return ints;
+};
+
+UUIDjs.prototype.equals = function(uuid) {
+ if (!(uuid instanceof UUID)) {
+ return false;
+ }
+ if (this.hex !== uuid.hex) {
+ return false;
+ }
+ return true;
+};
+
+UUIDjs.getTimeFieldValues = function(time) {
+ var ts = time - Date.UTC(1582, 9, 15);
+ var hm = ((ts / 0x100000000) * 10000) & 0xFFFFFFF;
+ return { low: ((ts & 0xFFFFFFF) * 10000) % 0x100000000,
+ mid: hm & 0xFFFF, hi: hm >>> 16, timestamp: ts };
+};
+
+UUIDjs._create4 = function() {
+ return new UUIDjs().fromParts(
+ UUIDjs.randomUI32(),
+ UUIDjs.randomUI16(),
+ 0x4000 | UUIDjs.randomUI12(),
+ 0x80 | UUIDjs.randomUI06(),
+ UUIDjs.randomUI08(),
+ UUIDjs.randomUI48()
+ );
+};
+
+UUIDjs._create1 = function() {
+ var now = new Date().getTime();
+ var sequence = UUIDjs.randomUI14();
+ var node = (UUIDjs.randomUI08() | 1) * 0x10000000000 + UUIDjs.randomUI40();
+ var tick = UUIDjs.randomUI04();
+ var timestamp = 0;
+ var timestampRatio = 1/4;
+
+ if (now != timestamp) {
+ if (now < timestamp) {
+ sequence++;
+ }
+ timestamp = now;
+ tick = UUIDjs.randomUI04();
+ } else if (Math.random() < timestampRatio && tick < 9984) {
+ tick += 1 + UUIDjs.randomUI04();
+ } else {
+ sequence++;
+ }
+
+ var tf = UUIDjs.getTimeFieldValues(timestamp);
+ var tl = tf.low + tick;
+ var thav = (tf.hi & 0xFFF) | 0x1000;
+
+ sequence &= 0x3FFF;
+ var cshar = (sequence >>> 8) | 0x80;
+ var csl = sequence & 0xFF;
+
+ return new UUIDjs().fromParts(tl, tf.mid, thav, cshar, csl, node);
+};
+
+UUIDjs.create = function(version) {
+ version = version || 4;
+ return this['_create' + version]();
+};
+
+UUIDjs.fromTime = function(time, last) {
+ last = (!last) ? false : last;
+ var tf = UUIDjs.getTimeFieldValues(time);
+ var tl = tf.low;
+ var thav = (tf.hi & 0xFFF) | 0x1000; // set version '0001'
+ if (last === false) {
+ return new UUIDjs().fromParts(tl, tf.mid, thav, 0, 0, 0);
+ } else {
+ return new UUIDjs().fromParts(tl, tf.mid, thav, 0x80 | UUIDjs.limitUI06, UUIDjs.limitUI08 - 1, UUIDjs.limitUI48 - 1);
+ }
+};
+
+UUIDjs.firstFromTime = function(time) {
+ return UUIDjs.fromTime(time, false);
+};
+UUIDjs.lastFromTime = function(time) {
+ return UUIDjs.fromTime(time, true);
+};
+
+UUIDjs.fromURN = function(strId) {
+ var r, p = /^(?:urn:uuid:|\{)?([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})(?:\})?$/i;
+ if ((r = p.exec(strId))) {
+ return new UUIDjs().fromParts(parseInt(r[1], 16), parseInt(r[2], 16),
+ parseInt(r[3], 16), parseInt(r[4], 16),
+ parseInt(r[5], 16), parseInt(r[6], 16));
+ }
+ return null;
+};
+
+UUIDjs.fromBytes = function(ints) {
+ if (ints.length < 5) {
+ return null;
+ }
+ var str = '';
+ var pos = 0;
+ var parts = [4, 2, 2, 2, 6];
+ for (var i = 0; i < parts.length; i++) {
+ for (var j = 0; j < parts[i]; j++) {
+ var octet = ints[pos++].toString(16);
+ if (octet.length == 1) {
+ octet = '0' + octet;
+ }
+ str += octet;
+ }
+ if (parts[i] !== 6) {
+ str += '-';
+ }
+ }
+ return UUIDjs.fromURN(str);
+};
+
+UUIDjs.fromBinary = function(binary) {
+ var ints = [];
+ for (var i = 0; i < binary.length; i++) {
+ ints[i] = binary.charCodeAt(i);
+ if (ints[i] > 255 || ints[i] < 0) {
+ throw new Error('Unexpected byte in binary data.');
+ }
+ }
+ return UUIDjs.fromBytes(ints);
+};
+
+// Aliases to support legacy code. Do not use these when writing new code as
+// they may be removed in future versions!
+UUIDjs.new = function() {
+ return this.create(4);
+};
+UUIDjs.newTS = function() {
+ return this.create(1);
+};
+
+//module.exports = UUIDjs;
diff --git a/contrail-webui/controller/uuid.js b/contrail-webui/controller/uuid.js
new file mode 100644
index 0000000..ee4b388
--- /dev/null
+++ b/contrail-webui/controller/uuid.js
@@ -0,0 +1,233 @@
+/*
+ * UUID-js: A js library to generate and parse UUIDs, TimeUUIDs and generate
+ * TimeUUID based on dates for range selections.
+ * @see http://www.ietf.org/rfc/rfc4122.txt
+ **/
+
+function UUIDjs() {
+};
+
+UUIDjs.maxFromBits = function(bits) {
+ return Math.pow(2, bits);
+};
+
+UUIDjs.limitUI04 = UUIDjs.maxFromBits(4);
+UUIDjs.limitUI06 = UUIDjs.maxFromBits(6);
+UUIDjs.limitUI08 = UUIDjs.maxFromBits(8);
+UUIDjs.limitUI12 = UUIDjs.maxFromBits(12);
+UUIDjs.limitUI14 = UUIDjs.maxFromBits(14);
+UUIDjs.limitUI16 = UUIDjs.maxFromBits(16);
+UUIDjs.limitUI32 = UUIDjs.maxFromBits(32);
+UUIDjs.limitUI40 = UUIDjs.maxFromBits(40);
+UUIDjs.limitUI48 = UUIDjs.maxFromBits(48);
+
+UUIDjs.randomUI04 = function() {
+ return Math.round(Math.random() * UUIDjs.limitUI04);
+};
+UUIDjs.randomUI06 = function() {
+ return Math.round(Math.random() * UUIDjs.limitUI06);
+};
+UUIDjs.randomUI08 = function() {
+ return Math.round(Math.random() * UUIDjs.limitUI08);
+};
+UUIDjs.randomUI12 = function() {
+ return Math.round(Math.random() * UUIDjs.limitUI12);
+};
+UUIDjs.randomUI14 = function() {
+ return Math.round(Math.random() * UUIDjs.limitUI14);
+};
+UUIDjs.randomUI16 = function() {
+ return Math.round(Math.random() * UUIDjs.limitUI16);
+};
+UUIDjs.randomUI32 = function() {
+ return Math.round(Math.random() * UUIDjs.limitUI32);
+};
+UUIDjs.randomUI40 = function() {
+ return (0 | Math.random() * (1 << 30)) + (0 | Math.random() * (1 << 40 - 30)) * (1 << 30);
+};
+UUIDjs.randomUI48 = function() {
+ return (0 | Math.random() * (1 << 30)) + (0 | Math.random() * (1 << 48 - 30)) * (1 << 30);
+};
+
+UUIDjs.paddedString = function(string, length, z) {
+ string = String(string);
+ z = (!z) ? '0' : z;
+ var i = length - string.length;
+ for (; i > 0; i >>>= 1, z += z) {
+ if (i & 1) {
+ string = z + string;
+ }
+ }
+ return string;
+};
+
+UUIDjs.prototype.fromParts = function(timeLow, timeMid, timeHiAndVersion, clockSeqHiAndReserved, clockSeqLow, node) {
+ this.version = (timeHiAndVersion >> 12) & 0xF;
+ this.hex = UUIDjs.paddedString(timeLow.toString(16), 8)
+ + '-'
+ + UUIDjs.paddedString(timeMid.toString(16), 4)
+ + '-'
+ + UUIDjs.paddedString(timeHiAndVersion.toString(16), 4)
+ + '-'
+ + UUIDjs.paddedString(clockSeqHiAndReserved.toString(16), 2)
+ + UUIDjs.paddedString(clockSeqLow.toString(16), 2)
+ + '-'
+ + UUIDjs.paddedString(node.toString(16), 12);
+ return this;
+};
+
+UUIDjs.prototype.toString = function() {
+ return this.hex;
+};
+UUIDjs.prototype.toURN = function() {
+ return 'urn:uuid:' + this.hex;
+};
+
+UUIDjs.prototype.toBytes = function() {
+ var parts = this.hex.split('-');
+ var ints = [];
+ var intPos = 0;
+ for (var i = 0; i < parts.length; i++) {
+ for (var j = 0; j < parts[i].length; j+=2) {
+ ints[intPos++] = parseInt(parts[i].substr(j, 2), 16);
+ }
+ }
+ return ints;
+};
+
+UUIDjs.prototype.equals = function(uuid) {
+ if (!(uuid instanceof UUID)) {
+ return false;
+ }
+ if (this.hex !== uuid.hex) {
+ return false;
+ }
+ return true;
+};
+
+UUIDjs.getTimeFieldValues = function(time) {
+ var ts = time - Date.UTC(1582, 9, 15);
+ var hm = ((ts / 0x100000000) * 10000) & 0xFFFFFFF;
+ return { low: ((ts & 0xFFFFFFF) * 10000) % 0x100000000,
+ mid: hm & 0xFFFF, hi: hm >>> 16, timestamp: ts };
+};
+
+UUIDjs._create4 = function() {
+ return new UUIDjs().fromParts(
+ UUIDjs.randomUI32(),
+ UUIDjs.randomUI16(),
+ 0x4000 | UUIDjs.randomUI12(),
+ 0x80 | UUIDjs.randomUI06(),
+ UUIDjs.randomUI08(),
+ UUIDjs.randomUI48()
+ );
+};
+
+UUIDjs._create1 = function() {
+ var now = new Date().getTime();
+ var sequence = UUIDjs.randomUI14();
+ var node = (UUIDjs.randomUI08() | 1) * 0x10000000000 + UUIDjs.randomUI40();
+ var tick = UUIDjs.randomUI04();
+ var timestamp = 0;
+ var timestampRatio = 1/4;
+
+ if (now != timestamp) {
+ if (now < timestamp) {
+ sequence++;
+ }
+ timestamp = now;
+ tick = UUIDjs.randomUI04();
+ } else if (Math.random() < timestampRatio && tick < 9984) {
+ tick += 1 + UUIDjs.randomUI04();
+ } else {
+ sequence++;
+ }
+
+ var tf = UUIDjs.getTimeFieldValues(timestamp);
+ var tl = tf.low + tick;
+ var thav = (tf.hi & 0xFFF) | 0x1000;
+
+ sequence &= 0x3FFF;
+ var cshar = (sequence >>> 8) | 0x80;
+ var csl = sequence & 0xFF;
+
+ return new UUIDjs().fromParts(tl, tf.mid, thav, cshar, csl, node);
+};
+
+UUIDjs.create = function(version) {
+ version = version || 4;
+ return this['_create' + version]();
+};
+
+UUIDjs.fromTime = function(time, last) {
+ last = (!last) ? false : last;
+ var tf = UUIDjs.getTimeFieldValues(time);
+ var tl = tf.low;
+ var thav = (tf.hi & 0xFFF) | 0x1000; // set version '0001'
+ if (last === false) {
+ return new UUIDjs().fromParts(tl, tf.mid, thav, 0, 0, 0);
+ } else {
+ return new UUIDjs().fromParts(tl, tf.mid, thav, 0x80 | UUIDjs.limitUI06, UUIDjs.limitUI08 - 1, UUIDjs.limitUI48 - 1);
+ }
+};
+
+UUIDjs.firstFromTime = function(time) {
+ return UUIDjs.fromTime(time, false);
+};
+UUIDjs.lastFromTime = function(time) {
+ return UUIDjs.fromTime(time, true);
+};
+
+UUIDjs.fromURN = function(strId) {
+ var r, p = /^(?:urn:uuid:|\{)?([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})(?:\})?$/i;
+ if ((r = p.exec(strId))) {
+ return new UUIDjs().fromParts(parseInt(r[1], 16), parseInt(r[2], 16),
+ parseInt(r[3], 16), parseInt(r[4], 16),
+ parseInt(r[5], 16), parseInt(r[6], 16));
+ }
+ return null;
+};
+
+UUIDjs.fromBytes = function(ints) {
+ if (ints.length < 5) {
+ return null;
+ }
+ var str = '';
+ var pos = 0;
+ var parts = [4, 2, 2, 2, 6];
+ for (var i = 0; i < parts.length; i++) {
+ for (var j = 0; j < parts[i]; j++) {
+ var octet = ints[pos++].toString(16);
+ if (octet.length == 1) {
+ octet = '0' + octet;
+ }
+ str += octet;
+ }
+ if (parts[i] !== 6) {
+ str += '-';
+ }
+ }
+ return UUIDjs.fromURN(str);
+};
+
+UUIDjs.fromBinary = function(binary) {
+ var ints = [];
+ for (var i = 0; i < binary.length; i++) {
+ ints[i] = binary.charCodeAt(i);
+ if (ints[i] > 255 || ints[i] < 0) {
+ throw new Error('Unexpected byte in binary data.');
+ }
+ }
+ return UUIDjs.fromBytes(ints);
+};
+
+// Aliases to support legacy code. Do not use these when writing new code as
+// they may be removed in future versions!
+UUIDjs.new = function() {
+ return this.create(4);
+};
+UUIDjs.newTS = function() {
+ return this.create(1);
+};
+
+//module.exports = UUIDjs;
diff --git a/contrail-webui/controller/vis-v4.9.0.zip b/contrail-webui/controller/vis-v4.9.0.zip
new file mode 100644
index 0000000..6291e4f
--- /dev/null
+++ b/contrail-webui/controller/vis-v4.9.0.zip
Binary files differ
diff --git a/contrail-webui/controller/winston-0.6.2.tgz b/contrail-webui/controller/winston-0.6.2.tgz
new file mode 100644
index 0000000..f3b3cc1
--- /dev/null
+++ b/contrail-webui/controller/winston-0.6.2.tgz
Binary files differ
diff --git a/contrail-webui/controller/x2js-1.2.0.tar.gz b/contrail-webui/controller/x2js-1.2.0.tar.gz
new file mode 100644
index 0000000..cda3ac3
--- /dev/null
+++ b/contrail-webui/controller/x2js-1.2.0.tar.gz
Binary files differ
diff --git a/contrail-webui/controller/xdate-0.7.js b/contrail-webui/controller/xdate-0.7.js
new file mode 100644
index 0000000..53d27a7
--- /dev/null
+++ b/contrail-webui/controller/xdate-0.7.js
@@ -0,0 +1,18 @@
+/*
+ XDate v0.7
+ Docs & Licensing: http://arshaw.com/xdate/
+*/
+var XDate=function(g,m,A,p){function f(){var a=this instanceof f?this:new f,c=arguments,b=c.length,d;typeof c[b-1]=="boolean"&&(d=c[--b],c=q(c,0,b));if(b)if(b==1)if(b=c[0],b instanceof g||typeof b=="number")a[0]=new g(+b);else if(b instanceof f){var c=a,h=new g(+b[0]);if(l(b))h.toString=w;c[0]=h}else{if(typeof b=="string"){a[0]=new g(0);a:{for(var c=b,b=d||!1,h=f.parsers,r=0,e;r<h.length;r++)if(e=h[r](c,b,a)){a=e;break a}a[0]=new g(c)}}}else a[0]=new g(n.apply(g,c)),d||(a[0]=s(a[0]));else a[0]=new g;
+typeof d=="boolean"&&B(a,d);return a}function l(a){return a[0].toString===w}function B(a,c,b){if(c){if(!l(a))b&&(a[0]=new g(n(a[0].getFullYear(),a[0].getMonth(),a[0].getDate(),a[0].getHours(),a[0].getMinutes(),a[0].getSeconds(),a[0].getMilliseconds()))),a[0].toString=w}else l(a)&&(a[0]=b?s(a[0]):new g(+a[0]));return a}function C(a,c,b,d,h){var e=k(j,a[0],h),a=k(D,a[0],h),h=c==1?b%12:e(1),f=!1;d.length==2&&typeof d[1]=="boolean"&&(f=d[1],d=[b]);a(c,d);f&&e(1)!=h&&(a(1,[e(1)-1]),a(2,[E(e(0),e(1))]))}
+function F(a,c,b,d){var b=Number(b),h=m.floor(b);a["set"+o[c]](a["get"+o[c]]()+h,d||!1);h!=b&&c<6&&F(a,c+1,(b-h)*G[c],d)}function H(a,c,b){var a=a.clone().setUTCMode(!0,!0),c=f(c).setUTCMode(!0,!0),d=0;if(b==0||b==1){for(var h=6;h>=b;h--)d/=G[h],d+=j(c,!1,h)-j(a,!1,h);b==1&&(d+=(c.getFullYear()-a.getFullYear())*12)}else b==2?(b=a.toDate().setUTCHours(0,0,0,0),d=c.toDate().setUTCHours(0,0,0,0),d=m.round((d-b)/864E5)+(c-d-(a-b))/864E5):d=(c-a)/[36E5,6E4,1E3,1][b-3];return d}function t(a){var c=a(0),
+b=a(1),a=a(2),b=new g(n(c,b,a)),d=u(c),a=d;b<d?a=u(c-1):(c=u(c+1),b>=c&&(a=c));return m.floor(m.round((b-a)/864E5)/7)+1}function u(a){a=new g(n(a,0,4));a.setUTCDate(a.getUTCDate()-(a.getUTCDay()+6)%7);return a}function I(a,c,b,d){var h=k(j,a,d),e=k(D,a,d),b=u(b===p?h(0):b);d||(b=s(b));a.setTime(+b);e(2,[h(2)+(c-1)*7])}function J(a,c,b,d,e){var r=f.locales,g=r[f.defaultLocale]||{},i=k(j,a,e),b=(typeof b=="string"?r[b]:b)||{};return x(a,c,function(a){if(d)for(var b=(a==7?2:a)-1;b>=0;b--)d.push(i(b));
+return i(a)},function(a){return b[a]||g[a]},e)}function x(a,c,b,d,e){for(var f,g,i="";f=c.match(M);){i+=c.substr(0,f.index);if(f[1]){g=i;for(var i=a,j=f[1],l=b,m=d,n=e,k=j.length,o=void 0,q="";k>0;)o=N(i,j.substr(0,k),l,m,n),o!==p?(q+=o,j=j.substr(k),k=j.length):k--;i=g+(q+j)}else f[3]?(g=x(a,f[4],b,d,e),parseInt(g.replace(/\D/g,""),10)&&(i+=g)):i+=f[7]||"'";c=c.substr(f.index+f[0].length)}return i+c}function N(a,c,b,d,e){var g=f.formatters[c];if(typeof g=="string")return x(a,g,b,d,e);else if(typeof g==
+"function")return g(a,e||!1,d);switch(c){case "fff":return i(b(6),3);case "s":return b(5);case "ss":return i(b(5));case "m":return b(4);case "mm":return i(b(4));case "h":return b(3)%12||12;case "hh":return i(b(3)%12||12);case "H":return b(3);case "HH":return i(b(3));case "d":return b(2);case "dd":return i(b(2));case "ddd":return d("dayNamesShort")[b(7)]||"";case "dddd":return d("dayNames")[b(7)]||"";case "M":return b(1)+1;case "MM":return i(b(1)+1);case "MMM":return d("monthNamesShort")[b(1)]||"";
+case "MMMM":return d("monthNames")[b(1)]||"";case "yy":return(b(0)+"").substring(2);case "yyyy":return b(0);case "t":return v(b,d).substr(0,1).toLowerCase();case "tt":return v(b,d).toLowerCase();case "T":return v(b,d).substr(0,1);case "TT":return v(b,d);case "z":case "zz":case "zzz":return e?c="Z":(d=a.getTimezoneOffset(),a=d<0?"+":"-",b=m.floor(m.abs(d)/60),d=m.abs(d)%60,e=b,c=="zz"?e=i(b):c=="zzz"&&(e=i(b)+":"+i(d)),c=a+e),c;case "w":return t(b);case "ww":return i(t(b));case "S":return c=b(2),c>
+10&&c<20?"th":["st","nd","rd"][c%10-1]||"th"}}function v(a,c){return a(3)<12?c("amDesignator"):c("pmDesignator")}function y(a){return!isNaN(+a[0])}function j(a,c,b){return a["get"+(c?"UTC":"")+o[b]]()}function D(a,c,b,d){a["set"+(c?"UTC":"")+o[b]].apply(a,d)}function s(a){return new g(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds())}function E(a,c){return 32-(new g(n(a,c,32))).getUTCDate()}function z(a){return function(){return a.apply(p,
+[this].concat(q(arguments)))}}function k(a){var c=q(arguments,1);return function(){return a.apply(p,c.concat(q(arguments)))}}function q(a,c,b){return A.prototype.slice.call(a,c||0,b===p?a.length:b)}function K(a,c){for(var b=0;b<a.length;b++)c(a[b],b)}function i(a,c){c=c||2;for(a+="";a.length<c;)a="0"+a;return a}var o="FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds,Day,Year".split(","),L=["Years","Months","Days"],G=[12,31,24,60,60,1E3,1],M=/(([a-zA-Z])\2*)|(\((('.*?'|\(.*?\)|.)*?)\))|('(.*?)')/,
+n=g.UTC,w=g.prototype.toUTCString,e=f.prototype;e.length=1;e.splice=A.prototype.splice;e.getUTCMode=z(l);e.setUTCMode=z(B);e.getTimezoneOffset=function(){return l(this)?0:this[0].getTimezoneOffset()};K(o,function(a,c){e["get"+a]=function(){return j(this[0],l(this),c)};c!=8&&(e["getUTC"+a]=function(){return j(this[0],!0,c)});c!=7&&(e["set"+a]=function(a){C(this,c,a,arguments,l(this));return this},c!=8&&(e["setUTC"+a]=function(a){C(this,c,a,arguments,!0);return this},e["add"+(L[c]||a)]=function(a,d){F(this,
+c,a,d);return this},e["diff"+(L[c]||a)]=function(a){return H(this,a,c)}))});e.getWeek=function(){return t(k(j,this,!1))};e.getUTCWeek=function(){return t(k(j,this,!0))};e.setWeek=function(a,c){I(this,a,c,!1);return this};e.setUTCWeek=function(a,c){I(this,a,c,!0);return this};e.addWeeks=function(a){return this.addDays(Number(a)*7)};e.diffWeeks=function(a){return H(this,a,2)/7};f.parsers=[function(a,c,b){if(a=a.match(/^(\d{4})(-(\d{2})(-(\d{2})([T ](\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/)){var d=
+new g(n(a[1],a[3]?a[3]-1:0,a[5]||1,a[7]||0,a[8]||0,a[10]||0,a[12]?Number("0."+a[12])*1E3:0));a[13]?a[14]&&d.setUTCMinutes(d.getUTCMinutes()+(a[15]=="-"?1:-1)*(Number(a[16])*60+(a[18]?Number(a[18]):0))):c||(d=s(d));return b.setTime(+d)}}];f.parse=function(a){return+f(""+a)};e.toString=function(a,c,b){return a===p||!y(this)?this[0].toString():J(this,a,c,b,l(this))};e.toUTCString=e.toGMTString=function(a,c,b){return a===p||!y(this)?this[0].toUTCString():J(this,a,c,b,!0)};e.toISOString=function(){return this.toUTCString("yyyy-MM-dd'T'HH:mm:ss(.fff)zzz")};
+f.defaultLocale="";f.locales={"":{monthNames:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthNamesShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),dayNames:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),dayNamesShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),amDesignator:"AM",pmDesignator:"PM"}};f.formatters={i:"yyyy-MM-dd'T'HH:mm:ss(.fff)",u:"yyyy-MM-dd'T'HH:mm:ss(.fff)zzz"};K("getTime,valueOf,toDateString,toTimeString,toLocaleString,toLocaleDateString,toLocaleTimeString,toJSON".split(","),
+function(a){e[a]=function(){return this[0][a]()}});e.setTime=function(a){this[0].setTime(a);return this};e.valid=z(y);e.clone=function(){return new f(this)};e.clearTime=function(){return this.setHours(0,0,0,0)};e.toDate=function(){return new g(+this[0])};f.now=function(){return+new g};f.today=function(){return(new f).clearTime()};f.UTC=n;f.getDaysInMonth=E;if(typeof module!=="undefined"&&module.exports)module.exports=f;return f}(Date,Math,Array);
diff --git a/contrail-webui/controller/xjAJXh38I15wypJXxuGMBrrIa-7acMAeDBVuclsi6Gc.woff b/contrail-webui/controller/xjAJXh38I15wypJXxuGMBrrIa-7acMAeDBVuclsi6Gc.woff
new file mode 100644
index 0000000..c5f6bac
--- /dev/null
+++ b/contrail-webui/controller/xjAJXh38I15wypJXxuGMBrrIa-7acMAeDBVuclsi6Gc.woff
Binary files differ
diff --git a/contrail-webui/controller/xml2js-0.2.3.tgz b/contrail-webui/controller/xml2js-0.2.3.tgz
new file mode 100644
index 0000000..bdba015
--- /dev/null
+++ b/contrail-webui/controller/xml2js-0.2.3.tgz
Binary files differ
diff --git a/contrail-webui/server-manager/backbone-min.js b/contrail-webui/server-manager/backbone-min.js
new file mode 100644
index 0000000..8ea4b13
--- /dev/null
+++ b/contrail-webui/server-manager/backbone-min.js
@@ -0,0 +1,2 @@
+(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h<u;h++){t=o[h];if(a=this._events[t]){this._events[t]=s=[];if(e||r){for(l=0,f=a.length;l<f;l++){n=a[l];if(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context){s.push(n)}}}if(!s.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)f(i,e);if(r)f(r,arguments);return this},stopListening:function(t,e,r){var s=this._listeningTo;if(!s)return this;var n=!e&&!r;if(!r&&typeof e==="object")r=this;if(t)(s={})[t._listenId]=t;for(var a in s){t=s[a];t.off(e,r,this);if(n||i.isEmpty(t._events))delete this._listeningTo[a]}return this}};var l=/\s+/;var c=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(l.test(i)){var n=i.split(l);for(var a=0,o=n.length;a<o;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var f=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,o);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e);return}};var d={listenTo:"on",listenToOnce:"once"};i.each(d,function(t,e){u[e]=function(e,r,s){var n=this._listeningTo||(this._listeningTo={});var a=e._listenId||(e._listenId=i.uniqueId("l"));n[a]=e;if(!s&&typeof r==="object")s=this;e[t](r,s,this);return this}});u.bind=u.on;u.unbind=u.off;i.extend(e,u);var p=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(p.prototype,u,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,r){var s,n,a,o,h,u,l,c;if(t==null)return this;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;a=r.unset;h=r.silent;o=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=i.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in n)this.id=n[this.idAttribute];for(s in n){e=n[s];if(!i.isEqual(c[s],e))o.push(s);if(!i.isEqual(l[s],e)){this.changed[s]=e}else{delete this.changed[s]}a?delete c[s]:c[s]=e}if(!h){if(o.length)this._pending=r;for(var f=0,d=o.length;f<d;f++){this.trigger("change:"+o[f],this,c[o[f]],r)}}if(u)return this;if(!h){while(this._pending){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e,r=false;var s=this._changing?this._previousAttributes:this.attributes;for(var n in t){if(i.isEqual(s[n],e=t[n]))continue;(r||(r={}))[n]=e}return r},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var r=t.success;t.success=function(i){if(!e.set(e.parse(i,t),t))return false;if(r)r(e,i,t);e.trigger("sync",e,i,t)};q(this,t);return this.sync("read",this,t)},save:function(t,e,r){var s,n,a,o=this.attributes;if(t==null||typeof t==="object"){s=t;r=e}else{(s={})[t]=e}r=i.extend({validate:true},r);if(s&&!r.wait){if(!this.set(s,r))return false}else{if(!this._validate(s,r))return false}if(s&&r.wait){this.attributes=i.extend({},o,s)}if(r.parse===void 0)r.parse=true;var h=this;var u=r.success;r.success=function(t){h.attributes=o;var e=h.parse(t,r);if(r.wait)e=i.extend(s||{},e);if(i.isObject(e)&&!h.set(e,r)){return false}if(u)u(h,t,r);h.trigger("sync",h,t,r)};q(this,r);n=this.isNew()?"create":r.patch?"patch":"update";if(n==="patch")r.attrs=s;a=this.sync(n,this,r);if(s&&r.wait)this.attributes=o;return a},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var s=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(t.wait||e.isNew())s();if(r)r(e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};if(this.isNew()){t.success();return false}q(this,t);var n=this.sync("delete",this,t);if(!t.wait)s();return n},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;return t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var v=["keys","values","pairs","invert","pick","omit"];i.each(v,function(t){p.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.attributes);return i[t].apply(i,e)}});var g=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,remove:false};i.extend(g.prototype,u,{model:p,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,y))},remove:function(t,e){var r=!i.isArray(t);t=r?[t]:i.clone(t);e||(e={});var s,n,a,o;for(s=0,n=t.length;s<n;s++){o=t[s]=this.get(t[s]);if(!o)continue;delete this._byId[o.id];delete this._byId[o.cid];a=this.indexOf(o);this.models.splice(a,1);this.length--;if(!e.silent){e.index=a;o.trigger("remove",o,this,e)}this._removeReference(o,e)}return r?t[0]:t},set:function(t,e){e=i.defaults({},e,m);if(e.parse)t=this.parse(t,e);var r=!i.isArray(t);t=r?t?[t]:[]:i.clone(t);var s,n,a,o,h,u,l;var c=e.at;var f=this.model;var d=this.comparator&&c==null&&e.sort!==false;var v=i.isString(this.comparator)?this.comparator:null;var g=[],y=[],_={};var b=e.add,w=e.merge,x=e.remove;var E=!d&&b&&x?[]:false;for(s=0,n=t.length;s<n;s++){h=t[s]||{};if(h instanceof p){a=o=h}else{a=h[f.prototype.idAttribute||"id"]}if(u=this.get(a)){if(x)_[u.cid]=true;if(w){h=h===o?o.attributes:h;if(e.parse)h=u.parse(h,e);u.set(h,e);if(d&&!l&&u.hasChanged(v))l=true}t[s]=u}else if(b){o=t[s]=this._prepareModel(h,e);if(!o)continue;g.push(o);this._addReference(o,e)}o=u||o;if(E&&(o.isNew()||!_[o.id]))E.push(o);_[o.id]=true}if(x){for(s=0,n=this.length;s<n;++s){if(!_[(o=this.models[s]).cid])y.push(o)}if(y.length)this.remove(y,e)}if(g.length||E&&E.length){if(d)l=true;this.length+=g.length;if(c!=null){for(s=0,n=g.length;s<n;s++){this.models.splice(c+s,0,g[s])}}else{if(E)this.models.length=0;var k=E||g;for(s=0,n=k.length;s<n;s++){this.models.push(k[s])}}}if(l)this.sort({silent:true});if(!e.silent){for(s=0,n=g.length;s<n;s++){(o=g[s]).trigger("add",o,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}return r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,s=this.models.length;r<s;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){if(i.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(i.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(i.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var r=this;t.success=function(i){var s=t.reset?"reset":"set";r[s](i,t);if(e)e(r,i,t);r.trigger("sync",r,i,t)};q(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var r=this;var s=e.success;e.success=function(t,i){if(e.wait)r.add(t,e);if(s)s(t,i,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof p)return t;e=e?i.clone(e):{};e.collection=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_addReference:function(t,e){this._byId[t.cid]=t;if(t.id!=null)this._byId[t.id]=t;if(!t.collection)t.collection=this;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["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"];i.each(_,function(t){g.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.models);return i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){g.prototype[t]=function(e,r){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,r)}});var w=e.View=function(t){this.cid=i.uniqueId("view");t||(t={});i.extend(this,i.pick(t,E));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];i.extend(w.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,i){if(this.$el)this.undelegateEvents();this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0];if(i!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=i.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[t[e]];if(!r)continue;var s=e.match(x);var n=s[1],a=s[2];r=i.bind(r,this);n+=".delegateEvents"+this.cid;if(a===""){this.$el.on(n,r)}else{this.$el.on(n,a,r)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");var r=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);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 r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow;this.navigate(r)}if(this._hasPushState){e.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!n){e.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=r;var o=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()&&o.hash){this.fragment=this.getHash().replace(R,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);N.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return i.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!N.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new N;var U=function(t,e){var r=this;var s;if(t&&i.has(t,"constructor")){s=t.constructor}else{s=function(){return r.apply(this,arguments)}}i.extend(s,r,e);var n=function(){this.constructor=s};n.prototype=r.prototype;s.prototype=new n;if(t)i.extend(s.prototype,t);s.__super__=r.prototype;return s};p.extend=g.extend=$.extend=w.extend=N.extend=U;var M=function(){throw new Error('A "url" property or function must be specified')};var q=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}};return e});
+//# sourceMappingURL=backbone-min.map
\ No newline at end of file
diff --git a/contrail-webui/server-manager/backbone-min.map b/contrail-webui/server-manager/backbone-min.map
new file mode 100644
index 0000000..2b0cf27
--- /dev/null
+++ b/contrail-webui/server-manager/backbone-min.map
@@ -0,0 +1 @@
+{"version":3,"file":"backbone-min.js","sources":["backbone.js"],"names":["root","factory","define","amd","_","$","exports","Backbone","require","jQuery","Zepto","ender","this","previousBackbone","array","push","slice","splice","VERSION","noConflict","emulateHTTP","emulateJSON","Events","on","name","callback","context","eventsApi","_events","events","ctx","once","self","off","apply","arguments","_callback","retain","ev","names","i","l","j","k","keys","length","trigger","args","call","allEvents","all","triggerEvents","stopListening","obj","listeningTo","_listeningTo","remove","_listenId","id","isEmpty","eventSplitter","action","rest","key","concat","test","split","a1","a2","a3","listenMethods","listenTo","listenToOnce","each","implementation","method","uniqueId","bind","unbind","extend","Model","attributes","options","attrs","cid","collection","parse","defaults","result","set","changed","initialize","prototype","validationError","idAttribute","toJSON","clone","sync","get","attr","escape","has","val","unset","changes","silent","changing","prev","current","_validate","_changing","_previousAttributes","isEqual","_pending","clear","hasChanged","changedAttributes","diff","old","previous","previousAttributes","fetch","model","success","resp","wrapError","save","xhr","validate","wait","serverAttrs","isObject","isNew","patch","destroy","url","base","urlError","replace","encodeURIComponent","constructor","isValid","error","modelMethods","unshift","Collection","models","comparator","_reset","reset","setOptions","add","merge","addOptions","map","singular","isArray","index","_byId","indexOf","_removeReference","existing","sort","at","targetModel","sortable","sortAttr","isString","toAdd","toRemove","modelMap","order","_prepareModel","_addReference","orderedModels","previousModels","pop","shift","where","first","findWhere","Error","sortBy","pluck","invoke","create","_onModelEvent","event","methods","attributeMethods","value","iterator","isFunction","View","pick","viewOptions","_ensureElement","delegateEvents","delegateEventSplitter","tagName","selector","$el","find","render","setElement","element","delegate","undelegateEvents","el","match","eventName","className","type","methodMap","params","dataType","data","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","noXhrPatch","ActiveXObject","ajax","window","XMLHttpRequest","dispatchEvent","update","delete","read","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","execute","navigate","optional","RegExp","exec","param","decodeURIComponent","History","handlers","bindAll","location","routeStripper","rootStripper","isExplorer","trailingSlash","pathStripper","started","interval","atRoot","pathname","getHash","href","getFragment","forcePushState","_hasPushState","_wantsHashChange","decodeURI","search","start","hashChange","_wantsPushState","pushState","docMode","document","documentMode","oldIE","navigator","userAgent","toLowerCase","frame","iframe","hide","appendTo","contentWindow","checkUrl","_checkUrlInterval","setInterval","loc","hash","replaceState","title","loadUrl","stop","clearInterval","e","any","handler","_updateHash","open","close","assign","protoProps","staticProps","parent","child","Surrogate","__super__"],"mappings":"CAOC,SAASA,EAAMC,GAGd,SAAWC,UAAW,YAAcA,OAAOC,IAAK,CAC9CD,QAAQ,aAAc,SAAU,WAAY,SAASE,EAAGC,EAAGC,GAGzDN,EAAKO,SAAWN,EAAQD,EAAMM,EAASF,EAAGC,SAIvC,UAAWC,WAAY,YAAa,CACzC,GAAIF,GAAII,QAAQ,aAChBP,GAAQD,EAAMM,QAASF,OAGlB,CACLJ,EAAKO,SAAWN,EAAQD,KAAUA,EAAKI,EAAIJ,EAAKS,QAAUT,EAAKU,OAASV,EAAKW,OAASX,EAAKK,MAG7FO,KAAM,SAASZ,EAAMO,EAAUH,EAAGC,GAOlC,GAAIQ,GAAmBb,EAAKO,QAG5B,IAAIO,KACJ,IAAIC,GAAOD,EAAMC,IACjB,IAAIC,GAAQF,EAAME,KAClB,IAAIC,GAASH,EAAMG,MAGnBV,GAASW,QAAU,OAInBX,GAASF,EAAIA,CAIbE,GAASY,WAAa,WACpBnB,EAAKO,SAAWM,CAChB,OAAOD,MAMTL,GAASa,YAAc,KAMvBb,GAASc,YAAc,KAevB,IAAIC,GAASf,EAASe,QAIpBC,GAAI,SAASC,EAAMC,EAAUC,GAC3B,IAAKC,EAAUf,KAAM,KAAMY,GAAOC,EAAUC,MAAcD,EAAU,MAAOb,KAC3EA,MAAKgB,UAAYhB,KAAKgB,WACtB,IAAIC,GAASjB,KAAKgB,QAAQJ,KAAUZ,KAAKgB,QAAQJ,MACjDK,GAAOd,MAAMU,SAAUA,EAAUC,QAASA,EAASI,IAAKJ,GAAWd,MACnE,OAAOA,OAKTmB,KAAM,SAASP,EAAMC,EAAUC,GAC7B,IAAKC,EAAUf,KAAM,OAAQY,GAAOC,EAAUC,MAAcD,EAAU,MAAOb,KAC7E,IAAIoB,GAAOpB,IACX,IAAImB,GAAO3B,EAAE2B,KAAK,WAChBC,EAAKC,IAAIT,EAAMO,EACfN,GAASS,MAAMtB,KAAMuB,YAEvBJ,GAAKK,UAAYX,CACjB,OAAOb,MAAKW,GAAGC,EAAMO,EAAML,IAO7BO,IAAK,SAAST,EAAMC,EAAUC,GAC5B,GAAIW,GAAQC,EAAIT,EAAQU,EAAOC,EAAGC,EAAGC,EAAGC,CACxC,KAAK/B,KAAKgB,UAAYD,EAAUf,KAAM,MAAOY,GAAOC,EAAUC,IAAW,MAAOd,KAChF,KAAKY,IAASC,IAAaC,EAAS,CAClCd,KAAKgB,YAAe,EACpB,OAAOhB,MAET2B,EAAQf,GAAQA,GAAQpB,EAAEwC,KAAKhC,KAAKgB,QACpC,KAAKY,EAAI,EAAGC,EAAIF,EAAMM,OAAQL,EAAIC,EAAGD,IAAK,CACxChB,EAAOe,EAAMC,EACb,IAAIX,EAASjB,KAAKgB,QAAQJ,GAAO,CAC/BZ,KAAKgB,QAAQJ,GAAQa,IACrB,IAAIZ,GAAYC,EAAS,CACvB,IAAKgB,EAAI,EAAGC,EAAId,EAAOgB,OAAQH,EAAIC,EAAGD,IAAK,CACzCJ,EAAKT,EAAOa,EACZ,IAAKjB,GAAYA,IAAaa,EAAGb,UAAYA,IAAaa,EAAGb,SAASW,WACjEV,GAAWA,IAAYY,EAAGZ,QAAU,CACvCW,EAAOtB,KAAKuB,KAIlB,IAAKD,EAAOQ,aAAejC,MAAKgB,QAAQJ,IAI5C,MAAOZ,OAOTkC,QAAS,SAAStB,GAChB,IAAKZ,KAAKgB,QAAS,MAAOhB,KAC1B,IAAImC,GAAO/B,EAAMgC,KAAKb,UAAW,EACjC,KAAKR,EAAUf,KAAM,UAAWY,EAAMuB,GAAO,MAAOnC,KACpD,IAAIiB,GAASjB,KAAKgB,QAAQJ,EAC1B,IAAIyB,GAAYrC,KAAKgB,QAAQsB,GAC7B,IAAIrB,EAAQsB,EAActB,EAAQkB,EAClC,IAAIE,EAAWE,EAAcF,EAAWd,UACxC,OAAOvB,OAKTwC,cAAe,SAASC,EAAK7B,EAAMC,GACjC,GAAI6B,GAAc1C,KAAK2C,YACvB,KAAKD,EAAa,MAAO1C,KACzB,IAAI4C,IAAUhC,IAASC,CACvB,KAAKA,SAAmBD,KAAS,SAAUC,EAAWb,IACtD,IAAIyC,GAAMC,MAAkBD,EAAII,WAAaJ,CAC7C,KAAK,GAAIK,KAAMJ,GAAa,CAC1BD,EAAMC,EAAYI,EAClBL,GAAIpB,IAAIT,EAAMC,EAAUb,KACxB,IAAI4C,GAAUpD,EAAEuD,QAAQN,EAAIzB,eAAiBhB,MAAK2C,aAAaG,GAEjE,MAAO9C,OAMX,IAAIgD,GAAgB,KAKpB,IAAIjC,GAAY,SAAS0B,EAAKQ,EAAQrC,EAAMsC,GAC1C,IAAKtC,EAAM,MAAO,KAGlB,UAAWA,KAAS,SAAU,CAC5B,IAAK,GAAIuC,KAAOvC,GAAM,CACpB6B,EAAIQ,GAAQ3B,MAAMmB,GAAMU,EAAKvC,EAAKuC,IAAMC,OAAOF,IAEjD,MAAO,OAIT,GAAIF,EAAcK,KAAKzC,GAAO,CAC5B,GAAIe,GAAQf,EAAK0C,MAAMN,EACvB,KAAK,GAAIpB,GAAI,EAAGC,EAAIF,EAAMM,OAAQL,EAAIC,EAAGD,IAAK,CAC5Ca,EAAIQ,GAAQ3B,MAAMmB,GAAMd,EAAMC,IAAIwB,OAAOF,IAE3C,MAAO,OAGT,MAAO,MAMT,IAAIX,GAAgB,SAAStB,EAAQkB,GACnC,GAAIT,GAAIE,GAAK,EAAGC,EAAIZ,EAAOgB,OAAQsB,EAAKpB,EAAK,GAAIqB,EAAKrB,EAAK,GAAIsB,EAAKtB,EAAK,EACzE,QAAQA,EAAKF,QACX,IAAK,GAAG,QAASL,EAAIC,GAAIH,EAAKT,EAAOW,IAAIf,SAASuB,KAAKV,EAAGR,IAAM,OAChE,KAAK,GAAG,QAASU,EAAIC,GAAIH,EAAKT,EAAOW,IAAIf,SAASuB,KAAKV,EAAGR,IAAKqC,EAAK,OACpE,KAAK,GAAG,QAAS3B,EAAIC,GAAIH,EAAKT,EAAOW,IAAIf,SAASuB,KAAKV,EAAGR,IAAKqC,EAAIC,EAAK,OACxE,KAAK,GAAG,QAAS5B,EAAIC,GAAIH,EAAKT,EAAOW,IAAIf,SAASuB,KAAKV,EAAGR,IAAKqC,EAAIC,EAAIC,EAAK,OAC5E,SAAS,QAAS7B,EAAIC,GAAIH,EAAKT,EAAOW,IAAIf,SAASS,MAAMI,EAAGR,IAAKiB,EAAO,SAI5E,IAAIuB,IAAiBC,SAAU,KAAMC,aAAc,OAKnDpE,GAAEqE,KAAKH,EAAe,SAASI,EAAgBC,GAC7CrD,EAAOqD,GAAU,SAAStB,EAAK7B,EAAMC,GACnC,GAAI6B,GAAc1C,KAAK2C,eAAiB3C,KAAK2C,gBAC7C,IAAIG,GAAKL,EAAII,YAAcJ,EAAII,UAAYrD,EAAEwE,SAAS,KACtDtB,GAAYI,GAAML,CAClB,KAAK5B,SAAmBD,KAAS,SAAUC,EAAWb,IACtDyC,GAAIqB,GAAgBlD,EAAMC,EAAUb,KACpC,OAAOA,QAKXU,GAAOuD,KAASvD,EAAOC,EACvBD,GAAOwD,OAASxD,EAAOW,GAIvB7B,GAAE2E,OAAOxE,EAAUe,EAYnB,IAAI0D,GAAQzE,EAASyE,MAAQ,SAASC,EAAYC,GAChD,GAAIC,GAAQF,KACZC,KAAYA,KACZtE,MAAKwE,IAAMhF,EAAEwE,SAAS,IACtBhE,MAAKqE,aACL,IAAIC,EAAQG,WAAYzE,KAAKyE,WAAaH,EAAQG,UAClD,IAAIH,EAAQI,MAAOH,EAAQvE,KAAK0E,MAAMH,EAAOD,MAC7CC,GAAQ/E,EAAEmF,YAAaJ,EAAO/E,EAAEoF,OAAO5E,KAAM,YAC7CA,MAAK6E,IAAIN,EAAOD,EAChBtE,MAAK8E,UACL9E,MAAK+E,WAAWzD,MAAMtB,KAAMuB,WAI9B/B,GAAE2E,OAAOC,EAAMY,UAAWtE,GAGxBoE,QAAS,KAGTG,gBAAiB,KAIjBC,YAAa,KAIbH,WAAY,aAGZI,OAAQ,SAASb,GACf,MAAO9E,GAAE4F,MAAMpF,KAAKqE,aAKtBgB,KAAM,WACJ,MAAO1F,GAAS0F,KAAK/D,MAAMtB,KAAMuB,YAInC+D,IAAK,SAASC,GACZ,MAAOvF,MAAKqE,WAAWkB,IAIzBC,OAAQ,SAASD,GACf,MAAO/F,GAAEgG,OAAOxF,KAAKsF,IAAIC,KAK3BE,IAAK,SAASF,GACZ,MAAOvF,MAAKsF,IAAIC,IAAS,MAM3BV,IAAK,SAAS1B,EAAKuC,EAAKpB,GACtB,GAAIiB,GAAMhB,EAAOoB,EAAOC,EAASC,EAAQC,EAAUC,EAAMC,CACzD,IAAI7C,GAAO,KAAM,MAAOnD,KAGxB,UAAWmD,KAAQ,SAAU,CAC3BoB,EAAQpB,CACRmB,GAAUoB,MACL,EACJnB,MAAYpB,GAAOuC,EAGtBpB,IAAYA,KAGZ,KAAKtE,KAAKiG,UAAU1B,EAAOD,GAAU,MAAO,MAG5CqB,GAAkBrB,EAAQqB,KAC1BE,GAAkBvB,EAAQuB,MAC1BD,KACAE,GAAkB9F,KAAKkG,SACvBlG,MAAKkG,UAAa,IAElB,KAAKJ,EAAU,CACb9F,KAAKmG,oBAAsB3G,EAAE4F,MAAMpF,KAAKqE,WACxCrE,MAAK8E,WAEPkB,EAAUhG,KAAKqE,WAAY0B,EAAO/F,KAAKmG,mBAGvC,IAAInG,KAAKkF,cAAeX,GAAOvE,KAAK8C,GAAKyB,EAAMvE,KAAKkF,YAGpD,KAAKK,IAAQhB,GAAO,CAClBmB,EAAMnB,EAAMgB,EACZ,KAAK/F,EAAE4G,QAAQJ,EAAQT,GAAOG,GAAME,EAAQzF,KAAKoF,EACjD,KAAK/F,EAAE4G,QAAQL,EAAKR,GAAOG,GAAM,CAC/B1F,KAAK8E,QAAQS,GAAQG,MAChB,OACE1F,MAAK8E,QAAQS,GAEtBI,QAAeK,GAAQT,GAAQS,EAAQT,GAAQG,EAIjD,IAAKG,EAAQ,CACX,GAAID,EAAQ3D,OAAQjC,KAAKqG,SAAW/B,CACpC,KAAK,GAAI1C,GAAI,EAAGC,EAAI+D,EAAQ3D,OAAQL,EAAIC,EAAGD,IAAK,CAC9C5B,KAAKkC,QAAQ,UAAY0D,EAAQhE,GAAI5B,KAAMgG,EAAQJ,EAAQhE,IAAK0C,IAMpE,GAAIwB,EAAU,MAAO9F,KACrB,KAAK6F,EAAQ,CACX,MAAO7F,KAAKqG,SAAU,CACpB/B,EAAUtE,KAAKqG,QACfrG,MAAKqG,SAAW,KAChBrG,MAAKkC,QAAQ,SAAUlC,KAAMsE,IAGjCtE,KAAKqG,SAAW,KAChBrG,MAAKkG,UAAY,KACjB,OAAOlG,OAKT2F,MAAO,SAASJ,EAAMjB,GACpB,MAAOtE,MAAK6E,IAAIU,MAAW,GAAG/F,EAAE2E,UAAWG,GAAUqB,MAAO,SAI9DW,MAAO,SAAShC,GACd,GAAIC,KACJ,KAAK,GAAIpB,KAAOnD,MAAKqE,WAAYE,EAAMpB,OAAY,EACnD,OAAOnD,MAAK6E,IAAIN,EAAO/E,EAAE2E,UAAWG,GAAUqB,MAAO,SAKvDY,WAAY,SAAShB,GACnB,GAAIA,GAAQ,KAAM,OAAQ/F,EAAEuD,QAAQ/C,KAAK8E,QACzC,OAAOtF,GAAEiG,IAAIzF,KAAK8E,QAASS,IAS7BiB,kBAAmB,SAASC,GAC1B,IAAKA,EAAM,MAAOzG,MAAKuG,aAAe/G,EAAE4F,MAAMpF,KAAK8E,SAAW,KAC9D,IAAIY,GAAKZ,EAAU,KACnB,IAAI4B,GAAM1G,KAAKkG,UAAYlG,KAAKmG,oBAAsBnG,KAAKqE,UAC3D,KAAK,GAAIkB,KAAQkB,GAAM,CACrB,GAAIjH,EAAE4G,QAAQM,EAAInB,GAAQG,EAAMe,EAAKlB,IAAS,UAC7CT,IAAYA,OAAeS,GAAQG,EAEtC,MAAOZ,IAKT6B,SAAU,SAASpB,GACjB,GAAIA,GAAQ,OAASvF,KAAKmG,oBAAqB,MAAO,KACtD,OAAOnG,MAAKmG,oBAAoBZ,IAKlCqB,mBAAoB,WAClB,MAAOpH,GAAE4F,MAAMpF,KAAKmG,sBAMtBU,MAAO,SAASvC,GACdA,EAAUA,EAAU9E,EAAE4F,MAAMd,KAC5B,IAAIA,EAAQI,YAAe,GAAGJ,EAAQI,MAAQ,IAC9C,IAAIoC,GAAQ9G,IACZ,IAAI+G,GAAUzC,EAAQyC,OACtBzC,GAAQyC,QAAU,SAASC,GACzB,IAAKF,EAAMjC,IAAIiC,EAAMpC,MAAMsC,EAAM1C,GAAUA,GAAU,MAAO,MAC5D,IAAIyC,EAASA,EAAQD,EAAOE,EAAM1C,EAClCwC,GAAM5E,QAAQ,OAAQ4E,EAAOE,EAAM1C,GAErC2C,GAAUjH,KAAMsE,EAChB,OAAOtE,MAAKqF,KAAK,OAAQrF,KAAMsE,IAMjC4C,KAAM,SAAS/D,EAAKuC,EAAKpB,GACvB,GAAIC,GAAOR,EAAQoD,EAAK9C,EAAarE,KAAKqE,UAG1C,IAAIlB,GAAO,YAAeA,KAAQ,SAAU,CAC1CoB,EAAQpB,CACRmB,GAAUoB,MACL,EACJnB,MAAYpB,GAAOuC,EAGtBpB,EAAU9E,EAAE2E,QAAQiD,SAAU,MAAO9C,EAKrC,IAAIC,IAAUD,EAAQ+C,KAAM,CAC1B,IAAKrH,KAAK6E,IAAIN,EAAOD,GAAU,MAAO,WACjC,CACL,IAAKtE,KAAKiG,UAAU1B,EAAOD,GAAU,MAAO,OAI9C,GAAIC,GAASD,EAAQ+C,KAAM,CACzBrH,KAAKqE,WAAa7E,EAAE2E,UAAWE,EAAYE,GAK7C,GAAID,EAAQI,YAAe,GAAGJ,EAAQI,MAAQ,IAC9C,IAAIoC,GAAQ9G,IACZ,IAAI+G,GAAUzC,EAAQyC,OACtBzC,GAAQyC,QAAU,SAASC,GAEzBF,EAAMzC,WAAaA,CACnB,IAAIiD,GAAcR,EAAMpC,MAAMsC,EAAM1C,EACpC,IAAIA,EAAQ+C,KAAMC,EAAc9H,EAAE2E,OAAOI,MAAa+C,EACtD,IAAI9H,EAAE+H,SAASD,KAAiBR,EAAMjC,IAAIyC,EAAahD,GAAU,CAC/D,MAAO,OAET,GAAIyC,EAASA,EAAQD,EAAOE,EAAM1C,EAClCwC,GAAM5E,QAAQ,OAAQ4E,EAAOE,EAAM1C,GAErC2C,GAAUjH,KAAMsE,EAEhBP,GAAS/D,KAAKwH,QAAU,SAAYlD,EAAQmD,MAAQ,QAAU,QAC9D,IAAI1D,IAAW,QAASO,EAAQC,MAAQA,CACxC4C,GAAMnH,KAAKqF,KAAKtB,EAAQ/D,KAAMsE,EAG9B,IAAIC,GAASD,EAAQ+C,KAAMrH,KAAKqE,WAAaA,CAE7C,OAAO8C,IAMTO,QAAS,SAASpD,GAChBA,EAAUA,EAAU9E,EAAE4F,MAAMd,KAC5B,IAAIwC,GAAQ9G,IACZ,IAAI+G,GAAUzC,EAAQyC,OAEtB,IAAIW,GAAU,WACZZ,EAAM5E,QAAQ,UAAW4E,EAAOA,EAAMrC,WAAYH,GAGpDA,GAAQyC,QAAU,SAASC,GACzB,GAAI1C,EAAQ+C,MAAQP,EAAMU,QAASE,GACnC,IAAIX,EAASA,EAAQD,EAAOE,EAAM1C,EAClC,KAAKwC,EAAMU,QAASV,EAAM5E,QAAQ,OAAQ4E,EAAOE,EAAM1C,GAGzD,IAAItE,KAAKwH,QAAS,CAChBlD,EAAQyC,SACR,OAAO,OAETE,EAAUjH,KAAMsE,EAEhB,IAAI6C,GAAMnH,KAAKqF,KAAK,SAAUrF,KAAMsE,EACpC,KAAKA,EAAQ+C,KAAMK,GACnB,OAAOP,IAMTQ,IAAK,WACH,GAAIC,GACFpI,EAAEoF,OAAO5E,KAAM,YACfR,EAAEoF,OAAO5E,KAAKyE,WAAY,QAC1BoD,GACF,IAAI7H,KAAKwH,QAAS,MAAOI,EACzB,OAAOA,GAAKE,QAAQ,WAAY,OAASC,mBAAmB/H,KAAK8C,KAKnE4B,MAAO,SAASsC,EAAM1C,GACpB,MAAO0C,IAIT5B,MAAO,WACL,MAAO,IAAIpF,MAAKgI,YAAYhI,KAAKqE,aAInCmD,MAAO,WACL,OAAQxH,KAAKyF,IAAIzF,KAAKkF,cAIxB+C,QAAS,SAAS3D,GAChB,MAAOtE,MAAKiG,aAAczG,EAAE2E,OAAOG,OAAiB8C,SAAU,SAKhEnB,UAAW,SAAS1B,EAAOD,GACzB,IAAKA,EAAQ8C,WAAapH,KAAKoH,SAAU,MAAO,KAChD7C,GAAQ/E,EAAE2E,UAAWnE,KAAKqE,WAAYE,EACtC,IAAI2D,GAAQlI,KAAKiF,gBAAkBjF,KAAKoH,SAAS7C,EAAOD,IAAY,IACpE,KAAK4D,EAAO,MAAO,KACnBlI,MAAKkC,QAAQ,UAAWlC,KAAMkI,EAAO1I,EAAE2E,OAAOG,GAAUW,gBAAiBiD,IACzE,OAAO,SAMX,IAAIC,IAAgB,OAAQ,SAAU,QAAS,SAAU,OAAQ,OAGjE3I,GAAEqE,KAAKsE,EAAc,SAASpE,GAC5BK,EAAMY,UAAUjB,GAAU,WACxB,GAAI5B,GAAO/B,EAAMgC,KAAKb,UACtBY,GAAKiG,QAAQpI,KAAKqE,WAClB,OAAO7E,GAAEuE,GAAQzC,MAAM9B,EAAG2C,KAiB9B,IAAIkG,GAAa1I,EAAS0I,WAAa,SAASC,EAAQhE,GACtDA,IAAYA,KACZ,IAAIA,EAAQwC,MAAO9G,KAAK8G,MAAQxC,EAAQwC,KACxC,IAAIxC,EAAQiE,iBAAoB,GAAGvI,KAAKuI,WAAajE,EAAQiE,UAC7DvI,MAAKwI,QACLxI,MAAK+E,WAAWzD,MAAMtB,KAAMuB,UAC5B,IAAI+G,EAAQtI,KAAKyI,MAAMH,EAAQ9I,EAAE2E,QAAQ0B,OAAQ,MAAOvB,IAI1D,IAAIoE,IAAcC,IAAK,KAAM/F,OAAQ,KAAMgG,MAAO,KAClD,IAAIC,IAAcF,IAAK,KAAM/F,OAAQ,MAGrCpD,GAAE2E,OAAOkE,EAAWrD,UAAWtE,GAI7BoG,MAAO1C,EAIPW,WAAY,aAIZI,OAAQ,SAASb,GACf,MAAOtE,MAAK8I,IAAI,SAAShC,GAAQ,MAAOA,GAAM3B,OAAOb,MAIvDe,KAAM,WACJ,MAAO1F,GAAS0F,KAAK/D,MAAMtB,KAAMuB,YAInCoH,IAAK,SAASL,EAAQhE,GACpB,MAAOtE,MAAK6E,IAAIyD,EAAQ9I,EAAE2E,QAAQyE,MAAO,OAAQtE,EAASuE,KAI5DjG,OAAQ,SAAS0F,EAAQhE,GACvB,GAAIyE,IAAYvJ,EAAEwJ,QAAQV,EAC1BA,GAASS,GAAYT,GAAU9I,EAAE4F,MAAMkD,EACvChE,KAAYA,KACZ,IAAI1C,GAAGC,EAAGoH,EAAOnC,CACjB,KAAKlF,EAAI,EAAGC,EAAIyG,EAAOrG,OAAQL,EAAIC,EAAGD,IAAK,CACzCkF,EAAQwB,EAAO1G,GAAK5B,KAAKsF,IAAIgD,EAAO1G,GACpC,KAAKkF,EAAO,eACL9G,MAAKkJ,MAAMpC,EAAMhE,UACjB9C,MAAKkJ,MAAMpC,EAAMtC,IACxByE,GAAQjJ,KAAKmJ,QAAQrC,EACrB9G,MAAKsI,OAAOjI,OAAO4I,EAAO,EAC1BjJ,MAAKiC,QACL,KAAKqC,EAAQuB,OAAQ,CACnBvB,EAAQ2E,MAAQA,CAChBnC,GAAM5E,QAAQ,SAAU4E,EAAO9G,KAAMsE,GAEvCtE,KAAKoJ,iBAAiBtC,EAAOxC,GAE/B,MAAOyE,GAAWT,EAAO,GAAKA,GAOhCzD,IAAK,SAASyD,EAAQhE,GACpBA,EAAU9E,EAAEmF,YAAaL,EAASoE,EAClC,IAAIpE,EAAQI,MAAO4D,EAAStI,KAAK0E,MAAM4D,EAAQhE,EAC/C,IAAIyE,IAAYvJ,EAAEwJ,QAAQV,EAC1BA,GAASS,EAAYT,GAAUA,MAAgB9I,EAAE4F,MAAMkD,EACvD,IAAI1G,GAAGC,EAAGiB,EAAIgE,EAAOvC,EAAO8E,EAAUC,CACtC,IAAIC,GAAKjF,EAAQiF,EACjB,IAAIC,GAAcxJ,KAAK8G,KACvB,IAAI2C,GAAWzJ,KAAKuI,YAAegB,GAAM,MAASjF,EAAQgF,OAAS,KACnE,IAAII,GAAWlK,EAAEmK,SAAS3J,KAAKuI,YAAcvI,KAAKuI,WAAa,IAC/D,IAAIqB,MAAYC,KAAeC,IAC/B,IAAInB,GAAMrE,EAAQqE,IAAKC,EAAQtE,EAAQsE,MAAOhG,EAAS0B,EAAQ1B,MAC/D,IAAImH,IAASN,GAAYd,GAAO/F,KAAc,KAI9C,KAAKhB,EAAI,EAAGC,EAAIyG,EAAOrG,OAAQL,EAAIC,EAAGD,IAAK,CACzC2C,EAAQ+D,EAAO1G,MACf,IAAI2C,YAAiBH,GAAO,CAC1BtB,EAAKgE,EAAQvC,MACR,CACLzB,EAAKyB,EAAMiF,EAAYxE,UAAUE,aAAe,MAKlD,GAAImE,EAAWrJ,KAAKsF,IAAIxC,GAAK,CAC3B,GAAIF,EAAQkH,EAAST,EAAS7E,KAAO,IACrC,IAAIoE,EAAO,CACTrE,EAAQA,IAAUuC,EAAQA,EAAMzC,WAAaE,CAC7C,IAAID,EAAQI,MAAOH,EAAQ8E,EAAS3E,MAAMH,EAAOD,EACjD+E,GAASxE,IAAIN,EAAOD,EACpB,IAAImF,IAAaH,GAAQD,EAAS9C,WAAWmD,GAAWJ,EAAO,KAEjEhB,EAAO1G,GAAKyH,MAGP,IAAIV,EAAK,CACd7B,EAAQwB,EAAO1G,GAAK5B,KAAKgK,cAAczF,EAAOD,EAC9C,KAAKwC,EAAO,QACZ8C,GAAMzJ,KAAK2G,EACX9G,MAAKiK,cAAcnD,EAAOxC,GAI5BwC,EAAQuC,GAAYvC,CACpB,IAAIiD,IAAUjD,EAAMU,UAAYsC,EAAShD,EAAMhE,KAAMiH,EAAM5J,KAAK2G,EAChEgD,GAAShD,EAAMhE,IAAM,KAIvB,GAAIF,EAAQ,CACV,IAAKhB,EAAI,EAAGC,EAAI7B,KAAKiC,OAAQL,EAAIC,IAAKD,EAAG,CACvC,IAAKkI,GAAUhD,EAAQ9G,KAAKsI,OAAO1G,IAAI4C,KAAMqF,EAAS1J,KAAK2G,GAE7D,GAAI+C,EAAS5H,OAAQjC,KAAK4C,OAAOiH,EAAUvF,GAI7C,GAAIsF,EAAM3H,QAAW8H,GAASA,EAAM9H,OAAS,CAC3C,GAAIwH,EAAUH,EAAO,IACrBtJ,MAAKiC,QAAU2H,EAAM3H,MACrB,IAAIsH,GAAM,KAAM,CACd,IAAK3H,EAAI,EAAGC,EAAI+H,EAAM3H,OAAQL,EAAIC,EAAGD,IAAK,CACxC5B,KAAKsI,OAAOjI,OAAOkJ,EAAK3H,EAAG,EAAGgI,EAAMhI,SAEjC,CACL,GAAImI,EAAO/J,KAAKsI,OAAOrG,OAAS,CAChC,IAAIiI,GAAgBH,GAASH,CAC7B,KAAKhI,EAAI,EAAGC,EAAIqI,EAAcjI,OAAQL,EAAIC,EAAGD,IAAK,CAChD5B,KAAKsI,OAAOnI,KAAK+J,EAActI,MAMrC,GAAI0H,EAAMtJ,KAAKsJ,MAAMzD,OAAQ,MAG7B,KAAKvB,EAAQuB,OAAQ,CACnB,IAAKjE,EAAI,EAAGC,EAAI+H,EAAM3H,OAAQL,EAAIC,EAAGD,IAAK,EACvCkF,EAAQ8C,EAAMhI,IAAIM,QAAQ,MAAO4E,EAAO9G,KAAMsE,GAEjD,GAAIgF,GAASS,GAASA,EAAM9H,OAASjC,KAAKkC,QAAQ,OAAQlC,KAAMsE,GAIlE,MAAOyE,GAAWT,EAAO,GAAKA,GAOhCG,MAAO,SAASH,EAAQhE,GACtBA,IAAYA,KACZ,KAAK,GAAI1C,GAAI,EAAGC,EAAI7B,KAAKsI,OAAOrG,OAAQL,EAAIC,EAAGD,IAAK,CAClD5B,KAAKoJ,iBAAiBpJ,KAAKsI,OAAO1G,GAAI0C,GAExCA,EAAQ6F,eAAiBnK,KAAKsI,MAC9BtI,MAAKwI,QACLF,GAAStI,KAAK2I,IAAIL,EAAQ9I,EAAE2E,QAAQ0B,OAAQ,MAAOvB,GACnD,KAAKA,EAAQuB,OAAQ7F,KAAKkC,QAAQ,QAASlC,KAAMsE,EACjD,OAAOgE,IAITnI,KAAM,SAAS2G,EAAOxC,GACpB,MAAOtE,MAAK2I,IAAI7B,EAAOtH,EAAE2E,QAAQoF,GAAIvJ,KAAKiC,QAASqC,KAIrD8F,IAAK,SAAS9F,GACZ,GAAIwC,GAAQ9G,KAAKuJ,GAAGvJ,KAAKiC,OAAS,EAClCjC,MAAK4C,OAAOkE,EAAOxC,EACnB,OAAOwC,IAITsB,QAAS,SAAStB,EAAOxC,GACvB,MAAOtE,MAAK2I,IAAI7B,EAAOtH,EAAE2E,QAAQoF,GAAI,GAAIjF,KAI3C+F,MAAO,SAAS/F,GACd,GAAIwC,GAAQ9G,KAAKuJ,GAAG,EACpBvJ,MAAK4C,OAAOkE,EAAOxC,EACnB,OAAOwC,IAIT1G,MAAO,WACL,MAAOA,GAAMkB,MAAMtB,KAAKsI,OAAQ/G,YAIlC+D,IAAK,SAAS7C,GACZ,GAAIA,GAAO,KAAM,WAAY,EAC7B,OAAOzC,MAAKkJ,MAAMzG,IAAQzC,KAAKkJ,MAAMzG,EAAIK,KAAO9C,KAAKkJ,MAAMzG,EAAI+B,MAIjE+E,GAAI,SAASN,GACX,MAAOjJ,MAAKsI,OAAOW,IAKrBqB,MAAO,SAAS/F,EAAOgG,GACrB,GAAI/K,EAAEuD,QAAQwB,GAAQ,MAAOgG,OAAa,KAC1C,OAAOvK,MAAKuK,EAAQ,OAAS,UAAU,SAASzD,GAC9C,IAAK,GAAI3D,KAAOoB,GAAO,CACrB,GAAIA,EAAMpB,KAAS2D,EAAMxB,IAAInC,GAAM,MAAO,OAE5C,MAAO,SAMXqH,UAAW,SAASjG,GAClB,MAAOvE,MAAKsK,MAAM/F,EAAO,OAM3B+E,KAAM,SAAShF,GACb,IAAKtE,KAAKuI,WAAY,KAAM,IAAIkC,OAAM,yCACtCnG,KAAYA,KAGZ,IAAI9E,EAAEmK,SAAS3J,KAAKuI,aAAevI,KAAKuI,WAAWtG,SAAW,EAAG,CAC/DjC,KAAKsI,OAAStI,KAAK0K,OAAO1K,KAAKuI,WAAYvI,UACtC,CACLA,KAAKsI,OAAOgB,KAAK9J,EAAEyE,KAAKjE,KAAKuI,WAAYvI,OAG3C,IAAKsE,EAAQuB,OAAQ7F,KAAKkC,QAAQ,OAAQlC,KAAMsE,EAChD,OAAOtE,OAIT2K,MAAO,SAASpF,GACd,MAAO/F,GAAEoL,OAAO5K,KAAKsI,OAAQ,MAAO/C,IAMtCsB,MAAO,SAASvC,GACdA,EAAUA,EAAU9E,EAAE4F,MAAMd,KAC5B,IAAIA,EAAQI,YAAe,GAAGJ,EAAQI,MAAQ,IAC9C,IAAIqC,GAAUzC,EAAQyC,OACtB,IAAItC,GAAazE,IACjBsE,GAAQyC,QAAU,SAASC,GACzB,GAAIjD,GAASO,EAAQmE,MAAQ,QAAU,KACvChE,GAAWV,GAAQiD,EAAM1C,EACzB,IAAIyC,EAASA,EAAQtC,EAAYuC,EAAM1C,EACvCG,GAAWvC,QAAQ,OAAQuC,EAAYuC,EAAM1C,GAE/C2C,GAAUjH,KAAMsE,EAChB,OAAOtE,MAAKqF,KAAK,OAAQrF,KAAMsE,IAMjCuG,OAAQ,SAAS/D,EAAOxC,GACtBA,EAAUA,EAAU9E,EAAE4F,MAAMd,KAC5B,MAAMwC,EAAQ9G,KAAKgK,cAAclD,EAAOxC,IAAW,MAAO,MAC1D,KAAKA,EAAQ+C,KAAMrH,KAAK2I,IAAI7B,EAAOxC,EACnC,IAAIG,GAAazE,IACjB,IAAI+G,GAAUzC,EAAQyC,OACtBzC,GAAQyC,QAAU,SAASD,EAAOE,GAChC,GAAI1C,EAAQ+C,KAAM5C,EAAWkE,IAAI7B,EAAOxC,EACxC,IAAIyC,EAASA,EAAQD,EAAOE,EAAM1C,GAEpCwC,GAAMI,KAAK,KAAM5C,EACjB,OAAOwC,IAKTpC,MAAO,SAASsC,EAAM1C,GACpB,MAAO0C,IAIT5B,MAAO,WACL,MAAO,IAAIpF,MAAKgI,YAAYhI,KAAKsI,SAKnCE,OAAQ,WACNxI,KAAKiC,OAAS,CACdjC,MAAKsI,SACLtI,MAAKkJ,UAKPc,cAAe,SAASzF,EAAOD,GAC7B,GAAIC,YAAiBH,GAAO,MAAOG,EACnCD,GAAUA,EAAU9E,EAAE4F,MAAMd,KAC5BA,GAAQG,WAAazE,IACrB,IAAI8G,GAAQ,GAAI9G,MAAK8G,MAAMvC,EAAOD,EAClC,KAAKwC,EAAM7B,gBAAiB,MAAO6B,EACnC9G,MAAKkC,QAAQ,UAAWlC,KAAM8G,EAAM7B,gBAAiBX,EACrD,OAAO,QAIT2F,cAAe,SAASnD,EAAOxC,GAC7BtE,KAAKkJ,MAAMpC,EAAMtC,KAAOsC,CACxB,IAAIA,EAAMhE,IAAM,KAAM9C,KAAKkJ,MAAMpC,EAAMhE,IAAMgE,CAC7C,KAAKA,EAAMrC,WAAYqC,EAAMrC,WAAazE,IAC1C8G,GAAMnG,GAAG,MAAOX,KAAK8K,cAAe9K,OAItCoJ,iBAAkB,SAAStC,EAAOxC,GAChC,GAAItE,OAAS8G,EAAMrC,iBAAmBqC,GAAMrC,UAC5CqC,GAAMzF,IAAI,MAAOrB,KAAK8K,cAAe9K,OAOvC8K,cAAe,SAASC,EAAOjE,EAAOrC,EAAYH,GAChD,IAAKyG,IAAU,OAASA,IAAU,WAAatG,IAAezE,KAAM,MACpE,IAAI+K,IAAU,UAAW/K,KAAK4C,OAAOkE,EAAOxC,EAC5C,IAAIwC,GAASiE,IAAU,UAAYjE,EAAM5B,YAAa,OAC7ClF,MAAKkJ,MAAMpC,EAAMH,SAASG,EAAM5B,aACvC,IAAI4B,EAAMhE,IAAM,KAAM9C,KAAKkJ,MAAMpC,EAAMhE,IAAMgE,EAE/C9G,KAAKkC,QAAQZ,MAAMtB,KAAMuB,aAQ7B,IAAIyJ,IAAW,UAAW,OAAQ,MAAO,UAAW,SAAU,QAC5D,SAAU,cAAe,QAAS,OAAQ,SAAU,SAAU,SAC9D,SAAU,QAAS,MAAO,OAAQ,MAAO,UAAW,WAAY,SAChE,MAAO,MAAO,UAAW,OAAQ,QAAS,OAAQ,OAAQ,UAAW,OACrE,OAAQ,OAAQ,OAAQ,UAAW,aAAc,UAAW,UAC5D,cAAe,UAAW,QAAS,SAGrCxL,GAAEqE,KAAKmH,EAAS,SAASjH,GACvBsE,EAAWrD,UAAUjB,GAAU,WAC7B,GAAI5B,GAAO/B,EAAMgC,KAAKb,UACtBY,GAAKiG,QAAQpI,KAAKsI,OAClB,OAAO9I,GAAEuE,GAAQzC,MAAM9B,EAAG2C,KAK9B,IAAI8I,IAAoB,UAAW,UAAW,SAAU,UAGxDzL,GAAEqE,KAAKoH,EAAkB,SAASlH,GAChCsE,EAAWrD,UAAUjB,GAAU,SAASmH,EAAOpK,GAC7C,GAAIqK,GAAW3L,EAAE4L,WAAWF,GAASA,EAAQ,SAASpE,GACpD,MAAOA,GAAMxB,IAAI4F,GAEnB,OAAO1L,GAAEuE,GAAQ/D,KAAKsI,OAAQ6C,EAAUrK,KAiB5C,IAAIuK,GAAO1L,EAAS0L,KAAO,SAAS/G,GAClCtE,KAAKwE,IAAMhF,EAAEwE,SAAS,OACtBM,KAAYA,KACZ9E,GAAE2E,OAAOnE,KAAMR,EAAE8L,KAAKhH,EAASiH,GAC/BvL,MAAKwL,gBACLxL,MAAK+E,WAAWzD,MAAMtB,KAAMuB,UAC5BvB,MAAKyL,iBAIP,IAAIC,GAAwB,gBAG5B,IAAIH,IAAe,QAAS,aAAc,KAAM,KAAM,aAAc,YAAa,UAAW,SAG5F/L,GAAE2E,OAAOkH,EAAKrG,UAAWtE,GAGvBiL,QAAS,MAITlM,EAAG,SAASmM,GACV,MAAO5L,MAAK6L,IAAIC,KAAKF,IAKvB7G,WAAY,aAKZgH,OAAQ,WACN,MAAO/L,OAKT4C,OAAQ,WACN5C,KAAK6L,IAAIjJ,QACT5C,MAAKwC,eACL,OAAOxC,OAKTgM,WAAY,SAASC,EAASC,GAC5B,GAAIlM,KAAK6L,IAAK7L,KAAKmM,kBACnBnM,MAAK6L,IAAMI,YAAmBtM,GAASF,EAAIwM,EAAUtM,EAASF,EAAEwM,EAChEjM,MAAKoM,GAAKpM,KAAK6L,IAAI,EACnB,IAAIK,IAAa,MAAOlM,KAAKyL,gBAC7B,OAAOzL,OAkBTyL,eAAgB,SAASxK,GACvB,KAAMA,IAAWA,EAASzB,EAAEoF,OAAO5E,KAAM,YAAa,MAAOA,KAC7DA,MAAKmM,kBACL,KAAK,GAAIhJ,KAAOlC,GAAQ,CACtB,GAAI8C,GAAS9C,EAAOkC,EACpB,KAAK3D,EAAE4L,WAAWrH,GAASA,EAAS/D,KAAKiB,EAAOkC,GAChD,KAAKY,EAAQ,QAEb,IAAIsI,GAAQlJ,EAAIkJ,MAAMX,EACtB,IAAIY,GAAYD,EAAM,GAAIT,EAAWS,EAAM,EAC3CtI,GAASvE,EAAEyE,KAAKF,EAAQ/D,KACxBsM,IAAa,kBAAoBtM,KAAKwE,GACtC,IAAIoH,IAAa,GAAI,CACnB5L,KAAK6L,IAAIlL,GAAG2L,EAAWvI,OAClB,CACL/D,KAAK6L,IAAIlL,GAAG2L,EAAWV,EAAU7H,IAGrC,MAAO/D,OAMTmM,iBAAkB,WAChBnM,KAAK6L,IAAIxK,IAAI,kBAAoBrB,KAAKwE,IACtC,OAAOxE,OAOTwL,eAAgB,WACd,IAAKxL,KAAKoM,GAAI,CACZ,GAAI7H,GAAQ/E,EAAE2E,UAAW3E,EAAEoF,OAAO5E,KAAM,cACxC,IAAIA,KAAK8C,GAAIyB,EAAMzB,GAAKtD,EAAEoF,OAAO5E,KAAM,KACvC,IAAIA,KAAKuM,UAAWhI,EAAM,SAAW/E,EAAEoF,OAAO5E,KAAM,YACpD,IAAI6L,GAAMlM,EAASF,EAAE,IAAMD,EAAEoF,OAAO5E,KAAM,WAAa,KAAKuF,KAAKhB,EACjEvE,MAAKgM,WAAWH,EAAK,WAChB,CACL7L,KAAKgM,WAAWxM,EAAEoF,OAAO5E,KAAM,MAAO,UAwB5CL,GAAS0F,KAAO,SAAStB,EAAQ+C,EAAOxC,GACtC,GAAIkI,GAAOC,EAAU1I,EAGrBvE,GAAEmF,SAASL,IAAYA,OACrB9D,YAAab,EAASa,YACtBC,YAAad,EAASc,aAIxB,IAAIiM,IAAUF,KAAMA,EAAMG,SAAU,OAGpC,KAAKrI,EAAQqD,IAAK,CAChB+E,EAAO/E,IAAMnI,EAAEoF,OAAOkC,EAAO,QAAUe,IAIzC,GAAIvD,EAAQsI,MAAQ,MAAQ9F,IAAU/C,IAAW,UAAYA,IAAW,UAAYA,IAAW,SAAU,CACvG2I,EAAOG,YAAc,kBACrBH,GAAOE,KAAOE,KAAKC,UAAUzI,EAAQC,OAASuC,EAAM3B,OAAOb,IAI7D,GAAIA,EAAQ7D,YAAa,CACvBiM,EAAOG,YAAc,mCACrBH,GAAOE,KAAOF,EAAOE,MAAQ9F,MAAO4F,EAAOE,SAK7C,GAAItI,EAAQ9D,cAAgBgM,IAAS,OAASA,IAAS,UAAYA,IAAS,SAAU,CACpFE,EAAOF,KAAO,MACd,IAAIlI,EAAQ7D,YAAaiM,EAAOE,KAAKI,QAAUR,CAC/C,IAAIS,GAAa3I,EAAQ2I,UACzB3I,GAAQ2I,WAAa,SAAS9F,GAC5BA,EAAI+F,iBAAiB,yBAA0BV,EAC/C,IAAIS,EAAY,MAAOA,GAAW3L,MAAMtB,KAAMuB,YAKlD,GAAImL,EAAOF,OAAS,QAAUlI,EAAQ7D,YAAa,CACjDiM,EAAOS,YAAc,MAMvB,GAAIT,EAAOF,OAAS,SAAWY,EAAY,CACzCV,EAAOvF,IAAM,WACX,MAAO,IAAIkG,eAAc,sBAK7B,GAAIlG,GAAM7C,EAAQ6C,IAAMxH,EAAS2N,KAAK9N,EAAE2E,OAAOuI,EAAQpI,GACvDwC,GAAM5E,QAAQ,UAAW4E,EAAOK,EAAK7C,EACrC,OAAO6C,GAGT,IAAIiG,SACKG,UAAW,eAAiBA,OAAOF,iBACtCE,OAAOC,iBAAkB,GAAKA,iBAAgBC,cAGpD,IAAIhB,IACF5B,OAAU,OACV6C,OAAU,MACVjG,MAAU,QACVkG,SAAU,SACVC,KAAU,MAKZjO,GAAS2N,KAAO,WACd,MAAO3N,GAASF,EAAE6N,KAAKhM,MAAM3B,EAASF,EAAG8B,WAQ3C,IAAIsM,GAASlO,EAASkO,OAAS,SAASvJ,GACtCA,IAAYA,KACZ,IAAIA,EAAQwJ,OAAQ9N,KAAK8N,OAASxJ,EAAQwJ,MAC1C9N,MAAK+N,aACL/N,MAAK+E,WAAWzD,MAAMtB,KAAMuB,WAK9B,IAAIyM,GAAgB,YACpB,IAAIC,GAAgB,cACpB,IAAIC,GAAgB,QACpB,IAAIC,GAAgB,0BAGpB3O,GAAE2E,OAAO0J,EAAO7I,UAAWtE,GAIzBqE,WAAY,aAQZqJ,MAAO,SAASA,EAAOxN,EAAMC,GAC3B,IAAKrB,EAAE6O,SAASD,GAAQA,EAAQpO,KAAKsO,eAAeF,EACpD,IAAI5O,EAAE4L,WAAWxK,GAAO,CACtBC,EAAWD,CACXA,GAAO,GAET,IAAKC,EAAUA,EAAWb,KAAKY,EAC/B,IAAI2N,GAASvO,IACbL,GAAS6O,QAAQJ,MAAMA,EAAO,SAASK,GACrC,GAAItM,GAAOoM,EAAOG,mBAAmBN,EAAOK,EAC5CF,GAAOI,QAAQ9N,EAAUsB,EACzBoM,GAAOrM,QAAQZ,MAAMiN,GAAS,SAAW3N,GAAMwC,OAAOjB,GACtDoM,GAAOrM,QAAQ,QAAStB,EAAMuB,EAC9BxC,GAAS6O,QAAQtM,QAAQ,QAASqM,EAAQ3N,EAAMuB,IAElD,OAAOnC,OAKT2O,QAAS,SAAS9N,EAAUsB,GAC1B,GAAItB,EAAUA,EAASS,MAAMtB,KAAMmC,IAIrCyM,SAAU,SAASH,EAAUnK,GAC3B3E,EAAS6O,QAAQI,SAASH,EAAUnK,EACpC,OAAOtE,OAMT+N,YAAa,WACX,IAAK/N,KAAK8N,OAAQ,MAClB9N,MAAK8N,OAAStO,EAAEoF,OAAO5E,KAAM,SAC7B,IAAIoO,GAAON,EAAStO,EAAEwC,KAAKhC,KAAK8N,OAChC,QAAQM,EAAQN,EAAO1D,QAAU,KAAM,CACrCpK,KAAKoO,MAAMA,EAAOpO,KAAK8N,OAAOM,MAMlCE,eAAgB,SAASF,GACvBA,EAAQA,EAAMtG,QAAQqG,EAAc,QACtBrG,QAAQkG,EAAe,WACvBlG,QAAQmG,EAAY,SAAS5B,EAAOwC,GACnC,MAAOA,GAAWxC,EAAQ,aAE3BvE,QAAQoG,EAAY,WAClC,OAAO,IAAIY,QAAO,IAAMV,EAAQ,yBAMlCM,mBAAoB,SAASN,EAAOK,GAClC,GAAI/B,GAAS0B,EAAMW,KAAKN,GAAUrO,MAAM,EACxC,OAAOZ,GAAEsJ,IAAI4D,EAAQ,SAASsC,EAAOpN,GAEnC,GAAIA,IAAM8K,EAAOzK,OAAS,EAAG,MAAO+M,IAAS,IAC7C,OAAOA,GAAQC,mBAAmBD,GAAS,SAcjD,IAAIE,GAAUvP,EAASuP,QAAU,WAC/BlP,KAAKmP,WACL3P,GAAE4P,QAAQpP,KAAM,WAGhB,UAAWuN,UAAW,YAAa,CACjCvN,KAAKqP,SAAW9B,OAAO8B,QACvBrP,MAAKwO,QAAUjB,OAAOiB,SAK1B,IAAIc,GAAgB,cAGpB,IAAIC,GAAe,YAGnB,IAAIC,GAAa,aAGjB,IAAIC,GAAgB,KAGpB,IAAIC,GAAe,MAGnBR,GAAQS,QAAU,KAGlBnQ,GAAE2E,OAAO+K,EAAQlK,UAAWtE,GAI1BkP,SAAU,GAGVC,OAAQ,WACN,MAAO7P,MAAKqP,SAASS,SAAShI,QAAQ,SAAU,SAAW9H,KAAKZ,MAKlE2Q,QAAS,SAASxC,GAChB,GAAIlB,IAASkB,GAAUvN,MAAMqP,SAASW,KAAK3D,MAAM,SACjD,OAAOA,GAAQA,EAAM,GAAK,IAK5B4D,YAAa,SAASxB,EAAUyB,GAC9B,GAAIzB,GAAY,KAAM,CACpB,GAAIzO,KAAKmQ,gBAAkBnQ,KAAKoQ,kBAAoBF,EAAgB,CAClEzB,EAAW4B,UAAUrQ,KAAKqP,SAASS,SAAW9P,KAAKqP,SAASiB,OAC5D,IAAIlR,GAAOY,KAAKZ,KAAK0I,QAAQ2H,EAAe,GAC5C,KAAKhB,EAAStF,QAAQ/J,GAAOqP,EAAWA,EAASrO,MAAMhB,EAAK6C,YACvD,CACLwM,EAAWzO,KAAK+P,WAGpB,MAAOtB,GAAS3G,QAAQwH,EAAe,KAKzCiB,MAAO,SAASjM,GACd,GAAI4K,EAAQS,QAAS,KAAM,IAAIlF,OAAM,4CACrCyE,GAAQS,QAAU,IAIlB3P,MAAKsE,QAAmB9E,EAAE2E,QAAQ/E,KAAM,KAAMY,KAAKsE,QAASA,EAC5DtE,MAAKZ,KAAmBY,KAAKsE,QAAQlF,IACrCY,MAAKoQ,iBAAmBpQ,KAAKsE,QAAQkM,aAAe,KACpDxQ,MAAKyQ,kBAAqBzQ,KAAKsE,QAAQoM,SACvC1Q,MAAKmQ,iBAAsBnQ,KAAKsE,QAAQoM,WAAa1Q,KAAKwO,SAAWxO,KAAKwO,QAAQkC,UAClF,IAAIjC,GAAoBzO,KAAKiQ,aAC7B,IAAIU,GAAoBC,SAASC,YACjC,IAAIC,GAAqBtB,EAAWT,KAAKgC,UAAUC,UAAUC,kBAAoBN,GAAWA,GAAW,EAGvG3Q,MAAKZ,MAAQ,IAAMY,KAAKZ,KAAO,KAAK0I,QAAQyH,EAAc,IAE1D,IAAIuB,GAAS9Q,KAAKoQ,iBAAkB,CAClC,GAAIc,GAAQvR,EAASF,EAAE,4CACvBO,MAAKmR,OAASD,EAAME,OAAOC,SAAS,QAAQ,GAAGC,aAC/CtR,MAAK4O,SAASH,GAKhB,GAAIzO,KAAKmQ,cAAe,CACtBxQ,EAASF,EAAE8N,QAAQ5M,GAAG,WAAYX,KAAKuR,cAClC,IAAIvR,KAAKoQ,kBAAqB,gBAAkB7C,UAAYuD,EAAO,CACxEnR,EAASF,EAAE8N,QAAQ5M,GAAG,aAAcX,KAAKuR,cACpC,IAAIvR,KAAKoQ,iBAAkB,CAChCpQ,KAAKwR,kBAAoBC,YAAYzR,KAAKuR,SAAUvR,KAAK4P,UAK3D5P,KAAKyO,SAAWA,CAChB,IAAIiD,GAAM1R,KAAKqP,QAIf,IAAIrP,KAAKoQ,kBAAoBpQ,KAAKyQ,gBAAiB,CAIjD,IAAKzQ,KAAKmQ,gBAAkBnQ,KAAK6P,SAAU,CACzC7P,KAAKyO,SAAWzO,KAAKiQ,YAAY,KAAM,KACvCjQ,MAAKqP,SAASvH,QAAQ9H,KAAKZ,KAAO,IAAMY,KAAKyO,SAE7C,OAAO,UAIF,IAAIzO,KAAKmQ,eAAiBnQ,KAAK6P,UAAY6B,EAAIC,KAAM,CAC1D3R,KAAKyO,SAAWzO,KAAK+P,UAAUjI,QAAQwH,EAAe,GACtDtP,MAAKwO,QAAQoD,gBAAiBhB,SAASiB,MAAO7R,KAAKZ,KAAOY,KAAKyO,WAKnE,IAAKzO,KAAKsE,QAAQuB,OAAQ,MAAO7F,MAAK8R,WAKxCC,KAAM,WACJpS,EAASF,EAAE8N,QAAQlM,IAAI,WAAYrB,KAAKuR,UAAUlQ,IAAI,aAAcrB,KAAKuR,SACzE,IAAIvR,KAAKwR,kBAAmBQ,cAAchS,KAAKwR,kBAC/CtC,GAAQS,QAAU,OAKpBvB,MAAO,SAASA,EAAOvN,GACrBb,KAAKmP,SAAS/G,SAASgG,MAAOA,EAAOvN,SAAUA,KAKjD0Q,SAAU,SAASU,GACjB,GAAIjM,GAAUhG,KAAKiQ,aACnB,IAAIjK,IAAYhG,KAAKyO,UAAYzO,KAAKmR,OAAQ,CAC5CnL,EAAUhG,KAAKiQ,YAAYjQ,KAAK+P,QAAQ/P,KAAKmR,SAE/C,GAAInL,IAAYhG,KAAKyO,SAAU,MAAO,MACtC,IAAIzO,KAAKmR,OAAQnR,KAAK4O,SAAS5I,EAC/BhG,MAAK8R,WAMPA,QAAS,SAASrD,GAChBA,EAAWzO,KAAKyO,SAAWzO,KAAKiQ,YAAYxB,EAC5C,OAAOjP,GAAE0S,IAAIlS,KAAKmP,SAAU,SAASgD,GACnC,GAAIA,EAAQ/D,MAAM/K,KAAKoL,GAAW,CAChC0D,EAAQtR,SAAS4N,EACjB,OAAO,UAYbG,SAAU,SAASH,EAAUnK,GAC3B,IAAK4K,EAAQS,QAAS,MAAO,MAC7B,KAAKrL,GAAWA,IAAY,KAAMA,GAAWpC,UAAWoC,EAExD,IAAIqD,GAAM3H,KAAKZ,MAAQqP,EAAWzO,KAAKiQ,YAAYxB,GAAY,IAG/DA,GAAWA,EAAS3G,QAAQ4H,EAAc,GAE1C,IAAI1P,KAAKyO,WAAaA,EAAU,MAChCzO,MAAKyO,SAAWA,CAGhB,IAAIA,IAAa,IAAM9G,IAAQ,IAAKA,EAAMA,EAAIvH,MAAM,GAAI,EAGxD,IAAIJ,KAAKmQ,cAAe,CACtBnQ,KAAKwO,QAAQlK,EAAQwD,QAAU,eAAiB,gBAAiB8I,SAASiB,MAAOlK,OAI5E,IAAI3H,KAAKoQ,iBAAkB,CAChCpQ,KAAKoS,YAAYpS,KAAKqP,SAAUZ,EAAUnK,EAAQwD,QAClD,IAAI9H,KAAKmR,QAAW1C,IAAazO,KAAKiQ,YAAYjQ,KAAK+P,QAAQ/P,KAAKmR,SAAW,CAI7E,IAAI7M,EAAQwD,QAAS9H,KAAKmR,OAAOP,SAASyB,OAAOC,OACjDtS,MAAKoS,YAAYpS,KAAKmR,OAAO9B,SAAUZ,EAAUnK,EAAQwD,cAKtD,CACL,MAAO9H,MAAKqP,SAASkD,OAAO5K,GAE9B,GAAIrD,EAAQpC,QAAS,MAAOlC,MAAK8R,QAAQrD,IAK3C2D,YAAa,SAAS/C,EAAUZ,EAAU3G,GACxC,GAAIA,EAAS,CACX,GAAIkI,GAAOX,EAASW,KAAKlI,QAAQ,qBAAsB,GACvDuH,GAASvH,QAAQkI,EAAO,IAAMvB,OACzB,CAELY,EAASsC,KAAO,IAAMlD,KAO5B9O,GAAS6O,QAAU,GAAIU,EAQvB,IAAI/K,GAAS,SAASqO,EAAYC,GAChC,GAAIC,GAAS1S,IACb,IAAI2S,EAKJ,IAAIH,GAAchT,EAAEiG,IAAI+M,EAAY,eAAgB,CAClDG,EAAQH,EAAWxK,gBACd,CACL2K,EAAQ,WAAY,MAAOD,GAAOpR,MAAMtB,KAAMuB,YAIhD/B,EAAE2E,OAAOwO,EAAOD,EAAQD,EAIxB,IAAIG,GAAY,WAAY5S,KAAKgI,YAAc2K,EAC/CC,GAAU5N,UAAY0N,EAAO1N,SAC7B2N,GAAM3N,UAAY,GAAI4N,EAItB,IAAIJ,EAAYhT,EAAE2E,OAAOwO,EAAM3N,UAAWwN,EAI1CG,GAAME,UAAYH,EAAO1N,SAEzB,OAAO2N,GAITvO,GAAMD,OAASkE,EAAWlE,OAAS0J,EAAO1J,OAASkH,EAAKlH,OAAS+K,EAAQ/K,OAASA,CAGlF,IAAI0D,GAAW,WACb,KAAM,IAAI4C,OAAM,kDAIlB,IAAIxD,GAAY,SAASH,EAAOxC,GAC9B,GAAI4D,GAAQ5D,EAAQ4D,KACpB5D,GAAQ4D,MAAQ,SAASlB,GACvB,GAAIkB,EAAOA,EAAMpB,EAAOE,EAAM1C,EAC9BwC,GAAM5E,QAAQ,QAAS4E,EAAOE,EAAM1C,IAIxC,OAAO3E"}
\ No newline at end of file
diff --git a/contrail-webui/server-manager/backbone-validation-amd.js b/contrail-webui/server-manager/backbone-validation-amd.js
new file mode 100644
index 0000000..31f041a
--- /dev/null
+++ b/contrail-webui/server-manager/backbone-validation-amd.js
@@ -0,0 +1,643 @@
+// Backbone.Validation v0.9.1
+//
+// Copyright (c) 2011-2014 Thomas Pedersen
+// Distributed under MIT License
+//
+// Documentation and full license available at:
+// http://thedersen.com/projects/backbone-validation
+(function (factory) {
+ if (typeof exports === 'object') {
+ module.exports = factory(require('backbone'), require('underscore'));
+ } else if (typeof define === 'function' && define.amd) {
+ define(['backbone', 'underscore'], factory);
+ }
+}(function (Backbone, _) {
+ Backbone.Validation = (function(_){
+ 'use strict';
+
+ // Default options
+ // ---------------
+
+ var defaultOptions = {
+ forceUpdate: false,
+ selector: 'name',
+ labelFormatter: 'sentenceCase',
+ valid: Function.prototype,
+ invalid: Function.prototype
+ };
+
+
+ // Helper functions
+ // ----------------
+
+ // Formatting functions used for formatting error messages
+ var formatFunctions = {
+ // Uses the configured label formatter to format the attribute name
+ // to make it more readable for the user
+ formatLabel: function(attrName, model) {
+ return defaultLabelFormatters[defaultOptions.labelFormatter](attrName, model);
+ },
+
+ // Replaces nummeric placeholders like {0} in a string with arguments
+ // passed to the function
+ format: function() {
+ var args = Array.prototype.slice.call(arguments),
+ text = args.shift();
+ return text.replace(/\{(\d+)\}/g, function(match, number) {
+ return typeof args[number] !== 'undefined' ? args[number] : match;
+ });
+ }
+ };
+
+ // Flattens an object
+ // eg:
+ //
+ // var o = {
+ // address: {
+ // street: 'Street',
+ // zip: 1234
+ // }
+ // };
+ //
+ // becomes:
+ //
+ // var o = {
+ // 'address.street': 'Street',
+ // 'address.zip': 1234
+ // };
+ var flatten = function (obj, into, prefix) {
+ into = into || {};
+ prefix = prefix || '';
+
+ _.each(obj, function(val, key) {
+ if(obj.hasOwnProperty(key)) {
+ if (val && typeof val === 'object' && !(
+ val instanceof Array ||
+ val instanceof Date ||
+ val instanceof RegExp ||
+ val instanceof Backbone.Model ||
+ val instanceof Backbone.Collection)
+ ) {
+ flatten(val, into, prefix + key + '.');
+ }
+ else {
+ into[prefix + key] = val;
+ }
+ }
+ });
+
+ return into;
+ };
+
+ // Validation
+ // ----------
+
+ var Validation = (function(){
+
+ // Returns an object with undefined properties for all
+ // attributes on the model that has defined one or more
+ // validation rules.
+ var getValidatedAttrs = function(model) {
+ return _.reduce(_.keys(_.result(model, 'validation') || {}), function(memo, key) {
+ memo[key] = void 0;
+ return memo;
+ }, {});
+ };
+
+ // Looks on the model for validations for a specified
+ // attribute. Returns an array of any validators defined,
+ // or an empty array if none is defined.
+ var getValidators = function(model, attr) {
+ var attrValidationSet = model.validation ? _.result(model, 'validation')[attr] || {} : {};
+
+ // If the validator is a function or a string, wrap it in a function validator
+ if (_.isFunction(attrValidationSet) || _.isString(attrValidationSet)) {
+ attrValidationSet = {
+ fn: attrValidationSet
+ };
+ }
+
+ // Stick the validator object into an array
+ if(!_.isArray(attrValidationSet)) {
+ attrValidationSet = [attrValidationSet];
+ }
+
+ // Reduces the array of validators into a new array with objects
+ // with a validation method to call, the value to validate against
+ // and the specified error message, if any
+ return _.reduce(attrValidationSet, function(memo, attrValidation) {
+ _.each(_.without(_.keys(attrValidation), 'msg'), function(validator) {
+ memo.push({
+ fn: defaultValidators[validator],
+ val: attrValidation[validator],
+ msg: attrValidation.msg
+ });
+ });
+ return memo;
+ }, []);
+ };
+
+ // Validates an attribute against all validators defined
+ // for that attribute. If one or more errors are found,
+ // the first error message is returned.
+ // If the attribute is valid, an empty string is returned.
+ var validateAttr = function(model, attr, value, computed) {
+ // Reduces the array of validators to an error message by
+ // applying all the validators and returning the first error
+ // message, if any.
+ return _.reduce(getValidators(model, attr), function(memo, validator){
+ // Pass the format functions plus the default
+ // validators as the context to the validator
+ var ctx = _.extend({}, formatFunctions, defaultValidators),
+ result = validator.fn.call(ctx, value, attr, validator.val, model, computed);
+
+ if(result === false || memo === false) {
+ return false;
+ }
+ if (result && !memo) {
+ return _.result(validator, 'msg') || result;
+ }
+ return memo;
+ }, '');
+ };
+
+ // Loops through the model's attributes and validates them all.
+ // Returns and object containing names of invalid attributes
+ // as well as error messages.
+ var validateModel = function(model, attrs) {
+ var error,
+ invalidAttrs = {},
+ isValid = true,
+ computed = _.clone(attrs),
+ flattened = flatten(attrs);
+
+ _.each(flattened, function(val, attr) {
+ error = validateAttr(model, attr, val, computed);
+ if (error) {
+ invalidAttrs[attr] = error;
+ isValid = false;
+ }
+ });
+
+ return {
+ invalidAttrs: invalidAttrs,
+ isValid: isValid
+ };
+ };
+
+ // Contains the methods that are mixed in on the model when binding
+ var mixin = function(view, options) {
+ return {
+
+ // Check whether or not a value, or a hash of values
+ // passes validation without updating the model
+ preValidate: function(attr, value) {
+ var self = this,
+ result = {},
+ error;
+
+ if(_.isObject(attr)){
+ _.each(attr, function(value, key) {
+ error = self.preValidate(key, value);
+ if(error){
+ result[key] = error;
+ }
+ });
+
+ return _.isEmpty(result) ? undefined : result;
+ }
+ else {
+ return validateAttr(this, attr, value, _.extend({}, this.attributes));
+ }
+ },
+
+ // Check to see if an attribute, an array of attributes or the
+ // entire model is valid. Passing true will force a validation
+ // of the model.
+ isValid: function(option) {
+ var flattened = flatten(this.attributes);
+
+ if(_.isString(option)){
+ return !validateAttr(this, option, flattened[option], _.extend({}, this.attributes));
+ }
+ if(_.isArray(option)){
+ return _.reduce(option, function(memo, attr) {
+ return memo && !validateAttr(this, attr, flattened[attr], _.extend({}, this.attributes));
+ }, true, this);
+ }
+ if(option === true) {
+ this.validate();
+ }
+ return this.validation ? this._isValid : true;
+ },
+
+ // This is called by Backbone when it needs to perform validation.
+ // You can call it manually without any parameters to validate the
+ // entire model.
+ validate: function(attrs, setOptions){
+ var model = this,
+ validateAll = !attrs,
+ opt = _.extend({}, options, setOptions),
+ validatedAttrs = getValidatedAttrs(model),
+ allAttrs = _.extend({}, validatedAttrs, model.attributes, attrs),
+ changedAttrs = flatten(attrs || allAttrs),
+
+ result = validateModel(model, allAttrs);
+
+ model._isValid = result.isValid;
+
+ // After validation is performed, loop through all validated attributes
+ // and call the valid callbacks so the view is updated.
+ _.each(validatedAttrs, function(val, attr){
+ var invalid = result.invalidAttrs.hasOwnProperty(attr);
+ if(!invalid){
+ opt.valid(view, attr, opt.selector);
+ }
+ });
+
+ // After validation is performed, loop through all validated and changed attributes
+ // and call the invalid callback so the view is updated.
+ _.each(validatedAttrs, function(val, attr){
+ var invalid = result.invalidAttrs.hasOwnProperty(attr),
+ changed = changedAttrs.hasOwnProperty(attr);
+
+ if(invalid && (changed || validateAll)){
+ opt.invalid(view, attr, result.invalidAttrs[attr], opt.selector);
+ }
+ });
+
+ // Trigger validated events.
+ // Need to defer this so the model is actually updated before
+ // the event is triggered.
+ _.defer(function() {
+ model.trigger('validated', model._isValid, model, result.invalidAttrs);
+ model.trigger('validated:' + (model._isValid ? 'valid' : 'invalid'), model, result.invalidAttrs);
+ });
+
+ // Return any error messages to Backbone, unless the forceUpdate flag is set.
+ // Then we do not return anything and fools Backbone to believe the validation was
+ // a success. That way Backbone will update the model regardless.
+ if (!opt.forceUpdate && _.intersection(_.keys(result.invalidAttrs), _.keys(changedAttrs)).length > 0) {
+ return result.invalidAttrs;
+ }
+ }
+ };
+ };
+
+ // Helper to mix in validation on a model
+ var bindModel = function(view, model, options) {
+ _.extend(model, mixin(view, options));
+ };
+
+ // Removes the methods added to a model
+ var unbindModel = function(model) {
+ delete model.validate;
+ delete model.preValidate;
+ delete model.isValid;
+ };
+
+ // Mix in validation on a model whenever a model is
+ // added to a collection
+ var collectionAdd = function(model) {
+ bindModel(this.view, model, this.options);
+ };
+
+ // Remove validation from a model whenever a model is
+ // removed from a collection
+ var collectionRemove = function(model) {
+ unbindModel(model);
+ };
+
+ // Returns the public methods on Backbone.Validation
+ return {
+
+ // Current version of the library
+ version: '0.9.1',
+
+ // Called to configure the default options
+ configure: function(options) {
+ _.extend(defaultOptions, options);
+ },
+
+ // Hooks up validation on a view with a model
+ // or collection
+ bind: function(view, options) {
+ options = _.extend({}, defaultOptions, defaultCallbacks, options);
+
+ var model = options.model || view.model,
+ collection = options.collection || view.collection;
+
+ if(typeof model === 'undefined' && typeof collection === 'undefined'){
+ throw 'Before you execute the binding your view must have a model or a collection.\n' +
+ 'See http://thedersen.com/projects/backbone-validation/#using-form-model-validation for more information.';
+ }
+
+ if(model) {
+ bindModel(view, model, options);
+ }
+ else if(collection) {
+ collection.each(function(model){
+ bindModel(view, model, options);
+ });
+ collection.bind('add', collectionAdd, {view: view, options: options});
+ collection.bind('remove', collectionRemove);
+ }
+ },
+
+ // Removes validation from a view with a model
+ // or collection
+ unbind: function(view, options) {
+ options = _.extend({}, options);
+ var model = options.model || view.model,
+ collection = options.collection || view.collection;
+
+ if(model) {
+ unbindModel(model);
+ }
+ else if(collection) {
+ collection.each(function(model){
+ unbindModel(model);
+ });
+ collection.unbind('add', collectionAdd);
+ collection.unbind('remove', collectionRemove);
+ }
+ },
+
+ // Used to extend the Backbone.Model.prototype
+ // with validation
+ mixin: mixin(null, defaultOptions)
+ };
+ }());
+
+
+ // Callbacks
+ // ---------
+
+ var defaultCallbacks = Validation.callbacks = {
+
+ // Gets called when a previously invalid field in the
+ // view becomes valid. Removes any error message.
+ // Should be overridden with custom functionality.
+ valid: function(view, attr, selector) {
+ view.$('[' + selector + '~="' + attr + '"]')
+ .removeClass('invalid')
+ .removeAttr('data-error');
+ },
+
+ // Gets called when a field in the view becomes invalid.
+ // Adds a error message.
+ // Should be overridden with custom functionality.
+ invalid: function(view, attr, error, selector) {
+ view.$('[' + selector + '~="' + attr + '"]')
+ .addClass('invalid')
+ .attr('data-error', error);
+ }
+ };
+
+
+ // Patterns
+ // --------
+
+ var defaultPatterns = Validation.patterns = {
+ // Matches any digit(s) (i.e. 0-9)
+ digits: /^\d+$/,
+
+ // Matches any number (e.g. 100.000)
+ number: /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/,
+
+ // Matches a valid email address (e.g. mail@example.com)
+ email: /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,
+
+ // Mathes any valid url (e.g. http://www.xample.com)
+ url: /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i
+ };
+
+
+ // Error messages
+ // --------------
+
+ // Error message for the build in validators.
+ // {x} gets swapped out with arguments form the validator.
+ var defaultMessages = Validation.messages = {
+ required: '{0} is required',
+ acceptance: '{0} must be accepted',
+ min: '{0} must be greater than or equal to {1}',
+ max: '{0} must be less than or equal to {1}',
+ range: '{0} must be between {1} and {2}',
+ length: '{0} must be {1} characters',
+ minLength: '{0} must be at least {1} characters',
+ maxLength: '{0} must be at most {1} characters',
+ rangeLength: '{0} must be between {1} and {2} characters',
+ oneOf: '{0} must be one of: {1}',
+ equalTo: '{0} must be the same as {1}',
+ digits: '{0} must only contain digits',
+ number: '{0} must be a number',
+ email: '{0} must be a valid email',
+ url: '{0} must be a valid url',
+ inlinePattern: '{0} is invalid'
+ };
+
+ // Label formatters
+ // ----------------
+
+ // Label formatters are used to convert the attribute name
+ // to a more human friendly label when using the built in
+ // error messages.
+ // Configure which one to use with a call to
+ //
+ // Backbone.Validation.configure({
+ // labelFormatter: 'label'
+ // });
+ var defaultLabelFormatters = Validation.labelFormatters = {
+
+ // Returns the attribute name with applying any formatting
+ none: function(attrName) {
+ return attrName;
+ },
+
+ // Converts attributeName or attribute_name to Attribute name
+ sentenceCase: function(attrName) {
+ return attrName.replace(/(?:^\w|[A-Z]|\b\w)/g, function(match, index) {
+ return index === 0 ? match.toUpperCase() : ' ' + match.toLowerCase();
+ }).replace(/_/g, ' ');
+ },
+
+ // Looks for a label configured on the model and returns it
+ //
+ // var Model = Backbone.Model.extend({
+ // validation: {
+ // someAttribute: {
+ // required: true
+ // }
+ // },
+ //
+ // labels: {
+ // someAttribute: 'Custom label'
+ // }
+ // });
+ label: function(attrName, model) {
+ return (model.labels && model.labels[attrName]) || defaultLabelFormatters.sentenceCase(attrName, model);
+ }
+ };
+
+
+ // Built in validators
+ // -------------------
+
+ var defaultValidators = Validation.validators = (function(){
+ // Use native trim when defined
+ var trim = String.prototype.trim ?
+ function(text) {
+ return text === null ? '' : String.prototype.trim.call(text);
+ } :
+ function(text) {
+ var trimLeft = /^\s+/,
+ trimRight = /\s+$/;
+
+ return text === null ? '' : text.toString().replace(trimLeft, '').replace(trimRight, '');
+ };
+
+ // Determines whether or not a value is a number
+ var isNumber = function(value){
+ return _.isNumber(value) || (_.isString(value) && value.match(defaultPatterns.number));
+ };
+
+ // Determines whether or not a value is empty
+ var hasValue = function(value) {
+ return !(_.isNull(value) || _.isUndefined(value) || (_.isString(value) && trim(value) === '') || (_.isArray(value) && _.isEmpty(value)));
+ };
+
+ return {
+ // Function validator
+ // Lets you implement a custom function used for validation
+ fn: function(value, attr, fn, model, computed) {
+ if(_.isString(fn)){
+ fn = model[fn];
+ }
+ return fn.call(model, value, attr, computed);
+ },
+
+ // Required validator
+ // Validates if the attribute is required or not
+ // This can be specified as either a boolean value or a function that returns a boolean value
+ required: function(value, attr, required, model, computed) {
+ var isRequired = _.isFunction(required) ? required.call(model, value, attr, computed) : required;
+ if(!isRequired && !hasValue(value)) {
+ return false; // overrides all other validators
+ }
+ if (isRequired && !hasValue(value)) {
+ return this.format(defaultMessages.required, this.formatLabel(attr, model));
+ }
+ },
+
+ // Acceptance validator
+ // Validates that something has to be accepted, e.g. terms of use
+ // `true` or 'true' are valid
+ acceptance: function(value, attr, accept, model) {
+ if(value !== 'true' && (!_.isBoolean(value) || value === false)) {
+ return this.format(defaultMessages.acceptance, this.formatLabel(attr, model));
+ }
+ },
+
+ // Min validator
+ // Validates that the value has to be a number and equal to or greater than
+ // the min value specified
+ min: function(value, attr, minValue, model) {
+ if (!isNumber(value) || value < minValue) {
+ return this.format(defaultMessages.min, this.formatLabel(attr, model), minValue);
+ }
+ },
+
+ // Max validator
+ // Validates that the value has to be a number and equal to or less than
+ // the max value specified
+ max: function(value, attr, maxValue, model) {
+ if (!isNumber(value) || value > maxValue) {
+ return this.format(defaultMessages.max, this.formatLabel(attr, model), maxValue);
+ }
+ },
+
+ // Range validator
+ // Validates that the value has to be a number and equal to or between
+ // the two numbers specified
+ range: function(value, attr, range, model) {
+ if(!isNumber(value) || value < range[0] || value > range[1]) {
+ return this.format(defaultMessages.range, this.formatLabel(attr, model), range[0], range[1]);
+ }
+ },
+
+ // Length validator
+ // Validates that the value has to be a string with length equal to
+ // the length value specified
+ length: function(value, attr, length, model) {
+ if (!_.isString(value) || value.length !== length) {
+ return this.format(defaultMessages.length, this.formatLabel(attr, model), length);
+ }
+ },
+
+ // Min length validator
+ // Validates that the value has to be a string with length equal to or greater than
+ // the min length value specified
+ minLength: function(value, attr, minLength, model) {
+ if (!_.isString(value) || value.length < minLength) {
+ return this.format(defaultMessages.minLength, this.formatLabel(attr, model), minLength);
+ }
+ },
+
+ // Max length validator
+ // Validates that the value has to be a string with length equal to or less than
+ // the max length value specified
+ maxLength: function(value, attr, maxLength, model) {
+ if (!_.isString(value) || value.length > maxLength) {
+ return this.format(defaultMessages.maxLength, this.formatLabel(attr, model), maxLength);
+ }
+ },
+
+ // Range length validator
+ // Validates that the value has to be a string and equal to or between
+ // the two numbers specified
+ rangeLength: function(value, attr, range, model) {
+ if (!_.isString(value) || value.length < range[0] || value.length > range[1]) {
+ return this.format(defaultMessages.rangeLength, this.formatLabel(attr, model), range[0], range[1]);
+ }
+ },
+
+ // One of validator
+ // Validates that the value has to be equal to one of the elements in
+ // the specified array. Case sensitive matching
+ oneOf: function(value, attr, values, model) {
+ if(!_.include(values, value)){
+ return this.format(defaultMessages.oneOf, this.formatLabel(attr, model), values.join(', '));
+ }
+ },
+
+ // Equal to validator
+ // Validates that the value has to be equal to the value of the attribute
+ // with the name specified
+ equalTo: function(value, attr, equalTo, model, computed) {
+ if(value !== computed[equalTo]) {
+ return this.format(defaultMessages.equalTo, this.formatLabel(attr, model), this.formatLabel(equalTo, model));
+ }
+ },
+
+ // Pattern validator
+ // Validates that the value has to match the pattern specified.
+ // Can be a regular expression or the name of one of the built in patterns
+ pattern: function(value, attr, pattern, model) {
+ if (!hasValue(value) || !value.toString().match(defaultPatterns[pattern] || pattern)) {
+ return this.format(defaultMessages[pattern] || defaultMessages.inlinePattern, this.formatLabel(attr, model), pattern);
+ }
+ }
+ };
+ }());
+
+ // Set the correct context for all validators
+ // when used from within a method validator
+ _.each(defaultValidators, function(validator, key){
+ defaultValidators[key] = _.bind(defaultValidators[key], _.extend({}, formatFunctions, defaultValidators));
+ });
+
+ return Validation;
+ }(_));
+ return Backbone.Validation;
+}));
\ No newline at end of file
diff --git a/contrail-webui/server-manager/knockback.min.js b/contrail-webui/server-manager/knockback.min.js
new file mode 100644
index 0000000..4c327fa
--- /dev/null
+++ b/contrail-webui/server-manager/knockback.min.js
@@ -0,0 +1,10 @@
+/*
+ knockback.js 0.19.2
+ Copyright (c) 2011-2014 Kevin Malakoff.
+ License: MIT (http://www.opensource.org/licenses/mit-license.php)
+ Source: https://github.com/kmalakoff/knockback
+ Dependencies: Knockout.js, Backbone.js, and Underscore.js (or LoDash.js).
+ Optional dependencies: Backbone.ModelRef.js and BackboneORM.
+*/
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("knockout"),require("backbone"),require("underscore"),function(){try{return require("jquery")}catch(e){}}()):"function"==typeof define&&define.amd?define(["knockout","backbone","underscore"],function(r,n,o){return t(r,n,o,e.jQuery)}):"object"==typeof exports?exports.kb=t(require("knockout"),require("backbone"),require("underscore"),function(){try{return require("jquery")}catch(e){}}()):e.kb=t(e.ko,e.Backbone,e._,e.jQuery)}(this,function(e,t,r,n){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){r(1),r(2),r(3),r(4),r(5),r(6),r(7),r(8),r(9),r(10),r(11),r(12),r(13),r(15),r(16),r(17),r(18),r(19),e.exports=r(14)},function(e,t,r){var n,o,i,s,a,l,u,c,d=function(e,t){return function(){return e.apply(t,arguments)}},p=[].indexOf||function(e){for(var t=0,r=this.length;r>t;t++)if(t in this&&this[t]===e)return t;return-1};c=a=r(6),u=c._,l=c.ko,i=0,n=-1,o=1,s=["destroy","shareOptions","filters","comparator","sortAttribute","viewModelByModel","hasViewModels"],a.compare=function(e,t){return u.isString(e)?e.localeCompare(""+t):u.isString(t)?t.localeCompare(""+e):e===t?i:t>e?n:o},a.CollectionObservable=function(){function e(e,t){return this._onCollectionChange=d(this._onCollectionChange,this),a.ignore(function(r){return function(){var n,o,i;return!u.isUndefined(t)||e instanceof a.Collection?u.isArray(e)&&(e=new a.Collection(e)):(i=[new a.Collection,e],e=i[0],t=i[1]),t||(t={}),o=a.utils.wrappedObservable(r,l.observableArray([])),o.__kb_is_co=!0,r.in_edit=0,r.__kb||(r.__kb={}),t=a.utils.collapseOptions(t),t.auto_compact&&(r.auto_compact=!0),r._comparator=l.observable(t.sort_attribute?r._attributeComparator(t.sort_attribute):t.comparator),r._filters=l.observableArray(t.filters?u.isArray(t.filters)?t.filters:t.filters?[t.filters]:void 0:[]),n=r.create_options={store:a.Store.useOptionsOrCreate(t,e,o)},r.path=t.path,n.factory=a.utils.wrappedFactory(o,r._shareOrCreateFactory(t)),n.path=a.utils.pathJoin(t.path,"models"),n.creator=n.factory.creatorForPath(null,n.path),n.creator&&(r.models_only=n.creator.models_only),a.publishMethods(o,r,s),r._collection=l.observable(e),o.collection=r.collection=l.computed({read:function(){return r._collection()},write:function(e){return a.ignore(function(){var t;if((t=r._collection())!==e)return t&&t.unbind("all",r._onCollectionChange),e&&e.bind("all",r._onCollectionChange),r._collection(e)})}}),e&&e.bind("all",r._onCollectionChange),r._mapper=l.computed(function(){var e,t,n,i,s,c,d,p;if(e=r._comparator(),i=r._filters())for(d=0,p=i.length;p>d;d++)n=i[d],l.utils.unwrapObservable(n);return t=r._collection(),r.in_edit?void 0:(o=a.utils.wrappedObservable(r),t&&(s=t.models),s&&0!==t.models.length?(s=u.filter(s,function(e){return!i.length||r._selectModel(e)}),c=e?u.map(s,function(e){return r._createViewModel(e)}).sort(e):r.models_only?i.length?s:s.slice():u.map(s,function(e){return r._createViewModel(e)})):c=[],r.in_edit++,o(c),r.in_edit--)}),o.subscribe(u.bind(r._onObservableArrayChange,r)),!a.statistics||a.statistics.register("CollectionObservable",r),o}}(this))}return e.extend=a.extend,e.prototype.destroy=function(){var e,t,r;return this.__kb_released=!0,r=a.utils.wrappedObservable(this),t=a.peek(this._collection),t&&(t.unbind("all",this._onCollectionChange),e=a.peek(r),e.splice(0,e.length)),this.collection.dispose(),this._collection=r.collection=this.collection=null,this._mapper.dispose(),this._mapper=null,a.release(this._filters),this._filters=null,this._comparator(null),this._comparator=null,this.create_options=null,r.collection=null,a.utils.wrappedDestroy(this),!a.statistics||a.statistics.unregister("CollectionObservable",this)},e.prototype.shareOptions=function(){var e;return e=a.utils.wrappedObservable(this),{store:a.utils.wrappedStore(e),factory:a.utils.wrappedFactory(e)}},e.prototype.filters=function(e){return this._filters(e?u.isArray(e)?e:[e]:[])},e.prototype.comparator=function(e){return this._comparator(e)},e.prototype.sortAttribute=function(e){return this._comparator(e?this._attributeComparator(e):null)},e.prototype.viewModelByModel=function(e){var t;return this.models_only?null:(t=e.hasOwnProperty(e.idAttribute)?e.idAttribute:"cid",u.find(a.peek(a.utils.wrappedObservable(this)),function(r){var n;return(null!=r&&null!=(n=r.__kb)?n.object:void 0)?r.__kb.object[t]===e[t]:!1}))},e.prototype.hasViewModels=function(){return!this.models_only},e.prototype.compact=function(){return a.ignore(function(e){return function(){var t;return t=a.utils.wrappedObservable(e),a.utils.wrappedStoreIsOwned(t)?(a.utils.wrappedStore(t).clear(),e._collection.notifySubscribers(e._collection())):void 0}}(this))},e.prototype._shareOrCreateFactory=function(e){var t,r,n,o;if(t=a.utils.pathJoin(e.path,"models"),n=e.factories,(o=e.factory)&&(r=o.creatorForPath(null,t))&&(!n||n.models===r)){if(!n)return o;if(o.hasPathMappings(n,e.path))return o}return o=new a.Factory(e.factory),n&&o.addPathMappings(n,e.path),o.creatorForPath(null,t)||(e.hasOwnProperty("models_only")?e.models_only?o.addPathMapping(t,{models_only:!0}):o.addPathMapping(t,a.ViewModel):e.view_model?o.addPathMapping(t,e.view_model):e.create?o.addPathMapping(t,{create:e.create}):o.addPathMapping(t,a.ViewModel)),o},e.prototype._onCollectionChange=function(e,t){return a.ignore(function(r){return function(){var n,o,i,s;if(!r.in_edit)switch(e){case"reset":r.auto_compact?r.compact():r._collection.notifySubscribers(r._collection());break;case"sort":case"resort":r._collection.notifySubscribers(r._collection());break;case"new":case"add":if(!r._selectModel(t))return;if(i=a.utils.wrappedObservable(r),n=r._collection(),-1===n.indexOf(t))return;if(s=r.viewModelByModel(t))return;r.in_edit++,(o=r._comparator())?(i().push(r._createViewModel(t)),i.sort(o)):i.splice(n.indexOf(t),0,r._createViewModel(t)),r.in_edit--;break;case"remove":case"destroy":r._onModelRemove(t);break;case"change":r._selectModel(t)?(s=r.models_only?t:r.viewModelByModel(t),s?(o=r._comparator())&&(i=a.utils.wrappedObservable(r),r.in_edit++,i.sort(o),r.in_edit--):r._onCollectionChange("add",t)):r._onModelRemove(t)}}}(this))},e.prototype._onModelRemove=function(e){var t,r;return(r=this.models_only?e:this.viewModelByModel(e))?(t=a.utils.wrappedObservable(this),this.in_edit++,t.remove(r),this.in_edit--):void 0},e.prototype._onObservableArrayChange=function(e){return a.ignore(function(t){return function(){var r,n,o,i,s,l,c,d,p;if(!t.in_edit&&(t.models_only&&(!e.length||a.utils.hasModelSignature(e[0]))||!t.models_only&&(!e.length||u.isObject(e[0])&&!a.utils.hasModelSignature(e[0]))||a._throwUnexpected(t,"incorrect type passed"),s=a.utils.wrappedObservable(t),r=a.peek(t._collection),n=a.peek(t._filters).length,r)){if(c=e,t.models_only)i=u.filter(e,function(e){return!n||t._selectModel(e)});else for(!n||(c=[]),i=[],d=0,p=e.length;p>d;d++){if(l=e[d],o=a.utils.wrappedObject(l),n){if(!t._selectModel(o))continue;c.push(l)}t.create_options.store.findOrReplace(o,t.create_options.creator,l),i.push(o)}t.in_edit++,e.length===c.length||s(c),u.isEqual(r.models,i)||r.reset(i),t.in_edit--}}}(this))},e.prototype._attributeComparator=function(e){var t;return t=function(t,r){var n;return n=l.utils.unwrapObservable(e),a.compare(t.get(n),r.get(n))},this.models_only?t:function(e,r){return t(a.utils.wrappedModel(e),a.utils.wrappedModel(r))}},e.prototype._createViewModel=function(e){return this.models_only?e:this.create_options.store.findOrCreate(e,this.create_options)},e.prototype._selectModel=function(e){var t,r,n,o,i;for(r=a.peek(this._filters),n=0,o=r.length;o>n;n++)if(t=r[n],t=a.peek(t),u.isFunction(t)){if(!t(e))return!1}else if(u.isArray(t)){if(i=e.id,p.call(t,i)<0)return!1}else if(e.id!==t)return!1;return!0},e}(),a.collectionObservable=function(e,t){return new a.CollectionObservable(e,t)}},function(e,t,r){var n,o,i,s,a,l,u;u=o=r(6),l=u._,s=u.ko,n={"default":null,"backbone-orm":null,"backbone-associations":r(26),"backbone-relational":r(27),supermodel:r(28)},o.orm=n["default"];for(i in n)if(a=n[i],a&&a.isAvailable()){o.orm=a;break}e.exports=function(e){var t;null==e&&(e={});for(i in e)switch(a=e[i],i){case"orm":if(l.isString(a)){if(!n.hasOwnProperty(a)){console.log("Knockback configure: could not find orm: "+a+". Available: "+l.keys(n).join(", "));continue}if((t=n[a])&&!t.isAvailable()){console.log("Knockback configure: could not enable orm "+a+". Make sure it is included before Knockback");continue}o.orm=t;continue}o.orm=a;break;default:o[i]=a}}},function(e,t,r){var n,o,i,s,a=function(e,t){return function(){return e.apply(t,arguments)}};s=n=r(6),i=s._,o=s.ko,n.EventWatcher=function(){function e(e,t,r){this._unbindCallbacks=a(this._unbindCallbacks,this),this._onModelUnloaded=a(this._onModelUnloaded,this),this._onModelLoaded=a(this._onModelLoaded,this),this.__kb||(this.__kb={}),this.__kb.callbacks={},this.ee=null,r&&this.registerCallbacks(t,r),e&&this.emitter(e)}return e.useOptionsOrCreate=function(e,t,r,o){return e.event_watcher?(e.event_watcher.emitter()!==t&&e.event_watcher.model_ref!==t&&n._throwUnexpected(this,"emitter not matching"),n.utils.wrappedEventWatcher(r,e.event_watcher).registerCallbacks(r,o)):(n.utils.wrappedEventWatcherIsOwned(r,!0),n.utils.wrappedEventWatcher(r,new n.EventWatcher(t)).registerCallbacks(r,o))},e.prototype.destroy=function(){return this.emitter(null),this.__kb.callbacks=null,n.utils.wrappedDestroy(this)},e.prototype.emitter=function(e){return 0===arguments.length||this.ee===e?this.ee:(this.model_ref&&(this.model_ref.unbind("loaded",this._onModelLoaded),this.model_ref.unbind("unloaded",this._onModelUnloaded),this.model_ref.release(),this.model_ref=null),n.Backbone&&n.Backbone.ModelRef&&e instanceof n.Backbone.ModelRef?(this.model_ref=e,this.model_ref.retain(),this.model_ref.bind("loaded",this._onModelLoaded),this.model_ref.bind("unloaded",this._onModelUnloaded),e=this.model_ref.model()||null):delete this.model_ref,this.ee!==e&&(e?this._onModelLoaded(e):this._onModelUnloaded(this.ee)),e)},e.prototype.registerCallbacks=function(e,t){var r,s,a,l,u,c;for(e||n._throwMissing(this,"obj"),t||n._throwMissing(this,"callback_info"),s=t.event_selector?t.event_selector.split(" "):["change"],a=this.ee,l=function(r){return function(s){var l,u;return(l=r.__kb.callbacks[s])||(l=r.__kb.callbacks[s]={model:null,list:[],fn:function(e){var t,r,i,a;for(a=l.list,r=0,i=a.length;i>r;r++)t=a[r],t.update&&(e&&t.key&&e.hasChanged&&!e.hasChanged(o.utils.unwrapObservable(t.key))||(!n.statistics||n.statistics.addModelEvent({name:s,model:e,key:t.key,path:t.path}),t.update()));return null}}),l.list.push(u=i.defaults({obj:e},t)),a?r._onModelLoaded(a):void 0}}(this),u=0,c=s.length;c>u;u++)r=s[u],r&&l(r);return this},e.prototype.releaseCallbacks=function(e){var t,r,o;this.ee=null,o=this.__kb.callbacks;for(r in o)t=o[r],this._unbindCallbacks(r,t,n.wasReleased(e));return delete this.__kb.callbacks},e.prototype._onModelLoaded=function(e){var t,r,o,i,s,a,l,u;this.ee=e,a=this.__kb.callbacks;for(r in a)for(t=a[r],t.model&&t.model!==e&&this._unbindCallbacks(r,t,!0),t.model||(t.model=e,e.bind(r,t.fn)),l=t.list,i=0,s=l.length;s>i;i++)o=l[i],o.unbind_fn||(o.unbind_fn=null!=(u=n.orm)?u.bind(e,o.key,o.update,o.path):void 0),o.emitter&&o.emitter(e)},e.prototype._onModelUnloaded=function(e){var t,r,n;if(this.ee===e){this.ee=null,n=this.__kb.callbacks;for(r in n)t=n[r],this._unbindCallbacks(r,t)}},e.prototype._unbindCallbacks=function(e,t,r){var o,i,s,a;for(t.model&&(t.model.unbind(e,t.fn),t.model=null),a=t.list,i=0,s=a.length;s>i;i++)o=a[i],o.unbind_fn&&(o.unbind_fn(),o.unbind_fn=null),!o.emitter||r||n.wasReleased(o.obj)||o.emitter(null)},e}(),n.emitterObservable=function(e,t){return new n.EventWatcher(e,t)}},function(e,t,r){var n,o;o=(n=r(6))._,n.Factory=function(){function e(e){this.parent_factory=e,this.paths={}}return e.useOptionsOrCreate=function(e,t,r){var o;return e.factory&&(!e.factories||e.factories&&e.factory.hasPathMappings(e.factories,r))?n.utils.wrappedFactory(t,e.factory):(o=n.utils.wrappedFactory(t,new n.Factory(e.factory)),e.factories&&o.addPathMappings(e.factories,r),o)},e.prototype.hasPath=function(e){return this.paths.hasOwnProperty(e)||this.parent_factory&&this.parent_factory.hasPath(e)},e.prototype.addPathMapping=function(e,t){return this.paths[e]=t},e.prototype.addPathMappings=function(e,t){var r,o;for(o in e)r=e[o],this.paths[n.utils.pathJoin(t,o)]=r},e.prototype.hasPathMappings=function(e,t){var r,o,i,s;r=!0;for(s in e)o=e[s],r&=(i=this.creatorForPath(null,n.utils.pathJoin(t,s)))&&o===i;return r},e.prototype.creatorForPath=function(e,t){var r;return(r=this.paths[t])?r.view_model?r.view_model:r:this.parent_factory&&(r=this.parent_factory.creatorForPath(e,t))?r:null},e}()},function(e,t,r){(function(e){var t,n,o,i,s,a,l,u;s=null!=s?s:e,u=n=r(6),a=u._,o=u.ko,t=u.$,n.RECUSIVE_AUTO_INJECT=!0,o.bindingHandlers.inject={init:function(e,t,r,i){return n.Inject.inject(o.utils.unwrapObservable(t()),i,e,t,r)}},n.Inject=function(){function e(){}return e.inject=function(e,t,r,o,i,s){var l;return l=function(e){var l,u,c;if(a.isFunction(e))t=new e(t,r,o,i),n.releaseOnNodeRemove(t,r);else{e.view_model&&(t=new e.view_model(t,r,o,i),n.releaseOnNodeRemove(t,r));for(l in e)c=e[l],"view_model"!==l&&("create"===l?c(t,r,o,i):a.isObject(c)&&!a.isFunction(c)?(u=s||c&&c.create?{}:t,t[l]=n.Inject.inject(c,u,r,o,i,!0)):t[l]=c)}return t},s?l(e):n.ignore(function(){return l(e)})},e.injectViewModels=function(e){var t,r,o,i,l,u,c,d,p,f;for(d=[],u=function(e){var t,r,n,o,i;for(e.__kb_injected||e.attributes&&(t=a.find(e.attributes,function(e){return"kb-inject"===e.name}))&&(e.__kb_injected=!0,d.push({el:e,view_model:{},binding:t.value})),i=e.childNodes,n=0,o=i.length;o>n;n++)r=i[n],u(r)},!e&&(null!=s?s.document:void 0)&&(e=s.document),u(e),p=0,f=d.length;f>p;p++)r=d[p],(l=r.binding)&&(l.search(/[:]/)<0||(l="{"+l+"}"),i=new Function("","return ( "+l+" )")(),i||(i={}),!i.options||(c=i.options,delete i.options),c||(c={}),r.view_model=n.Inject.inject(i,r.view_model,r.el,null,null,!0),t=r.view_model.afterBinding||c.afterBinding,o=r.view_model.beforeBinding||c.beforeBinding),o&&o(r.view_model,r.el,c),n.applyBindings(r.view_model,r.el,c),t&&t(r.view_model,r.el,c);return d},e}(),l=o.applyBindings,o.applyBindings=function(e,t){var r;return r=n.RECUSIVE_AUTO_INJECT?n.injectViewModels(t):[],r.length?void 0:l.apply(this,arguments)},n.injectViewModels=n.Inject.injectViewModels,"undefined"!=typeof document&&null!==document&&(t?t(function(){return n.injectViewModels()}):(i=function(){return"complete"!==document.readyState?setTimeout(i,0):n.injectViewModels()})())}).call(t,function(){return this}())},function(e,t,r){(function(t){var n,o,i,s,a,l;a=null!=a?a:t,s=r(20),o=function(e,t){var r,n;for(r in t)n=t[r],e[r]=n;return e};var u=function(){},c=function(e,t,r){var n;return n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){e.apply(this,arguments)},o(n,e),u.prototype=e.prototype,n.prototype=new u,t&&o(n.prototype,t),r&&o(n,r),n.prototype.constructor=n,n.__super__=e.prototype,n},d=function(e,t){var r=c(this,e,t);return r.extend=this.extend,r};e.exports=i=function(){function e(){}var t;return e.VERSION="0.19.2",e.TYPE_UNKNOWN=0,e.TYPE_SIMPLE=1,e.TYPE_ARRAY=2,e.TYPE_MODEL=3,e.TYPE_COLLECTION=4,e.wasReleased=function(e){return!e||e.__kb_released},e.isReleaseable=function(t,r){var n,o;if(null==r&&(r=0),!t||t!==Object(t)||t.__kb_released)return!1;if(s.isObservable(t)||t instanceof e.ViewModel)return!0;if("function"==typeof t||t instanceof e.Model||t instanceof e.Collection)return!1;if("function"==typeof t.dispose||"function"==typeof t.destroy||"function"==typeof t.release)return!0;if(1>r)for(n in t)if(o=t[n],"__kb"!==n&&e.isReleaseable(o,r+1))return!0;return!1},e.release=function(t){var r,n,o;if(e.isReleaseable(t))if(l.isArray(t))for(n in t)o=t[n],e.isReleaseable(o)&&(t[n]=null,e.release(o));else{if(t.__kb_released=!0,s.isObservable(t)&&l.isArray(r=e.peek(t))){if(t.__kb_is_co||t.__kb_is_o&&t.valueType()===e.TYPE_COLLECTION)return t.destroy();for(n in r)o=r[n],e.isReleaseable(o)&&(r[n]=null,e.release(o));return void("function"==typeof t.dispose&&t.dispose())}"function"==typeof t.release?t.release():"function"==typeof t.destroy?t.destroy():"function"==typeof t.dispose?t.dispose():s.isObservable(t)||this.releaseKeys(t)}},e.releaseKeys=function(t){var r,n;for(r in t)n=t[r],"__kb"!==r&&e.isReleaseable(n)&&(t[r]=null,e.release(n))},e.releaseOnNodeRemove=function(t,r){return t||e._throwUnexpected(this,"missing view model"),r||e._throwUnexpected(this,"missing node"),s.utils.domNodeDisposal.addDisposeCallback(r,function(){return e.release(t)})},e.renderTemplate=function(t,r,n){var o,i,l;return null==n&&(n={}),(o=null!=a?a.document:void 0)?(i=o.createElement("div"),l=s.renderTemplate(t,r,n,i,"replaceChildren"),1===i.childNodes.length&&(i=i.childNodes[0]),e.releaseOnNodeRemove(r,i),l.dispose(),r.afterRender&&!n.afterRender&&r.afterRender(i),i):"undefined"!=typeof console&&null!==console?console.log("renderTemplate: document is undefined"):void 0},e.applyBindings=function(t,r){return s.applyBindings(t,r),e.releaseOnNodeRemove(t,r)},e.getValue=function(t,r,n){var o;if(t)return l.isFunction(t[r])&&(null!=(o=e.orm)?o.useFunction(t,r):void 0)?t[r]():n?t.get.apply(t,l.map([r].concat(n),function(t){return e.peek(t)})):t.get(r)},e.setValue=function(t,r,n){var o,i;if(t)return l.isFunction(t[r])&&(null!=(i=e.orm)?i.useFunction(t,r):void 0)?t[r](n):((o={})[r]=n,t.set(o))},e.ignore=(null!=(t=s.dependencyDetection)?t.ignore:void 0)||function(e,t,r){var n;return n=null,s.computed(function(){return n=e.apply(t,r||[])}).dispose(),n},e.extend=d,e._throwMissing=function(e,t){throw""+(l.isString(e)?e:e.constructor.name)+": "+t+" is missing"},e._throwUnexpected=function(e,t){throw""+(l.isString(e)?e:e.constructor.name)+": "+t+" is unexpected"},e.publishMethods=function(t,r,n){var o,i,s;for(i=0,s=n.length;s>i;i++)o=n[i],t[o]=e._.bind(r[o],r)},e.peek=function(t){return s.isObservable(t)?t.peek?t.peek():e.ignore(function(){return t()}):t},e}(),a.Parse?(n=i.Parse=a.Parse,l=i._=a.Parse._):(n=i.Backbone=r(21),l=i._=r(22)),i.ko=s,i.Collection=n.Collection,i.Model=n.Object||n.Model,i.Events=n.Events,i.$=a.jQuery||a.$;try{i.$||(i.$=r(23))}catch(p){}}).call(t,function(){return this}())},function(e,t,r){var n,o,i,s,a;o=(n=r(6)).ko,(null!=(s=o.subscribable)&&null!=(a=s.fn)?a.extend:void 0)&&(i=o.subscribable.fn.extend,o.subscribable.fn.extend=function(){var e,t;return e=i.apply(this,arguments),e!==this&&n.isReleaseable(this)&&(t=e.dispose,e.dispose=function(r){return function(){return null!=t&&t.apply(e,arguments),n.release(r)}}(this)),e})},function(e,t,r){var n,o,i,s,a,l,u;u=s=r(6),l=u._,a=u.ko,i=r(11),o=["value","valueType","destroy"],n=["args","read","write"],s.Observable=function(){function e(e,t,r,u){return this._vm=null!=u?u:{},s.ignore(function(u){return function(){var c,d,p,f,_,b;for(t||s._throwMissing(u,"key_or_info"),u.key=t.key||t,_=0,b=n.length;b>_;_++)p=n[_],t[p]&&(u[p]=t[p]);return c=s.utils.collapseOptions(r),d=c.event_watcher,delete c.event_watcher,u._value=new i(c),u._model=a.observable(),f=s.utils.wrappedObservable(u,a.computed({read:function(){var e,t,r,n,o,i,c;for(o=u._model(),i=t=[u.key].concat(u.args||[]),r=0,n=i.length;n>r;r++)e=i[r],a.utils.unwrapObservable(e);return null!=(c=s.utils.wrappedEventWatcher(u))&&c.emitter(o||null),u.read?u.update(u.read.apply(u._vm,t)):l.isUndefined(o)||s.ignore(function(){return u.update(s.getValue(o,s.peek(u.key),u.args))}),u._value.value()},write:function(e){return s.ignore(function(){var t,r;return t=s.utils.unwrapModels(e),r=s.peek(u._model),u.write?(u.write.call(u._vm,t),e=s.getValue(r,s.peek(u.key),u.args)):r&&s.setValue(r,s.peek(u.key),t),u.update(e)})},owner:u._vm})),f.__kb_is_o=!0,c.store=s.utils.wrappedStore(f,c.store),c.path=s.utils.pathJoin(c.path,u.key),c.factories&&("function"==typeof c.factories||c.factories.create)?(c.factory=s.utils.wrappedFactory(f,new s.Factory(c.factory)),c.factory.addPathMapping(c.path,c.factories)):c.factory=s.Factory.useOptionsOrCreate(c,f,c.path),delete c.factories,s.publishMethods(f,u,o),f.model=u.model=a.computed({read:function(){return a.utils.unwrapObservable(u._model)},write:function(e){return s.ignore(function(){var t;if(!u.__kb_released&&s.peek(u._model)!==e)return t=s.getValue(e,s.peek(u.key),u.args),u._model(e),e?l.isUndefined(t)?void 0:u.update(t):u.update(null)})}}),s.EventWatcher.useOptionsOrCreate({event_watcher:d},e||null,u,{emitter:u.model,update:function(){return s.ignore(function(){return u.update()})},key:u.key,path:c.path}),u._value.rawValue()||u._value.update(),s.LocalizedObservable&&t.localizer&&(f=new t.localizer(f)),s.DefaultObservable&&t.hasOwnProperty("default")&&(f=s.defaultObservable(f,t["default"])),f}}(this))}return e.prototype.destroy=function(){var e;return e=s.utils.wrappedObservable(this),this.__kb_released=!0,this._value.destroy(),this._value=null,this.model.dispose(),this.model=e.model=null,s.utils.wrappedDestroy(this)},e.prototype.value=function(){return this._value.rawValue()},e.prototype.valueType=function(){return this._value.valueType(s.peek(this._model),s.peek(this.key))},e.prototype.update=function(e){return this.__kb_released?void 0:(arguments.length||(e=s.getValue(s.peek(this._model),s.peek(this.key))),this._value.update(e))},e}(),s.observable=function(e,t,r,n){return new s.Observable(e,t,r,n)}},function(e,t,r){var n,o;o=(n=r(6))._,e.exports=n.Statistics=function(){function e(){this.model_events_tracker=[],this.registered_tracker={}}return e.prototype.clear=function(){return this.model_events_tracker=[]},e.prototype.addModelEvent=function(e){return this.model_events_tracker.push(e)},e.prototype.modelEventsStatsString=function(){var e,t,r,n;r="",r+="Total Count: "+this.model_events_tracker.length,e=o.groupBy(this.model_events_tracker,function(e){return"event name: '"+e.name+"', attribute name: '"+e.key+"'"});for(t in e)n=e[t],r+="\n "+t+", count: "+n.length;return r},e.prototype.register=function(e,t){return this.registeredTracker(e).push(t)},e.prototype.unregister=function(e,t){var r,n;return n=this.registeredTracker(e),r=o.indexOf(n,t),0>r&&"undefined"!=typeof console&&null!==console&&console.log("kb.Statistics: failed to unregister type: "+e),n.splice(r,1)},e.prototype.registeredCount=function(e){var t,r,n;if(e)return this.registeredTracker(e).length;t=0,n=this.registered_tracker[e];for(e in n)r=n[e],t+=r.length;return t},e.prototype.registeredStatsString=function(e){var t,r,n,o,i;t="",i=this.registered_tracker;for(r in i)n=i[r],n.length&&(o&&(t+="\n "),t+=""+(r?r:"No Name")+": "+n.length,o=!0);return t?t:e},e.prototype.registeredTracker=function(e){var t;return this.registered_tracker.hasOwnProperty(e)?this.registered_tracker[e]:(t=[],this.registered_tracker[e]=t,t)},e.eventsStats=function(e,t){var r,n,i,s,a,l,u;for(i={count:0},r=e._events||e._callbacks||{},u=t?[t]:o.keys(r),a=0,l=u.length;l>a;a++)if(t=u[a],n=r[t]){if(o.isArray(n))i[t]=o.compact(n).length;else for(i[t]=0,s=n.tail;(n=n.next)!==s;)i[t]++;i.count+=i[t]}return i},e}()},function(e,t,r){var n,o,i,s;s=n=r(6),i=s._,o=s.ko,e.exports=n.Store=function(){function e(){this.observable_records=[],this.replaced_observables=[]}return e.useOptionsOrCreate=function(e,t,r){return e.store?(e.store.register(t,r,e),n.utils.wrappedStore(r,e.store)):(n.utils.wrappedStoreIsOwned(r,!0),n.utils.wrappedStore(r,new n.Store))},e.prototype.destroy=function(){return this.clear()},e.prototype.clear=function(){var e,t,r,o,i,s,a;for(s=[this.observable_records,[]],e=s[0],this.observable_records=s[1],o=0,i=e.length;i>o;o++)t=e[o],n.release(t.observable);a=[this.replaced_observables,[]],r=a[0],this.replaced_observables=a[1],n.release(r)},e.prototype.compact=function(){var e,t,r,n,o,s;for(t=[],o=this.observable_records,r=0,n=o.length;n>r;r++)e=o[r],(null!=(s=e.observable)?s.__kb_released:void 0)&&t.push(e);t.length&&(this.observable_records=i.difference(this.observable_records,t))},e.prototype.register=function(e,t,r){var i;if(t&&!o.isObservable(t)&&!t.__kb_is_co)return n.utils.wrappedObject(t,e),e||(t.__kb_null=!0),i=r.creator?r.creator:r.path&&r.factory?r.factory.creatorForPath(e,r.path):null,i||(i=t.constructor),this.observable_records.push({obj:e,observable:t,creator:i}),t},e.prototype.findIndex=function(e,t){var r,o,s,a;if(s=[],!e||e instanceof n.Model){a=this.observable_records;for(r in a)if(o=a[r],o.observable)if(o.observable.__kb_released)s.push(o);else if((e||o.observable.__kb_null)&&(!e||!o.observable.__kb_null&&o.obj===e)&&(o.creator===t||o.creator.create&&o.creator.create===t.create))return s.length?(this.observable_records=i.difference(this.observable_records,s),i.indexOf(this.observable_records,o)):r}return s.length&&(this.observable_records=i.difference(this.observable_records,s)),-1},e.prototype.find=function(e,t){var r;return(r=this.findIndex(e,t))<0?null:this.observable_records[r].observable},e.prototype.isRegistered=function(e){var t,r,n,o;for(o=this.observable_records,r=0,n=o.length;n>r;r++)if(t=o[r],t.observable===e)return!0;return!1},e.prototype.findOrCreate=function(e,t){var r,i;return t.store=this,t.creator||(t.creator=n.utils.inferCreator(e,t.factory,t.path)),!t.creator&&e instanceof n.Model&&(t.creator=n.ViewModel),(r=t.creator)?r.models_only?e:(r&&(i=this.find(e,r)),i?i:(i=n.ignore(function(){return function(){return i=r.create?r.create(e,t):new r(e,t),i||o.observable(null)}}(this)),o.isObservable(i)||this.isRegistered(i)||this.register(e,i,t),i)):n.utils.createFromDefaultCreator(e,t)},e.prototype.findOrReplace=function(e,t,r){var o,i;return e||n._throwUnexpected(this,"obj missing"),(o=this.findIndex(e,t))<0?this.register(e,r,{creator:t}):(i=this.observable_records[o],n.utils.wrappedObject(i.observable)===e||n._throwUnexpected(this,"different object"),i.observable!==r&&(i.observable.constructor===r.constructor||n._throwUnexpected(this,"replacing different type"),this.replaced_observables.push(i.observable),i.observable=r),r)},e}()},function(e,t,r){var n,o,i,s,a;a=o=r(6),s=a._,i=a.ko,e.exports=n=function(){function e(e){this.create_options=e,this._vo=i.observable(null)}return e.prototype.destroy=function(){return this.__kb_released=!0,o.release(this.__kb_value),this.__kb_value=null},e.prototype.value=function(){return i.utils.unwrapObservable(this._vo())},e.prototype.rawValue=function(){return this.__kb_value},e.prototype.valueType=function(e,t){var r;return r=o.getValue(e,t),this.value_type||this._updateValueObservable(r),this.value_type},e.prototype.update=function(e){var t,r;if(!this.__kb_released){switch(void 0!==e||(e=null),t=o.utils.valueType(e),(!this.__kb_value||this.__kb_value.__kb_released||this.__kb_value.__kb_null&&e)&&(this.__kb_value=void 0,this.value_type=void 0),r=this.__kb_value,this.value_type){case o.TYPE_COLLECTION:if(this.value_type===o.TYPE_COLLECTION&&t===o.TYPE_ARRAY)return r(e);if((t===o.TYPE_COLLECTION||s.isNull(e))&&s.isFunction(r.collection))return void(o.peek(r.collection)!==e&&r.collection(e));break;case o.TYPE_MODEL:if(t===o.TYPE_MODEL||s.isNull(e))return void(s.isFunction(r.model)?o.peek(r.model)!==e&&r.model(e):o.utils.wrappedObject(r)!==e&&this._updateValueObservable(e))}if(this.value_type!==t||s.isUndefined(this.value_type)){if(o.peek(r)!==e)return this._updateValueObservable(e)}else if(o.peek(r)!==e)return r(e)}},e.prototype._updateValueObservable=function(e){var t,r,n,a;return t=this.create_options,r=t.creator=o.utils.inferCreator(e,t.factory,t.path),this.value_type=o.TYPE_UNKNOWN,n=this.__kb_value,this.__kb_value=void 0,n&&o.release(n),r?t.store?a=t.store.findOrCreate(e,t):r.models_only?(a=e,this.value_type=o.TYPE_SIMPLE):a=r.create?r.create(e,t):new r(e,t):s.isArray(e)?(this.value_type=o.TYPE_ARRAY,a=i.observableArray(e)):(this.value_type=o.TYPE_SIMPLE,a=i.observable(e)),this.value_type===o.TYPE_UNKNOWN&&(i.isObservable(a)?this.value_type=a.__kb_is_co?o.TYPE_COLLECTION:o.TYPE_SIMPLE:(this.value_type=o.TYPE_MODEL,"function"!=typeof a.model&&o.utils.wrappedObject(a,e))),this.__kb_value=a,this._vo(a)},e}()},function(e,t,r){var n,o,i,s,a,l,u,c,d;c=n=r(6),i=c._,o=c.ko,d=n._wrappedKey=function(e,t,r){return 2===arguments.length?e&&e.__kb&&e.__kb.hasOwnProperty(t)?e.__kb[t]:void 0:(e||n._throwUnexpected(this,"no obj for wrapping "+t),e.__kb||(e.__kb={}),e.__kb[t]=r,r)},s=function(e,t){return Array.prototype.splice.call(e,1,0,t),e},l=function(e,t,r){return e[t]||(e[t]=[]),i.isArray(r)||(r=[r]),e[t]=e[t].length?i.union(e[t],r):r,e},u=function(e,t,r){return e[t]||(e[t]={}),i.extend(e[t],r)},a=function(e){var t,r,n,o;for(r={},n=0,o=e.length;o>n;n++)t=e[n],r[t]={key:t};return r},n.utils=function(){function e(){}return e.wrappedObservable=function(){return d.apply(this,s(arguments,"observable"))},e.wrappedObject=function(){return d.apply(this,s(arguments,"object"))},e.wrappedModel=function(e,t){return 1===arguments.length?(t=d(e,"object"),i.isUndefined(t)?e:t):d(e,"object",t)},e.wrappedStore=function(){return d.apply(this,s(arguments,"store"))},e.wrappedStoreIsOwned=function(){return d.apply(this,s(arguments,"store_is_owned"))},e.wrappedFactory=function(){return d.apply(this,s(arguments,"factory"))},e.wrappedEventWatcher=function(){return d.apply(this,s(arguments,"event_watcher"))},e.wrappedEventWatcherIsOwned=function(){return d.apply(this,s(arguments,"event_watcher_is_owned"))},e.wrappedDestroy=function(e){var t;if(e.__kb)return e.__kb.event_watcher&&e.__kb.event_watcher.releaseCallbacks(e),t=e.__kb,e.__kb=null,t.observable&&(t.observable.destroy=t.observable.release=null,this.wrappedDestroy(t.observable),t.observable=null),t.factory=null,t.event_watcher_is_owned&&t.event_watcher.destroy(),t.event_watcher=null,t.store_is_owned&&t.store.destroy(),t.store=null},e.valueType=function(e){return e?e.__kb_is_o?e.valueType():e.__kb_is_co||e instanceof n.Collection?n.TYPE_COLLECTION:e instanceof n.ViewModel||e instanceof n.Model?n.TYPE_MODEL:i.isArray(e)?n.TYPE_ARRAY:n.TYPE_SIMPLE:n.TYPE_UNKNOWN},e.pathJoin=function(e,t){return(e?"."!==e[e.length-1]?""+e+".":e:"")+t},e.optionsPathJoin=function(e,t){return i.defaults({path:this.pathJoin(e.path,t)},e)},e.inferCreator=function(e,t,r){var o;return t&&(o=t.creatorForPath(e,r))?o:e?e instanceof n.Model?n.ViewModel:e instanceof n.Collection?n.CollectionObservable:null:null},e.createFromDefaultCreator=function(e,t){return e instanceof n.Model?n.viewModel(e,t):e instanceof n.Collection?n.collectionObservable(e,t):i.isArray(e)?o.observableArray(e):o.observable(e)},e.hasModelSignature=function(e){return e&&e.attributes&&!e.models&&"function"==typeof e.get&&"function"==typeof e.trigger},e.hasCollectionSignature=function(e){return e&&e.models&&"function"==typeof e.get&&"function"==typeof e.trigger},e.collapseOptions=function(e){var t,r,n,o;for(r={},e={options:e};e.options;){o=e.options;for(t in o)switch(n=o[t],t){case"internals":case"requires":case"excludes":case"statics":l(r,t,n);break;case"keys":i.isObject(n)&&!i.isArray(n)||i.isObject(r[t])&&!i.isArray(r[t])?(i.isObject(n)||(n=[n]),i.isArray(n)&&(n=a(n)),i.isArray(r[t])&&(r[t]=a(r[t])),u(r,t,n)):l(r,t,n);break;case"factories":i.isFunction(n)?r[t]=n:u(r,t,n);break;case"static_defaults":u(r,t,n);break;case"options":break;default:r[t]=n}e=e.options}return r},e.unwrapModels=function(e){var t,r,o;if(!e)return e;if(e.__kb)return"object"in e.__kb?e.__kb.object:e;if(i.isArray(e))return i.map(e,function(e){return n.utils.unwrapModels(e)});if(i.isObject(e)&&e.constructor==={}.constructor){r={};for(t in e)o=e[t],r[t]=n.utils.unwrapModels(o);return r}return e},e}()},function(e,t,r){var n,o,i,s,a,l,u,c,d;d=l=r(6),c=d._,u=d.ko,s=function(){return function(e){return{store:l.utils.wrappedStore(e),factory:l.utils.wrappedFactory(e),path:e.__kb.path,event_watcher:l.utils.wrappedEventWatcher(e)}}}(this),o=function(e,t){var r;return r=e.__kb.internals&&c.contains(e.__kb.internals,t)?"_"+t:t,e.__kb.view_model.hasOwnProperty(r)?void 0:(e.__kb.view_model[r]=null,r)
+},i=function(e,t,r,n){var i;if(!(e.__kb.excludes&&c.contains(e.__kb.excludes,r)||e.__kb.statics&&c.contains(e.__kb.statics,r)||!(i=o(e,r))))return e[i]=e.__kb.view_model[i]=l.observable(t,r,n,e)},a=function(e,t){var r,n,i,s,a;for(a=e.__kb.statics,i=0,s=a.length;s>i;i++)r=a[i],(n=o(e,r))&&(t.has(n)?e[n]=e.__kb.view_model[n]=t.get(n):e.__kb.static_defaults&&n in e.__kb.static_defaults?e[n]=e.__kb.view_model[n]=e.__kb.static_defaults[n]:delete e.__kb.view_model[n])},n=["keys","internals","excludes","statics","static_defaults"],l.ViewModel=function(){function e(e,t,r){return null==t&&(t={}),l.ignore(function(o){return function(){var i,d,p,f,_,b;for(!e||e instanceof l.Model||"function"==typeof e.get&&"function"==typeof e.bind||l._throwUnexpected(o,"not a model"),t=c.isArray(t)?{keys:t}:l.utils.collapseOptions(t),o.__kb||(o.__kb={}),o.__kb.view_model=r||o,f=0,_=n.length;_>f;f++)p=n[f],t.hasOwnProperty(p)&&(o.__kb[p]=t[p]);return l.Store.useOptionsOrCreate(t,e,o),o.__kb.path=t.path,l.Factory.useOptionsOrCreate(t,o,t.path),b=l._wrappedKey(o,"_model",u.observable()),o.model=u.computed({read:function(){return u.utils.unwrapObservable(b)},write:function(e){return l.ignore(function(){return l.utils.wrappedObject(o)!==e&&!l.wasReleased(o)&&d?o.__kb_null?void(!e||l._throwUnexpected(o,"model set on shared null")):(d.emitter(e),l.utils.wrappedObject(o,d.ee),b(d.ee),!d.ee||o.createObservables(d.ee)):void 0})}}),d=l.utils.wrappedEventWatcher(o,new l.EventWatcher(e,o,{emitter:o._model,update:function(){return l.ignore(function(){return!(null!=d?d.ee:void 0)||o.createObservables(null!=d?d.ee:void 0)})}})),l.utils.wrappedObject(o,e=d.ee),b(d.ee),i=s(o),!t.requires||o.createObservables(e,t.requires,i),!o.__kb.internals||o.createObservables(e,o.__kb.internals,i),!t.mappings||o.createObservables(e,t.mappings,i),!o.__kb.statics||a(o,e),o.createObservables(e,o.__kb.keys,i),!l.statistics||l.statistics.register("ViewModel",o),o}}(this))}return e.extend=l.extend,e.prototype.destroy=function(){var e;if(this.__kb_released=!0,this.__kb.view_model!==this)for(e in this.__kb.vm_keys)this.__kb.view_model[e]=null;return this.__kb.view_model=null,l.releaseKeys(this),l.utils.wrappedDestroy(this),!l.statistics||l.statistics.unregister("ViewModel",this)},e.prototype.shareOptions=function(){return{store:l.utils.wrappedStore(this),factory:l.utils.wrappedFactory(this)}},e.prototype.createObservables=function(e,t,r){var n,a,u,d,p,f,_,b,h;if(r||(r=s(this)),t)if(c.isArray(t))for(f=0,b=t.length;b>f;f++)n=t[f],i(this,e,n,r);else for(n in t)a=t[n],(d=o(this,n))&&(c.isString(a)||a.key||(a.key=d),this[d]=this.__kb.view_model[d]=l.observable(e,a,r,this));else{if(this.__kb.keys||!e)return;for(n in e.attributes)i(this,e,n,r);if(u=null!=(h=l.orm)&&"function"==typeof h.keys?h.keys(e):void 0)for(p=0,_=u.length;_>p;p++)n=u[p],i(this,e,n,r)}},e}(),l.viewModel=function(e,t,r){return new l.ViewModel(e,t,r)}},function(e,t,r){var n,o,i,s,a;if(e.exports=n=r(6),n.configure=r(2),n.modules={underscore:n._,backbone:n.Parse||n.Backbone,knockout:n.ko},"undefined"!=typeof window&&null!==window)for(a=["_","Backbone","Parse","ko","$"],i=0,s=a.length;s>i;i++)o=a[i],n[o]&&!window.hasOwnProperty(o)&&(window[o]=n[o])},function(e,t,r){var n,o,i,s,a;a=o=r(6),s=a._,i=a.ko,r(24),n=["destroy","setToDefault"],e.exports=o.DefaultObservable=function(){function e(e,t){var r;return this.dv=t,r=o.utils.wrappedObservable(this,i.computed({read:function(t){return function(){var r;return r=i.utils.unwrapObservable(e()),s.isNull(r)||s.isUndefined(r)?i.utils.unwrapObservable(t.dv):r}}(this),write:function(t){return e(t)}})),o.publishMethods(r,this,n),r}return e.prototype.destroy=function(){return o.utils.wrappedDestroy(this)},e.prototype.setToDefault=function(){return o.utils.wrappedObservable(this)(this.dv)},e}(),o.defaultObservable=function(e,t){return new o.DefaultObservable(e,t)}},function(e,t,r){var n,o,i,s,a;a=o=r(6),s=a._,i=a.ko,n=Array.prototype.slice,o.toFormattedString=function(e){var t,r,o,a,l,u;l=e.slice(),r=n.call(arguments,1);for(o in r)for(t=r[o],u=i.utils.unwrapObservable(t),(s.isUndefined(u)||s.isNull(u))&&(u=""),a=e.indexOf("{"+o+"}");a>=0;)l=l.replace("{"+o+"}",u),a=e.indexOf("{"+o+"}",a+1);return l},o.parseFormattedString=function(e,t){var r,n,o,i,a,l,u,c,d,p,f,_,b;for(p=t.slice(),o=0,l=0,c={};p.search("\\{"+o+"\\}")>=0;){for(u=t.indexOf("{"+o+"}");u>=0;)p=p.replace("{"+o+"}","(.*)"),c[u]=o,l++,u=t.indexOf("{"+o+"}",u+1);o++}if(r=o,d=new RegExp(p),a=d.exec(e),a&&a.shift(),!a||a.length!==l){for(f=[];r-->0;)f.push("");return f}b=s.sortBy(s.keys(c),function(e){return parseInt(e,10)}),n={};for(i in b)u=b[i],o=c[u],n.hasOwnProperty(o)||(n[o]=i);for(_=[],o=0;r>o;)_.push(a[n[o]]),o++;return _},e.exports=o.FormattedObservable=function(){function e(e,t){var r,a;return s.isArray(t)?(e=e,a=t):a=n.call(arguments,1),r=o.utils.wrappedObservable(this,i.computed({read:function(){var r,n,s;for(t=[i.utils.unwrapObservable(e)],n=0,s=a.length;s>n;n++)r=a[n],t.push(i.utils.unwrapObservable(r));return o.toFormattedString.apply(null,t)},write:function(t){var r,n,s;for(n=o.parseFormattedString(t,i.utils.unwrapObservable(e)),s=Math.min(a.length,n.length),r=0;s>r;)a[r](n[r]),r++}}))}return e.prototype.destroy=function(){return o.utils.wrappedDestroy(this)},e}(),o.formattedObservable=function(e){return new o.FormattedObservable(e,n.call(arguments,1))}},function(e,t,r){var n,o,i,s,a;a=o=r(6),s=a._,i=a.ko,n=["destroy","observedValue","resetToCurrent"],o.locale_manager||(o.locale_manager=void 0),e.exports=o.LocalizedObservable=function(){function e(e,t,r){var a;return this.value=e,this.vm=r,t||(t={}),this.vm||(this.vm={}),this.read||o._throwMissing(this,"read"),o.locale_manager||o._throwMissing(this,"kb.locale_manager"),this.__kb||(this.__kb={}),this.__kb._onLocaleChange=s.bind(this._onLocaleChange,this),this.__kb._onChange=t.onChange,this.value&&(e=i.utils.unwrapObservable(this.value)),this.vo=i.observable(e?this.read(e,null):null),a=o.utils.wrappedObservable(this,i.computed({read:function(e){return function(){return e.value&&i.utils.unwrapObservable(e.value),e.vo(),e.read(i.utils.unwrapObservable(e.value))}}(this),write:function(e){return function(t){return e.write||o._throwUnexpected(e,"writing to read-only"),e.write(t,i.utils.unwrapObservable(e.value)),e.vo(t),e.__kb._onChange?e.__kb._onChange(t):void 0}}(this),owner:this.vm})),o.publishMethods(a,this,n),o.locale_manager.bind("change",this.__kb._onLocaleChange),t.hasOwnProperty("default")&&(a=o.DefaultObservable&&i.defaultObservable(a,t["default"])),a}return e.extend=o.extend,e.prototype.destroy=function(){return o.locale_manager.unbind("change",this.__kb._onLocaleChange),this.vm=null,o.utils.wrappedDestroy(this)},e.prototype.resetToCurrent=function(){var e,t;return t=o.utils.wrappedObservable(this),e=this.value?this.read(i.utils.unwrapObservable(this.value)):null,t()!==e?t(e):void 0},e.prototype.observedValue=function(e){return 0===arguments.length?this.value:(this.value=e,void this._onLocaleChange())},e.prototype._onLocaleChange=function(){var e;return e=this.read(i.utils.unwrapObservable(this.value)),this.vo(e),this.__kb._onChange?this.__kb._onChange(e):void 0},e}(),o.localizedObservable=function(e,t,r){return new o.LocalizedObservable(e,t,r)}},function(e,t,r){var n,o,i,s,a;a=o=r(6),s=a._,i=a.ko,n=["destroy"],e.exports=o.TriggeredObservable=function(){function e(e,t){var r;return this.event_selector=t,e||o._throwMissing(this,"emitter"),this.event_selector||o._throwMissing(this,"event_selector"),this.vo=i.observable(),r=o.utils.wrappedObservable(this,i.computed(function(e){return function(){return e.vo()}}(this))),o.publishMethods(r,this,n),o.utils.wrappedEventWatcher(this,new o.EventWatcher(e,this,{emitter:s.bind(this.emitter,this),update:s.bind(this.update,this),event_selector:this.event_selector})),r}return e.prototype.destroy=function(){return o.utils.wrappedDestroy(this)},e.prototype.emitter=function(e){return 0===arguments.length||this.ee===e?this.ee:(this.ee=e)?this.update():void 0},e.prototype.update=function(){return this.ee?this.vo()!==this.ee?this.vo(this.ee):this.vo.valueHasMutated():void 0},e}(),o.triggeredObservable=function(e,t){return new o.TriggeredObservable(e,t)}},function(e,t,r){var n,o,i,s,a,l;l=i=r(6),a=l._,s=l.ko,n=l.$,r(25),o=function(e){return e=s.utils.unwrapObservable(e),"function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):e},e.exports=i.Validation=function(){function e(){}return e}(),i.valueValidator=function(e,t,r){return null==r&&(r={}),r&&!("function"==typeof r)||(r={}),s.computed(function(){var n,i,l,u,c,d,p,f;p={$error_count:0},i=s.utils.unwrapObservable(e),!("disable"in r)||(l=o(r.disable)),!("enable"in r)||(l=!o(r.enable)),d=r.priorities||[],a.isArray(d)||(d=[d]),n=d.length+1;for(u in t)f=t[u],p[u]=!l&&o(f,i),p[u]&&(p.$error_count++,(c=a.indexOf(d,u)>=0)||(c=d.length),p.$active_error&&n>c?(p.$active_error=u,n=c):p.$active_error||(p.$active_error=u,n=c));return p.$enabled=!l,p.$disable=!!l,p.$valid=0===p.$error_count,p})},i.inputValidator=function(e,t,r){var o,s,l,u,c,d,p,f,_,b;if(null==r&&(r={}),r&&!("function"==typeof r)||(r={}),_=i.valid,o=n(t),(u=o.attr("name"))&&!a.isString(u)&&(u=null),!(s=o.attr("data-bind")))return null;if(c=new Function("sc","with(sc[0]) { return { "+s+" } }")([e]),!c||!c.value)return null;if(!c.validation_options||(a.defaults(c.validation_options,r),r=c.validation_options),s={},!_[p=o.attr("type")]||(s[p]=_[p]),!o.attr("required")||(s.required=_.required),c.validations){b=c.validations;for(l in b)f=b[l],s[l]=f}return d=i.valueValidator(c.value,s,r),!u&&!r.no_attach||(e["$"+u]=d),d},i.formValidator=function(e,t){var r,o,l,u,c,d,p,f,_,b,h,v,y;for(p={},b=[],r=n(t),(l=r.attr("name"))&&!a.isString(l)&&(l=null),(o=r.attr("data-bind"))&&(d=new Function("sc","with(sc[0]) { return { "+o+" } }")([e]),f=d.validation_options),f||(f={}),f.no_attach=!!l,y=r.find("input"),h=0,v=y.length;v>h;h++)u=y[h],(c=n(u).attr("name"))&&(_=i.inputValidator(e,u,f),!_||b.push(p[c]=_));return p.$error_count=s.computed(function(){var e,t,r;for(e=0,t=0,r=b.length;r>t;t++)_=b[t],e+=_().$error_count;return e}),p.$valid=s.computed(function(){return 0===p.$error_count()}),p.$enabled=s.computed(function(){var e,t,r;for(e=!0,t=0,r=b.length;r>t;t++)_=b[t],e&=_().$enabled;return e}),p.$disabled=s.computed(function(){return!p.$enabled()}),l&&(e["$"+l]=p),p}},function(t){t.exports=e},function(e){e.exports=t},function(e){e.exports=r},function(e){if("undefined"==typeof n){var t=new Error('Cannot find module "undefined"');throw t.code="MODULE_NOT_FOUND",t}e.exports=n},function(e,t,r){var n,o,i,s;s=n=r(6),i=s._,o=s.ko,n.Observable.prototype.setToDefault=function(){var e;null!=(e=this.__kb_value)&&"function"==typeof e.setToDefault&&e.setToDefault()},n.ViewModel.prototype.setToDefault=function(){var e,t;for(e in this.__kb.vm_keys)null!=(t=this[e])&&"function"==typeof t.setToDefault&&t.setToDefault()},n.utils.setToDefault=function(e){var t,r;if(e){if(o.isObservable(e))"function"==typeof e.setToDefault&&e.setToDefault();else if(i.isObject(e))for(t in e)r=e[t],!r||!o.isObservable(r)&&"function"==typeof r||"_"===t[0]&&!t.search("__kb")||this.setToDefault(r);return e}}},function(e,t,r){var n,o,i,s,a,l,u,c;c=a=r(6),u=c._,l=c.ko,n=c.$,s=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,o=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,i=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,a.valid={required:function(e){return!e},url:function(e){return!s.test(e)},email:function(e){return!o.test(e)},number:function(e){return!i.test(e)}},a.hasChangedFn=function(e){var t,r;return r=null,t=null,function(){var n;return r!==(n=l.utils.unwrapObservable(e))?(r=n,t=r?r.toJSON():null,!1):r&&t?!u.isEqual(r.toJSON(),t):!1}},a.minLengthFn=function(e){return function(t){return!t||t.length<e}},a.uniqueValueFn=function(e,t,r){return function(n){var o,i,s;return s=l.utils.unwrapObservable(e),i=l.utils.unwrapObservable(t),o=l.utils.unwrapObservable(r),s&&i&&o?!!u.find(o.models,function(){return function(e){return e!==s&&e.get(i)===n}}(this)):!1}},a.untilTrueFn=function(e,t,r){var n;return n=!1,r&&l.isObservable(r)&&r.subscribe(function(){return n=!1}),function(r){var o,i;return(o=l.utils.unwrapObservable(t))?(n|=!!(i=o(l.utils.unwrapObservable(r))),n?i:l.utils.unwrapObservable(e)):l.utils.unwrapObservable(e)}},a.untilFalseFn=function(e,t,r){var n;return n=!1,r&&l.isObservable(r)&&r.subscribe(function(){return n=!1}),function(r){var o,i;return(o=l.utils.unwrapObservable(t))?(n|=!(i=o(l.utils.unwrapObservable(r))),n?i:l.utils.unwrapObservable(e)):l.utils.unwrapObservable(e)}}},function(e,t,r){var n,o,i,s,a,l;l=s=r(6),a=l._,o=l.Backbone,n=null,e.exports=i=function(){function e(){}return e.isAvailable=function(){return!!(n=null!=o?o.AssociatedModel:void 0)},e.keys=function(e){return e instanceof n?a.map(e.relations,function(e){return e.key}):null},e.relationType=function(e,t){var r;return e instanceof n&&(r=a.find(e.relations,function(e){return e.key===t}))?"Many"===r.type?s.TYPE_COLLECTION:s.TYPE_MODEL:null},e}()},function(e,t,r){var n,o,i,s,a,l;l=s=r(6),a=l._,n=l.Backbone,i=null,e.exports=o=function(){function e(){}return e.isAvailable=function(){return!!(i=null!=n?n.RelationalModel:void 0)},e.relationType=function(e,t){var r;return e instanceof i&&(r=a.find(e.getRelations(),function(e){return e.key===t}))?r.collectionType||a.isArray(r.keyContents)?s.TYPE_COLLECTION:s.TYPE_MODEL:null},e.bind=function(e,t,r,n){var o,i,a,l,u,c;if(!(l=this.relationType(e,t)))return null;if(a=function(e){return!s.statistics||s.statistics.addModelEvent({name:"update (relational)",model:e,key:t,path:n}),r()},i=s.Backbone.Relation.prototype.sanitizeOptions?["update","add","remove"]:["change","add","remove"],l===s.TYPE_COLLECTION)for(u=0,c=i.length;c>u;u++)o=i[u],e.bind(""+o+":"+t,a);else e.bind(""+i[0]+":"+t,a);return function(){var r,n;if(l===s.TYPE_COLLECTION)for(r=0,n=i.length;n>r;r++)o=i[r],e.unbind(""+o+":"+t,a);else e.unbind(""+i[0]+":"+t,a)}},e}()},function(e,t,r){(function(t){var n,o,i,s;i="undefined"!=typeof window&&null!==window?window:t,s=(o=r(6))._,n=null,e.exports=n=function(){function e(){}return e.isAvailable=function(){return!!(e=i.Supermodel)},e.keys=function(t){return t instanceof e.Model?s.keys(t.constructor.associations()):null},e.relationType=function(t,r){var n;return t instanceof e.Model&&(n=t.constructor.associations()[r])?n.add?o.TYPE_COLLECTION:o.TYPE_MODEL:null},e.bind=function(e,t,r,n){var i,s;return(s=this.relationType(e,t))?(i=function(e,i){var s,a;return!o.statistics||o.statistics.addModelEvent({name:"update (supermodel)",model:e,key:t,path:n}),a=e.constructor.associations()[t],s=e[a.store],e[a.store]=i,r(i),e[a.store]=s},s===o.TYPE_MODEL?(e.bind("associate:"+t,i),function(){return e.unbind("associate:"+t,i)}):void 0):null},e.useFunction=function(e,t){return!!this.relationType(e,t)},e}()}).call(t,function(){return this}())}])});
\ No newline at end of file
diff --git a/contrail-webui/server-manager/requirejs-1.0.2.tar.gz b/contrail-webui/server-manager/requirejs-1.0.2.tar.gz
new file mode 100644
index 0000000..e13e5ed
--- /dev/null
+++ b/contrail-webui/server-manager/requirejs-1.0.2.tar.gz
Binary files differ
diff --git a/contrail-webui/server-manager/text.js b/contrail-webui/server-manager/text.js
new file mode 100644
index 0000000..49e242c
--- /dev/null
+++ b/contrail-webui/server-manager/text.js
@@ -0,0 +1,390 @@
+/**
+ * @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/requirejs/text for details
+ */
+/*jslint regexp: true */
+/*global require, XMLHttpRequest, ActiveXObject,
+ define, window, process, Packages,
+ java, location, Components, FileUtils */
+
+define(['module'], function (module) {
+ 'use strict';
+
+ var text, fs, Cc, Ci, xpcIsWindows,
+ progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
+ xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
+ bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
+ hasLocation = typeof location !== 'undefined' && location.href,
+ defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
+ defaultHostName = hasLocation && location.hostname,
+ defaultPort = hasLocation && (location.port || undefined),
+ buildMap = {},
+ masterConfig = (module.config && module.config()) || {};
+
+ text = {
+ version: '2.0.12',
+
+ strip: function (content) {
+ //Strips <?xml ...?> declarations so that external SVG and XML
+ //documents can be added to a document without worry. Also, if the string
+ //is an HTML document, only the part inside the body tag is returned.
+ if (content) {
+ content = content.replace(xmlRegExp, "");
+ var matches = content.match(bodyRegExp);
+ if (matches) {
+ content = matches[1];
+ }
+ } else {
+ content = "";
+ }
+ return content;
+ },
+
+ jsEscape: function (content) {
+ return content.replace(/(['\\])/g, '\\$1')
+ .replace(/[\f]/g, "\\f")
+ .replace(/[\b]/g, "\\b")
+ .replace(/[\n]/g, "\\n")
+ .replace(/[\t]/g, "\\t")
+ .replace(/[\r]/g, "\\r")
+ .replace(/[\u2028]/g, "\\u2028")
+ .replace(/[\u2029]/g, "\\u2029");
+ },
+
+ createXhr: masterConfig.createXhr || function () {
+ //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
+ var xhr, i, progId;
+ if (typeof XMLHttpRequest !== "undefined") {
+ return new XMLHttpRequest();
+ } else if (typeof ActiveXObject !== "undefined") {
+ for (i = 0; i < 3; i += 1) {
+ progId = progIds[i];
+ try {
+ xhr = new ActiveXObject(progId);
+ } catch (e) {}
+
+ if (xhr) {
+ progIds = [progId]; // so faster next time
+ break;
+ }
+ }
+ }
+
+ return xhr;
+ },
+
+ /**
+ * Parses a resource name into its component parts. Resource names
+ * look like: module/name.ext!strip, where the !strip part is
+ * optional.
+ * @param {String} name the resource name
+ * @returns {Object} with properties "moduleName", "ext" and "strip"
+ * where strip is a boolean.
+ */
+ parseName: function (name) {
+ var modName, ext, temp,
+ strip = false,
+ index = name.indexOf("."),
+ isRelative = name.indexOf('./') === 0 ||
+ name.indexOf('../') === 0;
+
+ if (index !== -1 && (!isRelative || index > 1)) {
+ modName = name.substring(0, index);
+ ext = name.substring(index + 1, name.length);
+ } else {
+ modName = name;
+ }
+
+ temp = ext || modName;
+ index = temp.indexOf("!");
+ if (index !== -1) {
+ //Pull off the strip arg.
+ strip = temp.substring(index + 1) === "strip";
+ temp = temp.substring(0, index);
+ if (ext) {
+ ext = temp;
+ } else {
+ modName = temp;
+ }
+ }
+
+ return {
+ moduleName: modName,
+ ext: ext,
+ strip: strip
+ };
+ },
+
+ xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
+
+ /**
+ * Is an URL on another domain. Only works for browser use, returns
+ * false in non-browser environments. Only used to know if an
+ * optimized .js version of a text resource should be loaded
+ * instead.
+ * @param {String} url
+ * @returns Boolean
+ */
+ useXhr: function (url, protocol, hostname, port) {
+ var uProtocol, uHostName, uPort,
+ match = text.xdRegExp.exec(url);
+ if (!match) {
+ return true;
+ }
+ uProtocol = match[2];
+ uHostName = match[3];
+
+ uHostName = uHostName.split(':');
+ uPort = uHostName[1];
+ uHostName = uHostName[0];
+
+ return (!uProtocol || uProtocol === protocol) &&
+ (!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
+ ((!uPort && !uHostName) || uPort === port);
+ },
+
+ finishLoad: function (name, strip, content, onLoad) {
+ content = strip ? text.strip(content) : content;
+ if (masterConfig.isBuild) {
+ buildMap[name] = content;
+ }
+ onLoad(content);
+ },
+
+ load: function (name, req, onLoad, config) {
+ //Name has format: some.module.filext!strip
+ //The strip part is optional.
+ //if strip is present, then that means only get the string contents
+ //inside a body tag in an HTML string. For XML/SVG content it means
+ //removing the <?xml ...?> declarations so the content can be inserted
+ //into the current doc without problems.
+
+ // Do not bother with the work if a build and text will
+ // not be inlined.
+ if (config && config.isBuild && !config.inlineText) {
+ onLoad();
+ return;
+ }
+
+ masterConfig.isBuild = config && config.isBuild;
+
+ var parsed = text.parseName(name),
+ nonStripName = parsed.moduleName +
+ (parsed.ext ? '.' + parsed.ext : ''),
+ url = req.toUrl(nonStripName),
+ useXhr = (masterConfig.useXhr) ||
+ text.useXhr;
+
+ // Do not load if it is an empty: url
+ if (url.indexOf('empty:') === 0) {
+ onLoad();
+ return;
+ }
+
+ //Load the text. Use XHR if possible and in a browser.
+ if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
+ text.get(url, function (content) {
+ text.finishLoad(name, parsed.strip, content, onLoad);
+ }, function (err) {
+ if (onLoad.error) {
+ onLoad.error(err);
+ }
+ });
+ } else {
+ //Need to fetch the resource across domains. Assume
+ //the resource has been optimized into a JS module. Fetch
+ //by the module name + extension, but do not include the
+ //!strip part to avoid file system issues.
+ req([nonStripName], function (content) {
+ text.finishLoad(parsed.moduleName + '.' + parsed.ext,
+ parsed.strip, content, onLoad);
+ });
+ }
+ },
+
+ write: function (pluginName, moduleName, write, config) {
+ if (buildMap.hasOwnProperty(moduleName)) {
+ var content = text.jsEscape(buildMap[moduleName]);
+ write.asModule(pluginName + "!" + moduleName,
+ "define(function () { return '" +
+ content +
+ "';});\n");
+ }
+ },
+
+ writeFile: function (pluginName, moduleName, req, write, config) {
+ var parsed = text.parseName(moduleName),
+ extPart = parsed.ext ? '.' + parsed.ext : '',
+ nonStripName = parsed.moduleName + extPart,
+ //Use a '.js' file name so that it indicates it is a
+ //script that can be loaded across domains.
+ fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
+
+ //Leverage own load() method to load plugin value, but only
+ //write out values that do not have the strip argument,
+ //to avoid any potential issues with ! in file names.
+ text.load(nonStripName, req, function (value) {
+ //Use own write() method to construct full module value.
+ //But need to create shell that translates writeFile's
+ //write() to the right interface.
+ var textWrite = function (contents) {
+ return write(fileName, contents);
+ };
+ textWrite.asModule = function (moduleName, contents) {
+ return write.asModule(moduleName, fileName, contents);
+ };
+
+ text.write(pluginName, nonStripName, textWrite, config);
+ }, config);
+ }
+ };
+
+ if (masterConfig.env === 'node' || (!masterConfig.env &&
+ typeof process !== "undefined" &&
+ process.versions &&
+ !!process.versions.node &&
+ !process.versions['node-webkit'])) {
+ //Using special require.nodeRequire, something added by r.js.
+ fs = require.nodeRequire('fs');
+
+ text.get = function (url, callback, errback) {
+ try {
+ var file = fs.readFileSync(url, 'utf8');
+ //Remove BOM (Byte Mark Order) from utf8 files if it is there.
+ if (file.indexOf('\uFEFF') === 0) {
+ file = file.substring(1);
+ }
+ callback(file);
+ } catch (e) {
+ if (errback) {
+ errback(e);
+ }
+ }
+ };
+ } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
+ text.createXhr())) {
+ text.get = function (url, callback, errback, headers) {
+ var xhr = text.createXhr(), header;
+ xhr.open('GET', url, true);
+
+ //Allow plugins direct access to xhr headers
+ if (headers) {
+ for (header in headers) {
+ if (headers.hasOwnProperty(header)) {
+ xhr.setRequestHeader(header.toLowerCase(), headers[header]);
+ }
+ }
+ }
+
+ //Allow overrides specified in config
+ if (masterConfig.onXhr) {
+ masterConfig.onXhr(xhr, url);
+ }
+
+ xhr.onreadystatechange = function (evt) {
+ var status, err;
+ //Do not explicitly handle errors, those should be
+ //visible via console output in the browser.
+ if (xhr.readyState === 4) {
+ status = xhr.status || 0;
+ if (status > 399 && status < 600) {
+ //An http 4xx or 5xx error. Signal an error.
+ err = new Error(url + ' HTTP status: ' + status);
+ err.xhr = xhr;
+ if (errback) {
+ errback(err);
+ }
+ } else {
+ callback(xhr.responseText);
+ }
+
+ if (masterConfig.onXhrComplete) {
+ masterConfig.onXhrComplete(xhr, url);
+ }
+ }
+ };
+ xhr.send(null);
+ };
+ } else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
+ typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
+ //Why Java, why is this so awkward?
+ text.get = function (url, callback) {
+ var stringBuffer, line,
+ encoding = "utf-8",
+ file = new java.io.File(url),
+ lineSeparator = java.lang.System.getProperty("line.separator"),
+ input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
+ content = '';
+ try {
+ stringBuffer = new java.lang.StringBuffer();
+ line = input.readLine();
+
+ // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
+ // http://www.unicode.org/faq/utf_bom.html
+
+ // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
+ // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
+ if (line && line.length() && line.charAt(0) === 0xfeff) {
+ // Eat the BOM, since we've already found the encoding on this file,
+ // and we plan to concatenating this buffer with others; the BOM should
+ // only appear at the top of a file.
+ line = line.substring(1);
+ }
+
+ if (line !== null) {
+ stringBuffer.append(line);
+ }
+
+ while ((line = input.readLine()) !== null) {
+ stringBuffer.append(lineSeparator);
+ stringBuffer.append(line);
+ }
+ //Make sure we return a JavaScript string and not a Java string.
+ content = String(stringBuffer.toString()); //String
+ } finally {
+ input.close();
+ }
+ callback(content);
+ };
+ } else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
+ typeof Components !== 'undefined' && Components.classes &&
+ Components.interfaces)) {
+ //Avert your gaze!
+ Cc = Components.classes;
+ Ci = Components.interfaces;
+ Components.utils['import']('resource://gre/modules/FileUtils.jsm');
+ xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
+
+ text.get = function (url, callback) {
+ var inStream, convertStream, fileObj,
+ readData = {};
+
+ if (xpcIsWindows) {
+ url = url.replace(/\//g, '\\');
+ }
+
+ fileObj = new FileUtils.File(url);
+
+ //XPCOM, you so crazy
+ try {
+ inStream = Cc['@mozilla.org/network/file-input-stream;1']
+ .createInstance(Ci.nsIFileInputStream);
+ inStream.init(fileObj, 1, 0, false);
+
+ convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
+ .createInstance(Ci.nsIConverterInputStream);
+ convertStream.init(inStream, "utf-8", inStream.available(),
+ Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
+
+ convertStream.readString(inStream.available(), readData);
+ convertStream.close();
+ inStream.close();
+ callback(readData.value);
+ } catch (e) {
+ throw new Error((fileObj && fileObj.path || '') + ': ' + e);
+ }
+ };
+ }
+ return text;
+});
\ No newline at end of file
diff --git a/contrail-webui/server-manager/underscore-min.js b/contrail-webui/server-manager/underscore-min.js
new file mode 100644
index 0000000..3434d6c
--- /dev/null
+++ b/contrail-webui/server-manager/underscore-min.js
@@ -0,0 +1,6 @@
+// Underscore.js 1.6.0
+// http://underscorejs.org
+// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+// Underscore may be freely distributed under the MIT license.
+(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).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 F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:j.now(),a=null,i=n.apply(e,u),e=u=null};return function(){var l=j.now();o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=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 j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(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;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this);
+//# sourceMappingURL=underscore-min.map
\ No newline at end of file
diff --git a/contrail-webui/server-manager/underscore-min.map b/contrail-webui/server-manager/underscore-min.map
new file mode 100644
index 0000000..47c69ba
--- /dev/null
+++ b/contrail-webui/server-manager/underscore-min.map
@@ -0,0 +1 @@
+{"version":3,"file":"underscore-min.js","sources":["underscore.js"],"names":["root","this","previousUnderscore","_","breaker","ArrayProto","Array","prototype","ObjProto","Object","FuncProto","Function","push","slice","concat","toString","hasOwnProperty","nativeForEach","forEach","nativeMap","map","nativeReduce","reduce","nativeReduceRight","reduceRight","nativeFilter","filter","nativeEvery","every","nativeSome","some","nativeIndexOf","indexOf","nativeLastIndexOf","lastIndexOf","nativeIsArray","isArray","nativeKeys","keys","nativeBind","bind","obj","_wrapped","exports","module","VERSION","each","iterator","context","length","i","call","collect","results","value","index","list","reduceError","foldl","inject","memo","initial","arguments","TypeError","foldr","find","detect","predicate","result","any","select","reject","all","identity","contains","include","target","invoke","method","args","isFunc","isFunction","apply","pluck","key","property","where","attrs","matches","findWhere","max","Math","Infinity","lastComputed","computed","min","shuffle","rand","shuffled","random","sample","n","guard","values","lookupIterator","sortBy","criteria","sort","left","right","a","b","group","behavior","groupBy","has","indexBy","countBy","sortedIndex","array","low","high","mid","toArray","size","first","head","take","last","rest","tail","drop","compact","flatten","input","shallow","output","isArguments","without","difference","partition","pass","fail","elem","uniq","unique","isSorted","seen","union","intersection","item","other","zip","object","from","hasIndex","range","start","stop","step","ceil","idx","ctor","func","bound","self","partial","boundArgs","position","bindAll","funcs","Error","f","memoize","hasher","delay","wait","setTimeout","defer","throttle","options","timeout","previous","later","leading","now","remaining","clearTimeout","trailing","debounce","immediate","timestamp","callNow","once","ran","wrap","wrapper","compose","after","times","isObject","pairs","invert","functions","methods","names","extend","source","prop","pick","copy","omit","defaults","clone","tap","interceptor","eq","aStack","bStack","className","String","global","multiline","ignoreCase","aCtor","constructor","bCtor","pop","isEqual","isEmpty","isString","isElement","nodeType","name","isFinite","isNaN","parseFloat","isNumber","isBoolean","isNull","isUndefined","noConflict","constant","accum","floor","Date","getTime","entityMap","escape","&","<",">","\"","'","unescape","entityRegexes","RegExp","join","string","replace","match","mixin","idCounter","uniqueId","prefix","id","templateSettings","evaluate","interpolate","noMatch","escapes","\\","\r","\n","\t","
","
","escaper","template","text","data","settings","render","matcher","offset","variable","e","chain","_chain","define","amd"],"mappings":";;;;CAKA,WAME,GAAIA,GAAOC,KAGPC,EAAqBF,EAAKG,EAG1BC,KAGAC,EAAaC,MAAMC,UAAWC,EAAWC,OAAOF,UAAWG,EAAYC,SAASJ,UAIlFK,EAAmBP,EAAWO,KAC9BC,EAAmBR,EAAWQ,MAC9BC,EAAmBT,EAAWS,OAC9BC,EAAmBP,EAASO,SAC5BC,EAAmBR,EAASQ,eAK5BC,EAAqBZ,EAAWa,QAChCC,EAAqBd,EAAWe,IAChCC,EAAqBhB,EAAWiB,OAChCC,EAAqBlB,EAAWmB,YAChCC,EAAqBpB,EAAWqB,OAChCC,EAAqBtB,EAAWuB,MAChCC,EAAqBxB,EAAWyB,KAChCC,EAAqB1B,EAAW2B,QAChCC,EAAqB5B,EAAW6B,YAChCC,EAAqB7B,MAAM8B,QAC3BC,EAAqB5B,OAAO6B,KAC5BC,EAAqB7B,EAAU8B,KAG7BrC,EAAI,SAASsC,GACf,MAAIA,aAAetC,GAAUsC,EACvBxC,eAAgBE,QACtBF,KAAKyC,SAAWD,GADiB,GAAItC,GAAEsC,GAQlB,oBAAZE,UACa,mBAAXC,SAA0BA,OAAOD,UAC1CA,QAAUC,OAAOD,QAAUxC,GAE7BwC,QAAQxC,EAAIA,GAEZH,EAAKG,EAAIA,EAIXA,EAAE0C,QAAU,OAQZ,IAAIC,GAAO3C,EAAE2C,KAAO3C,EAAEe,QAAU,SAASuB,EAAKM,EAAUC,GACtD,GAAW,MAAPP,EAAa,MAAOA,EACxB,IAAIxB,GAAiBwB,EAAIvB,UAAYD,EACnCwB,EAAIvB,QAAQ6B,EAAUC,OACjB,IAAIP,EAAIQ,UAAYR,EAAIQ,QAC7B,IAAK,GAAIC,GAAI,EAAGD,EAASR,EAAIQ,OAAYA,EAAJC,EAAYA,IAC/C,GAAIH,EAASI,KAAKH,EAASP,EAAIS,GAAIA,EAAGT,KAASrC,EAAS,WAI1D,KAAK,GADDkC,GAAOnC,EAAEmC,KAAKG,GACTS,EAAI,EAAGD,EAASX,EAAKW,OAAYA,EAAJC,EAAYA,IAChD,GAAIH,EAASI,KAAKH,EAASP,EAAIH,EAAKY,IAAKZ,EAAKY,GAAIT,KAASrC,EAAS,MAGxE,OAAOqC,GAKTtC,GAAEiB,IAAMjB,EAAEiD,QAAU,SAASX,EAAKM,EAAUC,GAC1C,GAAIK,KACJ,OAAW,OAAPZ,EAAoBY,EACpBlC,GAAasB,EAAIrB,MAAQD,EAAkBsB,EAAIrB,IAAI2B,EAAUC,IACjEF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/BH,EAAQzC,KAAKmC,EAASI,KAAKH,EAASM,EAAOC,EAAOC,MAE7CH,GAGT,IAAII,GAAc,6CAIlBtD,GAAEmB,OAASnB,EAAEuD,MAAQvD,EAAEwD,OAAS,SAASlB,EAAKM,EAAUa,EAAMZ,GAC5D,GAAIa,GAAUC,UAAUb,OAAS,CAEjC,IADW,MAAPR,IAAaA,MACbpB,GAAgBoB,EAAInB,SAAWD,EAEjC,MADI2B,KAASD,EAAW5C,EAAEqC,KAAKO,EAAUC,IAClCa,EAAUpB,EAAInB,OAAOyB,EAAUa,GAAQnB,EAAInB,OAAOyB,EAU3D,IARAD,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC1BK,EAIHD,EAAOb,EAASI,KAAKH,EAASY,EAAMN,EAAOC,EAAOC,IAHlDI,EAAON,EACPO,GAAU,MAKTA,EAAS,KAAM,IAAIE,WAAUN,EAClC,OAAOG,IAKTzD,EAAEqB,YAAcrB,EAAE6D,MAAQ,SAASvB,EAAKM,EAAUa,EAAMZ,GACtD,GAAIa,GAAUC,UAAUb,OAAS,CAEjC,IADW,MAAPR,IAAaA,MACblB,GAAqBkB,EAAIjB,cAAgBD,EAE3C,MADIyB,KAASD,EAAW5C,EAAEqC,KAAKO,EAAUC,IAClCa,EAAUpB,EAAIjB,YAAYuB,EAAUa,GAAQnB,EAAIjB,YAAYuB,EAErE,IAAIE,GAASR,EAAIQ,MACjB,IAAIA,KAAYA,EAAQ,CACtB,GAAIX,GAAOnC,EAAEmC,KAAKG,EAClBQ,GAASX,EAAKW,OAWhB,GATAH,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/BD,EAAQjB,EAAOA,IAAOW,KAAYA,EAC7BY,EAIHD,EAAOb,EAASI,KAAKH,EAASY,EAAMnB,EAAIc,GAAQA,EAAOC,IAHvDI,EAAOnB,EAAIc,GACXM,GAAU,MAKTA,EAAS,KAAM,IAAIE,WAAUN,EAClC,OAAOG,IAITzD,EAAE8D,KAAO9D,EAAE+D,OAAS,SAASzB,EAAK0B,EAAWnB,GAC3C,GAAIoB,EAOJ,OANAC,GAAI5B,EAAK,SAASa,EAAOC,EAAOC,GAC9B,MAAIW,GAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IACxCY,EAASd,GACF,GAFT,SAKKc,GAMTjE,EAAEuB,OAASvB,EAAEmE,OAAS,SAAS7B,EAAK0B,EAAWnB,GAC7C,GAAIK,KACJ,OAAW,OAAPZ,EAAoBY,EACpB5B,GAAgBgB,EAAIf,SAAWD,EAAqBgB,EAAIf,OAAOyC,EAAWnB,IAC9EF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC3BW,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAAOH,EAAQzC,KAAK0C,KAEzDD,IAITlD,EAAEoE,OAAS,SAAS9B,EAAK0B,EAAWnB,GAClC,MAAO7C,GAAEuB,OAAOe,EAAK,SAASa,EAAOC,EAAOC,GAC1C,OAAQW,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAC7CR,IAML7C,EAAEyB,MAAQzB,EAAEqE,IAAM,SAAS/B,EAAK0B,EAAWnB,GACzCmB,IAAcA,EAAYhE,EAAEsE,SAC5B,IAAIL,IAAS,CACb,OAAW,OAAP3B,EAAoB2B,EACpBzC,GAAec,EAAIb,QAAUD,EAAoBc,EAAIb,MAAMuC,EAAWnB,IAC1EF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,OAAMY,EAASA,GAAUD,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAA/D,OAA8EpD,MAEvEgE,GAMX,IAAIC,GAAMlE,EAAE2B,KAAO3B,EAAEkE,IAAM,SAAS5B,EAAK0B,EAAWnB,GAClDmB,IAAcA,EAAYhE,EAAEsE,SAC5B,IAAIL,IAAS,CACb,OAAW,OAAP3B,EAAoB2B,EACpBvC,GAAcY,EAAIX,OAASD,EAAmBY,EAAIX,KAAKqC,EAAWnB,IACtEF,EAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,MAAIY,KAAWA,EAASD,EAAUhB,KAAKH,EAASM,EAAOC,EAAOC,IAAepD,EAA7E,WAEOgE,GAKXjE,GAAEuE,SAAWvE,EAAEwE,QAAU,SAASlC,EAAKmC,GACrC,MAAW,OAAPnC,GAAoB,EACpBV,GAAiBU,EAAIT,UAAYD,EAAsBU,EAAIT,QAAQ4C,KAAY,EAC5EP,EAAI5B,EAAK,SAASa,GACvB,MAAOA,KAAUsB,KAKrBzE,EAAE0E,OAAS,SAASpC,EAAKqC,GACvB,GAAIC,GAAOlE,EAAMsC,KAAKW,UAAW,GAC7BkB,EAAS7E,EAAE8E,WAAWH,EAC1B,OAAO3E,GAAEiB,IAAIqB,EAAK,SAASa,GACzB,OAAQ0B,EAASF,EAASxB,EAAMwB,IAASI,MAAM5B,EAAOyB,MAK1D5E,EAAEgF,MAAQ,SAAS1C,EAAK2C,GACtB,MAAOjF,GAAEiB,IAAIqB,EAAKtC,EAAEkF,SAASD,KAK/BjF,EAAEmF,MAAQ,SAAS7C,EAAK8C,GACtB,MAAOpF,GAAEuB,OAAOe,EAAKtC,EAAEqF,QAAQD,KAKjCpF,EAAEsF,UAAY,SAAShD,EAAK8C,GAC1B,MAAOpF,GAAE8D,KAAKxB,EAAKtC,EAAEqF,QAAQD,KAM/BpF,EAAEuF,IAAM,SAASjD,EAAKM,EAAUC,GAC9B,IAAKD,GAAY5C,EAAEiC,QAAQK,IAAQA,EAAI,MAAQA,EAAI,IAAMA,EAAIQ,OAAS,MACpE,MAAO0C,MAAKD,IAAIR,MAAMS,KAAMlD,EAE9B,IAAI2B,IAAUwB,IAAUC,GAAgBD,GAQxC,OAPA9C,GAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,GAAIsC,GAAW/C,EAAWA,EAASI,KAAKH,EAASM,EAAOC,EAAOC,GAAQF,CACnEwC,GAAWD,IACbzB,EAASd,EACTuC,EAAeC,KAGZ1B,GAITjE,EAAE4F,IAAM,SAAStD,EAAKM,EAAUC,GAC9B,IAAKD,GAAY5C,EAAEiC,QAAQK,IAAQA,EAAI,MAAQA,EAAI,IAAMA,EAAIQ,OAAS,MACpE,MAAO0C,MAAKI,IAAIb,MAAMS,KAAMlD,EAE9B,IAAI2B,GAASwB,IAAUC,EAAeD,GAQtC,OAPA9C,GAAKL,EAAK,SAASa,EAAOC,EAAOC,GAC/B,GAAIsC,GAAW/C,EAAWA,EAASI,KAAKH,EAASM,EAAOC,EAAOC,GAAQF,CACxDuC,GAAXC,IACF1B,EAASd,EACTuC,EAAeC,KAGZ1B,GAKTjE,EAAE6F,QAAU,SAASvD,GACnB,GAAIwD,GACA1C,EAAQ,EACR2C,IAMJ,OALApD,GAAKL,EAAK,SAASa,GACjB2C,EAAO9F,EAAEgG,OAAO5C,KAChB2C,EAAS3C,EAAQ,GAAK2C,EAASD,GAC/BC,EAASD,GAAQ3C,IAEZ4C,GAMT/F,EAAEiG,OAAS,SAAS3D,EAAK4D,EAAGC,GAC1B,MAAS,OAALD,GAAaC,GACX7D,EAAIQ,UAAYR,EAAIQ,SAAQR,EAAMtC,EAAEoG,OAAO9D,IACxCA,EAAItC,EAAEgG,OAAO1D,EAAIQ,OAAS,KAE5B9C,EAAE6F,QAAQvD,GAAK5B,MAAM,EAAG8E,KAAKD,IAAI,EAAGW,IAI7C,IAAIG,GAAiB,SAASlD,GAC5B,MAAa,OAATA,EAAsBnD,EAAEsE,SACxBtE,EAAE8E,WAAW3B,GAAeA,EACzBnD,EAAEkF,SAAS/B,GAIpBnD,GAAEsG,OAAS,SAAShE,EAAKM,EAAUC,GAEjC,MADAD,GAAWyD,EAAezD,GACnB5C,EAAEgF,MAAMhF,EAAEiB,IAAIqB,EAAK,SAASa,EAAOC,EAAOC,GAC/C,OACEF,MAAOA,EACPC,MAAOA,EACPmD,SAAU3D,EAASI,KAAKH,EAASM,EAAOC,EAAOC,MAEhDmD,KAAK,SAASC,EAAMC,GACrB,GAAIC,GAAIF,EAAKF,SACTK,EAAIF,EAAMH,QACd,IAAII,IAAMC,EAAG,CACX,GAAID,EAAIC,GAAKD,QAAW,GAAG,MAAO,EAClC,IAAQC,EAAJD,GAASC,QAAW,GAAG,OAAQ,EAErC,MAAOH,GAAKrD,MAAQsD,EAAMtD,QACxB,SAIN,IAAIyD,GAAQ,SAASC,GACnB,MAAO,UAASxE,EAAKM,EAAUC,GAC7B,GAAIoB,KAMJ,OALArB,GAAWyD,EAAezD,GAC1BD,EAAKL,EAAK,SAASa,EAAOC,GACxB,GAAI6B,GAAMrC,EAASI,KAAKH,EAASM,EAAOC,EAAOd,EAC/CwE,GAAS7C,EAAQgB,EAAK9B,KAEjBc,GAMXjE,GAAE+G,QAAUF,EAAM,SAAS5C,EAAQgB,EAAK9B,GACtCnD,EAAEgH,IAAI/C,EAAQgB,GAAOhB,EAAOgB,GAAKxE,KAAK0C,GAASc,EAAOgB,IAAQ9B,KAKhEnD,EAAEiH,QAAUJ,EAAM,SAAS5C,EAAQgB,EAAK9B,GACtCc,EAAOgB,GAAO9B,IAMhBnD,EAAEkH,QAAUL,EAAM,SAAS5C,EAAQgB,GACjCjF,EAAEgH,IAAI/C,EAAQgB,GAAOhB,EAAOgB,KAAShB,EAAOgB,GAAO,IAKrDjF,EAAEmH,YAAc,SAASC,EAAO9E,EAAKM,EAAUC,GAC7CD,EAAWyD,EAAezD,EAG1B,KAFA,GAAIO,GAAQP,EAASI,KAAKH,EAASP,GAC/B+E,EAAM,EAAGC,EAAOF,EAAMtE,OACbwE,EAAND,GAAY,CACjB,GAAIE,GAAOF,EAAMC,IAAU,CAC3B1E,GAASI,KAAKH,EAASuE,EAAMG,IAAQpE,EAAQkE,EAAME,EAAM,EAAID,EAAOC,EAEtE,MAAOF,IAITrH,EAAEwH,QAAU,SAASlF,GACnB,MAAKA,GACDtC,EAAEiC,QAAQK,GAAa5B,EAAMsC,KAAKV,GAClCA,EAAIQ,UAAYR,EAAIQ,OAAe9C,EAAEiB,IAAIqB,EAAKtC,EAAEsE,UAC7CtE,EAAEoG,OAAO9D,OAIlBtC,EAAEyH,KAAO,SAASnF,GAChB,MAAW,OAAPA,EAAoB,EAChBA,EAAIQ,UAAYR,EAAIQ,OAAUR,EAAIQ,OAAS9C,EAAEmC,KAAKG,GAAKQ,QASjE9C,EAAE0H,MAAQ1H,EAAE2H,KAAO3H,EAAE4H,KAAO,SAASR,EAAOlB,EAAGC,GAC7C,MAAa,OAATiB,MAA2B,GACrB,MAALlB,GAAcC,EAAciB,EAAM,GAC/B,EAAJlB,KACGxF,EAAMsC,KAAKoE,EAAO,EAAGlB,IAO9BlG,EAAE0D,QAAU,SAAS0D,EAAOlB,EAAGC,GAC7B,MAAOzF,GAAMsC,KAAKoE,EAAO,EAAGA,EAAMtE,QAAgB,MAALoD,GAAcC,EAAQ,EAAID,KAKzElG,EAAE6H,KAAO,SAAST,EAAOlB,EAAGC,GAC1B,MAAa,OAATiB,MAA2B,GACrB,MAALlB,GAAcC,EAAciB,EAAMA,EAAMtE,OAAS,GAC/CpC,EAAMsC,KAAKoE,EAAO5B,KAAKD,IAAI6B,EAAMtE,OAASoD,EAAG,KAOtDlG,EAAE8H,KAAO9H,EAAE+H,KAAO/H,EAAEgI,KAAO,SAASZ,EAAOlB,EAAGC,GAC5C,MAAOzF,GAAMsC,KAAKoE,EAAa,MAALlB,GAAcC,EAAQ,EAAID,IAItDlG,EAAEiI,QAAU,SAASb,GACnB,MAAOpH,GAAEuB,OAAO6F,EAAOpH,EAAEsE,UAI3B,IAAI4D,GAAU,SAASC,EAAOC,EAASC,GACrC,MAAID,IAAWpI,EAAEyB,MAAM0G,EAAOnI,EAAEiC,SACvBtB,EAAOoE,MAAMsD,EAAQF,IAE9BxF,EAAKwF,EAAO,SAAShF,GACfnD,EAAEiC,QAAQkB,IAAUnD,EAAEsI,YAAYnF,GACpCiF,EAAU3H,EAAKsE,MAAMsD,EAAQlF,GAAS+E,EAAQ/E,EAAOiF,EAASC,GAE9DA,EAAO5H,KAAK0C,KAGTkF,GAITrI,GAAEkI,QAAU,SAASd,EAAOgB,GAC1B,MAAOF,GAAQd,EAAOgB,OAIxBpI,EAAEuI,QAAU,SAASnB,GACnB,MAAOpH,GAAEwI,WAAWpB,EAAO1G,EAAMsC,KAAKW,UAAW,KAKnD3D,EAAEyI,UAAY,SAASrB,EAAOpD,GAC5B,GAAI0E,MAAWC,IAIf,OAHAhG,GAAKyE,EAAO,SAASwB,IAClB5E,EAAU4E,GAAQF,EAAOC,GAAMlI,KAAKmI,MAE/BF,EAAMC,IAMhB3I,EAAE6I,KAAO7I,EAAE8I,OAAS,SAAS1B,EAAO2B,EAAUnG,EAAUC,GAClD7C,EAAE8E,WAAWiE,KACflG,EAAUD,EACVA,EAAWmG,EACXA,GAAW,EAEb,IAAIrF,GAAUd,EAAW5C,EAAEiB,IAAImG,EAAOxE,EAAUC,GAAWuE,EACvDlE,KACA8F,IAOJ,OANArG,GAAKe,EAAS,SAASP,EAAOC,IACxB2F,EAAa3F,GAAS4F,EAAKA,EAAKlG,OAAS,KAAOK,EAAUnD,EAAEuE,SAASyE,EAAM7F,MAC7E6F,EAAKvI,KAAK0C,GACVD,EAAQzC,KAAK2G,EAAMhE,OAGhBF,GAKTlD,EAAEiJ,MAAQ,WACR,MAAOjJ,GAAE6I,KAAK7I,EAAEkI,QAAQvE,WAAW,KAKrC3D,EAAEkJ,aAAe,SAAS9B,GACxB,GAAIU,GAAOpH,EAAMsC,KAAKW,UAAW,EACjC,OAAO3D,GAAEuB,OAAOvB,EAAE6I,KAAKzB,GAAQ,SAAS+B,GACtC,MAAOnJ,GAAEyB,MAAMqG,EAAM,SAASsB,GAC5B,MAAOpJ,GAAEuE,SAAS6E,EAAOD,QAO/BnJ,EAAEwI,WAAa,SAASpB,GACtB,GAAIU,GAAOnH,EAAOoE,MAAM7E,EAAYQ,EAAMsC,KAAKW,UAAW,GAC1D,OAAO3D,GAAEuB,OAAO6F,EAAO,SAASjE,GAAQ,OAAQnD,EAAEuE,SAASuD,EAAM3E,MAKnEnD,EAAEqJ,IAAM,WAGN,IAAK,GAFDvG,GAAS9C,EAAEuF,IAAIvF,EAAEgF,MAAMrB,UAAW,UAAUhD,OAAO,IACnDuC,EAAU,GAAI/C,OAAM2C,GACfC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BG,EAAQH,GAAK/C,EAAEgF,MAAMrB,UAAW,GAAKZ,EAEvC,OAAOG,IAMTlD,EAAEsJ,OAAS,SAASjG,EAAM+C,GACxB,GAAY,MAAR/C,EAAc,QAElB,KAAK,GADDY,MACKlB,EAAI,EAAGD,EAASO,EAAKP,OAAYA,EAAJC,EAAYA,IAC5CqD,EACFnC,EAAOZ,EAAKN,IAAMqD,EAAOrD,GAEzBkB,EAAOZ,EAAKN,GAAG,IAAMM,EAAKN,GAAG,EAGjC,OAAOkB,IASTjE,EAAE6B,QAAU,SAASuF,EAAO+B,EAAMJ,GAChC,GAAa,MAAT3B,EAAe,OAAQ,CAC3B,IAAIrE,GAAI,EAAGD,EAASsE,EAAMtE,MAC1B,IAAIiG,EAAU,CACZ,GAAuB,gBAAZA,GAIT,MADAhG,GAAI/C,EAAEmH,YAAYC,EAAO+B,GAClB/B,EAAMrE,KAAOoG,EAAOpG,GAAK,CAHhCA,GAAgB,EAAXgG,EAAevD,KAAKD,IAAI,EAAGzC,EAASiG,GAAYA,EAMzD,GAAInH,GAAiBwF,EAAMvF,UAAYD,EAAe,MAAOwF,GAAMvF,QAAQsH,EAAMJ,EACjF,MAAWjG,EAAJC,EAAYA,IAAK,GAAIqE,EAAMrE,KAAOoG,EAAM,MAAOpG,EACtD,QAAQ,GAIV/C,EAAE+B,YAAc,SAASqF,EAAO+B,EAAMI,GACpC,GAAa,MAATnC,EAAe,OAAQ,CAC3B,IAAIoC,GAAmB,MAARD,CACf,IAAIzH,GAAqBsF,EAAMrF,cAAgBD,EAC7C,MAAO0H,GAAWpC,EAAMrF,YAAYoH,EAAMI,GAAQnC,EAAMrF,YAAYoH,EAGtE,KADA,GAAIpG,GAAKyG,EAAWD,EAAOnC,EAAMtE,OAC1BC,KAAK,GAAIqE,EAAMrE,KAAOoG,EAAM,MAAOpG,EAC1C,QAAQ,GAMV/C,EAAEyJ,MAAQ,SAASC,EAAOC,EAAMC,GAC1BjG,UAAUb,QAAU,IACtB6G,EAAOD,GAAS,EAChBA,EAAQ,GAEVE,EAAOjG,UAAU,IAAM,CAMvB,KAJA,GAAIb,GAAS0C,KAAKD,IAAIC,KAAKqE,MAAMF,EAAOD,GAASE,GAAO,GACpDE,EAAM,EACNL,EAAQ,GAAItJ,OAAM2C,GAEVA,EAANgH,GACJL,EAAMK,KAASJ,EACfA,GAASE,CAGX,OAAOH,GAOT,IAAIM,GAAO,YAKX/J,GAAEqC,KAAO,SAAS2H,EAAMnH,GACtB,GAAI+B,GAAMqF,CACV,IAAI7H,GAAc4H,EAAK3H,OAASD,EAAY,MAAOA,GAAW2C,MAAMiF,EAAMtJ,EAAMsC,KAAKW,UAAW,GAChG,KAAK3D,EAAE8E,WAAWkF,GAAO,KAAM,IAAIpG,UAEnC,OADAgB,GAAOlE,EAAMsC,KAAKW,UAAW,GACtBsG,EAAQ,WACb,KAAMnK,eAAgBmK,IAAQ,MAAOD,GAAKjF,MAAMlC,EAAS+B,EAAKjE,OAAOD,EAAMsC,KAAKW,YAChFoG,GAAK3J,UAAY4J,EAAK5J,SACtB,IAAI8J,GAAO,GAAIH,EACfA,GAAK3J,UAAY,IACjB,IAAI6D,GAAS+F,EAAKjF,MAAMmF,EAAMtF,EAAKjE,OAAOD,EAAMsC,KAAKW,YACrD,OAAIrD,QAAO2D,KAAYA,EAAeA,EAC/BiG,IAOXlK,EAAEmK,QAAU,SAASH,GACnB,GAAII,GAAY1J,EAAMsC,KAAKW,UAAW,EACtC,OAAO,YAGL,IAAK,GAFD0G,GAAW,EACXzF,EAAOwF,EAAU1J,QACZqC,EAAI,EAAGD,EAAS8B,EAAK9B,OAAYA,EAAJC,EAAYA,IAC5C6B,EAAK7B,KAAO/C,IAAG4E,EAAK7B,GAAKY,UAAU0G,KAEzC,MAAOA,EAAW1G,UAAUb,QAAQ8B,EAAKnE,KAAKkD,UAAU0G,KACxD,OAAOL,GAAKjF,MAAMjF,KAAM8E,KAO5B5E,EAAEsK,QAAU,SAAShI,GACnB,GAAIiI,GAAQ7J,EAAMsC,KAAKW,UAAW,EAClC,IAAqB,IAAjB4G,EAAMzH,OAAc,KAAM,IAAI0H,OAAM,wCAExC,OADA7H,GAAK4H,EAAO,SAASE,GAAKnI,EAAImI,GAAKzK,EAAEqC,KAAKC,EAAImI,GAAInI,KAC3CA,GAITtC,EAAE0K,QAAU,SAASV,EAAMW,GACzB,GAAIlH,KAEJ,OADAkH,KAAWA,EAAS3K,EAAEsE,UACf,WACL,GAAIW,GAAM0F,EAAO5F,MAAMjF,KAAM6D,UAC7B,OAAO3D,GAAEgH,IAAIvD,EAAMwB,GAAOxB,EAAKwB,GAAQxB,EAAKwB,GAAO+E,EAAKjF,MAAMjF,KAAM6D,aAMxE3D,EAAE4K,MAAQ,SAASZ,EAAMa,GACvB,GAAIjG,GAAOlE,EAAMsC,KAAKW,UAAW,EACjC,OAAOmH,YAAW,WAAY,MAAOd,GAAKjF,MAAM,KAAMH,IAAUiG,IAKlE7K,EAAE+K,MAAQ,SAASf,GACjB,MAAOhK,GAAE4K,MAAM7F,MAAM/E,GAAIgK,EAAM,GAAGrJ,OAAOD,EAAMsC,KAAKW,UAAW,MAQjE3D,EAAEgL,SAAW,SAAShB,EAAMa,EAAMI,GAChC,GAAIpI,GAAS+B,EAAMX,EACfiH,EAAU,KACVC,EAAW,CACfF,KAAYA,KACZ,IAAIG,GAAQ,WACVD,EAAWF,EAAQI,WAAY,EAAQ,EAAIrL,EAAEsL,MAC7CJ,EAAU,KACVjH,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,KAEnB,OAAO,YACL,GAAI0G,GAAMtL,EAAEsL,KACPH,IAAYF,EAAQI,WAAY,IAAOF,EAAWG,EACvD,IAAIC,GAAYV,GAAQS,EAAMH,EAY9B,OAXAtI,GAAU/C,KACV8E,EAAOjB,UACU,GAAb4H,GACFC,aAAaN,GACbA,EAAU,KACVC,EAAWG,EACXrH,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,MACPsG,GAAWD,EAAQQ,YAAa,IAC1CP,EAAUJ,WAAWM,EAAOG,IAEvBtH,IAQXjE,EAAE0L,SAAW,SAAS1B,EAAMa,EAAMc,GAChC,GAAIT,GAAStG,EAAM/B,EAAS+I,EAAW3H,EAEnCmH,EAAQ,WACV,GAAIvD,GAAO7H,EAAEsL,MAAQM,CACVf,GAAPhD,EACFqD,EAAUJ,WAAWM,EAAOP,EAAOhD,IAEnCqD,EAAU,KACLS,IACH1H,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,OAKvB,OAAO,YACL/B,EAAU/C,KACV8E,EAAOjB,UACPiI,EAAY5L,EAAEsL,KACd,IAAIO,GAAUF,IAAcT,CAS5B,OARKA,KACHA,EAAUJ,WAAWM,EAAOP,IAE1BgB,IACF5H,EAAS+F,EAAKjF,MAAMlC,EAAS+B,GAC7B/B,EAAU+B,EAAO,MAGZX,IAMXjE,EAAE8L,KAAO,SAAS9B,GAChB,GAAiBvG,GAAbsI,GAAM,CACV,OAAO,YACL,MAAIA,GAAYtI,GAChBsI,GAAM,EACNtI,EAAOuG,EAAKjF,MAAMjF,KAAM6D,WACxBqG,EAAO,KACAvG,KAOXzD,EAAEgM,KAAO,SAAShC,EAAMiC,GACtB,MAAOjM,GAAEmK,QAAQ8B,EAASjC,IAK5BhK,EAAEkM,QAAU,WACV,GAAI3B,GAAQ5G,SACZ,OAAO,YAEL,IAAK,GADDiB,GAAOjB,UACFZ,EAAIwH,EAAMzH,OAAS,EAAGC,GAAK,EAAGA,IACrC6B,GAAQ2F,EAAMxH,GAAGgC,MAAMjF,KAAM8E,GAE/B,OAAOA,GAAK,KAKhB5E,EAAEmM,MAAQ,SAASC,EAAOpC,GACxB,MAAO,YACL,QAAMoC,EAAQ,EACLpC,EAAKjF,MAAMjF,KAAM6D,WAD1B,SAWJ3D,EAAEmC,KAAO,SAASG,GAChB,IAAKtC,EAAEqM,SAAS/J,GAAM,QACtB,IAAIJ,EAAY,MAAOA,GAAWI,EAClC,IAAIH,KACJ,KAAK,GAAI8C,KAAO3C,GAAStC,EAAEgH,IAAI1E,EAAK2C,IAAM9C,EAAK1B,KAAKwE,EACpD,OAAO9C,IAITnC,EAAEoG,OAAS,SAAS9D,GAIlB,IAAK,GAHDH,GAAOnC,EAAEmC,KAAKG,GACdQ,EAASX,EAAKW,OACdsD,EAAS,GAAIjG,OAAM2C,GACdC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BqD,EAAOrD,GAAKT,EAAIH,EAAKY,GAEvB,OAAOqD,IAITpG,EAAEsM,MAAQ,SAAShK,GAIjB,IAAK,GAHDH,GAAOnC,EAAEmC,KAAKG,GACdQ,EAASX,EAAKW,OACdwJ,EAAQ,GAAInM,OAAM2C,GACbC,EAAI,EAAOD,EAAJC,EAAYA,IAC1BuJ,EAAMvJ,IAAMZ,EAAKY,GAAIT,EAAIH,EAAKY,IAEhC,OAAOuJ,IAITtM,EAAEuM,OAAS,SAASjK,GAGlB,IAAK,GAFD2B,MACA9B,EAAOnC,EAAEmC,KAAKG,GACTS,EAAI,EAAGD,EAASX,EAAKW,OAAYA,EAAJC,EAAYA,IAChDkB,EAAO3B,EAAIH,EAAKY,KAAOZ,EAAKY,EAE9B,OAAOkB,IAKTjE,EAAEwM,UAAYxM,EAAEyM,QAAU,SAASnK,GACjC,GAAIoK,KACJ,KAAK,GAAIzH,KAAO3C,GACVtC,EAAE8E,WAAWxC,EAAI2C,KAAOyH,EAAMjM,KAAKwE,EAEzC,OAAOyH,GAAMlG,QAIfxG,EAAE2M,OAAS,SAASrK,GAQlB,MAPAK,GAAKjC,EAAMsC,KAAKW,UAAW,GAAI,SAASiJ,GACtC,GAAIA,EACF,IAAK,GAAIC,KAAQD,GACftK,EAAIuK,GAAQD,EAAOC,KAIlBvK,GAITtC,EAAE8M,KAAO,SAASxK,GAChB,GAAIyK,MACA5K,EAAOxB,EAAOoE,MAAM7E,EAAYQ,EAAMsC,KAAKW,UAAW,GAI1D,OAHAhB,GAAKR,EAAM,SAAS8C,GACdA,IAAO3C,KAAKyK,EAAK9H,GAAO3C,EAAI2C,MAE3B8H,GAIT/M,EAAEgN,KAAO,SAAS1K,GAChB,GAAIyK,MACA5K,EAAOxB,EAAOoE,MAAM7E,EAAYQ,EAAMsC,KAAKW,UAAW,GAC1D,KAAK,GAAIsB,KAAO3C,GACTtC,EAAEuE,SAASpC,EAAM8C,KAAM8H,EAAK9H,GAAO3C,EAAI2C,GAE9C,OAAO8H,IAIT/M,EAAEiN,SAAW,SAAS3K,GAQpB,MAPAK,GAAKjC,EAAMsC,KAAKW,UAAW,GAAI,SAASiJ,GACtC,GAAIA,EACF,IAAK,GAAIC,KAAQD,GACXtK,EAAIuK,SAAe,KAAGvK,EAAIuK,GAAQD,EAAOC,MAI5CvK,GAITtC,EAAEkN,MAAQ,SAAS5K,GACjB,MAAKtC,GAAEqM,SAAS/J,GACTtC,EAAEiC,QAAQK,GAAOA,EAAI5B,QAAUV,EAAE2M,UAAWrK,GADtBA,GAO/BtC,EAAEmN,IAAM,SAAS7K,EAAK8K,GAEpB,MADAA,GAAY9K,GACLA,EAIT,IAAI+K,GAAK,SAAS1G,EAAGC,EAAG0G,EAAQC,GAG9B,GAAI5G,IAAMC,EAAG,MAAa,KAAND,GAAW,EAAIA,GAAK,EAAIC,CAE5C,IAAS,MAALD,GAAkB,MAALC,EAAW,MAAOD,KAAMC,CAErCD,aAAa3G,KAAG2G,EAAIA,EAAEpE,UACtBqE,YAAa5G,KAAG4G,EAAIA,EAAErE,SAE1B,IAAIiL,GAAY5M,EAASoC,KAAK2D,EAC9B,IAAI6G,GAAa5M,EAASoC,KAAK4D,GAAI,OAAO,CAC1C,QAAQ4G,GAEN,IAAK,kBAGH,MAAO7G,IAAK8G,OAAO7G,EACrB,KAAK,kBAGH,MAAOD,KAAMA,EAAIC,IAAMA,EAAU,GAALD,EAAS,EAAIA,GAAK,EAAIC,EAAID,IAAMC,CAC9D,KAAK,gBACL,IAAK,mBAIH,OAAQD,IAAMC,CAEhB,KAAK,kBACH,MAAOD,GAAEiG,QAAUhG,EAAEgG,QACdjG,EAAE+G,QAAU9G,EAAE8G,QACd/G,EAAEgH,WAAa/G,EAAE+G,WACjBhH,EAAEiH,YAAchH,EAAEgH,WAE7B,GAAgB,gBAALjH,IAA6B,gBAALC,GAAe,OAAO,CAIzD,KADA,GAAI9D,GAASwK,EAAOxK,OACbA,KAGL,GAAIwK,EAAOxK,IAAW6D,EAAG,MAAO4G,GAAOzK,IAAW8D,CAIpD,IAAIiH,GAAQlH,EAAEmH,YAAaC,EAAQnH,EAAEkH,WACrC,IAAID,IAAUE,KAAW/N,EAAE8E,WAAW+I,IAAWA,YAAiBA,IACzC7N,EAAE8E,WAAWiJ,IAAWA,YAAiBA,KAC1C,eAAiBpH,IAAK,eAAiBC,GAC7D,OAAO,CAGT0G,GAAO7M,KAAKkG,GACZ4G,EAAO9M,KAAKmG,EACZ,IAAIa,GAAO,EAAGxD,GAAS,CAEvB,IAAiB,kBAAbuJ,GAIF,GAFA/F,EAAOd,EAAE7D,OACTmB,EAASwD,GAAQb,EAAE9D,OAGjB,KAAO2E,MACCxD,EAASoJ,EAAG1G,EAAEc,GAAOb,EAAEa,GAAO6F,EAAQC,WAG3C,CAEL,IAAK,GAAItI,KAAO0B,GACd,GAAI3G,EAAEgH,IAAIL,EAAG1B,KAEXwC,MAEMxD,EAASjE,EAAEgH,IAAIJ,EAAG3B,IAAQoI,EAAG1G,EAAE1B,GAAM2B,EAAE3B,GAAMqI,EAAQC,KAAU,KAIzE,IAAItJ,EAAQ,CACV,IAAKgB,IAAO2B,GACV,GAAI5G,EAAEgH,IAAIJ,EAAG3B,KAAUwC,IAAS,KAElCxD,IAAUwD,GAMd,MAFA6F,GAAOU,MACPT,EAAOS,MACA/J,EAITjE,GAAEiO,QAAU,SAAStH,EAAGC,GACtB,MAAOyG,GAAG1G,EAAGC,UAKf5G,EAAEkO,QAAU,SAAS5L,GACnB,GAAW,MAAPA,EAAa,OAAO,CACxB,IAAItC,EAAEiC,QAAQK,IAAQtC,EAAEmO,SAAS7L,GAAM,MAAsB,KAAfA,EAAIQ,MAClD,KAAK,GAAImC,KAAO3C,GAAK,GAAItC,EAAEgH,IAAI1E,EAAK2C,GAAM,OAAO,CACjD,QAAO,GAITjF,EAAEoO,UAAY,SAAS9L,GACrB,SAAUA,GAAwB,IAAjBA,EAAI+L,WAKvBrO,EAAEiC,QAAUD,GAAiB,SAASM,GACpC,MAA6B,kBAAtB1B,EAASoC,KAAKV,IAIvBtC,EAAEqM,SAAW,SAAS/J,GACpB,MAAOA,KAAQhC,OAAOgC,IAIxBK,GAAM,YAAa,WAAY,SAAU,SAAU,OAAQ,UAAW,SAAS2L,GAC7EtO,EAAE,KAAOsO,GAAQ,SAAShM,GACxB,MAAO1B,GAASoC,KAAKV,IAAQ,WAAagM,EAAO,OAMhDtO,EAAEsI,YAAY3E,aACjB3D,EAAEsI,YAAc,SAAShG,GACvB,SAAUA,IAAOtC,EAAEgH,IAAI1E,EAAK,aAKX,kBAAV,MACTtC,EAAE8E,WAAa,SAASxC,GACtB,MAAsB,kBAARA,KAKlBtC,EAAEuO,SAAW,SAASjM,GACpB,MAAOiM,UAASjM,KAASkM,MAAMC,WAAWnM,KAI5CtC,EAAEwO,MAAQ,SAASlM,GACjB,MAAOtC,GAAE0O,SAASpM,IAAQA,IAAQA,GAIpCtC,EAAE2O,UAAY,SAASrM,GACrB,MAAOA,MAAQ,GAAQA,KAAQ,GAA+B,oBAAtB1B,EAASoC,KAAKV,IAIxDtC,EAAE4O,OAAS,SAAStM,GAClB,MAAe,QAARA,GAITtC,EAAE6O,YAAc,SAASvM,GACvB,MAAOA,SAAa,IAKtBtC,EAAEgH,IAAM,SAAS1E,EAAK2C,GACpB,MAAOpE,GAAemC,KAAKV,EAAK2C,IAQlCjF,EAAE8O,WAAa,WAEb,MADAjP,GAAKG,EAAID,EACFD,MAITE,EAAEsE,SAAW,SAASnB,GACpB,MAAOA,IAGTnD,EAAE+O,SAAW,SAAS5L,GACpB,MAAO,YACL,MAAOA,KAIXnD,EAAEkF,SAAW,SAASD,GACpB,MAAO,UAAS3C,GACd,MAAOA,GAAI2C,KAKfjF,EAAEqF,QAAU,SAASD,GACnB,MAAO,UAAS9C,GACd,GAAIA,IAAQ8C,EAAO,OAAO,CAC1B,KAAK,GAAIH,KAAOG,GACd,GAAIA,EAAMH,KAAS3C,EAAI2C,GACrB,OAAO,CAEX,QAAO,IAKXjF,EAAEoM,MAAQ,SAASlG,EAAGtD,EAAUC,GAE9B,IAAK,GADDmM,GAAQ7O,MAAMqF,KAAKD,IAAI,EAAGW,IACrBnD,EAAI,EAAOmD,EAAJnD,EAAOA,IAAKiM,EAAMjM,GAAKH,EAASI,KAAKH,EAASE,EAC9D,OAAOiM,IAIThP,EAAEgG,OAAS,SAASJ,EAAKL,GAKvB,MAJW,OAAPA,IACFA,EAAMK,EACNA,EAAM,GAEDA,EAAMJ,KAAKyJ,MAAMzJ,KAAKQ,UAAYT,EAAMK,EAAM,KAIvD5F,EAAEsL,IAAM4D,KAAK5D,KAAO,WAAa,OAAO,GAAI4D,OAAOC,UAGnD,IAAIC,IACFC,QACEC,IAAK,QACLC,IAAK,OACLC,IAAK,OACLC,IAAK,SACLC,IAAK,UAGTN,GAAUO,SAAW3P,EAAEuM,OAAO6C,EAAUC,OAGxC,IAAIO,IACFP,OAAU,GAAIQ,QAAO,IAAM7P,EAAEmC,KAAKiN,EAAUC,QAAQS,KAAK,IAAM,IAAK,KACpEH,SAAU,GAAIE,QAAO,IAAM7P,EAAEmC,KAAKiN,EAAUO,UAAUG,KAAK,KAAO,IAAK,KAIzE9P,GAAE2C,MAAM,SAAU,YAAa,SAASgC,GACtC3E,EAAE2E,GAAU,SAASoL,GACnB,MAAc,OAAVA,EAAuB,IACnB,GAAKA,GAAQC,QAAQJ,EAAcjL,GAAS,SAASsL,GAC3D,MAAOb,GAAUzK,GAAQsL,QAO/BjQ,EAAEiE,OAAS,SAASqF,EAAQpE,GAC1B,GAAc,MAAVoE,EAAgB,WAAY,EAChC,IAAInG,GAAQmG,EAAOpE,EACnB,OAAOlF,GAAE8E,WAAW3B,GAASA,EAAMH,KAAKsG,GAAUnG,GAIpDnD,EAAEkQ,MAAQ,SAAS5N,GACjBK,EAAK3C,EAAEwM,UAAUlK,GAAM,SAASgM,GAC9B,GAAItE,GAAOhK,EAAEsO,GAAQhM,EAAIgM,EACzBtO,GAAEI,UAAUkO,GAAQ,WAClB,GAAI1J,IAAQ9E,KAAKyC,SAEjB,OADA9B,GAAKsE,MAAMH,EAAMjB,WACVM,EAAOjB,KAAKlD,KAAMkK,EAAKjF,MAAM/E,EAAG4E,OAO7C,IAAIuL,GAAY,CAChBnQ,GAAEoQ,SAAW,SAASC,GACpB,GAAIC,KAAOH,EAAY,EACvB,OAAOE,GAASA,EAASC,EAAKA,GAKhCtQ,EAAEuQ,kBACAC,SAAc,kBACdC,YAAc,mBACdpB,OAAc,mBAMhB,IAAIqB,GAAU,OAIVC,GACFjB,IAAU,IACVkB,KAAU,KACVC,KAAU,IACVC,KAAU,IACVC,IAAU,IACVC,SAAU,QACVC,SAAU,SAGRC,EAAU,8BAKdlR,GAAEmR,SAAW,SAASC,EAAMC,EAAMC,GAChC,GAAIC,EACJD,GAAWtR,EAAEiN,YAAaqE,EAAUtR,EAAEuQ,iBAGtC,IAAIiB,GAAU,GAAI3B,UACfyB,EAASjC,QAAUqB,GAAS9D,QAC5B0E,EAASb,aAAeC,GAAS9D,QACjC0E,EAASd,UAAYE,GAAS9D,QAC/BkD,KAAK,KAAO,KAAM,KAGhB1M,EAAQ,EACRwJ,EAAS,QACbwE,GAAKpB,QAAQwB,EAAS,SAASvB,EAAOZ,EAAQoB,EAAaD,EAAUiB,GAcnE,MAbA7E,IAAUwE,EAAK1Q,MAAM0C,EAAOqO,GACzBzB,QAAQkB,EAAS,SAASjB,GAAS,MAAO,KAAOU,EAAQV,KAExDZ,IACFzC,GAAU,cAAgByC,EAAS,kCAEjCoB,IACF7D,GAAU,cAAgB6D,EAAc,wBAEtCD,IACF5D,GAAU,OAAS4D,EAAW,YAEhCpN,EAAQqO,EAASxB,EAAMnN,OAChBmN,IAETrD,GAAU,OAGL0E,EAASI,WAAU9E,EAAS,mBAAqBA,EAAS,OAE/DA,EAAS,2CACP,oDACAA,EAAS,eAEX,KACE2E,EAAS,GAAI/Q,UAAS8Q,EAASI,UAAY,MAAO,IAAK9E,GACvD,MAAO+E,GAEP,KADAA,GAAE/E,OAASA,EACL+E,EAGR,GAAIN,EAAM,MAAOE,GAAOF,EAAMrR,EAC9B,IAAImR,GAAW,SAASE,GACtB,MAAOE,GAAOvO,KAAKlD,KAAMuR,EAAMrR,GAMjC,OAFAmR,GAASvE,OAAS,aAAe0E,EAASI,UAAY,OAAS,OAAS9E,EAAS,IAE1EuE,GAITnR,EAAE4R,MAAQ,SAAStP,GACjB,MAAOtC,GAAEsC,GAAKsP,QAUhB,IAAI3N,GAAS,SAAS3B,GACpB,MAAOxC,MAAK+R,OAAS7R,EAAEsC,GAAKsP,QAAUtP,EAIxCtC,GAAEkQ,MAAMlQ,GAGR2C,GAAM,MAAO,OAAQ,UAAW,QAAS,OAAQ,SAAU,WAAY,SAAS2L,GAC9E,GAAI3J,GAASzE,EAAWoO,EACxBtO,GAAEI,UAAUkO,GAAQ,WAClB,GAAIhM,GAAMxC,KAAKyC,QAGf,OAFAoC,GAAOI,MAAMzC,EAAKqB,WACL,SAAR2K,GAA2B,UAARA,GAAoC,IAAfhM,EAAIQ,cAAqBR,GAAI,GACnE2B,EAAOjB,KAAKlD,KAAMwC,MAK7BK,GAAM,SAAU,OAAQ,SAAU,SAAS2L,GACzC,GAAI3J,GAASzE,EAAWoO,EACxBtO,GAAEI,UAAUkO,GAAQ,WAClB,MAAOrK,GAAOjB,KAAKlD,KAAM6E,EAAOI,MAAMjF,KAAKyC,SAAUoB,eAIzD3D,EAAE2M,OAAO3M,EAAEI,WAGTwR,MAAO,WAEL,MADA9R,MAAK+R,QAAS,EACP/R,MAITqD,MAAO,WACL,MAAOrD,MAAKyC,YAYM,kBAAXuP,SAAyBA,OAAOC,KACzCD,OAAO,gBAAkB,WACvB,MAAO9R,OAGVgD,KAAKlD"}
\ No newline at end of file
diff --git a/distro/cmon-1.2.6-357-64bit-glibc23-mc70.tar.gz b/distro/cmon-1.2.6-357-64bit-glibc23-mc70.tar.gz
new file mode 100644
index 0000000..4ccb56a
--- /dev/null
+++ b/distro/cmon-1.2.6-357-64bit-glibc23-mc70.tar.gz
Binary files differ
diff --git a/distro/netaddr-0.7.5.tar.gz b/distro/netaddr-0.7.5.tar.gz
new file mode 100644
index 0000000..31a67f0
--- /dev/null
+++ b/distro/netaddr-0.7.5.tar.gz
Binary files differ
diff --git a/googlecode/googlemock-release-1.6.0.zip b/googlecode/googlemock-release-1.6.0.zip
new file mode 100644
index 0000000..4d39a71
--- /dev/null
+++ b/googlecode/googlemock-release-1.6.0.zip
Binary files differ
diff --git a/googlecode/googletest-release-1.6.0.zip b/googlecode/googletest-release-1.6.0.zip
new file mode 100644
index 0000000..1a7655d
--- /dev/null
+++ b/googlecode/googletest-release-1.6.0.zip
Binary files differ
diff --git a/googlecode/gperftools-2.1.tar.gz b/googlecode/gperftools-2.1.tar.gz
new file mode 100644
index 0000000..99e2aa2
--- /dev/null
+++ b/googlecode/gperftools-2.1.tar.gz
Binary files differ
diff --git a/googlecode/pugixml-1.2.tar.gz b/googlecode/pugixml-1.2.tar.gz
new file mode 100644
index 0000000..6abb531
--- /dev/null
+++ b/googlecode/pugixml-1.2.tar.gz
Binary files differ
diff --git a/googlecode/rapidjson-0.11.zip b/googlecode/rapidjson-0.11.zip
new file mode 100644
index 0000000..4a67710
--- /dev/null
+++ b/googlecode/rapidjson-0.11.zip
Binary files differ
diff --git a/googlecode/rapidjson-v1.1.0.zip b/googlecode/rapidjson-v1.1.0.zip
new file mode 100644
index 0000000..bb24acf
--- /dev/null
+++ b/googlecode/rapidjson-v1.1.0.zip
Binary files differ
diff --git a/googletest-1.8.1.zip b/googletest-1.8.1.zip
new file mode 100644
index 0000000..457af9b
--- /dev/null
+++ b/googletest-1.8.1.zip
Binary files differ
diff --git a/hiredis/hiredis-0.11.0.tar.gz b/hiredis/hiredis-0.11.0.tar.gz
new file mode 100644
index 0000000..37658fb
--- /dev/null
+++ b/hiredis/hiredis-0.11.0.tar.gz
Binary files differ
diff --git a/hiredis/hiredis-boostasio-adapter-master.zip b/hiredis/hiredis-boostasio-adapter-master.zip
new file mode 100644
index 0000000..e3eb062
--- /dev/null
+++ b/hiredis/hiredis-boostasio-adapter-master.zip
Binary files differ
diff --git a/hiredis/hiredis-master-20190604.zip b/hiredis/hiredis-master-20190604.zip
new file mode 100644
index 0000000..3163fed
--- /dev/null
+++ b/hiredis/hiredis-master-20190604.zip
Binary files differ
diff --git a/ifmap-python/ifmap-python-master.zip b/ifmap-python/ifmap-python-master.zip
new file mode 100644
index 0000000..a0869ff
--- /dev/null
+++ b/ifmap-python/ifmap-python-master.zip
Binary files differ
diff --git a/irond/irond-0.3.2-src.zip b/irond/irond-0.3.2-src.zip
new file mode 100644
index 0000000..7a797cc
--- /dev/null
+++ b/irond/irond-0.3.2-src.zip
Binary files differ
diff --git a/kafka/kafka_2.10-0.9.0.0-SNAPSHOT.tgz b/kafka/kafka_2.10-0.9.0.0-SNAPSHOT.tgz
new file mode 100644
index 0000000..4c57db1
--- /dev/null
+++ b/kafka/kafka_2.10-0.9.0.0-SNAPSHOT.tgz
Binary files differ
diff --git a/kafka/kafka_2.11-0.9.0.1.orig.tar.gz b/kafka/kafka_2.11-0.9.0.1.orig.tar.gz
new file mode 100644
index 0000000..b8fec37
--- /dev/null
+++ b/kafka/kafka_2.11-0.9.0.1.orig.tar.gz
Binary files differ
diff --git a/kafka/kafka_2.11-1.1.1-1.tar.gz b/kafka/kafka_2.11-1.1.1-1.tar.gz
new file mode 100644
index 0000000..e3c10e3
--- /dev/null
+++ b/kafka/kafka_2.11-1.1.1-1.tar.gz
Binary files differ
diff --git a/kafka/kafka_2.11-2.3.0.tgz b/kafka/kafka_2.11-2.3.0.tgz
new file mode 100644
index 0000000..3ab87dd
--- /dev/null
+++ b/kafka/kafka_2.11-2.3.0.tgz
Binary files differ
diff --git a/kafka/kafka_2.11-2.3.1.tgz b/kafka/kafka_2.11-2.3.1.tgz
new file mode 100644
index 0000000..d3bd8d8
--- /dev/null
+++ b/kafka/kafka_2.11-2.3.1.tgz
Binary files differ
diff --git a/libtbb/2018_U5.tar.gz b/libtbb/2018_U5.tar.gz
new file mode 100644
index 0000000..44f5c5d
--- /dev/null
+++ b/libtbb/2018_U5.tar.gz
Binary files differ
diff --git a/openjdk-1.8.0/java-1.8.0-openjdk-amd64.tar.gz b/openjdk-1.8.0/java-1.8.0-openjdk-amd64.tar.gz
new file mode 100644
index 0000000..be327b5
--- /dev/null
+++ b/openjdk-1.8.0/java-1.8.0-openjdk-amd64.tar.gz
Binary files differ
diff --git a/stunnel/stunnel-5.56.tar.gz b/stunnel/stunnel-5.56.tar.gz
new file mode 100644
index 0000000..26172dc
--- /dev/null
+++ b/stunnel/stunnel-5.56.tar.gz
Binary files differ
diff --git a/vmware/vijava55b20130927src.jar b/vmware/vijava55b20130927src.jar
new file mode 100644
index 0000000..ec4bd62
--- /dev/null
+++ b/vmware/vijava55b20130927src.jar
Binary files differ
diff --git a/zookeeper/zookeeper-3.4.5.tar.gz b/zookeeper/zookeeper-3.4.5.tar.gz
new file mode 100644
index 0000000..1a547fe
--- /dev/null
+++ b/zookeeper/zookeeper-3.4.5.tar.gz
Binary files differ