aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bower_components/admin-lte/plugins
diff options
context:
space:
mode:
authorMarvin Borner2018-07-13 19:06:45 +0200
committerMarvin Borner2018-07-13 19:06:45 +0200
commit6fcfb7c04d32e1c8b26a312295bf7ac3ec2d2ad7 (patch)
treedbc87ef16fa01d5d99116de283592b8fe5e02944 /public/bower_components/admin-lte/plugins
parentdfd839f27146df0ad0494e11734fc7d310c70ebf (diff)
Fixed many permissions and began admin interface
Diffstat (limited to 'public/bower_components/admin-lte/plugins')
-rw-r--r--public/bower_components/admin-lte/plugins/bootstrap-slider/bootstrap-slider.js1576
-rw-r--r--public/bower_components/admin-lte/plugins/bootstrap-slider/slider.css282
-rw-r--r--public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js14975
-rw-r--r--public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js8
-rw-r--r--public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.css117
-rw-r--r--public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css3
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/all.css61
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/_all.css560
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/aero.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/aero.pngbin0 -> 1520 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/aero@2x.pngbin0 -> 3218 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/blue.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/blue.pngbin0 -> 1518 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/blue@2x.pngbin0 -> 3217 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/flat.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/flat.pngbin0 -> 1515 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/flat@2x.pngbin0 -> 3217 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/green.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/green.pngbin0 -> 1444 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/green@2x.pngbin0 -> 3117 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/grey.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/grey.pngbin0 -> 1516 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/grey@2x.pngbin0 -> 3217 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/orange.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/orange.pngbin0 -> 1518 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/orange@2x.pngbin0 -> 3275 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/pink.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/pink.pngbin0 -> 1522 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/pink@2x.pngbin0 -> 3218 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/purple.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/purple.pngbin0 -> 1519 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/purple@2x.pngbin0 -> 3218 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/red.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/red.pngbin0 -> 1516 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/red@2x.pngbin0 -> 3276 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/yellow.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/yellow.pngbin0 -> 1516 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/flat/yellow@2x.pngbin0 -> 3216 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.css56
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.pngbin0 -> 1734 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/futurico/futurico@2x.pngbin0 -> 3446 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/icheck.js478
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/icheck.min.js10
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/_all.css740
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/aero.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/blue.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/green.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/grey.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/line.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/line.pngbin0 -> 588 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/line@2x.pngbin0 -> 1073 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/orange.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/pink.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/purple.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/red.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/line/yellow.css74
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/_all.css557
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/aero.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/aero.pngbin0 -> 1151 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/aero@2x.pngbin0 -> 1409 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/blue.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/blue.pngbin0 -> 1132 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/blue@2x.pngbin0 -> 1410 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/green.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/green.pngbin0 -> 1143 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/green@2x.pngbin0 -> 1408 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/grey.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/grey.pngbin0 -> 1142 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/grey@2x.pngbin0 -> 1407 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.pngbin0 -> 1114 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/minimal@2x.pngbin0 -> 1410 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/orange.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/orange.pngbin0 -> 1139 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/orange@2x.pngbin0 -> 1407 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/pink.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/pink.pngbin0 -> 1150 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/pink@2x.pngbin0 -> 1409 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/purple.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/purple.pngbin0 -> 1132 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/purple@2x.pngbin0 -> 1409 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/red.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/red.pngbin0 -> 1130 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/red@2x.pngbin0 -> 1410 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.pngbin0 -> 1135 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/minimal/yellow@2x.pngbin0 -> 1406 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.pngbin0 -> 6401 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/polaris/polaris@2x.pngbin0 -> 16760 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/_all.css620
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/aero.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/aero.pngbin0 -> 2167 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/aero@2x.pngbin0 -> 4455 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/blue.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/blue.pngbin0 -> 2185 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/blue@2x.pngbin0 -> 4485 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/green.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/green.pngbin0 -> 2193 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/green@2x.pngbin0 -> 4498 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/grey.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/grey.pngbin0 -> 2186 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/grey@2x.pngbin0 -> 4483 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/orange.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/orange.pngbin0 -> 2181 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/orange@2x.pngbin0 -> 4474 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/pink.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/pink.pngbin0 -> 2189 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/pink@2x.pngbin0 -> 4479 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/purple.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/purple.pngbin0 -> 2188 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/purple@2x.pngbin0 -> 4501 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/red.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/red.pngbin0 -> 2190 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/red@2x.pngbin0 -> 4490 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/square.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/square.pngbin0 -> 2175 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/square@2x.pngbin0 -> 4478 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/yellow.css62
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/yellow.pngbin0 -> 2131 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/iCheck/square/yellow@2x.pngbin0 -> 4385 bytes
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.date.extensions.js488
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.extensions.js122
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.js1627
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.numeric.extensions.js177
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.phone.extensions.js50
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.regex.extensions.js169
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-be.json45
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-codes.json294
-rw-r--r--public/bower_components/admin-lte/plugins/input-mask/phone-codes/readme.txt1
-rw-r--r--public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.js16617
-rw-r--r--public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.min.js13
-rw-r--r--public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.css40
-rw-r--r--public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js8
-rw-r--r--public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-usa-en.js1
-rw-r--r--public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js1
-rwxr-xr-xpublic/bower_components/admin-lte/plugins/pace/pace.css85
-rwxr-xr-xpublic/bower_components/admin-lte/plugins/pace/pace.js935
-rwxr-xr-xpublic/bower_components/admin-lte/plugins/pace/pace.min.css1
-rwxr-xr-xpublic/bower_components/admin-lte/plugins/pace/pace.min.js2
-rw-r--r--public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.css121
-rw-r--r--public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.js903
-rw-r--r--public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.css10
-rw-r--r--public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.js5
144 files changed, 44360 insertions, 0 deletions
diff --git a/public/bower_components/admin-lte/plugins/bootstrap-slider/bootstrap-slider.js b/public/bower_components/admin-lte/plugins/bootstrap-slider/bootstrap-slider.js
new file mode 100644
index 0000000..3a0e464
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/bootstrap-slider/bootstrap-slider.js
@@ -0,0 +1,1576 @@
+/*! =========================================================
+ * bootstrap-slider.js
+ *
+ * Maintainers:
+ * Kyle Kemp
+ * - Twitter: @seiyria
+ * - Github: seiyria
+ * Rohit Kalkur
+ * - Twitter: @Rovolutionary
+ * - Github: rovolution
+ *
+ * =========================================================
+ *
+ * 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.
+ * ========================================================= */
+
+
+/**
+ * Bridget makes jQuery widgets
+ * v1.0.1
+ * MIT license
+ */
+
+(function(root, factory) {
+ if(typeof define === "function" && define.amd) {
+ define(["jquery"], factory);
+ }
+ else if(typeof module === "object" && module.exports) {
+ var jQuery;
+ try {
+ jQuery = require("jquery");
+ }
+ catch (err) {
+ jQuery = null;
+ }
+ module.exports = factory(jQuery);
+ }
+ else {
+ root.Slider = factory(root.jQuery);
+ }
+}(this, function($) {
+ // Reference to Slider constructor
+ var Slider;
+
+
+ (function( $ ) {
+
+ 'use strict';
+
+ // -------------------------- utils -------------------------- //
+
+ var slice = Array.prototype.slice;
+
+ function noop() {}
+
+ // -------------------------- definition -------------------------- //
+
+ function defineBridget( $ ) {
+
+ // bail if no jQuery
+ if ( !$ ) {
+ return;
+ }
+
+ // -------------------------- addOptionMethod -------------------------- //
+
+ /**
+ * adds option method -> $().plugin('option', {...})
+ * @param {Function} PluginClass - constructor class
+ */
+ function addOptionMethod( PluginClass ) {
+ // don't overwrite original option method
+ if ( PluginClass.prototype.option ) {
+ return;
+ }
+
+ // option setter
+ PluginClass.prototype.option = function( opts ) {
+ // bail out if not an object
+ if ( !$.isPlainObject( opts ) ){
+ return;
+ }
+ this.options = $.extend( true, this.options, opts );
+ };
+ }
+
+
+ // -------------------------- plugin bridge -------------------------- //
+
+ // helper function for logging errors
+ // $.error breaks jQuery chaining
+ var logError = typeof console === 'undefined' ? noop :
+ function( message ) {
+ console.error( message );
+ };
+
+ /**
+ * jQuery plugin bridge, access methods like $elem.plugin('method')
+ * @param {String} namespace - plugin name
+ * @param {Function} PluginClass - constructor class
+ */
+ function bridge( namespace, PluginClass ) {
+ // add to jQuery fn namespace
+ $.fn[ namespace ] = function( options ) {
+ if ( typeof options === 'string' ) {
+ // call plugin method when first argument is a string
+ // get arguments for method
+ var args = slice.call( arguments, 1 );
+
+ for ( var i=0, len = this.length; i < len; i++ ) {
+ var elem = this[i];
+ var instance = $.data( elem, namespace );
+ if ( !instance ) {
+ logError( "cannot call methods on " + namespace + " prior to initialization; " +
+ "attempted to call '" + options + "'" );
+ continue;
+ }
+ if ( !$.isFunction( instance[options] ) || options.charAt(0) === '_' ) {
+ logError( "no such method '" + options + "' for " + namespace + " instance" );
+ continue;
+ }
+
+ // trigger method with arguments
+ var returnValue = instance[ options ].apply( instance, args);
+
+ // break look and return first value if provided
+ if ( returnValue !== undefined && returnValue !== instance) {
+ return returnValue;
+ }
+ }
+ // return this if no return value
+ return this;
+ } else {
+ var objects = this.map( function() {
+ var instance = $.data( this, namespace );
+ if ( instance ) {
+ // apply options & init
+ instance.option( options );
+ instance._init();
+ } else {
+ // initialize new instance
+ instance = new PluginClass( this, options );
+ $.data( this, namespace, instance );
+ }
+ return $(this);
+ });
+
+ if(!objects || objects.length > 1) {
+ return objects;
+ } else {
+ return objects[0];
+ }
+ }
+ };
+
+ }
+
+ // -------------------------- bridget -------------------------- //
+
+ /**
+ * converts a Prototypical class into a proper jQuery plugin
+ * the class must have a ._init method
+ * @param {String} namespace - plugin name, used in $().pluginName
+ * @param {Function} PluginClass - constructor class
+ */
+ $.bridget = function( namespace, PluginClass ) {
+ addOptionMethod( PluginClass );
+ bridge( namespace, PluginClass );
+ };
+
+ return $.bridget;
+
+ }
+
+ // get jquery from browser global
+ defineBridget( $ );
+
+ })( $ );
+
+
+ /*************************************************
+
+ BOOTSTRAP-SLIDER SOURCE CODE
+
+ **************************************************/
+
+ (function($) {
+
+ var ErrorMsgs = {
+ formatInvalidInputErrorMsg : function(input) {
+ return "Invalid input value '" + input + "' passed in";
+ },
+ callingContextNotSliderInstance : "Calling context element does not have instance of Slider bound to it. Check your code to make sure the JQuery object returned from the call to the slider() initializer is calling the method"
+ };
+
+ var SliderScale = {
+ linear: {
+ toValue: function(percentage) {
+ var rawValue = percentage/100 * (this.options.max - this.options.min);
+ if (this.options.ticks_positions.length > 0) {
+ var minv, maxv, minp, maxp = 0;
+ for (var i = 0; i < this.options.ticks_positions.length; i++) {
+ if (percentage <= this.options.ticks_positions[i]) {
+ minv = (i > 0) ? this.options.ticks[i-1] : 0;
+ minp = (i > 0) ? this.options.ticks_positions[i-1] : 0;
+ maxv = this.options.ticks[i];
+ maxp = this.options.ticks_positions[i];
+
+ break;
+ }
+ }
+ if (i > 0) {
+ var partialPercentage = (percentage - minp) / (maxp - minp);
+ rawValue = minv + partialPercentage * (maxv - minv);
+ }
+ }
+
+ var value = this.options.min + Math.round(rawValue / this.options.step) * this.options.step;
+ if (value < this.options.min) {
+ return this.options.min;
+ } else if (value > this.options.max) {
+ return this.options.max;
+ } else {
+ return value;
+ }
+ },
+ toPercentage: function(value) {
+ if (this.options.max === this.options.min) {
+ return 0;
+ }
+
+ if (this.options.ticks_positions.length > 0) {
+ var minv, maxv, minp, maxp = 0;
+ for (var i = 0; i < this.options.ticks.length; i++) {
+ if (value <= this.options.ticks[i]) {
+ minv = (i > 0) ? this.options.ticks[i-1] : 0;
+ minp = (i > 0) ? this.options.ticks_positions[i-1] : 0;
+ maxv = this.options.ticks[i];
+ maxp = this.options.ticks_positions[i];
+
+ break;
+ }
+ }
+ if (i > 0) {
+ var partialPercentage = (value - minv) / (maxv - minv);
+ return minp + partialPercentage * (maxp - minp);
+ }
+ }
+
+ return 100 * (value - this.options.min) / (this.options.max - this.options.min);
+ }
+ },
+
+ logarithmic: {
+ /* Based on http://stackoverflow.com/questions/846221/logarithmic-slider */
+ toValue: function(percentage) {
+ var min = (this.options.min === 0) ? 0 : Math.log(this.options.min);
+ var max = Math.log(this.options.max);
+ var value = Math.exp(min + (max - min) * percentage / 100);
+ value = this.options.min + Math.round((value - this.options.min) / this.options.step) * this.options.step;
+ /* Rounding to the nearest step could exceed the min or
+ * max, so clip to those values. */
+ if (value < this.options.min) {
+ return this.options.min;
+ } else if (value > this.options.max) {
+ return this.options.max;
+ } else {
+ return value;
+ }
+ },
+ toPercentage: function(value) {
+ if (this.options.max === this.options.min) {
+ return 0;
+ } else {
+ var max = Math.log(this.options.max);
+ var min = this.options.min === 0 ? 0 : Math.log(this.options.min);
+ var v = value === 0 ? 0 : Math.log(value);
+ return 100 * (v - min) / (max - min);
+ }
+ }
+ }
+ };
+
+
+ /*************************************************
+
+ CONSTRUCTOR
+
+ **************************************************/
+ Slider = function(element, options) {
+ createNewSlider.call(this, element, options);
+ return this;
+ };
+
+ function createNewSlider(element, options) {
+
+ /*
+ The internal state object is used to store data about the current 'state' of slider.
+
+ This includes values such as the `value`, `enabled`, etc...
+ */
+ this._state = {
+ value: null,
+ enabled: null,
+ offset: null,
+ size: null,
+ percentage: null,
+ inDrag: false,
+ over: false
+ };
+
+
+ if(typeof element === "string") {
+ this.element = document.querySelector(element);
+ } else if(element instanceof HTMLElement) {
+ this.element = element;
+ }
+
+ /*************************************************
+
+ Process Options
+
+ **************************************************/
+ options = options ? options : {};
+ var optionTypes = Object.keys(this.defaultOptions);
+
+ for(var i = 0; i < optionTypes.length; i++) {
+ var optName = optionTypes[i];
+
+ // First check if an option was passed in via the constructor
+ var val = options[optName];
+ // If no data attrib, then check data atrributes
+ val = (typeof val !== 'undefined') ? val : getDataAttrib(this.element, optName);
+ // Finally, if nothing was specified, use the defaults
+ val = (val !== null) ? val : this.defaultOptions[optName];
+
+ // Set all options on the instance of the Slider
+ if(!this.options) {
+ this.options = {};
+ }
+ this.options[optName] = val;
+ }
+
+ /*
+ Validate `tooltip_position` against 'orientation`
+ - if `tooltip_position` is incompatible with orientation, swith it to a default compatible with specified `orientation`
+ -- default for "vertical" -> "right"
+ -- default for "horizontal" -> "left"
+ */
+ if(this.options.orientation === "vertical" && (this.options.tooltip_position === "top" || this.options.tooltip_position === "bottom")) {
+
+ this.options.tooltip_position = "right";
+
+ }
+ else if(this.options.orientation === "horizontal" && (this.options.tooltip_position === "left" || this.options.tooltip_position === "right")) {
+
+ this.options.tooltip_position = "top";
+
+ }
+
+ function getDataAttrib(element, optName) {
+ var dataName = "data-slider-" + optName.replace(/_/g, '-');
+ var dataValString = element.getAttribute(dataName);
+
+ try {
+ return JSON.parse(dataValString);
+ }
+ catch(err) {
+ return dataValString;
+ }
+ }
+
+ /*************************************************
+
+ Create Markup
+
+ **************************************************/
+
+ var origWidth = this.element.style.width;
+ var updateSlider = false;
+ var parent = this.element.parentNode;
+ var sliderTrackSelection;
+ var sliderTrackLow, sliderTrackHigh;
+ var sliderMinHandle;
+ var sliderMaxHandle;
+
+ if (this.sliderElem) {
+ updateSlider = true;
+ } else {
+ /* Create elements needed for slider */
+ this.sliderElem = document.createElement("div");
+ this.sliderElem.className = "slider";
+
+ /* Create slider track elements */
+ var sliderTrack = document.createElement("div");
+ sliderTrack.className = "slider-track";
+
+ sliderTrackLow = document.createElement("div");
+ sliderTrackLow.className = "slider-track-low";
+
+ sliderTrackSelection = document.createElement("div");
+ sliderTrackSelection.className = "slider-selection";
+
+ sliderTrackHigh = document.createElement("div");
+ sliderTrackHigh.className = "slider-track-high";
+
+ sliderMinHandle = document.createElement("div");
+ sliderMinHandle.className = "slider-handle min-slider-handle";
+ sliderMinHandle.setAttribute('role', 'slider');
+ sliderMinHandle.setAttribute('aria-valuemin', this.options.min);
+ sliderMinHandle.setAttribute('aria-valuemax', this.options.max);
+
+ sliderMaxHandle = document.createElement("div");
+ sliderMaxHandle.className = "slider-handle max-slider-handle";
+ sliderMaxHandle.setAttribute('role', 'slider');
+ sliderMaxHandle.setAttribute('aria-valuemin', this.options.min);
+ sliderMaxHandle.setAttribute('aria-valuemax', this.options.max);
+
+ sliderTrack.appendChild(sliderTrackLow);
+ sliderTrack.appendChild(sliderTrackSelection);
+ sliderTrack.appendChild(sliderTrackHigh);
+
+ /* Add aria-labelledby to handle's */
+ var isLabelledbyArray = Array.isArray(this.options.labelledby);
+ if (isLabelledbyArray && this.options.labelledby[0]) {
+ sliderMinHandle.setAttribute('aria-labelledby', this.options.labelledby[0]);
+ }
+ if (isLabelledbyArray && this.options.labelledby[1]) {
+ sliderMaxHandle.setAttribute('aria-labelledby', this.options.labelledby[1]);
+ }
+ if (!isLabelledbyArray && this.options.labelledby) {
+ sliderMinHandle.setAttribute('aria-labelledby', this.options.labelledby);
+ sliderMaxHandle.setAttribute('aria-labelledby', this.options.labelledby);
+ }
+
+ /* Create ticks */
+ this.ticks = [];
+ if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
+ for (i = 0; i < this.options.ticks.length; i++) {
+ var tick = document.createElement('div');
+ tick.className = 'slider-tick';
+
+ this.ticks.push(tick);
+ sliderTrack.appendChild(tick);
+ }
+
+ sliderTrackSelection.className += " tick-slider-selection";
+ }
+
+ sliderTrack.appendChild(sliderMinHandle);
+ sliderTrack.appendChild(sliderMaxHandle);
+
+ this.tickLabels = [];
+ if (Array.isArray(this.options.ticks_labels) && this.options.ticks_labels.length > 0) {
+ this.tickLabelContainer = document.createElement('div');
+ this.tickLabelContainer.className = 'slider-tick-label-container';
+
+ for (i = 0; i < this.options.ticks_labels.length; i++) {
+ var label = document.createElement('div');
+ var noTickPositionsSpecified = this.options.ticks_positions.length === 0;
+ var tickLabelsIndex = (this.options.reversed && noTickPositionsSpecified) ? (this.options.ticks_labels.length - (i + 1)) : i;
+ label.className = 'slider-tick-label';
+ label.innerHTML = this.options.ticks_labels[tickLabelsIndex];
+
+ this.tickLabels.push(label);
+ this.tickLabelContainer.appendChild(label);
+ }
+ }
+
+
+ var createAndAppendTooltipSubElements = function(tooltipElem) {
+ var arrow = document.createElement("div");
+ arrow.className = "tooltip-arrow";
+
+ var inner = document.createElement("div");
+ inner.className = "tooltip-inner";
+
+ tooltipElem.appendChild(arrow);
+ tooltipElem.appendChild(inner);
+
+ };
+
+ /* Create tooltip elements */
+ var sliderTooltip = document.createElement("div");
+ sliderTooltip.className = "tooltip tooltip-main";
+ sliderTooltip.setAttribute('role', 'presentation');
+ createAndAppendTooltipSubElements(sliderTooltip);
+
+ var sliderTooltipMin = document.createElement("div");
+ sliderTooltipMin.className = "tooltip tooltip-min";
+ sliderTooltipMin.setAttribute('role', 'presentation');
+ createAndAppendTooltipSubElements(sliderTooltipMin);
+
+ var sliderTooltipMax = document.createElement("div");
+ sliderTooltipMax.className = "tooltip tooltip-max";
+ sliderTooltipMax.setAttribute('role', 'presentation');
+ createAndAppendTooltipSubElements(sliderTooltipMax);
+
+
+ /* Append components to sliderElem */
+ this.sliderElem.appendChild(sliderTrack);
+ this.sliderElem.appendChild(sliderTooltip);
+ this.sliderElem.appendChild(sliderTooltipMin);
+ this.sliderElem.appendChild(sliderTooltipMax);
+
+ if (this.tickLabelContainer) {
+ this.sliderElem.appendChild(this.tickLabelContainer);
+ }
+
+ /* Append slider element to parent container, right before the original <input> element */
+ parent.insertBefore(this.sliderElem, this.element);
+
+ /* Hide original <input> element */
+ this.element.style.display = "none";
+ }
+ /* If JQuery exists, cache JQ references */
+ if($) {
+ this.$element = $(this.element);
+ this.$sliderElem = $(this.sliderElem);
+ }
+
+ /*************************************************
+
+ Setup
+
+ **************************************************/
+ this.eventToCallbackMap = {};
+ this.sliderElem.id = this.options.id;
+
+ this.touchCapable = 'ontouchstart' in window || (window.DocumentTouch && document instanceof window.DocumentTouch);
+
+ this.tooltip = this.sliderElem.querySelector('.tooltip-main');
+ this.tooltipInner = this.tooltip.querySelector('.tooltip-inner');
+
+ this.tooltip_min = this.sliderElem.querySelector('.tooltip-min');
+ this.tooltipInner_min = this.tooltip_min.querySelector('.tooltip-inner');
+
+ this.tooltip_max = this.sliderElem.querySelector('.tooltip-max');
+ this.tooltipInner_max= this.tooltip_max.querySelector('.tooltip-inner');
+
+ if (SliderScale[this.options.scale]) {
+ this.options.scale = SliderScale[this.options.scale];
+ }
+
+ if (updateSlider === true) {
+ // Reset classes
+ this._removeClass(this.sliderElem, 'slider-horizontal');
+ this._removeClass(this.sliderElem, 'slider-vertical');
+ this._removeClass(this.tooltip, 'hide');
+ this._removeClass(this.tooltip_min, 'hide');
+ this._removeClass(this.tooltip_max, 'hide');
+
+ // Undo existing inline styles for track
+ ["left", "top", "width", "height"].forEach(function(prop) {
+ this._removeProperty(this.trackLow, prop);
+ this._removeProperty(this.trackSelection, prop);
+ this._removeProperty(this.trackHigh, prop);
+ }, this);
+
+ // Undo inline styles on handles
+ [this.handle1, this.handle2].forEach(function(handle) {
+ this._removeProperty(handle, 'left');
+ this._removeProperty(handle, 'top');
+ }, this);
+
+ // Undo inline styles and classes on tooltips
+ [this.tooltip, this.tooltip_min, this.tooltip_max].forEach(function(tooltip) {
+ this._removeProperty(tooltip, 'left');
+ this._removeProperty(tooltip, 'top');
+ this._removeProperty(tooltip, 'margin-left');
+ this._removeProperty(tooltip, 'margin-top');
+
+ this._removeClass(tooltip, 'right');
+ this._removeClass(tooltip, 'top');
+ }, this);
+ }
+
+ if(this.options.orientation === 'vertical') {
+ this._addClass(this.sliderElem,'slider-vertical');
+ this.stylePos = 'top';
+ this.mousePos = 'pageY';
+ this.sizePos = 'offsetHeight';
+ } else {
+ this._addClass(this.sliderElem, 'slider-horizontal');
+ this.sliderElem.style.width = origWidth;
+ this.options.orientation = 'horizontal';
+ this.stylePos = 'left';
+ this.mousePos = 'pageX';
+ this.sizePos = 'offsetWidth';
+
+ }
+ this._setTooltipPosition();
+ /* In case ticks are specified, overwrite the min and max bounds */
+ if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
+ this.options.max = Math.max.apply(Math, this.options.ticks);
+ this.options.min = Math.min.apply(Math, this.options.ticks);
+ }
+
+ if (Array.isArray(this.options.value)) {
+ this.options.range = true;
+ this._state.value = this.options.value;
+ }
+ else if (this.options.range) {
+ // User wants a range, but value is not an array
+ this._state.value = [this.options.value, this.options.max];
+ }
+ else {
+ this._state.value = this.options.value;
+ }
+
+ this.trackLow = sliderTrackLow || this.trackLow;
+ this.trackSelection = sliderTrackSelection || this.trackSelection;
+ this.trackHigh = sliderTrackHigh || this.trackHigh;
+
+ if (this.options.selection === 'none') {
+ this._addClass(this.trackLow, 'hide');
+ this._addClass(this.trackSelection, 'hide');
+ this._addClass(this.trackHigh, 'hide');
+ }
+
+ this.handle1 = sliderMinHandle || this.handle1;
+ this.handle2 = sliderMaxHandle || this.handle2;
+
+ if (updateSlider === true) {
+ // Reset classes
+ this._removeClass(this.handle1, 'round triangle');
+ this._removeClass(this.handle2, 'round triangle hide');
+
+ for (i = 0; i < this.ticks.length; i++) {
+ this._removeClass(this.ticks[i], 'round triangle hide');
+ }
+ }
+
+ var availableHandleModifiers = ['round', 'triangle', 'custom'];
+ var isValidHandleType = availableHandleModifiers.indexOf(this.options.handle) !== -1;
+ if (isValidHandleType) {
+ this._addClass(this.handle1, this.options.handle);
+ this._addClass(this.handle2, this.options.handle);
+
+ for (i = 0; i < this.ticks.length; i++) {
+ this._addClass(this.ticks[i], this.options.handle);
+ }
+ }
+
+ this._state.offset = this._offset(this.sliderElem);
+ this._state.size = this.sliderElem[this.sizePos];
+ this.setValue(this._state.value);
+
+ /******************************************
+
+ Bind Event Listeners
+
+ ******************************************/
+
+ // Bind keyboard handlers
+ this.handle1Keydown = this._keydown.bind(this, 0);
+ this.handle1.addEventListener("keydown", this.handle1Keydown, false);
+
+ this.handle2Keydown = this._keydown.bind(this, 1);
+ this.handle2.addEventListener("keydown", this.handle2Keydown, false);
+
+ this.mousedown = this._mousedown.bind(this);
+ if (this.touchCapable) {
+ // Bind touch handlers
+ this.sliderElem.addEventListener("touchstart", this.mousedown, false);
+ }
+ this.sliderElem.addEventListener("mousedown", this.mousedown, false);
+
+
+ // Bind tooltip-related handlers
+ if(this.options.tooltip === 'hide') {
+ this._addClass(this.tooltip, 'hide');
+ this._addClass(this.tooltip_min, 'hide');
+ this._addClass(this.tooltip_max, 'hide');
+ }
+ else if(this.options.tooltip === 'always') {
+ this._showTooltip();
+ this._alwaysShowTooltip = true;
+ }
+ else {
+ this.showTooltip = this._showTooltip.bind(this);
+ this.hideTooltip = this._hideTooltip.bind(this);
+
+ this.sliderElem.addEventListener("mouseenter", this.showTooltip, false);
+ this.sliderElem.addEventListener("mouseleave", this.hideTooltip, false);
+
+ this.handle1.addEventListener("focus", this.showTooltip, false);
+ this.handle1.addEventListener("blur", this.hideTooltip, false);
+
+ this.handle2.addEventListener("focus", this.showTooltip, false);
+ this.handle2.addEventListener("blur", this.hideTooltip, false);
+ }
+
+ if(this.options.enabled) {
+ this.enable();
+ } else {
+ this.disable();
+ }
+ }
+
+
+
+ /*************************************************
+
+ INSTANCE PROPERTIES/METHODS
+
+ - Any methods bound to the prototype are considered
+ part of the plugin's `public` interface
+
+ **************************************************/
+ Slider.prototype = {
+ _init: function() {}, // NOTE: Must exist to support bridget
+
+ constructor: Slider,
+
+ defaultOptions: {
+ id: "",
+ min: 0,
+ max: 10,
+ step: 1,
+ precision: 0,
+ orientation: 'horizontal',
+ value: 5,
+ range: false,
+ selection: 'before',
+ tooltip: 'show',
+ tooltip_split: false,
+ handle: 'round',
+ reversed: false,
+ enabled: true,
+ formatter: function(val) {
+ if (Array.isArray(val)) {
+ return val[0] + " : " + val[1];
+ } else {
+ return val;
+ }
+ },
+ natural_arrow_keys: false,
+ ticks: [],
+ ticks_positions: [],
+ ticks_labels: [],
+ ticks_snap_bounds: 0,
+ scale: 'linear',
+ focus: false,
+ tooltip_position: null,
+ labelledby: null
+ },
+
+ getElement: function() {
+ return this.sliderElem;
+ },
+
+ getValue: function() {
+ if (this.options.range) {
+ return this._state.value;
+ }
+ else {
+ return this._state.value[0];
+ }
+ },
+
+ setValue: function(val, triggerSlideEvent, triggerChangeEvent) {
+ if (!val) {
+ val = 0;
+ }
+ var oldValue = this.getValue();
+ this._state.value = this._validateInputValue(val);
+ var applyPrecision = this._applyPrecision.bind(this);
+
+ if (this.options.range) {
+ this._state.value[0] = applyPrecision(this._state.value[0]);
+ this._state.value[1] = applyPrecision(this._state.value[1]);
+
+ this._state.value[0] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[0]));
+ this._state.value[1] = Math.max(this.options.min, Math.min(this.options.max, this._state.value[1]));
+ }
+ else {
+ this._state.value = applyPrecision(this._state.value);
+ this._state.value = [ Math.max(this.options.min, Math.min(this.options.max, this._state.value))];
+ this._addClass(this.handle2, 'hide');
+ if (this.options.selection === 'after') {
+ this._state.value[1] = this.options.max;
+ } else {
+ this._state.value[1] = this.options.min;
+ }
+ }
+
+ if (this.options.max > this.options.min) {
+ this._state.percentage = [
+ this._toPercentage(this._state.value[0]),
+ this._toPercentage(this._state.value[1]),
+ this.options.step * 100 / (this.options.max - this.options.min)
+ ];
+ } else {
+ this._state.percentage = [0, 0, 100];
+ }
+
+ this._layout();
+ var newValue = this.options.range ? this._state.value : this._state.value[0];
+
+ if(triggerSlideEvent === true) {
+ this._trigger('slide', newValue);
+ }
+ if( (oldValue !== newValue) && (triggerChangeEvent === true) ) {
+ this._trigger('change', {
+ oldValue: oldValue,
+ newValue: newValue
+ });
+ }
+ this._setDataVal(newValue);
+
+ return this;
+ },
+
+ destroy: function(){
+ // Remove event handlers on slider elements
+ this._removeSliderEventHandlers();
+
+ // Remove the slider from the DOM
+ this.sliderElem.parentNode.removeChild(this.sliderElem);
+ /* Show original <input> element */
+ this.element.style.display = "";
+
+ // Clear out custom event bindings
+ this._cleanUpEventCallbacksMap();
+
+ // Remove data values
+ this.element.removeAttribute("data");
+
+ // Remove JQuery handlers/data
+ if($) {
+ this._unbindJQueryEventHandlers();
+ this.$element.removeData('slider');
+ }
+ },
+
+ disable: function() {
+ this._state.enabled = false;
+ this.handle1.removeAttribute("tabindex");
+ this.handle2.removeAttribute("tabindex");
+ this._addClass(this.sliderElem, 'slider-disabled');
+ this._trigger('slideDisabled');
+
+ return this;
+ },
+
+ enable: function() {
+ this._state.enabled = true;
+ this.handle1.setAttribute("tabindex", 0);
+ this.handle2.setAttribute("tabindex", 0);
+ this._removeClass(this.sliderElem, 'slider-disabled');
+ this._trigger('slideEnabled');
+
+ return this;
+ },
+
+ toggle: function() {
+ if(this._state.enabled) {
+ this.disable();
+ } else {
+ this.enable();
+ }
+ return this;
+ },
+
+ isEnabled: function() {
+ return this._state.enabled;
+ },
+
+ on: function(evt, callback) {
+ this._bindNonQueryEventHandler(evt, callback);
+ return this;
+ },
+
+ off: function(evt, callback) {
+ if($) {
+ this.$element.off(evt, callback);
+ this.$sliderElem.off(evt, callback);
+ } else {
+ this._unbindNonQueryEventHandler(evt, callback);
+ }
+ },
+
+ getAttribute: function(attribute) {
+ if(attribute) {
+ return this.options[attribute];
+ } else {
+ return this.options;
+ }
+ },
+
+ setAttribute: function(attribute, value) {
+ this.options[attribute] = value;
+ return this;
+ },
+
+ refresh: function() {
+ this._removeSliderEventHandlers();
+ createNewSlider.call(this, this.element, this.options);
+ if($) {
+ // Bind new instance of slider to the element
+ $.data(this.element, 'slider', this);
+ }
+ return this;
+ },
+
+ relayout: function() {
+ this._layout();
+ return this;
+ },
+
+ /******************************+
+
+ HELPERS
+
+ - Any method that is not part of the public interface.
+ - Place it underneath this comment block and write its signature like so:
+
+ _fnName : function() {...}
+
+ ********************************/
+ _removeSliderEventHandlers: function() {
+ // Remove keydown event listeners
+ this.handle1.removeEventListener("keydown", this.handle1Keydown, false);
+ this.handle2.removeEventListener("keydown", this.handle2Keydown, false);
+
+ if (this.showTooltip) {
+ this.handle1.removeEventListener("focus", this.showTooltip, false);
+ this.handle2.removeEventListener("focus", this.showTooltip, false);
+ }
+ if (this.hideTooltip) {
+ this.handle1.removeEventListener("blur", this.hideTooltip, false);
+ this.handle2.removeEventListener("blur", this.hideTooltip, false);
+ }
+
+ // Remove event listeners from sliderElem
+ if (this.showTooltip) {
+ this.sliderElem.removeEventListener("mouseenter", this.showTooltip, false);
+ }
+ if (this.hideTooltip) {
+ this.sliderElem.removeEventListener("mouseleave", this.hideTooltip, false);
+ }
+ this.sliderElem.removeEventListener("touchstart", this.mousedown, false);
+ this.sliderElem.removeEventListener("mousedown", this.mousedown, false);
+ },
+ _bindNonQueryEventHandler: function(evt, callback) {
+ if(this.eventToCallbackMap[evt] === undefined) {
+ this.eventToCallbackMap[evt] = [];
+ }
+ this.eventToCallbackMap[evt].push(callback);
+ },
+ _unbindNonQueryEventHandler: function(evt, callback) {
+ var callbacks = this.eventToCallbackMap[evt];
+ if(callbacks !== undefined) {
+ for (var i = 0; i < callbacks.length; i++) {
+ if (callbacks[i] === callback) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
+ }
+ },
+ _cleanUpEventCallbacksMap: function() {
+ var eventNames = Object.keys(this.eventToCallbackMap);
+ for(var i = 0; i < eventNames.length; i++) {
+ var eventName = eventNames[i];
+ this.eventToCallbackMap[eventName] = null;
+ }
+ },
+ _showTooltip: function() {
+ if (this.options.tooltip_split === false ){
+ this._addClass(this.tooltip, 'in');
+ this.tooltip_min.style.display = 'none';
+ this.tooltip_max.style.display = 'none';
+ } else {
+ this._addClass(this.tooltip_min, 'in');
+ this._addClass(this.tooltip_max, 'in');
+ this.tooltip.style.display = 'none';
+ }
+ this._state.over = true;
+ },
+ _hideTooltip: function() {
+ if (this._state.inDrag === false && this.alwaysShowTooltip !== true) {
+ this._removeClass(this.tooltip, 'in');
+ this._removeClass(this.tooltip_min, 'in');
+ this._removeClass(this.tooltip_max, 'in');
+ }
+ this._state.over = false;
+ },
+ _layout: function() {
+ var positionPercentages;
+
+ if(this.options.reversed) {
+ positionPercentages = [ 100 - this._state.percentage[0], this.options.range ? 100 - this._state.percentage[1] : this._state.percentage[1]];
+ }
+ else {
+ positionPercentages = [ this._state.percentage[0], this._state.percentage[1] ];
+ }
+
+ this.handle1.style[this.stylePos] = positionPercentages[0]+'%';
+ this.handle1.setAttribute('aria-valuenow', this._state.value[0]);
+
+ this.handle2.style[this.stylePos] = positionPercentages[1]+'%';
+ this.handle2.setAttribute('aria-valuenow', this._state.value[1]);
+
+ /* Position ticks and labels */
+ if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
+
+ var styleSize = this.options.orientation === 'vertical' ? 'height' : 'width';
+ var styleMargin = this.options.orientation === 'vertical' ? 'marginTop' : 'marginLeft';
+ var labelSize = this._state.size / (this.options.ticks.length - 1);
+
+ if (this.tickLabelContainer) {
+ var extraMargin = 0;
+ if (this.options.ticks_positions.length === 0) {
+ if (this.options.orientation !== 'vertical') {
+ this.tickLabelContainer.style[styleMargin] = -labelSize/2 + 'px';
+ }
+
+ extraMargin = this.tickLabelContainer.offsetHeight;
+ } else {
+ /* Chidren are position absolute, calculate height by finding the max offsetHeight of a child */
+ for (i = 0 ; i < this.tickLabelContainer.childNodes.length; i++) {
+ if (this.tickLabelContainer.childNodes[i].offsetHeight > extraMargin) {
+ extraMargin = this.tickLabelContainer.childNodes[i].offsetHeight;
+ }
+ }
+ }
+ if (this.options.orientation === 'horizontal') {
+ this.sliderElem.style.marginBottom = extraMargin + 'px';
+ }
+ }
+ for (var i = 0; i < this.options.ticks.length; i++) {
+
+ var percentage = this.options.ticks_positions[i] || this._toPercentage(this.options.ticks[i]);
+
+ if (this.options.reversed) {
+ percentage = 100 - percentage;
+ }
+
+ this.ticks[i].style[this.stylePos] = percentage + '%';
+
+ /* Set class labels to denote whether ticks are in the selection */
+ this._removeClass(this.ticks[i], 'in-selection');
+ if (!this.options.range) {
+ if (this.options.selection === 'after' && percentage >= positionPercentages[0]){
+ this._addClass(this.ticks[i], 'in-selection');
+ } else if (this.options.selection === 'before' && percentage <= positionPercentages[0]) {
+ this._addClass(this.ticks[i], 'in-selection');
+ }
+ } else if (percentage >= positionPercentages[0] && percentage <= positionPercentages[1]) {
+ this._addClass(this.ticks[i], 'in-selection');
+ }
+
+ if (this.tickLabels[i]) {
+ this.tickLabels[i].style[styleSize] = labelSize + 'px';
+
+ if (this.options.orientation !== 'vertical' && this.options.ticks_positions[i] !== undefined) {
+ this.tickLabels[i].style.position = 'absolute';
+ this.tickLabels[i].style[this.stylePos] = percentage + '%';
+ this.tickLabels[i].style[styleMargin] = -labelSize/2 + 'px';
+ } else if (this.options.orientation === 'vertical') {
+ this.tickLabels[i].style['marginLeft'] = this.sliderElem.offsetWidth + 'px';
+ this.tickLabelContainer.style['marginTop'] = this.sliderElem.offsetWidth / 2 * -1 + 'px';
+ }
+ }
+ }
+ }
+
+ var formattedTooltipVal;
+
+ if (this.options.range) {
+ formattedTooltipVal = this.options.formatter(this._state.value);
+ this._setText(this.tooltipInner, formattedTooltipVal);
+ this.tooltip.style[this.stylePos] = (positionPercentages[1] + positionPercentages[0])/2 + '%';
+
+ if (this.options.orientation === 'vertical') {
+ this._css(this.tooltip, 'margin-top', -this.tooltip.offsetHeight / 2 + 'px');
+ } else {
+ this._css(this.tooltip, 'margin-left', -this.tooltip.offsetWidth / 2 + 'px');
+ }
+
+ if (this.options.orientation === 'vertical') {
+ this._css(this.tooltip, 'margin-top', -this.tooltip.offsetHeight / 2 + 'px');
+ } else {
+ this._css(this.tooltip, 'margin-left', -this.tooltip.offsetWidth / 2 + 'px');
+ }
+
+ var innerTooltipMinText = this.options.formatter(this._state.value[0]);
+ this._setText(this.tooltipInner_min, innerTooltipMinText);
+
+ var innerTooltipMaxText = this.options.formatter(this._state.value[1]);
+ this._setText(this.tooltipInner_max, innerTooltipMaxText);
+
+ this.tooltip_min.style[this.stylePos] = positionPercentages[0] + '%';
+
+ if (this.options.orientation === 'vertical') {
+ this._css(this.tooltip_min, 'margin-top', -this.tooltip_min.offsetHeight / 2 + 'px');
+ } else {
+ this._css(this.tooltip_min, 'margin-left', -this.tooltip_min.offsetWidth / 2 + 'px');
+ }
+
+ this.tooltip_max.style[this.stylePos] = positionPercentages[1] + '%';
+
+ if (this.options.orientation === 'vertical') {
+ this._css(this.tooltip_max, 'margin-top', -this.tooltip_max.offsetHeight / 2 + 'px');
+ } else {
+ this._css(this.tooltip_max, 'margin-left', -this.tooltip_max.offsetWidth / 2 + 'px');
+ }
+ } else {
+ formattedTooltipVal = this.options.formatter(this._state.value[0]);
+ this._setText(this.tooltipInner, formattedTooltipVal);
+
+ this.tooltip.style[this.stylePos] = positionPercentages[0] + '%';
+ if (this.options.orientation === 'vertical') {
+ this._css(this.tooltip, 'margin-top', -this.tooltip.offsetHeight / 2 + 'px');
+ } else {
+ this._css(this.tooltip, 'margin-left', -this.tooltip.offsetWidth / 2 + 'px');
+ }
+ }
+
+ if (this.options.orientation === 'vertical') {
+ this.trackLow.style.top = '0';
+ this.trackLow.style.height = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
+
+ this.trackSelection.style.top = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
+ this.trackSelection.style.height = Math.abs(positionPercentages[0] - positionPercentages[1]) +'%';
+
+ this.trackHigh.style.bottom = '0';
+ this.trackHigh.style.height = (100 - Math.min(positionPercentages[0], positionPercentages[1]) - Math.abs(positionPercentages[0] - positionPercentages[1])) +'%';
+ }
+ else {
+ this.trackLow.style.left = '0';
+ this.trackLow.style.width = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
+
+ this.trackSelection.style.left = Math.min(positionPercentages[0], positionPercentages[1]) +'%';
+ this.trackSelection.style.width = Math.abs(positionPercentages[0] - positionPercentages[1]) +'%';
+
+ this.trackHigh.style.right = '0';
+ this.trackHigh.style.width = (100 - Math.min(positionPercentages[0], positionPercentages[1]) - Math.abs(positionPercentages[0] - positionPercentages[1])) +'%';
+
+ var offset_min = this.tooltip_min.getBoundingClientRect();
+ var offset_max = this.tooltip_max.getBoundingClientRect();
+
+ if (offset_min.right > offset_max.left) {
+ this._removeClass(this.tooltip_max, 'top');
+ this._addClass(this.tooltip_max, 'bottom');
+ this.tooltip_max.style.top = 18 + 'px';
+ } else {
+ this._removeClass(this.tooltip_max, 'bottom');
+ this._addClass(this.tooltip_max, 'top');
+ this.tooltip_max.style.top = this.tooltip_min.style.top;
+ }
+ }
+ },
+ _removeProperty: function(element, prop) {
+ if (element.style.removeProperty) {
+ element.style.removeProperty(prop);
+ } else {
+ element.style.removeAttribute(prop);
+ }
+ },
+ _mousedown: function(ev) {
+ if(!this._state.enabled) {
+ return false;
+ }
+
+ this._state.offset = this._offset(this.sliderElem);
+ this._state.size = this.sliderElem[this.sizePos];
+
+ var percentage = this._getPercentage(ev);
+
+ if (this.options.range) {
+ var diff1 = Math.abs(this._state.percentage[0] - percentage);
+ var diff2 = Math.abs(this._state.percentage[1] - percentage);
+ this._state.dragged = (diff1 < diff2) ? 0 : 1;
+ } else {
+ this._state.dragged = 0;
+ }
+
+ this._state.percentage[this._state.dragged] = percentage;
+ this._layout();
+
+ if (this.touchCapable) {
+ document.removeEventListener("touchmove", this.mousemove, false);
+ document.removeEventListener("touchend", this.mouseup, false);
+ }
+
+ if(this.mousemove){
+ document.removeEventListener("mousemove", this.mousemove, false);
+ }
+ if(this.mouseup){
+ document.removeEventListener("mouseup", this.mouseup, false);
+ }
+
+ this.mousemove = this._mousemove.bind(this);
+ this.mouseup = this._mouseup.bind(this);
+
+ if (this.touchCapable) {
+ // Touch: Bind touch events:
+ document.addEventListener("touchmove", this.mousemove, false);
+ document.addEventListener("touchend", this.mouseup, false);
+ }
+ // Bind mouse events:
+ document.addEventListener("mousemove", this.mousemove, false);
+ document.addEventListener("mouseup", this.mouseup, false);
+
+ this._state.inDrag = true;
+ var newValue = this._calculateValue();
+
+ this._trigger('slideStart', newValue);
+
+ this._setDataVal(newValue);
+ this.setValue(newValue, false, true);
+
+ this._pauseEvent(ev);
+
+ if (this.options.focus) {
+ this._triggerFocusOnHandle(this._state.dragged);
+ }
+
+ return true;
+ },
+ _triggerFocusOnHandle: function(handleIdx) {
+ if(handleIdx === 0) {
+ this.handle1.focus();
+ }
+ if(handleIdx === 1) {
+ this.handle2.focus();
+ }
+ },
+ _keydown: function(handleIdx, ev) {
+ if(!this._state.enabled) {
+ return false;
+ }
+
+ var dir;
+ switch (ev.keyCode) {
+ case 37: // left
+ case 40: // down
+ dir = -1;
+ break;
+ case 39: // right
+ case 38: // up
+ dir = 1;
+ break;
+ }
+ if (!dir) {
+ return;
+ }
+
+ // use natural arrow keys instead of from min to max
+ if (this.options.natural_arrow_keys) {
+ var ifVerticalAndNotReversed = (this.options.orientation === 'vertical' && !this.options.reversed);
+ var ifHorizontalAndReversed = (this.options.orientation === 'horizontal' && this.options.reversed);
+
+ if (ifVerticalAndNotReversed || ifHorizontalAndReversed) {
+ dir = -dir;
+ }
+ }
+
+ var val = this._state.value[handleIdx] + dir * this.options.step;
+ if (this.options.range) {
+ val = [ (!handleIdx) ? val : this._state.value[0],
+ ( handleIdx) ? val : this._state.value[1]];
+ }
+
+ this._trigger('slideStart', val);
+ this._setDataVal(val);
+ this.setValue(val, true, true);
+
+ this._setDataVal(val);
+ this._trigger('slideStop', val);
+ this._layout();
+
+ this._pauseEvent(ev);
+
+ return false;
+ },
+ _pauseEvent: function(ev) {
+ if(ev.stopPropagation) {
+ ev.stopPropagation();
+ }
+ if(ev.preventDefault) {
+ ev.preventDefault();
+ }
+ ev.cancelBubble=true;
+ ev.returnValue=false;
+ },
+ _mousemove: function(ev) {
+ if(!this._state.enabled) {
+ return false;
+ }
+
+ var percentage = this._getPercentage(ev);
+ this._adjustPercentageForRangeSliders(percentage);
+ this._state.percentage[this._state.dragged] = percentage;
+ this._layout();
+
+ var val = this._calculateValue(true);
+ this.setValue(val, true, true);
+
+ return false;
+ },
+ _adjustPercentageForRangeSliders: function(percentage) {
+ if (this.options.range) {
+ var precision = this._getNumDigitsAfterDecimalPlace(percentage);
+ precision = precision ? precision - 1 : 0;
+ var percentageWithAdjustedPrecision = this._applyToFixedAndParseFloat(percentage, precision);
+ if (this._state.dragged === 0 && this._applyToFixedAndParseFloat(this._state.percentage[1], precision) < percentageWithAdjustedPrecision) {
+ this._state.percentage[0] = this._state.percentage[1];
+ this._state.dragged = 1;
+ } else if (this._state.dragged === 1 && this._applyToFixedAndParseFloat(this._state.percentage[0], precision) > percentageWithAdjustedPrecision) {
+ this._state.percentage[1] = this._state.percentage[0];
+ this._state.dragged = 0;
+ }
+ }
+ },
+ _mouseup: function() {
+ if(!this._state.enabled) {
+ return false;
+ }
+ if (this.touchCapable) {
+ // Touch: Unbind touch event handlers:
+ document.removeEventListener("touchmove", this.mousemove, false);
+ document.removeEventListener("touchend", this.mouseup, false);
+ }
+ // Unbind mouse event handlers:
+ document.removeEventListener("mousemove", this.mousemove, false);
+ document.removeEventListener("mouseup", this.mouseup, false);
+
+ this._state.inDrag = false;
+ if (this._state.over === false) {
+ this._hideTooltip();
+ }
+ var val = this._calculateValue(true);
+
+ this._layout();
+ this._setDataVal(val);
+ this._trigger('slideStop', val);
+
+ return false;
+ },
+ _calculateValue: function(snapToClosestTick) {
+ var val;
+ if (this.options.range) {
+ val = [this.options.min,this.options.max];
+ if (this._state.percentage[0] !== 0){
+ val[0] = this._toValue(this._state.percentage[0]);
+ val[0] = this._applyPrecision(val[0]);
+ }
+ if (this._state.percentage[1] !== 100){
+ val[1] = this._toValue(this._state.percentage[1]);
+ val[1] = this._applyPrecision(val[1]);
+ }
+ } else {
+ val = this._toValue(this._state.percentage[0]);
+ val = parseFloat(val);
+ val = this._applyPrecision(val);
+ }
+
+ if (snapToClosestTick) {
+ var min = [val, Infinity];
+ for (var i = 0; i < this.options.ticks.length; i++) {
+ var diff = Math.abs(this.options.ticks[i] - val);
+ if (diff <= min[1]) {
+ min = [this.options.ticks[i], diff];
+ }
+ }
+ if (min[1] <= this.options.ticks_snap_bounds) {
+ return min[0];
+ }
+ }
+
+ return val;
+ },
+ _applyPrecision: function(val) {
+ var precision = this.options.precision || this._getNumDigitsAfterDecimalPlace(this.options.step);
+ return this._applyToFixedAndParseFloat(val, precision);
+ },
+ _getNumDigitsAfterDecimalPlace: function(num) {
+ var match = (''+num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
+ if (!match) { return 0; }
+ return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));
+ },
+ _applyToFixedAndParseFloat: function(num, toFixedInput) {
+ var truncatedNum = num.toFixed(toFixedInput);
+ return parseFloat(truncatedNum);
+ },
+ /*
+ Credits to Mike Samuel for the following method!
+ Source: http://stackoverflow.com/questions/10454518/javascript-how-to-retrieve-the-number-of-decimals-of-a-string-number
+ */
+ _getPercentage: function(ev) {
+ if (this.touchCapable && (ev.type === 'touchstart' || ev.type === 'touchmove')) {
+ ev = ev.touches[0];
+ }
+
+ var eventPosition = ev[this.mousePos];
+ var sliderOffset = this._state.offset[this.stylePos];
+ var distanceToSlide = eventPosition - sliderOffset;
+ // Calculate what percent of the length the slider handle has slid
+ var percentage = (distanceToSlide / this._state.size) * 100;
+ percentage = Math.round(percentage / this._state.percentage[2]) * this._state.percentage[2];
+ if (this.options.reversed) {
+ percentage = 100 - percentage;
+ }
+
+ // Make sure the percent is within the bounds of the slider.
+ // 0% corresponds to the 'min' value of the slide
+ // 100% corresponds to the 'max' value of the slide
+ return Math.max(0, Math.min(100, percentage));
+ },
+ _validateInputValue: function(val) {
+ if (typeof val === 'number') {
+ return val;
+ } else if (Array.isArray(val)) {
+ this._validateArray(val);
+ return val;
+ } else {
+ throw new Error( ErrorMsgs.formatInvalidInputErrorMsg(val) );
+ }
+ },
+ _validateArray: function(val) {
+ for(var i = 0; i < val.length; i++) {
+ var input = val[i];
+ if (typeof input !== 'number') { throw new Error( ErrorMsgs.formatInvalidInputErrorMsg(input) ); }
+ }
+ },
+ _setDataVal: function(val) {
+ this.element.setAttribute('data-value', val);
+ this.element.setAttribute('value', val);
+ this.element.value = val;
+ },
+ _trigger: function(evt, val) {
+ val = (val || val === 0) ? val : undefined;
+
+ var callbackFnArray = this.eventToCallbackMap[evt];
+ if(callbackFnArray && callbackFnArray.length) {
+ for(var i = 0; i < callbackFnArray.length; i++) {
+ var callbackFn = callbackFnArray[i];
+ callbackFn(val);
+ }
+ }
+
+ /* If JQuery exists, trigger JQuery events */
+ if($) {
+ this._triggerJQueryEvent(evt, val);
+ }
+ },
+ _triggerJQueryEvent: function(evt, val) {
+ var eventData = {
+ type: evt,
+ value: val
+ };
+ this.$element.trigger(eventData);
+ this.$sliderElem.trigger(eventData);
+ },
+ _unbindJQueryEventHandlers: function() {
+ this.$element.off();
+ this.$sliderElem.off();
+ },
+ _setText: function(element, text) {
+ if(typeof element.innerText !== "undefined") {
+ element.innerText = text;
+ } else if(typeof element.textContent !== "undefined") {
+ element.textContent = text;
+ }
+ },
+ _removeClass: function(element, classString) {
+ var classes = classString.split(" ");
+ var newClasses = element.className;
+
+ for(var i = 0; i < classes.length; i++) {
+ var classTag = classes[i];
+ var regex = new RegExp("(?:\\s|^)" + classTag + "(?:\\s|$)");
+ newClasses = newClasses.replace(regex, " ");
+ }
+
+ element.className = newClasses.trim();
+ },
+ _addClass: function(element, classString) {
+ var classes = classString.split(" ");
+ var newClasses = element.className;
+
+ for(var i = 0; i < classes.length; i++) {
+ var classTag = classes[i];
+ var regex = new RegExp("(?:\\s|^)" + classTag + "(?:\\s|$)");
+ var ifClassExists = regex.test(newClasses);
+
+ if(!ifClassExists) {
+ newClasses += " " + classTag;
+ }
+ }
+
+ element.className = newClasses.trim();
+ },
+ _offsetLeft: function(obj){
+ return obj.getBoundingClientRect().left;
+ },
+ _offsetTop: function(obj){
+ var offsetTop = obj.offsetTop;
+ while((obj = obj.offsetParent) && !isNaN(obj.offsetTop)){
+ offsetTop += obj.offsetTop;
+ }
+ return offsetTop;
+ },
+ _offset: function (obj) {
+ return {
+ left: this._offsetLeft(obj),
+ top: this._offsetTop(obj)
+ };
+ },
+ _css: function(elementRef, styleName, value) {
+ if ($) {
+ $.style(elementRef, styleName, value);
+ } else {
+ var style = styleName.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function (all, letter) {
+ return letter.toUpperCase();
+ });
+ elementRef.style[style] = value;
+ }
+ },
+ _toValue: function(percentage) {
+ return this.options.scale.toValue.apply(this, [percentage]);
+ },
+ _toPercentage: function(value) {
+ return this.options.scale.toPercentage.apply(this, [value]);
+ },
+ _setTooltipPosition: function(){
+ var tooltips = [this.tooltip, this.tooltip_min, this.tooltip_max];
+ if (this.options.orientation === 'vertical'){
+ var tooltipPos = this.options.tooltip_position || 'right';
+ var oppositeSide = (tooltipPos === 'left') ? 'right' : 'left';
+ tooltips.forEach(function(tooltip){
+ this._addClass(tooltip, tooltipPos);
+ tooltip.style[oppositeSide] = '100%';
+ }.bind(this));
+ } else if(this.options.tooltip_position === 'bottom') {
+ tooltips.forEach(function(tooltip){
+ this._addClass(tooltip, 'bottom');
+ tooltip.style.top = 22 + 'px';
+ }.bind(this));
+ } else {
+ tooltips.forEach(function(tooltip){
+ this._addClass(tooltip, 'top');
+ tooltip.style.top = -this.tooltip.outerHeight - 14 + 'px';
+ }.bind(this));
+ }
+ }
+ };
+
+ /*********************************
+
+ Attach to global namespace
+
+ *********************************/
+ if($) {
+ var namespace = $.fn.slider ? 'bootstrapSlider' : 'slider';
+ $.bridget(namespace, Slider);
+ }
+
+ })( $ );
+
+ return Slider;
+}));
diff --git a/public/bower_components/admin-lte/plugins/bootstrap-slider/slider.css b/public/bower_components/admin-lte/plugins/bootstrap-slider/slider.css
new file mode 100644
index 0000000..3a64928
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/bootstrap-slider/slider.css
@@ -0,0 +1,282 @@
+/*!
+ * Slider for Bootstrap
+ *
+ * Copyright 2012 Stefan Petre
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ */
+.slider {
+ display: block;
+ vertical-align: middle;
+ position: relative;
+
+}
+.slider.slider-horizontal {
+ width: 100%;
+ height: 20px;
+ margin-bottom: 20px;
+}
+.slider.slider-horizontal:last-of-type {
+ margin-bottom: 0;
+}
+.slider.slider-horizontal .slider-track {
+ height: 10px;
+ width: 100%;
+ margin-top: -5px;
+ top: 50%;
+ left: 0;
+}
+.slider.slider-horizontal .slider-selection,
+.slider.slider-horizontal .slider-track-low,
+.slider.slider-horizontal .slider-track-high {
+ height: 100%;
+ top: 0;
+ bottom: 0;
+}
+.slider.slider-horizontal .slider-tick,
+.slider.slider-horizontal .slider-handle {
+ margin-left: -10px;
+ margin-top: -5px;
+}
+.slider.slider-horizontal .slider-tick.triangle,
+.slider.slider-horizontal .slider-handle.triangle {
+ border-width: 0 10px 10px 10px;
+ width: 0;
+ height: 0;
+ border-bottom-color: #0480be;
+ margin-top: 0;
+}
+.slider.slider-horizontal .slider-tick-label-container {
+ white-space: nowrap;
+ margin-top: 20px;
+}
+.slider.slider-horizontal .slider-tick-label-container .slider-tick-label {
+ padding-top: 4px;
+ display: inline-block;
+ text-align: center;
+}
+.slider.slider-vertical {
+ height: 230px;
+ width: 20px;
+ margin-right: 20px;
+ display: inline-block;
+}
+.slider.slider-vertical:last-of-type {
+ margin-right: 0;
+}
+.slider.slider-vertical .slider-track {
+ width: 10px;
+ height: 100%;
+ margin-left: -5px;
+ left: 50%;
+ top: 0;
+}
+.slider.slider-vertical .slider-selection {
+ width: 100%;
+ left: 0;
+ top: 0;
+ bottom: 0;
+}
+.slider.slider-vertical .slider-track-low,
+.slider.slider-vertical .slider-track-high {
+ width: 100%;
+ left: 0;
+ right: 0;
+}
+.slider.slider-vertical .slider-tick,
+.slider.slider-vertical .slider-handle {
+ margin-left: -5px;
+ margin-top: -10px;
+}
+.slider.slider-vertical .slider-tick.triangle,
+.slider.slider-vertical .slider-handle.triangle {
+ border-width: 10px 0 10px 10px;
+ width: 1px;
+ height: 1px;
+ border-left-color: #0480be;
+ margin-left: 0;
+}
+.slider.slider-vertical .slider-tick-label-container {
+ white-space: nowrap;
+}
+.slider.slider-vertical .slider-tick-label-container .slider-tick-label {
+ padding-left: 4px;
+}
+.slider.slider-disabled .slider-handle {
+ background-image: -webkit-linear-gradient(top, #dfdfdf 0%, #bebebe 100%);
+ background-image: -o-linear-gradient(top, #dfdfdf 0%, #bebebe 100%);
+ background-image: linear-gradient(to bottom, #dfdfdf 0%, #bebebe 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdfdfdf', endColorstr='#ffbebebe', GradientType=0);
+}
+.slider.slider-disabled .slider-track {
+ background-image: -webkit-linear-gradient(top, #e5e5e5 0%, #e9e9e9 100%);
+ background-image: -o-linear-gradient(top, #e5e5e5 0%, #e9e9e9 100%);
+ background-image: linear-gradient(to bottom, #e5e5e5 0%, #e9e9e9 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe5e5e5', endColorstr='#ffe9e9e9', GradientType=0);
+ cursor: not-allowed;
+}
+.slider input {
+ display: none;
+}
+.slider .tooltip.top {
+ margin-top: -36px;
+}
+.slider .tooltip-inner {
+ white-space: nowrap;
+}
+.slider .hide {
+ display: none;
+}
+.slider-track {
+ position: absolute;
+ cursor: pointer;
+ background-color: #f7f7f7;
+ background-image: -moz-linear-gradient(top, #f0f0f0, #f9f9f9);
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f0f0f0), to(#f9f9f9));
+ background-image: -webkit-linear-gradient(top, #f0f0f0, #f9f9f9);
+ background-image: -o-linear-gradient(top, #f0f0f0, #f9f9f9);
+ background-image: linear-gradient(to bottom, #f0f0f0, #f9f9f9);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0f0f0', endColorstr='#fff9f9f9', GradientType=0);
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+.slider-selection {
+ position: absolute;
+ background-color: #f7f7f7;
+ background-image: -moz-linear-gradient(top, #f9f9f9, #f5f5f5);
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f9f9f9), to(#f5f5f5));
+ background-image: -webkit-linear-gradient(top, #f9f9f9, #f5f5f5);
+ background-image: -o-linear-gradient(top, #f9f9f9, #f5f5f5);
+ background-image: linear-gradient(to bottom, #f9f9f9, #f5f5f5);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0);
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+.slider-selection.tick-slider-selection {
+ background-image: -webkit-linear-gradient(top, #89cdef 0%, #81bfde 100%);
+ background-image: -o-linear-gradient(top, #89cdef 0%, #81bfde 100%);
+ background-image: linear-gradient(to bottom, #89cdef 0%, #81bfde 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff89cdef', endColorstr='#ff81bfde', GradientType=0);
+}
+.slider-track-low,
+.slider-track-high {
+ position: absolute;
+ background: transparent;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ border-radius: 4px;
+}
+.slider-handle {
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ background-color: #444;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
+ -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);
+ opacity: 1;
+ border: 0px solid transparent;
+}
+.slider-handle.round {
+ -webkit-border-radius: 20px;
+ -moz-border-radius: 20px;
+ border-radius: 20px;
+}
+.slider-handle.triangle {
+ background: transparent none;
+}
+.slider-handle.custom {
+ background: transparent none;
+}
+.slider-handle.custom::before {
+ line-height: 20px;
+ font-size: 20px;
+ content: '\2605';
+ color: #726204;
+}
+.slider-tick {
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ background-image: -webkit-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
+ background-image: -o-linear-gradient(top, #f9f9f9 0%, #f5f5f5 100%);
+ background-image: linear-gradient(to bottom, #f9f9f9 0%, #f5f5f5 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f9f9', endColorstr='#fff5f5f5', GradientType=0);
+ -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ filter: none;
+ opacity: 0.8;
+ border: 0px solid transparent;
+}
+.slider-tick.round {
+ border-radius: 50%;
+}
+.slider-tick.triangle {
+ background: transparent none;
+}
+.slider-tick.custom {
+ background: transparent none;
+}
+.slider-tick.custom::before {
+ line-height: 20px;
+ font-size: 20px;
+ content: '\2605';
+ color: #726204;
+}
+.slider-tick.in-selection {
+ background-image: -webkit-linear-gradient(top, #89cdef 0%, #81bfde 100%);
+ background-image: -o-linear-gradient(top, #89cdef 0%, #81bfde 100%);
+ background-image: linear-gradient(to bottom, #89cdef 0%, #81bfde 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff89cdef', endColorstr='#ff81bfde', GradientType=0);
+ opacity: 1;
+}
+.slider-disabled .slider-selection {
+ opacity: 0.5;
+}
+
+#red .slider-selection {
+ background: #f56954;
+}
+
+#blue .slider-selection {
+ background: #3c8dbc;
+}
+
+#green .slider-selection {
+ background: #00a65a;
+}
+
+#yellow .slider-selection {
+ background: #f39c12;
+}
+
+#aqua .slider-selection {
+ background: #00c0ef;
+}
+
+#purple .slider-selection {
+ background: #932ab6;
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
new file mode 100644
index 0000000..acccf91
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.js
@@ -0,0 +1,14975 @@
+// TODO: in future try to replace most inline compability checks with polyfills for code readability
+
+// element.textContent polyfill.
+// Unsupporting browsers: IE8
+
+if (Object.defineProperty && Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(Element.prototype, "textContent") && !Object.getOwnPropertyDescriptor(Element.prototype, "textContent").get) {
+ (function() {
+ var innerText = Object.getOwnPropertyDescriptor(Element.prototype, "innerText");
+ Object.defineProperty(Element.prototype, "textContent",
+ {
+ get: function() {
+ return innerText.get.call(this);
+ },
+ set: function(s) {
+ return innerText.set.call(this, s);
+ }
+ }
+ );
+ })();
+}
+
+// isArray polyfill for ie8
+if(!Array.isArray) {
+ Array.isArray = function(arg) {
+ return Object.prototype.toString.call(arg) === '[object Array]';
+ };
+};/**
+ * @license wysihtml5x v0.4.15
+ * https://github.com/Edicy/wysihtml5
+ *
+ * Author: Christopher Blum (https://github.com/tiff)
+ * Secondary author of extended features: Oliver Pulges (https://github.com/pulges)
+ *
+ * Copyright (C) 2012 XING AG
+ * Licensed under the MIT license (MIT)
+ *
+ */
+var wysihtml5 = {
+ version: "0.4.15",
+
+ // namespaces
+ commands: {},
+ dom: {},
+ quirks: {},
+ toolbar: {},
+ lang: {},
+ selection: {},
+ views: {},
+
+ INVISIBLE_SPACE: "\uFEFF",
+
+ EMPTY_FUNCTION: function() {},
+
+ ELEMENT_NODE: 1,
+ TEXT_NODE: 3,
+
+ BACKSPACE_KEY: 8,
+ ENTER_KEY: 13,
+ ESCAPE_KEY: 27,
+ SPACE_KEY: 32,
+ DELETE_KEY: 46
+};
+;/**
+ * Rangy, a cross-browser JavaScript range and selection library
+ * http://code.google.com/p/rangy/
+ *
+ * Copyright 2014, Tim Down
+ * Licensed under the MIT license.
+ * Version: 1.3alpha.20140804
+ * Build date: 4 August 2014
+ */
+
+(function(factory, global) {
+ if (typeof define == "function" && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(factory);
+/*
+ TODO: look into this properly.
+
+ } else if (typeof exports == "object") {
+ // Node/CommonJS style for Browserify
+ module.exports = factory;
+*/
+ } else {
+ // No AMD or CommonJS support so we place Rangy in a global variable
+ global.rangy = factory();
+ }
+})(function() {
+
+ var OBJECT = "object", FUNCTION = "function", UNDEFINED = "undefined";
+
+ // Minimal set of properties required for DOM Level 2 Range compliance. Comparison constants such as START_TO_START
+ // are omitted because ranges in KHTML do not have them but otherwise work perfectly well. See issue 113.
+ var domRangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
+ "commonAncestorContainer"];
+
+ // Minimal set of methods required for DOM Level 2 Range compliance
+ var domRangeMethods = ["setStart", "setStartBefore", "setStartAfter", "setEnd", "setEndBefore",
+ "setEndAfter", "collapse", "selectNode", "selectNodeContents", "compareBoundaryPoints", "deleteContents",
+ "extractContents", "cloneContents", "insertNode", "surroundContents", "cloneRange", "toString", "detach"];
+
+ var textRangeProperties = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"];
+
+ // Subset of TextRange's full set of methods that we're interested in
+ var textRangeMethods = ["collapse", "compareEndPoints", "duplicate", "moveToElementText", "parentElement", "select",
+ "setEndPoint", "getBoundingClientRect"];
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Trio of functions taken from Peter Michaux's article:
+ // http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
+ function isHostMethod(o, p) {
+ var t = typeof o[p];
+ return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == "unknown";
+ }
+
+ function isHostObject(o, p) {
+ return !!(typeof o[p] == OBJECT && o[p]);
+ }
+
+ function isHostProperty(o, p) {
+ return typeof o[p] != UNDEFINED;
+ }
+
+ // Creates a convenience function to save verbose repeated calls to tests functions
+ function createMultiplePropertyTest(testFunc) {
+ return function(o, props) {
+ var i = props.length;
+ while (i--) {
+ if (!testFunc(o, props[i])) {
+ return false;
+ }
+ }
+ return true;
+ };
+ }
+
+ // Next trio of functions are a convenience to save verbose repeated calls to previous two functions
+ var areHostMethods = createMultiplePropertyTest(isHostMethod);
+ var areHostObjects = createMultiplePropertyTest(isHostObject);
+ var areHostProperties = createMultiplePropertyTest(isHostProperty);
+
+ function isTextRange(range) {
+ return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);
+ }
+
+ function getBody(doc) {
+ return isHostObject(doc, "body") ? doc.body : doc.getElementsByTagName("body")[0];
+ }
+
+ var modules = {};
+
+ var api = {
+ version: "1.3alpha.20140804",
+ initialized: false,
+ supported: true,
+
+ util: {
+ isHostMethod: isHostMethod,
+ isHostObject: isHostObject,
+ isHostProperty: isHostProperty,
+ areHostMethods: areHostMethods,
+ areHostObjects: areHostObjects,
+ areHostProperties: areHostProperties,
+ isTextRange: isTextRange,
+ getBody: getBody
+ },
+
+ features: {},
+
+ modules: modules,
+ config: {
+ alertOnFail: true,
+ alertOnWarn: false,
+ preferTextRange: false,
+ autoInitialize: (typeof rangyAutoInitialize == UNDEFINED) ? true : rangyAutoInitialize
+ }
+ };
+
+ function consoleLog(msg) {
+ if (isHostObject(window, "console") && isHostMethod(window.console, "log")) {
+ window.console.log(msg);
+ }
+ }
+
+ function alertOrLog(msg, shouldAlert) {
+ if (shouldAlert) {
+ window.alert(msg);
+ } else {
+ consoleLog(msg);
+ }
+ }
+
+ function fail(reason) {
+ api.initialized = true;
+ api.supported = false;
+ alertOrLog("Rangy is not supported on this page in your browser. Reason: " + reason, api.config.alertOnFail);
+ }
+
+ api.fail = fail;
+
+ function warn(msg) {
+ alertOrLog("Rangy warning: " + msg, api.config.alertOnWarn);
+ }
+
+ api.warn = warn;
+
+ // Add utility extend() method
+ if ({}.hasOwnProperty) {
+ api.util.extend = function(obj, props, deep) {
+ var o, p;
+ for (var i in props) {
+ if (props.hasOwnProperty(i)) {
+ o = obj[i];
+ p = props[i];
+ if (deep && o !== null && typeof o == "object" && p !== null && typeof p == "object") {
+ api.util.extend(o, p, true);
+ }
+ obj[i] = p;
+ }
+ }
+ // Special case for toString, which does not show up in for...in loops in IE <= 8
+ if (props.hasOwnProperty("toString")) {
+ obj.toString = props.toString;
+ }
+ return obj;
+ };
+ } else {
+ fail("hasOwnProperty not supported");
+ }
+
+ // Test whether Array.prototype.slice can be relied on for NodeLists and use an alternative toArray() if not
+ (function() {
+ var el = document.createElement("div");
+ el.appendChild(document.createElement("span"));
+ var slice = [].slice;
+ var toArray;
+ try {
+ if (slice.call(el.childNodes, 0)[0].nodeType == 1) {
+ toArray = function(arrayLike) {
+ return slice.call(arrayLike, 0);
+ };
+ }
+ } catch (e) {}
+
+ if (!toArray) {
+ toArray = function(arrayLike) {
+ var arr = [];
+ for (var i = 0, len = arrayLike.length; i < len; ++i) {
+ arr[i] = arrayLike[i];
+ }
+ return arr;
+ };
+ }
+
+ api.util.toArray = toArray;
+ })();
+
+
+ // Very simple event handler wrapper function that doesn't attempt to solve issues such as "this" handling or
+ // normalization of event properties
+ var addListener;
+ if (isHostMethod(document, "addEventListener")) {
+ addListener = function(obj, eventType, listener) {
+ obj.addEventListener(eventType, listener, false);
+ };
+ } else if (isHostMethod(document, "attachEvent")) {
+ addListener = function(obj, eventType, listener) {
+ obj.attachEvent("on" + eventType, listener);
+ };
+ } else {
+ fail("Document does not have required addEventListener or attachEvent method");
+ }
+
+ api.util.addListener = addListener;
+
+ var initListeners = [];
+
+ function getErrorDesc(ex) {
+ return ex.message || ex.description || String(ex);
+ }
+
+ // Initialization
+ function init() {
+ if (api.initialized) {
+ return;
+ }
+ var testRange;
+ var implementsDomRange = false, implementsTextRange = false;
+
+ // First, perform basic feature tests
+
+ if (isHostMethod(document, "createRange")) {
+ testRange = document.createRange();
+ if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {
+ implementsDomRange = true;
+ }
+ }
+
+ var body = getBody(document);
+ if (!body || body.nodeName.toLowerCase() != "body") {
+ fail("No body element found");
+ return;
+ }
+
+ if (body && isHostMethod(body, "createTextRange")) {
+ testRange = body.createTextRange();
+ if (isTextRange(testRange)) {
+ implementsTextRange = true;
+ }
+ }
+
+ if (!implementsDomRange && !implementsTextRange) {
+ fail("Neither Range nor TextRange are available");
+ return;
+ }
+
+ api.initialized = true;
+ api.features = {
+ implementsDomRange: implementsDomRange,
+ implementsTextRange: implementsTextRange
+ };
+
+ // Initialize modules
+ var module, errorMessage;
+ for (var moduleName in modules) {
+ if ( (module = modules[moduleName]) instanceof Module ) {
+ module.init(module, api);
+ }
+ }
+
+ // Call init listeners
+ for (var i = 0, len = initListeners.length; i < len; ++i) {
+ try {
+ initListeners[i](api);
+ } catch (ex) {
+ errorMessage = "Rangy init listener threw an exception. Continuing. Detail: " + getErrorDesc(ex);
+ consoleLog(errorMessage);
+ }
+ }
+ }
+
+ // Allow external scripts to initialize this library in case it's loaded after the document has loaded
+ api.init = init;
+
+ // Execute listener immediately if already initialized
+ api.addInitListener = function(listener) {
+ if (api.initialized) {
+ listener(api);
+ } else {
+ initListeners.push(listener);
+ }
+ };
+
+ var shimListeners = [];
+
+ api.addShimListener = function(listener) {
+ shimListeners.push(listener);
+ };
+
+ function shim(win) {
+ win = win || window;
+ init();
+
+ // Notify listeners
+ for (var i = 0, len = shimListeners.length; i < len; ++i) {
+ shimListeners[i](win);
+ }
+ }
+
+ api.shim = api.createMissingNativeApi = shim;
+
+ function Module(name, dependencies, initializer) {
+ this.name = name;
+ this.dependencies = dependencies;
+ this.initialized = false;
+ this.supported = false;
+ this.initializer = initializer;
+ }
+
+ Module.prototype = {
+ init: function() {
+ var requiredModuleNames = this.dependencies || [];
+ for (var i = 0, len = requiredModuleNames.length, requiredModule, moduleName; i < len; ++i) {
+ moduleName = requiredModuleNames[i];
+
+ requiredModule = modules[moduleName];
+ if (!requiredModule || !(requiredModule instanceof Module)) {
+ throw new Error("required module '" + moduleName + "' not found");
+ }
+
+ requiredModule.init();
+
+ if (!requiredModule.supported) {
+ throw new Error("required module '" + moduleName + "' not supported");
+ }
+ }
+
+ // Now run initializer
+ this.initializer(this);
+ },
+
+ fail: function(reason) {
+ this.initialized = true;
+ this.supported = false;
+ throw new Error("Module '" + this.name + "' failed to load: " + reason);
+ },
+
+ warn: function(msg) {
+ api.warn("Module " + this.name + ": " + msg);
+ },
+
+ deprecationNotice: function(deprecated, replacement) {
+ api.warn("DEPRECATED: " + deprecated + " in module " + this.name + "is deprecated. Please use " +
+ replacement + " instead");
+ },
+
+ createError: function(msg) {
+ return new Error("Error in Rangy " + this.name + " module: " + msg);
+ }
+ };
+
+ function createModule(isCore, name, dependencies, initFunc) {
+ var newModule = new Module(name, dependencies, function(module) {
+ if (!module.initialized) {
+ module.initialized = true;
+ try {
+ initFunc(api, module);
+ module.supported = true;
+ } catch (ex) {
+ var errorMessage = "Module '" + name + "' failed to load: " + getErrorDesc(ex);
+ consoleLog(errorMessage);
+ }
+ }
+ });
+ modules[name] = newModule;
+ }
+
+ api.createModule = function(name) {
+ // Allow 2 or 3 arguments (second argument is an optional array of dependencies)
+ var initFunc, dependencies;
+ if (arguments.length == 2) {
+ initFunc = arguments[1];
+ dependencies = [];
+ } else {
+ initFunc = arguments[2];
+ dependencies = arguments[1];
+ }
+
+ var module = createModule(false, name, dependencies, initFunc);
+
+ // Initialize the module immediately if the core is already initialized
+ if (api.initialized) {
+ module.init();
+ }
+ };
+
+ api.createCoreModule = function(name, dependencies, initFunc) {
+ createModule(true, name, dependencies, initFunc);
+ };
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately
+
+ function RangePrototype() {}
+ api.RangePrototype = RangePrototype;
+ api.rangePrototype = new RangePrototype();
+
+ function SelectionPrototype() {}
+ api.selectionPrototype = new SelectionPrototype();
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Wait for document to load before running tests
+
+ var docReady = false;
+
+ var loadHandler = function(e) {
+ if (!docReady) {
+ docReady = true;
+ if (!api.initialized && api.config.autoInitialize) {
+ init();
+ }
+ }
+ };
+
+ // Test whether we have window and document objects that we will need
+ if (typeof window == UNDEFINED) {
+ fail("No window found");
+ return;
+ }
+ if (typeof document == UNDEFINED) {
+ fail("No document found");
+ return;
+ }
+
+ if (isHostMethod(document, "addEventListener")) {
+ document.addEventListener("DOMContentLoaded", loadHandler, false);
+ }
+
+ // Add a fallback in case the DOMContentLoaded event isn't supported
+ addListener(window, "load", loadHandler);
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // DOM utility methods used by Rangy
+ api.createCoreModule("DomUtil", [], function(api, module) {
+ var UNDEF = "undefined";
+ var util = api.util;
+
+ // Perform feature tests
+ if (!util.areHostMethods(document, ["createDocumentFragment", "createElement", "createTextNode"])) {
+ module.fail("document missing a Node creation method");
+ }
+
+ if (!util.isHostMethod(document, "getElementsByTagName")) {
+ module.fail("document missing getElementsByTagName method");
+ }
+
+ var el = document.createElement("div");
+ if (!util.areHostMethods(el, ["insertBefore", "appendChild", "cloneNode"] ||
+ !util.areHostObjects(el, ["previousSibling", "nextSibling", "childNodes", "parentNode"]))) {
+ module.fail("Incomplete Element implementation");
+ }
+
+ // innerHTML is required for Range's createContextualFragment method
+ if (!util.isHostProperty(el, "innerHTML")) {
+ module.fail("Element is missing innerHTML property");
+ }
+
+ var textNode = document.createTextNode("test");
+ if (!util.areHostMethods(textNode, ["splitText", "deleteData", "insertData", "appendData", "cloneNode"] ||
+ !util.areHostObjects(el, ["previousSibling", "nextSibling", "childNodes", "parentNode"]) ||
+ !util.areHostProperties(textNode, ["data"]))) {
+ module.fail("Incomplete Text Node implementation");
+ }
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Removed use of indexOf because of a bizarre bug in Opera that is thrown in one of the Acid3 tests. I haven't been
+ // able to replicate it outside of the test. The bug is that indexOf returns -1 when called on an Array that
+ // contains just the document as a single element and the value searched for is the document.
+ var arrayContains = /*Array.prototype.indexOf ?
+ function(arr, val) {
+ return arr.indexOf(val) > -1;
+ }:*/
+
+ function(arr, val) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === val) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ // Opera 11 puts HTML elements in the null namespace, it seems, and IE 7 has undefined namespaceURI
+ function isHtmlNamespace(node) {
+ var ns;
+ return typeof node.namespaceURI == UNDEF || ((ns = node.namespaceURI) === null || ns == "http://www.w3.org/1999/xhtml");
+ }
+
+ function parentElement(node) {
+ var parent = node.parentNode;
+ return (parent.nodeType == 1) ? parent : null;
+ }
+
+ function getNodeIndex(node) {
+ var i = 0;
+ while( (node = node.previousSibling) ) {
+ ++i;
+ }
+ return i;
+ }
+
+ function getNodeLength(node) {
+ switch (node.nodeType) {
+ case 7:
+ case 10:
+ return 0;
+ case 3:
+ case 8:
+ return node.length;
+ default:
+ return node.childNodes.length;
+ }
+ }
+
+ function getCommonAncestor(node1, node2) {
+ var ancestors = [], n;
+ for (n = node1; n; n = n.parentNode) {
+ ancestors.push(n);
+ }
+
+ for (n = node2; n; n = n.parentNode) {
+ if (arrayContains(ancestors, n)) {
+ return n;
+ }
+ }
+
+ return null;
+ }
+
+ function isAncestorOf(ancestor, descendant, selfIsAncestor) {
+ var n = selfIsAncestor ? descendant : descendant.parentNode;
+ while (n) {
+ if (n === ancestor) {
+ return true;
+ } else {
+ n = n.parentNode;
+ }
+ }
+ return false;
+ }
+
+ function isOrIsAncestorOf(ancestor, descendant) {
+ return isAncestorOf(ancestor, descendant, true);
+ }
+
+ function getClosestAncestorIn(node, ancestor, selfIsAncestor) {
+ var p, n = selfIsAncestor ? node : node.parentNode;
+ while (n) {
+ p = n.parentNode;
+ if (p === ancestor) {
+ return n;
+ }
+ n = p;
+ }
+ return null;
+ }
+
+ function isCharacterDataNode(node) {
+ var t = node.nodeType;
+ return t == 3 || t == 4 || t == 8 ; // Text, CDataSection or Comment
+ }
+
+ function isTextOrCommentNode(node) {
+ if (!node) {
+ return false;
+ }
+ var t = node.nodeType;
+ return t == 3 || t == 8 ; // Text or Comment
+ }
+
+ function insertAfter(node, precedingNode) {
+ var nextNode = precedingNode.nextSibling, parent = precedingNode.parentNode;
+ if (nextNode) {
+ parent.insertBefore(node, nextNode);
+ } else {
+ parent.appendChild(node);
+ }
+ return node;
+ }
+
+ // Note that we cannot use splitText() because it is bugridden in IE 9.
+ function splitDataNode(node, index, positionsToPreserve) {
+ var newNode = node.cloneNode(false);
+ newNode.deleteData(0, index);
+ node.deleteData(index, node.length - index);
+ insertAfter(newNode, node);
+
+ // Preserve positions
+ if (positionsToPreserve) {
+ for (var i = 0, position; position = positionsToPreserve[i++]; ) {
+ // Handle case where position was inside the portion of node after the split point
+ if (position.node == node && position.offset > index) {
+ position.node = newNode;
+ position.offset -= index;
+ }
+ // Handle the case where the position is a node offset within node's parent
+ else if (position.node == node.parentNode && position.offset > getNodeIndex(node)) {
+ ++position.offset;
+ }
+ }
+ }
+ return newNode;
+ }
+
+ function getDocument(node) {
+ if (node.nodeType == 9) {
+ return node;
+ } else if (typeof node.ownerDocument != UNDEF) {
+ return node.ownerDocument;
+ } else if (typeof node.document != UNDEF) {
+ return node.document;
+ } else if (node.parentNode) {
+ return getDocument(node.parentNode);
+ } else {
+ throw module.createError("getDocument: no document found for node");
+ }
+ }
+
+ function getWindow(node) {
+ var doc = getDocument(node);
+ if (typeof doc.defaultView != UNDEF) {
+ return doc.defaultView;
+ } else if (typeof doc.parentWindow != UNDEF) {
+ return doc.parentWindow;
+ } else {
+ throw module.createError("Cannot get a window object for node");
+ }
+ }
+
+ function getIframeDocument(iframeEl) {
+ if (typeof iframeEl.contentDocument != UNDEF) {
+ return iframeEl.contentDocument;
+ } else if (typeof iframeEl.contentWindow != UNDEF) {
+ return iframeEl.contentWindow.document;
+ } else {
+ throw module.createError("getIframeDocument: No Document object found for iframe element");
+ }
+ }
+
+ function getIframeWindow(iframeEl) {
+ if (typeof iframeEl.contentWindow != UNDEF) {
+ return iframeEl.contentWindow;
+ } else if (typeof iframeEl.contentDocument != UNDEF) {
+ return iframeEl.contentDocument.defaultView;
+ } else {
+ throw module.createError("getIframeWindow: No Window object found for iframe element");
+ }
+ }
+
+ // This looks bad. Is it worth it?
+ function isWindow(obj) {
+ return obj && util.isHostMethod(obj, "setTimeout") && util.isHostObject(obj, "document");
+ }
+
+ function getContentDocument(obj, module, methodName) {
+ var doc;
+
+ if (!obj) {
+ doc = document;
+ }
+
+ // Test if a DOM node has been passed and obtain a document object for it if so
+ else if (util.isHostProperty(obj, "nodeType")) {
+ doc = (obj.nodeType == 1 && obj.tagName.toLowerCase() == "iframe") ?
+ getIframeDocument(obj) : getDocument(obj);
+ }
+
+ // Test if the doc parameter appears to be a Window object
+ else if (isWindow(obj)) {
+ doc = obj.document;
+ }
+
+ if (!doc) {
+ throw module.createError(methodName + "(): Parameter must be a Window object or DOM node");
+ }
+
+ return doc;
+ }
+
+ function getRootContainer(node) {
+ var parent;
+ while ( (parent = node.parentNode) ) {
+ node = parent;
+ }
+ return node;
+ }
+
+ function comparePoints(nodeA, offsetA, nodeB, offsetB) {
+ // See http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Comparing
+ var nodeC, root, childA, childB, n;
+ if (nodeA == nodeB) {
+ // Case 1: nodes are the same
+ return offsetA === offsetB ? 0 : (offsetA < offsetB) ? -1 : 1;
+ } else if ( (nodeC = getClosestAncestorIn(nodeB, nodeA, true)) ) {
+ // Case 2: node C (container B or an ancestor) is a child node of A
+ return offsetA <= getNodeIndex(nodeC) ? -1 : 1;
+ } else if ( (nodeC = getClosestAncestorIn(nodeA, nodeB, true)) ) {
+ // Case 3: node C (container A or an ancestor) is a child node of B
+ return getNodeIndex(nodeC) < offsetB ? -1 : 1;
+ } else {
+ root = getCommonAncestor(nodeA, nodeB);
+ if (!root) {
+ throw new Error("comparePoints error: nodes have no common ancestor");
+ }
+
+ // Case 4: containers are siblings or descendants of siblings
+ childA = (nodeA === root) ? root : getClosestAncestorIn(nodeA, root, true);
+ childB = (nodeB === root) ? root : getClosestAncestorIn(nodeB, root, true);
+
+ if (childA === childB) {
+ // This shouldn't be possible
+ throw module.createError("comparePoints got to case 4 and childA and childB are the same!");
+ } else {
+ n = root.firstChild;
+ while (n) {
+ if (n === childA) {
+ return -1;
+ } else if (n === childB) {
+ return 1;
+ }
+ n = n.nextSibling;
+ }
+ }
+ }
+ }
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Test for IE's crash (IE 6/7) or exception (IE >= 8) when a reference to garbage-collected text node is queried
+ var crashyTextNodes = false;
+
+ function isBrokenNode(node) {
+ var n;
+ try {
+ n = node.parentNode;
+ return false;
+ } catch (e) {
+ return true;
+ }
+ }
+
+ (function() {
+ var el = document.createElement("b");
+ el.innerHTML = "1";
+ var textNode = el.firstChild;
+ el.innerHTML = "<br>";
+ crashyTextNodes = isBrokenNode(textNode);
+
+ api.features.crashyTextNodes = crashyTextNodes;
+ })();
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ function inspectNode(node) {
+ if (!node) {
+ return "[No node]";
+ }
+ if (crashyTextNodes && isBrokenNode(node)) {
+ return "[Broken node]";
+ }
+ if (isCharacterDataNode(node)) {
+ return '"' + node.data + '"';
+ }
+ if (node.nodeType == 1) {
+ var idAttr = node.id ? ' id="' + node.id + '"' : "";
+ return "<" + node.nodeName + idAttr + ">[index:" + getNodeIndex(node) + ",length:" + node.childNodes.length + "][" + (node.innerHTML || "[innerHTML not supported]").slice(0, 25) + "]";
+ }
+ return node.nodeName;
+ }
+
+ function fragmentFromNodeChildren(node) {
+ var fragment = getDocument(node).createDocumentFragment(), child;
+ while ( (child = node.firstChild) ) {
+ fragment.appendChild(child);
+ }
+ return fragment;
+ }
+
+ var getComputedStyleProperty;
+ if (typeof window.getComputedStyle != UNDEF) {
+ getComputedStyleProperty = function(el, propName) {
+ return getWindow(el).getComputedStyle(el, null)[propName];
+ };
+ } else if (typeof document.documentElement.currentStyle != UNDEF) {
+ getComputedStyleProperty = function(el, propName) {
+ return el.currentStyle[propName];
+ };
+ } else {
+ module.fail("No means of obtaining computed style properties found");
+ }
+
+ function NodeIterator(root) {
+ this.root = root;
+ this._next = root;
+ }
+
+ NodeIterator.prototype = {
+ _current: null,
+
+ hasNext: function() {
+ return !!this._next;
+ },
+
+ next: function() {
+ var n = this._current = this._next;
+ var child, next;
+ if (this._current) {
+ child = n.firstChild;
+ if (child) {
+ this._next = child;
+ } else {
+ next = null;
+ while ((n !== this.root) && !(next = n.nextSibling)) {
+ n = n.parentNode;
+ }
+ this._next = next;
+ }
+ }
+ return this._current;
+ },
+
+ detach: function() {
+ this._current = this._next = this.root = null;
+ }
+ };
+
+ function createIterator(root) {
+ return new NodeIterator(root);
+ }
+
+ function DomPosition(node, offset) {
+ this.node = node;
+ this.offset = offset;
+ }
+
+ DomPosition.prototype = {
+ equals: function(pos) {
+ return !!pos && this.node === pos.node && this.offset == pos.offset;
+ },
+
+ inspect: function() {
+ return "[DomPosition(" + inspectNode(this.node) + ":" + this.offset + ")]";
+ },
+
+ toString: function() {
+ return this.inspect();
+ }
+ };
+
+ function DOMException(codeName) {
+ this.code = this[codeName];
+ this.codeName = codeName;
+ this.message = "DOMException: " + this.codeName;
+ }
+
+ DOMException.prototype = {
+ INDEX_SIZE_ERR: 1,
+ HIERARCHY_REQUEST_ERR: 3,
+ WRONG_DOCUMENT_ERR: 4,
+ NO_MODIFICATION_ALLOWED_ERR: 7,
+ NOT_FOUND_ERR: 8,
+ NOT_SUPPORTED_ERR: 9,
+ INVALID_STATE_ERR: 11,
+ INVALID_NODE_TYPE_ERR: 24
+ };
+
+ DOMException.prototype.toString = function() {
+ return this.message;
+ };
+
+ api.dom = {
+ arrayContains: arrayContains,
+ isHtmlNamespace: isHtmlNamespace,
+ parentElement: parentElement,
+ getNodeIndex: getNodeIndex,
+ getNodeLength: getNodeLength,
+ getCommonAncestor: getCommonAncestor,
+ isAncestorOf: isAncestorOf,
+ isOrIsAncestorOf: isOrIsAncestorOf,
+ getClosestAncestorIn: getClosestAncestorIn,
+ isCharacterDataNode: isCharacterDataNode,
+ isTextOrCommentNode: isTextOrCommentNode,
+ insertAfter: insertAfter,
+ splitDataNode: splitDataNode,
+ getDocument: getDocument,
+ getWindow: getWindow,
+ getIframeWindow: getIframeWindow,
+ getIframeDocument: getIframeDocument,
+ getBody: util.getBody,
+ isWindow: isWindow,
+ getContentDocument: getContentDocument,
+ getRootContainer: getRootContainer,
+ comparePoints: comparePoints,
+ isBrokenNode: isBrokenNode,
+ inspectNode: inspectNode,
+ getComputedStyleProperty: getComputedStyleProperty,
+ fragmentFromNodeChildren: fragmentFromNodeChildren,
+ createIterator: createIterator,
+ DomPosition: DomPosition
+ };
+
+ api.DOMException = DOMException;
+ });
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Pure JavaScript implementation of DOM Range
+ api.createCoreModule("DomRange", ["DomUtil"], function(api, module) {
+ var dom = api.dom;
+ var util = api.util;
+ var DomPosition = dom.DomPosition;
+ var DOMException = api.DOMException;
+
+ var isCharacterDataNode = dom.isCharacterDataNode;
+ var getNodeIndex = dom.getNodeIndex;
+ var isOrIsAncestorOf = dom.isOrIsAncestorOf;
+ var getDocument = dom.getDocument;
+ var comparePoints = dom.comparePoints;
+ var splitDataNode = dom.splitDataNode;
+ var getClosestAncestorIn = dom.getClosestAncestorIn;
+ var getNodeLength = dom.getNodeLength;
+ var arrayContains = dom.arrayContains;
+ var getRootContainer = dom.getRootContainer;
+ var crashyTextNodes = api.features.crashyTextNodes;
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Utility functions
+
+ function isNonTextPartiallySelected(node, range) {
+ return (node.nodeType != 3) &&
+ (isOrIsAncestorOf(node, range.startContainer) || isOrIsAncestorOf(node, range.endContainer));
+ }
+
+ function getRangeDocument(range) {
+ return range.document || getDocument(range.startContainer);
+ }
+
+ function getBoundaryBeforeNode(node) {
+ return new DomPosition(node.parentNode, getNodeIndex(node));
+ }
+
+ function getBoundaryAfterNode(node) {
+ return new DomPosition(node.parentNode, getNodeIndex(node) + 1);
+ }
+
+ function insertNodeAtPosition(node, n, o) {
+ var firstNodeInserted = node.nodeType == 11 ? node.firstChild : node;
+ if (isCharacterDataNode(n)) {
+ if (o == n.length) {
+ dom.insertAfter(node, n);
+ } else {
+ n.parentNode.insertBefore(node, o == 0 ? n : splitDataNode(n, o));
+ }
+ } else if (o >= n.childNodes.length) {
+ n.appendChild(node);
+ } else {
+ n.insertBefore(node, n.childNodes[o]);
+ }
+ return firstNodeInserted;
+ }
+
+ function rangesIntersect(rangeA, rangeB, touchingIsIntersecting) {
+ assertRangeValid(rangeA);
+ assertRangeValid(rangeB);
+
+ if (getRangeDocument(rangeB) != getRangeDocument(rangeA)) {
+ throw new DOMException("WRONG_DOCUMENT_ERR");
+ }
+
+ var startComparison = comparePoints(rangeA.startContainer, rangeA.startOffset, rangeB.endContainer, rangeB.endOffset),
+ endComparison = comparePoints(rangeA.endContainer, rangeA.endOffset, rangeB.startContainer, rangeB.startOffset);
+
+ return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;
+ }
+
+ function cloneSubtree(iterator) {
+ var partiallySelected;
+ for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next(); ) {
+ partiallySelected = iterator.isPartiallySelectedSubtree();
+ node = node.cloneNode(!partiallySelected);
+ if (partiallySelected) {
+ subIterator = iterator.getSubtreeIterator();
+ node.appendChild(cloneSubtree(subIterator));
+ subIterator.detach();
+ }
+
+ if (node.nodeType == 10) { // DocumentType
+ throw new DOMException("HIERARCHY_REQUEST_ERR");
+ }
+ frag.appendChild(node);
+ }
+ return frag;
+ }
+
+ function iterateSubtree(rangeIterator, func, iteratorState) {
+ var it, n;
+ iteratorState = iteratorState || { stop: false };
+ for (var node, subRangeIterator; node = rangeIterator.next(); ) {
+ if (rangeIterator.isPartiallySelectedSubtree()) {
+ if (func(node) === false) {
+ iteratorState.stop = true;
+ return;
+ } else {
+ // The node is partially selected by the Range, so we can use a new RangeIterator on the portion of
+ // the node selected by the Range.
+ subRangeIterator = rangeIterator.getSubtreeIterator();
+ iterateSubtree(subRangeIterator, func, iteratorState);
+ subRangeIterator.detach();
+ if (iteratorState.stop) {
+ return;
+ }
+ }
+ } else {
+ // The whole node is selected, so we can use efficient DOM iteration to iterate over the node and its
+ // descendants
+ it = dom.createIterator(node);
+ while ( (n = it.next()) ) {
+ if (func(n) === false) {
+ iteratorState.stop = true;
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ function deleteSubtree(iterator) {
+ var subIterator;
+ while (iterator.next()) {
+ if (iterator.isPartiallySelectedSubtree()) {
+ subIterator = iterator.getSubtreeIterator();
+ deleteSubtree(subIterator);
+ subIterator.detach();
+ } else {
+ iterator.remove();
+ }
+ }
+ }
+
+ function extractSubtree(iterator) {
+ for (var node, frag = getRangeDocument(iterator.range).createDocumentFragment(), subIterator; node = iterator.next(); ) {
+
+ if (iterator.isPartiallySelectedSubtree()) {
+ node = node.cloneNode(false);
+ subIterator = iterator.getSubtreeIterator();
+ node.appendChild(extractSubtree(subIterator));
+ subIterator.detach();
+ } else {
+ iterator.remove();
+ }
+ if (node.nodeType == 10) { // DocumentType
+ throw new DOMException("HIERARCHY_REQUEST_ERR");
+ }
+ frag.appendChild(node);
+ }
+ return frag;
+ }
+
+ function getNodesInRange(range, nodeTypes, filter) {
+ var filterNodeTypes = !!(nodeTypes && nodeTypes.length), regex;
+ var filterExists = !!filter;
+ if (filterNodeTypes) {
+ regex = new RegExp("^(" + nodeTypes.join("|") + ")$");
+ }
+
+ var nodes = [];
+ iterateSubtree(new RangeIterator(range, false), function(node) {
+ if (filterNodeTypes && !regex.test(node.nodeType)) {
+ return;
+ }
+ if (filterExists && !filter(node)) {
+ return;
+ }
+ // Don't include a boundary container if it is a character data node and the range does not contain any
+ // of its character data. See issue 190.
+ var sc = range.startContainer;
+ if (node == sc && isCharacterDataNode(sc) && range.startOffset == sc.length) {
+ return;
+ }
+
+ var ec = range.endContainer;
+ if (node == ec && isCharacterDataNode(ec) && range.endOffset == 0) {
+ return;
+ }
+
+ nodes.push(node);
+ });
+ return nodes;
+ }
+
+ function inspect(range) {
+ var name = (typeof range.getName == "undefined") ? "Range" : range.getName();
+ return "[" + name + "(" + dom.inspectNode(range.startContainer) + ":" + range.startOffset + ", " +
+ dom.inspectNode(range.endContainer) + ":" + range.endOffset + ")]";
+ }
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // RangeIterator code partially borrows from IERange by Tim Ryan (http://github.com/timcameronryan/IERange)
+
+ function RangeIterator(range, clonePartiallySelectedTextNodes) {
+ this.range = range;
+ this.clonePartiallySelectedTextNodes = clonePartiallySelectedTextNodes;
+
+
+ if (!range.collapsed) {
+ this.sc = range.startContainer;
+ this.so = range.startOffset;
+ this.ec = range.endContainer;
+ this.eo = range.endOffset;
+ var root = range.commonAncestorContainer;
+
+ if (this.sc === this.ec && isCharacterDataNode(this.sc)) {
+ this.isSingleCharacterDataNode = true;
+ this._first = this._last = this._next = this.sc;
+ } else {
+ this._first = this._next = (this.sc === root && !isCharacterDataNode(this.sc)) ?
+ this.sc.childNodes[this.so] : getClosestAncestorIn(this.sc, root, true);
+ this._last = (this.ec === root && !isCharacterDataNode(this.ec)) ?
+ this.ec.childNodes[this.eo - 1] : getClosestAncestorIn(this.ec, root, true);
+ }
+ }
+ }
+
+ RangeIterator.prototype = {
+ _current: null,
+ _next: null,
+ _first: null,
+ _last: null,
+ isSingleCharacterDataNode: false,
+
+ reset: function() {
+ this._current = null;
+ this._next = this._first;
+ },
+
+ hasNext: function() {
+ return !!this._next;
+ },
+
+ next: function() {
+ // Move to next node
+ var current = this._current = this._next;
+ if (current) {
+ this._next = (current !== this._last) ? current.nextSibling : null;
+
+ // Check for partially selected text nodes
+ if (isCharacterDataNode(current) && this.clonePartiallySelectedTextNodes) {
+ if (current === this.ec) {
+ (current = current.cloneNode(true)).deleteData(this.eo, current.length - this.eo);
+ }
+ if (this._current === this.sc) {
+ (current = current.cloneNode(true)).deleteData(0, this.so);
+ }
+ }
+ }
+
+ return current;
+ },
+
+ remove: function() {
+ var current = this._current, start, end;
+
+ if (isCharacterDataNode(current) && (current === this.sc || current === this.ec)) {
+ start = (current === this.sc) ? this.so : 0;
+ end = (current === this.ec) ? this.eo : current.length;
+ if (start != end) {
+ current.deleteData(start, end - start);
+ }
+ } else {
+ if (current.parentNode) {
+ current.parentNode.removeChild(current);
+ } else {
+ }
+ }
+ },
+
+ // Checks if the current node is partially selected
+ isPartiallySelectedSubtree: function() {
+ var current = this._current;
+ return isNonTextPartiallySelected(current, this.range);
+ },
+
+ getSubtreeIterator: function() {
+ var subRange;
+ if (this.isSingleCharacterDataNode) {
+ subRange = this.range.cloneRange();
+ subRange.collapse(false);
+ } else {
+ subRange = new Range(getRangeDocument(this.range));
+ var current = this._current;
+ var startContainer = current, startOffset = 0, endContainer = current, endOffset = getNodeLength(current);
+
+ if (isOrIsAncestorOf(current, this.sc)) {
+ startContainer = this.sc;
+ startOffset = this.so;
+ }
+ if (isOrIsAncestorOf(current, this.ec)) {
+ endContainer = this.ec;
+ endOffset = this.eo;
+ }
+
+ updateBoundaries(subRange, startContainer, startOffset, endContainer, endOffset);
+ }
+ return new RangeIterator(subRange, this.clonePartiallySelectedTextNodes);
+ },
+
+ detach: function() {
+ this.range = this._current = this._next = this._first = this._last = this.sc = this.so = this.ec = this.eo = null;
+ }
+ };
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ var beforeAfterNodeTypes = [1, 3, 4, 5, 7, 8, 10];
+ var rootContainerNodeTypes = [2, 9, 11];
+ var readonlyNodeTypes = [5, 6, 10, 12];
+ var insertableNodeTypes = [1, 3, 4, 5, 7, 8, 10, 11];
+ var surroundNodeTypes = [1, 3, 4, 5, 7, 8];
+
+ function createAncestorFinder(nodeTypes) {
+ return function(node, selfIsAncestor) {
+ var t, n = selfIsAncestor ? node : node.parentNode;
+ while (n) {
+ t = n.nodeType;
+ if (arrayContains(nodeTypes, t)) {
+ return n;
+ }
+ n = n.parentNode;
+ }
+ return null;
+ };
+ }
+
+ var getDocumentOrFragmentContainer = createAncestorFinder( [9, 11] );
+ var getReadonlyAncestor = createAncestorFinder(readonlyNodeTypes);
+ var getDocTypeNotationEntityAncestor = createAncestorFinder( [6, 10, 12] );
+
+ function assertNoDocTypeNotationEntityAncestor(node, allowSelf) {
+ if (getDocTypeNotationEntityAncestor(node, allowSelf)) {
+ throw new DOMException("INVALID_NODE_TYPE_ERR");
+ }
+ }
+
+ function assertValidNodeType(node, invalidTypes) {
+ if (!arrayContains(invalidTypes, node.nodeType)) {
+ throw new DOMException("INVALID_NODE_TYPE_ERR");
+ }
+ }
+
+ function assertValidOffset(node, offset) {
+ if (offset < 0 || offset > (isCharacterDataNode(node) ? node.length : node.childNodes.length)) {
+ throw new DOMException("INDEX_SIZE_ERR");
+ }
+ }
+
+ function assertSameDocumentOrFragment(node1, node2) {
+ if (getDocumentOrFragmentContainer(node1, true) !== getDocumentOrFragmentContainer(node2, true)) {
+ throw new DOMException("WRONG_DOCUMENT_ERR");
+ }
+ }
+
+ function assertNodeNotReadOnly(node) {
+ if (getReadonlyAncestor(node, true)) {
+ throw new DOMException("NO_MODIFICATION_ALLOWED_ERR");
+ }
+ }
+
+ function assertNode(node, codeName) {
+ if (!node) {
+ throw new DOMException(codeName);
+ }
+ }
+
+ function isOrphan(node) {
+ return (crashyTextNodes && dom.isBrokenNode(node)) ||
+ !arrayContains(rootContainerNodeTypes, node.nodeType) && !getDocumentOrFragmentContainer(node, true);
+ }
+
+ function isValidOffset(node, offset) {
+ return offset <= (isCharacterDataNode(node) ? node.length : node.childNodes.length);
+ }
+
+ function isRangeValid(range) {
+ return (!!range.startContainer && !!range.endContainer &&
+ !isOrphan(range.startContainer) &&
+ !isOrphan(range.endContainer) &&
+ isValidOffset(range.startContainer, range.startOffset) &&
+ isValidOffset(range.endContainer, range.endOffset));
+ }
+
+ function assertRangeValid(range) {
+ if (!isRangeValid(range)) {
+ throw new Error("Range error: Range is no longer valid after DOM mutation (" + range.inspect() + ")");
+ }
+ }
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Test the browser's innerHTML support to decide how to implement createContextualFragment
+ var styleEl = document.createElement("style");
+ var htmlParsingConforms = false;
+ try {
+ styleEl.innerHTML = "<b>x</b>";
+ htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Opera incorrectly creates an element node
+ } catch (e) {
+ // IE 6 and 7 throw
+ }
+
+ api.features.htmlParsingConforms = htmlParsingConforms;
+
+ var createContextualFragment = htmlParsingConforms ?
+
+ // Implementation as per HTML parsing spec, trusting in the browser's implementation of innerHTML. See
+ // discussion and base code for this implementation at issue 67.
+ // Spec: http://html5.org/specs/dom-parsing.html#extensions-to-the-range-interface
+ // Thanks to Aleks Williams.
+ function(fragmentStr) {
+ // "Let node the context object's start's node."
+ var node = this.startContainer;
+ var doc = getDocument(node);
+
+ // "If the context object's start's node is null, raise an INVALID_STATE_ERR
+ // exception and abort these steps."
+ if (!node) {
+ throw new DOMException("INVALID_STATE_ERR");
+ }
+
+ // "Let element be as follows, depending on node's interface:"
+ // Document, Document Fragment: null
+ var el = null;
+
+ // "Element: node"
+ if (node.nodeType == 1) {
+ el = node;
+
+ // "Text, Comment: node's parentElement"
+ } else if (isCharacterDataNode(node)) {
+ el = dom.parentElement(node);
+ }
+
+ // "If either element is null or element's ownerDocument is an HTML document
+ // and element's local name is "html" and element's namespace is the HTML
+ // namespace"
+ if (el === null || (
+ el.nodeName == "HTML" &&
+ dom.isHtmlNamespace(getDocument(el).documentElement) &&
+ dom.isHtmlNamespace(el)
+ )) {
+
+ // "let element be a new Element with "body" as its local name and the HTML
+ // namespace as its namespace.""
+ el = doc.createElement("body");
+ } else {
+ el = el.cloneNode(false);
+ }
+
+ // "If the node's document is an HTML document: Invoke the HTML fragment parsing algorithm."
+ // "If the node's document is an XML document: Invoke the XML fragment parsing algorithm."
+ // "In either case, the algorithm must be invoked with fragment as the input
+ // and element as the context element."
+ el.innerHTML = fragmentStr;
+
+ // "If this raises an exception, then abort these steps. Otherwise, let new
+ // children be the nodes returned."
+
+ // "Let fragment be a new DocumentFragment."
+ // "Append all new children to fragment."
+ // "Return fragment."
+ return dom.fragmentFromNodeChildren(el);
+ } :
+
+ // In this case, innerHTML cannot be trusted, so fall back to a simpler, non-conformant implementation that
+ // previous versions of Rangy used (with the exception of using a body element rather than a div)
+ function(fragmentStr) {
+ var doc = getRangeDocument(this);
+ var el = doc.createElement("body");
+ el.innerHTML = fragmentStr;
+
+ return dom.fragmentFromNodeChildren(el);
+ };
+
+ function splitRangeBoundaries(range, positionsToPreserve) {
+ assertRangeValid(range);
+
+ var sc = range.startContainer, so = range.startOffset, ec = range.endContainer, eo = range.endOffset;
+ var startEndSame = (sc === ec);
+
+ if (isCharacterDataNode(ec) && eo > 0 && eo < ec.length) {
+ splitDataNode(ec, eo, positionsToPreserve);
+ }
+
+ if (isCharacterDataNode(sc) && so > 0 && so < sc.length) {
+ sc = splitDataNode(sc, so, positionsToPreserve);
+ if (startEndSame) {
+ eo -= so;
+ ec = sc;
+ } else if (ec == sc.parentNode && eo >= getNodeIndex(sc)) {
+ eo++;
+ }
+ so = 0;
+ }
+ range.setStartAndEnd(sc, so, ec, eo);
+ }
+
+ function rangeToHtml(range) {
+ assertRangeValid(range);
+ var container = range.commonAncestorContainer.parentNode.cloneNode(false);
+ container.appendChild( range.cloneContents() );
+ return container.innerHTML;
+ }
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ var rangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
+ "commonAncestorContainer"];
+
+ var s2s = 0, s2e = 1, e2e = 2, e2s = 3;
+ var n_b = 0, n_a = 1, n_b_a = 2, n_i = 3;
+
+ util.extend(api.rangePrototype, {
+ compareBoundaryPoints: function(how, range) {
+ assertRangeValid(this);
+ assertSameDocumentOrFragment(this.startContainer, range.startContainer);
+
+ var nodeA, offsetA, nodeB, offsetB;
+ var prefixA = (how == e2s || how == s2s) ? "start" : "end";
+ var prefixB = (how == s2e || how == s2s) ? "start" : "end";
+ nodeA = this[prefixA + "Container"];
+ offsetA = this[prefixA + "Offset"];
+ nodeB = range[prefixB + "Container"];
+ offsetB = range[prefixB + "Offset"];
+ return comparePoints(nodeA, offsetA, nodeB, offsetB);
+ },
+
+ insertNode: function(node) {
+ assertRangeValid(this);
+ assertValidNodeType(node, insertableNodeTypes);
+ assertNodeNotReadOnly(this.startContainer);
+
+ if (isOrIsAncestorOf(node, this.startContainer)) {
+ throw new DOMException("HIERARCHY_REQUEST_ERR");
+ }
+
+ // No check for whether the container of the start of the Range is of a type that does not allow
+ // children of the type of node: the browser's DOM implementation should do this for us when we attempt
+ // to add the node
+
+ var firstNodeInserted = insertNodeAtPosition(node, this.startContainer, this.startOffset);
+ this.setStartBefore(firstNodeInserted);
+ },
+
+ cloneContents: function() {
+ assertRangeValid(this);
+
+ var clone, frag;
+ if (this.collapsed) {
+ return getRangeDocument(this).createDocumentFragment();
+ } else {
+ if (this.startContainer === this.endContainer && isCharacterDataNode(this.startContainer)) {
+ clone = this.startContainer.cloneNode(true);
+ clone.data = clone.data.slice(this.startOffset, this.endOffset);
+ frag = getRangeDocument(this).createDocumentFragment();
+ frag.appendChild(clone);
+ return frag;
+ } else {
+ var iterator = new RangeIterator(this, true);
+ clone = cloneSubtree(iterator);
+ iterator.detach();
+ }
+ return clone;
+ }
+ },
+
+ canSurroundContents: function() {
+ assertRangeValid(this);
+ assertNodeNotReadOnly(this.startContainer);
+ assertNodeNotReadOnly(this.endContainer);
+
+ // Check if the contents can be surrounded. Specifically, this means whether the range partially selects
+ // no non-text nodes.
+ var iterator = new RangeIterator(this, true);
+ var boundariesInvalid = (iterator._first && (isNonTextPartiallySelected(iterator._first, this)) ||
+ (iterator._last && isNonTextPartiallySelected(iterator._last, this)));
+ iterator.detach();
+ return !boundariesInvalid;
+ },
+
+ surroundContents: function(node) {
+ assertValidNodeType(node, surroundNodeTypes);
+
+ if (!this.canSurroundContents()) {
+ throw new DOMException("INVALID_STATE_ERR");
+ }
+
+ // Extract the contents
+ var content = this.extractContents();
+
+ // Clear the children of the node
+ if (node.hasChildNodes()) {
+ while (node.lastChild) {
+ node.removeChild(node.lastChild);
+ }
+ }
+
+ // Insert the new node and add the extracted contents
+ insertNodeAtPosition(node, this.startContainer, this.startOffset);
+ node.appendChild(content);
+
+ this.selectNode(node);
+ },
+
+ cloneRange: function() {
+ assertRangeValid(this);
+ var range = new Range(getRangeDocument(this));
+ var i = rangeProperties.length, prop;
+ while (i--) {
+ prop = rangeProperties[i];
+ range[prop] = this[prop];
+ }
+ return range;
+ },
+
+ toString: function() {
+ assertRangeValid(this);
+ var sc = this.startContainer;
+ if (sc === this.endContainer && isCharacterDataNode(sc)) {
+ return (sc.nodeType == 3 || sc.nodeType == 4) ? sc.data.slice(this.startOffset, this.endOffset) : "";
+ } else {
+ var textParts = [], iterator = new RangeIterator(this, true);
+ iterateSubtree(iterator, function(node) {
+ // Accept only text or CDATA nodes, not comments
+ if (node.nodeType == 3 || node.nodeType == 4) {
+ textParts.push(node.data);
+ }
+ });
+ iterator.detach();
+ return textParts.join("");
+ }
+ },
+
+ // The methods below are all non-standard. The following batch were introduced by Mozilla but have since
+ // been removed from Mozilla.
+
+ compareNode: function(node) {
+ assertRangeValid(this);
+
+ var parent = node.parentNode;
+ var nodeIndex = getNodeIndex(node);
+
+ if (!parent) {
+ throw new DOMException("NOT_FOUND_ERR");
+ }
+
+ var startComparison = this.comparePoint(parent, nodeIndex),
+ endComparison = this.comparePoint(parent, nodeIndex + 1);
+
+ if (startComparison < 0) { // Node starts before
+ return (endComparison > 0) ? n_b_a : n_b;
+ } else {
+ return (endComparison > 0) ? n_a : n_i;
+ }
+ },
+
+ comparePoint: function(node, offset) {
+ assertRangeValid(this);
+ assertNode(node, "HIERARCHY_REQUEST_ERR");
+ assertSameDocumentOrFragment(node, this.startContainer);
+
+ if (comparePoints(node, offset, this.startContainer, this.startOffset) < 0) {
+ return -1;
+ } else if (comparePoints(node, offset, this.endContainer, this.endOffset) > 0) {
+ return 1;
+ }
+ return 0;
+ },
+
+ createContextualFragment: createContextualFragment,
+
+ toHtml: function() {
+ return rangeToHtml(this);
+ },
+
+ // touchingIsIntersecting determines whether this method considers a node that borders a range intersects
+ // with it (as in WebKit) or not (as in Gecko pre-1.9, and the default)
+ intersectsNode: function(node, touchingIsIntersecting) {
+ assertRangeValid(this);
+ assertNode(node, "NOT_FOUND_ERR");
+ if (getDocument(node) !== getRangeDocument(this)) {
+ return false;
+ }
+
+ var parent = node.parentNode, offset = getNodeIndex(node);
+ assertNode(parent, "NOT_FOUND_ERR");
+
+ var startComparison = comparePoints(parent, offset, this.endContainer, this.endOffset),
+ endComparison = comparePoints(parent, offset + 1, this.startContainer, this.startOffset);
+
+ return touchingIsIntersecting ? startComparison <= 0 && endComparison >= 0 : startComparison < 0 && endComparison > 0;
+ },
+
+ isPointInRange: function(node, offset) {
+ assertRangeValid(this);
+ assertNode(node, "HIERARCHY_REQUEST_ERR");
+ assertSameDocumentOrFragment(node, this.startContainer);
+
+ return (comparePoints(node, offset, this.startContainer, this.startOffset) >= 0) &&
+ (comparePoints(node, offset, this.endContainer, this.endOffset) <= 0);
+ },
+
+ // The methods below are non-standard and invented by me.
+
+ // Sharing a boundary start-to-end or end-to-start does not count as intersection.
+ intersectsRange: function(range) {
+ return rangesIntersect(this, range, false);
+ },
+
+ // Sharing a boundary start-to-end or end-to-start does count as intersection.
+ intersectsOrTouchesRange: function(range) {
+ return rangesIntersect(this, range, true);
+ },
+
+ intersection: function(range) {
+ if (this.intersectsRange(range)) {
+ var startComparison = comparePoints(this.startContainer, this.startOffset, range.startContainer, range.startOffset),
+ endComparison = comparePoints(this.endContainer, this.endOffset, range.endContainer, range.endOffset);
+
+ var intersectionRange = this.cloneRange();
+ if (startComparison == -1) {
+ intersectionRange.setStart(range.startContainer, range.startOffset);
+ }
+ if (endComparison == 1) {
+ intersectionRange.setEnd(range.endContainer, range.endOffset);
+ }
+ return intersectionRange;
+ }
+ return null;
+ },
+
+ union: function(range) {
+ if (this.intersectsOrTouchesRange(range)) {
+ var unionRange = this.cloneRange();
+ if (comparePoints(range.startContainer, range.startOffset, this.startContainer, this.startOffset) == -1) {
+ unionRange.setStart(range.startContainer, range.startOffset);
+ }
+ if (comparePoints(range.endContainer, range.endOffset, this.endContainer, this.endOffset) == 1) {
+ unionRange.setEnd(range.endContainer, range.endOffset);
+ }
+ return unionRange;
+ } else {
+ throw new DOMException("Ranges do not intersect");
+ }
+ },
+
+ containsNode: function(node, allowPartial) {
+ if (allowPartial) {
+ return this.intersectsNode(node, false);
+ } else {
+ return this.compareNode(node) == n_i;
+ }
+ },
+
+ containsNodeContents: function(node) {
+ return this.comparePoint(node, 0) >= 0 && this.comparePoint(node, getNodeLength(node)) <= 0;
+ },
+
+ containsRange: function(range) {
+ var intersection = this.intersection(range);
+ return intersection !== null && range.equals(intersection);
+ },
+
+ containsNodeText: function(node) {
+ var nodeRange = this.cloneRange();
+ nodeRange.selectNode(node);
+ var textNodes = nodeRange.getNodes([3]);
+ if (textNodes.length > 0) {
+ nodeRange.setStart(textNodes[0], 0);
+ var lastTextNode = textNodes.pop();
+ nodeRange.setEnd(lastTextNode, lastTextNode.length);
+ return this.containsRange(nodeRange);
+ } else {
+ return this.containsNodeContents(node);
+ }
+ },
+
+ getNodes: function(nodeTypes, filter) {
+ assertRangeValid(this);
+ return getNodesInRange(this, nodeTypes, filter);
+ },
+
+ getDocument: function() {
+ return getRangeDocument(this);
+ },
+
+ collapseBefore: function(node) {
+ this.setEndBefore(node);
+ this.collapse(false);
+ },
+
+ collapseAfter: function(node) {
+ this.setStartAfter(node);
+ this.collapse(true);
+ },
+
+ getBookmark: function(containerNode) {
+ var doc = getRangeDocument(this);
+ var preSelectionRange = api.createRange(doc);
+ containerNode = containerNode || dom.getBody(doc);
+ preSelectionRange.selectNodeContents(containerNode);
+ var range = this.intersection(preSelectionRange);
+ var start = 0, end = 0;
+ if (range) {
+ preSelectionRange.setEnd(range.startContainer, range.startOffset);
+ start = preSelectionRange.toString().length;
+ end = start + range.toString().length;
+ }
+
+ return {
+ start: start,
+ end: end,
+ containerNode: containerNode
+ };
+ },
+
+ moveToBookmark: function(bookmark) {
+ var containerNode = bookmark.containerNode;
+ var charIndex = 0;
+ this.setStart(containerNode, 0);
+ this.collapse(true);
+ var nodeStack = [containerNode], node, foundStart = false, stop = false;
+ var nextCharIndex, i, childNodes;
+
+ while (!stop && (node = nodeStack.pop())) {
+ if (node.nodeType == 3) {
+ nextCharIndex = charIndex + node.length;
+ if (!foundStart && bookmark.start >= charIndex && bookmark.start <= nextCharIndex) {
+ this.setStart(node, bookmark.start - charIndex);
+ foundStart = true;
+ }
+ if (foundStart && bookmark.end >= charIndex && bookmark.end <= nextCharIndex) {
+ this.setEnd(node, bookmark.end - charIndex);
+ stop = true;
+ }
+ charIndex = nextCharIndex;
+ } else {
+ childNodes = node.childNodes;
+ i = childNodes.length;
+ while (i--) {
+ nodeStack.push(childNodes[i]);
+ }
+ }
+ }
+ },
+
+ getName: function() {
+ return "DomRange";
+ },
+
+ equals: function(range) {
+ return Range.rangesEqual(this, range);
+ },
+
+ isValid: function() {
+ return isRangeValid(this);
+ },
+
+ inspect: function() {
+ return inspect(this);
+ },
+
+ detach: function() {
+ // In DOM4, detach() is now a no-op.
+ }
+ });
+
+ function copyComparisonConstantsToObject(obj) {
+ obj.START_TO_START = s2s;
+ obj.START_TO_END = s2e;
+ obj.END_TO_END = e2e;
+ obj.END_TO_START = e2s;
+
+ obj.NODE_BEFORE = n_b;
+ obj.NODE_AFTER = n_a;
+ obj.NODE_BEFORE_AND_AFTER = n_b_a;
+ obj.NODE_INSIDE = n_i;
+ }
+
+ function copyComparisonConstants(constructor) {
+ copyComparisonConstantsToObject(constructor);
+ copyComparisonConstantsToObject(constructor.prototype);
+ }
+
+ function createRangeContentRemover(remover, boundaryUpdater) {
+ return function() {
+ assertRangeValid(this);
+
+ var sc = this.startContainer, so = this.startOffset, root = this.commonAncestorContainer;
+
+ var iterator = new RangeIterator(this, true);
+
+ // Work out where to position the range after content removal
+ var node, boundary;
+ if (sc !== root) {
+ node = getClosestAncestorIn(sc, root, true);
+ boundary = getBoundaryAfterNode(node);
+ sc = boundary.node;
+ so = boundary.offset;
+ }
+
+ // Check none of the range is read-only
+ iterateSubtree(iterator, assertNodeNotReadOnly);
+
+ iterator.reset();
+
+ // Remove the content
+ var returnValue = remover(iterator);
+ iterator.detach();
+
+ // Move to the new position
+ boundaryUpdater(this, sc, so, sc, so);
+
+ return returnValue;
+ };
+ }
+
+ function createPrototypeRange(constructor, boundaryUpdater) {
+ function createBeforeAfterNodeSetter(isBefore, isStart) {
+ return function(node) {
+ assertValidNodeType(node, beforeAfterNodeTypes);
+ assertValidNodeType(getRootContainer(node), rootContainerNodeTypes);
+
+ var boundary = (isBefore ? getBoundaryBeforeNode : getBoundaryAfterNode)(node);
+ (isStart ? setRangeStart : setRangeEnd)(this, boundary.node, boundary.offset);
+ };
+ }
+
+ function setRangeStart(range, node, offset) {
+ var ec = range.endContainer, eo = range.endOffset;
+ if (node !== range.startContainer || offset !== range.startOffset) {
+ // Check the root containers of the range and the new boundary, and also check whether the new boundary
+ // is after the current end. In either case, collapse the range to the new position
+ if (getRootContainer(node) != getRootContainer(ec) || comparePoints(node, offset, ec, eo) == 1) {
+ ec = node;
+ eo = offset;
+ }
+ boundaryUpdater(range, node, offset, ec, eo);
+ }
+ }
+
+ function setRangeEnd(range, node, offset) {
+ var sc = range.startContainer, so = range.startOffset;
+ if (node !== range.endContainer || offset !== range.endOffset) {
+ // Check the root containers of the range and the new boundary, and also check whether the new boundary
+ // is after the current end. In either case, collapse the range to the new position
+ if (getRootContainer(node) != getRootContainer(sc) || comparePoints(node, offset, sc, so) == -1) {
+ sc = node;
+ so = offset;
+ }
+ boundaryUpdater(range, sc, so, node, offset);
+ }
+ }
+
+ // Set up inheritance
+ var F = function() {};
+ F.prototype = api.rangePrototype;
+ constructor.prototype = new F();
+
+ util.extend(constructor.prototype, {
+ setStart: function(node, offset) {
+ assertNoDocTypeNotationEntityAncestor(node, true);
+ assertValidOffset(node, offset);
+
+ setRangeStart(this, node, offset);
+ },
+
+ setEnd: function(node, offset) {
+ assertNoDocTypeNotationEntityAncestor(node, true);
+ assertValidOffset(node, offset);
+
+ setRangeEnd(this, node, offset);
+ },
+
+ /**
+ * Convenience method to set a range's start and end boundaries. Overloaded as follows:
+ * - Two parameters (node, offset) creates a collapsed range at that position
+ * - Three parameters (node, startOffset, endOffset) creates a range contained with node starting at
+ * startOffset and ending at endOffset
+ * - Four parameters (startNode, startOffset, endNode, endOffset) creates a range starting at startOffset in
+ * startNode and ending at endOffset in endNode
+ */
+ setStartAndEnd: function() {
+ var args = arguments;
+ var sc = args[0], so = args[1], ec = sc, eo = so;
+
+ switch (args.length) {
+ case 3:
+ eo = args[2];
+ break;
+ case 4:
+ ec = args[2];
+ eo = args[3];
+ break;
+ }
+
+ boundaryUpdater(this, sc, so, ec, eo);
+ },
+
+ setBoundary: function(node, offset, isStart) {
+ this["set" + (isStart ? "Start" : "End")](node, offset);
+ },
+
+ setStartBefore: createBeforeAfterNodeSetter(true, true),
+ setStartAfter: createBeforeAfterNodeSetter(false, true),
+ setEndBefore: createBeforeAfterNodeSetter(true, false),
+ setEndAfter: createBeforeAfterNodeSetter(false, false),
+
+ collapse: function(isStart) {
+ assertRangeValid(this);
+ if (isStart) {
+ boundaryUpdater(this, this.startContainer, this.startOffset, this.startContainer, this.startOffset);
+ } else {
+ boundaryUpdater(this, this.endContainer, this.endOffset, this.endContainer, this.endOffset);
+ }
+ },
+
+ selectNodeContents: function(node) {
+ assertNoDocTypeNotationEntityAncestor(node, true);
+
+ boundaryUpdater(this, node, 0, node, getNodeLength(node));
+ },
+
+ selectNode: function(node) {
+ assertNoDocTypeNotationEntityAncestor(node, false);
+ assertValidNodeType(node, beforeAfterNodeTypes);
+
+ var start = getBoundaryBeforeNode(node), end = getBoundaryAfterNode(node);
+ boundaryUpdater(this, start.node, start.offset, end.node, end.offset);
+ },
+
+ extractContents: createRangeContentRemover(extractSubtree, boundaryUpdater),
+
+ deleteContents: createRangeContentRemover(deleteSubtree, boundaryUpdater),
+
+ canSurroundContents: function() {
+ assertRangeValid(this);
+ assertNodeNotReadOnly(this.startContainer);
+ assertNodeNotReadOnly(this.endContainer);
+
+ // Check if the contents can be surrounded. Specifically, this means whether the range partially selects
+ // no non-text nodes.
+ var iterator = new RangeIterator(this, true);
+ var boundariesInvalid = (iterator._first && isNonTextPartiallySelected(iterator._first, this) ||
+ (iterator._last && isNonTextPartiallySelected(iterator._last, this)));
+ iterator.detach();
+ return !boundariesInvalid;
+ },
+
+ splitBoundaries: function() {
+ splitRangeBoundaries(this);
+ },
+
+ splitBoundariesPreservingPositions: function(positionsToPreserve) {
+ splitRangeBoundaries(this, positionsToPreserve);
+ },
+
+ normalizeBoundaries: function() {
+ assertRangeValid(this);
+
+ var sc = this.startContainer, so = this.startOffset, ec = this.endContainer, eo = this.endOffset;
+
+ var mergeForward = function(node) {
+ var sibling = node.nextSibling;
+ if (sibling && sibling.nodeType == node.nodeType) {
+ ec = node;
+ eo = node.length;
+ node.appendData(sibling.data);
+ sibling.parentNode.removeChild(sibling);
+ }
+ };
+
+ var mergeBackward = function(node) {
+ var sibling = node.previousSibling;
+ if (sibling && sibling.nodeType == node.nodeType) {
+ sc = node;
+ var nodeLength = node.length;
+ so = sibling.length;
+ node.insertData(0, sibling.data);
+ sibling.parentNode.removeChild(sibling);
+ if (sc == ec) {
+ eo += so;
+ ec = sc;
+ } else if (ec == node.parentNode) {
+ var nodeIndex = getNodeIndex(node);
+ if (eo == nodeIndex) {
+ ec = node;
+ eo = nodeLength;
+ } else if (eo > nodeIndex) {
+ eo--;
+ }
+ }
+ }
+ };
+
+ var normalizeStart = true;
+
+ if (isCharacterDataNode(ec)) {
+ if (ec.length == eo) {
+ mergeForward(ec);
+ }
+ } else {
+ if (eo > 0) {
+ var endNode = ec.childNodes[eo - 1];
+ if (endNode && isCharacterDataNode(endNode)) {
+ mergeForward(endNode);
+ }
+ }
+ normalizeStart = !this.collapsed;
+ }
+
+ if (normalizeStart) {
+ if (isCharacterDataNode(sc)) {
+ if (so == 0) {
+ mergeBackward(sc);
+ }
+ } else {
+ if (so < sc.childNodes.length) {
+ var startNode = sc.childNodes[so];
+ if (startNode && isCharacterDataNode(startNode)) {
+ mergeBackward(startNode);
+ }
+ }
+ }
+ } else {
+ sc = ec;
+ so = eo;
+ }
+
+ boundaryUpdater(this, sc, so, ec, eo);
+ },
+
+ collapseToPoint: function(node, offset) {
+ assertNoDocTypeNotationEntityAncestor(node, true);
+ assertValidOffset(node, offset);
+ this.setStartAndEnd(node, offset);
+ }
+ });
+
+ copyComparisonConstants(constructor);
+ }
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Updates commonAncestorContainer and collapsed after boundary change
+ function updateCollapsedAndCommonAncestor(range) {
+ range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
+ range.commonAncestorContainer = range.collapsed ?
+ range.startContainer : dom.getCommonAncestor(range.startContainer, range.endContainer);
+ }
+
+ function updateBoundaries(range, startContainer, startOffset, endContainer, endOffset) {
+ range.startContainer = startContainer;
+ range.startOffset = startOffset;
+ range.endContainer = endContainer;
+ range.endOffset = endOffset;
+ range.document = dom.getDocument(startContainer);
+
+ updateCollapsedAndCommonAncestor(range);
+ }
+
+ function Range(doc) {
+ this.startContainer = doc;
+ this.startOffset = 0;
+ this.endContainer = doc;
+ this.endOffset = 0;
+ this.document = doc;
+ updateCollapsedAndCommonAncestor(this);
+ }
+
+ createPrototypeRange(Range, updateBoundaries);
+
+ util.extend(Range, {
+ rangeProperties: rangeProperties,
+ RangeIterator: RangeIterator,
+ copyComparisonConstants: copyComparisonConstants,
+ createPrototypeRange: createPrototypeRange,
+ inspect: inspect,
+ toHtml: rangeToHtml,
+ getRangeDocument: getRangeDocument,
+ rangesEqual: function(r1, r2) {
+ return r1.startContainer === r2.startContainer &&
+ r1.startOffset === r2.startOffset &&
+ r1.endContainer === r2.endContainer &&
+ r1.endOffset === r2.endOffset;
+ }
+ });
+
+ api.DomRange = Range;
+ });
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // Wrappers for the browser's native DOM Range and/or TextRange implementation
+ api.createCoreModule("WrappedRange", ["DomRange"], function(api, module) {
+ var WrappedRange, WrappedTextRange;
+ var dom = api.dom;
+ var util = api.util;
+ var DomPosition = dom.DomPosition;
+ var DomRange = api.DomRange;
+ var getBody = dom.getBody;
+ var getContentDocument = dom.getContentDocument;
+ var isCharacterDataNode = dom.isCharacterDataNode;
+
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ if (api.features.implementsDomRange) {
+ // This is a wrapper around the browser's native DOM Range. It has two aims:
+ // - Provide workarounds for specific browser bugs
+ // - provide convenient extensions, which are inherited from Rangy's DomRange
+
+ (function() {
+ var rangeProto;
+ var rangeProperties = DomRange.rangeProperties;
+
+ function updateRangeProperties(range) {
+ var i = rangeProperties.length, prop;
+ while (i--) {
+ prop = rangeProperties[i];
+ range[prop] = range.nativeRange[prop];
+ }
+ // Fix for broken collapsed property in IE 9.
+ range.collapsed = (range.startContainer === range.endContainer && range.startOffset === range.endOffset);
+ }
+
+ function updateNativeRange(range, startContainer, startOffset, endContainer, endOffset) {
+ var startMoved = (range.startContainer !== startContainer || range.startOffset != startOffset);
+ var endMoved = (range.endContainer !== endContainer || range.endOffset != endOffset);
+ var nativeRangeDifferent = !range.equals(range.nativeRange);
+
+ // Always set both boundaries for the benefit of IE9 (see issue 35)
+ if (startMoved || endMoved || nativeRangeDifferent) {
+ range.setEnd(endContainer, endOffset);
+ range.setStart(startContainer, startOffset);
+ }
+ }
+
+ var createBeforeAfterNodeSetter;
+
+ WrappedRange = function(range) {
+ if (!range) {
+ throw module.createError("WrappedRange: Range must be specified");
+ }
+ this.nativeRange = range;
+ updateRangeProperties(this);
+ };
+
+ DomRange.createPrototypeRange(WrappedRange, updateNativeRange);
+
+ rangeProto = WrappedRange.prototype;
+
+ rangeProto.selectNode = function(node) {
+ this.nativeRange.selectNode(node);
+ updateRangeProperties(this);
+ };
+
+ rangeProto.cloneContents = function() {
+ return this.nativeRange.cloneContents();
+ };
+
+ // Due to a long-standing Firefox bug that I have not been able to find a reliable way to detect,
+ // insertNode() is never delegated to the native range.
+
+ rangeProto.surroundContents = function(node) {
+ this.nativeRange.surroundContents(node);
+ updateRangeProperties(this);
+ };
+
+ rangeProto.collapse = function(isStart) {
+ this.nativeRange.collapse(isStart);
+ updateRangeProperties(this);
+ };
+
+ rangeProto.cloneRange = function() {
+ return new WrappedRange(this.nativeRange.cloneRange());
+ };
+
+ rangeProto.refresh = function() {
+ updateRangeProperties(this);
+ };
+
+ rangeProto.toString = function() {
+ return this.nativeRange.toString();
+ };
+
+ // Create test range and node for feature detection
+
+ var testTextNode = document.createTextNode("test");
+ getBody(document).appendChild(testTextNode);
+ var range = document.createRange();
+
+ /*--------------------------------------------------------------------------------------------------------*/
+
+ // Test for Firefox 2 bug that prevents moving the start of a Range to a point after its current end and
+ // correct for it
+
+ range.setStart(testTextNode, 0);
+ range.setEnd(testTextNode, 0);
+
+ try {
+ range.setStart(testTextNode, 1);
+
+ rangeProto.setStart = function(node, offset) {
+ this.nativeRange.setStart(node, offset);
+ updateRangeProperties(this);
+ };
+
+ rangeProto.setEnd = function(node, offset) {
+ this.nativeRange.setEnd(node, offset);
+ updateRangeProperties(this);
+ };
+
+ createBeforeAfterNodeSetter = function(name) {
+ return function(node) {
+ this.nativeRange[name](node);
+ updateRangeProperties(this);
+ };
+ };
+
+ } catch(ex) {
+
+ rangeProto.setStart = function(node, offset) {
+ try {
+ this.nativeRange.setStart(node, offset);
+ } catch (ex) {
+ this.nativeRange.setEnd(node, offset);
+ this.nativeRange.setStart(node, offset);
+ }
+ updateRangeProperties(this);
+ };
+
+ rangeProto.setEnd = function(node, offset) {
+ try {
+ this.nativeRange.setEnd(node, offset);
+ } catch (ex) {
+ this.nativeRange.setStart(node, offset);
+ this.nativeRange.setEnd(node, offset);
+ }
+ updateRangeProperties(this);
+ };
+
+ createBeforeAfterNodeSetter = function(name, oppositeName) {
+ return function(node) {
+ try {
+ this.nativeRange[name](node);
+ } catch (ex) {
+ this.nativeRange[oppositeName](node);
+ this.nativeRange[name](node);
+ }
+ updateRangeProperties(this);
+ };
+ };
+ }
+
+ rangeProto.setStartBefore = createBeforeAfterNodeSetter("setStartBefore", "setEndBefore");
+ rangeProto.setStartAfter = createBeforeAfterNodeSetter("setStartAfter", "setEndAfter");
+ rangeProto.setEndBefore = createBeforeAfterNodeSetter("setEndBefore", "setStartBefore");
+ rangeProto.setEndAfter = createBeforeAfterNodeSetter("setEndAfter", "setStartAfter");
+
+ /*--------------------------------------------------------------------------------------------------------*/
+
+ // Always use DOM4-compliant selectNodeContents implementation: it's simpler and less code than testing
+ // whether the native implementation can be trusted
+ rangeProto.selectNodeContents = function(node) {
+ this.setStartAndEnd(node, 0, dom.getNodeLength(node));
+ };
+
+ /*--------------------------------------------------------------------------------------------------------*/
+
+ // Test for and correct WebKit bug that has the behaviour of compareBoundaryPoints round the wrong way for
+ // constants START_TO_END and END_TO_START: https://bugs.webkit.org/show_bug.cgi?id=20738
+
+ range.selectNodeContents(testTextNode);
+ range.setEnd(testTextNode, 3);
+
+ var range2 = document.createRange();
+ range2.selectNodeContents(testTextNode);
+ range2.setEnd(testTextNode, 4);
+ range2.setStart(testTextNode, 2);
+
+ if (range.compareBoundaryPoints(range.START_TO_END, range2) == -1 &&
+ range.compareBoundaryPoints(range.END_TO_START, range2) == 1) {
+ // This is the wrong way round, so correct for it
+
+ rangeProto.compareBoundaryPoints = function(type, range) {
+ range = range.nativeRange || range;
+ if (type == range.START_TO_END) {
+ type = range.END_TO_START;
+ } else if (type == range.END_TO_START) {
+ type = range.START_TO_END;
+ }
+ return this.nativeRange.compareBoundaryPoints(type, range);
+ };
+ } else {
+ rangeProto.compareBoundaryPoints = function(type, range) {
+ return this.nativeRange.compareBoundaryPoints(type, range.nativeRange || range);
+ };
+ }
+
+ /*--------------------------------------------------------------------------------------------------------*/
+
+ // Test for IE 9 deleteContents() and extractContents() bug and correct it. See issue 107.
+
+ var el = document.createElement("div");
+ el.innerHTML = "123";
+ var textNode = el.firstChild;
+ var body = getBody(document);
+ body.appendChild(el);
+
+ range.setStart(textNode, 1);
+ range.setEnd(textNode, 2);
+ range.deleteContents();
+
+ if (textNode.data == "13") {
+ // Behaviour is correct per DOM4 Range so wrap the browser's implementation of deleteContents() and
+ // extractContents()
+ rangeProto.deleteContents = function() {
+ this.nativeRange.deleteContents();
+ updateRangeProperties(this);
+ };
+
+ rangeProto.extractContents = function() {
+ var frag = this.nativeRange.extractContents();
+ updateRangeProperties(this);
+ return frag;
+ };
+ } else {
+ }
+
+ body.removeChild(el);
+ body = null;
+
+ /*--------------------------------------------------------------------------------------------------------*/
+
+ // Test for existence of createContextualFragment and delegate to it if it exists
+ if (util.isHostMethod(range, "createContextualFragment")) {
+ rangeProto.createContextualFragment = function(fragmentStr) {
+ return this.nativeRange.createContextualFragment(fragmentStr);
+ };
+ }
+
+ /*--------------------------------------------------------------------------------------------------------*/
+
+ // Clean up
+ getBody(document).removeChild(testTextNode);
+
+ rangeProto.getName = function() {
+ return "WrappedRange";
+ };
+
+ api.WrappedRange = WrappedRange;
+
+ api.createNativeRange = function(doc) {
+ doc = getContentDocument(doc, module, "createNativeRange");
+ return doc.createRange();
+ };
+ })();
+ }
+
+ if (api.features.implementsTextRange) {
+ /*
+ This is a workaround for a bug where IE returns the wrong container element from the TextRange's parentElement()
+ method. For example, in the following (where pipes denote the selection boundaries):
+
+ <ul id="ul"><li id="a">| a </li><li id="b"> b |</li></ul>
+
+ var range = document.selection.createRange();
+ alert(range.parentElement().id); // Should alert "ul" but alerts "b"
+
+ This method returns the common ancestor node of the following:
+ - the parentElement() of the textRange
+ - the parentElement() of the textRange after calling collapse(true)
+ - the parentElement() of the textRange after calling collapse(false)
+ */
+ var getTextRangeContainerElement = function(textRange) {
+ var parentEl = textRange.parentElement();
+ var range = textRange.duplicate();
+ range.collapse(true);
+ var startEl = range.parentElement();
+ range = textRange.duplicate();
+ range.collapse(false);
+ var endEl = range.parentElement();
+ var startEndContainer = (startEl == endEl) ? startEl : dom.getCommonAncestor(startEl, endEl);
+
+ return startEndContainer == parentEl ? startEndContainer : dom.getCommonAncestor(parentEl, startEndContainer);
+ };
+
+ var textRangeIsCollapsed = function(textRange) {
+ return textRange.compareEndPoints("StartToEnd", textRange) == 0;
+ };
+
+ // Gets the boundary of a TextRange expressed as a node and an offset within that node. This function started
+ // out as an improved version of code found in Tim Cameron Ryan's IERange (http://code.google.com/p/ierange/)
+ // but has grown, fixing problems with line breaks in preformatted text, adding workaround for IE TextRange
+ // bugs, handling for inputs and images, plus optimizations.
+ var getTextRangeBoundaryPosition = function(textRange, wholeRangeContainerElement, isStart, isCollapsed, startInfo) {
+ var workingRange = textRange.duplicate();
+ workingRange.collapse(isStart);
+ var containerElement = workingRange.parentElement();
+
+ // Sometimes collapsing a TextRange that's at the start of a text node can move it into the previous node, so
+ // check for that
+ if (!dom.isOrIsAncestorOf(wholeRangeContainerElement, containerElement)) {
+ containerElement = wholeRangeContainerElement;
+ }
+
+
+ // Deal with nodes that cannot "contain rich HTML markup". In practice, this means form inputs, images and
+ // similar. See http://msdn.microsoft.com/en-us/library/aa703950%28VS.85%29.aspx
+ if (!containerElement.canHaveHTML) {
+ var pos = new DomPosition(containerElement.parentNode, dom.getNodeIndex(containerElement));
+ return {
+ boundaryPosition: pos,
+ nodeInfo: {
+ nodeIndex: pos.offset,
+ containerElement: pos.node
+ }
+ };
+ }
+
+ var workingNode = dom.getDocument(containerElement).createElement("span");
+
+ // Workaround for HTML5 Shiv's insane violation of document.createElement(). See Rangy issue 104 and HTML5
+ // Shiv issue 64: https://github.com/aFarkas/html5shiv/issues/64
+ if (workingNode.parentNode) {
+ workingNode.parentNode.removeChild(workingNode);
+ }
+
+ var comparison, workingComparisonType = isStart ? "StartToStart" : "StartToEnd";
+ var previousNode, nextNode, boundaryPosition, boundaryNode;
+ var start = (startInfo && startInfo.containerElement == containerElement) ? startInfo.nodeIndex : 0;
+ var childNodeCount = containerElement.childNodes.length;
+ var end = childNodeCount;
+
+ // Check end first. Code within the loop assumes that the endth child node of the container is definitely
+ // after the range boundary.
+ var nodeIndex = end;
+
+ while (true) {
+ if (nodeIndex == childNodeCount) {
+ containerElement.appendChild(workingNode);
+ } else {
+ containerElement.insertBefore(workingNode, containerElement.childNodes[nodeIndex]);
+ }
+ workingRange.moveToElementText(workingNode);
+ comparison = workingRange.compareEndPoints(workingComparisonType, textRange);
+ if (comparison == 0 || start == end) {
+ break;
+ } else if (comparison == -1) {
+ if (end == start + 1) {
+ // We know the endth child node is after the range boundary, so we must be done.
+ break;
+ } else {
+ start = nodeIndex;
+ }
+ } else {
+ end = (end == start + 1) ? start : nodeIndex;
+ }
+ nodeIndex = Math.floor((start + end) / 2);
+ containerElement.removeChild(workingNode);
+ }
+
+
+ // We've now reached or gone past the boundary of the text range we're interested in
+ // so have identified the node we want
+ boundaryNode = workingNode.nextSibling;
+
+ if (comparison == -1 && boundaryNode && isCharacterDataNode(boundaryNode)) {
+ // This is a character data node (text, comment, cdata). The working range is collapsed at the start of
+ // the node containing the text range's boundary, so we move the end of the working range to the
+ // boundary point and measure the length of its text to get the boundary's offset within the node.
+ workingRange.setEndPoint(isStart ? "EndToStart" : "EndToEnd", textRange);
+
+ var offset;
+
+ if (/[\r\n]/.test(boundaryNode.data)) {
+ /*
+ For the particular case of a boundary within a text node containing rendered line breaks (within a
+ <pre> element, for example), we need a slightly complicated approach to get the boundary's offset in
+ IE. The facts:
+
+ - Each line break is represented as \r in the text node's data/nodeValue properties
+ - Each line break is represented as \r\n in the TextRange's 'text' property
+ - The 'text' property of the TextRange does not contain trailing line breaks
+
+ To get round the problem presented by the final fact above, we can use the fact that TextRange's
+ moveStart() and moveEnd() methods return the actual number of characters moved, which is not
+ necessarily the same as the number of characters it was instructed to move. The simplest approach is
+ to use this to store the characters moved when moving both the start and end of the range to the
+ start of the document body and subtracting the start offset from the end offset (the
+ "move-negative-gazillion" method). However, this is extremely slow when the document is large and
+ the range is near the end of it. Clearly doing the mirror image (i.e. moving the range boundaries to
+ the end of the document) has the same problem.
+
+ Another approach that works is to use moveStart() to move the start boundary of the range up to the
+ end boundary one character at a time and incrementing a counter with the value returned by the
+ moveStart() call. However, the check for whether the start boundary has reached the end boundary is
+ expensive, so this method is slow (although unlike "move-negative-gazillion" is largely unaffected
+ by the location of the range within the document).
+
+ The approach used below is a hybrid of the two methods above. It uses the fact that a string
+ containing the TextRange's 'text' property with each \r\n converted to a single \r character cannot
+ be longer than the text of the TextRange, so the start of the range is moved that length initially
+ and then a character at a time to make up for any trailing line breaks not contained in the 'text'
+ property. This has good performance in most situations compared to the previous two methods.
+ */
+ var tempRange = workingRange.duplicate();
+ var rangeLength = tempRange.text.replace(/\r\n/g, "\r").length;
+
+ offset = tempRange.moveStart("character", rangeLength);
+ while ( (comparison = tempRange.compareEndPoints("StartToEnd", tempRange)) == -1) {
+ offset++;
+ tempRange.moveStart("character", 1);
+ }
+ } else {
+ offset = workingRange.text.length;
+ }
+ boundaryPosition = new DomPosition(boundaryNode, offset);
+ } else {
+
+ // If the boundary immediately follows a character data node and this is the end boundary, we should favour
+ // a position within that, and likewise for a start boundary preceding a character data node
+ previousNode = (isCollapsed || !isStart) && workingNode.previousSibling;
+ nextNode = (isCollapsed || isStart) && workingNode.nextSibling;
+ if (nextNode && isCharacterDataNode(nextNode)) {
+ boundaryPosition = new DomPosition(nextNode, 0);
+ } else if (previousNode && isCharacterDataNode(previousNode)) {
+ boundaryPosition = new DomPosition(previousNode, previousNode.data.length);
+ } else {
+ boundaryPosition = new DomPosition(containerElement, dom.getNodeIndex(workingNode));
+ }
+ }
+
+ // Clean up
+ workingNode.parentNode.removeChild(workingNode);
+
+ return {
+ boundaryPosition: boundaryPosition,
+ nodeInfo: {
+ nodeIndex: nodeIndex,
+ containerElement: containerElement
+ }
+ };
+ };
+
+ // Returns a TextRange representing the boundary of a TextRange expressed as a node and an offset within that
+ // node. This function started out as an optimized version of code found in Tim Cameron Ryan's IERange
+ // (http://code.google.com/p/ierange/)
+ var createBoundaryTextRange = function(boundaryPosition, isStart) {
+ var boundaryNode, boundaryParent, boundaryOffset = boundaryPosition.offset;
+ var doc = dom.getDocument(boundaryPosition.node);
+ var workingNode, childNodes, workingRange = getBody(doc).createTextRange();
+ var nodeIsDataNode = isCharacterDataNode(boundaryPosition.node);
+
+ if (nodeIsDataNode) {
+ boundaryNode = boundaryPosition.node;
+ boundaryParent = boundaryNode.parentNode;
+ } else {
+ childNodes = boundaryPosition.node.childNodes;
+ boundaryNode = (boundaryOffset < childNodes.length) ? childNodes[boundaryOffset] : null;
+ boundaryParent = boundaryPosition.node;
+ }
+
+ // Position the range immediately before the node containing the boundary
+ workingNode = doc.createElement("span");
+
+ // Making the working element non-empty element persuades IE to consider the TextRange boundary to be within
+ // the element rather than immediately before or after it
+ workingNode.innerHTML = "&#feff;";
+
+ // insertBefore is supposed to work like appendChild if the second parameter is null. However, a bug report
+ // for IERange suggests that it can crash the browser: http://code.google.com/p/ierange/issues/detail?id=12
+ if (boundaryNode) {
+ boundaryParent.insertBefore(workingNode, boundaryNode);
+ } else {
+ boundaryParent.appendChild(workingNode);
+ }
+
+ workingRange.moveToElementText(workingNode);
+ workingRange.collapse(!isStart);
+
+ // Clean up
+ boundaryParent.removeChild(workingNode);
+
+ // Move the working range to the text offset, if required
+ if (nodeIsDataNode) {
+ workingRange[isStart ? "moveStart" : "moveEnd"]("character", boundaryOffset);
+ }
+
+ return workingRange;
+ };
+
+ /*------------------------------------------------------------------------------------------------------------*/
+
+ // This is a wrapper around a TextRange, providing full DOM Range functionality using rangy's DomRange as a
+ // prototype
+
+ WrappedTextRange = function(textRange) {
+ this.textRange = textRange;
+ this.refresh();
+ };
+
+ WrappedTextRange.prototype = new DomRange(document);
+
+ WrappedTextRange.prototype.refresh = function() {
+ var start, end, startBoundary;
+
+ // TextRange's parentElement() method cannot be trusted. getTextRangeContainerElement() works around that.
+ var rangeContainerElement = getTextRangeContainerElement(this.textRange);
+
+ if (textRangeIsCollapsed(this.textRange)) {
+ end = start = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true,
+ true).boundaryPosition;
+ } else {
+ startBoundary = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, true, false);
+ start = startBoundary.boundaryPosition;
+
+ // An optimization used here is that if the start and end boundaries have the same parent element, the
+ // search scope for the end boundary can be limited to exclude the portion of the element that precedes
+ // the start boundary
+ end = getTextRangeBoundaryPosition(this.textRange, rangeContainerElement, false, false,
+ startBoundary.nodeInfo).boundaryPosition;
+ }
+
+ this.setStart(start.node, start.offset);
+ this.setEnd(end.node, end.offset);
+ };
+
+ WrappedTextRange.prototype.getName = function() {
+ return "WrappedTextRange";
+ };
+
+ DomRange.copyComparisonConstants(WrappedTextRange);
+
+ var rangeToTextRange = function(range) {
+ if (range.collapsed) {
+ return createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);
+ } else {
+ var startRange = createBoundaryTextRange(new DomPosition(range.startContainer, range.startOffset), true);
+ var endRange = createBoundaryTextRange(new DomPosition(range.endContainer, range.endOffset), false);
+ var textRange = getBody( DomRange.getRangeDocument(range) ).createTextRange();
+ textRange.setEndPoint("StartToStart", startRange);
+ textRange.setEndPoint("EndToEnd", endRange);
+ return textRange;
+ }
+ };
+
+ WrappedTextRange.rangeToTextRange = rangeToTextRange;
+
+ WrappedTextRange.prototype.toTextRange = function() {
+ return rangeToTextRange(this);
+ };
+
+ api.WrappedTextRange = WrappedTextRange;
+
+ // IE 9 and above have both implementations and Rangy makes both available. The next few lines sets which
+ // implementation to use by default.
+ if (!api.features.implementsDomRange || api.config.preferTextRange) {
+ // Add WrappedTextRange as the Range property of the global object to allow expression like Range.END_TO_END to work
+ var globalObj = (function() { return this; })();
+ if (typeof globalObj.Range == "undefined") {
+ globalObj.Range = WrappedTextRange;
+ }
+
+ api.createNativeRange = function(doc) {
+ doc = getContentDocument(doc, module, "createNativeRange");
+ return getBody(doc).createTextRange();
+ };
+
+ api.WrappedRange = WrappedTextRange;
+ }
+ }
+
+ api.createRange = function(doc) {
+ doc = getContentDocument(doc, module, "createRange");
+ return new api.WrappedRange(api.createNativeRange(doc));
+ };
+
+ api.createRangyRange = function(doc) {
+ doc = getContentDocument(doc, module, "createRangyRange");
+ return new DomRange(doc);
+ };
+
+ api.createIframeRange = function(iframeEl) {
+ module.deprecationNotice("createIframeRange()", "createRange(iframeEl)");
+ return api.createRange(iframeEl);
+ };
+
+ api.createIframeRangyRange = function(iframeEl) {
+ module.deprecationNotice("createIframeRangyRange()", "createRangyRange(iframeEl)");
+ return api.createRangyRange(iframeEl);
+ };
+
+ api.addShimListener(function(win) {
+ var doc = win.document;
+ if (typeof doc.createRange == "undefined") {
+ doc.createRange = function() {
+ return api.createRange(doc);
+ };
+ }
+ doc = win = null;
+ });
+ });
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ // This module creates a selection object wrapper that conforms as closely as possible to the Selection specification
+ // in the HTML Editing spec (http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections)
+ api.createCoreModule("WrappedSelection", ["DomRange", "WrappedRange"], function(api, module) {
+ api.config.checkSelectionRanges = true;
+
+ var BOOLEAN = "boolean";
+ var NUMBER = "number";
+ var dom = api.dom;
+ var util = api.util;
+ var isHostMethod = util.isHostMethod;
+ var DomRange = api.DomRange;
+ var WrappedRange = api.WrappedRange;
+ var DOMException = api.DOMException;
+ var DomPosition = dom.DomPosition;
+ var getNativeSelection;
+ var selectionIsCollapsed;
+ var features = api.features;
+ var CONTROL = "Control";
+ var getDocument = dom.getDocument;
+ var getBody = dom.getBody;
+ var rangesEqual = DomRange.rangesEqual;
+
+
+ // Utility function to support direction parameters in the API that may be a string ("backward" or "forward") or a
+ // Boolean (true for backwards).
+ function isDirectionBackward(dir) {
+ return (typeof dir == "string") ? /^backward(s)?$/i.test(dir) : !!dir;
+ }
+
+ function getWindow(win, methodName) {
+ if (!win) {
+ return window;
+ } else if (dom.isWindow(win)) {
+ return win;
+ } else if (win instanceof WrappedSelection) {
+ return win.win;
+ } else {
+ var doc = dom.getContentDocument(win, module, methodName);
+ return dom.getWindow(doc);
+ }
+ }
+
+ function getWinSelection(winParam) {
+ return getWindow(winParam, "getWinSelection").getSelection();
+ }
+
+ function getDocSelection(winParam) {
+ return getWindow(winParam, "getDocSelection").document.selection;
+ }
+
+ function winSelectionIsBackward(sel) {
+ var backward = false;
+ if (sel.anchorNode) {
+ backward = (dom.comparePoints(sel.anchorNode, sel.anchorOffset, sel.focusNode, sel.focusOffset) == 1);
+ }
+ return backward;
+ }
+
+ // Test for the Range/TextRange and Selection features required
+ // Test for ability to retrieve selection
+ var implementsWinGetSelection = isHostMethod(window, "getSelection"),
+ implementsDocSelection = util.isHostObject(document, "selection");
+
+ features.implementsWinGetSelection = implementsWinGetSelection;
+ features.implementsDocSelection = implementsDocSelection;
+
+ var useDocumentSelection = implementsDocSelection && (!implementsWinGetSelection || api.config.preferTextRange);
+
+ if (useDocumentSelection) {
+ getNativeSelection = getDocSelection;
+ api.isSelectionValid = function(winParam) {
+ var doc = getWindow(winParam, "isSelectionValid").document, nativeSel = doc.selection;
+
+ // Check whether the selection TextRange is actually contained within the correct document
+ return (nativeSel.type != "None" || getDocument(nativeSel.createRange().parentElement()) == doc);
+ };
+ } else if (implementsWinGetSelection) {
+ getNativeSelection = getWinSelection;
+ api.isSelectionValid = function() {
+ return true;
+ };
+ } else {
+ module.fail("Neither document.selection or window.getSelection() detected.");
+ }
+
+ api.getNativeSelection = getNativeSelection;
+
+ var testSelection = getNativeSelection();
+ var testRange = api.createNativeRange(document);
+ var body = getBody(document);
+
+ // Obtaining a range from a selection
+ var selectionHasAnchorAndFocus = util.areHostProperties(testSelection,
+ ["anchorNode", "focusNode", "anchorOffset", "focusOffset"]);
+
+ features.selectionHasAnchorAndFocus = selectionHasAnchorAndFocus;
+
+ // Test for existence of native selection extend() method
+ var selectionHasExtend = isHostMethod(testSelection, "extend");
+ features.selectionHasExtend = selectionHasExtend;
+
+ // Test if rangeCount exists
+ var selectionHasRangeCount = (typeof testSelection.rangeCount == NUMBER);
+ features.selectionHasRangeCount = selectionHasRangeCount;
+
+ var selectionSupportsMultipleRanges = false;
+ var collapsedNonEditableSelectionsSupported = true;
+
+ var addRangeBackwardToNative = selectionHasExtend ?
+ function(nativeSelection, range) {
+ var doc = DomRange.getRangeDocument(range);
+ var endRange = api.createRange(doc);
+ endRange.collapseToPoint(range.endContainer, range.endOffset);
+ nativeSelection.addRange(getNativeRange(endRange));
+ nativeSelection.extend(range.startContainer, range.startOffset);
+ } : null;
+
+ if (util.areHostMethods(testSelection, ["addRange", "getRangeAt", "removeAllRanges"]) &&
+ typeof testSelection.rangeCount == NUMBER && features.implementsDomRange) {
+
+ (function() {
+ // Previously an iframe was used but this caused problems in some circumstances in IE, so tests are
+ // performed on the current document's selection. See issue 109.
+
+ // Note also that if a selection previously existed, it is wiped by these tests. This should usually be fine
+ // because initialization usually happens when the document loads, but could be a problem for a script that
+ // loads and initializes Rangy later. If anyone complains, code could be added to save and restore the
+ // selection.
+ var sel = window.getSelection();
+ if (sel) {
+ // Store the current selection
+ var originalSelectionRangeCount = sel.rangeCount;
+ var selectionHasMultipleRanges = (originalSelectionRangeCount > 1);
+ var originalSelectionRanges = [];
+ var originalSelectionBackward = winSelectionIsBackward(sel);
+ for (var i = 0; i < originalSelectionRangeCount; ++i) {
+ originalSelectionRanges[i] = sel.getRangeAt(i);
+ }
+
+ // Create some test elements
+ var body = getBody(document);
+ var testEl = body.appendChild( document.createElement("div") );
+ testEl.contentEditable = "false";
+ var textNode = testEl.appendChild( document.createTextNode("\u00a0\u00a0\u00a0") );
+
+ // Test whether the native selection will allow a collapsed selection within a non-editable element
+ var r1 = document.createRange();
+
+ r1.setStart(textNode, 1);
+ r1.collapse(true);
+ sel.addRange(r1);
+ collapsedNonEditableSelectionsSupported = (sel.rangeCount == 1);
+ sel.removeAllRanges();
+
+ // Test whether the native selection is capable of supporting multiple ranges.
+ if (!selectionHasMultipleRanges) {
+ // Doing the original feature test here in Chrome 36 (and presumably later versions) prints a
+ // console error of "Discontiguous selection is not supported." that cannot be suppressed. There's
+ // nothing we can do about this while retaining the feature test so we have to resort to a browser
+ // sniff. I'm not happy about it. See
+ // https://code.google.com/p/chromium/issues/detail?id=399791
+ var chromeMatch = window.navigator.appVersion.match(/Chrome\/(.*?) /);
+ if (chromeMatch && parseInt(chromeMatch[1]) >= 36) {
+ selectionSupportsMultipleRanges = false;
+ } else {
+ var r2 = r1.cloneRange();
+ r1.setStart(textNode, 0);
+ r2.setEnd(textNode, 3);
+ r2.setStart(textNode, 2);
+ sel.addRange(r1);
+ sel.addRange(r2);
+ selectionSupportsMultipleRanges = (sel.rangeCount == 2);
+ }
+ }
+
+ // Clean up
+ body.removeChild(testEl);
+ sel.removeAllRanges();
+
+ for (i = 0; i < originalSelectionRangeCount; ++i) {
+ if (i == 0 && originalSelectionBackward) {
+ if (addRangeBackwardToNative) {
+ addRangeBackwardToNative(sel, originalSelectionRanges[i]);
+ } else {
+ api.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend");
+ sel.addRange(originalSelectionRanges[i]);
+ }
+ } else {
+ sel.addRange(originalSelectionRanges[i]);
+ }
+ }
+ }
+ })();
+ }
+
+ features.selectionSupportsMultipleRanges = selectionSupportsMultipleRanges;
+ features.collapsedNonEditableSelectionsSupported = collapsedNonEditableSelectionsSupported;
+
+ // ControlRanges
+ var implementsControlRange = false, testControlRange;
+
+ if (body && isHostMethod(body, "createControlRange")) {
+ testControlRange = body.createControlRange();
+ if (util.areHostProperties(testControlRange, ["item", "add"])) {
+ implementsControlRange = true;
+ }
+ }
+ features.implementsControlRange = implementsControlRange;
+
+ // Selection collapsedness
+ if (selectionHasAnchorAndFocus) {
+ selectionIsCollapsed = function(sel) {
+ return sel.anchorNode === sel.focusNode && sel.anchorOffset === sel.focusOffset;
+ };
+ } else {
+ selectionIsCollapsed = function(sel) {
+ return sel.rangeCount ? sel.getRangeAt(sel.rangeCount - 1).collapsed : false;
+ };
+ }
+
+ function updateAnchorAndFocusFromRange(sel, range, backward) {
+ var anchorPrefix = backward ? "end" : "start", focusPrefix = backward ? "start" : "end";
+ sel.anchorNode = range[anchorPrefix + "Container"];
+ sel.anchorOffset = range[anchorPrefix + "Offset"];
+ sel.focusNode = range[focusPrefix + "Container"];
+ sel.focusOffset = range[focusPrefix + "Offset"];
+ }
+
+ function updateAnchorAndFocusFromNativeSelection(sel) {
+ var nativeSel = sel.nativeSelection;
+ sel.anchorNode = nativeSel.anchorNode;
+ sel.anchorOffset = nativeSel.anchorOffset;
+ sel.focusNode = nativeSel.focusNode;
+ sel.focusOffset = nativeSel.focusOffset;
+ }
+
+ function updateEmptySelection(sel) {
+ sel.anchorNode = sel.focusNode = null;
+ sel.anchorOffset = sel.focusOffset = 0;
+ sel.rangeCount = 0;
+ sel.isCollapsed = true;
+ sel._ranges.length = 0;
+ }
+
+ function getNativeRange(range) {
+ var nativeRange;
+ if (range instanceof DomRange) {
+ nativeRange = api.createNativeRange(range.getDocument());
+ nativeRange.setEnd(range.endContainer, range.endOffset);
+ nativeRange.setStart(range.startContainer, range.startOffset);
+ } else if (range instanceof WrappedRange) {
+ nativeRange = range.nativeRange;
+ } else if (features.implementsDomRange && (range instanceof dom.getWindow(range.startContainer).Range)) {
+ nativeRange = range;
+ }
+ return nativeRange;
+ }
+
+ function rangeContainsSingleElement(rangeNodes) {
+ if (!rangeNodes.length || rangeNodes[0].nodeType != 1) {
+ return false;
+ }
+ for (var i = 1, len = rangeNodes.length; i < len; ++i) {
+ if (!dom.isAncestorOf(rangeNodes[0], rangeNodes[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function getSingleElementFromRange(range) {
+ var nodes = range.getNodes();
+ if (!rangeContainsSingleElement(nodes)) {
+ throw module.createError("getSingleElementFromRange: range " + range.inspect() + " did not consist of a single element");
+ }
+ return nodes[0];
+ }
+
+ // Simple, quick test which only needs to distinguish between a TextRange and a ControlRange
+ function isTextRange(range) {
+ return !!range && typeof range.text != "undefined";
+ }
+
+ function updateFromTextRange(sel, range) {
+ // Create a Range from the selected TextRange
+ var wrappedRange = new WrappedRange(range);
+ sel._ranges = [wrappedRange];
+
+ updateAnchorAndFocusFromRange(sel, wrappedRange, false);
+ sel.rangeCount = 1;
+ sel.isCollapsed = wrappedRange.collapsed;
+ }
+
+ function updateControlSelection(sel) {
+ // Update the wrapped selection based on what's now in the native selection
+ sel._ranges.length = 0;
+ if (sel.docSelection.type == "None") {
+ updateEmptySelection(sel);
+ } else {
+ var controlRange = sel.docSelection.createRange();
+ if (isTextRange(controlRange)) {
+ // This case (where the selection type is "Control" and calling createRange() on the selection returns
+ // a TextRange) can happen in IE 9. It happens, for example, when all elements in the selected
+ // ControlRange have been removed from the ControlRange and removed from the document.
+ updateFromTextRange(sel, controlRange);
+ } else {
+ sel.rangeCount = controlRange.length;
+ var range, doc = getDocument(controlRange.item(0));
+ for (var i = 0; i < sel.rangeCount; ++i) {
+ range = api.createRange(doc);
+ range.selectNode(controlRange.item(i));
+ sel._ranges.push(range);
+ }
+ sel.isCollapsed = sel.rangeCount == 1 && sel._ranges[0].collapsed;
+ updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], false);
+ }
+ }
+ }
+
+ function addRangeToControlSelection(sel, range) {
+ var controlRange = sel.docSelection.createRange();
+ var rangeElement = getSingleElementFromRange(range);
+
+ // Create a new ControlRange containing all the elements in the selected ControlRange plus the element
+ // contained by the supplied range
+ var doc = getDocument(controlRange.item(0));
+ var newControlRange = getBody(doc).createControlRange();
+ for (var i = 0, len = controlRange.length; i < len; ++i) {
+ newControlRange.add(controlRange.item(i));
+ }
+ try {
+ newControlRange.add(rangeElement);
+ } catch (ex) {
+ throw module.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)");
+ }
+ newControlRange.select();
+
+ // Update the wrapped selection based on what's now in the native selection
+ updateControlSelection(sel);
+ }
+
+ var getSelectionRangeAt;
+
+ if (isHostMethod(testSelection, "getRangeAt")) {
+ // try/catch is present because getRangeAt() must have thrown an error in some browser and some situation.
+ // Unfortunately, I didn't write a comment about the specifics and am now scared to take it out. Let that be a
+ // lesson to us all, especially me.
+ getSelectionRangeAt = function(sel, index) {
+ try {
+ return sel.getRangeAt(index);
+ } catch (ex) {
+ return null;
+ }
+ };
+ } else if (selectionHasAnchorAndFocus) {
+ getSelectionRangeAt = function(sel) {
+ var doc = getDocument(sel.anchorNode);
+ var range = api.createRange(doc);
+ range.setStartAndEnd(sel.anchorNode, sel.anchorOffset, sel.focusNode, sel.focusOffset);
+
+ // Handle the case when the selection was selected backwards (from the end to the start in the
+ // document)
+ if (range.collapsed !== this.isCollapsed) {
+ range.setStartAndEnd(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset);
+ }
+
+ return range;
+ };
+ }
+
+ function WrappedSelection(selection, docSelection, win) {
+ this.nativeSelection = selection;
+ this.docSelection = docSelection;
+ this._ranges = [];
+ this.win = win;
+ this.refresh();
+ }
+
+ WrappedSelection.prototype = api.selectionPrototype;
+
+ function deleteProperties(sel) {
+ sel.win = sel.anchorNode = sel.focusNode = sel._ranges = null;
+ sel.rangeCount = sel.anchorOffset = sel.focusOffset = 0;
+ sel.detached = true;
+ }
+
+ var cachedRangySelections = [];
+
+ function actOnCachedSelection(win, action) {
+ var i = cachedRangySelections.length, cached, sel;
+ while (i--) {
+ cached = cachedRangySelections[i];
+ sel = cached.selection;
+ if (action == "deleteAll") {
+ deleteProperties(sel);
+ } else if (cached.win == win) {
+ if (action == "delete") {
+ cachedRangySelections.splice(i, 1);
+ return true;
+ } else {
+ return sel;
+ }
+ }
+ }
+ if (action == "deleteAll") {
+ cachedRangySelections.length = 0;
+ }
+ return null;
+ }
+
+ var getSelection = function(win) {
+ // Check if the parameter is a Rangy Selection object
+ if (win && win instanceof WrappedSelection) {
+ win.refresh();
+ return win;
+ }
+
+ win = getWindow(win, "getNativeSelection");
+
+ var sel = actOnCachedSelection(win);
+ var nativeSel = getNativeSelection(win), docSel = implementsDocSelection ? getDocSelection(win) : null;
+ if (sel) {
+ sel.nativeSelection = nativeSel;
+ sel.docSelection = docSel;
+ sel.refresh();
+ } else {
+ sel = new WrappedSelection(nativeSel, docSel, win);
+ cachedRangySelections.push( { win: win, selection: sel } );
+ }
+ return sel;
+ };
+
+ api.getSelection = getSelection;
+
+ api.getIframeSelection = function(iframeEl) {
+ module.deprecationNotice("getIframeSelection()", "getSelection(iframeEl)");
+ return api.getSelection(dom.getIframeWindow(iframeEl));
+ };
+
+ var selProto = WrappedSelection.prototype;
+
+ function createControlSelection(sel, ranges) {
+ // Ensure that the selection becomes of type "Control"
+ var doc = getDocument(ranges[0].startContainer);
+ var controlRange = getBody(doc).createControlRange();
+ for (var i = 0, el, len = ranges.length; i < len; ++i) {
+ el = getSingleElementFromRange(ranges[i]);
+ try {
+ controlRange.add(el);
+ } catch (ex) {
+ throw module.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)");
+ }
+ }
+ controlRange.select();
+
+ // Update the wrapped selection based on what's now in the native selection
+ updateControlSelection(sel);
+ }
+
+ // Selecting a range
+ if (!useDocumentSelection && selectionHasAnchorAndFocus && util.areHostMethods(testSelection, ["removeAllRanges", "addRange"])) {
+ selProto.removeAllRanges = function() {
+ this.nativeSelection.removeAllRanges();
+ updateEmptySelection(this);
+ };
+
+ var addRangeBackward = function(sel, range) {
+ addRangeBackwardToNative(sel.nativeSelection, range);
+ sel.refresh();
+ };
+
+ if (selectionHasRangeCount) {
+ selProto.addRange = function(range, direction) {
+ if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {
+ addRangeToControlSelection(this, range);
+ } else {
+ if (isDirectionBackward(direction) && selectionHasExtend) {
+ addRangeBackward(this, range);
+ } else {
+ var previousRangeCount;
+ if (selectionSupportsMultipleRanges) {
+ previousRangeCount = this.rangeCount;
+ } else {
+ this.removeAllRanges();
+ previousRangeCount = 0;
+ }
+ // Clone the native range so that changing the selected range does not affect the selection.
+ // This is contrary to the spec but is the only way to achieve consistency between browsers. See
+ // issue 80.
+ this.nativeSelection.addRange(getNativeRange(range).cloneRange());
+
+ // Check whether adding the range was successful
+ this.rangeCount = this.nativeSelection.rangeCount;
+
+ if (this.rangeCount == previousRangeCount + 1) {
+ // The range was added successfully
+
+ // Check whether the range that we added to the selection is reflected in the last range extracted from
+ // the selection
+ if (api.config.checkSelectionRanges) {
+ var nativeRange = getSelectionRangeAt(this.nativeSelection, this.rangeCount - 1);
+ if (nativeRange && !rangesEqual(nativeRange, range)) {
+ // Happens in WebKit with, for example, a selection placed at the start of a text node
+ range = new WrappedRange(nativeRange);
+ }
+ }
+ this._ranges[this.rangeCount - 1] = range;
+ updateAnchorAndFocusFromRange(this, range, selectionIsBackward(this.nativeSelection));
+ this.isCollapsed = selectionIsCollapsed(this);
+ } else {
+ // The range was not added successfully. The simplest thing is to refresh
+ this.refresh();
+ }
+ }
+ }
+ };
+ } else {
+ selProto.addRange = function(range, direction) {
+ if (isDirectionBackward(direction) && selectionHasExtend) {
+ addRangeBackward(this, range);
+ } else {
+ this.nativeSelection.addRange(getNativeRange(range));
+ this.refresh();
+ }
+ };
+ }
+
+ selProto.setRanges = function(ranges) {
+ if (implementsControlRange && implementsDocSelection && ranges.length > 1) {
+ createControlSelection(this, ranges);
+ } else {
+ this.removeAllRanges();
+ for (var i = 0, len = ranges.length; i < len; ++i) {
+ this.addRange(ranges[i]);
+ }
+ }
+ };
+ } else if (isHostMethod(testSelection, "empty") && isHostMethod(testRange, "select") &&
+ implementsControlRange && useDocumentSelection) {
+
+ selProto.removeAllRanges = function() {
+ // Added try/catch as fix for issue #21
+ try {
+ this.docSelection.empty();
+
+ // Check for empty() not working (issue #24)
+ if (this.docSelection.type != "None") {
+ // Work around failure to empty a control selection by instead selecting a TextRange and then
+ // calling empty()
+ var doc;
+ if (this.anchorNode) {
+ doc = getDocument(this.anchorNode);
+ } else if (this.docSelection.type == CONTROL) {
+ var controlRange = this.docSelection.createRange();
+ if (controlRange.length) {
+ doc = getDocument( controlRange.item(0) );
+ }
+ }
+ if (doc) {
+ var textRange = getBody(doc).createTextRange();
+ textRange.select();
+ this.docSelection.empty();
+ }
+ }
+ } catch(ex) {}
+ updateEmptySelection(this);
+ };
+
+ selProto.addRange = function(range) {
+ if (this.docSelection.type == CONTROL) {
+ addRangeToControlSelection(this, range);
+ } else {
+ api.WrappedTextRange.rangeToTextRange(range).select();
+ this._ranges[0] = range;
+ this.rangeCount = 1;
+ this.isCollapsed = this._ranges[0].collapsed;
+ updateAnchorAndFocusFromRange(this, range, false);
+ }
+ };
+
+ selProto.setRanges = function(ranges) {
+ this.removeAllRanges();
+ var rangeCount = ranges.length;
+ if (rangeCount > 1) {
+ createControlSelection(this, ranges);
+ } else if (rangeCount) {
+ this.addRange(ranges[0]);
+ }
+ };
+ } else {
+ module.fail("No means of selecting a Range or TextRange was found");
+ return false;
+ }
+
+ selProto.getRangeAt = function(index) {
+ if (index < 0 || index >= this.rangeCount) {
+ throw new DOMException("INDEX_SIZE_ERR");
+ } else {
+ // Clone the range to preserve selection-range independence. See issue 80.
+ return this._ranges[index].cloneRange();
+ }
+ };
+
+ var refreshSelection;
+
+ if (useDocumentSelection) {
+ refreshSelection = function(sel) {
+ var range;
+ if (api.isSelectionValid(sel.win)) {
+ range = sel.docSelection.createRange();
+ } else {
+ range = getBody(sel.win.document).createTextRange();
+ range.collapse(true);
+ }
+
+ if (sel.docSelection.type == CONTROL) {
+ updateControlSelection(sel);
+ } else if (isTextRange(range)) {
+ updateFromTextRange(sel, range);
+ } else {
+ updateEmptySelection(sel);
+ }
+ };
+ } else if (isHostMethod(testSelection, "getRangeAt") && typeof testSelection.rangeCount == NUMBER) {
+ refreshSelection = function(sel) {
+ if (implementsControlRange && implementsDocSelection && sel.docSelection.type == CONTROL) {
+ updateControlSelection(sel);
+ } else {
+ sel._ranges.length = sel.rangeCount = sel.nativeSelection.rangeCount;
+ if (sel.rangeCount) {
+ for (var i = 0, len = sel.rangeCount; i < len; ++i) {
+ sel._ranges[i] = new api.WrappedRange(sel.nativeSelection.getRangeAt(i));
+ }
+ updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], selectionIsBackward(sel.nativeSelection));
+ sel.isCollapsed = selectionIsCollapsed(sel);
+ } else {
+ updateEmptySelection(sel);
+ }
+ }
+ };
+ } else if (selectionHasAnchorAndFocus && typeof testSelection.isCollapsed == BOOLEAN && typeof testRange.collapsed == BOOLEAN && features.implementsDomRange) {
+ refreshSelection = function(sel) {
+ var range, nativeSel = sel.nativeSelection;
+ if (nativeSel.anchorNode) {
+ range = getSelectionRangeAt(nativeSel, 0);
+ sel._ranges = [range];
+ sel.rangeCount = 1;
+ updateAnchorAndFocusFromNativeSelection(sel);
+ sel.isCollapsed = selectionIsCollapsed(sel);
+ } else {
+ updateEmptySelection(sel);
+ }
+ };
+ } else {
+ module.fail("No means of obtaining a Range or TextRange from the user's selection was found");
+ return false;
+ }
+
+ selProto.refresh = function(checkForChanges) {
+ var oldRanges = checkForChanges ? this._ranges.slice(0) : null;
+ var oldAnchorNode = this.anchorNode, oldAnchorOffset = this.anchorOffset;
+
+ refreshSelection(this);
+ if (checkForChanges) {
+ // Check the range count first
+ var i = oldRanges.length;
+ if (i != this._ranges.length) {
+ return true;
+ }
+
+ // Now check the direction. Checking the anchor position is the same is enough since we're checking all the
+ // ranges after this
+ if (this.anchorNode != oldAnchorNode || this.anchorOffset != oldAnchorOffset) {
+ return true;
+ }
+
+ // Finally, compare each range in turn
+ while (i--) {
+ if (!rangesEqual(oldRanges[i], this._ranges[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+ };
+
+ // Removal of a single range
+ var removeRangeManually = function(sel, range) {
+ var ranges = sel.getAllRanges();
+ sel.removeAllRanges();
+ for (var i = 0, len = ranges.length; i < len; ++i) {
+ if (!rangesEqual(range, ranges[i])) {
+ sel.addRange(ranges[i]);
+ }
+ }
+ if (!sel.rangeCount) {
+ updateEmptySelection(sel);
+ }
+ };
+
+ if (implementsControlRange && implementsDocSelection) {
+ selProto.removeRange = function(range) {
+ if (this.docSelection.type == CONTROL) {
+ var controlRange = this.docSelection.createRange();
+ var rangeElement = getSingleElementFromRange(range);
+
+ // Create a new ControlRange containing all the elements in the selected ControlRange minus the
+ // element contained by the supplied range
+ var doc = getDocument(controlRange.item(0));
+ var newControlRange = getBody(doc).createControlRange();
+ var el, removed = false;
+ for (var i = 0, len = controlRange.length; i < len; ++i) {
+ el = controlRange.item(i);
+ if (el !== rangeElement || removed) {
+ newControlRange.add(controlRange.item(i));
+ } else {
+ removed = true;
+ }
+ }
+ newControlRange.select();
+
+ // Update the wrapped selection based on what's now in the native selection
+ updateControlSelection(this);
+ } else {
+ removeRangeManually(this, range);
+ }
+ };
+ } else {
+ selProto.removeRange = function(range) {
+ removeRangeManually(this, range);
+ };
+ }
+
+ // Detecting if a selection is backward
+ var selectionIsBackward;
+ if (!useDocumentSelection && selectionHasAnchorAndFocus && features.implementsDomRange) {
+ selectionIsBackward = winSelectionIsBackward;
+
+ selProto.isBackward = function() {
+ return selectionIsBackward(this);
+ };
+ } else {
+ selectionIsBackward = selProto.isBackward = function() {
+ return false;
+ };
+ }
+
+ // Create an alias for backwards compatibility. From 1.3, everything is "backward" rather than "backwards"
+ selProto.isBackwards = selProto.isBackward;
+
+ // Selection stringifier
+ // This is conformant to the old HTML5 selections draft spec but differs from WebKit and Mozilla's implementation.
+ // The current spec does not yet define this method.
+ selProto.toString = function() {
+ var rangeTexts = [];
+ for (var i = 0, len = this.rangeCount; i < len; ++i) {
+ rangeTexts[i] = "" + this._ranges[i];
+ }
+ return rangeTexts.join("");
+ };
+
+ function assertNodeInSameDocument(sel, node) {
+ if (sel.win.document != getDocument(node)) {
+ throw new DOMException("WRONG_DOCUMENT_ERR");
+ }
+ }
+
+ // No current browser conforms fully to the spec for this method, so Rangy's own method is always used
+ selProto.collapse = function(node, offset) {
+ assertNodeInSameDocument(this, node);
+ var range = api.createRange(node);
+ range.collapseToPoint(node, offset);
+ this.setSingleRange(range);
+ this.isCollapsed = true;
+ };
+
+ selProto.collapseToStart = function() {
+ if (this.rangeCount) {
+ var range = this._ranges[0];
+ this.collapse(range.startContainer, range.startOffset);
+ } else {
+ throw new DOMException("INVALID_STATE_ERR");
+ }
+ };
+
+ selProto.collapseToEnd = function() {
+ if (this.rangeCount) {
+ var range = this._ranges[this.rangeCount - 1];
+ this.collapse(range.endContainer, range.endOffset);
+ } else {
+ throw new DOMException("INVALID_STATE_ERR");
+ }
+ };
+
+ // The spec is very specific on how selectAllChildren should be implemented so the native implementation is
+ // never used by Rangy.
+ selProto.selectAllChildren = function(node) {
+ assertNodeInSameDocument(this, node);
+ var range = api.createRange(node);
+ range.selectNodeContents(node);
+ this.setSingleRange(range);
+ };
+
+ selProto.deleteFromDocument = function() {
+ // Sepcial behaviour required for IE's control selections
+ if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {
+ var controlRange = this.docSelection.createRange();
+ var element;
+ while (controlRange.length) {
+ element = controlRange.item(0);
+ controlRange.remove(element);
+ element.parentNode.removeChild(element);
+ }
+ this.refresh();
+ } else if (this.rangeCount) {
+ var ranges = this.getAllRanges();
+ if (ranges.length) {
+ this.removeAllRanges();
+ for (var i = 0, len = ranges.length; i < len; ++i) {
+ ranges[i].deleteContents();
+ }
+ // The spec says nothing about what the selection should contain after calling deleteContents on each
+ // range. Firefox moves the selection to where the final selected range was, so we emulate that
+ this.addRange(ranges[len - 1]);
+ }
+ }
+ };
+
+ // The following are non-standard extensions
+ selProto.eachRange = function(func, returnValue) {
+ for (var i = 0, len = this._ranges.length; i < len; ++i) {
+ if ( func( this.getRangeAt(i) ) ) {
+ return returnValue;
+ }
+ }
+ };
+
+ selProto.getAllRanges = function() {
+ var ranges = [];
+ this.eachRange(function(range) {
+ ranges.push(range);
+ });
+ return ranges;
+ };
+
+ selProto.setSingleRange = function(range, direction) {
+ this.removeAllRanges();
+ this.addRange(range, direction);
+ };
+
+ selProto.callMethodOnEachRange = function(methodName, params) {
+ var results = [];
+ this.eachRange( function(range) {
+ results.push( range[methodName].apply(range, params) );
+ } );
+ return results;
+ };
+
+ function createStartOrEndSetter(isStart) {
+ return function(node, offset) {
+ var range;
+ if (this.rangeCount) {
+ range = this.getRangeAt(0);
+ range["set" + (isStart ? "Start" : "End")](node, offset);
+ } else {
+ range = api.createRange(this.win.document);
+ range.setStartAndEnd(node, offset);
+ }
+ this.setSingleRange(range, this.isBackward());
+ };
+ }
+
+ selProto.setStart = createStartOrEndSetter(true);
+ selProto.setEnd = createStartOrEndSetter(false);
+
+ // Add select() method to Range prototype. Any existing selection will be removed.
+ api.rangePrototype.select = function(direction) {
+ getSelection( this.getDocument() ).setSingleRange(this, direction);
+ };
+
+ selProto.changeEachRange = function(func) {
+ var ranges = [];
+ var backward = this.isBackward();
+
+ this.eachRange(function(range) {
+ func(range);
+ ranges.push(range);
+ });
+
+ this.removeAllRanges();
+ if (backward && ranges.length == 1) {
+ this.addRange(ranges[0], "backward");
+ } else {
+ this.setRanges(ranges);
+ }
+ };
+
+ selProto.containsNode = function(node, allowPartial) {
+ return this.eachRange( function(range) {
+ return range.containsNode(node, allowPartial);
+ }, true ) || false;
+ };
+
+ selProto.getBookmark = function(containerNode) {
+ return {
+ backward: this.isBackward(),
+ rangeBookmarks: this.callMethodOnEachRange("getBookmark", [containerNode])
+ };
+ };
+
+ selProto.moveToBookmark = function(bookmark) {
+ var selRanges = [];
+ for (var i = 0, rangeBookmark, range; rangeBookmark = bookmark.rangeBookmarks[i++]; ) {
+ range = api.createRange(this.win);
+ range.moveToBookmark(rangeBookmark);
+ selRanges.push(range);
+ }
+ if (bookmark.backward) {
+ this.setSingleRange(selRanges[0], "backward");
+ } else {
+ this.setRanges(selRanges);
+ }
+ };
+
+ selProto.toHtml = function() {
+ var rangeHtmls = [];
+ this.eachRange(function(range) {
+ rangeHtmls.push( DomRange.toHtml(range) );
+ });
+ return rangeHtmls.join("");
+ };
+
+ if (features.implementsTextRange) {
+ selProto.getNativeTextRange = function() {
+ var sel, textRange;
+ if ( (sel = this.docSelection) ) {
+ var range = sel.createRange();
+ if (isTextRange(range)) {
+ return range;
+ } else {
+ throw module.createError("getNativeTextRange: selection is a control selection");
+ }
+ } else if (this.rangeCount > 0) {
+ return api.WrappedTextRange.rangeToTextRange( this.getRangeAt(0) );
+ } else {
+ throw module.createError("getNativeTextRange: selection contains no range");
+ }
+ };
+ }
+
+ function inspect(sel) {
+ var rangeInspects = [];
+ var anchor = new DomPosition(sel.anchorNode, sel.anchorOffset);
+ var focus = new DomPosition(sel.focusNode, sel.focusOffset);
+ var name = (typeof sel.getName == "function") ? sel.getName() : "Selection";
+
+ if (typeof sel.rangeCount != "undefined") {
+ for (var i = 0, len = sel.rangeCount; i < len; ++i) {
+ rangeInspects[i] = DomRange.inspect(sel.getRangeAt(i));
+ }
+ }
+ return "[" + name + "(Ranges: " + rangeInspects.join(", ") +
+ ")(anchor: " + anchor.inspect() + ", focus: " + focus.inspect() + "]";
+ }
+
+ selProto.getName = function() {
+ return "WrappedSelection";
+ };
+
+ selProto.inspect = function() {
+ return inspect(this);
+ };
+
+ selProto.detach = function() {
+ actOnCachedSelection(this.win, "delete");
+ deleteProperties(this);
+ };
+
+ WrappedSelection.detachAll = function() {
+ actOnCachedSelection(null, "deleteAll");
+ };
+
+ WrappedSelection.inspect = inspect;
+ WrappedSelection.isDirectionBackward = isDirectionBackward;
+
+ api.Selection = WrappedSelection;
+
+ api.selectionPrototype = selProto;
+
+ api.addShimListener(function(win) {
+ if (typeof win.getSelection == "undefined") {
+ win.getSelection = function() {
+ return getSelection(win);
+ };
+ }
+ win = null;
+ });
+ });
+
+
+ /*----------------------------------------------------------------------------------------------------------------*/
+
+ return api;
+}, this);;/**
+ * Selection save and restore module for Rangy.
+ * Saves and restores user selections using marker invisible elements in the DOM.
+ *
+ * Part of Rangy, a cross-browser JavaScript range and selection library
+ * http://code.google.com/p/rangy/
+ *
+ * Depends on Rangy core.
+ *
+ * Copyright 2014, Tim Down
+ * Licensed under the MIT license.
+ * Version: 1.3alpha.20140804
+ * Build date: 4 August 2014
+ */
+(function(factory, global) {
+ if (typeof define == "function" && define.amd) {
+ // AMD. Register as an anonymous module with a dependency on Rangy.
+ define(["rangy"], factory);
+ /*
+ } else if (typeof exports == "object") {
+ // Node/CommonJS style for Browserify
+ module.exports = factory;
+ */
+ } else {
+ // No AMD or CommonJS support so we use the rangy global variable
+ factory(global.rangy);
+ }
+})(function(rangy) {
+ rangy.createModule("SaveRestore", ["WrappedRange"], function(api, module) {
+ var dom = api.dom;
+
+ var markerTextChar = "\ufeff";
+
+ function gEBI(id, doc) {
+ return (doc || document).getElementById(id);
+ }
+
+ function insertRangeBoundaryMarker(range, atStart) {
+ var markerId = "selectionBoundary_" + (+new Date()) + "_" + ("" + Math.random()).slice(2);
+ var markerEl;
+ var doc = dom.getDocument(range.startContainer);
+
+ // Clone the Range and collapse to the appropriate boundary point
+ var boundaryRange = range.cloneRange();
+ boundaryRange.collapse(atStart);
+
+ // Create the marker element containing a single invisible character using DOM methods and insert it
+ markerEl = doc.createElement("span");
+ markerEl.id = markerId;
+ markerEl.style.lineHeight = "0";
+ markerEl.style.display = "none";
+ markerEl.className = "rangySelectionBoundary";
+ markerEl.appendChild(doc.createTextNode(markerTextChar));
+
+ boundaryRange.insertNode(markerEl);
+ return markerEl;
+ }
+
+ function setRangeBoundary(doc, range, markerId, atStart) {
+ var markerEl = gEBI(markerId, doc);
+ if (markerEl) {
+ range[atStart ? "setStartBefore" : "setEndBefore"](markerEl);
+ markerEl.parentNode.removeChild(markerEl);
+ } else {
+ module.warn("Marker element has been removed. Cannot restore selection.");
+ }
+ }
+
+ function compareRanges(r1, r2) {
+ return r2.compareBoundaryPoints(r1.START_TO_START, r1);
+ }
+
+ function saveRange(range, backward) {
+ var startEl, endEl, doc = api.DomRange.getRangeDocument(range), text = range.toString();
+
+ if (range.collapsed) {
+ endEl = insertRangeBoundaryMarker(range, false);
+ return {
+ document: doc,
+ markerId: endEl.id,
+ collapsed: true
+ };
+ } else {
+ endEl = insertRangeBoundaryMarker(range, false);
+ startEl = insertRangeBoundaryMarker(range, true);
+
+ return {
+ document: doc,
+ startMarkerId: startEl.id,
+ endMarkerId: endEl.id,
+ collapsed: false,
+ backward: backward,
+ toString: function() {
+ return "original text: '" + text + "', new text: '" + range.toString() + "'";
+ }
+ };
+ }
+ }
+
+ function restoreRange(rangeInfo, normalize) {
+ var doc = rangeInfo.document;
+ if (typeof normalize == "undefined") {
+ normalize = true;
+ }
+ var range = api.createRange(doc);
+ if (rangeInfo.collapsed) {
+ var markerEl = gEBI(rangeInfo.markerId, doc);
+ if (markerEl) {
+ markerEl.style.display = "inline";
+ var previousNode = markerEl.previousSibling;
+
+ // Workaround for issue 17
+ if (previousNode && previousNode.nodeType == 3) {
+ markerEl.parentNode.removeChild(markerEl);
+ range.collapseToPoint(previousNode, previousNode.length);
+ } else {
+ range.collapseBefore(markerEl);
+ markerEl.parentNode.removeChild(markerEl);
+ }
+ } else {
+ module.warn("Marker element has been removed. Cannot restore selection.");
+ }
+ } else {
+ setRangeBoundary(doc, range, rangeInfo.startMarkerId, true);
+ setRangeBoundary(doc, range, rangeInfo.endMarkerId, false);
+ }
+
+ if (normalize) {
+ range.normalizeBoundaries();
+ }
+
+ return range;
+ }
+
+ function saveRanges(ranges, backward) {
+ var rangeInfos = [], range, doc;
+
+ // Order the ranges by position within the DOM, latest first, cloning the array to leave the original untouched
+ ranges = ranges.slice(0);
+ ranges.sort(compareRanges);
+
+ for (var i = 0, len = ranges.length; i < len; ++i) {
+ rangeInfos[i] = saveRange(ranges[i], backward);
+ }
+
+ // Now that all the markers are in place and DOM manipulation over, adjust each range's boundaries to lie
+ // between its markers
+ for (i = len - 1; i >= 0; --i) {
+ range = ranges[i];
+ doc = api.DomRange.getRangeDocument(range);
+ if (range.collapsed) {
+ range.collapseAfter(gEBI(rangeInfos[i].markerId, doc));
+ } else {
+ range.setEndBefore(gEBI(rangeInfos[i].endMarkerId, doc));
+ range.setStartAfter(gEBI(rangeInfos[i].startMarkerId, doc));
+ }
+ }
+
+ return rangeInfos;
+ }
+
+ function saveSelection(win) {
+ if (!api.isSelectionValid(win)) {
+ module.warn("Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus.");
+ return null;
+ }
+ var sel = api.getSelection(win);
+ var ranges = sel.getAllRanges();
+ var backward = (ranges.length == 1 && sel.isBackward());
+
+ var rangeInfos = saveRanges(ranges, backward);
+
+ // Ensure current selection is unaffected
+ if (backward) {
+ sel.setSingleRange(ranges[0], "backward");
+ } else {
+ sel.setRanges(ranges);
+ }
+
+ return {
+ win: win,
+ rangeInfos: rangeInfos,
+ restored: false
+ };
+ }
+
+ function restoreRanges(rangeInfos) {
+ var ranges = [];
+
+ // Ranges are in reverse order of appearance in the DOM. We want to restore earliest first to avoid
+ // normalization affecting previously restored ranges.
+ var rangeCount = rangeInfos.length;
+
+ for (var i = rangeCount - 1; i >= 0; i--) {
+ ranges[i] = restoreRange(rangeInfos[i], true);
+ }
+
+ return ranges;
+ }
+
+ function restoreSelection(savedSelection, preserveDirection) {
+ if (!savedSelection.restored) {
+ var rangeInfos = savedSelection.rangeInfos;
+ var sel = api.getSelection(savedSelection.win);
+ var ranges = restoreRanges(rangeInfos), rangeCount = rangeInfos.length;
+
+ if (rangeCount == 1 && preserveDirection && api.features.selectionHasExtend && rangeInfos[0].backward) {
+ sel.removeAllRanges();
+ sel.addRange(ranges[0], true);
+ } else {
+ sel.setRanges(ranges);
+ }
+
+ savedSelection.restored = true;
+ }
+ }
+
+ function removeMarkerElement(doc, markerId) {
+ var markerEl = gEBI(markerId, doc);
+ if (markerEl) {
+ markerEl.parentNode.removeChild(markerEl);
+ }
+ }
+
+ function removeMarkers(savedSelection) {
+ var rangeInfos = savedSelection.rangeInfos;
+ for (var i = 0, len = rangeInfos.length, rangeInfo; i < len; ++i) {
+ rangeInfo = rangeInfos[i];
+ if (rangeInfo.collapsed) {
+ removeMarkerElement(savedSelection.doc, rangeInfo.markerId);
+ } else {
+ removeMarkerElement(savedSelection.doc, rangeInfo.startMarkerId);
+ removeMarkerElement(savedSelection.doc, rangeInfo.endMarkerId);
+ }
+ }
+ }
+
+ api.util.extend(api, {
+ saveRange: saveRange,
+ restoreRange: restoreRange,
+ saveRanges: saveRanges,
+ restoreRanges: restoreRanges,
+ saveSelection: saveSelection,
+ restoreSelection: restoreSelection,
+ removeMarkerElement: removeMarkerElement,
+ removeMarkers: removeMarkers
+ });
+ });
+
+}, this);;/*
+ Base.js, version 1.1a
+ Copyright 2006-2010, Dean Edwards
+ License: http://www.opensource.org/licenses/mit-license.php
+*/
+
+var Base = function() {
+ // dummy
+};
+
+Base.extend = function(_instance, _static) { // subclass
+ var extend = Base.prototype.extend;
+
+ // build the prototype
+ Base._prototyping = true;
+ var proto = new this;
+ extend.call(proto, _instance);
+ proto.base = function() {
+ // call this method from any other method to invoke that method's ancestor
+ };
+ delete Base._prototyping;
+
+ // create the wrapper for the constructor function
+ //var constructor = proto.constructor.valueOf(); //-dean
+ var constructor = proto.constructor;
+ var klass = proto.constructor = function() {
+ if (!Base._prototyping) {
+ if (this._constructing || this.constructor == klass) { // instantiation
+ this._constructing = true;
+ constructor.apply(this, arguments);
+ delete this._constructing;
+ } else if (arguments[0] != null) { // casting
+ return (arguments[0].extend || extend).call(arguments[0], proto);
+ }
+ }
+ };
+
+ // build the class interface
+ klass.ancestor = this;
+ klass.extend = this.extend;
+ klass.forEach = this.forEach;
+ klass.implement = this.implement;
+ klass.prototype = proto;
+ klass.toString = this.toString;
+ klass.valueOf = function(type) {
+ //return (type == "object") ? klass : constructor; //-dean
+ return (type == "object") ? klass : constructor.valueOf();
+ };
+ extend.call(klass, _static);
+ // class initialisation
+ if (typeof klass.init == "function") klass.init();
+ return klass;
+};
+
+Base.prototype = {
+ extend: function(source, value) {
+ if (arguments.length > 1) { // extending with a name/value pair
+ var ancestor = this[source];
+ if (ancestor && (typeof value == "function") && // overriding a method?
+ // the valueOf() comparison is to avoid circular references
+ (!ancestor.valueOf || ancestor.valueOf() != value.valueOf()) &&
+ /\bbase\b/.test(value)) {
+ // get the underlying method
+ var method = value.valueOf();
+ // override
+ value = function() {
+ var previous = this.base || Base.prototype.base;
+ this.base = ancestor;
+ var returnValue = method.apply(this, arguments);
+ this.base = previous;
+ return returnValue;
+ };
+ // point to the underlying method
+ value.valueOf = function(type) {
+ return (type == "object") ? value : method;
+ };
+ value.toString = Base.toString;
+ }
+ this[source] = value;
+ } else if (source) { // extending with an object literal
+ var extend = Base.prototype.extend;
+ // if this object has a customised extend method then use it
+ if (!Base._prototyping && typeof this != "function") {
+ extend = this.extend || extend;
+ }
+ var proto = {toSource: null};
+ // do the "toString" and other methods manually
+ var hidden = ["constructor", "toString", "valueOf"];
+ // if we are prototyping then include the constructor
+ var i = Base._prototyping ? 0 : 1;
+ while (key = hidden[i++]) {
+ if (source[key] != proto[key]) {
+ extend.call(this, key, source[key]);
+
+ }
+ }
+ // copy each of the source object's properties to this object
+ for (var key in source) {
+ if (!proto[key]) extend.call(this, key, source[key]);
+ }
+ }
+ return this;
+ }
+};
+
+// initialise
+Base = Base.extend({
+ constructor: function() {
+ this.extend(arguments[0]);
+ }
+}, {
+ ancestor: Object,
+ version: "1.1",
+
+ forEach: function(object, block, context) {
+ for (var key in object) {
+ if (this.prototype[key] === undefined) {
+ block.call(context, object[key], key, object);
+ }
+ }
+ },
+
+ implement: function() {
+ for (var i = 0; i < arguments.length; i++) {
+ if (typeof arguments[i] == "function") {
+ // if it's a function, call it
+ arguments[i](this.prototype);
+ } else {
+ // add the interface using the extend method
+ this.prototype.extend(arguments[i]);
+ }
+ }
+ return this;
+ },
+
+ toString: function() {
+ return String(this.valueOf());
+ }
+});;/**
+ * Detect browser support for specific features
+ */
+wysihtml5.browser = (function() {
+ var userAgent = navigator.userAgent,
+ testElement = document.createElement("div"),
+ // Browser sniffing is unfortunately needed since some behaviors are impossible to feature detect
+ isGecko = userAgent.indexOf("Gecko") !== -1 && userAgent.indexOf("KHTML") === -1,
+ isWebKit = userAgent.indexOf("AppleWebKit/") !== -1,
+ isChrome = userAgent.indexOf("Chrome/") !== -1,
+ isOpera = userAgent.indexOf("Opera/") !== -1;
+
+ function iosVersion(userAgent) {
+ return +((/ipad|iphone|ipod/.test(userAgent) && userAgent.match(/ os (\d+).+? like mac os x/)) || [undefined, 0])[1];
+ }
+
+ function androidVersion(userAgent) {
+ return +(userAgent.match(/android (\d+)/) || [undefined, 0])[1];
+ }
+
+ function isIE(version, equation) {
+ var rv = -1,
+ re;
+
+ if (navigator.appName == 'Microsoft Internet Explorer') {
+ re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
+ } else if (navigator.appName == 'Netscape') {
+ re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})");
+ }
+
+ if (re && re.exec(navigator.userAgent) != null) {
+ rv = parseFloat(RegExp.$1);
+ }
+
+ if (rv === -1) { return false; }
+ if (!version) { return true; }
+ if (!equation) { return version === rv; }
+ if (equation === "<") { return version < rv; }
+ if (equation === ">") { return version > rv; }
+ if (equation === "<=") { return version <= rv; }
+ if (equation === ">=") { return version >= rv; }
+ }
+
+ return {
+ // Static variable needed, publicly accessible, to be able override it in unit tests
+ USER_AGENT: userAgent,
+
+ /**
+ * Exclude browsers that are not capable of displaying and handling
+ * contentEditable as desired:
+ * - iPhone, iPad (tested iOS 4.2.2) and Android (tested 2.2) refuse to make contentEditables focusable
+ * - IE < 8 create invalid markup and crash randomly from time to time
+ *
+ * @return {Boolean}
+ */
+ supported: function() {
+ var userAgent = this.USER_AGENT.toLowerCase(),
+ // Essential for making html elements editable
+ hasContentEditableSupport = "contentEditable" in testElement,
+ // Following methods are needed in order to interact with the contentEditable area
+ hasEditingApiSupport = document.execCommand && document.queryCommandSupported && document.queryCommandState,
+ // document selector apis are only supported by IE 8+, Safari 4+, Chrome and Firefox 3.5+
+ hasQuerySelectorSupport = document.querySelector && document.querySelectorAll,
+ // contentEditable is unusable in mobile browsers (tested iOS 4.2.2, Android 2.2, Opera Mobile, WebOS 3.05)
+ isIncompatibleMobileBrowser = (this.isIos() && iosVersion(userAgent) < 5) || (this.isAndroid() && androidVersion(userAgent) < 4) || userAgent.indexOf("opera mobi") !== -1 || userAgent.indexOf("hpwos/") !== -1;
+ return hasContentEditableSupport
+ && hasEditingApiSupport
+ && hasQuerySelectorSupport
+ && !isIncompatibleMobileBrowser;
+ },
+
+ isTouchDevice: function() {
+ return this.supportsEvent("touchmove");
+ },
+
+ isIos: function() {
+ return (/ipad|iphone|ipod/i).test(this.USER_AGENT);
+ },
+
+ isAndroid: function() {
+ return this.USER_AGENT.indexOf("Android") !== -1;
+ },
+
+ /**
+ * Whether the browser supports sandboxed iframes
+ * Currently only IE 6+ offers such feature <iframe security="restricted">
+ *
+ * http://msdn.microsoft.com/en-us/library/ms534622(v=vs.85).aspx
+ * http://blogs.msdn.com/b/ie/archive/2008/01/18/using-frames-more-securely.aspx
+ *
+ * HTML5 sandboxed iframes are still buggy and their DOM is not reachable from the outside (except when using postMessage)
+ */
+ supportsSandboxedIframes: function() {
+ return isIE();
+ },
+
+ /**
+ * IE6+7 throw a mixed content warning when the src of an iframe
+ * is empty/unset or about:blank
+ * window.querySelector is implemented as of IE8
+ */
+ throwsMixedContentWarningWhenIframeSrcIsEmpty: function() {
+ return !("querySelector" in document);
+ },
+
+ /**
+ * Whether the caret is correctly displayed in contentEditable elements
+ * Firefox sometimes shows a huge caret in the beginning after focusing
+ */
+ displaysCaretInEmptyContentEditableCorrectly: function() {
+ return isIE();
+ },
+
+ /**
+ * Opera and IE are the only browsers who offer the css value
+ * in the original unit, thx to the currentStyle object
+ * All other browsers provide the computed style in px via window.getComputedStyle
+ */
+ hasCurrentStyleProperty: function() {
+ return "currentStyle" in testElement;
+ },
+
+ /**
+ * Firefox on OSX navigates through history when hitting CMD + Arrow right/left
+ */
+ hasHistoryIssue: function() {
+ return isGecko && navigator.platform.substr(0, 3) === "Mac";
+ },
+
+ /**
+ * Whether the browser inserts a <br> when pressing enter in a contentEditable element
+ */
+ insertsLineBreaksOnReturn: function() {
+ return isGecko;
+ },
+
+ supportsPlaceholderAttributeOn: function(element) {
+ return "placeholder" in element;
+ },
+
+ supportsEvent: function(eventName) {
+ return "on" + eventName in testElement || (function() {
+ testElement.setAttribute("on" + eventName, "return;");
+ return typeof(testElement["on" + eventName]) === "function";
+ })();
+ },
+
+ /**
+ * Opera doesn't correctly fire focus/blur events when clicking in- and outside of iframe
+ */
+ supportsEventsInIframeCorrectly: function() {
+ return !isOpera;
+ },
+
+ /**
+ * Everything below IE9 doesn't know how to treat HTML5 tags
+ *
+ * @param {Object} context The document object on which to check HTML5 support
+ *
+ * @example
+ * wysihtml5.browser.supportsHTML5Tags(document);
+ */
+ supportsHTML5Tags: function(context) {
+ var element = context.createElement("div"),
+ html5 = "<article>foo</article>";
+ element.innerHTML = html5;
+ return element.innerHTML.toLowerCase() === html5;
+ },
+
+ /**
+ * Checks whether a document supports a certain queryCommand
+ * In particular, Opera needs a reference to a document that has a contentEditable in it's dom tree
+ * in oder to report correct results
+ *
+ * @param {Object} doc Document object on which to check for a query command
+ * @param {String} command The query command to check for
+ * @return {Boolean}
+ *
+ * @example
+ * wysihtml5.browser.supportsCommand(document, "bold");
+ */
+ supportsCommand: (function() {
+ // Following commands are supported but contain bugs in some browsers
+ var buggyCommands = {
+ // formatBlock fails with some tags (eg. <blockquote>)
+ "formatBlock": isIE(10, "<="),
+ // When inserting unordered or ordered lists in Firefox, Chrome or Safari, the current selection or line gets
+ // converted into a list (<ul><li>...</li></ul>, <ol><li>...</li></ol>)
+ // IE and Opera act a bit different here as they convert the entire content of the current block element into a list
+ "insertUnorderedList": isIE(),
+ "insertOrderedList": isIE()
+ };
+
+ // Firefox throws errors for queryCommandSupported, so we have to build up our own object of supported commands
+ var supported = {
+ "insertHTML": isGecko
+ };
+
+ return function(doc, command) {
+ var isBuggy = buggyCommands[command];
+ if (!isBuggy) {
+ // Firefox throws errors when invoking queryCommandSupported or queryCommandEnabled
+ try {
+ return doc.queryCommandSupported(command);
+ } catch(e1) {}
+
+ try {
+ return doc.queryCommandEnabled(command);
+ } catch(e2) {
+ return !!supported[command];
+ }
+ }
+ return false;
+ };
+ })(),
+
+ /**
+ * IE: URLs starting with:
+ * www., http://, https://, ftp://, gopher://, mailto:, new:, snews:, telnet:, wasis:, file://,
+ * nntp://, newsrc:, ldap://, ldaps://, outlook:, mic:// and url:
+ * will automatically be auto-linked when either the user inserts them via copy&paste or presses the
+ * space bar when the caret is directly after such an url.
+ * This behavior cannot easily be avoided in IE < 9 since the logic is hardcoded in the mshtml.dll
+ * (related blog post on msdn
+ * http://blogs.msdn.com/b/ieinternals/archive/2009/09/17/prevent-automatic-hyperlinking-in-contenteditable-html.aspx).
+ */
+ doesAutoLinkingInContentEditable: function() {
+ return isIE();
+ },
+
+ /**
+ * As stated above, IE auto links urls typed into contentEditable elements
+ * Since IE9 it's possible to prevent this behavior
+ */
+ canDisableAutoLinking: function() {
+ return this.supportsCommand(document, "AutoUrlDetect");
+ },
+
+ /**
+ * IE leaves an empty paragraph in the contentEditable element after clearing it
+ * Chrome/Safari sometimes an empty <div>
+ */
+ clearsContentEditableCorrectly: function() {
+ return isGecko || isOpera || isWebKit;
+ },
+
+ /**
+ * IE gives wrong results for getAttribute
+ */
+ supportsGetAttributeCorrectly: function() {
+ var td = document.createElement("td");
+ return td.getAttribute("rowspan") != "1";
+ },
+
+ /**
+ * When clicking on images in IE, Opera and Firefox, they are selected, which makes it easy to interact with them.
+ * Chrome and Safari both don't support this
+ */
+ canSelectImagesInContentEditable: function() {
+ return isGecko || isIE() || isOpera;
+ },
+
+ /**
+ * All browsers except Safari and Chrome automatically scroll the range/caret position into view
+ */
+ autoScrollsToCaret: function() {
+ return !isWebKit;
+ },
+
+ /**
+ * Check whether the browser automatically closes tags that don't need to be opened
+ */
+ autoClosesUnclosedTags: function() {
+ var clonedTestElement = testElement.cloneNode(false),
+ returnValue,
+ innerHTML;
+
+ clonedTestElement.innerHTML = "<p><div></div>";
+ innerHTML = clonedTestElement.innerHTML.toLowerCase();
+ returnValue = innerHTML === "<p></p><div></div>" || innerHTML === "<p><div></div></p>";
+
+ // Cache result by overwriting current function
+ this.autoClosesUnclosedTags = function() { return returnValue; };
+
+ return returnValue;
+ },
+
+ /**
+ * Whether the browser supports the native document.getElementsByClassName which returns live NodeLists
+ */
+ supportsNativeGetElementsByClassName: function() {
+ return String(document.getElementsByClassName).indexOf("[native code]") !== -1;
+ },
+
+ /**
+ * As of now (19.04.2011) only supported by Firefox 4 and Chrome
+ * See https://developer.mozilla.org/en/DOM/Selection/modify
+ */
+ supportsSelectionModify: function() {
+ return "getSelection" in window && "modify" in window.getSelection();
+ },
+
+ /**
+ * Opera needs a white space after a <br> in order to position the caret correctly
+ */
+ needsSpaceAfterLineBreak: function() {
+ return isOpera;
+ },
+
+ /**
+ * Whether the browser supports the speech api on the given element
+ * See http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/
+ *
+ * @example
+ * var input = document.createElement("input");
+ * if (wysihtml5.browser.supportsSpeechApiOn(input)) {
+ * // ...
+ * }
+ */
+ supportsSpeechApiOn: function(input) {
+ var chromeVersion = userAgent.match(/Chrome\/(\d+)/) || [undefined, 0];
+ return chromeVersion[1] >= 11 && ("onwebkitspeechchange" in input || "speech" in input);
+ },
+
+ /**
+ * IE9 crashes when setting a getter via Object.defineProperty on XMLHttpRequest or XDomainRequest
+ * See https://connect.microsoft.com/ie/feedback/details/650112
+ * or try the POC http://tifftiff.de/ie9_crash/
+ */
+ crashesWhenDefineProperty: function(property) {
+ return isIE(9) && (property === "XMLHttpRequest" || property === "XDomainRequest");
+ },
+
+ /**
+ * IE is the only browser who fires the "focus" event not immediately when .focus() is called on an element
+ */
+ doesAsyncFocus: function() {
+ return isIE();
+ },
+
+ /**
+ * In IE it's impssible for the user and for the selection library to set the caret after an <img> when it's the lastChild in the document
+ */
+ hasProblemsSettingCaretAfterImg: function() {
+ return isIE();
+ },
+
+ hasUndoInContextMenu: function() {
+ return isGecko || isChrome || isOpera;
+ },
+
+ /**
+ * Opera sometimes doesn't insert the node at the right position when range.insertNode(someNode)
+ * is used (regardless if rangy or native)
+ * This especially happens when the caret is positioned right after a <br> because then
+ * insertNode() will insert the node right before the <br>
+ */
+ hasInsertNodeIssue: function() {
+ return isOpera;
+ },
+
+ /**
+ * IE 8+9 don't fire the focus event of the <body> when the iframe gets focused (even though the caret gets set into the <body>)
+ */
+ hasIframeFocusIssue: function() {
+ return isIE();
+ },
+
+ /**
+ * Chrome + Safari create invalid nested markup after paste
+ *
+ * <p>
+ * foo
+ * <p>bar</p> <!-- BOO! -->
+ * </p>
+ */
+ createsNestedInvalidMarkupAfterPaste: function() {
+ return isWebKit;
+ },
+
+ supportsMutationEvents: function() {
+ return ("MutationEvent" in window);
+ },
+
+ /**
+ IE (at least up to 11) does not support clipboardData on event.
+ It is on window but cannot return text/html
+ Should actually check for clipboardData on paste event, but cannot in firefox
+ */
+ supportsModenPaste: function () {
+ return !("clipboardData" in window);
+ }
+ };
+})();
+;wysihtml5.lang.array = function(arr) {
+ return {
+ /**
+ * Check whether a given object exists in an array
+ *
+ * @example
+ * wysihtml5.lang.array([1, 2]).contains(1);
+ * // => true
+ *
+ * Can be used to match array with array. If intersection is found true is returned
+ */
+ contains: function(needle) {
+ if (Array.isArray(needle)) {
+ for (var i = needle.length; i--;) {
+ if (wysihtml5.lang.array(arr).indexOf(needle[i]) !== -1) {
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return wysihtml5.lang.array(arr).indexOf(needle) !== -1;
+ }
+ },
+
+ /**
+ * Check whether a given object exists in an array and return index
+ * If no elelemt found returns -1
+ *
+ * @example
+ * wysihtml5.lang.array([1, 2]).indexOf(2);
+ * // => 1
+ */
+ indexOf: function(needle) {
+ if (arr.indexOf) {
+ return arr.indexOf(needle);
+ } else {
+ for (var i=0, length=arr.length; i<length; i++) {
+ if (arr[i] === needle) { return i; }
+ }
+ return -1;
+ }
+ },
+
+ /**
+ * Substract one array from another
+ *
+ * @example
+ * wysihtml5.lang.array([1, 2, 3, 4]).without([3, 4]);
+ * // => [1, 2]
+ */
+ without: function(arrayToSubstract) {
+ arrayToSubstract = wysihtml5.lang.array(arrayToSubstract);
+ var newArr = [],
+ i = 0,
+ length = arr.length;
+ for (; i<length; i++) {
+ if (!arrayToSubstract.contains(arr[i])) {
+ newArr.push(arr[i]);
+ }
+ }
+ return newArr;
+ },
+
+ /**
+ * Return a clean native array
+ *
+ * Following will convert a Live NodeList to a proper Array
+ * @example
+ * var childNodes = wysihtml5.lang.array(document.body.childNodes).get();
+ */
+ get: function() {
+ var i = 0,
+ length = arr.length,
+ newArray = [];
+ for (; i<length; i++) {
+ newArray.push(arr[i]);
+ }
+ return newArray;
+ },
+
+ /**
+ * Creates a new array with the results of calling a provided function on every element in this array.
+ * optionally this can be provided as second argument
+ *
+ * @example
+ * var childNodes = wysihtml5.lang.array([1,2,3,4]).map(function (value, index, array) {
+ return value * 2;
+ * });
+ * // => [2,4,6,8]
+ */
+ map: function(callback, thisArg) {
+ if (Array.prototype.map) {
+ return arr.map(callback, thisArg);
+ } else {
+ var len = arr.length >>> 0,
+ A = new Array(len),
+ i = 0;
+ for (; i < len; i++) {
+ A[i] = callback.call(thisArg, arr[i], i, arr);
+ }
+ return A;
+ }
+ },
+
+ /* ReturnS new array without duplicate entries
+ *
+ * @example
+ * var uniq = wysihtml5.lang.array([1,2,3,2,1,4]).unique();
+ * // => [1,2,3,4]
+ */
+ unique: function() {
+ var vals = [],
+ max = arr.length,
+ idx = 0;
+
+ while (idx < max) {
+ if (!wysihtml5.lang.array(vals).contains(arr[idx])) {
+ vals.push(arr[idx]);
+ }
+ idx++;
+ }
+ return vals;
+ }
+
+ };
+};
+;wysihtml5.lang.Dispatcher = Base.extend(
+ /** @scope wysihtml5.lang.Dialog.prototype */ {
+ on: function(eventName, handler) {
+ this.events = this.events || {};
+ this.events[eventName] = this.events[eventName] || [];
+ this.events[eventName].push(handler);
+ return this;
+ },
+
+ off: function(eventName, handler) {
+ this.events = this.events || {};
+ var i = 0,
+ handlers,
+ newHandlers;
+ if (eventName) {
+ handlers = this.events[eventName] || [],
+ newHandlers = [];
+ for (; i<handlers.length; i++) {
+ if (handlers[i] !== handler && handler) {
+ newHandlers.push(handlers[i]);
+ }
+ }
+ this.events[eventName] = newHandlers;
+ } else {
+ // Clean up all events
+ this.events = {};
+ }
+ return this;
+ },
+
+ fire: function(eventName, payload) {
+ this.events = this.events || {};
+ var handlers = this.events[eventName] || [],
+ i = 0;
+ for (; i<handlers.length; i++) {
+ handlers[i].call(this, payload);
+ }
+ return this;
+ },
+
+ // deprecated, use .on()
+ observe: function() {
+ return this.on.apply(this, arguments);
+ },
+
+ // deprecated, use .off()
+ stopObserving: function() {
+ return this.off.apply(this, arguments);
+ }
+});
+;wysihtml5.lang.object = function(obj) {
+ return {
+ /**
+ * @example
+ * wysihtml5.lang.object({ foo: 1, bar: 1 }).merge({ bar: 2, baz: 3 }).get();
+ * // => { foo: 1, bar: 2, baz: 3 }
+ */
+ merge: function(otherObj) {
+ for (var i in otherObj) {
+ obj[i] = otherObj[i];
+ }
+ return this;
+ },
+
+ get: function() {
+ return obj;
+ },
+
+ /**
+ * @example
+ * wysihtml5.lang.object({ foo: 1 }).clone();
+ * // => { foo: 1 }
+ *
+ * v0.4.14 adds options for deep clone : wysihtml5.lang.object({ foo: 1 }).clone(true);
+ */
+ clone: function(deep) {
+ var newObj = {},
+ i;
+
+ if (obj === null || !wysihtml5.lang.object(obj).isPlainObject()) {
+ return obj;
+ }
+
+ for (i in obj) {
+ if(obj.hasOwnProperty(i)) {
+ if (deep) {
+ newObj[i] = wysihtml5.lang.object(obj[i]).clone(deep);
+ } else {
+ newObj[i] = obj[i];
+ }
+ }
+ }
+ return newObj;
+ },
+
+ /**
+ * @example
+ * wysihtml5.lang.object([]).isArray();
+ * // => true
+ */
+ isArray: function() {
+ return Object.prototype.toString.call(obj) === "[object Array]";
+ },
+
+ /**
+ * @example
+ * wysihtml5.lang.object(function() {}).isFunction();
+ * // => true
+ */
+ isFunction: function() {
+ return Object.prototype.toString.call(obj) === '[object Function]';
+ },
+
+ isPlainObject: function () {
+ return Object.prototype.toString.call(obj) === '[object Object]';
+ }
+ };
+};
+;(function() {
+ var WHITE_SPACE_START = /^\s+/,
+ WHITE_SPACE_END = /\s+$/,
+ ENTITY_REG_EXP = /[&<>\t"]/g,
+ ENTITY_MAP = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': "&quot;",
+ '\t':"&nbsp; "
+ };
+ wysihtml5.lang.string = function(str) {
+ str = String(str);
+ return {
+ /**
+ * @example
+ * wysihtml5.lang.string(" foo ").trim();
+ * // => "foo"
+ */
+ trim: function() {
+ return str.replace(WHITE_SPACE_START, "").replace(WHITE_SPACE_END, "");
+ },
+
+ /**
+ * @example
+ * wysihtml5.lang.string("Hello #{name}").interpolate({ name: "Christopher" });
+ * // => "Hello Christopher"
+ */
+ interpolate: function(vars) {
+ for (var i in vars) {
+ str = this.replace("#{" + i + "}").by(vars[i]);
+ }
+ return str;
+ },
+
+ /**
+ * @example
+ * wysihtml5.lang.string("Hello Tom").replace("Tom").with("Hans");
+ * // => "Hello Hans"
+ */
+ replace: function(search) {
+ return {
+ by: function(replace) {
+ return str.split(search).join(replace);
+ }
+ };
+ },
+
+ /**
+ * @example
+ * wysihtml5.lang.string("hello<br>").escapeHTML();
+ * // => "hello&lt;br&gt;"
+ */
+ escapeHTML: function(linebreaks, convertSpaces) {
+ var html = str.replace(ENTITY_REG_EXP, function(c) { return ENTITY_MAP[c]; });
+ if (linebreaks) {
+ html = html.replace(/(?:\r\n|\r|\n)/g, '<br />');
+ }
+ if (convertSpaces) {
+ html = html.replace(/ /gi, "&nbsp; ");
+ }
+ return html;
+ }
+ };
+ };
+})();
+;/**
+ * Find urls in descendant text nodes of an element and auto-links them
+ * Inspired by http://james.padolsey.com/javascript/find-and-replace-text-with-javascript/
+ *
+ * @param {Element} element Container element in which to search for urls
+ *
+ * @example
+ * <div id="text-container">Please click here: www.google.com</div>
+ * <script>wysihtml5.dom.autoLink(document.getElementById("text-container"));</script>
+ */
+(function(wysihtml5) {
+ var /**
+ * Don't auto-link urls that are contained in the following elements:
+ */
+ IGNORE_URLS_IN = wysihtml5.lang.array(["CODE", "PRE", "A", "SCRIPT", "HEAD", "TITLE", "STYLE"]),
+ /**
+ * revision 1:
+ * /(\S+\.{1}[^\s\,\.\!]+)/g
+ *
+ * revision 2:
+ * /(\b(((https?|ftp):\/\/)|(www\.))[-A-Z0-9+&@#\/%?=~_|!:,.;\[\]]*[-A-Z0-9+&@#\/%=~_|])/gim
+ *
+ * put this in the beginning if you don't wan't to match within a word
+ * (^|[\>\(\{\[\s\>])
+ */
+ URL_REG_EXP = /((https?:\/\/|www\.)[^\s<]{3,})/gi,
+ TRAILING_CHAR_REG_EXP = /([^\w\/\-](,?))$/i,
+ MAX_DISPLAY_LENGTH = 100,
+ BRACKETS = { ")": "(", "]": "[", "}": "{" };
+
+ function autoLink(element, ignoreInClasses) {
+ if (_hasParentThatShouldBeIgnored(element, ignoreInClasses)) {
+ return element;
+ }
+
+ if (element === element.ownerDocument.documentElement) {
+ element = element.ownerDocument.body;
+ }
+
+ return _parseNode(element, ignoreInClasses);
+ }
+
+ /**
+ * This is basically a rebuild of
+ * the rails auto_link_urls text helper
+ */
+ function _convertUrlsToLinks(str) {
+ return str.replace(URL_REG_EXP, function(match, url) {
+ var punctuation = (url.match(TRAILING_CHAR_REG_EXP) || [])[1] || "",
+ opening = BRACKETS[punctuation];
+ url = url.replace(TRAILING_CHAR_REG_EXP, "");
+
+ if (url.split(opening).length > url.split(punctuation).length) {
+ url = url + punctuation;
+ punctuation = "";
+ }
+ var realUrl = url,
+ displayUrl = url;
+ if (url.length > MAX_DISPLAY_LENGTH) {
+ displayUrl = displayUrl.substr(0, MAX_DISPLAY_LENGTH) + "...";
+ }
+ // Add http prefix if necessary
+ if (realUrl.substr(0, 4) === "www.") {
+ realUrl = "http://" + realUrl;
+ }
+
+ return '<a href="' + realUrl + '">' + displayUrl + '</a>' + punctuation;
+ });
+ }
+
+ /**
+ * Creates or (if already cached) returns a temp element
+ * for the given document object
+ */
+ function _getTempElement(context) {
+ var tempElement = context._wysihtml5_tempElement;
+ if (!tempElement) {
+ tempElement = context._wysihtml5_tempElement = context.createElement("div");
+ }
+ return tempElement;
+ }
+
+ /**
+ * Replaces the original text nodes with the newly auto-linked dom tree
+ */
+ function _wrapMatchesInNode(textNode) {
+ var parentNode = textNode.parentNode,
+ nodeValue = wysihtml5.lang.string(textNode.data).escapeHTML(),
+ tempElement = _getTempElement(parentNode.ownerDocument);
+
+ // We need to insert an empty/temporary <span /> to fix IE quirks
+ // Elsewise IE would strip white space in the beginning
+ tempElement.innerHTML = "<span></span>" + _convertUrlsToLinks(nodeValue);
+ tempElement.removeChild(tempElement.firstChild);
+
+ while (tempElement.firstChild) {
+ // inserts tempElement.firstChild before textNode
+ parentNode.insertBefore(tempElement.firstChild, textNode);
+ }
+ parentNode.removeChild(textNode);
+ }
+
+ function _hasParentThatShouldBeIgnored(node, ignoreInClasses) {
+ var nodeName;
+ while (node.parentNode) {
+ node = node.parentNode;
+ nodeName = node.nodeName;
+ if (node.className && wysihtml5.lang.array(node.className.split(' ')).contains(ignoreInClasses)) {
+ return true;
+ }
+ if (IGNORE_URLS_IN.contains(nodeName)) {
+ return true;
+ } else if (nodeName === "body") {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ function _parseNode(element, ignoreInClasses) {
+ if (IGNORE_URLS_IN.contains(element.nodeName)) {
+ return;
+ }
+
+ if (element.className && wysihtml5.lang.array(element.className.split(' ')).contains(ignoreInClasses)) {
+ return;
+ }
+
+ if (element.nodeType === wysihtml5.TEXT_NODE && element.data.match(URL_REG_EXP)) {
+ _wrapMatchesInNode(element);
+ return;
+ }
+
+ var childNodes = wysihtml5.lang.array(element.childNodes).get(),
+ childNodesLength = childNodes.length,
+ i = 0;
+
+ for (; i<childNodesLength; i++) {
+ _parseNode(childNodes[i], ignoreInClasses);
+ }
+
+ return element;
+ }
+
+ wysihtml5.dom.autoLink = autoLink;
+
+ // Reveal url reg exp to the outside
+ wysihtml5.dom.autoLink.URL_REG_EXP = URL_REG_EXP;
+})(wysihtml5);
+;(function(wysihtml5) {
+ var api = wysihtml5.dom;
+
+ api.addClass = function(element, className) {
+ var classList = element.classList;
+ if (classList) {
+ return classList.add(className);
+ }
+ if (api.hasClass(element, className)) {
+ return;
+ }
+ element.className += " " + className;
+ };
+
+ api.removeClass = function(element, className) {
+ var classList = element.classList;
+ if (classList) {
+ return classList.remove(className);
+ }
+
+ element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ");
+ };
+
+ api.hasClass = function(element, className) {
+ var classList = element.classList;
+ if (classList) {
+ return classList.contains(className);
+ }
+
+ var elementClassName = element.className;
+ return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
+ };
+})(wysihtml5);
+;wysihtml5.dom.contains = (function() {
+ var documentElement = document.documentElement;
+ if (documentElement.contains) {
+ return function(container, element) {
+ if (element.nodeType !== wysihtml5.ELEMENT_NODE) {
+ element = element.parentNode;
+ }
+ return container !== element && container.contains(element);
+ };
+ } else if (documentElement.compareDocumentPosition) {
+ return function(container, element) {
+ // https://developer.mozilla.org/en/DOM/Node.compareDocumentPosition
+ return !!(container.compareDocumentPosition(element) & 16);
+ };
+ }
+})();
+;/**
+ * Converts an HTML fragment/element into a unordered/ordered list
+ *
+ * @param {Element} element The element which should be turned into a list
+ * @param {String} listType The list type in which to convert the tree (either "ul" or "ol")
+ * @return {Element} The created list
+ *
+ * @example
+ * <!-- Assume the following dom: -->
+ * <span id="pseudo-list">
+ * eminem<br>
+ * dr. dre
+ * <div>50 Cent</div>
+ * </span>
+ *
+ * <script>
+ * wysihtml5.dom.convertToList(document.getElementById("pseudo-list"), "ul");
+ * </script>
+ *
+ * <!-- Will result in: -->
+ * <ul>
+ * <li>eminem</li>
+ * <li>dr. dre</li>
+ * <li>50 Cent</li>
+ * </ul>
+ */
+wysihtml5.dom.convertToList = (function() {
+ function _createListItem(doc, list) {
+ var listItem = doc.createElement("li");
+ list.appendChild(listItem);
+ return listItem;
+ }
+
+ function _createList(doc, type) {
+ return doc.createElement(type);
+ }
+
+ function convertToList(element, listType, uneditableClass) {
+ if (element.nodeName === "UL" || element.nodeName === "OL" || element.nodeName === "MENU") {
+ // Already a list
+ return element;
+ }
+
+ var doc = element.ownerDocument,
+ list = _createList(doc, listType),
+ lineBreaks = element.querySelectorAll("br"),
+ lineBreaksLength = lineBreaks.length,
+ childNodes,
+ childNodesLength,
+ childNode,
+ lineBreak,
+ parentNode,
+ isBlockElement,
+ isLineBreak,
+ currentListItem,
+ i;
+
+ // First find <br> at the end of inline elements and move them behind them
+ for (i=0; i<lineBreaksLength; i++) {
+ lineBreak = lineBreaks[i];
+ while ((parentNode = lineBreak.parentNode) && parentNode !== element && parentNode.lastChild === lineBreak) {
+ if (wysihtml5.dom.getStyle("display").from(parentNode) === "block") {
+ parentNode.removeChild(lineBreak);
+ break;
+ }
+ wysihtml5.dom.insert(lineBreak).after(lineBreak.parentNode);
+ }
+ }
+
+ childNodes = wysihtml5.lang.array(element.childNodes).get();
+ childNodesLength = childNodes.length;
+
+ for (i=0; i<childNodesLength; i++) {
+ currentListItem = currentListItem || _createListItem(doc, list);
+ childNode = childNodes[i];
+ isBlockElement = wysihtml5.dom.getStyle("display").from(childNode) === "block";
+ isLineBreak = childNode.nodeName === "BR";
+
+ // consider uneditable as an inline element
+ if (isBlockElement && (!uneditableClass || !wysihtml5.dom.hasClass(childNode, uneditableClass))) {
+ // Append blockElement to current <li> if empty, otherwise create a new one
+ currentListItem = currentListItem.firstChild ? _createListItem(doc, list) : currentListItem;
+ currentListItem.appendChild(childNode);
+ currentListItem = null;
+ continue;
+ }
+
+ if (isLineBreak) {
+ // Only create a new list item in the next iteration when the current one has already content
+ currentListItem = currentListItem.firstChild ? null : currentListItem;
+ continue;
+ }
+
+ currentListItem.appendChild(childNode);
+ }
+
+ if (childNodes.length === 0) {
+ _createListItem(doc, list);
+ }
+
+ element.parentNode.replaceChild(list, element);
+ return list;
+ }
+
+ return convertToList;
+})();
+;/**
+ * Copy a set of attributes from one element to another
+ *
+ * @param {Array} attributesToCopy List of attributes which should be copied
+ * @return {Object} Returns an object which offers the "from" method which can be invoked with the element where to
+ * copy the attributes from., this again returns an object which provides a method named "to" which can be invoked
+ * with the element where to copy the attributes to (see example)
+ *
+ * @example
+ * var textarea = document.querySelector("textarea"),
+ * div = document.querySelector("div[contenteditable=true]"),
+ * anotherDiv = document.querySelector("div.preview");
+ * wysihtml5.dom.copyAttributes(["spellcheck", "value", "placeholder"]).from(textarea).to(div).andTo(anotherDiv);
+ *
+ */
+wysihtml5.dom.copyAttributes = function(attributesToCopy) {
+ return {
+ from: function(elementToCopyFrom) {
+ return {
+ to: function(elementToCopyTo) {
+ var attribute,
+ i = 0,
+ length = attributesToCopy.length;
+ for (; i<length; i++) {
+ attribute = attributesToCopy[i];
+ if (typeof(elementToCopyFrom[attribute]) !== "undefined" && elementToCopyFrom[attribute] !== "") {
+ elementToCopyTo[attribute] = elementToCopyFrom[attribute];
+ }
+ }
+ return { andTo: arguments.callee };
+ }
+ };
+ }
+ };
+};
+;/**
+ * Copy a set of styles from one element to another
+ * Please note that this only works properly across browsers when the element from which to copy the styles
+ * is in the dom
+ *
+ * Interesting article on how to copy styles
+ *
+ * @param {Array} stylesToCopy List of styles which should be copied
+ * @return {Object} Returns an object which offers the "from" method which can be invoked with the element where to
+ * copy the styles from., this again returns an object which provides a method named "to" which can be invoked
+ * with the element where to copy the styles to (see example)
+ *
+ * @example
+ * var textarea = document.querySelector("textarea"),
+ * div = document.querySelector("div[contenteditable=true]"),
+ * anotherDiv = document.querySelector("div.preview");
+ * wysihtml5.dom.copyStyles(["overflow-y", "width", "height"]).from(textarea).to(div).andTo(anotherDiv);
+ *
+ */
+(function(dom) {
+
+ /**
+ * Mozilla, WebKit and Opera recalculate the computed width when box-sizing: boder-box; is set
+ * So if an element has "width: 200px; -moz-box-sizing: border-box; border: 1px;" then
+ * its computed css width will be 198px
+ *
+ * See https://bugzilla.mozilla.org/show_bug.cgi?id=520992
+ */
+ var BOX_SIZING_PROPERTIES = ["-webkit-box-sizing", "-moz-box-sizing", "-ms-box-sizing", "box-sizing"];
+
+ var shouldIgnoreBoxSizingBorderBox = function(element) {
+ if (hasBoxSizingBorderBox(element)) {
+ return parseInt(dom.getStyle("width").from(element), 10) < element.offsetWidth;
+ }
+ return false;
+ };
+
+ var hasBoxSizingBorderBox = function(element) {
+ var i = 0,
+ length = BOX_SIZING_PROPERTIES.length;
+ for (; i<length; i++) {
+ if (dom.getStyle(BOX_SIZING_PROPERTIES[i]).from(element) === "border-box") {
+ return BOX_SIZING_PROPERTIES[i];
+ }
+ }
+ };
+
+ dom.copyStyles = function(stylesToCopy) {
+ return {
+ from: function(element) {
+ if (shouldIgnoreBoxSizingBorderBox(element)) {
+ stylesToCopy = wysihtml5.lang.array(stylesToCopy).without(BOX_SIZING_PROPERTIES);
+ }
+
+ var cssText = "",
+ length = stylesToCopy.length,
+ i = 0,
+ property;
+ for (; i<length; i++) {
+ property = stylesToCopy[i];
+ cssText += property + ":" + dom.getStyle(property).from(element) + ";";
+ }
+
+ return {
+ to: function(element) {
+ dom.setStyles(cssText).on(element);
+ return { andTo: arguments.callee };
+ }
+ };
+ }
+ };
+ };
+})(wysihtml5.dom);
+;/**
+ * Event Delegation
+ *
+ * @example
+ * wysihtml5.dom.delegate(document.body, "a", "click", function() {
+ * // foo
+ * });
+ */
+(function(wysihtml5) {
+
+ wysihtml5.dom.delegate = function(container, selector, eventName, handler) {
+ return wysihtml5.dom.observe(container, eventName, function(event) {
+ var target = event.target,
+ match = wysihtml5.lang.array(container.querySelectorAll(selector));
+
+ while (target && target !== container) {
+ if (match.contains(target)) {
+ handler.call(target, event);
+ break;
+ }
+ target = target.parentNode;
+ }
+ });
+ };
+
+})(wysihtml5);
+;// TODO: Refactor dom tree traversing here
+(function(wysihtml5) {
+ wysihtml5.dom.domNode = function(node) {
+ var defaultNodeTypes = [wysihtml5.ELEMENT_NODE, wysihtml5.TEXT_NODE];
+
+ var _isBlankText = function(node) {
+ return node.nodeType === wysihtml5.TEXT_NODE && (/^\s*$/g).test(node.data);
+ };
+
+ return {
+
+ // var node = wysihtml5.dom.domNode(element).prev({nodeTypes: [1,3], ignoreBlankTexts: true});
+ prev: function(options) {
+ var prevNode = node.previousSibling,
+ types = (options && options.nodeTypes) ? options.nodeTypes : defaultNodeTypes;
+
+ if (!prevNode) {
+ return null;
+ }
+
+ if (
+ (!wysihtml5.lang.array(types).contains(prevNode.nodeType)) || // nodeTypes check.
+ (options && options.ignoreBlankTexts && _isBlankText(prevNode)) // Blank text nodes bypassed if set
+ ) {
+ return wysihtml5.dom.domNode(prevNode).prev(options);
+ }
+
+ return prevNode;
+ },
+
+ // var node = wysihtml5.dom.domNode(element).next({nodeTypes: [1,3], ignoreBlankTexts: true});
+ next: function(options) {
+ var nextNode = node.nextSibling,
+ types = (options && options.nodeTypes) ? options.nodeTypes : defaultNodeTypes;
+
+ if (!nextNode) {
+ return null;
+ }
+
+ if (
+ (!wysihtml5.lang.array(types).contains(nextNode.nodeType)) || // nodeTypes check.
+ (options && options.ignoreBlankTexts && _isBlankText(nextNode)) // blank text nodes bypassed if set
+ ) {
+ return wysihtml5.dom.domNode(nextNode).next(options);
+ }
+
+ return nextNode;
+ }
+
+
+
+ };
+ };
+})(wysihtml5);;/**
+ * Returns the given html wrapped in a div element
+ *
+ * Fixing IE's inability to treat unknown elements (HTML5 section, article, ...) correctly
+ * when inserted via innerHTML
+ *
+ * @param {String} html The html which should be wrapped in a dom element
+ * @param {Obejct} [context] Document object of the context the html belongs to
+ *
+ * @example
+ * wysihtml5.dom.getAsDom("<article>foo</article>");
+ */
+wysihtml5.dom.getAsDom = (function() {
+
+ var _innerHTMLShiv = function(html, context) {
+ var tempElement = context.createElement("div");
+ tempElement.style.display = "none";
+ context.body.appendChild(tempElement);
+ // IE throws an exception when trying to insert <frameset></frameset> via innerHTML
+ try { tempElement.innerHTML = html; } catch(e) {}
+ context.body.removeChild(tempElement);
+ return tempElement;
+ };
+
+ /**
+ * Make sure IE supports HTML5 tags, which is accomplished by simply creating one instance of each element
+ */
+ var _ensureHTML5Compatibility = function(context) {
+ if (context._wysihtml5_supportsHTML5Tags) {
+ return;
+ }
+ for (var i=0, length=HTML5_ELEMENTS.length; i<length; i++) {
+ context.createElement(HTML5_ELEMENTS[i]);
+ }
+ context._wysihtml5_supportsHTML5Tags = true;
+ };
+
+
+ /**
+ * List of html5 tags
+ * taken from http://simon.html5.org/html5-elements
+ */
+ var HTML5_ELEMENTS = [
+ "abbr", "article", "aside", "audio", "bdi", "canvas", "command", "datalist", "details", "figcaption",
+ "figure", "footer", "header", "hgroup", "keygen", "mark", "meter", "nav", "output", "progress",
+ "rp", "rt", "ruby", "svg", "section", "source", "summary", "time", "track", "video", "wbr"
+ ];
+
+ return function(html, context) {
+ context = context || document;
+ var tempElement;
+ if (typeof(html) === "object" && html.nodeType) {
+ tempElement = context.createElement("div");
+ tempElement.appendChild(html);
+ } else if (wysihtml5.browser.supportsHTML5Tags(context)) {
+ tempElement = context.createElement("div");
+ tempElement.innerHTML = html;
+ } else {
+ _ensureHTML5Compatibility(context);
+ tempElement = _innerHTMLShiv(html, context);
+ }
+ return tempElement;
+ };
+})();
+;/**
+ * Walks the dom tree from the given node up until it finds a match
+ * Designed for optimal performance.
+ *
+ * @param {Element} node The from which to check the parent nodes
+ * @param {Object} matchingSet Object to match against (possible properties: nodeName, className, classRegExp)
+ * @param {Number} [levels] How many parents should the function check up from the current node (defaults to 50)
+ * @return {null|Element} Returns the first element that matched the desiredNodeName(s)
+ * @example
+ * var listElement = wysihtml5.dom.getParentElement(document.querySelector("li"), { nodeName: ["MENU", "UL", "OL"] });
+ * // ... or ...
+ * var unorderedListElement = wysihtml5.dom.getParentElement(document.querySelector("li"), { nodeName: "UL" });
+ * // ... or ...
+ * var coloredElement = wysihtml5.dom.getParentElement(myTextNode, { nodeName: "SPAN", className: "wysiwyg-color-red", classRegExp: /wysiwyg-color-[a-z]/g });
+ */
+wysihtml5.dom.getParentElement = (function() {
+
+ function _isSameNodeName(nodeName, desiredNodeNames) {
+ if (!desiredNodeNames || !desiredNodeNames.length) {
+ return true;
+ }
+
+ if (typeof(desiredNodeNames) === "string") {
+ return nodeName === desiredNodeNames;
+ } else {
+ return wysihtml5.lang.array(desiredNodeNames).contains(nodeName);
+ }
+ }
+
+ function _isElement(node) {
+ return node.nodeType === wysihtml5.ELEMENT_NODE;
+ }
+
+ function _hasClassName(element, className, classRegExp) {
+ var classNames = (element.className || "").match(classRegExp) || [];
+ if (!className) {
+ return !!classNames.length;
+ }
+ return classNames[classNames.length - 1] === className;
+ }
+
+ function _hasStyle(element, cssStyle, styleRegExp) {
+ var styles = (element.getAttribute('style') || "").match(styleRegExp) || [];
+ if (!cssStyle) {
+ return !!styles.length;
+ }
+ return styles[styles.length - 1] === cssStyle;
+ }
+
+ return function(node, matchingSet, levels, container) {
+ var findByStyle = (matchingSet.cssStyle || matchingSet.styleRegExp),
+ findByClass = (matchingSet.className || matchingSet.classRegExp);
+
+ levels = levels || 50; // Go max 50 nodes upwards from current node
+
+ while (levels-- && node && node.nodeName !== "BODY" && (!container || node !== container)) {
+ if (_isElement(node) && _isSameNodeName(node.nodeName, matchingSet.nodeName) &&
+ (!findByStyle || _hasStyle(node, matchingSet.cssStyle, matchingSet.styleRegExp)) &&
+ (!findByClass || _hasClassName(node, matchingSet.className, matchingSet.classRegExp))
+ ) {
+ return node;
+ }
+ node = node.parentNode;
+ }
+ return null;
+ };
+})();
+;/**
+ * Get element's style for a specific css property
+ *
+ * @param {Element} element The element on which to retrieve the style
+ * @param {String} property The CSS property to retrieve ("float", "display", "text-align", ...)
+ *
+ * @example
+ * wysihtml5.dom.getStyle("display").from(document.body);
+ * // => "block"
+ */
+wysihtml5.dom.getStyle = (function() {
+ var stylePropertyMapping = {
+ "float": ("styleFloat" in document.createElement("div").style) ? "styleFloat" : "cssFloat"
+ },
+ REG_EXP_CAMELIZE = /\-[a-z]/g;
+
+ function camelize(str) {
+ return str.replace(REG_EXP_CAMELIZE, function(match) {
+ return match.charAt(1).toUpperCase();
+ });
+ }
+
+ return function(property) {
+ return {
+ from: function(element) {
+ if (element.nodeType !== wysihtml5.ELEMENT_NODE) {
+ return;
+ }
+
+ var doc = element.ownerDocument,
+ camelizedProperty = stylePropertyMapping[property] || camelize(property),
+ style = element.style,
+ currentStyle = element.currentStyle,
+ styleValue = style[camelizedProperty];
+ if (styleValue) {
+ return styleValue;
+ }
+
+ // currentStyle is no standard and only supported by Opera and IE but it has one important advantage over the standard-compliant
+ // window.getComputedStyle, since it returns css property values in their original unit:
+ // If you set an elements width to "50%", window.getComputedStyle will give you it's current width in px while currentStyle
+ // gives you the original "50%".
+ // Opera supports both, currentStyle and window.getComputedStyle, that's why checking for currentStyle should have higher prio
+ if (currentStyle) {
+ try {
+ return currentStyle[camelizedProperty];
+ } catch(e) {
+ //ie will occasionally fail for unknown reasons. swallowing exception
+ }
+ }
+
+ var win = doc.defaultView || doc.parentWindow,
+ needsOverflowReset = (property === "height" || property === "width") && element.nodeName === "TEXTAREA",
+ originalOverflow,
+ returnValue;
+
+ if (win.getComputedStyle) {
+ // Chrome and Safari both calculate a wrong width and height for textareas when they have scroll bars
+ // therfore we remove and restore the scrollbar and calculate the value in between
+ if (needsOverflowReset) {
+ originalOverflow = style.overflow;
+ style.overflow = "hidden";
+ }
+ returnValue = win.getComputedStyle(element, null).getPropertyValue(property);
+ if (needsOverflowReset) {
+ style.overflow = originalOverflow || "";
+ }
+ return returnValue;
+ }
+ }
+ };
+ };
+})();
+;wysihtml5.dom.getTextNodes = function(node, ingoreEmpty){
+ var all = [];
+ for (node=node.firstChild;node;node=node.nextSibling){
+ if (node.nodeType == 3) {
+ if (!ingoreEmpty || !(/^\s*$/).test(node.innerText || node.textContent)) {
+ all.push(node);
+ }
+ } else {
+ all = all.concat(wysihtml5.dom.getTextNodes(node, ingoreEmpty));
+ }
+ }
+ return all;
+};;/**
+ * High performant way to check whether an element with a specific tag name is in the given document
+ * Optimized for being heavily executed
+ * Unleashes the power of live node lists
+ *
+ * @param {Object} doc The document object of the context where to check
+ * @param {String} tagName Upper cased tag name
+ * @example
+ * wysihtml5.dom.hasElementWithTagName(document, "IMG");
+ */
+wysihtml5.dom.hasElementWithTagName = (function() {
+ var LIVE_CACHE = {},
+ DOCUMENT_IDENTIFIER = 1;
+
+ function _getDocumentIdentifier(doc) {
+ return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++);
+ }
+
+ return function(doc, tagName) {
+ var key = _getDocumentIdentifier(doc) + ":" + tagName,
+ cacheEntry = LIVE_CACHE[key];
+ if (!cacheEntry) {
+ cacheEntry = LIVE_CACHE[key] = doc.getElementsByTagName(tagName);
+ }
+
+ return cacheEntry.length > 0;
+ };
+})();
+;/**
+ * High performant way to check whether an element with a specific class name is in the given document
+ * Optimized for being heavily executed
+ * Unleashes the power of live node lists
+ *
+ * @param {Object} doc The document object of the context where to check
+ * @param {String} tagName Upper cased tag name
+ * @example
+ * wysihtml5.dom.hasElementWithClassName(document, "foobar");
+ */
+(function(wysihtml5) {
+ var LIVE_CACHE = {},
+ DOCUMENT_IDENTIFIER = 1;
+
+ function _getDocumentIdentifier(doc) {
+ return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++);
+ }
+
+ wysihtml5.dom.hasElementWithClassName = function(doc, className) {
+ // getElementsByClassName is not supported by IE<9
+ // but is sometimes mocked via library code (which then doesn't return live node lists)
+ if (!wysihtml5.browser.supportsNativeGetElementsByClassName()) {
+ return !!doc.querySelector("." + className);
+ }
+
+ var key = _getDocumentIdentifier(doc) + ":" + className,
+ cacheEntry = LIVE_CACHE[key];
+ if (!cacheEntry) {
+ cacheEntry = LIVE_CACHE[key] = doc.getElementsByClassName(className);
+ }
+
+ return cacheEntry.length > 0;
+ };
+})(wysihtml5);
+;wysihtml5.dom.insert = function(elementToInsert) {
+ return {
+ after: function(element) {
+ element.parentNode.insertBefore(elementToInsert, element.nextSibling);
+ },
+
+ before: function(element) {
+ element.parentNode.insertBefore(elementToInsert, element);
+ },
+
+ into: function(element) {
+ element.appendChild(elementToInsert);
+ }
+ };
+};
+;wysihtml5.dom.insertCSS = function(rules) {
+ rules = rules.join("\n");
+
+ return {
+ into: function(doc) {
+ var styleElement = doc.createElement("style");
+ styleElement.type = "text/css";
+
+ if (styleElement.styleSheet) {
+ styleElement.styleSheet.cssText = rules;
+ } else {
+ styleElement.appendChild(doc.createTextNode(rules));
+ }
+
+ var link = doc.querySelector("head link");
+ if (link) {
+ link.parentNode.insertBefore(styleElement, link);
+ return;
+ } else {
+ var head = doc.querySelector("head");
+ if (head) {
+ head.appendChild(styleElement);
+ }
+ }
+ }
+ };
+};
+;// TODO: Refactor dom tree traversing here
+(function(wysihtml5) {
+ wysihtml5.dom.lineBreaks = function(node) {
+
+ function _isLineBreak(n) {
+ return n.nodeName === "BR";
+ }
+
+ /**
+ * Checks whether the elment causes a visual line break
+ * (<br> or block elements)
+ */
+ function _isLineBreakOrBlockElement(element) {
+ if (_isLineBreak(element)) {
+ return true;
+ }
+
+ if (wysihtml5.dom.getStyle("display").from(element) === "block") {
+ return true;
+ }
+
+ return false;
+ }
+
+ return {
+
+ /* wysihtml5.dom.lineBreaks(element).add();
+ *
+ * Adds line breaks before and after the given node if the previous and next siblings
+ * aren't already causing a visual line break (block element or <br>)
+ */
+ add: function(options) {
+ var doc = node.ownerDocument,
+ nextSibling = wysihtml5.dom.domNode(node).next({ignoreBlankTexts: true}),
+ previousSibling = wysihtml5.dom.domNode(node).prev({ignoreBlankTexts: true});
+
+ if (nextSibling && !_isLineBreakOrBlockElement(nextSibling)) {
+ wysihtml5.dom.insert(doc.createElement("br")).after(node);
+ }
+ if (previousSibling && !_isLineBreakOrBlockElement(previousSibling)) {
+ wysihtml5.dom.insert(doc.createElement("br")).before(node);
+ }
+ },
+
+ /* wysihtml5.dom.lineBreaks(element).remove();
+ *
+ * Removes line breaks before and after the given node
+ */
+ remove: function(options) {
+ var nextSibling = wysihtml5.dom.domNode(node).next({ignoreBlankTexts: true}),
+ previousSibling = wysihtml5.dom.domNode(node).prev({ignoreBlankTexts: true});
+
+ if (nextSibling && _isLineBreak(nextSibling)) {
+ nextSibling.parentNode.removeChild(nextSibling);
+ }
+ if (previousSibling && _isLineBreak(previousSibling)) {
+ previousSibling.parentNode.removeChild(previousSibling);
+ }
+ }
+ };
+ };
+})(wysihtml5);;/**
+ * Method to set dom events
+ *
+ * @example
+ * wysihtml5.dom.observe(iframe.contentWindow.document.body, ["focus", "blur"], function() { ... });
+ */
+wysihtml5.dom.observe = function(element, eventNames, handler) {
+ eventNames = typeof(eventNames) === "string" ? [eventNames] : eventNames;
+
+ var handlerWrapper,
+ eventName,
+ i = 0,
+ length = eventNames.length;
+
+ for (; i<length; i++) {
+ eventName = eventNames[i];
+ if (element.addEventListener) {
+ element.addEventListener(eventName, handler, false);
+ } else {
+ handlerWrapper = function(event) {
+ if (!("target" in event)) {
+ event.target = event.srcElement;
+ }
+ event.preventDefault = event.preventDefault || function() {
+ this.returnValue = false;
+ };
+ event.stopPropagation = event.stopPropagation || function() {
+ this.cancelBubble = true;
+ };
+ handler.call(element, event);
+ };
+ element.attachEvent("on" + eventName, handlerWrapper);
+ }
+ }
+
+ return {
+ stop: function() {
+ var eventName,
+ i = 0,
+ length = eventNames.length;
+ for (; i<length; i++) {
+ eventName = eventNames[i];
+ if (element.removeEventListener) {
+ element.removeEventListener(eventName, handler, false);
+ } else {
+ element.detachEvent("on" + eventName, handlerWrapper);
+ }
+ }
+ }
+ };
+};
+;/**
+ * HTML Sanitizer
+ * Rewrites the HTML based on given rules
+ *
+ * @param {Element|String} elementOrHtml HTML String to be sanitized OR element whose content should be sanitized
+ * @param {Object} [rules] List of rules for rewriting the HTML, if there's no rule for an element it will
+ * be converted to a "span". Each rule is a key/value pair where key is the tag to convert, and value the
+ * desired substitution.
+ * @param {Object} context Document object in which to parse the html, needed to sandbox the parsing
+ *
+ * @return {Element|String} Depends on the elementOrHtml parameter. When html then the sanitized html as string elsewise the element.
+ *
+ * @example
+ * var userHTML = '<div id="foo" onclick="alert(1);"><p><font color="red">foo</font><script>alert(1);</script></p></div>';
+ * wysihtml5.dom.parse(userHTML, {
+ * tags {
+ * p: "div", // Rename p tags to div tags
+ * font: "span" // Rename font tags to span tags
+ * div: true, // Keep them, also possible (same result when passing: "div" or true)
+ * script: undefined // Remove script elements
+ * }
+ * });
+ * // => <div><div><span>foo bar</span></div></div>
+ *
+ * var userHTML = '<table><tbody><tr><td>I'm a table!</td></tr></tbody></table>';
+ * wysihtml5.dom.parse(userHTML);
+ * // => '<span><span><span><span>I'm a table!</span></span></span></span>'
+ *
+ * var userHTML = '<div>foobar<br>foobar</div>';
+ * wysihtml5.dom.parse(userHTML, {
+ * tags: {
+ * div: undefined,
+ * br: true
+ * }
+ * });
+ * // => ''
+ *
+ * var userHTML = '<div class="red">foo</div><div class="pink">bar</div>';
+ * wysihtml5.dom.parse(userHTML, {
+ * classes: {
+ * red: 1,
+ * green: 1
+ * },
+ * tags: {
+ * div: {
+ * rename_tag: "p"
+ * }
+ * }
+ * });
+ * // => '<p class="red">foo</p><p>bar</p>'
+ */
+
+wysihtml5.dom.parse = function(elementOrHtml_current, config_current) {
+ /* TODO: Currently escaped module pattern as otherwise folloowing default swill be shared among multiple editors.
+ * Refactor whole code as this method while workind is kind of awkward too */
+
+ /**
+ * It's not possible to use a XMLParser/DOMParser as HTML5 is not always well-formed XML
+ * new DOMParser().parseFromString('<img src="foo.gif">') will cause a parseError since the
+ * node isn't closed
+ *
+ * Therefore we've to use the browser's ordinary HTML parser invoked by setting innerHTML.
+ */
+ var NODE_TYPE_MAPPING = {
+ "1": _handleElement,
+ "3": _handleText,
+ "8": _handleComment
+ },
+ // Rename unknown tags to this
+ DEFAULT_NODE_NAME = "span",
+ WHITE_SPACE_REG_EXP = /\s+/,
+ defaultRules = { tags: {}, classes: {} },
+ currentRules = {};
+
+ /**
+ * Iterates over all childs of the element, recreates them, appends them into a document fragment
+ * which later replaces the entire body content
+ */
+ function parse(elementOrHtml, config) {
+ wysihtml5.lang.object(currentRules).merge(defaultRules).merge(config.rules).get();
+
+ var context = config.context || elementOrHtml.ownerDocument || document,
+ fragment = context.createDocumentFragment(),
+ isString = typeof(elementOrHtml) === "string",
+ clearInternals = false,
+ element,
+ newNode,
+ firstChild;
+
+ if (config.clearInternals === true) {
+ clearInternals = true;
+ }
+
+ if (isString) {
+ element = wysihtml5.dom.getAsDom(elementOrHtml, context);
+ } else {
+ element = elementOrHtml;
+ }
+
+ if (currentRules.selectors) {
+ _applySelectorRules(element, currentRules.selectors);
+ }
+
+ while (element.firstChild) {
+ firstChild = element.firstChild;
+ newNode = _convert(firstChild, config.cleanUp, clearInternals, config.uneditableClass);
+ if (newNode) {
+ fragment.appendChild(newNode);
+ }
+ if (firstChild !== newNode) {
+ element.removeChild(firstChild);
+ }
+ }
+
+ if (config.unjoinNbsps) {
+ // replace joined non-breakable spaces with unjoined
+ var txtnodes = wysihtml5.dom.getTextNodes(fragment);
+ for (var n = txtnodes.length; n--;) {
+ txtnodes[n].nodeValue = txtnodes[n].nodeValue.replace(/([\S\u00A0])\u00A0/gi, "$1 ");
+ }
+ }
+
+ // Clear element contents
+ element.innerHTML = "";
+
+ // Insert new DOM tree
+ element.appendChild(fragment);
+
+ return isString ? wysihtml5.quirks.getCorrectInnerHTML(element) : element;
+ }
+
+ function _convert(oldNode, cleanUp, clearInternals, uneditableClass) {
+ var oldNodeType = oldNode.nodeType,
+ oldChilds = oldNode.childNodes,
+ oldChildsLength = oldChilds.length,
+ method = NODE_TYPE_MAPPING[oldNodeType],
+ i = 0,
+ fragment,
+ newNode,
+ newChild;
+
+ // Passes directly elemets with uneditable class
+ if (uneditableClass && oldNodeType === 1 && wysihtml5.dom.hasClass(oldNode, uneditableClass)) {
+ return oldNode;
+ }
+
+ newNode = method && method(oldNode, clearInternals);
+
+ // Remove or unwrap node in case of return value null or false
+ if (!newNode) {
+ if (newNode === false) {
+ // false defines that tag should be removed but contents should remain (unwrap)
+ fragment = oldNode.ownerDocument.createDocumentFragment();
+
+ for (i = oldChildsLength; i--;) {
+ if (oldChilds[i]) {
+ newChild = _convert(oldChilds[i], cleanUp, clearInternals, uneditableClass);
+ if (newChild) {
+ if (oldChilds[i] === newChild) {
+ i--;
+ }
+ fragment.insertBefore(newChild, fragment.firstChild);
+ }
+ }
+ }
+
+ if (wysihtml5.dom.getStyle("display").from(oldNode) === "block") {
+ fragment.appendChild(oldNode.ownerDocument.createElement("br"));
+ }
+
+ // TODO: try to minimize surplus spaces
+ if (wysihtml5.lang.array([
+ "div", "pre", "p",
+ "table", "td", "th",
+ "ul", "ol", "li",
+ "dd", "dl",
+ "footer", "header", "section",
+ "h1", "h2", "h3", "h4", "h5", "h6"
+ ]).contains(oldNode.nodeName.toLowerCase()) && oldNode.parentNode.lastChild !== oldNode) {
+ // add space at first when unwraping non-textflow elements
+ if (!oldNode.nextSibling || oldNode.nextSibling.nodeType !== 3 || !(/^\s/).test(oldNode.nextSibling.nodeValue)) {
+ fragment.appendChild(oldNode.ownerDocument.createTextNode(" "));
+ }
+ }
+
+ if (fragment.normalize) {
+ fragment.normalize();
+ }
+ return fragment;
+ } else {
+ // Remove
+ return null;
+ }
+ }
+
+ // Converts all childnodes
+ for (i=0; i<oldChildsLength; i++) {
+ if (oldChilds[i]) {
+ newChild = _convert(oldChilds[i], cleanUp, clearInternals, uneditableClass);
+ if (newChild) {
+ if (oldChilds[i] === newChild) {
+ i--;
+ }
+ newNode.appendChild(newChild);
+ }
+ }
+ }
+
+ // Cleanup senseless <span> elements
+ if (cleanUp &&
+ newNode.nodeName.toLowerCase() === DEFAULT_NODE_NAME &&
+ (!newNode.childNodes.length ||
+ ((/^\s*$/gi).test(newNode.innerHTML) && (clearInternals || (oldNode.className !== "_wysihtml5-temp-placeholder" && oldNode.className !== "rangySelectionBoundary"))) ||
+ !newNode.attributes.length)
+ ) {
+ fragment = newNode.ownerDocument.createDocumentFragment();
+ while (newNode.firstChild) {
+ fragment.appendChild(newNode.firstChild);
+ }
+ if (fragment.normalize) {
+ fragment.normalize();
+ }
+ return fragment;
+ }
+
+ if (newNode.normalize) {
+ newNode.normalize();
+ }
+ return newNode;
+ }
+
+ function _applySelectorRules (element, selectorRules) {
+ var sel, method, els;
+
+ for (sel in selectorRules) {
+ if (selectorRules.hasOwnProperty(sel)) {
+ if (wysihtml5.lang.object(selectorRules[sel]).isFunction()) {
+ method = selectorRules[sel];
+ } else if (typeof(selectorRules[sel]) === "string" && elementHandlingMethods[selectorRules[sel]]) {
+ method = elementHandlingMethods[selectorRules[sel]];
+ }
+ els = element.querySelectorAll(sel);
+ for (var i = els.length; i--;) {
+ method(els[i]);
+ }
+ }
+ }
+ }
+
+ function _handleElement(oldNode, clearInternals) {
+ var rule,
+ newNode,
+ tagRules = currentRules.tags,
+ nodeName = oldNode.nodeName.toLowerCase(),
+ scopeName = oldNode.scopeName,
+ renameTag;
+
+ /**
+ * We already parsed that element
+ * ignore it! (yes, this sometimes happens in IE8 when the html is invalid)
+ */
+ if (oldNode._wysihtml5) {
+ return null;
+ }
+ oldNode._wysihtml5 = 1;
+
+ if (oldNode.className === "wysihtml5-temp") {
+ return null;
+ }
+
+ /**
+ * IE is the only browser who doesn't include the namespace in the
+ * nodeName, that's why we have to prepend it by ourselves
+ * scopeName is a proprietary IE feature
+ * read more here http://msdn.microsoft.com/en-us/library/ms534388(v=vs.85).aspx
+ */
+ if (scopeName && scopeName != "HTML") {
+ nodeName = scopeName + ":" + nodeName;
+ }
+ /**
+ * Repair node
+ * IE is a bit bitchy when it comes to invalid nested markup which includes unclosed tags
+ * A <p> doesn't need to be closed according HTML4-5 spec, we simply replace it with a <div> to preserve its content and layout
+ */
+ if ("outerHTML" in oldNode) {
+ if (!wysihtml5.browser.autoClosesUnclosedTags() &&
+ oldNode.nodeName === "P" &&
+ oldNode.outerHTML.slice(-4).toLowerCase() !== "</p>") {
+ nodeName = "div";
+ }
+ }
+
+ if (nodeName in tagRules) {
+ rule = tagRules[nodeName];
+ if (!rule || rule.remove) {
+ return null;
+ } else if (rule.unwrap) {
+ return false;
+ }
+ rule = typeof(rule) === "string" ? { rename_tag: rule } : rule;
+ } else if (oldNode.firstChild) {
+ rule = { rename_tag: DEFAULT_NODE_NAME };
+ } else {
+ // Remove empty unknown elements
+ return null;
+ }
+
+ // tests if type condition is met or node should be removed/unwrapped/renamed
+ if (rule.one_of_type && !_testTypes(oldNode, currentRules, rule.one_of_type, clearInternals)) {
+ if (rule.remove_action) {
+ if (rule.remove_action === "unwrap") {
+ return false;
+ } else if (rule.remove_action === "rename") {
+ renameTag = rule.remove_action_rename_to || DEFAULT_NODE_NAME;
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ newNode = oldNode.ownerDocument.createElement(renameTag || rule.rename_tag || nodeName);
+ _handleAttributes(oldNode, newNode, rule, clearInternals);
+ _handleStyles(oldNode, newNode, rule);
+
+ oldNode = null;
+
+ if (newNode.normalize) { newNode.normalize(); }
+ return newNode;
+ }
+
+ function _testTypes(oldNode, rules, types, clearInternals) {
+ var definition, type;
+
+ // do not interfere with placeholder span or pasting caret position is not maintained
+ if (oldNode.nodeName === "SPAN" && !clearInternals && (oldNode.className === "_wysihtml5-temp-placeholder" || oldNode.className === "rangySelectionBoundary")) {
+ return true;
+ }
+
+ for (type in types) {
+ if (types.hasOwnProperty(type) && rules.type_definitions && rules.type_definitions[type]) {
+ definition = rules.type_definitions[type];
+ if (_testType(oldNode, definition)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ function array_contains(a, obj) {
+ var i = a.length;
+ while (i--) {
+ if (a[i] === obj) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function _testType(oldNode, definition) {
+
+ var nodeClasses = oldNode.getAttribute("class"),
+ nodeStyles = oldNode.getAttribute("style"),
+ classesLength, s, s_corrected, a, attr, currentClass, styleProp;
+
+ // test for methods
+ if (definition.methods) {
+ for (var m in definition.methods) {
+ if (definition.methods.hasOwnProperty(m) && typeCeckMethods[m]) {
+
+ if (typeCeckMethods[m](oldNode)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ // test for classes, if one found return true
+ if (nodeClasses && definition.classes) {
+ nodeClasses = nodeClasses.replace(/^\s+/g, '').replace(/\s+$/g, '').split(WHITE_SPACE_REG_EXP);
+ classesLength = nodeClasses.length;
+ for (var i = 0; i < classesLength; i++) {
+ if (definition.classes[nodeClasses[i]]) {
+ return true;
+ }
+ }
+ }
+
+ // test for styles, if one found return true
+ if (nodeStyles && definition.styles) {
+
+ nodeStyles = nodeStyles.split(';');
+ for (s in definition.styles) {
+ if (definition.styles.hasOwnProperty(s)) {
+ for (var sp = nodeStyles.length; sp--;) {
+ styleProp = nodeStyles[sp].split(':');
+
+ if (styleProp[0].replace(/\s/g, '').toLowerCase() === s) {
+ if (definition.styles[s] === true || definition.styles[s] === 1 || wysihtml5.lang.array(definition.styles[s]).contains(styleProp[1].replace(/\s/g, '').toLowerCase()) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // test for attributes in general against regex match
+ if (definition.attrs) {
+ for (a in definition.attrs) {
+ if (definition.attrs.hasOwnProperty(a)) {
+ attr = wysihtml5.dom.getAttribute(oldNode, a);
+ if (typeof(attr) === "string") {
+ if (attr.search(definition.attrs[a]) > -1) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ function _handleStyles(oldNode, newNode, rule) {
+ var s, v;
+ if(rule && rule.keep_styles) {
+ for (s in rule.keep_styles) {
+ if (rule.keep_styles.hasOwnProperty(s)) {
+ v = (s === "float") ? oldNode.style.styleFloat || oldNode.style.cssFloat : oldNode.style[s];
+ // value can be regex and if so should match or style skipped
+ if (rule.keep_styles[s] instanceof RegExp && !(rule.keep_styles[s].test(v))) {
+ continue;
+ }
+ if (s === "float") {
+ // IE compability
+ newNode.style[(oldNode.style.styleFloat) ? 'styleFloat': 'cssFloat'] = v;
+ } else if (oldNode.style[s]) {
+ newNode.style[s] = v;
+ }
+ }
+ }
+ }
+ };
+
+ function _getAttributesBeginningWith(beginning, attributes) {
+ var returnAttributes = [];
+ for (var attr in attributes) {
+ if (attributes.hasOwnProperty(attr) && attr.indexOf(beginning) === 0) {
+ returnAttributes.push(attr);
+ }
+ }
+ return returnAttributes;
+ }
+
+ function _checkAttribute(attributeName, attributeValue, methodName, nodeName) {
+ var method = attributeCheckMethods[methodName],
+ newAttributeValue;
+
+ if (method) {
+ if (attributeValue || (attributeName === "alt" && nodeName == "IMG")) {
+ newAttributeValue = method(attributeValue);
+ if (typeof(newAttributeValue) === "string") {
+ return newAttributeValue;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ function _checkAttributes(oldNode, local_attributes) {
+ var globalAttributes = wysihtml5.lang.object(currentRules.attributes || {}).clone(), // global values for check/convert values of attributes
+ checkAttributes = wysihtml5.lang.object(globalAttributes).merge( wysihtml5.lang.object(local_attributes || {}).clone()).get(),
+ attributes = {},
+ oldAttributes = wysihtml5.dom.getAttributes(oldNode),
+ attributeName, newValue, matchingAttributes;
+
+ for (attributeName in checkAttributes) {
+ if ((/\*$/).test(attributeName)) {
+
+ matchingAttributes = _getAttributesBeginningWith(attributeName.slice(0,-1), oldAttributes);
+ for (var i = 0, imax = matchingAttributes.length; i < imax; i++) {
+
+ newValue = _checkAttribute(matchingAttributes[i], oldAttributes[matchingAttributes[i]], checkAttributes[attributeName], oldNode.nodeName);
+ if (newValue !== false) {
+ attributes[matchingAttributes[i]] = newValue;
+ }
+ }
+ } else {
+ newValue = _checkAttribute(attributeName, oldAttributes[attributeName], checkAttributes[attributeName], oldNode.nodeName);
+ if (newValue !== false) {
+ attributes[attributeName] = newValue;
+ }
+ }
+ }
+
+ return attributes;
+ }
+
+ // TODO: refactor. Too long to read
+ function _handleAttributes(oldNode, newNode, rule, clearInternals) {
+ var attributes = {}, // fresh new set of attributes to set on newNode
+ setClass = rule.set_class, // classes to set
+ addClass = rule.add_class, // add classes based on existing attributes
+ addStyle = rule.add_style, // add styles based on existing attributes
+ setAttributes = rule.set_attributes, // attributes to set on the current node
+ allowedClasses = currentRules.classes,
+ i = 0,
+ classes = [],
+ styles = [],
+ newClasses = [],
+ oldClasses = [],
+ classesLength,
+ newClassesLength,
+ currentClass,
+ newClass,
+ attributeName,
+ method;
+
+ if (setAttributes) {
+ attributes = wysihtml5.lang.object(setAttributes).clone();
+ }
+
+ // check/convert values of attributes
+ attributes = wysihtml5.lang.object(attributes).merge(_checkAttributes(oldNode, rule.check_attributes)).get();
+
+ if (setClass) {
+ classes.push(setClass);
+ }
+
+ if (addClass) {
+ for (attributeName in addClass) {
+ method = addClassMethods[addClass[attributeName]];
+ if (!method) {
+ continue;
+ }
+ newClass = method(wysihtml5.dom.getAttribute(oldNode, attributeName));
+ if (typeof(newClass) === "string") {
+ classes.push(newClass);
+ }
+ }
+ }
+
+ if (addStyle) {
+ for (attributeName in addStyle) {
+ method = addStyleMethods[addStyle[attributeName]];
+ if (!method) {
+ continue;
+ }
+
+ newStyle = method(wysihtml5.dom.getAttribute(oldNode, attributeName));
+ if (typeof(newStyle) === "string") {
+ styles.push(newStyle);
+ }
+ }
+ }
+
+
+ if (typeof(allowedClasses) === "string" && allowedClasses === "any" && oldNode.getAttribute("class")) {
+ if (currentRules.classes_blacklist) {
+ oldClasses = oldNode.getAttribute("class");
+ if (oldClasses) {
+ classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP));
+ }
+
+ classesLength = classes.length;
+ for (; i<classesLength; i++) {
+ currentClass = classes[i];
+ if (!currentRules.classes_blacklist[currentClass]) {
+ newClasses.push(currentClass);
+ }
+ }
+
+ if (newClasses.length) {
+ attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" ");
+ }
+
+ } else {
+ attributes["class"] = oldNode.getAttribute("class");
+ }
+ } else {
+ // make sure that wysihtml5 temp class doesn't get stripped out
+ if (!clearInternals) {
+ allowedClasses["_wysihtml5-temp-placeholder"] = 1;
+ allowedClasses["_rangySelectionBoundary"] = 1;
+ allowedClasses["wysiwyg-tmp-selected-cell"] = 1;
+ }
+
+ // add old classes last
+ oldClasses = oldNode.getAttribute("class");
+ if (oldClasses) {
+ classes = classes.concat(oldClasses.split(WHITE_SPACE_REG_EXP));
+ }
+ classesLength = classes.length;
+ for (; i<classesLength; i++) {
+ currentClass = classes[i];
+ if (allowedClasses[currentClass]) {
+ newClasses.push(currentClass);
+ }
+ }
+
+ if (newClasses.length) {
+ attributes["class"] = wysihtml5.lang.array(newClasses).unique().join(" ");
+ }
+ }
+
+ // remove table selection class if present
+ if (attributes["class"] && clearInternals) {
+ attributes["class"] = attributes["class"].replace("wysiwyg-tmp-selected-cell", "");
+ if ((/^\s*$/g).test(attributes["class"])) {
+ delete attributes["class"];
+ }
+ }
+
+ if (styles.length) {
+ attributes["style"] = wysihtml5.lang.array(styles).unique().join(" ");
+ }
+
+ // set attributes on newNode
+ for (attributeName in attributes) {
+ // Setting attributes can cause a js error in IE under certain circumstances
+ // eg. on a <img> under https when it's new attribute value is non-https
+ // TODO: Investigate this further and check for smarter handling
+ try {
+ newNode.setAttribute(attributeName, attributes[attributeName]);
+ } catch(e) {}
+ }
+
+ // IE8 sometimes loses the width/height attributes when those are set before the "src"
+ // so we make sure to set them again
+ if (attributes.src) {
+ if (typeof(attributes.width) !== "undefined") {
+ newNode.setAttribute("width", attributes.width);
+ }
+ if (typeof(attributes.height) !== "undefined") {
+ newNode.setAttribute("height", attributes.height);
+ }
+ }
+ }
+
+ var INVISIBLE_SPACE_REG_EXP = /\uFEFF/g;
+ function _handleText(oldNode) {
+ var nextSibling = oldNode.nextSibling;
+ if (nextSibling && nextSibling.nodeType === wysihtml5.TEXT_NODE) {
+ // Concatenate text nodes
+ nextSibling.data = oldNode.data.replace(INVISIBLE_SPACE_REG_EXP, "") + nextSibling.data.replace(INVISIBLE_SPACE_REG_EXP, "");
+ } else {
+ // \uFEFF = wysihtml5.INVISIBLE_SPACE (used as a hack in certain rich text editing situations)
+ var data = oldNode.data.replace(INVISIBLE_SPACE_REG_EXP, "");
+ return oldNode.ownerDocument.createTextNode(data);
+ }
+ }
+
+ function _handleComment(oldNode) {
+ if (currentRules.comments) {
+ return oldNode.ownerDocument.createComment(oldNode.nodeValue);
+ }
+ }
+
+ // ------------ attribute checks ------------ \\
+ var attributeCheckMethods = {
+ url: (function() {
+ var REG_EXP = /^https?:\/\//i;
+ return function(attributeValue) {
+ if (!attributeValue || !attributeValue.match(REG_EXP)) {
+ return null;
+ }
+ return attributeValue.replace(REG_EXP, function(match) {
+ return match.toLowerCase();
+ });
+ };
+ })(),
+
+ src: (function() {
+ var REG_EXP = /^(\/|https?:\/\/)/i;
+ return function(attributeValue) {
+ if (!attributeValue || !attributeValue.match(REG_EXP)) {
+ return null;
+ }
+ return attributeValue.replace(REG_EXP, function(match) {
+ return match.toLowerCase();
+ });
+ };
+ })(),
+
+ href: (function() {
+ var REG_EXP = /^(#|\/|https?:\/\/|mailto:)/i;
+ return function(attributeValue) {
+ if (!attributeValue || !attributeValue.match(REG_EXP)) {
+ return null;
+ }
+ return attributeValue.replace(REG_EXP, function(match) {
+ return match.toLowerCase();
+ });
+ };
+ })(),
+
+ alt: (function() {
+ var REG_EXP = /[^ a-z0-9_\-]/gi;
+ return function(attributeValue) {
+ if (!attributeValue) {
+ return "";
+ }
+ return attributeValue.replace(REG_EXP, "");
+ };
+ })(),
+
+ numbers: (function() {
+ var REG_EXP = /\D/g;
+ return function(attributeValue) {
+ attributeValue = (attributeValue || "").replace(REG_EXP, "");
+ return attributeValue || null;
+ };
+ })(),
+
+ any: (function() {
+ return function(attributeValue) {
+ return attributeValue;
+ };
+ })()
+ };
+
+ // ------------ style converter (converts an html attribute to a style) ------------ \\
+ var addStyleMethods = {
+ align_text: (function() {
+ var mapping = {
+ left: "text-align: left;",
+ right: "text-align: right;",
+ center: "text-align: center;"
+ };
+ return function(attributeValue) {
+ return mapping[String(attributeValue).toLowerCase()];
+ };
+ })(),
+ };
+
+ // ------------ class converter (converts an html attribute to a class name) ------------ \\
+ var addClassMethods = {
+ align_img: (function() {
+ var mapping = {
+ left: "wysiwyg-float-left",
+ right: "wysiwyg-float-right"
+ };
+ return function(attributeValue) {
+ return mapping[String(attributeValue).toLowerCase()];
+ };
+ })(),
+
+ align_text: (function() {
+ var mapping = {
+ left: "wysiwyg-text-align-left",
+ right: "wysiwyg-text-align-right",
+ center: "wysiwyg-text-align-center",
+ justify: "wysiwyg-text-align-justify"
+ };
+ return function(attributeValue) {
+ return mapping[String(attributeValue).toLowerCase()];
+ };
+ })(),
+
+ clear_br: (function() {
+ var mapping = {
+ left: "wysiwyg-clear-left",
+ right: "wysiwyg-clear-right",
+ both: "wysiwyg-clear-both",
+ all: "wysiwyg-clear-both"
+ };
+ return function(attributeValue) {
+ return mapping[String(attributeValue).toLowerCase()];
+ };
+ })(),
+
+ size_font: (function() {
+ var mapping = {
+ "1": "wysiwyg-font-size-xx-small",
+ "2": "wysiwyg-font-size-small",
+ "3": "wysiwyg-font-size-medium",
+ "4": "wysiwyg-font-size-large",
+ "5": "wysiwyg-font-size-x-large",
+ "6": "wysiwyg-font-size-xx-large",
+ "7": "wysiwyg-font-size-xx-large",
+ "-": "wysiwyg-font-size-smaller",
+ "+": "wysiwyg-font-size-larger"
+ };
+ return function(attributeValue) {
+ return mapping[String(attributeValue).charAt(0)];
+ };
+ })()
+ };
+
+ // checks if element is possibly visible
+ var typeCeckMethods = {
+ has_visible_contet: (function() {
+ var txt,
+ isVisible = false,
+ visibleElements = ['img', 'video', 'picture', 'br', 'script', 'noscript',
+ 'style', 'table', 'iframe', 'object', 'embed', 'audio',
+ 'svg', 'input', 'button', 'select','textarea', 'canvas'];
+
+ return function(el) {
+
+ // has visible innertext. so is visible
+ txt = (el.innerText || el.textContent).replace(/\s/g, '');
+ if (txt && txt.length > 0) {
+ return true;
+ }
+
+ // matches list of visible dimensioned elements
+ for (var i = visibleElements.length; i--;) {
+ if (el.querySelector(visibleElements[i])) {
+ return true;
+ }
+ }
+
+ // try to measure dimesions in last resort. (can find only of elements in dom)
+ if (el.offsetWidth && el.offsetWidth > 0 && el.offsetHeight && el.offsetHeight > 0) {
+ return true;
+ }
+
+ return false;
+ };
+ })()
+ };
+
+ var elementHandlingMethods = {
+ unwrap: function (element) {
+ wysihtml5.dom.unwrap(element);
+ },
+
+ remove: function (element) {
+ element.parentNode.removeChild(element);
+ }
+ };
+
+ return parse(elementOrHtml_current, config_current);
+};
+;/**
+ * Checks for empty text node childs and removes them
+ *
+ * @param {Element} node The element in which to cleanup
+ * @example
+ * wysihtml5.dom.removeEmptyTextNodes(element);
+ */
+wysihtml5.dom.removeEmptyTextNodes = function(node) {
+ var childNode,
+ childNodes = wysihtml5.lang.array(node.childNodes).get(),
+ childNodesLength = childNodes.length,
+ i = 0;
+ for (; i<childNodesLength; i++) {
+ childNode = childNodes[i];
+ if (childNode.nodeType === wysihtml5.TEXT_NODE && childNode.data === "") {
+ childNode.parentNode.removeChild(childNode);
+ }
+ }
+};
+;/**
+ * Renames an element (eg. a <div> to a <p>) and keeps its childs
+ *
+ * @param {Element} element The list element which should be renamed
+ * @param {Element} newNodeName The desired tag name
+ *
+ * @example
+ * <!-- Assume the following dom: -->
+ * <ul id="list">
+ * <li>eminem</li>
+ * <li>dr. dre</li>
+ * <li>50 Cent</li>
+ * </ul>
+ *
+ * <script>
+ * wysihtml5.dom.renameElement(document.getElementById("list"), "ol");
+ * </script>
+ *
+ * <!-- Will result in: -->
+ * <ol>
+ * <li>eminem</li>
+ * <li>dr. dre</li>
+ * <li>50 Cent</li>
+ * </ol>
+ */
+wysihtml5.dom.renameElement = function(element, newNodeName) {
+ var newElement = element.ownerDocument.createElement(newNodeName),
+ firstChild;
+ while (firstChild = element.firstChild) {
+ newElement.appendChild(firstChild);
+ }
+ wysihtml5.dom.copyAttributes(["align", "className"]).from(element).to(newElement);
+ element.parentNode.replaceChild(newElement, element);
+ return newElement;
+};
+;/**
+ * Takes an element, removes it and replaces it with it's childs
+ *
+ * @param {Object} node The node which to replace with it's child nodes
+ * @example
+ * <div id="foo">
+ * <span>hello</span>
+ * </div>
+ * <script>
+ * // Remove #foo and replace with it's children
+ * wysihtml5.dom.replaceWithChildNodes(document.getElementById("foo"));
+ * </script>
+ */
+wysihtml5.dom.replaceWithChildNodes = function(node) {
+ if (!node.parentNode) {
+ return;
+ }
+
+ if (!node.firstChild) {
+ node.parentNode.removeChild(node);
+ return;
+ }
+
+ var fragment = node.ownerDocument.createDocumentFragment();
+ while (node.firstChild) {
+ fragment.appendChild(node.firstChild);
+ }
+ node.parentNode.replaceChild(fragment, node);
+ node = fragment = null;
+};
+;/**
+ * Unwraps an unordered/ordered list
+ *
+ * @param {Element} element The list element which should be unwrapped
+ *
+ * @example
+ * <!-- Assume the following dom: -->
+ * <ul id="list">
+ * <li>eminem</li>
+ * <li>dr. dre</li>
+ * <li>50 Cent</li>
+ * </ul>
+ *
+ * <script>
+ * wysihtml5.dom.resolveList(document.getElementById("list"));
+ * </script>
+ *
+ * <!-- Will result in: -->
+ * eminem<br>
+ * dr. dre<br>
+ * 50 Cent<br>
+ */
+(function(dom) {
+ function _isBlockElement(node) {
+ return dom.getStyle("display").from(node) === "block";
+ }
+
+ function _isLineBreak(node) {
+ return node.nodeName === "BR";
+ }
+
+ function _appendLineBreak(element) {
+ var lineBreak = element.ownerDocument.createElement("br");
+ element.appendChild(lineBreak);
+ }
+
+ function resolveList(list, useLineBreaks) {
+ if (!list.nodeName.match(/^(MENU|UL|OL)$/)) {
+ return;
+ }
+
+ var doc = list.ownerDocument,
+ fragment = doc.createDocumentFragment(),
+ previousSibling = wysihtml5.dom.domNode(list).prev({ignoreBlankTexts: true}),
+ firstChild,
+ lastChild,
+ isLastChild,
+ shouldAppendLineBreak,
+ paragraph,
+ listItem;
+
+ if (useLineBreaks) {
+ // Insert line break if list is after a non-block element
+ if (previousSibling && !_isBlockElement(previousSibling) && !_isLineBreak(previousSibling)) {
+ _appendLineBreak(fragment);
+ }
+
+ while (listItem = (list.firstElementChild || list.firstChild)) {
+ lastChild = listItem.lastChild;
+ while (firstChild = listItem.firstChild) {
+ isLastChild = firstChild === lastChild;
+ // This needs to be done before appending it to the fragment, as it otherwise will lose style information
+ shouldAppendLineBreak = isLastChild && !_isBlockElement(firstChild) && !_isLineBreak(firstChild);
+ fragment.appendChild(firstChild);
+ if (shouldAppendLineBreak) {
+ _appendLineBreak(fragment);
+ }
+ }
+
+ listItem.parentNode.removeChild(listItem);
+ }
+ } else {
+ while (listItem = (list.firstElementChild || list.firstChild)) {
+ if (listItem.querySelector && listItem.querySelector("div, p, ul, ol, menu, blockquote, h1, h2, h3, h4, h5, h6")) {
+ while (firstChild = listItem.firstChild) {
+ fragment.appendChild(firstChild);
+ }
+ } else {
+ paragraph = doc.createElement("p");
+ while (firstChild = listItem.firstChild) {
+ paragraph.appendChild(firstChild);
+ }
+ fragment.appendChild(paragraph);
+ }
+ listItem.parentNode.removeChild(listItem);
+ }
+ }
+
+ list.parentNode.replaceChild(fragment, list);
+ }
+
+ dom.resolveList = resolveList;
+})(wysihtml5.dom);
+;/**
+ * Sandbox for executing javascript, parsing css styles and doing dom operations in a secure way
+ *
+ * Browser Compatibility:
+ * - Secure in MSIE 6+, but only when the user hasn't made changes to his security level "restricted"
+ * - Partially secure in other browsers (Firefox, Opera, Safari, Chrome, ...)
+ *
+ * Please note that this class can't benefit from the HTML5 sandbox attribute for the following reasons:
+ * - sandboxing doesn't work correctly with inlined content (src="javascript:'<html>...</html>'")
+ * - sandboxing of physical documents causes that the dom isn't accessible anymore from the outside (iframe.contentWindow, ...)
+ * - setting the "allow-same-origin" flag would fix that, but then still javascript and dom events refuse to fire
+ * - therefore the "allow-scripts" flag is needed, which then would deactivate any security, as the js executed inside the iframe
+ * can do anything as if the sandbox attribute wasn't set
+ *
+ * @param {Function} [readyCallback] Method that gets invoked when the sandbox is ready
+ * @param {Object} [config] Optional parameters
+ *
+ * @example
+ * new wysihtml5.dom.Sandbox(function(sandbox) {
+ * sandbox.getWindow().document.body.innerHTML = '<img src=foo.gif onerror="alert(document.cookie)">';
+ * });
+ */
+(function(wysihtml5) {
+ var /**
+ * Default configuration
+ */
+ doc = document,
+ /**
+ * Properties to unset/protect on the window object
+ */
+ windowProperties = [
+ "parent", "top", "opener", "frameElement", "frames",
+ "localStorage", "globalStorage", "sessionStorage", "indexedDB"
+ ],
+ /**
+ * Properties on the window object which are set to an empty function
+ */
+ windowProperties2 = [
+ "open", "close", "openDialog", "showModalDialog",
+ "alert", "confirm", "prompt",
+ "openDatabase", "postMessage",
+ "XMLHttpRequest", "XDomainRequest"
+ ],
+ /**
+ * Properties to unset/protect on the document object
+ */
+ documentProperties = [
+ "referrer",
+ "write", "open", "close"
+ ];
+
+ wysihtml5.dom.Sandbox = Base.extend(
+ /** @scope wysihtml5.dom.Sandbox.prototype */ {
+
+ constructor: function(readyCallback, config) {
+ this.callback = readyCallback || wysihtml5.EMPTY_FUNCTION;
+ this.config = wysihtml5.lang.object({}).merge(config).get();
+ this.editableArea = this._createIframe();
+ },
+
+ insertInto: function(element) {
+ if (typeof(element) === "string") {
+ element = doc.getElementById(element);
+ }
+
+ element.appendChild(this.editableArea);
+ },
+
+ getIframe: function() {
+ return this.editableArea;
+ },
+
+ getWindow: function() {
+ this._readyError();
+ },
+
+ getDocument: function() {
+ this._readyError();
+ },
+
+ destroy: function() {
+ var iframe = this.getIframe();
+ iframe.parentNode.removeChild(iframe);
+ },
+
+ _readyError: function() {
+ throw new Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet");
+ },
+
+ /**
+ * Creates the sandbox iframe
+ *
+ * Some important notes:
+ * - We can't use HTML5 sandbox for now:
+ * setting it causes that the iframe's dom can't be accessed from the outside
+ * Therefore we need to set the "allow-same-origin" flag which enables accessing the iframe's dom
+ * But then there's another problem, DOM events (focus, blur, change, keypress, ...) aren't fired.
+ * In order to make this happen we need to set the "allow-scripts" flag.
+ * A combination of allow-scripts and allow-same-origin is almost the same as setting no sandbox attribute at all.
+ * - Chrome & Safari, doesn't seem to support sandboxing correctly when the iframe's html is inlined (no physical document)
+ * - IE needs to have the security="restricted" attribute set before the iframe is
+ * inserted into the dom tree
+ * - Believe it or not but in IE "security" in document.createElement("iframe") is false, even
+ * though it supports it
+ * - When an iframe has security="restricted", in IE eval() & execScript() don't work anymore
+ * - IE doesn't fire the onload event when the content is inlined in the src attribute, therefore we rely
+ * on the onreadystatechange event
+ */
+ _createIframe: function() {
+ var that = this,
+ iframe = doc.createElement("iframe");
+ iframe.className = "wysihtml5-sandbox";
+ wysihtml5.dom.setAttributes({
+ "security": "restricted",
+ "allowtransparency": "true",
+ "frameborder": 0,
+ "width": 0,
+ "height": 0,
+ "marginwidth": 0,
+ "marginheight": 0
+ }).on(iframe);
+
+ // Setting the src like this prevents ssl warnings in IE6
+ if (wysihtml5.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()) {
+ iframe.src = "javascript:'<html></html>'";
+ }
+
+ iframe.onload = function() {
+ iframe.onreadystatechange = iframe.onload = null;
+ that._onLoadIframe(iframe);
+ };
+
+ iframe.onreadystatechange = function() {
+ if (/loaded|complete/.test(iframe.readyState)) {
+ iframe.onreadystatechange = iframe.onload = null;
+ that._onLoadIframe(iframe);
+ }
+ };
+
+ return iframe;
+ },
+
+ /**
+ * Callback for when the iframe has finished loading
+ */
+ _onLoadIframe: function(iframe) {
+ // don't resume when the iframe got unloaded (eg. by removing it from the dom)
+ if (!wysihtml5.dom.contains(doc.documentElement, iframe)) {
+ return;
+ }
+
+ var that = this,
+ iframeWindow = iframe.contentWindow,
+ iframeDocument = iframe.contentWindow.document,
+ charset = doc.characterSet || doc.charset || "utf-8",
+ sandboxHtml = this._getHtml({
+ charset: charset,
+ stylesheets: this.config.stylesheets
+ });
+
+ // Create the basic dom tree including proper DOCTYPE and charset
+ iframeDocument.open("text/html", "replace");
+ iframeDocument.write(sandboxHtml);
+ iframeDocument.close();
+
+ this.getWindow = function() { return iframe.contentWindow; };
+ this.getDocument = function() { return iframe.contentWindow.document; };
+
+ // Catch js errors and pass them to the parent's onerror event
+ // addEventListener("error") doesn't work properly in some browsers
+ // TODO: apparently this doesn't work in IE9!
+ iframeWindow.onerror = function(errorMessage, fileName, lineNumber) {
+ throw new Error("wysihtml5.Sandbox: " + errorMessage, fileName, lineNumber);
+ };
+
+ if (!wysihtml5.browser.supportsSandboxedIframes()) {
+ // Unset a bunch of sensitive variables
+ // Please note: This isn't hack safe!
+ // It more or less just takes care of basic attacks and prevents accidental theft of sensitive information
+ // IE is secure though, which is the most important thing, since IE is the only browser, who
+ // takes over scripts & styles into contentEditable elements when copied from external websites
+ // or applications (Microsoft Word, ...)
+ var i, length;
+ for (i=0, length=windowProperties.length; i<length; i++) {
+ this._unset(iframeWindow, windowProperties[i]);
+ }
+ for (i=0, length=windowProperties2.length; i<length; i++) {
+ this._unset(iframeWindow, windowProperties2[i], wysihtml5.EMPTY_FUNCTION);
+ }
+ for (i=0, length=documentProperties.length; i<length; i++) {
+ this._unset(iframeDocument, documentProperties[i]);
+ }
+ // This doesn't work in Safari 5
+ // See http://stackoverflow.com/questions/992461/is-it-possible-to-override-document-cookie-in-webkit
+ this._unset(iframeDocument, "cookie", "", true);
+ }
+
+ this.loaded = true;
+
+ // Trigger the callback
+ setTimeout(function() { that.callback(that); }, 0);
+ },
+
+ _getHtml: function(templateVars) {
+ var stylesheets = templateVars.stylesheets,
+ html = "",
+ i = 0,
+ length;
+ stylesheets = typeof(stylesheets) === "string" ? [stylesheets] : stylesheets;
+ if (stylesheets) {
+ length = stylesheets.length;
+ for (; i<length; i++) {
+ html += '<link rel="stylesheet" href="' + stylesheets[i] + '">';
+ }
+ }
+ templateVars.stylesheets = html;
+
+ return wysihtml5.lang.string(
+ '<!DOCTYPE html><html><head>'
+ + '<meta charset="#{charset}">#{stylesheets}</head>'
+ + '<body></body></html>'
+ ).interpolate(templateVars);
+ },
+
+ /**
+ * Method to unset/override existing variables
+ * @example
+ * // Make cookie unreadable and unwritable
+ * this._unset(document, "cookie", "", true);
+ */
+ _unset: function(object, property, value, setter) {
+ try { object[property] = value; } catch(e) {}
+
+ try { object.__defineGetter__(property, function() { return value; }); } catch(e) {}
+ if (setter) {
+ try { object.__defineSetter__(property, function() {}); } catch(e) {}
+ }
+
+ if (!wysihtml5.browser.crashesWhenDefineProperty(property)) {
+ try {
+ var config = {
+ get: function() { return value; }
+ };
+ if (setter) {
+ config.set = function() {};
+ }
+ Object.defineProperty(object, property, config);
+ } catch(e) {}
+ }
+ }
+ });
+})(wysihtml5);
+;(function(wysihtml5) {
+ var doc = document;
+ wysihtml5.dom.ContentEditableArea = Base.extend({
+ getContentEditable: function() {
+ return this.element;
+ },
+
+ getWindow: function() {
+ return this.element.ownerDocument.defaultView;
+ },
+
+ getDocument: function() {
+ return this.element.ownerDocument;
+ },
+
+ constructor: function(readyCallback, config, contentEditable) {
+ this.callback = readyCallback || wysihtml5.EMPTY_FUNCTION;
+ this.config = wysihtml5.lang.object({}).merge(config).get();
+ if (contentEditable) {
+ this.element = this._bindElement(contentEditable);
+ } else {
+ this.element = this._createElement();
+ }
+ },
+
+ // creates a new contenteditable and initiates it
+ _createElement: function() {
+ var element = doc.createElement("div");
+ element.className = "wysihtml5-sandbox";
+ this._loadElement(element);
+ return element;
+ },
+
+ // initiates an allready existent contenteditable
+ _bindElement: function(contentEditable) {
+ contentEditable.className = (contentEditable.className && contentEditable.className != '') ? contentEditable.className + " wysihtml5-sandbox" : "wysihtml5-sandbox";
+ this._loadElement(contentEditable, true);
+ return contentEditable;
+ },
+
+ _loadElement: function(element, contentExists) {
+ var that = this;
+ if (!contentExists) {
+ var sandboxHtml = this._getHtml();
+ element.innerHTML = sandboxHtml;
+ }
+
+ this.getWindow = function() { return element.ownerDocument.defaultView; };
+ this.getDocument = function() { return element.ownerDocument; };
+
+ // Catch js errors and pass them to the parent's onerror event
+ // addEventListener("error") doesn't work properly in some browsers
+ // TODO: apparently this doesn't work in IE9!
+ // TODO: figure out and bind the errors logic for contenteditble mode
+ /*iframeWindow.onerror = function(errorMessage, fileName, lineNumber) {
+ throw new Error("wysihtml5.Sandbox: " + errorMessage, fileName, lineNumber);
+ }
+ */
+ this.loaded = true;
+ // Trigger the callback
+ setTimeout(function() { that.callback(that); }, 0);
+ },
+
+ _getHtml: function(templateVars) {
+ return '';
+ }
+
+ });
+})(wysihtml5);
+;(function() {
+ var mapping = {
+ "className": "class"
+ };
+ wysihtml5.dom.setAttributes = function(attributes) {
+ return {
+ on: function(element) {
+ for (var i in attributes) {
+ element.setAttribute(mapping[i] || i, attributes[i]);
+ }
+ }
+ };
+ };
+})();
+;wysihtml5.dom.setStyles = function(styles) {
+ return {
+ on: function(element) {
+ var style = element.style;
+ if (typeof(styles) === "string") {
+ style.cssText += ";" + styles;
+ return;
+ }
+ for (var i in styles) {
+ if (i === "float") {
+ style.cssFloat = styles[i];
+ style.styleFloat = styles[i];
+ } else {
+ style[i] = styles[i];
+ }
+ }
+ }
+ };
+};
+;/**
+ * Simulate HTML5 placeholder attribute
+ *
+ * Needed since
+ * - div[contentEditable] elements don't support it
+ * - older browsers (such as IE8 and Firefox 3.6) don't support it at all
+ *
+ * @param {Object} parent Instance of main wysihtml5.Editor class
+ * @param {Element} view Instance of wysihtml5.views.* class
+ * @param {String} placeholderText
+ *
+ * @example
+ * wysihtml.dom.simulatePlaceholder(this, composer, "Foobar");
+ */
+(function(dom) {
+ dom.simulatePlaceholder = function(editor, view, placeholderText) {
+ var CLASS_NAME = "placeholder",
+ unset = function() {
+ var composerIsVisible = view.element.offsetWidth > 0 && view.element.offsetHeight > 0;
+ if (view.hasPlaceholderSet()) {
+ view.clear();
+ view.element.focus();
+ if (composerIsVisible ) {
+ setTimeout(function() {
+ var sel = view.selection.getSelection();
+ if (!sel.focusNode || !sel.anchorNode) {
+ view.selection.selectNode(view.element.firstChild || view.element);
+ }
+ }, 0);
+ }
+ }
+ view.placeholderSet = false;
+ dom.removeClass(view.element, CLASS_NAME);
+ },
+ set = function() {
+ if (view.isEmpty()) {
+ view.placeholderSet = true;
+ view.setValue(placeholderText);
+ dom.addClass(view.element, CLASS_NAME);
+ }
+ };
+
+ editor
+ .on("set_placeholder", set)
+ .on("unset_placeholder", unset)
+ .on("focus:composer", unset)
+ .on("paste:composer", unset)
+ .on("blur:composer", set);
+
+ set();
+ };
+})(wysihtml5.dom);
+;(function(dom) {
+ var documentElement = document.documentElement;
+ if ("textContent" in documentElement) {
+ dom.setTextContent = function(element, text) {
+ element.textContent = text;
+ };
+
+ dom.getTextContent = function(element) {
+ return element.textContent;
+ };
+ } else if ("innerText" in documentElement) {
+ dom.setTextContent = function(element, text) {
+ element.innerText = text;
+ };
+
+ dom.getTextContent = function(element) {
+ return element.innerText;
+ };
+ } else {
+ dom.setTextContent = function(element, text) {
+ element.nodeValue = text;
+ };
+
+ dom.getTextContent = function(element) {
+ return element.nodeValue;
+ };
+ }
+})(wysihtml5.dom);
+
+;/**
+ * Get a set of attribute from one element
+ *
+ * IE gives wrong results for hasAttribute/getAttribute, for example:
+ * var td = document.createElement("td");
+ * td.getAttribute("rowspan"); // => "1" in IE
+ *
+ * Therefore we have to check the element's outerHTML for the attribute
+*/
+
+wysihtml5.dom.getAttribute = function(node, attributeName) {
+ var HAS_GET_ATTRIBUTE_BUG = !wysihtml5.browser.supportsGetAttributeCorrectly();
+ attributeName = attributeName.toLowerCase();
+ var nodeName = node.nodeName;
+ if (nodeName == "IMG" && attributeName == "src" && wysihtml5.dom.isLoadedImage(node) === true) {
+ // Get 'src' attribute value via object property since this will always contain the
+ // full absolute url (http://...)
+ // this fixes a very annoying bug in firefox (ver 3.6 & 4) and IE 8 where images copied from the same host
+ // will have relative paths, which the sanitizer strips out (see attributeCheckMethods.url)
+ return node.src;
+ } else if (HAS_GET_ATTRIBUTE_BUG && "outerHTML" in node) {
+ // Don't trust getAttribute/hasAttribute in IE 6-8, instead check the element's outerHTML
+ var outerHTML = node.outerHTML.toLowerCase(),
+ // TODO: This might not work for attributes without value: <input disabled>
+ hasAttribute = outerHTML.indexOf(" " + attributeName + "=") != -1;
+
+ return hasAttribute ? node.getAttribute(attributeName) : null;
+ } else{
+ return node.getAttribute(attributeName);
+ }
+};
+;/**
+ * Get all attributes of an element
+ *
+ * IE gives wrong results for hasAttribute/getAttribute, for example:
+ * var td = document.createElement("td");
+ * td.getAttribute("rowspan"); // => "1" in IE
+ *
+ * Therefore we have to check the element's outerHTML for the attribute
+*/
+
+wysihtml5.dom.getAttributes = function(node) {
+ var HAS_GET_ATTRIBUTE_BUG = !wysihtml5.browser.supportsGetAttributeCorrectly(),
+ nodeName = node.nodeName,
+ attributes = [],
+ attr;
+
+ for (attr in node.attributes) {
+ if ((node.attributes.hasOwnProperty && node.attributes.hasOwnProperty(attr)) || (!node.attributes.hasOwnProperty && Object.prototype.hasOwnProperty.call(node.attributes, attr))) {
+ if (node.attributes[attr].specified) {
+ if (nodeName == "IMG" && node.attributes[attr].name.toLowerCase() == "src" && wysihtml5.dom.isLoadedImage(node) === true) {
+ attributes['src'] = node.src;
+ } else if (wysihtml5.lang.array(['rowspan', 'colspan']).contains(node.attributes[attr].name.toLowerCase()) && HAS_GET_ATTRIBUTE_BUG) {
+ if (node.attributes[attr].value !== 1) {
+ attributes[node.attributes[attr].name] = node.attributes[attr].value;
+ }
+ } else {
+ attributes[node.attributes[attr].name] = node.attributes[attr].value;
+ }
+ }
+ }
+ }
+ return attributes;
+};;/**
+ * Check whether the given node is a proper loaded image
+ * FIXME: Returns undefined when unknown (Chrome, Safari)
+*/
+
+wysihtml5.dom.isLoadedImage = function (node) {
+ try {
+ return node.complete && !node.mozMatchesSelector(":-moz-broken");
+ } catch(e) {
+ if (node.complete && node.readyState === "complete") {
+ return true;
+ }
+ }
+};
+;(function(wysihtml5) {
+
+ var api = wysihtml5.dom;
+
+ var MapCell = function(cell) {
+ this.el = cell;
+ this.isColspan= false;
+ this.isRowspan= false;
+ this.firstCol= true;
+ this.lastCol= true;
+ this.firstRow= true;
+ this.lastRow= true;
+ this.isReal= true;
+ this.spanCollection= [];
+ this.modified = false;
+ };
+
+ var TableModifyerByCell = function (cell, table) {
+ if (cell) {
+ this.cell = cell;
+ this.table = api.getParentElement(cell, { nodeName: ["TABLE"] });
+ } else if (table) {
+ this.table = table;
+ this.cell = this.table.querySelectorAll('th, td')[0];
+ }
+ };
+
+ function queryInList(list, query) {
+ var ret = [],
+ q;
+ for (var e = 0, len = list.length; e < len; e++) {
+ q = list[e].querySelectorAll(query);
+ if (q) {
+ for(var i = q.length; i--; ret.unshift(q[i]));
+ }
+ }
+ return ret;
+ }
+
+ function removeElement(el) {
+ el.parentNode.removeChild(el);
+ }
+
+ function insertAfter(referenceNode, newNode) {
+ referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
+ }
+
+ function nextNode(node, tag) {
+ var element = node.nextSibling;
+ while (element.nodeType !=1) {
+ element = element.nextSibling;
+ if (!tag || tag == element.tagName.toLowerCase()) {
+ return element;
+ }
+ }
+ return null;
+ }
+
+ TableModifyerByCell.prototype = {
+
+ addSpannedCellToMap: function(cell, map, r, c, cspan, rspan) {
+ var spanCollect = [],
+ rmax = r + ((rspan) ? parseInt(rspan, 10) - 1 : 0),
+ cmax = c + ((cspan) ? parseInt(cspan, 10) - 1 : 0);
+
+ for (var rr = r; rr <= rmax; rr++) {
+ if (typeof map[rr] == "undefined") { map[rr] = []; }
+ for (var cc = c; cc <= cmax; cc++) {
+ map[rr][cc] = new MapCell(cell);
+ map[rr][cc].isColspan = (cspan && parseInt(cspan, 10) > 1);
+ map[rr][cc].isRowspan = (rspan && parseInt(rspan, 10) > 1);
+ map[rr][cc].firstCol = cc == c;
+ map[rr][cc].lastCol = cc == cmax;
+ map[rr][cc].firstRow = rr == r;
+ map[rr][cc].lastRow = rr == rmax;
+ map[rr][cc].isReal = cc == c && rr == r;
+ map[rr][cc].spanCollection = spanCollect;
+
+ spanCollect.push(map[rr][cc]);
+ }
+ }
+ },
+
+ setCellAsModified: function(cell) {
+ cell.modified = true;
+ if (cell.spanCollection.length > 0) {
+ for (var s = 0, smax = cell.spanCollection.length; s < smax; s++) {
+ cell.spanCollection[s].modified = true;
+ }
+ }
+ },
+
+ setTableMap: function() {
+ var map = [];
+ var tableRows = this.getTableRows(),
+ ridx, row, cells, cidx, cell,
+ c,
+ cspan, rspan;
+
+ for (ridx = 0; ridx < tableRows.length; ridx++) {
+ row = tableRows[ridx];
+ cells = this.getRowCells(row);
+ c = 0;
+ if (typeof map[ridx] == "undefined") { map[ridx] = []; }
+ for (cidx = 0; cidx < cells.length; cidx++) {
+ cell = cells[cidx];
+
+ // If cell allready set means it is set by col or rowspan,
+ // so increase cols index until free col is found
+ while (typeof map[ridx][c] != "undefined") { c++; }
+
+ cspan = api.getAttribute(cell, 'colspan');
+ rspan = api.getAttribute(cell, 'rowspan');
+
+ if (cspan || rspan) {
+ this.addSpannedCellToMap(cell, map, ridx, c, cspan, rspan);
+ c = c + ((cspan) ? parseInt(cspan, 10) : 1);
+ } else {
+ map[ridx][c] = new MapCell(cell);
+ c++;
+ }
+ }
+ }
+ this.map = map;
+ return map;
+ },
+
+ getRowCells: function(row) {
+ var inlineTables = this.table.querySelectorAll('table'),
+ inlineCells = (inlineTables) ? queryInList(inlineTables, 'th, td') : [],
+ allCells = row.querySelectorAll('th, td'),
+ tableCells = (inlineCells.length > 0) ? wysihtml5.lang.array(allCells).without(inlineCells) : allCells;
+
+ return tableCells;
+ },
+
+ getTableRows: function() {
+ var inlineTables = this.table.querySelectorAll('table'),
+ inlineRows = (inlineTables) ? queryInList(inlineTables, 'tr') : [],
+ allRows = this.table.querySelectorAll('tr'),
+ tableRows = (inlineRows.length > 0) ? wysihtml5.lang.array(allRows).without(inlineRows) : allRows;
+
+ return tableRows;
+ },
+
+ getMapIndex: function(cell) {
+ var r_length = this.map.length,
+ c_length = (this.map && this.map[0]) ? this.map[0].length : 0;
+
+ for (var r_idx = 0;r_idx < r_length; r_idx++) {
+ for (var c_idx = 0;c_idx < c_length; c_idx++) {
+ if (this.map[r_idx][c_idx].el === cell) {
+ return {'row': r_idx, 'col': c_idx};
+ }
+ }
+ }
+ return false;
+ },
+
+ getElementAtIndex: function(idx) {
+ this.setTableMap();
+ if (this.map[idx.row] && this.map[idx.row][idx.col] && this.map[idx.row][idx.col].el) {
+ return this.map[idx.row][idx.col].el;
+ }
+ return null;
+ },
+
+ getMapElsTo: function(to_cell) {
+ var els = [];
+ this.setTableMap();
+ this.idx_start = this.getMapIndex(this.cell);
+ this.idx_end = this.getMapIndex(to_cell);
+
+ // switch indexes if start is bigger than end
+ if (this.idx_start.row > this.idx_end.row || (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) {
+ var temp_idx = this.idx_start;
+ this.idx_start = this.idx_end;
+ this.idx_end = temp_idx;
+ }
+ if (this.idx_start.col > this.idx_end.col) {
+ var temp_cidx = this.idx_start.col;
+ this.idx_start.col = this.idx_end.col;
+ this.idx_end.col = temp_cidx;
+ }
+
+ if (this.idx_start != null && this.idx_end != null) {
+ for (var row = this.idx_start.row, maxr = this.idx_end.row; row <= maxr; row++) {
+ for (var col = this.idx_start.col, maxc = this.idx_end.col; col <= maxc; col++) {
+ els.push(this.map[row][col].el);
+ }
+ }
+ }
+ return els;
+ },
+
+ orderSelectionEnds: function(secondcell) {
+ this.setTableMap();
+ this.idx_start = this.getMapIndex(this.cell);
+ this.idx_end = this.getMapIndex(secondcell);
+
+ // switch indexes if start is bigger than end
+ if (this.idx_start.row > this.idx_end.row || (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) {
+ var temp_idx = this.idx_start;
+ this.idx_start = this.idx_end;
+ this.idx_end = temp_idx;
+ }
+ if (this.idx_start.col > this.idx_end.col) {
+ var temp_cidx = this.idx_start.col;
+ this.idx_start.col = this.idx_end.col;
+ this.idx_end.col = temp_cidx;
+ }
+
+ return {
+ "start": this.map[this.idx_start.row][this.idx_start.col].el,
+ "end": this.map[this.idx_end.row][this.idx_end.col].el
+ };
+ },
+
+ createCells: function(tag, nr, attrs) {
+ var doc = this.table.ownerDocument,
+ frag = doc.createDocumentFragment(),
+ cell;
+ for (var i = 0; i < nr; i++) {
+ cell = doc.createElement(tag);
+
+ if (attrs) {
+ for (var attr in attrs) {
+ if (attrs.hasOwnProperty(attr)) {
+ cell.setAttribute(attr, attrs[attr]);
+ }
+ }
+ }
+
+ // add non breaking space
+ cell.appendChild(document.createTextNode("\u00a0"));
+
+ frag.appendChild(cell);
+ }
+ return frag;
+ },
+
+ // Returns next real cell (not part of spanned cell unless first) on row if selected index is not real. I no real cells -1 will be returned
+ correctColIndexForUnreals: function(col, row) {
+ var r = this.map[row],
+ corrIdx = -1;
+ for (var i = 0, max = col; i < col; i++) {
+ if (r[i].isReal){
+ corrIdx++;
+ }
+ }
+ return corrIdx;
+ },
+
+ getLastNewCellOnRow: function(row, rowLimit) {
+ var cells = this.getRowCells(row),
+ cell, idx;
+
+ for (var cidx = 0, cmax = cells.length; cidx < cmax; cidx++) {
+ cell = cells[cidx];
+ idx = this.getMapIndex(cell);
+ if (idx === false || (typeof rowLimit != "undefined" && idx.row != rowLimit)) {
+ return cell;
+ }
+ }
+ return null;
+ },
+
+ removeEmptyTable: function() {
+ var cells = this.table.querySelectorAll('td, th');
+ if (!cells || cells.length == 0) {
+ removeElement(this.table);
+ return true;
+ } else {
+ return false;
+ }
+ },
+
+ // Splits merged cell on row to unique cells
+ splitRowToCells: function(cell) {
+ if (cell.isColspan) {
+ var colspan = parseInt(api.getAttribute(cell.el, 'colspan') || 1, 10),
+ cType = cell.el.tagName.toLowerCase();
+ if (colspan > 1) {
+ var newCells = this.createCells(cType, colspan -1);
+ insertAfter(cell.el, newCells);
+ }
+ cell.el.removeAttribute('colspan');
+ }
+ },
+
+ getRealRowEl: function(force, idx) {
+ var r = null,
+ c = null;
+
+ idx = idx || this.idx;
+
+ for (var cidx = 0, cmax = this.map[idx.row].length; cidx < cmax; cidx++) {
+ c = this.map[idx.row][cidx];
+ if (c.isReal) {
+ r = api.getParentElement(c.el, { nodeName: ["TR"] });
+ if (r) {
+ return r;
+ }
+ }
+ }
+
+ if (r === null && force) {
+ r = api.getParentElement(this.map[idx.row][idx.col].el, { nodeName: ["TR"] }) || null;
+ }
+
+ return r;
+ },
+
+ injectRowAt: function(row, col, colspan, cType, c) {
+ var r = this.getRealRowEl(false, {'row': row, 'col': col}),
+ new_cells = this.createCells(cType, colspan);
+
+ if (r) {
+ var n_cidx = this.correctColIndexForUnreals(col, row);
+ if (n_cidx >= 0) {
+ insertAfter(this.getRowCells(r)[n_cidx], new_cells);
+ } else {
+ r.insertBefore(new_cells, r.firstChild);
+ }
+ } else {
+ var rr = this.table.ownerDocument.createElement('tr');
+ rr.appendChild(new_cells);
+ insertAfter(api.getParentElement(c.el, { nodeName: ["TR"] }), rr);
+ }
+ },
+
+ canMerge: function(to) {
+ this.to = to;
+ this.setTableMap();
+ this.idx_start = this.getMapIndex(this.cell);
+ this.idx_end = this.getMapIndex(this.to);
+
+ // switch indexes if start is bigger than end
+ if (this.idx_start.row > this.idx_end.row || (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) {
+ var temp_idx = this.idx_start;
+ this.idx_start = this.idx_end;
+ this.idx_end = temp_idx;
+ }
+ if (this.idx_start.col > this.idx_end.col) {
+ var temp_cidx = this.idx_start.col;
+ this.idx_start.col = this.idx_end.col;
+ this.idx_end.col = temp_cidx;
+ }
+
+ for (var row = this.idx_start.row, maxr = this.idx_end.row; row <= maxr; row++) {
+ for (var col = this.idx_start.col, maxc = this.idx_end.col; col <= maxc; col++) {
+ if (this.map[row][col].isColspan || this.map[row][col].isRowspan) {
+ return false;
+ }
+ }
+ }
+ return true;
+ },
+
+ decreaseCellSpan: function(cell, span) {
+ var nr = parseInt(api.getAttribute(cell.el, span), 10) - 1;
+ if (nr >= 1) {
+ cell.el.setAttribute(span, nr);
+ } else {
+ cell.el.removeAttribute(span);
+ if (span == 'colspan') {
+ cell.isColspan = false;
+ }
+ if (span == 'rowspan') {
+ cell.isRowspan = false;
+ }
+ cell.firstCol = true;
+ cell.lastCol = true;
+ cell.firstRow = true;
+ cell.lastRow = true;
+ cell.isReal = true;
+ }
+ },
+
+ removeSurplusLines: function() {
+ var row, cell, ridx, rmax, cidx, cmax, allRowspan;
+
+ this.setTableMap();
+ if (this.map) {
+ ridx = 0;
+ rmax = this.map.length;
+ for (;ridx < rmax; ridx++) {
+ row = this.map[ridx];
+ allRowspan = true;
+ cidx = 0;
+ cmax = row.length;
+ for (; cidx < cmax; cidx++) {
+ cell = row[cidx];
+ if (!(api.getAttribute(cell.el, "rowspan") && parseInt(api.getAttribute(cell.el, "rowspan"), 10) > 1 && cell.firstRow !== true)) {
+ allRowspan = false;
+ break;
+ }
+ }
+ if (allRowspan) {
+ cidx = 0;
+ for (; cidx < cmax; cidx++) {
+ this.decreaseCellSpan(row[cidx], 'rowspan');
+ }
+ }
+ }
+
+ // remove rows without cells
+ var tableRows = this.getTableRows();
+ ridx = 0;
+ rmax = tableRows.length;
+ for (;ridx < rmax; ridx++) {
+ row = tableRows[ridx];
+ if (row.childNodes.length == 0 && (/^\s*$/.test(row.textContent || row.innerText))) {
+ removeElement(row);
+ }
+ }
+ }
+ },
+
+ fillMissingCells: function() {
+ var r_max = 0,
+ c_max = 0,
+ prevcell = null;
+
+ this.setTableMap();
+ if (this.map) {
+
+ // find maximal dimensions of broken table
+ r_max = this.map.length;
+ for (var ridx = 0; ridx < r_max; ridx++) {
+ if (this.map[ridx].length > c_max) { c_max = this.map[ridx].length; }
+ }
+
+ for (var row = 0; row < r_max; row++) {
+ for (var col = 0; col < c_max; col++) {
+ if (this.map[row] && !this.map[row][col]) {
+ if (col > 0) {
+ this.map[row][col] = new MapCell(this.createCells('td', 1));
+ prevcell = this.map[row][col-1];
+ if (prevcell && prevcell.el && prevcell.el.parent) { // if parent does not exist element is removed from dom
+ insertAfter(this.map[row][col-1].el, this.map[row][col].el);
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+
+ rectify: function() {
+ if (!this.removeEmptyTable()) {
+ this.removeSurplusLines();
+ this.fillMissingCells();
+ return true;
+ } else {
+ return false;
+ }
+ },
+
+ unmerge: function() {
+ if (this.rectify()) {
+ this.setTableMap();
+ this.idx = this.getMapIndex(this.cell);
+
+ if (this.idx) {
+ var thisCell = this.map[this.idx.row][this.idx.col],
+ colspan = (api.getAttribute(thisCell.el, "colspan")) ? parseInt(api.getAttribute(thisCell.el, "colspan"), 10) : 1,
+ cType = thisCell.el.tagName.toLowerCase();
+
+ if (thisCell.isRowspan) {
+ var rowspan = parseInt(api.getAttribute(thisCell.el, "rowspan"), 10);
+ if (rowspan > 1) {
+ for (var nr = 1, maxr = rowspan - 1; nr <= maxr; nr++){
+ this.injectRowAt(this.idx.row + nr, this.idx.col, colspan, cType, thisCell);
+ }
+ }
+ thisCell.el.removeAttribute('rowspan');
+ }
+ this.splitRowToCells(thisCell);
+ }
+ }
+ },
+
+ // merges cells from start cell (defined in creating obj) to "to" cell
+ merge: function(to) {
+ if (this.rectify()) {
+ if (this.canMerge(to)) {
+ var rowspan = this.idx_end.row - this.idx_start.row + 1,
+ colspan = this.idx_end.col - this.idx_start.col + 1;
+
+ for (var row = this.idx_start.row, maxr = this.idx_end.row; row <= maxr; row++) {
+ for (var col = this.idx_start.col, maxc = this.idx_end.col; col <= maxc; col++) {
+
+ if (row == this.idx_start.row && col == this.idx_start.col) {
+ if (rowspan > 1) {
+ this.map[row][col].el.setAttribute('rowspan', rowspan);
+ }
+ if (colspan > 1) {
+ this.map[row][col].el.setAttribute('colspan', colspan);
+ }
+ } else {
+ // transfer content
+ if (!(/^\s*<br\/?>\s*$/.test(this.map[row][col].el.innerHTML.toLowerCase()))) {
+ this.map[this.idx_start.row][this.idx_start.col].el.innerHTML += ' ' + this.map[row][col].el.innerHTML;
+ }
+ removeElement(this.map[row][col].el);
+ }
+ }
+ }
+ this.rectify();
+ } else {
+ if (window.console) {
+ console.log('Do not know how to merge allready merged cells.');
+ }
+ }
+ }
+ },
+
+ // Decreases rowspan of a cell if it is done on first cell of rowspan row (real cell)
+ // Cell is moved to next row (if it is real)
+ collapseCellToNextRow: function(cell) {
+ var cellIdx = this.getMapIndex(cell.el),
+ newRowIdx = cellIdx.row + 1,
+ newIdx = {'row': newRowIdx, 'col': cellIdx.col};
+
+ if (newRowIdx < this.map.length) {
+
+ var row = this.getRealRowEl(false, newIdx);
+ if (row !== null) {
+ var n_cidx = this.correctColIndexForUnreals(newIdx.col, newIdx.row);
+ if (n_cidx >= 0) {
+ insertAfter(this.getRowCells(row)[n_cidx], cell.el);
+ } else {
+ var lastCell = this.getLastNewCellOnRow(row, newRowIdx);
+ if (lastCell !== null) {
+ insertAfter(lastCell, cell.el);
+ } else {
+ row.insertBefore(cell.el, row.firstChild);
+ }
+ }
+ if (parseInt(api.getAttribute(cell.el, 'rowspan'), 10) > 2) {
+ cell.el.setAttribute('rowspan', parseInt(api.getAttribute(cell.el, 'rowspan'), 10) - 1);
+ } else {
+ cell.el.removeAttribute('rowspan');
+ }
+ }
+ }
+ },
+
+ // Removes a cell when removing a row
+ // If is rowspan cell then decreases the rowspan
+ // and moves cell to next row if needed (is first cell of rowspan)
+ removeRowCell: function(cell) {
+ if (cell.isReal) {
+ if (cell.isRowspan) {
+ this.collapseCellToNextRow(cell);
+ } else {
+ removeElement(cell.el);
+ }
+ } else {
+ if (parseInt(api.getAttribute(cell.el, 'rowspan'), 10) > 2) {
+ cell.el.setAttribute('rowspan', parseInt(api.getAttribute(cell.el, 'rowspan'), 10) - 1);
+ } else {
+ cell.el.removeAttribute('rowspan');
+ }
+ }
+ },
+
+ getRowElementsByCell: function() {
+ var cells = [];
+ this.setTableMap();
+ this.idx = this.getMapIndex(this.cell);
+ if (this.idx !== false) {
+ var modRow = this.map[this.idx.row];
+ for (var cidx = 0, cmax = modRow.length; cidx < cmax; cidx++) {
+ if (modRow[cidx].isReal) {
+ cells.push(modRow[cidx].el);
+ }
+ }
+ }
+ return cells;
+ },
+
+ getColumnElementsByCell: function() {
+ var cells = [];
+ this.setTableMap();
+ this.idx = this.getMapIndex(this.cell);
+ if (this.idx !== false) {
+ for (var ridx = 0, rmax = this.map.length; ridx < rmax; ridx++) {
+ if (this.map[ridx][this.idx.col] && this.map[ridx][this.idx.col].isReal) {
+ cells.push(this.map[ridx][this.idx.col].el);
+ }
+ }
+ }
+ return cells;
+ },
+
+ // Removes the row of selected cell
+ removeRow: function() {
+ var oldRow = api.getParentElement(this.cell, { nodeName: ["TR"] });
+ if (oldRow) {
+ this.setTableMap();
+ this.idx = this.getMapIndex(this.cell);
+ if (this.idx !== false) {
+ var modRow = this.map[this.idx.row];
+ for (var cidx = 0, cmax = modRow.length; cidx < cmax; cidx++) {
+ if (!modRow[cidx].modified) {
+ this.setCellAsModified(modRow[cidx]);
+ this.removeRowCell(modRow[cidx]);
+ }
+ }
+ }
+ removeElement(oldRow);
+ }
+ },
+
+ removeColCell: function(cell) {
+ if (cell.isColspan) {
+ if (parseInt(api.getAttribute(cell.el, 'colspan'), 10) > 2) {
+ cell.el.setAttribute('colspan', parseInt(api.getAttribute(cell.el, 'colspan'), 10) - 1);
+ } else {
+ cell.el.removeAttribute('colspan');
+ }
+ } else if (cell.isReal) {
+ removeElement(cell.el);
+ }
+ },
+
+ removeColumn: function() {
+ this.setTableMap();
+ this.idx = this.getMapIndex(this.cell);
+ if (this.idx !== false) {
+ for (var ridx = 0, rmax = this.map.length; ridx < rmax; ridx++) {
+ if (!this.map[ridx][this.idx.col].modified) {
+ this.setCellAsModified(this.map[ridx][this.idx.col]);
+ this.removeColCell(this.map[ridx][this.idx.col]);
+ }
+ }
+ }
+ },
+
+ // removes row or column by selected cell element
+ remove: function(what) {
+ if (this.rectify()) {
+ switch (what) {
+ case 'row':
+ this.removeRow();
+ break;
+ case 'column':
+ this.removeColumn();
+ break;
+ }
+ this.rectify();
+ }
+ },
+
+ addRow: function(where) {
+ var doc = this.table.ownerDocument;
+
+ this.setTableMap();
+ this.idx = this.getMapIndex(this.cell);
+ if (where == "below" && api.getAttribute(this.cell, 'rowspan')) {
+ this.idx.row = this.idx.row + parseInt(api.getAttribute(this.cell, 'rowspan'), 10) - 1;
+ }
+
+ if (this.idx !== false) {
+ var modRow = this.map[this.idx.row],
+ newRow = doc.createElement('tr');
+
+ for (var ridx = 0, rmax = modRow.length; ridx < rmax; ridx++) {
+ if (!modRow[ridx].modified) {
+ this.setCellAsModified(modRow[ridx]);
+ this.addRowCell(modRow[ridx], newRow, where);
+ }
+ }
+
+ switch (where) {
+ case 'below':
+ insertAfter(this.getRealRowEl(true), newRow);
+ break;
+ case 'above':
+ var cr = api.getParentElement(this.map[this.idx.row][this.idx.col].el, { nodeName: ["TR"] });
+ if (cr) {
+ cr.parentNode.insertBefore(newRow, cr);
+ }
+ break;
+ }
+ }
+ },
+
+ addRowCell: function(cell, row, where) {
+ var colSpanAttr = (cell.isColspan) ? {"colspan" : api.getAttribute(cell.el, 'colspan')} : null;
+ if (cell.isReal) {
+ if (where != 'above' && cell.isRowspan) {
+ cell.el.setAttribute('rowspan', parseInt(api.getAttribute(cell.el,'rowspan'), 10) + 1);
+ } else {
+ row.appendChild(this.createCells('td', 1, colSpanAttr));
+ }
+ } else {
+ if (where != 'above' && cell.isRowspan && cell.lastRow) {
+ row.appendChild(this.createCells('td', 1, colSpanAttr));
+ } else if (c.isRowspan) {
+ cell.el.attr('rowspan', parseInt(api.getAttribute(cell.el, 'rowspan'), 10) + 1);
+ }
+ }
+ },
+
+ add: function(where) {
+ if (this.rectify()) {
+ if (where == 'below' || where == 'above') {
+ this.addRow(where);
+ }
+ if (where == 'before' || where == 'after') {
+ this.addColumn(where);
+ }
+ }
+ },
+
+ addColCell: function (cell, ridx, where) {
+ var doAdd,
+ cType = cell.el.tagName.toLowerCase();
+
+ // defines add cell vs expand cell conditions
+ // true means add
+ switch (where) {
+ case "before":
+ doAdd = (!cell.isColspan || cell.firstCol);
+ break;
+ case "after":
+ doAdd = (!cell.isColspan || cell.lastCol || (cell.isColspan && c.el == this.cell));
+ break;
+ }
+
+ if (doAdd){
+ // adds a cell before or after current cell element
+ switch (where) {
+ case "before":
+ cell.el.parentNode.insertBefore(this.createCells(cType, 1), cell.el);
+ break;
+ case "after":
+ insertAfter(cell.el, this.createCells(cType, 1));
+ break;
+ }
+
+ // handles if cell has rowspan
+ if (cell.isRowspan) {
+ this.handleCellAddWithRowspan(cell, ridx+1, where);
+ }
+
+ } else {
+ // expands cell
+ cell.el.setAttribute('colspan', parseInt(api.getAttribute(cell.el, 'colspan'), 10) + 1);
+ }
+ },
+
+ addColumn: function(where) {
+ var row, modCell;
+
+ this.setTableMap();
+ this.idx = this.getMapIndex(this.cell);
+ if (where == "after" && api.getAttribute(this.cell, 'colspan')) {
+ this.idx.col = this.idx.col + parseInt(api.getAttribute(this.cell, 'colspan'), 10) - 1;
+ }
+
+ if (this.idx !== false) {
+ for (var ridx = 0, rmax = this.map.length; ridx < rmax; ridx++ ) {
+ row = this.map[ridx];
+ if (row[this.idx.col]) {
+ modCell = row[this.idx.col];
+ if (!modCell.modified) {
+ this.setCellAsModified(modCell);
+ this.addColCell(modCell, ridx , where);
+ }
+ }
+ }
+ }
+ },
+
+ handleCellAddWithRowspan: function (cell, ridx, where) {
+ var addRowsNr = parseInt(api.getAttribute(this.cell, 'rowspan'), 10) - 1,
+ crow = api.getParentElement(cell.el, { nodeName: ["TR"] }),
+ cType = cell.el.tagName.toLowerCase(),
+ cidx, temp_r_cells,
+ doc = this.table.ownerDocument,
+ nrow;
+
+ for (var i = 0; i < addRowsNr; i++) {
+ cidx = this.correctColIndexForUnreals(this.idx.col, (ridx + i));
+ crow = nextNode(crow, 'tr');
+ if (crow) {
+ if (cidx > 0) {
+ switch (where) {
+ case "before":
+ temp_r_cells = this.getRowCells(crow);
+ if (cidx > 0 && this.map[ridx + i][this.idx.col].el != temp_r_cells[cidx] && cidx == temp_r_cells.length - 1) {
+ insertAfter(temp_r_cells[cidx], this.createCells(cType, 1));
+ } else {
+ temp_r_cells[cidx].parentNode.insertBefore(this.createCells(cType, 1), temp_r_cells[cidx]);
+ }
+
+ break;
+ case "after":
+ insertAfter(this.getRowCells(crow)[cidx], this.createCells(cType, 1));
+ break;
+ }
+ } else {
+ crow.insertBefore(this.createCells(cType, 1), crow.firstChild);
+ }
+ } else {
+ nrow = doc.createElement('tr');
+ nrow.appendChild(this.createCells(cType, 1));
+ this.table.appendChild(nrow);
+ }
+ }
+ }
+ };
+
+ api.table = {
+ getCellsBetween: function(cell1, cell2) {
+ var c1 = new TableModifyerByCell(cell1);
+ return c1.getMapElsTo(cell2);
+ },
+
+ addCells: function(cell, where) {
+ var c = new TableModifyerByCell(cell);
+ c.add(where);
+ },
+
+ removeCells: function(cell, what) {
+ var c = new TableModifyerByCell(cell);
+ c.remove(what);
+ },
+
+ mergeCellsBetween: function(cell1, cell2) {
+ var c1 = new TableModifyerByCell(cell1);
+ c1.merge(cell2);
+ },
+
+ unmergeCell: function(cell) {
+ var c = new TableModifyerByCell(cell);
+ c.unmerge();
+ },
+
+ orderSelectionEnds: function(cell, cell2) {
+ var c = new TableModifyerByCell(cell);
+ return c.orderSelectionEnds(cell2);
+ },
+
+ indexOf: function(cell) {
+ var c = new TableModifyerByCell(cell);
+ c.setTableMap();
+ return c.getMapIndex(cell);
+ },
+
+ findCell: function(table, idx) {
+ var c = new TableModifyerByCell(null, table);
+ return c.getElementAtIndex(idx);
+ },
+
+ findRowByCell: function(cell) {
+ var c = new TableModifyerByCell(cell);
+ return c.getRowElementsByCell();
+ },
+
+ findColumnByCell: function(cell) {
+ var c = new TableModifyerByCell(cell);
+ return c.getColumnElementsByCell();
+ },
+
+ canMerge: function(cell1, cell2) {
+ var c = new TableModifyerByCell(cell1);
+ return c.canMerge(cell2);
+ }
+ };
+
+
+
+})(wysihtml5);
+;// does a selector query on element or array of elements
+
+wysihtml5.dom.query = function(elements, query) {
+ var ret = [],
+ q;
+
+ if (elements.nodeType) {
+ elements = [elements];
+ }
+
+ for (var e = 0, len = elements.length; e < len; e++) {
+ q = elements[e].querySelectorAll(query);
+ if (q) {
+ for(var i = q.length; i--; ret.unshift(q[i]));
+ }
+ }
+ return ret;
+};
+;wysihtml5.dom.compareDocumentPosition = (function() {
+ var documentElement = document.documentElement;
+ if (documentElement.compareDocumentPosition) {
+ return function(container, element) {
+ return container.compareDocumentPosition(element);
+ };
+ } else {
+ return function( container, element ) {
+ // implementation borrowed from https://github.com/tmpvar/jsdom/blob/681a8524b663281a0f58348c6129c8c184efc62c/lib/jsdom/level3/core.js // MIT license
+ var thisOwner, otherOwner;
+
+ if( container.nodeType === 9) // Node.DOCUMENT_NODE
+ thisOwner = container;
+ else
+ thisOwner = container.ownerDocument;
+
+ if( element.nodeType === 9) // Node.DOCUMENT_NODE
+ otherOwner = element;
+ else
+ otherOwner = element.ownerDocument;
+
+ if( container === element ) return 0;
+ if( container === element.ownerDocument ) return 4 + 16; //Node.DOCUMENT_POSITION_FOLLOWING + Node.DOCUMENT_POSITION_CONTAINED_BY;
+ if( container.ownerDocument === element ) return 2 + 8; //Node.DOCUMENT_POSITION_PRECEDING + Node.DOCUMENT_POSITION_CONTAINS;
+ if( thisOwner !== otherOwner ) return 1; // Node.DOCUMENT_POSITION_DISCONNECTED;
+
+ // Text nodes for attributes does not have a _parentNode. So we need to find them as attribute child.
+ if( container.nodeType === 2 /*Node.ATTRIBUTE_NODE*/ && container.childNodes && wysihtml5.lang.array(container.childNodes).indexOf( element ) !== -1)
+ return 4 + 16; //Node.DOCUMENT_POSITION_FOLLOWING + Node.DOCUMENT_POSITION_CONTAINED_BY;
+
+ if( element.nodeType === 2 /*Node.ATTRIBUTE_NODE*/ && element.childNodes && wysihtml5.lang.array(element.childNodes).indexOf( container ) !== -1)
+ return 2 + 8; //Node.DOCUMENT_POSITION_PRECEDING + Node.DOCUMENT_POSITION_CONTAINS;
+
+ var point = container;
+ var parents = [ ];
+ var previous = null;
+ while( point ) {
+ if( point == element ) return 2 + 8; //Node.DOCUMENT_POSITION_PRECEDING + Node.DOCUMENT_POSITION_CONTAINS;
+ parents.push( point );
+ point = point.parentNode;
+ }
+ point = element;
+ previous = null;
+ while( point ) {
+ if( point == container ) return 4 + 16; //Node.DOCUMENT_POSITION_FOLLOWING + Node.DOCUMENT_POSITION_CONTAINED_BY;
+ var location_index = wysihtml5.lang.array(parents).indexOf( point );
+ if( location_index !== -1) {
+ var smallest_common_ancestor = parents[ location_index ];
+ var this_index = wysihtml5.lang.array(smallest_common_ancestor.childNodes).indexOf( parents[location_index - 1]);//smallest_common_ancestor.childNodes.toArray().indexOf( parents[location_index - 1] );
+ var other_index = wysihtml5.lang.array(smallest_common_ancestor.childNodes).indexOf( previous ); //smallest_common_ancestor.childNodes.toArray().indexOf( previous );
+ if( this_index > other_index ) {
+ return 2; //Node.DOCUMENT_POSITION_PRECEDING;
+ }
+ else {
+ return 4; //Node.DOCUMENT_POSITION_FOLLOWING;
+ }
+ }
+ previous = point;
+ point = point.parentNode;
+ }
+ return 1; //Node.DOCUMENT_POSITION_DISCONNECTED;
+ };
+ }
+})();
+;wysihtml5.dom.unwrap = function(node) {
+ if (node.parentNode) {
+ while (node.lastChild) {
+ wysihtml5.dom.insert(node.lastChild).after(node);
+ }
+ node.parentNode.removeChild(node);
+ }
+};;/*
+ * Methods for fetching pasted html before it gets inserted into content
+**/
+
+/* Modern event.clipboardData driven approach.
+ * Advantage is that it does not have to loose selection or modify dom to catch the data.
+ * IE does not support though.
+**/
+wysihtml5.dom.getPastedHtml = function(event) {
+ var html;
+ if (event.clipboardData) {
+ if (wysihtml5.lang.array(event.clipboardData.types).contains('text/html')) {
+ html = event.clipboardData.getData('text/html');
+ } else if (wysihtml5.lang.array(event.clipboardData.types).contains('text/plain')) {
+ html = wysihtml5.lang.string(event.clipboardData.getData('text/plain')).escapeHTML(true, true);
+ }
+ }
+ return html;
+};
+
+/* Older temprorary contenteditable as paste source catcher method for fallbacks */
+wysihtml5.dom.getPastedHtmlWithDiv = function (composer, f) {
+ var selBookmark = composer.selection.getBookmark(),
+ doc = composer.element.ownerDocument,
+ cleanerDiv = doc.createElement('DIV');
+
+ doc.body.appendChild(cleanerDiv);
+
+ cleanerDiv.style.width = "1px";
+ cleanerDiv.style.height = "1px";
+ cleanerDiv.style.overflow = "hidden";
+
+ cleanerDiv.setAttribute('contenteditable', 'true');
+ cleanerDiv.focus();
+
+ setTimeout(function () {
+ composer.selection.setBookmark(selBookmark);
+ f(cleanerDiv.innerHTML);
+ cleanerDiv.parentNode.removeChild(cleanerDiv);
+ }, 0);
+};;/**
+ * Fix most common html formatting misbehaviors of browsers implementation when inserting
+ * content via copy & paste contentEditable
+ *
+ * @author Christopher Blum
+ */
+wysihtml5.quirks.cleanPastedHTML = (function() {
+
+ var styleToRegex = function (styleStr) {
+ var trimmedStr = wysihtml5.lang.string(styleStr).trim(),
+ escapedStr = trimmedStr.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
+
+ return new RegExp("^((?!^" + escapedStr + "$).)*$", "i");
+ };
+
+ var extendRulesWithStyleExceptions = function (rules, exceptStyles) {
+ var newRules = wysihtml5.lang.object(rules).clone(true),
+ tag, style;
+
+ for (tag in newRules.tags) {
+
+ if (newRules.tags.hasOwnProperty(tag)) {
+ if (newRules.tags[tag].keep_styles) {
+ for (style in newRules.tags[tag].keep_styles) {
+ if (newRules.tags[tag].keep_styles.hasOwnProperty(style)) {
+ if (exceptStyles[style]) {
+ newRules.tags[tag].keep_styles[style] = styleToRegex(exceptStyles[style]);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return newRules;
+ };
+
+ var pickRuleset = function(ruleset, html) {
+ var pickedSet, defaultSet;
+
+ if (!ruleset) {
+ return null;
+ }
+
+ for (var i = 0, max = ruleset.length; i < max; i++) {
+ if (!ruleset[i].condition) {
+ defaultSet = ruleset[i].set;
+ }
+ if (ruleset[i].condition && ruleset[i].condition.test(html)) {
+ return ruleset[i].set;
+ }
+ }
+
+ return defaultSet;
+ };
+
+ return function(html, options) {
+ var exceptStyles = {
+ 'color': wysihtml5.dom.getStyle("color").from(options.referenceNode),
+ 'fontSize': wysihtml5.dom.getStyle("font-size").from(options.referenceNode)
+ },
+ rules = extendRulesWithStyleExceptions(pickRuleset(options.rules, html) || {}, exceptStyles),
+ newHtml;
+
+ newHtml = wysihtml5.dom.parse(html, {
+ "rules": rules,
+ "cleanUp": true, // <span> elements, empty or without attributes, should be removed/replaced with their content
+ "context": options.referenceNode.ownerDocument,
+ "uneditableClass": options.uneditableClass,
+ "clearInternals" : true, // don't paste temprorary selection and other markings
+ "unjoinNbsps" : true
+ });
+
+ return newHtml;
+ };
+
+})();;/**
+ * IE and Opera leave an empty paragraph in the contentEditable element after clearing it
+ *
+ * @param {Object} contentEditableElement The contentEditable element to observe for clearing events
+ * @exaple
+ * wysihtml5.quirks.ensureProperClearing(myContentEditableElement);
+ */
+wysihtml5.quirks.ensureProperClearing = (function() {
+ var clearIfNecessary = function() {
+ var element = this;
+ setTimeout(function() {
+ var innerHTML = element.innerHTML.toLowerCase();
+ if (innerHTML == "<p>&nbsp;</p>" ||
+ innerHTML == "<p>&nbsp;</p><p>&nbsp;</p>") {
+ element.innerHTML = "";
+ }
+ }, 0);
+ };
+
+ return function(composer) {
+ wysihtml5.dom.observe(composer.element, ["cut", "keydown"], clearIfNecessary);
+ };
+})();
+;// See https://bugzilla.mozilla.org/show_bug.cgi?id=664398
+//
+// In Firefox this:
+// var d = document.createElement("div");
+// d.innerHTML ='<a href="~"></a>';
+// d.innerHTML;
+// will result in:
+// <a href="%7E"></a>
+// which is wrong
+(function(wysihtml5) {
+ var TILDE_ESCAPED = "%7E";
+ wysihtml5.quirks.getCorrectInnerHTML = function(element) {
+ var innerHTML = element.innerHTML;
+ if (innerHTML.indexOf(TILDE_ESCAPED) === -1) {
+ return innerHTML;
+ }
+
+ var elementsWithTilde = element.querySelectorAll("[href*='~'], [src*='~']"),
+ url,
+ urlToSearch,
+ length,
+ i;
+ for (i=0, length=elementsWithTilde.length; i<length; i++) {
+ url = elementsWithTilde[i].href || elementsWithTilde[i].src;
+ urlToSearch = wysihtml5.lang.string(url).replace("~").by(TILDE_ESCAPED);
+ innerHTML = wysihtml5.lang.string(innerHTML).replace(urlToSearch).by(url);
+ }
+ return innerHTML;
+ };
+})(wysihtml5);
+;/**
+ * Force rerendering of a given element
+ * Needed to fix display misbehaviors of IE
+ *
+ * @param {Element} element The element object which needs to be rerendered
+ * @example
+ * wysihtml5.quirks.redraw(document.body);
+ */
+(function(wysihtml5) {
+ var CLASS_NAME = "wysihtml5-quirks-redraw";
+
+ wysihtml5.quirks.redraw = function(element) {
+ wysihtml5.dom.addClass(element, CLASS_NAME);
+ wysihtml5.dom.removeClass(element, CLASS_NAME);
+
+ // Following hack is needed for firefox to make sure that image resize handles are properly removed
+ try {
+ var doc = element.ownerDocument;
+ doc.execCommand("italic", false, null);
+ doc.execCommand("italic", false, null);
+ } catch(e) {}
+ };
+})(wysihtml5);
+;wysihtml5.quirks.tableCellsSelection = function(editable, editor) {
+
+ var dom = wysihtml5.dom,
+ select = {
+ table: null,
+ start: null,
+ end: null,
+ cells: null,
+ select: selectCells
+ },
+ selection_class = "wysiwyg-tmp-selected-cell",
+ moveHandler = null,
+ upHandler = null;
+
+ function init () {
+
+ dom.observe(editable, "mousedown", function(event) {
+ var target = wysihtml5.dom.getParentElement(event.target, { nodeName: ["TD", "TH"] });
+ if (target) {
+ handleSelectionMousedown(target);
+ }
+ });
+
+ return select;
+ }
+
+ function handleSelectionMousedown (target) {
+ select.start = target;
+ select.end = target;
+ select.cells = [target];
+ select.table = dom.getParentElement(select.start, { nodeName: ["TABLE"] });
+
+ if (select.table) {
+ removeCellSelections();
+ dom.addClass(target, selection_class);
+ moveHandler = dom.observe(editable, "mousemove", handleMouseMove);
+ upHandler = dom.observe(editable, "mouseup", handleMouseUp);
+ editor.fire("tableselectstart").fire("tableselectstart:composer");
+ }
+ }
+
+ // remove all selection classes
+ function removeCellSelections () {
+ if (editable) {
+ var selectedCells = editable.querySelectorAll('.' + selection_class);
+ if (selectedCells.length > 0) {
+ for (var i = 0; i < selectedCells.length; i++) {
+ dom.removeClass(selectedCells[i], selection_class);
+ }
+ }
+ }
+ }
+
+ function addSelections (cells) {
+ for (var i = 0; i < cells.length; i++) {
+ dom.addClass(cells[i], selection_class);
+ }
+ }
+
+ function handleMouseMove (event) {
+ var curTable = null,
+ cell = dom.getParentElement(event.target, { nodeName: ["TD","TH"] }),
+ oldEnd;
+
+ if (cell && select.table && select.start) {
+ curTable = dom.getParentElement(cell, { nodeName: ["TABLE"] });
+ if (curTable && curTable === select.table) {
+ removeCellSelections();
+ oldEnd = select.end;
+ select.end = cell;
+ select.cells = dom.table.getCellsBetween(select.start, cell);
+ if (select.cells.length > 1) {
+ editor.composer.selection.deselect();
+ }
+ addSelections(select.cells);
+ if (select.end !== oldEnd) {
+ editor.fire("tableselectchange").fire("tableselectchange:composer");
+ }
+ }
+ }
+ }
+
+ function handleMouseUp (event) {
+ moveHandler.stop();
+ upHandler.stop();
+ editor.fire("tableselect").fire("tableselect:composer");
+ setTimeout(function() {
+ bindSideclick();
+ },0);
+ }
+
+ function bindSideclick () {
+ var sideClickHandler = dom.observe(editable.ownerDocument, "click", function(event) {
+ sideClickHandler.stop();
+ if (dom.getParentElement(event.target, { nodeName: ["TABLE"] }) != select.table) {
+ removeCellSelections();
+ select.table = null;
+ select.start = null;
+ select.end = null;
+ editor.fire("tableunselect").fire("tableunselect:composer");
+ }
+ });
+ }
+
+ function selectCells (start, end) {
+ select.start = start;
+ select.end = end;
+ select.table = dom.getParentElement(select.start, { nodeName: ["TABLE"] });
+ selectedCells = dom.table.getCellsBetween(select.start, select.end);
+ addSelections(selectedCells);
+ bindSideclick();
+ editor.fire("tableselect").fire("tableselect:composer");
+ }
+
+ return init();
+
+};
+;(function(wysihtml5) {
+ var RGBA_REGEX = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([\d\.]+)\s*\)/i,
+ RGB_REGEX = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i,
+ HEX6_REGEX = /^#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])/i,
+ HEX3_REGEX = /^#([0-9a-f])([0-9a-f])([0-9a-f])/i;
+
+ var param_REGX = function (p) {
+ return new RegExp("(^|\\s|;)" + p + "\\s*:\\s*[^;$]+" , "gi");
+ };
+
+ wysihtml5.quirks.styleParser = {
+
+ parseColor: function(stylesStr, paramName) {
+ var paramRegex = param_REGX(paramName),
+ params = stylesStr.match(paramRegex),
+ radix = 10,
+ str, colorMatch;
+
+ if (params) {
+ for (var i = params.length; i--;) {
+ params[i] = wysihtml5.lang.string(params[i].split(':')[1]).trim();
+ }
+ str = params[params.length-1];
+
+ if (RGBA_REGEX.test(str)) {
+ colorMatch = str.match(RGBA_REGEX);
+ } else if (RGB_REGEX.test(str)) {
+ colorMatch = str.match(RGB_REGEX);
+ } else if (HEX6_REGEX.test(str)) {
+ colorMatch = str.match(HEX6_REGEX);
+ radix = 16;
+ } else if (HEX3_REGEX.test(str)) {
+ colorMatch = str.match(HEX3_REGEX);
+ colorMatch.shift();
+ colorMatch.push(1);
+ return wysihtml5.lang.array(colorMatch).map(function(d, idx) {
+ return (idx < 3) ? (parseInt(d, 16) * 16) + parseInt(d, 16): parseFloat(d);
+ });
+ }
+
+ if (colorMatch) {
+ colorMatch.shift();
+ if (!colorMatch[3]) {
+ colorMatch.push(1);
+ }
+ return wysihtml5.lang.array(colorMatch).map(function(d, idx) {
+ return (idx < 3) ? parseInt(d, radix): parseFloat(d);
+ });
+ }
+ }
+ return false;
+ },
+
+ unparseColor: function(val, props) {
+ if (props) {
+ if (props == "hex") {
+ return (val[0].toString(16).toUpperCase()) + (val[1].toString(16).toUpperCase()) + (val[2].toString(16).toUpperCase());
+ } else if (props == "hash") {
+ return "#" + (val[0].toString(16).toUpperCase()) + (val[1].toString(16).toUpperCase()) + (val[2].toString(16).toUpperCase());
+ } else if (props == "rgb") {
+ return "rgb(" + val[0] + "," + val[1] + "," + val[2] + ")";
+ } else if (props == "rgba") {
+ return "rgba(" + val[0] + "," + val[1] + "," + val[2] + "," + val[3] + ")";
+ } else if (props == "csv") {
+ return val[0] + "," + val[1] + "," + val[2] + "," + val[3];
+ }
+ }
+
+ if (val[3] && val[3] !== 1) {
+ return "rgba(" + val[0] + "," + val[1] + "," + val[2] + "," + val[3] + ")";
+ } else {
+ return "rgb(" + val[0] + "," + val[1] + "," + val[2] + ")";
+ }
+ },
+
+ parseFontSize: function(stylesStr) {
+ var params = stylesStr.match(param_REGX('font-size'));
+ if (params) {
+ return wysihtml5.lang.string(params[params.length - 1].split(':')[1]).trim();
+ }
+ return false;
+ }
+ };
+
+})(wysihtml5);
+;/**
+ * Selection API
+ *
+ * @example
+ * var selection = new wysihtml5.Selection(editor);
+ */
+(function(wysihtml5) {
+ var dom = wysihtml5.dom;
+
+ function _getCumulativeOffsetTop(element) {
+ var top = 0;
+ if (element.parentNode) {
+ do {
+ top += element.offsetTop || 0;
+ element = element.offsetParent;
+ } while (element);
+ }
+ return top;
+ }
+
+ // Provides the depth of ``descendant`` relative to ``ancestor``
+ function getDepth(ancestor, descendant) {
+ var ret = 0;
+ while (descendant !== ancestor) {
+ ret++;
+ descendant = descendant.parentNode;
+ if (!descendant)
+ throw new Error("not a descendant of ancestor!");
+ }
+ return ret;
+ }
+
+ // Should fix the obtained ranges that cannot surrond contents normally to apply changes upon
+ // Being considerate to firefox that sets range start start out of span and end inside on doubleclick initiated selection
+ function expandRangeToSurround(range) {
+ if (range.canSurroundContents()) return;
+
+ var common = range.commonAncestorContainer,
+ start_depth = getDepth(common, range.startContainer),
+ end_depth = getDepth(common, range.endContainer);
+
+ while(!range.canSurroundContents()) {
+ // In the following branches, we cannot just decrement the depth variables because the setStartBefore/setEndAfter may move the start or end of the range more than one level relative to ``common``. So we need to recompute the depth.
+ if (start_depth > end_depth) {
+ range.setStartBefore(range.startContainer);
+ start_depth = getDepth(common, range.startContainer);
+ }
+ else {
+ range.setEndAfter(range.endContainer);
+ end_depth = getDepth(common, range.endContainer);
+ }
+ }
+ }
+
+ wysihtml5.Selection = Base.extend(
+ /** @scope wysihtml5.Selection.prototype */ {
+ constructor: function(editor, contain, unselectableClass) {
+ // Make sure that our external range library is initialized
+ window.rangy.init();
+
+ this.editor = editor;
+ this.composer = editor.composer;
+ this.doc = this.composer.doc;
+ this.contain = contain;
+ this.unselectableClass = unselectableClass || false;
+ },
+
+ /**
+ * Get the current selection as a bookmark to be able to later restore it
+ *
+ * @return {Object} An object that represents the current selection
+ */
+ getBookmark: function() {
+ var range = this.getRange();
+ if (range) expandRangeToSurround(range);
+ return range && range.cloneRange();
+ },
+
+ /**
+ * Restore a selection retrieved via wysihtml5.Selection.prototype.getBookmark
+ *
+ * @param {Object} bookmark An object that represents the current selection
+ */
+ setBookmark: function(bookmark) {
+ if (!bookmark) {
+ return;
+ }
+
+ this.setSelection(bookmark);
+ },
+
+ /**
+ * Set the caret in front of the given node
+ *
+ * @param {Object} node The element or text node where to position the caret in front of
+ * @example
+ * selection.setBefore(myElement);
+ */
+ setBefore: function(node) {
+ var range = rangy.createRange(this.doc);
+ range.setStartBefore(node);
+ range.setEndBefore(node);
+ return this.setSelection(range);
+ },
+
+ /**
+ * Set the caret after the given node
+ *
+ * @param {Object} node The element or text node where to position the caret in front of
+ * @example
+ * selection.setBefore(myElement);
+ */
+ setAfter: function(node) {
+ var range = rangy.createRange(this.doc);
+
+ range.setStartAfter(node);
+ range.setEndAfter(node);
+ return this.setSelection(range);
+ },
+
+ /**
+ * Ability to select/mark nodes
+ *
+ * @param {Element} node The node/element to select
+ * @example
+ * selection.selectNode(document.getElementById("my-image"));
+ */
+ selectNode: function(node, avoidInvisibleSpace) {
+ var range = rangy.createRange(this.doc),
+ isElement = node.nodeType === wysihtml5.ELEMENT_NODE,
+ canHaveHTML = "canHaveHTML" in node ? node.canHaveHTML : (node.nodeName !== "IMG"),
+ content = isElement ? node.innerHTML : node.data,
+ isEmpty = (content === "" || content === wysihtml5.INVISIBLE_SPACE),
+ displayStyle = dom.getStyle("display").from(node),
+ isBlockElement = (displayStyle === "block" || displayStyle === "list-item");
+
+ if (isEmpty && isElement && canHaveHTML && !avoidInvisibleSpace) {
+ // Make sure that caret is visible in node by inserting a zero width no breaking space
+ try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {}
+ }
+
+ if (canHaveHTML) {
+ range.selectNodeContents(node);
+ } else {
+ range.selectNode(node);
+ }
+
+ if (canHaveHTML && isEmpty && isElement) {
+ range.collapse(isBlockElement);
+ } else if (canHaveHTML && isEmpty) {
+ range.setStartAfter(node);
+ range.setEndAfter(node);
+ }
+
+ this.setSelection(range);
+ },
+
+ /**
+ * Get the node which contains the selection
+ *
+ * @param {Boolean} [controlRange] (only IE) Whether it should return the selected ControlRange element when the selection type is a "ControlRange"
+ * @return {Object} The node that contains the caret
+ * @example
+ * var nodeThatContainsCaret = selection.getSelectedNode();
+ */
+ getSelectedNode: function(controlRange) {
+ var selection,
+ range;
+
+ if (controlRange && this.doc.selection && this.doc.selection.type === "Control") {
+ range = this.doc.selection.createRange();
+ if (range && range.length) {
+ return range.item(0);
+ }
+ }
+
+ selection = this.getSelection(this.doc);
+ if (selection.focusNode === selection.anchorNode) {
+ return selection.focusNode;
+ } else {
+ range = this.getRange(this.doc);
+ return range ? range.commonAncestorContainer : this.doc.body;
+ }
+ },
+
+ fixSelBorders: function() {
+ var range = this.getRange();
+ expandRangeToSurround(range);
+ this.setSelection(range);
+ },
+
+ getSelectedOwnNodes: function(controlRange) {
+ var selection,
+ ranges = this.getOwnRanges(),
+ ownNodes = [];
+
+ for (var i = 0, maxi = ranges.length; i < maxi; i++) {
+ ownNodes.push(ranges[i].commonAncestorContainer || this.doc.body);
+ }
+ return ownNodes;
+ },
+
+ findNodesInSelection: function(nodeTypes) {
+ var ranges = this.getOwnRanges(),
+ nodes = [], curNodes;
+ for (var i = 0, maxi = ranges.length; i < maxi; i++) {
+ curNodes = ranges[i].getNodes([1], function(node) {
+ return wysihtml5.lang.array(nodeTypes).contains(node.nodeName);
+ });
+ nodes = nodes.concat(curNodes);
+ }
+ return nodes;
+ },
+
+ containsUneditable: function() {
+ var uneditables = this.getOwnUneditables(),
+ selection = this.getSelection();
+
+ for (var i = 0, maxi = uneditables.length; i < maxi; i++) {
+ if (selection.containsNode(uneditables[i])) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ deleteContents: function() {
+ var ranges = this.getOwnRanges();
+ for (var i = ranges.length; i--;) {
+ ranges[i].deleteContents();
+ }
+ this.setSelection(ranges[0]);
+ },
+
+ getPreviousNode: function(node, ignoreEmpty) {
+ if (!node) {
+ var selection = this.getSelection();
+ node = selection.anchorNode;
+ }
+
+ if (node === this.contain) {
+ return false;
+ }
+
+ var ret = node.previousSibling,
+ parent;
+
+ if (ret === this.contain) {
+ return false;
+ }
+
+ if (ret && ret.nodeType !== 3 && ret.nodeType !== 1) {
+ // do not count comments and other node types
+ ret = this.getPreviousNode(ret, ignoreEmpty);
+ } else if (ret && ret.nodeType === 3 && (/^\s*$/).test(ret.textContent)) {
+ // do not count empty textnodes as previus nodes
+ ret = this.getPreviousNode(ret, ignoreEmpty);
+ } else if (ignoreEmpty && ret && ret.nodeType === 1 && !wysihtml5.lang.array(["BR", "HR", "IMG"]).contains(ret.nodeName) && (/^[\s]*$/).test(ret.innerHTML)) {
+ // Do not count empty nodes if param set.
+ // Contenteditable tends to bypass and delete these silently when deleting with caret
+ ret = this.getPreviousNode(ret, ignoreEmpty);
+ } else if (!ret && node !== this.contain) {
+ parent = node.parentNode;
+ if (parent !== this.contain) {
+ ret = this.getPreviousNode(parent, ignoreEmpty);
+ }
+ }
+
+ return (ret !== this.contain) ? ret : false;
+ },
+
+ getSelectionParentsByTag: function(tagName) {
+ var nodes = this.getSelectedOwnNodes(),
+ curEl, parents = [];
+
+ for (var i = 0, maxi = nodes.length; i < maxi; i++) {
+ curEl = (nodes[i].nodeName && nodes[i].nodeName === 'LI') ? nodes[i] : wysihtml5.dom.getParentElement(nodes[i], { nodeName: ['LI']}, false, this.contain);
+ if (curEl) {
+ parents.push(curEl);
+ }
+ }
+ return (parents.length) ? parents : null;
+ },
+
+ getRangeToNodeEnd: function() {
+ if (this.isCollapsed()) {
+ var range = this.getRange(),
+ sNode = range.startContainer,
+ pos = range.startOffset,
+ lastR = rangy.createRange(this.doc);
+
+ lastR.selectNodeContents(sNode);
+ lastR.setStart(sNode, pos);
+ return lastR;
+ }
+ },
+
+ caretIsLastInSelection: function() {
+ var r = rangy.createRange(this.doc),
+ s = this.getSelection(),
+ endc = this.getRangeToNodeEnd().cloneContents(),
+ endtxt = endc.textContent;
+
+ return (/^\s*$/).test(endtxt);
+ },
+
+ caretIsFirstInSelection: function() {
+ var r = rangy.createRange(this.doc),
+ s = this.getSelection(),
+ range = this.getRange(),
+ startNode = range.startContainer;
+
+ if (startNode.nodeType === wysihtml5.TEXT_NODE) {
+ return this.isCollapsed() && (startNode.nodeType === wysihtml5.TEXT_NODE && (/^\s*$/).test(startNode.data.substr(0,range.startOffset)));
+ } else {
+ r.selectNodeContents(this.getRange().commonAncestorContainer);
+ r.collapse(true);
+ return (this.isCollapsed() && (r.startContainer === s.anchorNode || r.endContainer === s.anchorNode) && r.startOffset === s.anchorOffset);
+ }
+ },
+
+ caretIsInTheBeginnig: function(ofNode) {
+ var selection = this.getSelection(),
+ node = selection.anchorNode,
+ offset = selection.anchorOffset;
+ if (ofNode) {
+ return (offset === 0 && (node.nodeName && node.nodeName === ofNode.toUpperCase() || wysihtml5.dom.getParentElement(node.parentNode, { nodeName: ofNode }, 1)));
+ } else {
+ return (offset === 0 && !this.getPreviousNode(node, true));
+ }
+ },
+
+ caretIsBeforeUneditable: function() {
+ var selection = this.getSelection(),
+ node = selection.anchorNode,
+ offset = selection.anchorOffset;
+
+ if (offset === 0) {
+ var prevNode = this.getPreviousNode(node, true);
+ if (prevNode) {
+ var uneditables = this.getOwnUneditables();
+ for (var i = 0, maxi = uneditables.length; i < maxi; i++) {
+ if (prevNode === uneditables[i]) {
+ return uneditables[i];
+ }
+ }
+ }
+ }
+ return false;
+ },
+
+ // TODO: Figure out a method from following 2 that would work universally
+ executeAndRestoreRangy: function(method, restoreScrollPosition) {
+ var win = this.doc.defaultView || this.doc.parentWindow,
+ sel = rangy.saveSelection(win);
+
+ if (!sel) {
+ method();
+ } else {
+ try {
+ method();
+ } catch(e) {
+ setTimeout(function() { throw e; }, 0);
+ }
+ }
+ rangy.restoreSelection(sel);
+ },
+
+ // TODO: has problems in chrome 12. investigate block level and uneditable area inbetween
+ executeAndRestore: function(method, restoreScrollPosition) {
+ var body = this.doc.body,
+ oldScrollTop = restoreScrollPosition && body.scrollTop,
+ oldScrollLeft = restoreScrollPosition && body.scrollLeft,
+ className = "_wysihtml5-temp-placeholder",
+ placeholderHtml = '<span class="' + className + '">' + wysihtml5.INVISIBLE_SPACE + '</span>',
+ range = this.getRange(true),
+ caretPlaceholder,
+ newCaretPlaceholder,
+ nextSibling, prevSibling,
+ node, node2, range2,
+ newRange;
+
+ // Nothing selected, execute and say goodbye
+ if (!range) {
+ method(body, body);
+ return;
+ }
+
+ if (!range.collapsed) {
+ range2 = range.cloneRange();
+ node2 = range2.createContextualFragment(placeholderHtml);
+ range2.collapse(false);
+ range2.insertNode(node2);
+ range2.detach();
+ }
+
+ node = range.createContextualFragment(placeholderHtml);
+ range.insertNode(node);
+
+ if (node2) {
+ caretPlaceholder = this.contain.querySelectorAll("." + className);
+ range.setStartBefore(caretPlaceholder[0]);
+ range.setEndAfter(caretPlaceholder[caretPlaceholder.length -1]);
+ }
+ this.setSelection(range);
+
+ // Make sure that a potential error doesn't cause our placeholder element to be left as a placeholder
+ try {
+ method(range.startContainer, range.endContainer);
+ } catch(e) {
+ setTimeout(function() { throw e; }, 0);
+ }
+ caretPlaceholder = this.contain.querySelectorAll("." + className);
+ if (caretPlaceholder && caretPlaceholder.length) {
+ newRange = rangy.createRange(this.doc);
+ nextSibling = caretPlaceholder[0].nextSibling;
+ if (caretPlaceholder.length > 1) {
+ prevSibling = caretPlaceholder[caretPlaceholder.length -1].previousSibling;
+ }
+ if (prevSibling && nextSibling) {
+ newRange.setStartBefore(nextSibling);
+ newRange.setEndAfter(prevSibling);
+ } else {
+ newCaretPlaceholder = this.doc.createTextNode(wysihtml5.INVISIBLE_SPACE);
+ dom.insert(newCaretPlaceholder).after(caretPlaceholder[0]);
+ newRange.setStartBefore(newCaretPlaceholder);
+ newRange.setEndAfter(newCaretPlaceholder);
+ }
+ this.setSelection(newRange);
+ for (var i = caretPlaceholder.length; i--;) {
+ caretPlaceholder[i].parentNode.removeChild(caretPlaceholder[i]);
+ }
+
+ } else {
+ // fallback for when all hell breaks loose
+ this.contain.focus();
+ }
+
+ if (restoreScrollPosition) {
+ body.scrollTop = oldScrollTop;
+ body.scrollLeft = oldScrollLeft;
+ }
+
+ // Remove it again, just to make sure that the placeholder is definitely out of the dom tree
+ try {
+ caretPlaceholder.parentNode.removeChild(caretPlaceholder);
+ } catch(e2) {}
+ },
+
+ set: function(node, offset) {
+ var newRange = rangy.createRange(this.doc);
+ newRange.setStart(node, offset || 0);
+ this.setSelection(newRange);
+ },
+
+ /**
+ * Insert html at the caret position and move the cursor after the inserted html
+ *
+ * @param {String} html HTML string to insert
+ * @example
+ * selection.insertHTML("<p>foobar</p>");
+ */
+ insertHTML: function(html) {
+ var range = rangy.createRange(this.doc),
+ node = this.doc.createElement('DIV'),
+ fragment = this.doc.createDocumentFragment(),
+ lastChild;
+
+ node.innerHTML = html;
+ lastChild = node.lastChild;
+
+ while (node.firstChild) {
+ fragment.appendChild(node.firstChild);
+ }
+ this.insertNode(fragment);
+
+ if (lastChild) {
+ this.setAfter(lastChild);
+ }
+ },
+
+ /**
+ * Insert a node at the caret position and move the cursor behind it
+ *
+ * @param {Object} node HTML string to insert
+ * @example
+ * selection.insertNode(document.createTextNode("foobar"));
+ */
+ insertNode: function(node) {
+ var range = this.getRange();
+ if (range) {
+ range.insertNode(node);
+ }
+ },
+
+ /**
+ * Wraps current selection with the given node
+ *
+ * @param {Object} node The node to surround the selected elements with
+ */
+ surround: function(nodeOptions) {
+ var ranges = this.getOwnRanges(),
+ node, nodes = [];
+ if (ranges.length == 0) {
+ return nodes;
+ }
+
+ for (var i = ranges.length; i--;) {
+ node = this.doc.createElement(nodeOptions.nodeName);
+ nodes.push(node);
+ if (nodeOptions.className) {
+ node.className = nodeOptions.className;
+ }
+ if (nodeOptions.cssStyle) {
+ node.setAttribute('style', nodeOptions.cssStyle);
+ }
+ try {
+ // This only works when the range boundaries are not overlapping other elements
+ ranges[i].surroundContents(node);
+ this.selectNode(node);
+ } catch(e) {
+ // fallback
+ node.appendChild(ranges[i].extractContents());
+ ranges[i].insertNode(node);
+ }
+ }
+ return nodes;
+ },
+
+ deblockAndSurround: function(nodeOptions) {
+ var tempElement = this.doc.createElement('div'),
+ range = rangy.createRange(this.doc),
+ tempDivElements,
+ tempElements,
+ firstChild;
+
+ tempElement.className = nodeOptions.className;
+
+ this.composer.commands.exec("formatBlock", nodeOptions.nodeName, nodeOptions.className);
+ tempDivElements = this.contain.querySelectorAll("." + nodeOptions.className);
+ if (tempDivElements[0]) {
+ tempDivElements[0].parentNode.insertBefore(tempElement, tempDivElements[0]);
+
+ range.setStartBefore(tempDivElements[0]);
+ range.setEndAfter(tempDivElements[tempDivElements.length - 1]);
+ tempElements = range.extractContents();
+
+ while (tempElements.firstChild) {
+ firstChild = tempElements.firstChild;
+ if (firstChild.nodeType == 1 && wysihtml5.dom.hasClass(firstChild, nodeOptions.className)) {
+ while (firstChild.firstChild) {
+ tempElement.appendChild(firstChild.firstChild);
+ }
+ if (firstChild.nodeName !== "BR") { tempElement.appendChild(this.doc.createElement('br')); }
+ tempElements.removeChild(firstChild);
+ } else {
+ tempElement.appendChild(firstChild);
+ }
+ }
+ } else {
+ tempElement = null;
+ }
+
+ return tempElement;
+ },
+
+ /**
+ * Scroll the current caret position into the view
+ * FIXME: This is a bit hacky, there might be a smarter way of doing this
+ *
+ * @example
+ * selection.scrollIntoView();
+ */
+ scrollIntoView: function() {
+ var doc = this.doc,
+ tolerance = 5, // px
+ hasScrollBars = doc.documentElement.scrollHeight > doc.documentElement.offsetHeight,
+ tempElement = doc._wysihtml5ScrollIntoViewElement = doc._wysihtml5ScrollIntoViewElement || (function() {
+ var element = doc.createElement("span");
+ // The element needs content in order to be able to calculate it's position properly
+ element.innerHTML = wysihtml5.INVISIBLE_SPACE;
+ return element;
+ })(),
+ offsetTop;
+
+ if (hasScrollBars) {
+ this.insertNode(tempElement);
+ offsetTop = _getCumulativeOffsetTop(tempElement);
+ tempElement.parentNode.removeChild(tempElement);
+ if (offsetTop >= (doc.body.scrollTop + doc.documentElement.offsetHeight - tolerance)) {
+ doc.body.scrollTop = offsetTop;
+ }
+ }
+ },
+
+ /**
+ * Select line where the caret is in
+ */
+ selectLine: function() {
+ if (wysihtml5.browser.supportsSelectionModify()) {
+ this._selectLine_W3C();
+ } else if (this.doc.selection) {
+ this._selectLine_MSIE();
+ }
+ },
+
+ /**
+ * See https://developer.mozilla.org/en/DOM/Selection/modify
+ */
+ _selectLine_W3C: function() {
+ var win = this.doc.defaultView,
+ selection = win.getSelection();
+ selection.modify("move", "left", "lineboundary");
+ selection.modify("extend", "right", "lineboundary");
+ },
+
+ _selectLine_MSIE: function() {
+ var range = this.doc.selection.createRange(),
+ rangeTop = range.boundingTop,
+ scrollWidth = this.doc.body.scrollWidth,
+ rangeBottom,
+ rangeEnd,
+ measureNode,
+ i,
+ j;
+
+ if (!range.moveToPoint) {
+ return;
+ }
+
+ if (rangeTop === 0) {
+ // Don't know why, but when the selection ends at the end of a line
+ // range.boundingTop is 0
+ measureNode = this.doc.createElement("span");
+ this.insertNode(measureNode);
+ rangeTop = measureNode.offsetTop;
+ measureNode.parentNode.removeChild(measureNode);
+ }
+
+ rangeTop += 1;
+
+ for (i=-10; i<scrollWidth; i+=2) {
+ try {
+ range.moveToPoint(i, rangeTop);
+ break;
+ } catch(e1) {}
+ }
+
+ // Investigate the following in order to handle multi line selections
+ // rangeBottom = rangeTop + (rangeHeight ? (rangeHeight - 1) : 0);
+ rangeBottom = rangeTop;
+ rangeEnd = this.doc.selection.createRange();
+ for (j=scrollWidth; j>=0; j--) {
+ try {
+ rangeEnd.moveToPoint(j, rangeBottom);
+ break;
+ } catch(e2) {}
+ }
+
+ range.setEndPoint("EndToEnd", rangeEnd);
+ range.select();
+ },
+
+ getText: function() {
+ var selection = this.getSelection();
+ return selection ? selection.toString() : "";
+ },
+
+ getNodes: function(nodeType, filter) {
+ var range = this.getRange();
+ if (range) {
+ return range.getNodes([nodeType], filter);
+ } else {
+ return [];
+ }
+ },
+
+ fixRangeOverflow: function(range) {
+ if (this.contain && this.contain.firstChild && range) {
+ var containment = range.compareNode(this.contain);
+ if (containment !== 2) {
+ if (containment === 1) {
+ range.setStartBefore(this.contain.firstChild);
+ }
+ if (containment === 0) {
+ range.setEndAfter(this.contain.lastChild);
+ }
+ if (containment === 3) {
+ range.setStartBefore(this.contain.firstChild);
+ range.setEndAfter(this.contain.lastChild);
+ }
+ } else if (this._detectInlineRangeProblems(range)) {
+ var previousElementSibling = range.endContainer.previousElementSibling;
+ if (previousElementSibling) {
+ range.setEnd(previousElementSibling, this._endOffsetForNode(previousElementSibling));
+ }
+ }
+ }
+ },
+
+ _endOffsetForNode: function(node) {
+ var range = document.createRange();
+ range.selectNodeContents(node);
+ return range.endOffset;
+ },
+
+ _detectInlineRangeProblems: function(range) {
+ var position = dom.compareDocumentPosition(range.startContainer, range.endContainer);
+ return (
+ range.endOffset == 0 &&
+ position & 4 //Node.DOCUMENT_POSITION_FOLLOWING
+ );
+ },
+
+ getRange: function(dontFix) {
+ var selection = this.getSelection(),
+ range = selection && selection.rangeCount && selection.getRangeAt(0);
+
+ if (dontFix !== true) {
+ this.fixRangeOverflow(range);
+ }
+
+ return range;
+ },
+
+ getOwnUneditables: function() {
+ var allUneditables = dom.query(this.contain, '.' + this.unselectableClass),
+ deepUneditables = dom.query(allUneditables, '.' + this.unselectableClass);
+
+ return wysihtml5.lang.array(allUneditables).without(deepUneditables);
+ },
+
+ // Returns an array of ranges that belong only to this editable
+ // Needed as uneditable block in contenteditabel can split range into pieces
+ // If manipulating content reverse loop is usually needed as manipulation can shift subsequent ranges
+ getOwnRanges: function() {
+ var ranges = [],
+ r = this.getRange(),
+ tmpRanges;
+
+ if (r) { ranges.push(r); }
+
+ if (this.unselectableClass && this.contain && r) {
+ var uneditables = this.getOwnUneditables(),
+ tmpRange;
+ if (uneditables.length > 0) {
+ for (var i = 0, imax = uneditables.length; i < imax; i++) {
+ tmpRanges = [];
+ for (var j = 0, jmax = ranges.length; j < jmax; j++) {
+ if (ranges[j]) {
+ switch (ranges[j].compareNode(uneditables[i])) {
+ case 2:
+ // all selection inside uneditable. remove
+ break;
+ case 3:
+ //section begins before and ends after uneditable. spilt
+ tmpRange = ranges[j].cloneRange();
+ tmpRange.setEndBefore(uneditables[i]);
+ tmpRanges.push(tmpRange);
+
+ tmpRange = ranges[j].cloneRange();
+ tmpRange.setStartAfter(uneditables[i]);
+ tmpRanges.push(tmpRange);
+ break;
+ default:
+ // in all other cases uneditable does not touch selection. dont modify
+ tmpRanges.push(ranges[j]);
+ }
+ }
+ ranges = tmpRanges;
+ }
+ }
+ }
+ }
+ return ranges;
+ },
+
+ getSelection: function() {
+ return rangy.getSelection(this.doc.defaultView || this.doc.parentWindow);
+ },
+
+ setSelection: function(range) {
+ var win = this.doc.defaultView || this.doc.parentWindow,
+ selection = rangy.getSelection(win);
+ return selection.setSingleRange(range);
+ },
+
+ createRange: function() {
+ return rangy.createRange(this.doc);
+ },
+
+ isCollapsed: function() {
+ return this.getSelection().isCollapsed;
+ },
+
+ getHtml: function() {
+ return this.getSelection().toHtml();
+ },
+
+ isEndToEndInNode: function(nodeNames) {
+ var range = this.getRange(),
+ parentElement = range.commonAncestorContainer,
+ startNode = range.startContainer,
+ endNode = range.endContainer;
+
+
+ if (parentElement.nodeType === wysihtml5.TEXT_NODE) {
+ parentElement = parentElement.parentNode;
+ }
+
+ if (startNode.nodeType === wysihtml5.TEXT_NODE && !(/^\s*$/).test(startNode.data.substr(range.startOffset))) {
+ return false;
+ }
+
+ if (endNode.nodeType === wysihtml5.TEXT_NODE && !(/^\s*$/).test(endNode.data.substr(range.endOffset))) {
+ return false;
+ }
+
+ while (startNode && startNode !== parentElement) {
+ if (startNode.nodeType !== wysihtml5.TEXT_NODE && !wysihtml5.dom.contains(parentElement, startNode)) {
+ return false;
+ }
+ if (wysihtml5.dom.domNode(startNode).prev({ignoreBlankTexts: true})) {
+ return false;
+ }
+ startNode = startNode.parentNode;
+ }
+
+ while (endNode && endNode !== parentElement) {
+ if (endNode.nodeType !== wysihtml5.TEXT_NODE && !wysihtml5.dom.contains(parentElement, endNode)) {
+ return false;
+ }
+ if (wysihtml5.dom.domNode(endNode).next({ignoreBlankTexts: true})) {
+ return false;
+ }
+ endNode = endNode.parentNode;
+ }
+
+ return (wysihtml5.lang.array(nodeNames).contains(parentElement.nodeName)) ? parentElement : false;
+ },
+
+ deselect: function() {
+ var sel = this.getSelection();
+ sel && sel.removeAllRanges();
+ }
+ });
+
+})(wysihtml5);
+;/**
+ * Inspired by the rangy CSS Applier module written by Tim Down and licensed under the MIT license.
+ * http://code.google.com/p/rangy/
+ *
+ * changed in order to be able ...
+ * - to use custom tags
+ * - to detect and replace similar css classes via reg exp
+ */
+(function(wysihtml5, rangy) {
+ var defaultTagName = "span";
+
+ var REG_EXP_WHITE_SPACE = /\s+/g;
+
+ function hasClass(el, cssClass, regExp) {
+ if (!el.className) {
+ return false;
+ }
+
+ var matchingClassNames = el.className.match(regExp) || [];
+ return matchingClassNames[matchingClassNames.length - 1] === cssClass;
+ }
+
+ function hasStyleAttr(el, regExp) {
+ if (!el.getAttribute || !el.getAttribute('style')) {
+ return false;
+ }
+ var matchingStyles = el.getAttribute('style').match(regExp);
+ return (el.getAttribute('style').match(regExp)) ? true : false;
+ }
+
+ function addStyle(el, cssStyle, regExp) {
+ if (el.getAttribute('style')) {
+ removeStyle(el, regExp);
+ if (el.getAttribute('style') && !(/^\s*$/).test(el.getAttribute('style'))) {
+ el.setAttribute('style', cssStyle + ";" + el.getAttribute('style'));
+ } else {
+ el.setAttribute('style', cssStyle);
+ }
+ } else {
+ el.setAttribute('style', cssStyle);
+ }
+ }
+
+ function addClass(el, cssClass, regExp) {
+ if (el.className) {
+ removeClass(el, regExp);
+ el.className += " " + cssClass;
+ } else {
+ el.className = cssClass;
+ }
+ }
+
+ function removeClass(el, regExp) {
+ if (el.className) {
+ el.className = el.className.replace(regExp, "");
+ }
+ }
+
+ function removeStyle(el, regExp) {
+ var s,
+ s2 = [];
+ if (el.getAttribute('style')) {
+ s = el.getAttribute('style').split(';');
+ for (var i = s.length; i--;) {
+ if (!s[i].match(regExp) && !(/^\s*$/).test(s[i])) {
+ s2.push(s[i]);
+ }
+ }
+ if (s2.length) {
+ el.setAttribute('style', s2.join(';'));
+ } else {
+ el.removeAttribute('style');
+ }
+ }
+ }
+
+ function getMatchingStyleRegexp(el, style) {
+ var regexes = [],
+ sSplit = style.split(';'),
+ elStyle = el.getAttribute('style');
+
+ if (elStyle) {
+ elStyle = elStyle.replace(/\s/gi, '').toLowerCase();
+ regexes.push(new RegExp("(^|\\s|;)" + style.replace(/\s/gi, '').replace(/([\(\)])/gi, "\\$1").toLowerCase().replace(";", ";?").replace(/rgb\\\((\d+),(\d+),(\d+)\\\)/gi, "\\s?rgb\\($1,\\s?$2,\\s?$3\\)"), "gi"));
+
+ for (var i = sSplit.length; i-- > 0;) {
+ if (!(/^\s*$/).test(sSplit[i])) {
+ regexes.push(new RegExp("(^|\\s|;)" + sSplit[i].replace(/\s/gi, '').replace(/([\(\)])/gi, "\\$1").toLowerCase().replace(";", ";?").replace(/rgb\\\((\d+),(\d+),(\d+)\\\)/gi, "\\s?rgb\\($1,\\s?$2,\\s?$3\\)"), "gi"));
+ }
+ }
+ for (var j = 0, jmax = regexes.length; j < jmax; j++) {
+ if (elStyle.match(regexes[j])) {
+ return regexes[j];
+ }
+ }
+ }
+
+ return false;
+ }
+
+ function isMatchingAllready(node, tags, style, className) {
+ if (style) {
+ return getMatchingStyleRegexp(node, style);
+ } else if (className) {
+ return wysihtml5.dom.hasClass(node, className);
+ } else {
+ return rangy.dom.arrayContains(tags, node.tagName.toLowerCase());
+ }
+ }
+
+ function areMatchingAllready(nodes, tags, style, className) {
+ for (var i = nodes.length; i--;) {
+ if (!isMatchingAllready(nodes[i], tags, style, className)) {
+ return false;
+ }
+ }
+ return nodes.length ? true : false;
+ }
+
+ function removeOrChangeStyle(el, style, regExp) {
+
+ var exactRegex = getMatchingStyleRegexp(el, style);
+ if (exactRegex) {
+ // adding same style value on property again removes style
+ removeStyle(el, exactRegex);
+ return "remove";
+ } else {
+ // adding new style value changes value
+ addStyle(el, style, regExp);
+ return "change";
+ }
+ }
+
+ function hasSameClasses(el1, el2) {
+ return el1.className.replace(REG_EXP_WHITE_SPACE, " ") == el2.className.replace(REG_EXP_WHITE_SPACE, " ");
+ }
+
+ function replaceWithOwnChildren(el) {
+ var parent = el.parentNode;
+ while (el.firstChild) {
+ parent.insertBefore(el.firstChild, el);
+ }
+ parent.removeChild(el);
+ }
+
+ function elementsHaveSameNonClassAttributes(el1, el2) {
+ if (el1.attributes.length != el2.attributes.length) {
+ return false;
+ }
+ for (var i = 0, len = el1.attributes.length, attr1, attr2, name; i < len; ++i) {
+ attr1 = el1.attributes[i];
+ name = attr1.name;
+ if (name != "class") {
+ attr2 = el2.attributes.getNamedItem(name);
+ if (attr1.specified != attr2.specified) {
+ return false;
+ }
+ if (attr1.specified && attr1.nodeValue !== attr2.nodeValue) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ function isSplitPoint(node, offset) {
+ if (rangy.dom.isCharacterDataNode(node)) {
+ if (offset == 0) {
+ return !!node.previousSibling;
+ } else if (offset == node.length) {
+ return !!node.nextSibling;
+ } else {
+ return true;
+ }
+ }
+
+ return offset > 0 && offset < node.childNodes.length;
+ }
+
+ function splitNodeAt(node, descendantNode, descendantOffset, container) {
+ var newNode;
+ if (rangy.dom.isCharacterDataNode(descendantNode)) {
+ if (descendantOffset == 0) {
+ descendantOffset = rangy.dom.getNodeIndex(descendantNode);
+ descendantNode = descendantNode.parentNode;
+ } else if (descendantOffset == descendantNode.length) {
+ descendantOffset = rangy.dom.getNodeIndex(descendantNode) + 1;
+ descendantNode = descendantNode.parentNode;
+ } else {
+ newNode = rangy.dom.splitDataNode(descendantNode, descendantOffset);
+ }
+ }
+ if (!newNode) {
+ if (!container || descendantNode !== container) {
+
+ newNode = descendantNode.cloneNode(false);
+ if (newNode.id) {
+ newNode.removeAttribute("id");
+ }
+ var child;
+ while ((child = descendantNode.childNodes[descendantOffset])) {
+ newNode.appendChild(child);
+ }
+ rangy.dom.insertAfter(newNode, descendantNode);
+
+ }
+ }
+ return (descendantNode == node) ? newNode : splitNodeAt(node, newNode.parentNode, rangy.dom.getNodeIndex(newNode), container);
+ }
+
+ function Merge(firstNode) {
+ this.isElementMerge = (firstNode.nodeType == wysihtml5.ELEMENT_NODE);
+ this.firstTextNode = this.isElementMerge ? firstNode.lastChild : firstNode;
+ this.textNodes = [this.firstTextNode];
+ }
+
+ Merge.prototype = {
+ doMerge: function() {
+ var textBits = [], textNode, parent, text;
+ for (var i = 0, len = this.textNodes.length; i < len; ++i) {
+ textNode = this.textNodes[i];
+ parent = textNode.parentNode;
+ textBits[i] = textNode.data;
+ if (i) {
+ parent.removeChild(textNode);
+ if (!parent.hasChildNodes()) {
+ parent.parentNode.removeChild(parent);
+ }
+ }
+ }
+ this.firstTextNode.data = text = textBits.join("");
+ return text;
+ },
+
+ getLength: function() {
+ var i = this.textNodes.length, len = 0;
+ while (i--) {
+ len += this.textNodes[i].length;
+ }
+ return len;
+ },
+
+ toString: function() {
+ var textBits = [];
+ for (var i = 0, len = this.textNodes.length; i < len; ++i) {
+ textBits[i] = "'" + this.textNodes[i].data + "'";
+ }
+ return "[Merge(" + textBits.join(",") + ")]";
+ }
+ };
+
+ function HTMLApplier(tagNames, cssClass, similarClassRegExp, normalize, cssStyle, similarStyleRegExp, container) {
+ this.tagNames = tagNames || [defaultTagName];
+ this.cssClass = cssClass || ((cssClass === false) ? false : "");
+ this.similarClassRegExp = similarClassRegExp;
+ this.cssStyle = cssStyle || "";
+ this.similarStyleRegExp = similarStyleRegExp;
+ this.normalize = normalize;
+ this.applyToAnyTagName = false;
+ this.container = container;
+ }
+
+ HTMLApplier.prototype = {
+ getAncestorWithClass: function(node) {
+ var cssClassMatch;
+ while (node) {
+ cssClassMatch = this.cssClass ? hasClass(node, this.cssClass, this.similarClassRegExp) : (this.cssStyle !== "") ? false : true;
+ if (node.nodeType == wysihtml5.ELEMENT_NODE && node.getAttribute("contenteditable") != "false" && rangy.dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && cssClassMatch) {
+ return node;
+ }
+ node = node.parentNode;
+ }
+ return false;
+ },
+
+ // returns parents of node with given style attribute
+ getAncestorWithStyle: function(node) {
+ var cssStyleMatch;
+ while (node) {
+ cssStyleMatch = this.cssStyle ? hasStyleAttr(node, this.similarStyleRegExp) : false;
+
+ if (node.nodeType == wysihtml5.ELEMENT_NODE && node.getAttribute("contenteditable") != "false" && rangy.dom.arrayContains(this.tagNames, node.tagName.toLowerCase()) && cssStyleMatch) {
+ return node;
+ }
+ node = node.parentNode;
+ }
+ return false;
+ },
+
+ getMatchingAncestor: function(node) {
+ var ancestor = this.getAncestorWithClass(node),
+ matchType = false;
+
+ if (!ancestor) {
+ ancestor = this.getAncestorWithStyle(node);
+ if (ancestor) {
+ matchType = "style";
+ }
+ } else {
+ if (this.cssStyle) {
+ matchType = "class";
+ }
+ }
+
+ return {
+ "element": ancestor,
+ "type": matchType
+ };
+ },
+
+ // Normalizes nodes after applying a CSS class to a Range.
+ postApply: function(textNodes, range) {
+ var firstNode = textNodes[0], lastNode = textNodes[textNodes.length - 1];
+
+ var merges = [], currentMerge;
+
+ var rangeStartNode = firstNode, rangeEndNode = lastNode;
+ var rangeStartOffset = 0, rangeEndOffset = lastNode.length;
+
+ var textNode, precedingTextNode;
+
+ for (var i = 0, len = textNodes.length; i < len; ++i) {
+ textNode = textNodes[i];
+ precedingTextNode = null;
+ if (textNode && textNode.parentNode) {
+ precedingTextNode = this.getAdjacentMergeableTextNode(textNode.parentNode, false);
+ }
+ if (precedingTextNode) {
+ if (!currentMerge) {
+ currentMerge = new Merge(precedingTextNode);
+ merges.push(currentMerge);
+ }
+ currentMerge.textNodes.push(textNode);
+ if (textNode === firstNode) {
+ rangeStartNode = currentMerge.firstTextNode;
+ rangeStartOffset = rangeStartNode.length;
+ }
+ if (textNode === lastNode) {
+ rangeEndNode = currentMerge.firstTextNode;
+ rangeEndOffset = currentMerge.getLength();
+ }
+ } else {
+ currentMerge = null;
+ }
+ }
+ // Test whether the first node after the range needs merging
+ if(lastNode && lastNode.parentNode) {
+ var nextTextNode = this.getAdjacentMergeableTextNode(lastNode.parentNode, true);
+ if (nextTextNode) {
+ if (!currentMerge) {
+ currentMerge = new Merge(lastNode);
+ merges.push(currentMerge);
+ }
+ currentMerge.textNodes.push(nextTextNode);
+ }
+ }
+ // Do the merges
+ if (merges.length) {
+ for (i = 0, len = merges.length; i < len; ++i) {
+ merges[i].doMerge();
+ }
+ // Set the range boundaries
+ range.setStart(rangeStartNode, rangeStartOffset);
+ range.setEnd(rangeEndNode, rangeEndOffset);
+ }
+ },
+
+ getAdjacentMergeableTextNode: function(node, forward) {
+ var isTextNode = (node.nodeType == wysihtml5.TEXT_NODE);
+ var el = isTextNode ? node.parentNode : node;
+ var adjacentNode;
+ var propName = forward ? "nextSibling" : "previousSibling";
+ if (isTextNode) {
+ // Can merge if the node's previous/next sibling is a text node
+ adjacentNode = node[propName];
+ if (adjacentNode && adjacentNode.nodeType == wysihtml5.TEXT_NODE) {
+ return adjacentNode;
+ }
+ } else {
+ // Compare element with its sibling
+ adjacentNode = el[propName];
+ if (adjacentNode && this.areElementsMergeable(node, adjacentNode)) {
+ return adjacentNode[forward ? "firstChild" : "lastChild"];
+ }
+ }
+ return null;
+ },
+
+ areElementsMergeable: function(el1, el2) {
+ return rangy.dom.arrayContains(this.tagNames, (el1.tagName || "").toLowerCase())
+ && rangy.dom.arrayContains(this.tagNames, (el2.tagName || "").toLowerCase())
+ && hasSameClasses(el1, el2)
+ && elementsHaveSameNonClassAttributes(el1, el2);
+ },
+
+ createContainer: function(doc) {
+ var el = doc.createElement(this.tagNames[0]);
+ if (this.cssClass) {
+ el.className = this.cssClass;
+ }
+ if (this.cssStyle) {
+ el.setAttribute('style', this.cssStyle);
+ }
+ return el;
+ },
+
+ applyToTextNode: function(textNode) {
+ var parent = textNode.parentNode;
+ if (parent.childNodes.length == 1 && rangy.dom.arrayContains(this.tagNames, parent.tagName.toLowerCase())) {
+
+ if (this.cssClass) {
+ addClass(parent, this.cssClass, this.similarClassRegExp);
+ }
+ if (this.cssStyle) {
+ addStyle(parent, this.cssStyle, this.similarStyleRegExp);
+ }
+ } else {
+ var el = this.createContainer(rangy.dom.getDocument(textNode));
+ textNode.parentNode.insertBefore(el, textNode);
+ el.appendChild(textNode);
+ }
+ },
+
+ isRemovable: function(el) {
+ return rangy.dom.arrayContains(this.tagNames, el.tagName.toLowerCase()) &&
+ wysihtml5.lang.string(el.className).trim() === "" &&
+ (
+ !el.getAttribute('style') ||
+ wysihtml5.lang.string(el.getAttribute('style')).trim() === ""
+ );
+ },
+
+ undoToTextNode: function(textNode, range, ancestorWithClass, ancestorWithStyle) {
+ var styleMode = (ancestorWithClass) ? false : true,
+ ancestor = ancestorWithClass || ancestorWithStyle,
+ styleChanged = false;
+ if (!range.containsNode(ancestor)) {
+ // Split out the portion of the ancestor from which we can remove the CSS class
+ var ancestorRange = range.cloneRange();
+ ancestorRange.selectNode(ancestor);
+
+ if (ancestorRange.isPointInRange(range.endContainer, range.endOffset) && isSplitPoint(range.endContainer, range.endOffset)) {
+ splitNodeAt(ancestor, range.endContainer, range.endOffset, this.container);
+ range.setEndAfter(ancestor);
+ }
+ if (ancestorRange.isPointInRange(range.startContainer, range.startOffset) && isSplitPoint(range.startContainer, range.startOffset)) {
+ ancestor = splitNodeAt(ancestor, range.startContainer, range.startOffset, this.container);
+ }
+ }
+
+ if (!styleMode && this.similarClassRegExp) {
+ removeClass(ancestor, this.similarClassRegExp);
+ }
+
+ if (styleMode && this.similarStyleRegExp) {
+ styleChanged = (removeOrChangeStyle(ancestor, this.cssStyle, this.similarStyleRegExp) === "change");
+ }
+ if (this.isRemovable(ancestor) && !styleChanged) {
+ replaceWithOwnChildren(ancestor);
+ }
+ },
+
+ applyToRange: function(range) {
+ var textNodes;
+ for (var ri = range.length; ri--;) {
+ textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);
+
+ if (!textNodes.length) {
+ try {
+ var node = this.createContainer(range[ri].endContainer.ownerDocument);
+ range[ri].surroundContents(node);
+ this.selectNode(range[ri], node);
+ return;
+ } catch(e) {}
+ }
+
+ range[ri].splitBoundaries();
+ textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);
+ if (textNodes.length) {
+ var textNode;
+
+ for (var i = 0, len = textNodes.length; i < len; ++i) {
+ textNode = textNodes[i];
+ if (!this.getMatchingAncestor(textNode).element) {
+ this.applyToTextNode(textNode);
+ }
+ }
+
+ range[ri].setStart(textNodes[0], 0);
+ textNode = textNodes[textNodes.length - 1];
+ range[ri].setEnd(textNode, textNode.length);
+
+ if (this.normalize) {
+ this.postApply(textNodes, range[ri]);
+ }
+ }
+
+ }
+ },
+
+ undoToRange: function(range) {
+ var textNodes, textNode, ancestorWithClass, ancestorWithStyle, ancestor;
+ for (var ri = range.length; ri--;) {
+
+ textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);
+ if (textNodes.length) {
+ range[ri].splitBoundaries();
+ textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);
+ } else {
+ var doc = range[ri].endContainer.ownerDocument,
+ node = doc.createTextNode(wysihtml5.INVISIBLE_SPACE);
+ range[ri].insertNode(node);
+ range[ri].selectNode(node);
+ textNodes = [node];
+ }
+
+ for (var i = 0, len = textNodes.length; i < len; ++i) {
+ if (range[ri].isValid()) {
+ textNode = textNodes[i];
+
+ ancestor = this.getMatchingAncestor(textNode);
+ if (ancestor.type === "style") {
+ this.undoToTextNode(textNode, range[ri], false, ancestor.element);
+ } else if (ancestor.element) {
+ this.undoToTextNode(textNode, range[ri], ancestor.element);
+ }
+ }
+ }
+
+ if (len == 1) {
+ this.selectNode(range[ri], textNodes[0]);
+ } else {
+ range[ri].setStart(textNodes[0], 0);
+ textNode = textNodes[textNodes.length - 1];
+ range[ri].setEnd(textNode, textNode.length);
+
+ if (this.normalize) {
+ this.postApply(textNodes, range[ri]);
+ }
+ }
+
+ }
+ },
+
+ selectNode: function(range, node) {
+ var isElement = node.nodeType === wysihtml5.ELEMENT_NODE,
+ canHaveHTML = "canHaveHTML" in node ? node.canHaveHTML : true,
+ content = isElement ? node.innerHTML : node.data,
+ isEmpty = (content === "" || content === wysihtml5.INVISIBLE_SPACE);
+
+ if (isEmpty && isElement && canHaveHTML) {
+ // Make sure that caret is visible in node by inserting a zero width no breaking space
+ try { node.innerHTML = wysihtml5.INVISIBLE_SPACE; } catch(e) {}
+ }
+ range.selectNodeContents(node);
+ if (isEmpty && isElement) {
+ range.collapse(false);
+ } else if (isEmpty) {
+ range.setStartAfter(node);
+ range.setEndAfter(node);
+ }
+ },
+
+ getTextSelectedByRange: function(textNode, range) {
+ var textRange = range.cloneRange();
+ textRange.selectNodeContents(textNode);
+
+ var intersectionRange = textRange.intersection(range);
+ var text = intersectionRange ? intersectionRange.toString() : "";
+ textRange.detach();
+
+ return text;
+ },
+
+ isAppliedToRange: function(range) {
+ var ancestors = [],
+ appliedType = "full",
+ ancestor, styleAncestor, textNodes;
+
+ for (var ri = range.length; ri--;) {
+
+ textNodes = range[ri].getNodes([wysihtml5.TEXT_NODE]);
+ if (!textNodes.length) {
+ ancestor = this.getMatchingAncestor(range[ri].startContainer).element;
+
+ return (ancestor) ? {
+ "elements": [ancestor],
+ "coverage": appliedType
+ } : false;
+ }
+
+ for (var i = 0, len = textNodes.length, selectedText; i < len; ++i) {
+ selectedText = this.getTextSelectedByRange(textNodes[i], range[ri]);
+ ancestor = this.getMatchingAncestor(textNodes[i]).element;
+ if (ancestor && selectedText != "") {
+ ancestors.push(ancestor);
+
+ if (wysihtml5.dom.getTextNodes(ancestor, true).length === 1) {
+ appliedType = "full";
+ } else if (appliedType === "full") {
+ appliedType = "inline";
+ }
+ } else if (!ancestor) {
+ appliedType = "partial";
+ }
+ }
+
+ }
+
+ return (ancestors.length) ? {
+ "elements": ancestors,
+ "coverage": appliedType
+ } : false;
+ },
+
+ toggleRange: function(range) {
+ var isApplied = this.isAppliedToRange(range),
+ parentsExactMatch;
+
+ if (isApplied) {
+ if (isApplied.coverage === "full") {
+ this.undoToRange(range);
+ } else if (isApplied.coverage === "inline") {
+ parentsExactMatch = areMatchingAllready(isApplied.elements, this.tagNames, this.cssStyle, this.cssClass);
+ this.undoToRange(range);
+ if (!parentsExactMatch) {
+ this.applyToRange(range);
+ }
+ } else {
+ // partial
+ if (!areMatchingAllready(isApplied.elements, this.tagNames, this.cssStyle, this.cssClass)) {
+ this.undoToRange(range);
+ }
+ this.applyToRange(range);
+ }
+ } else {
+ this.applyToRange(range);
+ }
+ }
+ };
+
+ wysihtml5.selection.HTMLApplier = HTMLApplier;
+
+})(wysihtml5, rangy);
+;/**
+ * Rich Text Query/Formatting Commands
+ *
+ * @example
+ * var commands = new wysihtml5.Commands(editor);
+ */
+wysihtml5.Commands = Base.extend(
+ /** @scope wysihtml5.Commands.prototype */ {
+ constructor: function(editor) {
+ this.editor = editor;
+ this.composer = editor.composer;
+ this.doc = this.composer.doc;
+ },
+
+ /**
+ * Check whether the browser supports the given command
+ *
+ * @param {String} command The command string which to check (eg. "bold", "italic", "insertUnorderedList")
+ * @example
+ * commands.supports("createLink");
+ */
+ support: function(command) {
+ return wysihtml5.browser.supportsCommand(this.doc, command);
+ },
+
+ /**
+ * Check whether the browser supports the given command
+ *
+ * @param {String} command The command string which to execute (eg. "bold", "italic", "insertUnorderedList")
+ * @param {String} [value] The command value parameter, needed for some commands ("createLink", "insertImage", ...), optional for commands that don't require one ("bold", "underline", ...)
+ * @example
+ * commands.exec("insertImage", "http://a1.twimg.com/profile_images/113868655/schrei_twitter_reasonably_small.jpg");
+ */
+ exec: function(command, value) {
+ var obj = wysihtml5.commands[command],
+ args = wysihtml5.lang.array(arguments).get(),
+ method = obj && obj.exec,
+ result = null;
+
+ this.editor.fire("beforecommand:composer");
+
+ if (method) {
+ args.unshift(this.composer);
+ result = method.apply(obj, args);
+ } else {
+ try {
+ // try/catch for buggy firefox
+ result = this.doc.execCommand(command, false, value);
+ } catch(e) {}
+ }
+
+ this.editor.fire("aftercommand:composer");
+ return result;
+ },
+
+ /**
+ * Check whether the current command is active
+ * If the caret is within a bold text, then calling this with command "bold" should return true
+ *
+ * @param {String} command The command string which to check (eg. "bold", "italic", "insertUnorderedList")
+ * @param {String} [commandValue] The command value parameter (eg. for "insertImage" the image src)
+ * @return {Boolean} Whether the command is active
+ * @example
+ * var isCurrentSelectionBold = commands.state("bold");
+ */
+ state: function(command, commandValue) {
+ var obj = wysihtml5.commands[command],
+ args = wysihtml5.lang.array(arguments).get(),
+ method = obj && obj.state;
+ if (method) {
+ args.unshift(this.composer);
+ return method.apply(obj, args);
+ } else {
+ try {
+ // try/catch for buggy firefox
+ return this.doc.queryCommandState(command);
+ } catch(e) {
+ return false;
+ }
+ }
+ },
+
+ /* Get command state parsed value if command has stateValue parsing function */
+ stateValue: function(command) {
+ var obj = wysihtml5.commands[command],
+ args = wysihtml5.lang.array(arguments).get(),
+ method = obj && obj.stateValue;
+ if (method) {
+ args.unshift(this.composer);
+ return method.apply(obj, args);
+ } else {
+ return false;
+ }
+ }
+});
+;wysihtml5.commands.bold = {
+ exec: function(composer, command) {
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "b");
+ },
+
+ state: function(composer, command) {
+ // element.ownerDocument.queryCommandState("bold") results:
+ // firefox: only <b>
+ // chrome: <b>, <strong>, <h1>, <h2>, ...
+ // ie: <b>, <strong>
+ // opera: <b>, <strong>
+ return wysihtml5.commands.formatInline.state(composer, command, "b");
+ }
+};
+
+;(function(wysihtml5) {
+ var undef,
+ NODE_NAME = "A",
+ dom = wysihtml5.dom;
+
+ function _format(composer, attributes) {
+ var doc = composer.doc,
+ tempClass = "_wysihtml5-temp-" + (+new Date()),
+ tempClassRegExp = /non-matching-class/g,
+ i = 0,
+ length,
+ anchors,
+ anchor,
+ hasElementChild,
+ isEmpty,
+ elementToSetCaretAfter,
+ textContent,
+ whiteSpace,
+ j;
+ wysihtml5.commands.formatInline.exec(composer, undef, NODE_NAME, tempClass, tempClassRegExp, undef, undef, true, true);
+ anchors = doc.querySelectorAll(NODE_NAME + "." + tempClass);
+ length = anchors.length;
+ for (; i<length; i++) {
+ anchor = anchors[i];
+ anchor.removeAttribute("class");
+ for (j in attributes) {
+ // Do not set attribute "text" as it is meant for setting string value if created link has no textual data
+ if (j !== "text") {
+ anchor.setAttribute(j, attributes[j]);
+ }
+ }
+ }
+
+ elementToSetCaretAfter = anchor;
+ if (length === 1) {
+ textContent = dom.getTextContent(anchor);
+ hasElementChild = !!anchor.querySelector("*");
+ isEmpty = textContent === "" || textContent === wysihtml5.INVISIBLE_SPACE;
+ if (!hasElementChild && isEmpty) {
+ dom.setTextContent(anchor, attributes.text || anchor.href);
+ whiteSpace = doc.createTextNode(" ");
+ composer.selection.setAfter(anchor);
+ dom.insert(whiteSpace).after(anchor);
+ elementToSetCaretAfter = whiteSpace;
+ }
+ }
+ composer.selection.setAfter(elementToSetCaretAfter);
+ }
+
+ // Changes attributes of links
+ function _changeLinks(composer, anchors, attributes) {
+ var oldAttrs;
+ for (var a = anchors.length; a--;) {
+
+ // Remove all old attributes
+ oldAttrs = anchors[a].attributes;
+ for (var oa = oldAttrs.length; oa--;) {
+ anchors[a].removeAttribute(oldAttrs.item(oa).name);
+ }
+
+ // Set new attributes
+ for (var j in attributes) {
+ if (attributes.hasOwnProperty(j)) {
+ anchors[a].setAttribute(j, attributes[j]);
+ }
+ }
+
+ }
+ }
+
+ wysihtml5.commands.createLink = {
+ /**
+ * TODO: Use HTMLApplier or formatInline here
+ *
+ * Turns selection into a link
+ * If selection is already a link, it just changes the attributes
+ *
+ * @example
+ * // either ...
+ * wysihtml5.commands.createLink.exec(composer, "createLink", "http://www.google.de");
+ * // ... or ...
+ * wysihtml5.commands.createLink.exec(composer, "createLink", { href: "http://www.google.de", target: "_blank" });
+ */
+ exec: function(composer, command, value) {
+ var anchors = this.state(composer, command);
+ if (anchors) {
+ // Selection contains links then change attributes of these links
+ composer.selection.executeAndRestore(function() {
+ _changeLinks(composer, anchors, value);
+ });
+ } else {
+ // Create links
+ value = typeof(value) === "object" ? value : { href: value };
+ _format(composer, value);
+ }
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatInline.state(composer, command, "A");
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var dom = wysihtml5.dom;
+
+ function _removeFormat(composer, anchors) {
+ var length = anchors.length,
+ i = 0,
+ anchor,
+ codeElement,
+ textContent;
+ for (; i<length; i++) {
+ anchor = anchors[i];
+ codeElement = dom.getParentElement(anchor, { nodeName: "code" });
+ textContent = dom.getTextContent(anchor);
+
+ // if <a> contains url-like text content, rename it to <code> to prevent re-autolinking
+ // else replace <a> with its childNodes
+ if (textContent.match(dom.autoLink.URL_REG_EXP) && !codeElement) {
+ // <code> element is used to prevent later auto-linking of the content
+ codeElement = dom.renameElement(anchor, "code");
+ } else {
+ dom.replaceWithChildNodes(anchor);
+ }
+ }
+ }
+
+ wysihtml5.commands.removeLink = {
+ /*
+ * If selection is a link, it removes the link and wraps it with a <code> element
+ * The <code> element is needed to avoid auto linking
+ *
+ * @example
+ * wysihtml5.commands.createLink.exec(composer, "removeLink");
+ */
+
+ exec: function(composer, command) {
+ var anchors = this.state(composer, command);
+ if (anchors) {
+ composer.selection.executeAndRestore(function() {
+ _removeFormat(composer, anchors);
+ });
+ }
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatInline.state(composer, command, "A");
+ }
+ };
+})(wysihtml5);
+;/**
+ * document.execCommand("fontSize") will create either inline styles (firefox, chrome) or use font tags
+ * which we don't want
+ * Instead we set a css class
+ */
+(function(wysihtml5) {
+ var REG_EXP = /wysiwyg-font-size-[0-9a-z\-]+/g;
+
+ wysihtml5.commands.fontSize = {
+ exec: function(composer, command, size) {
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "span", "wysiwyg-font-size-" + size, REG_EXP);
+ },
+
+ state: function(composer, command, size) {
+ return wysihtml5.commands.formatInline.state(composer, command, "span", "wysiwyg-font-size-" + size, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;/* In case font size adjustment to any number defined by user is preferred, we cannot use classes and must use inline styles. */
+(function(wysihtml5) {
+ var REG_EXP = /(\s|^)font-size\s*:\s*[^;\s]+;?/gi;
+
+ wysihtml5.commands.fontSizeStyle = {
+ exec: function(composer, command, size) {
+ size = (typeof(size) == "object") ? size.size : size;
+ if (!(/^\s*$/).test(size)) {
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "span", false, false, "font-size:" + size, REG_EXP);
+ }
+ },
+
+ state: function(composer, command, size) {
+ return wysihtml5.commands.formatInline.state(composer, command, "span", false, false, "font-size", REG_EXP);
+ },
+
+ stateValue: function(composer, command) {
+ var st = this.state(composer, command),
+ styleStr, fontsizeMatches,
+ val = false;
+
+ if (st && wysihtml5.lang.object(st).isArray()) {
+ st = st[0];
+ }
+ if (st) {
+ styleStr = st.getAttribute('style');
+ if (styleStr) {
+ return wysihtml5.quirks.styleParser.parseFontSize(styleStr);
+ }
+ }
+ return false;
+ }
+ };
+})(wysihtml5);
+;/**
+ * document.execCommand("foreColor") will create either inline styles (firefox, chrome) or use font tags
+ * which we don't want
+ * Instead we set a css class
+ */
+(function(wysihtml5) {
+ var REG_EXP = /wysiwyg-color-[0-9a-z]+/g;
+
+ wysihtml5.commands.foreColor = {
+ exec: function(composer, command, color) {
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "span", "wysiwyg-color-" + color, REG_EXP);
+ },
+
+ state: function(composer, command, color) {
+ return wysihtml5.commands.formatInline.state(composer, command, "span", "wysiwyg-color-" + color, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;/**
+ * document.execCommand("foreColor") will create either inline styles (firefox, chrome) or use font tags
+ * which we don't want
+ * Instead we set a css class
+ */
+(function(wysihtml5) {
+ var REG_EXP = /(\s|^)color\s*:\s*[^;\s]+;?/gi;
+
+ wysihtml5.commands.foreColorStyle = {
+ exec: function(composer, command, color) {
+ var colorVals = wysihtml5.quirks.styleParser.parseColor((typeof(color) == "object") ? "color:" + color.color : "color:" + color, "color"),
+ colString;
+
+ if (colorVals) {
+ colString = "color: rgb(" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ');';
+ if (colorVals[3] !== 1) {
+ colString += "color: rgba(" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ',' + colorVals[3] + ');';
+ }
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "span", false, false, colString, REG_EXP);
+ }
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatInline.state(composer, command, "span", false, false, "color", REG_EXP);
+ },
+
+ stateValue: function(composer, command, props) {
+ var st = this.state(composer, command),
+ colorStr;
+
+ if (st && wysihtml5.lang.object(st).isArray()) {
+ st = st[0];
+ }
+
+ if (st) {
+ colorStr = st.getAttribute('style');
+ if (colorStr) {
+ if (colorStr) {
+ val = wysihtml5.quirks.styleParser.parseColor(colorStr, "color");
+ return wysihtml5.quirks.styleParser.unparseColor(val, props);
+ }
+ }
+ }
+ return false;
+ }
+
+ };
+})(wysihtml5);
+;/* In case background adjustment to any color defined by user is preferred, we cannot use classes and must use inline styles. */
+(function(wysihtml5) {
+ var REG_EXP = /(\s|^)background-color\s*:\s*[^;\s]+;?/gi;
+
+ wysihtml5.commands.bgColorStyle = {
+ exec: function(composer, command, color) {
+ var colorVals = wysihtml5.quirks.styleParser.parseColor((typeof(color) == "object") ? "background-color:" + color.color : "background-color:" + color, "background-color"),
+ colString;
+
+ if (colorVals) {
+ colString = "background-color: rgb(" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ');';
+ if (colorVals[3] !== 1) {
+ colString += "background-color: rgba(" + colorVals[0] + ',' + colorVals[1] + ',' + colorVals[2] + ',' + colorVals[3] + ');';
+ }
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "span", false, false, colString, REG_EXP);
+ }
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatInline.state(composer, command, "span", false, false, "background-color", REG_EXP);
+ },
+
+ stateValue: function(composer, command, props) {
+ var st = this.state(composer, command),
+ colorStr,
+ val = false;
+
+ if (st && wysihtml5.lang.object(st).isArray()) {
+ st = st[0];
+ }
+
+ if (st) {
+ colorStr = st.getAttribute('style');
+ if (colorStr) {
+ val = wysihtml5.quirks.styleParser.parseColor(colorStr, "background-color");
+ return wysihtml5.quirks.styleParser.unparseColor(val, props);
+ }
+ }
+ return false;
+ }
+
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var dom = wysihtml5.dom,
+ // Following elements are grouped
+ // when the caret is within a H1 and the H4 is invoked, the H1 should turn into H4
+ // instead of creating a H4 within a H1 which would result in semantically invalid html
+ BLOCK_ELEMENTS_GROUP = ["H1", "H2", "H3", "H4", "H5", "H6", "P", "PRE", "DIV"];
+
+ /**
+ * Remove similiar classes (based on classRegExp)
+ * and add the desired class name
+ */
+ function _addClass(element, className, classRegExp) {
+ if (element.className) {
+ _removeClass(element, classRegExp);
+ element.className = wysihtml5.lang.string(element.className + " " + className).trim();
+ } else {
+ element.className = className;
+ }
+ }
+
+ function _addStyle(element, cssStyle, styleRegExp) {
+ _removeStyle(element, styleRegExp);
+ if (element.getAttribute('style')) {
+ element.setAttribute('style', wysihtml5.lang.string(element.getAttribute('style') + " " + cssStyle).trim());
+ } else {
+ element.setAttribute('style', cssStyle);
+ }
+ }
+
+ function _removeClass(element, classRegExp) {
+ var ret = classRegExp.test(element.className);
+ element.className = element.className.replace(classRegExp, "");
+ if (wysihtml5.lang.string(element.className).trim() == '') {
+ element.removeAttribute('class');
+ }
+ return ret;
+ }
+
+ function _removeStyle(element, styleRegExp) {
+ var ret = styleRegExp.test(element.getAttribute('style'));
+ element.setAttribute('style', (element.getAttribute('style') || "").replace(styleRegExp, ""));
+ if (wysihtml5.lang.string(element.getAttribute('style') || "").trim() == '') {
+ element.removeAttribute('style');
+ }
+ return ret;
+ }
+
+ function _removeLastChildIfLineBreak(node) {
+ var lastChild = node.lastChild;
+ if (lastChild && _isLineBreak(lastChild)) {
+ lastChild.parentNode.removeChild(lastChild);
+ }
+ }
+
+ function _isLineBreak(node) {
+ return node.nodeName === "BR";
+ }
+
+ /**
+ * Execute native query command
+ * and if necessary modify the inserted node's className
+ */
+ function _execCommand(doc, composer, command, nodeName, className) {
+ var ranges = composer.selection.getOwnRanges();
+ for (var i = ranges.length; i--;){
+ composer.selection.getSelection().removeAllRanges();
+ composer.selection.setSelection(ranges[i]);
+ if (className) {
+ var eventListener = dom.observe(doc, "DOMNodeInserted", function(event) {
+ var target = event.target,
+ displayStyle;
+ if (target.nodeType !== wysihtml5.ELEMENT_NODE) {
+ return;
+ }
+ displayStyle = dom.getStyle("display").from(target);
+ if (displayStyle.substr(0, 6) !== "inline") {
+ // Make sure that only block elements receive the given class
+ target.className += " " + className;
+ }
+ });
+ }
+ doc.execCommand(command, false, nodeName);
+
+ if (eventListener) {
+ eventListener.stop();
+ }
+ }
+ }
+
+ function _selectionWrap(composer, options) {
+ if (composer.selection.isCollapsed()) {
+ composer.selection.selectLine();
+ }
+
+ var surroundedNodes = composer.selection.surround(options);
+ for (var i = 0, imax = surroundedNodes.length; i < imax; i++) {
+ wysihtml5.dom.lineBreaks(surroundedNodes[i]).remove();
+ _removeLastChildIfLineBreak(surroundedNodes[i]);
+ }
+
+ // rethink restoring selection
+ // composer.selection.selectNode(element, wysihtml5.browser.displaysCaretInEmptyContentEditableCorrectly());
+ }
+
+ function _hasClasses(element) {
+ return !!wysihtml5.lang.string(element.className).trim();
+ }
+
+ function _hasStyles(element) {
+ return !!wysihtml5.lang.string(element.getAttribute('style') || '').trim();
+ }
+
+ wysihtml5.commands.formatBlock = {
+ exec: function(composer, command, nodeName, className, classRegExp, cssStyle, styleRegExp) {
+ var doc = composer.doc,
+ blockElements = this.state(composer, command, nodeName, className, classRegExp, cssStyle, styleRegExp),
+ useLineBreaks = composer.config.useLineBreaks,
+ defaultNodeName = useLineBreaks ? "DIV" : "P",
+ selectedNodes, classRemoveAction, blockRenameFound, styleRemoveAction, blockElement;
+ nodeName = typeof(nodeName) === "string" ? nodeName.toUpperCase() : nodeName;
+
+ if (blockElements.length) {
+ composer.selection.executeAndRestoreRangy(function() {
+ for (var b = blockElements.length; b--;) {
+ if (classRegExp) {
+ classRemoveAction = _removeClass(blockElements[b], classRegExp);
+ }
+ if (styleRegExp) {
+ styleRemoveAction = _removeStyle(blockElements[b], styleRegExp);
+ }
+
+ if ((styleRemoveAction || classRemoveAction) && nodeName === null && blockElements[b].nodeName != defaultNodeName) {
+ // dont rename or remove element when just setting block formating class or style
+ return;
+ }
+
+ var hasClasses = _hasClasses(blockElements[b]),
+ hasStyles = _hasStyles(blockElements[b]);
+
+ if (!hasClasses && !hasStyles && (useLineBreaks || nodeName === "P")) {
+ // Insert a line break afterwards and beforewards when there are siblings
+ // that are not of type line break or block element
+ wysihtml5.dom.lineBreaks(blockElements[b]).add();
+ dom.replaceWithChildNodes(blockElements[b]);
+ } else {
+ // Make sure that styling is kept by renaming the element to a <div> or <p> and copying over the class name
+ dom.renameElement(blockElements[b], nodeName === "P" ? "DIV" : defaultNodeName);
+ }
+ }
+ });
+
+ return;
+ }
+
+ // Find similiar block element and rename it (<h2 class="foo"></h2> => <h1 class="foo"></h1>)
+ if (nodeName === null || wysihtml5.lang.array(BLOCK_ELEMENTS_GROUP).contains(nodeName)) {
+ selectedNodes = composer.selection.findNodesInSelection(BLOCK_ELEMENTS_GROUP).concat(composer.selection.getSelectedOwnNodes());
+ composer.selection.executeAndRestoreRangy(function() {
+ for (var n = selectedNodes.length; n--;) {
+ blockElement = dom.getParentElement(selectedNodes[n], {
+ nodeName: BLOCK_ELEMENTS_GROUP
+ });
+ if (blockElement == composer.element) {
+ blockElement = null;
+ }
+ if (blockElement) {
+ // Rename current block element to new block element and add class
+ if (nodeName) {
+ blockElement = dom.renameElement(blockElement, nodeName);
+ }
+ if (className) {
+ _addClass(blockElement, className, classRegExp);
+ }
+ if (cssStyle) {
+ _addStyle(blockElement, cssStyle, styleRegExp);
+ }
+ blockRenameFound = true;
+ }
+ }
+
+ });
+
+ if (blockRenameFound) {
+ return;
+ }
+ }
+
+ _selectionWrap(composer, {
+ "nodeName": (nodeName || defaultNodeName),
+ "className": className || null,
+ "cssStyle": cssStyle || null
+ });
+ },
+
+ state: function(composer, command, nodeName, className, classRegExp, cssStyle, styleRegExp) {
+ var nodes = composer.selection.getSelectedOwnNodes(),
+ parents = [],
+ parent;
+
+ nodeName = typeof(nodeName) === "string" ? nodeName.toUpperCase() : nodeName;
+
+ //var selectedNode = composer.selection.getSelectedNode();
+ for (var i = 0, maxi = nodes.length; i < maxi; i++) {
+ parent = dom.getParentElement(nodes[i], {
+ nodeName: nodeName,
+ className: className,
+ classRegExp: classRegExp,
+ cssStyle: cssStyle,
+ styleRegExp: styleRegExp
+ });
+ if (parent && wysihtml5.lang.array(parents).indexOf(parent) == -1) {
+ parents.push(parent);
+ }
+ }
+ if (parents.length == 0) {
+ return false;
+ }
+ return parents;
+ }
+
+
+ };
+})(wysihtml5);
+;/* Formats block for as a <pre><code class="classname"></code></pre> block
+ * Useful in conjuction for sytax highlight utility: highlight.js
+ *
+ * Usage:
+ *
+ * editorInstance.composer.commands.exec("formatCode", "language-html");
+*/
+
+wysihtml5.commands.formatCode = {
+
+ exec: function(composer, command, classname) {
+ var pre = this.state(composer),
+ code, range, selectedNodes;
+ if (pre) {
+ // caret is already within a <pre><code>...</code></pre>
+ composer.selection.executeAndRestore(function() {
+ code = pre.querySelector("code");
+ wysihtml5.dom.replaceWithChildNodes(pre);
+ if (code) {
+ wysihtml5.dom.replaceWithChildNodes(code);
+ }
+ });
+ } else {
+ // Wrap in <pre><code>...</code></pre>
+ range = composer.selection.getRange();
+ selectedNodes = range.extractContents();
+ pre = composer.doc.createElement("pre");
+ code = composer.doc.createElement("code");
+
+ if (classname) {
+ code.className = classname;
+ }
+
+ pre.appendChild(code);
+ code.appendChild(selectedNodes);
+ range.insertNode(pre);
+ composer.selection.selectNode(pre);
+ }
+ },
+
+ state: function(composer) {
+ var selectedNode = composer.selection.getSelectedNode();
+ if (selectedNode && selectedNode.nodeName && selectedNode.nodeName == "PRE"&&
+ selectedNode.firstChild && selectedNode.firstChild.nodeName && selectedNode.firstChild.nodeName == "CODE") {
+ return selectedNode;
+ } else {
+ return wysihtml5.dom.getParentElement(selectedNode, { nodeName: "CODE" }) && wysihtml5.dom.getParentElement(selectedNode, { nodeName: "PRE" });
+ }
+ }
+};;/**
+ * formatInline scenarios for tag "B" (| = caret, |foo| = selected text)
+ *
+ * #1 caret in unformatted text:
+ * abcdefg|
+ * output:
+ * abcdefg<b>|</b>
+ *
+ * #2 unformatted text selected:
+ * abc|deg|h
+ * output:
+ * abc<b>|deg|</b>h
+ *
+ * #3 unformatted text selected across boundaries:
+ * ab|c <span>defg|h</span>
+ * output:
+ * ab<b>|c </b><span><b>defg</b>|h</span>
+ *
+ * #4 formatted text entirely selected
+ * <b>|abc|</b>
+ * output:
+ * |abc|
+ *
+ * #5 formatted text partially selected
+ * <b>ab|c|</b>
+ * output:
+ * <b>ab</b>|c|
+ *
+ * #6 formatted text selected across boundaries
+ * <span>ab|c</span> <b>de|fgh</b>
+ * output:
+ * <span>ab|c</span> de|<b>fgh</b>
+ */
+(function(wysihtml5) {
+ var // Treat <b> as <strong> and vice versa
+ ALIAS_MAPPING = {
+ "strong": "b",
+ "em": "i",
+ "b": "strong",
+ "i": "em"
+ },
+ htmlApplier = {};
+
+ function _getTagNames(tagName) {
+ var alias = ALIAS_MAPPING[tagName];
+ return alias ? [tagName.toLowerCase(), alias.toLowerCase()] : [tagName.toLowerCase()];
+ }
+
+ function _getApplier(tagName, className, classRegExp, cssStyle, styleRegExp, container) {
+ var identifier = tagName;
+
+ if (className) {
+ identifier += ":" + className;
+ }
+ if (cssStyle) {
+ identifier += ":" + cssStyle;
+ }
+
+ if (!htmlApplier[identifier]) {
+ htmlApplier[identifier] = new wysihtml5.selection.HTMLApplier(_getTagNames(tagName), className, classRegExp, true, cssStyle, styleRegExp, container);
+ }
+
+ return htmlApplier[identifier];
+ }
+
+ wysihtml5.commands.formatInline = {
+ exec: function(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp, dontRestoreSelect, noCleanup) {
+ var range = composer.selection.createRange(),
+ ownRanges = composer.selection.getOwnRanges();
+
+ if (!ownRanges || ownRanges.length == 0) {
+ return false;
+ }
+ composer.selection.getSelection().removeAllRanges();
+
+ _getApplier(tagName, className, classRegExp, cssStyle, styleRegExp, composer.element).toggleRange(ownRanges);
+
+ if (!dontRestoreSelect) {
+ range.setStart(ownRanges[0].startContainer, ownRanges[0].startOffset);
+ range.setEnd(
+ ownRanges[ownRanges.length - 1].endContainer,
+ ownRanges[ownRanges.length - 1].endOffset
+ );
+ composer.selection.setSelection(range);
+ composer.selection.executeAndRestore(function() {
+ if (!noCleanup) {
+ composer.cleanUp();
+ }
+ }, true, true);
+ } else if (!noCleanup) {
+ composer.cleanUp();
+ }
+ },
+
+ // Executes so that if collapsed caret is in a state and executing that state it should unformat that state
+ // It is achieved by selecting the entire state element before executing.
+ // This works on built in contenteditable inline format commands
+ execWithToggle: function(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) {
+ var that = this;
+
+ if (this.state(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) &&
+ composer.selection.isCollapsed() &&
+ !composer.selection.caretIsLastInSelection() &&
+ !composer.selection.caretIsFirstInSelection()
+ ) {
+ var state_element = that.state(composer, command, tagName, className, classRegExp)[0];
+ composer.selection.executeAndRestoreRangy(function() {
+ var parent = state_element.parentNode;
+ composer.selection.selectNode(state_element, true);
+ wysihtml5.commands.formatInline.exec(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp, true, true);
+ });
+ } else {
+ if (this.state(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) && !composer.selection.isCollapsed()) {
+ composer.selection.executeAndRestoreRangy(function() {
+ wysihtml5.commands.formatInline.exec(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp, true, true);
+ });
+ } else {
+ wysihtml5.commands.formatInline.exec(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp);
+ }
+ }
+ },
+
+ state: function(composer, command, tagName, className, classRegExp, cssStyle, styleRegExp) {
+ var doc = composer.doc,
+ aliasTagName = ALIAS_MAPPING[tagName] || tagName,
+ ownRanges, isApplied;
+
+ // Check whether the document contains a node with the desired tagName
+ if (!wysihtml5.dom.hasElementWithTagName(doc, tagName) &&
+ !wysihtml5.dom.hasElementWithTagName(doc, aliasTagName)) {
+ return false;
+ }
+
+ // Check whether the document contains a node with the desired className
+ if (className && !wysihtml5.dom.hasElementWithClassName(doc, className)) {
+ return false;
+ }
+
+ ownRanges = composer.selection.getOwnRanges();
+
+ if (!ownRanges || ownRanges.length === 0) {
+ return false;
+ }
+
+ isApplied = _getApplier(tagName, className, classRegExp, cssStyle, styleRegExp, composer.element).isAppliedToRange(ownRanges);
+
+ return (isApplied && isApplied.elements) ? isApplied.elements : false;
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+
+ wysihtml5.commands.insertBlockQuote = {
+ exec: function(composer, command) {
+ var state = this.state(composer, command),
+ endToEndParent = composer.selection.isEndToEndInNode(['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'P']),
+ prevNode, nextNode;
+
+ composer.selection.executeAndRestore(function() {
+ if (state) {
+ if (composer.config.useLineBreaks) {
+ wysihtml5.dom.lineBreaks(state).add();
+ }
+ wysihtml5.dom.unwrap(state);
+ } else {
+ if (composer.selection.isCollapsed()) {
+ composer.selection.selectLine();
+ }
+
+ if (endToEndParent) {
+ var qouteEl = endToEndParent.ownerDocument.createElement('blockquote');
+ wysihtml5.dom.insert(qouteEl).after(endToEndParent);
+ qouteEl.appendChild(endToEndParent);
+ } else {
+ composer.selection.surround({nodeName: "blockquote"});
+ }
+ }
+ });
+ },
+ state: function(composer, command) {
+ var selectedNode = composer.selection.getSelectedNode(),
+ node = wysihtml5.dom.getParentElement(selectedNode, { nodeName: "BLOCKQUOTE" }, false, composer.element);
+
+ return (node) ? node : false;
+ }
+ };
+
+})(wysihtml5);;wysihtml5.commands.insertHTML = {
+ exec: function(composer, command, html) {
+ if (composer.commands.support(command)) {
+ composer.doc.execCommand(command, false, html);
+ } else {
+ composer.selection.insertHTML(html);
+ }
+ },
+
+ state: function() {
+ return false;
+ }
+};
+;(function(wysihtml5) {
+ var NODE_NAME = "IMG";
+
+ wysihtml5.commands.insertImage = {
+ /**
+ * Inserts an <img>
+ * If selection is already an image link, it removes it
+ *
+ * @example
+ * // either ...
+ * wysihtml5.commands.insertImage.exec(composer, "insertImage", "http://www.google.de/logo.jpg");
+ * // ... or ...
+ * wysihtml5.commands.insertImage.exec(composer, "insertImage", { src: "http://www.google.de/logo.jpg", title: "foo" });
+ */
+ exec: function(composer, command, value) {
+ value = typeof(value) === "object" ? value : { src: value };
+
+ var doc = composer.doc,
+ image = this.state(composer),
+ textNode,
+ parent;
+
+ if (image) {
+ // Image already selected, set the caret before it and delete it
+ composer.selection.setBefore(image);
+ parent = image.parentNode;
+ parent.removeChild(image);
+
+ // and it's parent <a> too if it hasn't got any other relevant child nodes
+ wysihtml5.dom.removeEmptyTextNodes(parent);
+ if (parent.nodeName === "A" && !parent.firstChild) {
+ composer.selection.setAfter(parent);
+ parent.parentNode.removeChild(parent);
+ }
+
+ // firefox and ie sometimes don't remove the image handles, even though the image got removed
+ wysihtml5.quirks.redraw(composer.element);
+ return;
+ }
+
+ image = doc.createElement(NODE_NAME);
+
+ for (var i in value) {
+ image.setAttribute(i === "className" ? "class" : i, value[i]);
+ }
+
+ composer.selection.insertNode(image);
+ if (wysihtml5.browser.hasProblemsSettingCaretAfterImg()) {
+ textNode = doc.createTextNode(wysihtml5.INVISIBLE_SPACE);
+ composer.selection.insertNode(textNode);
+ composer.selection.setAfter(textNode);
+ } else {
+ composer.selection.setAfter(image);
+ }
+ },
+
+ state: function(composer) {
+ var doc = composer.doc,
+ selectedNode,
+ text,
+ imagesInSelection;
+
+ if (!wysihtml5.dom.hasElementWithTagName(doc, NODE_NAME)) {
+ return false;
+ }
+
+ selectedNode = composer.selection.getSelectedNode();
+ if (!selectedNode) {
+ return false;
+ }
+
+ if (selectedNode.nodeName === NODE_NAME) {
+ // This works perfectly in IE
+ return selectedNode;
+ }
+
+ if (selectedNode.nodeType !== wysihtml5.ELEMENT_NODE) {
+ return false;
+ }
+
+ text = composer.selection.getText();
+ text = wysihtml5.lang.string(text).trim();
+ if (text) {
+ return false;
+ }
+
+ imagesInSelection = composer.selection.getNodes(wysihtml5.ELEMENT_NODE, function(node) {
+ return node.nodeName === "IMG";
+ });
+
+ if (imagesInSelection.length !== 1) {
+ return false;
+ }
+
+ return imagesInSelection[0];
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var LINE_BREAK = "<br>" + (wysihtml5.browser.needsSpaceAfterLineBreak() ? " " : "");
+
+ wysihtml5.commands.insertLineBreak = {
+ exec: function(composer, command) {
+ if (composer.commands.support(command)) {
+ composer.doc.execCommand(command, false, null);
+ if (!wysihtml5.browser.autoScrollsToCaret()) {
+ composer.selection.scrollIntoView();
+ }
+ } else {
+ composer.commands.exec("insertHTML", LINE_BREAK);
+ }
+ },
+
+ state: function() {
+ return false;
+ }
+ };
+})(wysihtml5);
+;wysihtml5.commands.insertOrderedList = {
+ exec: function(composer, command) {
+ wysihtml5.commands.insertList.exec(composer, command, "OL");
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.insertList.state(composer, command, "OL");
+ }
+};
+;wysihtml5.commands.insertUnorderedList = {
+ exec: function(composer, command) {
+ wysihtml5.commands.insertList.exec(composer, command, "UL");
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.insertList.state(composer, command, "UL");
+ }
+};
+;wysihtml5.commands.insertList = (function(wysihtml5) {
+
+ var isNode = function(node, name) {
+ if (node && node.nodeName) {
+ if (typeof name === 'string') {
+ name = [name];
+ }
+ for (var n = name.length; n--;) {
+ if (node.nodeName === name[n]) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ var findListEl = function(node, nodeName, composer) {
+ var ret = {
+ el: null,
+ other: false
+ };
+
+ if (node) {
+ var parentLi = wysihtml5.dom.getParentElement(node, { nodeName: "LI" }),
+ otherNodeName = (nodeName === "UL") ? "OL" : "UL";
+
+ if (isNode(node, nodeName)) {
+ ret.el = node;
+ } else if (isNode(node, otherNodeName)) {
+ ret = {
+ el: node,
+ other: true
+ };
+ } else if (parentLi) {
+ if (isNode(parentLi.parentNode, nodeName)) {
+ ret.el = parentLi.parentNode;
+ } else if (isNode(parentLi.parentNode, otherNodeName)) {
+ ret = {
+ el : parentLi.parentNode,
+ other: true
+ };
+ }
+ }
+ }
+
+ // do not count list elements outside of composer
+ if (ret.el && !composer.element.contains(ret.el)) {
+ ret.el = null;
+ }
+
+ return ret;
+ };
+
+ var handleSameTypeList = function(el, nodeName, composer) {
+ var otherNodeName = (nodeName === "UL") ? "OL" : "UL",
+ otherLists, innerLists;
+ // Unwrap list
+ // <ul><li>foo</li><li>bar</li></ul>
+ // becomes:
+ // foo<br>bar<br>
+ composer.selection.executeAndRestore(function() {
+ var otherLists = getListsInSelection(otherNodeName, composer);
+ if (otherLists.length) {
+ for (var l = otherLists.length; l--;) {
+ wysihtml5.dom.renameElement(otherLists[l], nodeName.toLowerCase());
+ }
+ } else {
+ innerLists = getListsInSelection(['OL', 'UL'], composer);
+ for (var i = innerLists.length; i--;) {
+ wysihtml5.dom.resolveList(innerLists[i], composer.config.useLineBreaks);
+ }
+ wysihtml5.dom.resolveList(el, composer.config.useLineBreaks);
+ }
+ });
+ };
+
+ var handleOtherTypeList = function(el, nodeName, composer) {
+ var otherNodeName = (nodeName === "UL") ? "OL" : "UL";
+ // Turn an ordered list into an unordered list
+ // <ol><li>foo</li><li>bar</li></ol>
+ // becomes:
+ // <ul><li>foo</li><li>bar</li></ul>
+ // Also rename other lists in selection
+ composer.selection.executeAndRestore(function() {
+ var renameLists = [el].concat(getListsInSelection(otherNodeName, composer));
+
+ // All selection inner lists get renamed too
+ for (var l = renameLists.length; l--;) {
+ wysihtml5.dom.renameElement(renameLists[l], nodeName.toLowerCase());
+ }
+ });
+ };
+
+ var getListsInSelection = function(nodeName, composer) {
+ var ranges = composer.selection.getOwnRanges(),
+ renameLists = [];
+
+ for (var r = ranges.length; r--;) {
+ renameLists = renameLists.concat(ranges[r].getNodes([1], function(node) {
+ return isNode(node, nodeName);
+ }));
+ }
+
+ return renameLists;
+ };
+
+ var createListFallback = function(nodeName, composer) {
+ // Fallback for Create list
+ composer.selection.executeAndRestoreRangy(function() {
+ var tempClassName = "_wysihtml5-temp-" + new Date().getTime(),
+ tempElement = composer.selection.deblockAndSurround({
+ "nodeName": "div",
+ "className": tempClassName
+ }),
+ isEmpty, list;
+
+ // This space causes new lists to never break on enter
+ var INVISIBLE_SPACE_REG_EXP = /\uFEFF/g;
+ tempElement.innerHTML = tempElement.innerHTML.replace(INVISIBLE_SPACE_REG_EXP, "");
+
+ if (tempElement) {
+ isEmpty = wysihtml5.lang.array(["", "<br>", wysihtml5.INVISIBLE_SPACE]).contains(tempElement.innerHTML);
+ list = wysihtml5.dom.convertToList(tempElement, nodeName.toLowerCase(), composer.parent.config.uneditableContainerClassname);
+ if (isEmpty) {
+ composer.selection.selectNode(list.querySelector("li"), true);
+ }
+ }
+ });
+ };
+
+ return {
+ exec: function(composer, command, nodeName) {
+ var doc = composer.doc,
+ cmd = (nodeName === "OL") ? "insertOrderedList" : "insertUnorderedList",
+ selectedNode = composer.selection.getSelectedNode(),
+ list = findListEl(selectedNode, nodeName, composer);
+
+ if (!list.el) {
+ if (composer.commands.support(cmd)) {
+ doc.execCommand(cmd, false, null);
+ } else {
+ createListFallback(nodeName, composer);
+ }
+ } else if (list.other) {
+ handleOtherTypeList(list.el, nodeName, composer);
+ } else {
+ handleSameTypeList(list.el, nodeName, composer);
+ }
+ },
+
+ state: function(composer, command, nodeName) {
+ var selectedNode = composer.selection.getSelectedNode(),
+ list = findListEl(selectedNode, nodeName, composer);
+
+ return (list.el && !list.other) ? list.el : false;
+ }
+ };
+
+})(wysihtml5);;wysihtml5.commands.italic = {
+ exec: function(composer, command) {
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "i");
+ },
+
+ state: function(composer, command) {
+ // element.ownerDocument.queryCommandState("italic") results:
+ // firefox: only <i>
+ // chrome: <i>, <em>, <blockquote>, ...
+ // ie: <i>, <em>
+ // opera: only <i>
+ return wysihtml5.commands.formatInline.state(composer, command, "i");
+ }
+};
+;(function(wysihtml5) {
+ var CLASS_NAME = "wysiwyg-text-align-center",
+ REG_EXP = /wysiwyg-text-align-[0-9a-z]+/g;
+
+ wysihtml5.commands.justifyCenter = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var CLASS_NAME = "wysiwyg-text-align-left",
+ REG_EXP = /wysiwyg-text-align-[0-9a-z]+/g;
+
+ wysihtml5.commands.justifyLeft = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var CLASS_NAME = "wysiwyg-text-align-right",
+ REG_EXP = /wysiwyg-text-align-[0-9a-z]+/g;
+
+ wysihtml5.commands.justifyRight = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var CLASS_NAME = "wysiwyg-text-align-justify",
+ REG_EXP = /wysiwyg-text-align-[0-9a-z]+/g;
+
+ wysihtml5.commands.justifyFull = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, CLASS_NAME, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var STYLE_STR = "text-align: right;",
+ REG_EXP = /(\s|^)text-align\s*:\s*[^;\s]+;?/gi;
+
+ wysihtml5.commands.alignRightStyle = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, null, null, STYLE_STR, REG_EXP);
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, null, null, STYLE_STR, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var STYLE_STR = "text-align: left;",
+ REG_EXP = /(\s|^)text-align\s*:\s*[^;\s]+;?/gi;
+
+ wysihtml5.commands.alignLeftStyle = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, null, null, STYLE_STR, REG_EXP);
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, null, null, STYLE_STR, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;(function(wysihtml5) {
+ var STYLE_STR = "text-align: center;",
+ REG_EXP = /(\s|^)text-align\s*:\s*[^;\s]+;?/gi;
+
+ wysihtml5.commands.alignCenterStyle = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatBlock.exec(composer, "formatBlock", null, null, null, STYLE_STR, REG_EXP);
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatBlock.state(composer, "formatBlock", null, null, null, STYLE_STR, REG_EXP);
+ }
+ };
+})(wysihtml5);
+;wysihtml5.commands.redo = {
+ exec: function(composer) {
+ return composer.undoManager.redo();
+ },
+
+ state: function(composer) {
+ return false;
+ }
+};
+;wysihtml5.commands.underline = {
+ exec: function(composer, command) {
+ wysihtml5.commands.formatInline.execWithToggle(composer, command, "u");
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatInline.state(composer, command, "u");
+ }
+};
+;wysihtml5.commands.undo = {
+ exec: function(composer) {
+ return composer.undoManager.undo();
+ },
+
+ state: function(composer) {
+ return false;
+ }
+};
+;wysihtml5.commands.createTable = {
+ exec: function(composer, command, value) {
+ var col, row, html;
+ if (value && value.cols && value.rows && parseInt(value.cols, 10) > 0 && parseInt(value.rows, 10) > 0) {
+ if (value.tableStyle) {
+ html = "<table style=\"" + value.tableStyle + "\">";
+ } else {
+ html = "<table>";
+ }
+ html += "<tbody>";
+ for (row = 0; row < value.rows; row ++) {
+ html += '<tr>';
+ for (col = 0; col < value.cols; col ++) {
+ html += "<td>&nbsp;</td>";
+ }
+ html += '</tr>';
+ }
+ html += "</tbody></table>";
+ composer.commands.exec("insertHTML", html);
+ //composer.selection.insertHTML(html);
+ }
+
+
+ },
+
+ state: function(composer, command) {
+ return false;
+ }
+};
+;wysihtml5.commands.mergeTableCells = {
+ exec: function(composer, command) {
+ if (composer.tableSelection && composer.tableSelection.start && composer.tableSelection.end) {
+ if (this.state(composer, command)) {
+ wysihtml5.dom.table.unmergeCell(composer.tableSelection.start);
+ } else {
+ wysihtml5.dom.table.mergeCellsBetween(composer.tableSelection.start, composer.tableSelection.end);
+ }
+ }
+ },
+
+ state: function(composer, command) {
+ if (composer.tableSelection) {
+ var start = composer.tableSelection.start,
+ end = composer.tableSelection.end;
+ if (start && end && start == end &&
+ ((
+ wysihtml5.dom.getAttribute(start, "colspan") &&
+ parseInt(wysihtml5.dom.getAttribute(start, "colspan"), 10) > 1
+ ) || (
+ wysihtml5.dom.getAttribute(start, "rowspan") &&
+ parseInt(wysihtml5.dom.getAttribute(start, "rowspan"), 10) > 1
+ ))
+ ) {
+ return [start];
+ }
+ }
+ return false;
+ }
+};
+;wysihtml5.commands.addTableCells = {
+ exec: function(composer, command, value) {
+ if (composer.tableSelection && composer.tableSelection.start && composer.tableSelection.end) {
+
+ // switches start and end if start is bigger than end (reverse selection)
+ var tableSelect = wysihtml5.dom.table.orderSelectionEnds(composer.tableSelection.start, composer.tableSelection.end);
+ if (value == "before" || value == "above") {
+ wysihtml5.dom.table.addCells(tableSelect.start, value);
+ } else if (value == "after" || value == "below") {
+ wysihtml5.dom.table.addCells(tableSelect.end, value);
+ }
+ setTimeout(function() {
+ composer.tableSelection.select(tableSelect.start, tableSelect.end);
+ },0);
+ }
+ },
+
+ state: function(composer, command) {
+ return false;
+ }
+};
+;wysihtml5.commands.deleteTableCells = {
+ exec: function(composer, command, value) {
+ if (composer.tableSelection && composer.tableSelection.start && composer.tableSelection.end) {
+ var tableSelect = wysihtml5.dom.table.orderSelectionEnds(composer.tableSelection.start, composer.tableSelection.end),
+ idx = wysihtml5.dom.table.indexOf(tableSelect.start),
+ selCell,
+ table = composer.tableSelection.table;
+
+ wysihtml5.dom.table.removeCells(tableSelect.start, value);
+ setTimeout(function() {
+ // move selection to next or previous if not present
+ selCell = wysihtml5.dom.table.findCell(table, idx);
+
+ if (!selCell){
+ if (value == "row") {
+ selCell = wysihtml5.dom.table.findCell(table, {
+ "row": idx.row - 1,
+ "col": idx.col
+ });
+ }
+
+ if (value == "column") {
+ selCell = wysihtml5.dom.table.findCell(table, {
+ "row": idx.row,
+ "col": idx.col - 1
+ });
+ }
+ }
+ if (selCell) {
+ composer.tableSelection.select(selCell, selCell);
+ }
+ }, 0);
+
+ }
+ },
+
+ state: function(composer, command) {
+ return false;
+ }
+};
+;wysihtml5.commands.indentList = {
+ exec: function(composer, command, value) {
+ var listEls = composer.selection.getSelectionParentsByTag('LI');
+ if (listEls) {
+ return this.tryToPushLiLevel(listEls, composer.selection);
+ }
+ return false;
+ },
+
+ state: function(composer, command) {
+ return false;
+ },
+
+ tryToPushLiLevel: function(liNodes, selection) {
+ var listTag, list, prevLi, liNode, prevLiList,
+ found = false;
+
+ selection.executeAndRestoreRangy(function() {
+
+ for (var i = liNodes.length; i--;) {
+ liNode = liNodes[i];
+ listTag = (liNode.parentNode.nodeName === 'OL') ? 'OL' : 'UL';
+ list = liNode.ownerDocument.createElement(listTag);
+ prevLi = wysihtml5.dom.domNode(liNode).prev({nodeTypes: [wysihtml5.ELEMENT_NODE]});
+ prevLiList = (prevLi) ? prevLi.querySelector('ul, ol') : null;
+
+ if (prevLi) {
+ if (prevLiList) {
+ prevLiList.appendChild(liNode);
+ } else {
+ list.appendChild(liNode);
+ prevLi.appendChild(list);
+ }
+ found = true;
+ }
+ }
+
+ });
+ return found;
+ }
+};
+;wysihtml5.commands.outdentList = {
+ exec: function(composer, command, value) {
+ var listEls = composer.selection.getSelectionParentsByTag('LI');
+ if (listEls) {
+ return this.tryToPullLiLevel(listEls, composer);
+ }
+ return false;
+ },
+
+ state: function(composer, command) {
+ return false;
+ },
+
+ tryToPullLiLevel: function(liNodes, composer) {
+ var listNode, outerListNode, outerLiNode, list, prevLi, liNode, afterList,
+ found = false,
+ that = this;
+
+ composer.selection.executeAndRestoreRangy(function() {
+
+ for (var i = liNodes.length; i--;) {
+ liNode = liNodes[i];
+ if (liNode.parentNode) {
+ listNode = liNode.parentNode;
+
+ if (listNode.tagName === 'OL' || listNode.tagName === 'UL') {
+ found = true;
+
+ outerListNode = wysihtml5.dom.getParentElement(listNode.parentNode, { nodeName: ['OL', 'UL']}, false, composer.element);
+ outerLiNode = wysihtml5.dom.getParentElement(listNode.parentNode, { nodeName: ['LI']}, false, composer.element);
+
+ if (outerListNode && outerLiNode) {
+
+ if (liNode.nextSibling) {
+ afterList = that.getAfterList(listNode, liNode);
+ liNode.appendChild(afterList);
+ }
+ outerListNode.insertBefore(liNode, outerLiNode.nextSibling);
+
+ } else {
+
+ if (liNode.nextSibling) {
+ afterList = that.getAfterList(listNode, liNode);
+ liNode.appendChild(afterList);
+ }
+
+ for (var j = liNode.childNodes.length; j--;) {
+ listNode.parentNode.insertBefore(liNode.childNodes[j], listNode.nextSibling);
+ }
+
+ listNode.parentNode.insertBefore(document.createElement('br'), listNode.nextSibling);
+ liNode.parentNode.removeChild(liNode);
+
+ }
+
+ // cleanup
+ if (listNode.childNodes.length === 0) {
+ listNode.parentNode.removeChild(listNode);
+ }
+ }
+ }
+ }
+
+ });
+ return found;
+ },
+
+ getAfterList: function(listNode, liNode) {
+ var nodeName = listNode.nodeName,
+ newList = document.createElement(nodeName);
+
+ while (liNode.nextSibling) {
+ newList.appendChild(liNode.nextSibling);
+ }
+ return newList;
+ }
+
+};;/**
+ * Undo Manager for wysihtml5
+ * slightly inspired by http://rniwa.com/editing/undomanager.html#the-undomanager-interface
+ */
+(function(wysihtml5) {
+ var Z_KEY = 90,
+ Y_KEY = 89,
+ BACKSPACE_KEY = 8,
+ DELETE_KEY = 46,
+ MAX_HISTORY_ENTRIES = 25,
+ DATA_ATTR_NODE = "data-wysihtml5-selection-node",
+ DATA_ATTR_OFFSET = "data-wysihtml5-selection-offset",
+ UNDO_HTML = '<span id="_wysihtml5-undo" class="_wysihtml5-temp">' + wysihtml5.INVISIBLE_SPACE + '</span>',
+ REDO_HTML = '<span id="_wysihtml5-redo" class="_wysihtml5-temp">' + wysihtml5.INVISIBLE_SPACE + '</span>',
+ dom = wysihtml5.dom;
+
+ function cleanTempElements(doc) {
+ var tempElement;
+ while (tempElement = doc.querySelector("._wysihtml5-temp")) {
+ tempElement.parentNode.removeChild(tempElement);
+ }
+ }
+
+ wysihtml5.UndoManager = wysihtml5.lang.Dispatcher.extend(
+ /** @scope wysihtml5.UndoManager.prototype */ {
+ constructor: function(editor) {
+ this.editor = editor;
+ this.composer = editor.composer;
+ this.element = this.composer.element;
+
+ this.position = 0;
+ this.historyStr = [];
+ this.historyDom = [];
+
+ this.transact();
+
+ this._observe();
+ },
+
+ _observe: function() {
+ var that = this,
+ doc = this.composer.sandbox.getDocument(),
+ lastKey;
+
+ // Catch CTRL+Z and CTRL+Y
+ dom.observe(this.element, "keydown", function(event) {
+ if (event.altKey || (!event.ctrlKey && !event.metaKey)) {
+ return;
+ }
+
+ var keyCode = event.keyCode,
+ isUndo = keyCode === Z_KEY && !event.shiftKey,
+ isRedo = (keyCode === Z_KEY && event.shiftKey) || (keyCode === Y_KEY);
+
+ if (isUndo) {
+ that.undo();
+ event.preventDefault();
+ } else if (isRedo) {
+ that.redo();
+ event.preventDefault();
+ }
+ });
+
+ // Catch delete and backspace
+ dom.observe(this.element, "keydown", function(event) {
+ var keyCode = event.keyCode;
+ if (keyCode === lastKey) {
+ return;
+ }
+
+ lastKey = keyCode;
+
+ if (keyCode === BACKSPACE_KEY || keyCode === DELETE_KEY) {
+ that.transact();
+ }
+ });
+
+ this.editor
+ .on("newword:composer", function() {
+ that.transact();
+ })
+
+ .on("beforecommand:composer", function() {
+ that.transact();
+ });
+ },
+
+ transact: function() {
+ var previousHtml = this.historyStr[this.position - 1],
+ currentHtml = this.composer.getValue(false, false),
+ composerIsVisible = this.element.offsetWidth > 0 && this.element.offsetHeight > 0,
+ range, node, offset, element, position;
+
+ if (currentHtml === previousHtml) {
+ return;
+ }
+
+ var length = this.historyStr.length = this.historyDom.length = this.position;
+ if (length > MAX_HISTORY_ENTRIES) {
+ this.historyStr.shift();
+ this.historyDom.shift();
+ this.position--;
+ }
+
+ this.position++;
+
+ if (composerIsVisible) {
+ // Do not start saving selection if composer is not visible
+ range = this.composer.selection.getRange();
+ node = (range && range.startContainer) ? range.startContainer : this.element;
+ offset = (range && range.startOffset) ? range.startOffset : 0;
+
+ if (node.nodeType === wysihtml5.ELEMENT_NODE) {
+ element = node;
+ } else {
+ element = node.parentNode;
+ position = this.getChildNodeIndex(element, node);
+ }
+
+ element.setAttribute(DATA_ATTR_OFFSET, offset);
+ if (typeof(position) !== "undefined") {
+ element.setAttribute(DATA_ATTR_NODE, position);
+ }
+ }
+
+ var clone = this.element.cloneNode(!!currentHtml);
+ this.historyDom.push(clone);
+ this.historyStr.push(currentHtml);
+
+ if (element) {
+ element.removeAttribute(DATA_ATTR_OFFSET);
+ element.removeAttribute(DATA_ATTR_NODE);
+ }
+
+ },
+
+ undo: function() {
+ this.transact();
+
+ if (!this.undoPossible()) {
+ return;
+ }
+
+ this.set(this.historyDom[--this.position - 1]);
+ this.editor.fire("undo:composer");
+ },
+
+ redo: function() {
+ if (!this.redoPossible()) {
+ return;
+ }
+
+ this.set(this.historyDom[++this.position - 1]);
+ this.editor.fire("redo:composer");
+ },
+
+ undoPossible: function() {
+ return this.position > 1;
+ },
+
+ redoPossible: function() {
+ return this.position < this.historyStr.length;
+ },
+
+ set: function(historyEntry) {
+ this.element.innerHTML = "";
+
+ var i = 0,
+ childNodes = historyEntry.childNodes,
+ length = historyEntry.childNodes.length;
+
+ for (; i<length; i++) {
+ this.element.appendChild(childNodes[i].cloneNode(true));
+ }
+
+ // Restore selection
+ var offset,
+ node,
+ position;
+
+ if (historyEntry.hasAttribute(DATA_ATTR_OFFSET)) {
+ offset = historyEntry.getAttribute(DATA_ATTR_OFFSET);
+ position = historyEntry.getAttribute(DATA_ATTR_NODE);
+ node = this.element;
+ } else {
+ node = this.element.querySelector("[" + DATA_ATTR_OFFSET + "]") || this.element;
+ offset = node.getAttribute(DATA_ATTR_OFFSET);
+ position = node.getAttribute(DATA_ATTR_NODE);
+ node.removeAttribute(DATA_ATTR_OFFSET);
+ node.removeAttribute(DATA_ATTR_NODE);
+ }
+
+ if (position !== null) {
+ node = this.getChildNodeByIndex(node, +position);
+ }
+
+ this.composer.selection.set(node, offset);
+ },
+
+ getChildNodeIndex: function(parent, child) {
+ var i = 0,
+ childNodes = parent.childNodes,
+ length = childNodes.length;
+ for (; i<length; i++) {
+ if (childNodes[i] === child) {
+ return i;
+ }
+ }
+ },
+
+ getChildNodeByIndex: function(parent, index) {
+ return parent.childNodes[index];
+ }
+ });
+})(wysihtml5);
+;/**
+ * TODO: the following methods still need unit test coverage
+ */
+wysihtml5.views.View = Base.extend(
+ /** @scope wysihtml5.views.View.prototype */ {
+ constructor: function(parent, textareaElement, config) {
+ this.parent = parent;
+ this.element = textareaElement;
+ this.config = config;
+ if (!this.config.noTextarea) {
+ this._observeViewChange();
+ }
+ },
+
+ _observeViewChange: function() {
+ var that = this;
+ this.parent.on("beforeload", function() {
+ that.parent.on("change_view", function(view) {
+ if (view === that.name) {
+ that.parent.currentView = that;
+ that.show();
+ // Using tiny delay here to make sure that the placeholder is set before focusing
+ setTimeout(function() { that.focus(); }, 0);
+ } else {
+ that.hide();
+ }
+ });
+ });
+ },
+
+ focus: function() {
+ if (this.element.ownerDocument.querySelector(":focus") === this.element) {
+ return;
+ }
+
+ try { this.element.focus(); } catch(e) {}
+ },
+
+ hide: function() {
+ this.element.style.display = "none";
+ },
+
+ show: function() {
+ this.element.style.display = "";
+ },
+
+ disable: function() {
+ this.element.setAttribute("disabled", "disabled");
+ },
+
+ enable: function() {
+ this.element.removeAttribute("disabled");
+ }
+});
+;(function(wysihtml5) {
+ var dom = wysihtml5.dom,
+ browser = wysihtml5.browser;
+
+ wysihtml5.views.Composer = wysihtml5.views.View.extend(
+ /** @scope wysihtml5.views.Composer.prototype */ {
+ name: "composer",
+
+ // Needed for firefox in order to display a proper caret in an empty contentEditable
+ CARET_HACK: "<br>",
+
+ constructor: function(parent, editableElement, config) {
+ this.base(parent, editableElement, config);
+ if (!this.config.noTextarea) {
+ this.textarea = this.parent.textarea;
+ } else {
+ this.editableArea = editableElement;
+ }
+ if (this.config.contentEditableMode) {
+ this._initContentEditableArea();
+ } else {
+ this._initSandbox();
+ }
+ },
+
+ clear: function() {
+ this.element.innerHTML = browser.displaysCaretInEmptyContentEditableCorrectly() ? "" : this.CARET_HACK;
+ },
+
+ getValue: function(parse, clearInternals) {
+ var value = this.isEmpty() ? "" : wysihtml5.quirks.getCorrectInnerHTML(this.element);
+ if (parse !== false) {
+ value = this.parent.parse(value, (clearInternals === false) ? false : true);
+ }
+
+ return value;
+ },
+
+ setValue: function(html, parse) {
+ if (parse) {
+ html = this.parent.parse(html);
+ }
+
+ try {
+ this.element.innerHTML = html;
+ } catch (e) {
+ this.element.innerText = html;
+ }
+ },
+
+ cleanUp: function() {
+ this.parent.parse(this.element);
+ },
+
+ show: function() {
+ this.editableArea.style.display = this._displayStyle || "";
+
+ if (!this.config.noTextarea && !this.textarea.element.disabled) {
+ // Firefox needs this, otherwise contentEditable becomes uneditable
+ this.disable();
+ this.enable();
+ }
+ },
+
+ hide: function() {
+ this._displayStyle = dom.getStyle("display").from(this.editableArea);
+ if (this._displayStyle === "none") {
+ this._displayStyle = null;
+ }
+ this.editableArea.style.display = "none";
+ },
+
+ disable: function() {
+ this.parent.fire("disable:composer");
+ this.element.removeAttribute("contentEditable");
+ },
+
+ enable: function() {
+ this.parent.fire("enable:composer");
+ this.element.setAttribute("contentEditable", "true");
+ },
+
+ focus: function(setToEnd) {
+ // IE 8 fires the focus event after .focus()
+ // This is needed by our simulate_placeholder.js to work
+ // therefore we clear it ourselves this time
+ if (wysihtml5.browser.doesAsyncFocus() && this.hasPlaceholderSet()) {
+ this.clear();
+ }
+
+ this.base();
+
+ var lastChild = this.element.lastChild;
+ if (setToEnd && lastChild && this.selection) {
+ if (lastChild.nodeName === "BR") {
+ this.selection.setBefore(this.element.lastChild);
+ } else {
+ this.selection.setAfter(this.element.lastChild);
+ }
+ }
+ },
+
+ getTextContent: function() {
+ return dom.getTextContent(this.element);
+ },
+
+ hasPlaceholderSet: function() {
+ return this.getTextContent() == ((this.config.noTextarea) ? this.editableArea.getAttribute("data-placeholder") : this.textarea.element.getAttribute("placeholder")) && this.placeholderSet;
+ },
+
+ isEmpty: function() {
+ var innerHTML = this.element.innerHTML.toLowerCase();
+ return (/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i).test(innerHTML) ||
+ innerHTML === "" ||
+ innerHTML === "<br>" ||
+ innerHTML === "<p></p>" ||
+ innerHTML === "<p><br></p>" ||
+ this.hasPlaceholderSet();
+ },
+
+ _initContentEditableArea: function() {
+ var that = this;
+
+ if (this.config.noTextarea) {
+ this.sandbox = new dom.ContentEditableArea(function() {
+ that._create();
+ }, {}, this.editableArea);
+ } else {
+ this.sandbox = new dom.ContentEditableArea(function() {
+ that._create();
+ });
+ this.editableArea = this.sandbox.getContentEditable();
+ dom.insert(this.editableArea).after(this.textarea.element);
+ this._createWysiwygFormField();
+ }
+ },
+
+ _initSandbox: function() {
+ var that = this;
+
+ this.sandbox = new dom.Sandbox(function() {
+ that._create();
+ }, {
+ stylesheets: this.config.stylesheets
+ });
+ this.editableArea = this.sandbox.getIframe();
+
+ var textareaElement = this.textarea.element;
+ dom.insert(this.editableArea).after(textareaElement);
+
+ this._createWysiwygFormField();
+ },
+
+ // Creates hidden field which tells the server after submit, that the user used an wysiwyg editor
+ _createWysiwygFormField: function() {
+ if (this.textarea.element.form) {
+ var hiddenField = document.createElement("input");
+ hiddenField.type = "hidden";
+ hiddenField.name = "_wysihtml5_mode";
+ hiddenField.value = 1;
+ dom.insert(hiddenField).after(this.textarea.element);
+ }
+ },
+
+ _create: function() {
+ var that = this;
+ this.doc = this.sandbox.getDocument();
+ this.element = (this.config.contentEditableMode) ? this.sandbox.getContentEditable() : this.doc.body;
+ if (!this.config.noTextarea) {
+ this.textarea = this.parent.textarea;
+ this.element.innerHTML = this.textarea.getValue(true, false);
+ } else {
+ this.cleanUp(); // cleans contenteditable on initiation as it may contain html
+ }
+
+ // Make sure our selection handler is ready
+ this.selection = new wysihtml5.Selection(this.parent, this.element, this.config.uneditableContainerClassname);
+
+ // Make sure commands dispatcher is ready
+ this.commands = new wysihtml5.Commands(this.parent);
+
+ if (!this.config.noTextarea) {
+ dom.copyAttributes([
+ "className", "spellcheck", "title", "lang", "dir", "accessKey"
+ ]).from(this.textarea.element).to(this.element);
+ }
+
+ dom.addClass(this.element, this.config.composerClassName);
+ //
+ // Make the editor look like the original textarea, by syncing styles
+ if (this.config.style && !this.config.contentEditableMode) {
+ this.style();
+ }
+
+ this.observe();
+
+ var name = this.config.name;
+ if (name) {
+ dom.addClass(this.element, name);
+ if (!this.config.contentEditableMode) { dom.addClass(this.editableArea, name); }
+ }
+
+ this.enable();
+
+ if (!this.config.noTextarea && this.textarea.element.disabled) {
+ this.disable();
+ }
+
+ // Simulate html5 placeholder attribute on contentEditable element
+ var placeholderText = typeof(this.config.placeholder) === "string"
+ ? this.config.placeholder
+ : ((this.config.noTextarea) ? this.editableArea.getAttribute("data-placeholder") : this.textarea.element.getAttribute("placeholder"));
+ if (placeholderText) {
+ dom.simulatePlaceholder(this.parent, this, placeholderText);
+ }
+
+ // Make sure that the browser avoids using inline styles whenever possible
+ this.commands.exec("styleWithCSS", false);
+
+ this._initAutoLinking();
+ this._initObjectResizing();
+ this._initUndoManager();
+ this._initLineBreaking();
+
+ // Simulate html5 autofocus on contentEditable element
+ // This doesn't work on IOS (5.1.1)
+ if (!this.config.noTextarea && (this.textarea.element.hasAttribute("autofocus") || document.querySelector(":focus") == this.textarea.element) && !browser.isIos()) {
+ setTimeout(function() { that.focus(true); }, 100);
+ }
+
+ // IE sometimes leaves a single paragraph, which can't be removed by the user
+ if (!browser.clearsContentEditableCorrectly()) {
+ wysihtml5.quirks.ensureProperClearing(this);
+ }
+
+ // Set up a sync that makes sure that textarea and editor have the same content
+ if (this.initSync && this.config.sync) {
+ this.initSync();
+ }
+
+ // Okay hide the textarea, we are ready to go
+ if (!this.config.noTextarea) { this.textarea.hide(); }
+
+ // Fire global (before-)load event
+ this.parent.fire("beforeload").fire("load");
+ },
+
+ _initAutoLinking: function() {
+ var that = this,
+ supportsDisablingOfAutoLinking = browser.canDisableAutoLinking(),
+ supportsAutoLinking = browser.doesAutoLinkingInContentEditable();
+ if (supportsDisablingOfAutoLinking) {
+ this.commands.exec("autoUrlDetect", false);
+ }
+
+ if (!this.config.autoLink) {
+ return;
+ }
+
+ // Only do the auto linking by ourselves when the browser doesn't support auto linking
+ // OR when he supports auto linking but we were able to turn it off (IE9+)
+ if (!supportsAutoLinking || (supportsAutoLinking && supportsDisablingOfAutoLinking)) {
+ this.parent.on("newword:composer", function() {
+ if (dom.getTextContent(that.element).match(dom.autoLink.URL_REG_EXP)) {
+ that.selection.executeAndRestore(function(startContainer, endContainer) {
+ var uneditables = that.element.querySelectorAll("." + that.config.uneditableContainerClassname),
+ isInUneditable = false;
+
+ for (var i = uneditables.length; i--;) {
+ if (wysihtml5.dom.contains(uneditables[i], endContainer)) {
+ isInUneditable = true;
+ }
+ }
+
+ if (!isInUneditable) dom.autoLink(endContainer.parentNode, [that.config.uneditableContainerClassname]);
+ });
+ }
+ });
+
+ dom.observe(this.element, "blur", function() {
+ dom.autoLink(that.element, [that.config.uneditableContainerClassname]);
+ });
+ }
+
+ // Assuming we have the following:
+ // <a href="http://www.google.de">http://www.google.de</a>
+ // If a user now changes the url in the innerHTML we want to make sure that
+ // it's synchronized with the href attribute (as long as the innerHTML is still a url)
+ var // Use a live NodeList to check whether there are any links in the document
+ links = this.sandbox.getDocument().getElementsByTagName("a"),
+ // The autoLink helper method reveals a reg exp to detect correct urls
+ urlRegExp = dom.autoLink.URL_REG_EXP,
+ getTextContent = function(element) {
+ var textContent = wysihtml5.lang.string(dom.getTextContent(element)).trim();
+ if (textContent.substr(0, 4) === "www.") {
+ textContent = "http://" + textContent;
+ }
+ return textContent;
+ };
+
+ dom.observe(this.element, "keydown", function(event) {
+ if (!links.length) {
+ return;
+ }
+
+ var selectedNode = that.selection.getSelectedNode(event.target.ownerDocument),
+ link = dom.getParentElement(selectedNode, { nodeName: "A" }, 4),
+ textContent;
+
+ if (!link) {
+ return;
+ }
+
+ textContent = getTextContent(link);
+ // keydown is fired before the actual content is changed
+ // therefore we set a timeout to change the href
+ setTimeout(function() {
+ var newTextContent = getTextContent(link);
+ if (newTextContent === textContent) {
+ return;
+ }
+
+ // Only set href when new href looks like a valid url
+ if (newTextContent.match(urlRegExp)) {
+ link.setAttribute("href", newTextContent);
+ }
+ }, 0);
+ });
+ },
+
+ _initObjectResizing: function() {
+ this.commands.exec("enableObjectResizing", true);
+
+ // IE sets inline styles after resizing objects
+ // The following lines make sure that the width/height css properties
+ // are copied over to the width/height attributes
+ if (browser.supportsEvent("resizeend")) {
+ var properties = ["width", "height"],
+ propertiesLength = properties.length,
+ element = this.element;
+
+ dom.observe(element, "resizeend", function(event) {
+ var target = event.target || event.srcElement,
+ style = target.style,
+ i = 0,
+ property;
+
+ if (target.nodeName !== "IMG") {
+ return;
+ }
+
+ for (; i<propertiesLength; i++) {
+ property = properties[i];
+ if (style[property]) {
+ target.setAttribute(property, parseInt(style[property], 10));
+ style[property] = "";
+ }
+ }
+
+ // After resizing IE sometimes forgets to remove the old resize handles
+ wysihtml5.quirks.redraw(element);
+ });
+ }
+ },
+
+ _initUndoManager: function() {
+ this.undoManager = new wysihtml5.UndoManager(this.parent);
+ },
+
+ _initLineBreaking: function() {
+ var that = this,
+ USE_NATIVE_LINE_BREAK_INSIDE_TAGS = ["LI", "P", "H1", "H2", "H3", "H4", "H5", "H6"],
+ LIST_TAGS = ["UL", "OL", "MENU"];
+
+ function adjust(selectedNode) {
+ var parentElement = dom.getParentElement(selectedNode, { nodeName: ["P", "DIV"] }, 2);
+ if (parentElement && dom.contains(that.element, parentElement)) {
+ that.selection.executeAndRestore(function() {
+ if (that.config.useLineBreaks) {
+ dom.replaceWithChildNodes(parentElement);
+ } else if (parentElement.nodeName !== "P") {
+ dom.renameElement(parentElement, "p");
+ }
+ });
+ }
+ }
+
+ if (!this.config.useLineBreaks) {
+ dom.observe(this.element, ["focus", "keydown"], function() {
+ if (that.isEmpty()) {
+ var paragraph = that.doc.createElement("P");
+ that.element.innerHTML = "";
+ that.element.appendChild(paragraph);
+ if (!browser.displaysCaretInEmptyContentEditableCorrectly()) {
+ paragraph.innerHTML = "<br>";
+ that.selection.setBefore(paragraph.firstChild);
+ } else {
+ that.selection.selectNode(paragraph, true);
+ }
+ }
+ });
+ }
+
+ // Under certain circumstances Chrome + Safari create nested <p> or <hX> tags after paste
+ // Inserting an invisible white space in front of it fixes the issue
+ // This is too hacky and causes selection not to replace content on paste in chrome
+ /* if (browser.createsNestedInvalidMarkupAfterPaste()) {
+ dom.observe(this.element, "paste", function(event) {
+ var invisibleSpace = that.doc.createTextNode(wysihtml5.INVISIBLE_SPACE);
+ that.selection.insertNode(invisibleSpace);
+ });
+ }*/
+
+
+ dom.observe(this.element, "keydown", function(event) {
+ var keyCode = event.keyCode;
+
+ if (event.shiftKey) {
+ return;
+ }
+
+ if (keyCode !== wysihtml5.ENTER_KEY && keyCode !== wysihtml5.BACKSPACE_KEY) {
+ return;
+ }
+ var blockElement = dom.getParentElement(that.selection.getSelectedNode(), { nodeName: USE_NATIVE_LINE_BREAK_INSIDE_TAGS }, 4);
+ if (blockElement) {
+ setTimeout(function() {
+ // Unwrap paragraph after leaving a list or a H1-6
+ var selectedNode = that.selection.getSelectedNode(),
+ list;
+
+ if (blockElement.nodeName === "LI") {
+ if (!selectedNode) {
+ return;
+ }
+
+ list = dom.getParentElement(selectedNode, { nodeName: LIST_TAGS }, 2);
+
+ if (!list) {
+ adjust(selectedNode);
+ }
+ }
+
+ if (keyCode === wysihtml5.ENTER_KEY && blockElement.nodeName.match(/^H[1-6]$/)) {
+ adjust(selectedNode);
+ }
+ }, 0);
+ return;
+ }
+
+ if (that.config.useLineBreaks && keyCode === wysihtml5.ENTER_KEY && !wysihtml5.browser.insertsLineBreaksOnReturn()) {
+ event.preventDefault();
+ that.commands.exec("insertLineBreak");
+
+ }
+ });
+ }
+ });
+})(wysihtml5);
+;(function(wysihtml5) {
+ var dom = wysihtml5.dom,
+ doc = document,
+ win = window,
+ HOST_TEMPLATE = doc.createElement("div"),
+ /**
+ * Styles to copy from textarea to the composer element
+ */
+ TEXT_FORMATTING = [
+ "background-color",
+ "color", "cursor",
+ "font-family", "font-size", "font-style", "font-variant", "font-weight",
+ "line-height", "letter-spacing",
+ "text-align", "text-decoration", "text-indent", "text-rendering",
+ "word-break", "word-wrap", "word-spacing"
+ ],
+ /**
+ * Styles to copy from textarea to the iframe
+ */
+ BOX_FORMATTING = [
+ "background-color",
+ "border-collapse",
+ "border-bottom-color", "border-bottom-style", "border-bottom-width",
+ "border-left-color", "border-left-style", "border-left-width",
+ "border-right-color", "border-right-style", "border-right-width",
+ "border-top-color", "border-top-style", "border-top-width",
+ "clear", "display", "float",
+ "margin-bottom", "margin-left", "margin-right", "margin-top",
+ "outline-color", "outline-offset", "outline-width", "outline-style",
+ "padding-left", "padding-right", "padding-top", "padding-bottom",
+ "position", "top", "left", "right", "bottom", "z-index",
+ "vertical-align", "text-align",
+ "-webkit-box-sizing", "-moz-box-sizing", "-ms-box-sizing", "box-sizing",
+ "-webkit-box-shadow", "-moz-box-shadow", "-ms-box-shadow","box-shadow",
+ "-webkit-border-top-right-radius", "-moz-border-radius-topright", "border-top-right-radius",
+ "-webkit-border-bottom-right-radius", "-moz-border-radius-bottomright", "border-bottom-right-radius",
+ "-webkit-border-bottom-left-radius", "-moz-border-radius-bottomleft", "border-bottom-left-radius",
+ "-webkit-border-top-left-radius", "-moz-border-radius-topleft", "border-top-left-radius",
+ "width", "height"
+ ],
+ ADDITIONAL_CSS_RULES = [
+ "html { height: 100%; }",
+ "body { height: 100%; padding: 1px 0 0 0; margin: -1px 0 0 0; }",
+ "body > p:first-child { margin-top: 0; }",
+ "._wysihtml5-temp { display: none; }",
+ wysihtml5.browser.isGecko ?
+ "body.placeholder { color: graytext !important; }" :
+ "body.placeholder { color: #a9a9a9 !important; }",
+ // Ensure that user see's broken images and can delete them
+ "img:-moz-broken { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }"
+ ];
+
+ /**
+ * With "setActive" IE offers a smart way of focusing elements without scrolling them into view:
+ * http://msdn.microsoft.com/en-us/library/ms536738(v=vs.85).aspx
+ *
+ * Other browsers need a more hacky way: (pssst don't tell my mama)
+ * In order to prevent the element being scrolled into view when focusing it, we simply
+ * move it out of the scrollable area, focus it, and reset it's position
+ */
+ var focusWithoutScrolling = function(element) {
+ if (element.setActive) {
+ // Following line could cause a js error when the textarea is invisible
+ // See https://github.com/xing/wysihtml5/issues/9
+ try { element.setActive(); } catch(e) {}
+ } else {
+ var elementStyle = element.style,
+ originalScrollTop = doc.documentElement.scrollTop || doc.body.scrollTop,
+ originalScrollLeft = doc.documentElement.scrollLeft || doc.body.scrollLeft,
+ originalStyles = {
+ position: elementStyle.position,
+ top: elementStyle.top,
+ left: elementStyle.left,
+ WebkitUserSelect: elementStyle.WebkitUserSelect
+ };
+
+ dom.setStyles({
+ position: "absolute",
+ top: "-99999px",
+ left: "-99999px",
+ // Don't ask why but temporarily setting -webkit-user-select to none makes the whole thing performing smoother
+ WebkitUserSelect: "none"
+ }).on(element);
+
+ element.focus();
+
+ dom.setStyles(originalStyles).on(element);
+
+ if (win.scrollTo) {
+ // Some browser extensions unset this method to prevent annoyances
+ // "Better PopUp Blocker" for Chrome http://code.google.com/p/betterpopupblocker/source/browse/trunk/blockStart.js#100
+ // Issue: http://code.google.com/p/betterpopupblocker/issues/detail?id=1
+ win.scrollTo(originalScrollLeft, originalScrollTop);
+ }
+ }
+ };
+
+
+ wysihtml5.views.Composer.prototype.style = function() {
+ var that = this,
+ originalActiveElement = doc.querySelector(":focus"),
+ textareaElement = this.textarea.element,
+ hasPlaceholder = textareaElement.hasAttribute("placeholder"),
+ originalPlaceholder = hasPlaceholder && textareaElement.getAttribute("placeholder"),
+ originalDisplayValue = textareaElement.style.display,
+ originalDisabled = textareaElement.disabled,
+ displayValueForCopying;
+
+ this.focusStylesHost = HOST_TEMPLATE.cloneNode(false);
+ this.blurStylesHost = HOST_TEMPLATE.cloneNode(false);
+ this.disabledStylesHost = HOST_TEMPLATE.cloneNode(false);
+
+ // Remove placeholder before copying (as the placeholder has an affect on the computed style)
+ if (hasPlaceholder) {
+ textareaElement.removeAttribute("placeholder");
+ }
+
+ if (textareaElement === originalActiveElement) {
+ textareaElement.blur();
+ }
+
+ // enable for copying styles
+ textareaElement.disabled = false;
+
+ // set textarea to display="none" to get cascaded styles via getComputedStyle
+ textareaElement.style.display = displayValueForCopying = "none";
+
+ if ((textareaElement.getAttribute("rows") && dom.getStyle("height").from(textareaElement) === "auto") ||
+ (textareaElement.getAttribute("cols") && dom.getStyle("width").from(textareaElement) === "auto")) {
+ textareaElement.style.display = displayValueForCopying = originalDisplayValue;
+ }
+
+ // --------- iframe styles (has to be set before editor styles, otherwise IE9 sets wrong fontFamily on blurStylesHost) ---------
+ dom.copyStyles(BOX_FORMATTING).from(textareaElement).to(this.editableArea).andTo(this.blurStylesHost);
+
+ // --------- editor styles ---------
+ dom.copyStyles(TEXT_FORMATTING).from(textareaElement).to(this.element).andTo(this.blurStylesHost);
+
+ // --------- apply standard rules ---------
+ dom.insertCSS(ADDITIONAL_CSS_RULES).into(this.element.ownerDocument);
+
+ // --------- :disabled styles ---------
+ textareaElement.disabled = true;
+ dom.copyStyles(BOX_FORMATTING).from(textareaElement).to(this.disabledStylesHost);
+ dom.copyStyles(TEXT_FORMATTING).from(textareaElement).to(this.disabledStylesHost);
+ textareaElement.disabled = originalDisabled;
+
+ // --------- :focus styles ---------
+ textareaElement.style.display = originalDisplayValue;
+ focusWithoutScrolling(textareaElement);
+ textareaElement.style.display = displayValueForCopying;
+
+ dom.copyStyles(BOX_FORMATTING).from(textareaElement).to(this.focusStylesHost);
+ dom.copyStyles(TEXT_FORMATTING).from(textareaElement).to(this.focusStylesHost);
+
+ // reset textarea
+ textareaElement.style.display = originalDisplayValue;
+
+ dom.copyStyles(["display"]).from(textareaElement).to(this.editableArea);
+
+ // Make sure that we don't change the display style of the iframe when copying styles oblur/onfocus
+ // this is needed for when the change_view event is fired where the iframe is hidden and then
+ // the blur event fires and re-displays it
+ var boxFormattingStyles = wysihtml5.lang.array(BOX_FORMATTING).without(["display"]);
+
+ // --------- restore focus ---------
+ if (originalActiveElement) {
+ originalActiveElement.focus();
+ } else {
+ textareaElement.blur();
+ }
+
+ // --------- restore placeholder ---------
+ if (hasPlaceholder) {
+ textareaElement.setAttribute("placeholder", originalPlaceholder);
+ }
+
+ // --------- Sync focus/blur styles ---------
+ this.parent.on("focus:composer", function() {
+ dom.copyStyles(boxFormattingStyles) .from(that.focusStylesHost).to(that.editableArea);
+ dom.copyStyles(TEXT_FORMATTING) .from(that.focusStylesHost).to(that.element);
+ });
+
+ this.parent.on("blur:composer", function() {
+ dom.copyStyles(boxFormattingStyles) .from(that.blurStylesHost).to(that.editableArea);
+ dom.copyStyles(TEXT_FORMATTING) .from(that.blurStylesHost).to(that.element);
+ });
+
+ this.parent.observe("disable:composer", function() {
+ dom.copyStyles(boxFormattingStyles) .from(that.disabledStylesHost).to(that.editableArea);
+ dom.copyStyles(TEXT_FORMATTING) .from(that.disabledStylesHost).to(that.element);
+ });
+
+ this.parent.observe("enable:composer", function() {
+ dom.copyStyles(boxFormattingStyles) .from(that.blurStylesHost).to(that.editableArea);
+ dom.copyStyles(TEXT_FORMATTING) .from(that.blurStylesHost).to(that.element);
+ });
+
+ return this;
+ };
+})(wysihtml5);
+;/**
+ * Taking care of events
+ * - Simulating 'change' event on contentEditable element
+ * - Handling drag & drop logic
+ * - Catch paste events
+ * - Dispatch proprietary newword:composer event
+ * - Keyboard shortcuts
+ */
+(function(wysihtml5) {
+ var dom = wysihtml5.dom,
+ browser = wysihtml5.browser,
+ /**
+ * Map keyCodes to query commands
+ */
+ shortcuts = {
+ "66": "bold", // B
+ "73": "italic", // I
+ "85": "underline" // U
+ };
+
+ var deleteAroundEditable = function(selection, uneditable, element) {
+ // merge node with previous node from uneditable
+ var prevNode = selection.getPreviousNode(uneditable, true),
+ curNode = selection.getSelectedNode();
+
+ if (curNode.nodeType !== 1 && curNode.parentNode !== element) { curNode = curNode.parentNode; }
+ if (prevNode) {
+ if (curNode.nodeType == 1) {
+ var first = curNode.firstChild;
+
+ if (prevNode.nodeType == 1) {
+ while (curNode.firstChild) {
+ prevNode.appendChild(curNode.firstChild);
+ }
+ } else {
+ while (curNode.firstChild) {
+ uneditable.parentNode.insertBefore(curNode.firstChild, uneditable);
+ }
+ }
+ if (curNode.parentNode) {
+ curNode.parentNode.removeChild(curNode);
+ }
+ selection.setBefore(first);
+ } else {
+ if (prevNode.nodeType == 1) {
+ prevNode.appendChild(curNode);
+ } else {
+ uneditable.parentNode.insertBefore(curNode, uneditable);
+ }
+ selection.setBefore(curNode);
+ }
+ }
+ };
+
+ var handleDeleteKeyPress = function(event, selection, element, composer) {
+ if (selection.isCollapsed()) {
+ if (selection.caretIsInTheBeginnig('LI')) {
+ event.preventDefault();
+ composer.commands.exec('outdentList');
+ } else if (selection.caretIsInTheBeginnig()) {
+ event.preventDefault();
+ } else {
+
+ if (selection.caretIsFirstInSelection() &&
+ selection.getPreviousNode() &&
+ selection.getPreviousNode().nodeName &&
+ (/^H\d$/gi).test(selection.getPreviousNode().nodeName)
+ ) {
+ var prevNode = selection.getPreviousNode();
+ event.preventDefault();
+ if ((/^\s*$/).test(prevNode.textContent || prevNode.innerText)) {
+ // heading is empty
+ prevNode.parentNode.removeChild(prevNode);
+ } else {
+ var range = prevNode.ownerDocument.createRange();
+ range.selectNodeContents(prevNode);
+ range.collapse(false);
+ selection.setSelection(range);
+ }
+ }
+
+ var beforeUneditable = selection.caretIsBeforeUneditable();
+ // Do a special delete if caret would delete uneditable
+ if (beforeUneditable) {
+ event.preventDefault();
+ deleteAroundEditable(selection, beforeUneditable, element);
+ }
+ }
+ } else {
+ if (selection.containsUneditable()) {
+ event.preventDefault();
+ selection.deleteContents();
+ }
+ }
+ };
+
+ var handleTabKeyDown = function(composer, element) {
+ if (!composer.selection.isCollapsed()) {
+ composer.selection.deleteContents();
+ } else if (composer.selection.caretIsInTheBeginnig('LI')) {
+ if (composer.commands.exec('indentList')) return;
+ }
+
+ // Is &emsp; close enough to tab. Could not find enough counter arguments for now.
+ composer.commands.exec("insertHTML", "&emsp;");
+ };
+
+ wysihtml5.views.Composer.prototype.observe = function() {
+ var that = this,
+ state = this.getValue(false, false),
+ container = (this.sandbox.getIframe) ? this.sandbox.getIframe() : this.sandbox.getContentEditable(),
+ element = this.element,
+ focusBlurElement = (browser.supportsEventsInIframeCorrectly() || this.sandbox.getContentEditable) ? element : this.sandbox.getWindow(),
+ pasteEvents = ["drop", "paste", "beforepaste"],
+ interactionEvents = ["drop", "paste", "mouseup", "focus", "keyup"];
+
+ // --------- destroy:composer event ---------
+ dom.observe(container, "DOMNodeRemoved", function() {
+ clearInterval(domNodeRemovedInterval);
+ that.parent.fire("destroy:composer");
+ });
+
+ // DOMNodeRemoved event is not supported in IE 8
+ if (!browser.supportsMutationEvents()) {
+ var domNodeRemovedInterval = setInterval(function() {
+ if (!dom.contains(document.documentElement, container)) {
+ clearInterval(domNodeRemovedInterval);
+ that.parent.fire("destroy:composer");
+ }
+ }, 250);
+ }
+
+ // --------- User interaction tracking --
+
+ dom.observe(focusBlurElement, interactionEvents, function() {
+ setTimeout(function() {
+ that.parent.fire("interaction").fire("interaction:composer");
+ }, 0);
+ });
+
+
+ if (this.config.handleTables) {
+ if(!this.tableClickHandle && this.doc.execCommand && wysihtml5.browser.supportsCommand(this.doc, "enableObjectResizing") && wysihtml5.browser.supportsCommand(this.doc, "enableInlineTableEditing")) {
+ if (this.sandbox.getIframe) {
+ this.tableClickHandle = dom.observe(container , ["focus", "mouseup", "mouseover"], function() {
+ that.doc.execCommand("enableObjectResizing", false, "false");
+ that.doc.execCommand("enableInlineTableEditing", false, "false");
+ that.tableClickHandle.stop();
+ });
+ } else {
+ setTimeout(function() {
+ that.doc.execCommand("enableObjectResizing", false, "false");
+ that.doc.execCommand("enableInlineTableEditing", false, "false");
+ }, 0);
+ }
+ }
+ this.tableSelection = wysihtml5.quirks.tableCellsSelection(element, that.parent);
+ }
+
+ // --------- Focus & blur logic ---------
+ dom.observe(focusBlurElement, "focus", function(event) {
+ that.parent.fire("focus", event).fire("focus:composer", event);
+
+ // Delay storing of state until all focus handler are fired
+ // especially the one which resets the placeholder
+ setTimeout(function() { state = that.getValue(false, false); }, 0);
+ });
+
+ dom.observe(focusBlurElement, "blur", function(event) {
+ if (state !== that.getValue(false, false)) {
+ //create change event if supported (all except IE8)
+ var changeevent = event;
+ if(typeof Object.create == 'function') {
+ changeevent = Object.create(event, { type: { value: 'change' } });
+ }
+ that.parent.fire("change", changeevent).fire("change:composer", changeevent);
+ }
+ that.parent.fire("blur", event).fire("blur:composer", event);
+ });
+
+ // --------- Drag & Drop logic ---------
+ dom.observe(element, "dragenter", function() {
+ that.parent.fire("unset_placeholder");
+ });
+
+ dom.observe(element, pasteEvents, function(event) {
+ that.parent.fire(event.type, event).fire(event.type + ":composer", event);
+ });
+
+
+ if (this.config.copyedFromMarking) {
+ // If supported the copied source is based directly on selection
+ // Very useful for webkit based browsers where copy will otherwise contain a lot of code and styles based on whatever and not actually in selection.
+ dom.observe(element, "copy", function(event) {
+ if (event.clipboardData) {
+ event.clipboardData.setData("text/html", that.config.copyedFromMarking + that.selection.getHtml());
+ event.preventDefault();
+ }
+ that.parent.fire(event.type, event).fire(event.type + ":composer", event);
+ });
+ }
+
+ // --------- neword event ---------
+ dom.observe(element, "keyup", function(event) {
+ var keyCode = event.keyCode;
+ if (keyCode === wysihtml5.SPACE_KEY || keyCode === wysihtml5.ENTER_KEY) {
+ that.parent.fire("newword:composer");
+ }
+ });
+
+ this.parent.on("paste:composer", function() {
+ setTimeout(function() { that.parent.fire("newword:composer"); }, 0);
+ });
+
+ // --------- Make sure that images are selected when clicking on them ---------
+ if (!browser.canSelectImagesInContentEditable()) {
+ dom.observe(element, "mousedown", function(event) {
+ var target = event.target;
+ var allImages = element.querySelectorAll('img'),
+ notMyImages = element.querySelectorAll('.' + that.config.uneditableContainerClassname + ' img'),
+ myImages = wysihtml5.lang.array(allImages).without(notMyImages);
+
+ if (target.nodeName === "IMG" && wysihtml5.lang.array(myImages).contains(target)) {
+ that.selection.selectNode(target);
+ }
+ });
+ }
+
+ if (!browser.canSelectImagesInContentEditable()) {
+ dom.observe(element, "drop", function(event) {
+ // TODO: if I knew how to get dropped elements list from event I could limit it to only IMG element case
+ setTimeout(function() {
+ that.selection.getSelection().removeAllRanges();
+ }, 0);
+ });
+ }
+
+ if (browser.hasHistoryIssue() && browser.supportsSelectionModify()) {
+ dom.observe(element, "keydown", function(event) {
+ if (!event.metaKey && !event.ctrlKey) {
+ return;
+ }
+
+ var keyCode = event.keyCode,
+ win = element.ownerDocument.defaultView,
+ selection = win.getSelection();
+
+ if (keyCode === 37 || keyCode === 39) {
+ if (keyCode === 37) {
+ selection.modify("extend", "left", "lineboundary");
+ if (!event.shiftKey) {
+ selection.collapseToStart();
+ }
+ }
+ if (keyCode === 39) {
+ selection.modify("extend", "right", "lineboundary");
+ if (!event.shiftKey) {
+ selection.collapseToEnd();
+ }
+ }
+ event.preventDefault();
+ }
+ });
+ }
+
+ // --------- Shortcut logic ---------
+ dom.observe(element, "keydown", function(event) {
+ var keyCode = event.keyCode,
+ command = shortcuts[keyCode];
+ if ((event.ctrlKey || event.metaKey) && !event.altKey && command) {
+ that.commands.exec(command);
+ event.preventDefault();
+ }
+ if (keyCode === 8) {
+ // delete key
+ handleDeleteKeyPress(event, that.selection, element, that);
+ } else if (that.config.handleTabKey && keyCode === 9) {
+ event.preventDefault();
+ handleTabKeyDown(that, element);
+ }
+ });
+
+ // --------- Make sure that when pressing backspace/delete on selected images deletes the image and it's anchor ---------
+ dom.observe(element, "keydown", function(event) {
+ var target = that.selection.getSelectedNode(true),
+ keyCode = event.keyCode,
+ parent;
+ if (target && target.nodeName === "IMG" && (keyCode === wysihtml5.BACKSPACE_KEY || keyCode === wysihtml5.DELETE_KEY)) { // 8 => backspace, 46 => delete
+ parent = target.parentNode;
+ // delete the <img>
+ parent.removeChild(target);
+ // and it's parent <a> too if it hasn't got any other child nodes
+ if (parent.nodeName === "A" && !parent.firstChild) {
+ parent.parentNode.removeChild(parent);
+ }
+
+ setTimeout(function() { wysihtml5.quirks.redraw(element); }, 0);
+ event.preventDefault();
+ }
+ });
+
+ // --------- IE 8+9 focus the editor when the iframe is clicked (without actually firing the 'focus' event on the <body>) ---------
+ if (!this.config.contentEditableMode && browser.hasIframeFocusIssue()) {
+ dom.observe(container, "focus", function() {
+ setTimeout(function() {
+ if (that.doc.querySelector(":focus") !== that.element) {
+ that.focus();
+ }
+ }, 0);
+ });
+
+ dom.observe(this.element, "blur", function() {
+ setTimeout(function() {
+ that.selection.getSelection().removeAllRanges();
+ }, 0);
+ });
+ }
+
+ // --------- Show url in tooltip when hovering links or images ---------
+ var titlePrefixes = {
+ IMG: "Image: ",
+ A: "Link: "
+ };
+
+ dom.observe(element, "mouseover", function(event) {
+ var target = event.target,
+ nodeName = target.nodeName,
+ title;
+ if (nodeName !== "A" && nodeName !== "IMG") {
+ return;
+ }
+ var hasTitle = target.hasAttribute("title");
+ if(!hasTitle){
+ title = titlePrefixes[nodeName] + (target.getAttribute("href") || target.getAttribute("src"));
+ target.setAttribute("title", title);
+ }
+ });
+ };
+})(wysihtml5);
+;/**
+ * Class that takes care that the value of the composer and the textarea is always in sync
+ */
+(function(wysihtml5) {
+ var INTERVAL = 400;
+
+ wysihtml5.views.Synchronizer = Base.extend(
+ /** @scope wysihtml5.views.Synchronizer.prototype */ {
+
+ constructor: function(editor, textarea, composer) {
+ this.editor = editor;
+ this.textarea = textarea;
+ this.composer = composer;
+
+ this._observe();
+ },
+
+ /**
+ * Sync html from composer to textarea
+ * Takes care of placeholders
+ * @param {Boolean} shouldParseHtml Whether the html should be sanitized before inserting it into the textarea
+ */
+ fromComposerToTextarea: function(shouldParseHtml) {
+ this.textarea.setValue(wysihtml5.lang.string(this.composer.getValue(false, false)).trim(), shouldParseHtml);
+ },
+
+ /**
+ * Sync value of textarea to composer
+ * Takes care of placeholders
+ * @param {Boolean} shouldParseHtml Whether the html should be sanitized before inserting it into the composer
+ */
+ fromTextareaToComposer: function(shouldParseHtml) {
+ var textareaValue = this.textarea.getValue(false, false);
+ if (textareaValue) {
+ this.composer.setValue(textareaValue, shouldParseHtml);
+ } else {
+ this.composer.clear();
+ this.editor.fire("set_placeholder");
+ }
+ },
+
+ /**
+ * Invoke syncing based on view state
+ * @param {Boolean} shouldParseHtml Whether the html should be sanitized before inserting it into the composer/textarea
+ */
+ sync: function(shouldParseHtml) {
+ if (this.editor.currentView.name === "textarea") {
+ this.fromTextareaToComposer(shouldParseHtml);
+ } else {
+ this.fromComposerToTextarea(shouldParseHtml);
+ }
+ },
+
+ /**
+ * Initializes interval-based syncing
+ * also makes sure that on-submit the composer's content is synced with the textarea
+ * immediately when the form gets submitted
+ */
+ _observe: function() {
+ var interval,
+ that = this,
+ form = this.textarea.element.form,
+ startInterval = function() {
+ interval = setInterval(function() { that.fromComposerToTextarea(); }, INTERVAL);
+ },
+ stopInterval = function() {
+ clearInterval(interval);
+ interval = null;
+ };
+
+ startInterval();
+
+ if (form) {
+ // If the textarea is in a form make sure that after onreset and onsubmit the composer
+ // has the correct state
+ wysihtml5.dom.observe(form, "submit", function() {
+ that.sync(true);
+ });
+ wysihtml5.dom.observe(form, "reset", function() {
+ setTimeout(function() { that.fromTextareaToComposer(); }, 0);
+ });
+ }
+
+ this.editor.on("change_view", function(view) {
+ if (view === "composer" && !interval) {
+ that.fromTextareaToComposer(true);
+ startInterval();
+ } else if (view === "textarea") {
+ that.fromComposerToTextarea(true);
+ stopInterval();
+ }
+ });
+
+ this.editor.on("destroy:composer", stopInterval);
+ }
+ });
+})(wysihtml5);
+;wysihtml5.views.Textarea = wysihtml5.views.View.extend(
+ /** @scope wysihtml5.views.Textarea.prototype */ {
+ name: "textarea",
+
+ constructor: function(parent, textareaElement, config) {
+ this.base(parent, textareaElement, config);
+
+ this._observe();
+ },
+
+ clear: function() {
+ this.element.value = "";
+ },
+
+ getValue: function(parse) {
+ var value = this.isEmpty() ? "" : this.element.value;
+ if (parse !== false) {
+ value = this.parent.parse(value);
+ }
+ return value;
+ },
+
+ setValue: function(html, parse) {
+ if (parse) {
+ html = this.parent.parse(html);
+ }
+ this.element.value = html;
+ },
+
+ cleanUp: function() {
+ var html = this.parent.parse(this.element.value);
+ this.element.value = html;
+ },
+
+ hasPlaceholderSet: function() {
+ var supportsPlaceholder = wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),
+ placeholderText = this.element.getAttribute("placeholder") || null,
+ value = this.element.value,
+ isEmpty = !value;
+ return (supportsPlaceholder && isEmpty) || (value === placeholderText);
+ },
+
+ isEmpty: function() {
+ return !wysihtml5.lang.string(this.element.value).trim() || this.hasPlaceholderSet();
+ },
+
+ _observe: function() {
+ var element = this.element,
+ parent = this.parent,
+ eventMapping = {
+ focusin: "focus",
+ focusout: "blur"
+ },
+ /**
+ * Calling focus() or blur() on an element doesn't synchronously trigger the attached focus/blur events
+ * This is the case for focusin and focusout, so let's use them whenever possible, kkthxbai
+ */
+ events = wysihtml5.browser.supportsEvent("focusin") ? ["focusin", "focusout", "change"] : ["focus", "blur", "change"];
+
+ parent.on("beforeload", function() {
+ wysihtml5.dom.observe(element, events, function(event) {
+ var eventName = eventMapping[event.type] || event.type;
+ parent.fire(eventName).fire(eventName + ":textarea");
+ });
+
+ wysihtml5.dom.observe(element, ["paste", "drop"], function() {
+ setTimeout(function() { parent.fire("paste").fire("paste:textarea"); }, 0);
+ });
+ });
+ }
+});
+;/**
+ * WYSIHTML5 Editor
+ *
+ * @param {Element} editableElement Reference to the textarea which should be turned into a rich text interface
+ * @param {Object} [config] See defaultConfig object below for explanation of each individual config option
+ *
+ * @events
+ * load
+ * beforeload (for internal use only)
+ * focus
+ * focus:composer
+ * focus:textarea
+ * blur
+ * blur:composer
+ * blur:textarea
+ * change
+ * change:composer
+ * change:textarea
+ * paste
+ * paste:composer
+ * paste:textarea
+ * newword:composer
+ * destroy:composer
+ * undo:composer
+ * redo:composer
+ * beforecommand:composer
+ * aftercommand:composer
+ * enable:composer
+ * disable:composer
+ * change_view
+ */
+(function(wysihtml5) {
+ var undef;
+
+ var defaultConfig = {
+ // Give the editor a name, the name will also be set as class name on the iframe and on the iframe's body
+ name: undef,
+ // Whether the editor should look like the textarea (by adopting styles)
+ style: true,
+ // Id of the toolbar element, pass falsey value if you don't want any toolbar logic
+ toolbar: undef,
+ // Whether toolbar is displayed after init by script automatically.
+ // Can be set to false if toolobar is set to display only on editable area focus
+ showToolbarAfterInit: true,
+ // Whether urls, entered by the user should automatically become clickable-links
+ autoLink: true,
+ // Includes table editing events and cell selection tracking
+ handleTables: true,
+ // Tab key inserts tab into text as default behaviour. It can be disabled to regain keyboard navigation
+ handleTabKey: true,
+ // Object which includes parser rules to apply when html gets cleaned
+ // See parser_rules/*.js for examples
+ parserRules: { tags: { br: {}, span: {}, div: {}, p: {} }, classes: {} },
+ // Object which includes parser when the user inserts content via copy & paste. If null parserRules will be used instead
+ pasteParserRulesets: null,
+ // Parser method to use when the user inserts content
+ parser: wysihtml5.dom.parse,
+ // Class name which should be set on the contentEditable element in the created sandbox iframe, can be styled via the 'stylesheets' option
+ composerClassName: "wysihtml5-editor",
+ // Class name to add to the body when the wysihtml5 editor is supported
+ bodyClassName: "wysihtml5-supported",
+ // By default wysihtml5 will insert a <br> for line breaks, set this to false to use <p>
+ useLineBreaks: true,
+ // Array (or single string) of stylesheet urls to be loaded in the editor's iframe
+ stylesheets: [],
+ // Placeholder text to use, defaults to the placeholder attribute on the textarea element
+ placeholderText: undef,
+ // Whether the rich text editor should be rendered on touch devices (wysihtml5 >= 0.3.0 comes with basic support for iOS 5)
+ supportTouchDevices: true,
+ // Whether senseless <span> elements (empty or without attributes) should be removed/replaced with their content
+ cleanUp: true,
+ // Whether to use div instead of secure iframe
+ contentEditableMode: false,
+ // Classname of container that editor should not touch and pass through
+ // Pass false to disable
+ uneditableContainerClassname: "wysihtml5-uneditable-container",
+ // Browsers that support copied source handling will get a marking of the origin of the copied source (for determinig code cleanup rules on paste)
+ // Also copied source is based directly on selection -
+ // (very useful for webkit based browsers where copy will otherwise contain a lot of code and styles based on whatever and not actually in selection).
+ // If falsy value is passed source override is also disabled
+ copyedFromMarking: '<meta name="copied-from" content="wysihtml5">'
+ };
+
+ wysihtml5.Editor = wysihtml5.lang.Dispatcher.extend(
+ /** @scope wysihtml5.Editor.prototype */ {
+ constructor: function(editableElement, config) {
+ this.editableElement = typeof(editableElement) === "string" ? document.getElementById(editableElement) : editableElement;
+ this.config = wysihtml5.lang.object({}).merge(defaultConfig).merge(config).get();
+ this._isCompatible = wysihtml5.browser.supported();
+
+ if (this.editableElement.nodeName.toLowerCase() != "textarea") {
+ this.config.contentEditableMode = true;
+ this.config.noTextarea = true;
+ }
+ if (!this.config.noTextarea) {
+ this.textarea = new wysihtml5.views.Textarea(this, this.editableElement, this.config);
+ this.currentView = this.textarea;
+ }
+
+ // Sort out unsupported/unwanted browsers here
+ if (!this._isCompatible || (!this.config.supportTouchDevices && wysihtml5.browser.isTouchDevice())) {
+ var that = this;
+ setTimeout(function() { that.fire("beforeload").fire("load"); }, 0);
+ return;
+ }
+
+ // Add class name to body, to indicate that the editor is supported
+ wysihtml5.dom.addClass(document.body, this.config.bodyClassName);
+
+ this.composer = new wysihtml5.views.Composer(this, this.editableElement, this.config);
+ this.currentView = this.composer;
+
+ if (typeof(this.config.parser) === "function") {
+ this._initParser();
+ }
+
+ this.on("beforeload", this.handleBeforeLoad);
+ },
+
+ handleBeforeLoad: function() {
+ if (!this.config.noTextarea) {
+ this.synchronizer = new wysihtml5.views.Synchronizer(this, this.textarea, this.composer);
+ }
+ if (this.config.toolbar) {
+ this.toolbar = new wysihtml5.toolbar.Toolbar(this, this.config.toolbar, this.config.showToolbarAfterInit);
+ }
+ },
+
+ isCompatible: function() {
+ return this._isCompatible;
+ },
+
+ clear: function() {
+ this.currentView.clear();
+ return this;
+ },
+
+ getValue: function(parse, clearInternals) {
+ return this.currentView.getValue(parse, clearInternals);
+ },
+
+ setValue: function(html, parse) {
+ this.fire("unset_placeholder");
+
+ if (!html) {
+ return this.clear();
+ }
+
+ this.currentView.setValue(html, parse);
+ return this;
+ },
+
+ cleanUp: function() {
+ this.currentView.cleanUp();
+ },
+
+ focus: function(setToEnd) {
+ this.currentView.focus(setToEnd);
+ return this;
+ },
+
+ /**
+ * Deactivate editor (make it readonly)
+ */
+ disable: function() {
+ this.currentView.disable();
+ return this;
+ },
+
+ /**
+ * Activate editor
+ */
+ enable: function() {
+ this.currentView.enable();
+ return this;
+ },
+
+ isEmpty: function() {
+ return this.currentView.isEmpty();
+ },
+
+ hasPlaceholderSet: function() {
+ return this.currentView.hasPlaceholderSet();
+ },
+
+ parse: function(htmlOrElement, clearInternals) {
+ var parseContext = (this.config.contentEditableMode) ? document : ((this.composer) ? this.composer.sandbox.getDocument() : null);
+ var returnValue = this.config.parser(htmlOrElement, {
+ "rules": this.config.parserRules,
+ "cleanUp": this.config.cleanUp,
+ "context": parseContext,
+ "uneditableClass": this.config.uneditableContainerClassname,
+ "clearInternals" : clearInternals
+ });
+ if (typeof(htmlOrElement) === "object") {
+ wysihtml5.quirks.redraw(htmlOrElement);
+ }
+ return returnValue;
+ },
+
+ /**
+ * Prepare html parser logic
+ * - Observes for paste and drop
+ */
+ _initParser: function() {
+ var that = this,
+ oldHtml,
+ cleanHtml;
+
+ if (wysihtml5.browser.supportsModenPaste()) {
+ this.on("paste:composer", function(event) {
+ event.preventDefault();
+ oldHtml = wysihtml5.dom.getPastedHtml(event);
+ if (oldHtml) {
+ that._cleanAndPaste(oldHtml);
+ }
+ });
+
+ } else {
+ this.on("beforepaste:composer", function(event) {
+ event.preventDefault();
+ wysihtml5.dom.getPastedHtmlWithDiv(that.composer, function(pastedHTML) {
+ if (pastedHTML) {
+ that._cleanAndPaste(pastedHTML);
+ }
+ });
+ });
+
+ }
+ },
+
+ _cleanAndPaste: function (oldHtml) {
+ var cleanHtml = wysihtml5.quirks.cleanPastedHTML(oldHtml, {
+ "referenceNode": this.composer.element,
+ "rules": this.config.pasteParserRulesets || [{"set": this.config.parserRules}],
+ "uneditableClass": this.config.uneditableContainerClassname
+ });
+ this.composer.selection.deleteContents();
+ this.composer.selection.insertHTML(cleanHtml);
+ }
+ });
+})(wysihtml5);
+;/**
+ * Toolbar Dialog
+ *
+ * @param {Element} link The toolbar link which causes the dialog to show up
+ * @param {Element} container The dialog container
+ *
+ * @example
+ * <!-- Toolbar link -->
+ * <a data-wysihtml5-command="insertImage">insert an image</a>
+ *
+ * <!-- Dialog -->
+ * <div data-wysihtml5-dialog="insertImage" style="display: none;">
+ * <label>
+ * URL: <input data-wysihtml5-dialog-field="src" value="http://">
+ * </label>
+ * <label>
+ * Alternative text: <input data-wysihtml5-dialog-field="alt" value="">
+ * </label>
+ * </div>
+ *
+ * <script>
+ * var dialog = new wysihtml5.toolbar.Dialog(
+ * document.querySelector("[data-wysihtml5-command='insertImage']"),
+ * document.querySelector("[data-wysihtml5-dialog='insertImage']")
+ * );
+ * dialog.observe("save", function(attributes) {
+ * // do something
+ * });
+ * </script>
+ */
+(function(wysihtml5) {
+ var dom = wysihtml5.dom,
+ CLASS_NAME_OPENED = "wysihtml5-command-dialog-opened",
+ SELECTOR_FORM_ELEMENTS = "input, select, textarea",
+ SELECTOR_FIELDS = "[data-wysihtml5-dialog-field]",
+ ATTRIBUTE_FIELDS = "data-wysihtml5-dialog-field";
+
+
+ wysihtml5.toolbar.Dialog = wysihtml5.lang.Dispatcher.extend(
+ /** @scope wysihtml5.toolbar.Dialog.prototype */ {
+ constructor: function(link, container) {
+ this.link = link;
+ this.container = container;
+ },
+
+ _observe: function() {
+ if (this._observed) {
+ return;
+ }
+
+ var that = this,
+ callbackWrapper = function(event) {
+ var attributes = that._serialize();
+ if (attributes == that.elementToChange) {
+ that.fire("edit", attributes);
+ } else {
+ that.fire("save", attributes);
+ }
+ that.hide();
+ event.preventDefault();
+ event.stopPropagation();
+ };
+
+ dom.observe(that.link, "click", function() {
+ if (dom.hasClass(that.link, CLASS_NAME_OPENED)) {
+ setTimeout(function() { that.hide(); }, 0);
+ }
+ });
+
+ dom.observe(this.container, "keydown", function(event) {
+ var keyCode = event.keyCode;
+ if (keyCode === wysihtml5.ENTER_KEY) {
+ callbackWrapper(event);
+ }
+ if (keyCode === wysihtml5.ESCAPE_KEY) {
+ that.fire("cancel");
+ that.hide();
+ }
+ });
+
+ dom.delegate(this.container, "[data-wysihtml5-dialog-action=save]", "click", callbackWrapper);
+
+ dom.delegate(this.container, "[data-wysihtml5-dialog-action=cancel]", "click", function(event) {
+ that.fire("cancel");
+ that.hide();
+ event.preventDefault();
+ event.stopPropagation();
+ });
+
+ var formElements = this.container.querySelectorAll(SELECTOR_FORM_ELEMENTS),
+ i = 0,
+ length = formElements.length,
+ _clearInterval = function() { clearInterval(that.interval); };
+ for (; i<length; i++) {
+ dom.observe(formElements[i], "change", _clearInterval);
+ }
+
+ this._observed = true;
+ },
+
+ /**
+ * Grabs all fields in the dialog and puts them in key=>value style in an object which
+ * then gets returned
+ */
+ _serialize: function() {
+ var data = this.elementToChange || {},
+ fields = this.container.querySelectorAll(SELECTOR_FIELDS),
+ length = fields.length,
+ i = 0;
+
+ for (; i<length; i++) {
+ data[fields[i].getAttribute(ATTRIBUTE_FIELDS)] = fields[i].value;
+ }
+ return data;
+ },
+
+ /**
+ * Takes the attributes of the "elementToChange"
+ * and inserts them in their corresponding dialog input fields
+ *
+ * Assume the "elementToChange" looks like this:
+ * <a href="http://www.google.com" target="_blank">foo</a>
+ *
+ * and we have the following dialog:
+ * <input type="text" data-wysihtml5-dialog-field="href" value="">
+ * <input type="text" data-wysihtml5-dialog-field="target" value="">
+ *
+ * after calling _interpolate() the dialog will look like this
+ * <input type="text" data-wysihtml5-dialog-field="href" value="http://www.google.com">
+ * <input type="text" data-wysihtml5-dialog-field="target" value="_blank">
+ *
+ * Basically it adopted the attribute values into the corresponding input fields
+ *
+ */
+ _interpolate: function(avoidHiddenFields) {
+ var field,
+ fieldName,
+ newValue,
+ focusedElement = document.querySelector(":focus"),
+ fields = this.container.querySelectorAll(SELECTOR_FIELDS),
+ length = fields.length,
+ i = 0;
+ for (; i<length; i++) {
+ field = fields[i];
+
+ // Never change elements where the user is currently typing in
+ if (field === focusedElement) {
+ continue;
+ }
+
+ // Don't update hidden fields
+ // See https://github.com/xing/wysihtml5/pull/14
+ if (avoidHiddenFields && field.type === "hidden") {
+ continue;
+ }
+
+ fieldName = field.getAttribute(ATTRIBUTE_FIELDS);
+ newValue = (this.elementToChange && typeof(this.elementToChange) !== 'boolean') ? (this.elementToChange.getAttribute(fieldName) || "") : field.defaultValue;
+ field.value = newValue;
+ }
+ },
+
+ /**
+ * Show the dialog element
+ */
+ show: function(elementToChange) {
+ if (dom.hasClass(this.link, CLASS_NAME_OPENED)) {
+ return;
+ }
+
+ var that = this,
+ firstField = this.container.querySelector(SELECTOR_FORM_ELEMENTS);
+ this.elementToChange = elementToChange;
+ this._observe();
+ this._interpolate();
+ if (elementToChange) {
+ this.interval = setInterval(function() { that._interpolate(true); }, 500);
+ }
+ dom.addClass(this.link, CLASS_NAME_OPENED);
+ this.container.style.display = "";
+ this.fire("show");
+ if (firstField && !elementToChange) {
+ try {
+ firstField.focus();
+ } catch(e) {}
+ }
+ },
+
+ /**
+ * Hide the dialog element
+ */
+ hide: function() {
+ clearInterval(this.interval);
+ this.elementToChange = null;
+ dom.removeClass(this.link, CLASS_NAME_OPENED);
+ this.container.style.display = "none";
+ this.fire("hide");
+ }
+ });
+})(wysihtml5);
+;/**
+ * Converts speech-to-text and inserts this into the editor
+ * As of now (2011/03/25) this only is supported in Chrome >= 11
+ *
+ * Note that it sends the recorded audio to the google speech recognition api:
+ * http://stackoverflow.com/questions/4361826/does-chrome-have-buil-in-speech-recognition-for-input-type-text-x-webkit-speec
+ *
+ * Current HTML5 draft can be found here
+ * http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html
+ *
+ * "Accessing Google Speech API Chrome 11"
+ * http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/
+ */
+(function(wysihtml5) {
+ var dom = wysihtml5.dom;
+
+ var linkStyles = {
+ position: "relative"
+ };
+
+ var wrapperStyles = {
+ left: 0,
+ margin: 0,
+ opacity: 0,
+ overflow: "hidden",
+ padding: 0,
+ position: "absolute",
+ top: 0,
+ zIndex: 1
+ };
+
+ var inputStyles = {
+ cursor: "inherit",
+ fontSize: "50px",
+ height: "50px",
+ marginTop: "-25px",
+ outline: 0,
+ padding: 0,
+ position: "absolute",
+ right: "-4px",
+ top: "50%"
+ };
+
+ var inputAttributes = {
+ "x-webkit-speech": "",
+ "speech": ""
+ };
+
+ wysihtml5.toolbar.Speech = function(parent, link) {
+ var input = document.createElement("input");
+ if (!wysihtml5.browser.supportsSpeechApiOn(input)) {
+ link.style.display = "none";
+ return;
+ }
+ var lang = parent.editor.textarea.element.getAttribute("lang");
+ if (lang) {
+ inputAttributes.lang = lang;
+ }
+
+ var wrapper = document.createElement("div");
+
+ wysihtml5.lang.object(wrapperStyles).merge({
+ width: link.offsetWidth + "px",
+ height: link.offsetHeight + "px"
+ });
+
+ dom.insert(input).into(wrapper);
+ dom.insert(wrapper).into(link);
+
+ dom.setStyles(inputStyles).on(input);
+ dom.setAttributes(inputAttributes).on(input);
+
+ dom.setStyles(wrapperStyles).on(wrapper);
+ dom.setStyles(linkStyles).on(link);
+
+ var eventName = "onwebkitspeechchange" in input ? "webkitspeechchange" : "speechchange";
+ dom.observe(input, eventName, function() {
+ parent.execCommand("insertText", input.value);
+ input.value = "";
+ });
+
+ dom.observe(input, "click", function(event) {
+ if (dom.hasClass(link, "wysihtml5-command-disabled")) {
+ event.preventDefault();
+ }
+
+ event.stopPropagation();
+ });
+ };
+})(wysihtml5);
+;/**
+ * Toolbar
+ *
+ * @param {Object} parent Reference to instance of Editor instance
+ * @param {Element} container Reference to the toolbar container element
+ *
+ * @example
+ * <div id="toolbar">
+ * <a data-wysihtml5-command="createLink">insert link</a>
+ * <a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1">insert h1</a>
+ * </div>
+ *
+ * <script>
+ * var toolbar = new wysihtml5.toolbar.Toolbar(editor, document.getElementById("toolbar"));
+ * </script>
+ */
+(function(wysihtml5) {
+ var CLASS_NAME_COMMAND_DISABLED = "wysihtml5-command-disabled",
+ CLASS_NAME_COMMANDS_DISABLED = "wysihtml5-commands-disabled",
+ CLASS_NAME_COMMAND_ACTIVE = "wysihtml5-command-active",
+ CLASS_NAME_ACTION_ACTIVE = "wysihtml5-action-active",
+ dom = wysihtml5.dom;
+
+ wysihtml5.toolbar.Toolbar = Base.extend(
+ /** @scope wysihtml5.toolbar.Toolbar.prototype */ {
+ constructor: function(editor, container, showOnInit) {
+ this.editor = editor;
+ this.container = typeof(container) === "string" ? document.getElementById(container) : container;
+ this.composer = editor.composer;
+
+ this._getLinks("command");
+ this._getLinks("action");
+
+ this._observe();
+ if (showOnInit) { this.show(); }
+
+ if (editor.config.classNameCommandDisabled != null) {
+ CLASS_NAME_COMMAND_DISABLED = editor.config.classNameCommandDisabled;
+ }
+ if (editor.config.classNameCommandsDisabled != null) {
+ CLASS_NAME_COMMANDS_DISABLED = editor.config.classNameCommandsDisabled;
+ }
+ if (editor.config.classNameCommandActive != null) {
+ CLASS_NAME_COMMAND_ACTIVE = editor.config.classNameCommandActive;
+ }
+ if (editor.config.classNameActionActive != null) {
+ CLASS_NAME_ACTION_ACTIVE = editor.config.classNameActionActive;
+ }
+
+ var speechInputLinks = this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),
+ length = speechInputLinks.length,
+ i = 0;
+ for (; i<length; i++) {
+ new wysihtml5.toolbar.Speech(this, speechInputLinks[i]);
+ }
+ },
+
+ _getLinks: function(type) {
+ var links = this[type + "Links"] = wysihtml5.lang.array(this.container.querySelectorAll("[data-wysihtml5-" + type + "]")).get(),
+ length = links.length,
+ i = 0,
+ mapping = this[type + "Mapping"] = {},
+ link,
+ group,
+ name,
+ value,
+ dialog;
+ for (; i<length; i++) {
+ link = links[i];
+ name = link.getAttribute("data-wysihtml5-" + type);
+ value = link.getAttribute("data-wysihtml5-" + type + "-value");
+ group = this.container.querySelector("[data-wysihtml5-" + type + "-group='" + name + "']");
+ dialog = this._getDialog(link, name);
+
+ mapping[name + ":" + value] = {
+ link: link,
+ group: group,
+ name: name,
+ value: value,
+ dialog: dialog,
+ state: false
+ };
+ }
+ },
+
+ _getDialog: function(link, command) {
+ var that = this,
+ dialogElement = this.container.querySelector("[data-wysihtml5-dialog='" + command + "']"),
+ dialog,
+ caretBookmark;
+
+ if (dialogElement) {
+ if (wysihtml5.toolbar["Dialog_" + command]) {
+ dialog = new wysihtml5.toolbar["Dialog_" + command](link, dialogElement);
+ } else {
+ dialog = new wysihtml5.toolbar.Dialog(link, dialogElement);
+ }
+
+ dialog.on("show", function() {
+ caretBookmark = that.composer.selection.getBookmark();
+
+ that.editor.fire("show:dialog", { command: command, dialogContainer: dialogElement, commandLink: link });
+ });
+
+ dialog.on("save", function(attributes) {
+ if (caretBookmark) {
+ that.composer.selection.setBookmark(caretBookmark);
+ }
+ that._execCommand(command, attributes);
+
+ that.editor.fire("save:dialog", { command: command, dialogContainer: dialogElement, commandLink: link });
+ });
+
+ dialog.on("cancel", function() {
+ that.editor.focus(false);
+ that.editor.fire("cancel:dialog", { command: command, dialogContainer: dialogElement, commandLink: link });
+ });
+ }
+ return dialog;
+ },
+
+ /**
+ * @example
+ * var toolbar = new wysihtml5.Toolbar();
+ * // Insert a <blockquote> element or wrap current selection in <blockquote>
+ * toolbar.execCommand("formatBlock", "blockquote");
+ */
+ execCommand: function(command, commandValue) {
+ if (this.commandsDisabled) {
+ return;
+ }
+
+ var commandObj = this.commandMapping[command + ":" + commandValue];
+
+ // Show dialog when available
+ if (commandObj && commandObj.dialog && !commandObj.state) {
+ commandObj.dialog.show();
+ } else {
+ this._execCommand(command, commandValue);
+ }
+ },
+
+ _execCommand: function(command, commandValue) {
+ // Make sure that composer is focussed (false => don't move caret to the end)
+ this.editor.focus(false);
+
+ this.composer.commands.exec(command, commandValue);
+ this._updateLinkStates();
+ },
+
+ execAction: function(action) {
+ var editor = this.editor;
+ if (action === "change_view") {
+ if (editor.textarea) {
+ if (editor.currentView === editor.textarea) {
+ editor.fire("change_view", "composer");
+ } else {
+ editor.fire("change_view", "textarea");
+ }
+ }
+ }
+ if (action == "showSource") {
+ editor.fire("showSource");
+ }
+ },
+
+ _observe: function() {
+ var that = this,
+ editor = this.editor,
+ container = this.container,
+ links = this.commandLinks.concat(this.actionLinks),
+ length = links.length,
+ i = 0;
+
+ for (; i<length; i++) {
+ // 'javascript:;' and unselectable=on Needed for IE, but done in all browsers to make sure that all get the same css applied
+ // (you know, a:link { ... } doesn't match anchors with missing href attribute)
+ if (links[i].nodeName === "A") {
+ dom.setAttributes({
+ href: "javascript:;",
+ unselectable: "on"
+ }).on(links[i]);
+ } else {
+ dom.setAttributes({ unselectable: "on" }).on(links[i]);
+ }
+ }
+
+ // Needed for opera and chrome
+ dom.delegate(container, "[data-wysihtml5-command], [data-wysihtml5-action]", "mousedown", function(event) { event.preventDefault(); });
+
+ dom.delegate(container, "[data-wysihtml5-command]", "click", function(event) {
+ var link = this,
+ command = link.getAttribute("data-wysihtml5-command"),
+ commandValue = link.getAttribute("data-wysihtml5-command-value");
+ that.execCommand(command, commandValue);
+ event.preventDefault();
+ });
+
+ dom.delegate(container, "[data-wysihtml5-action]", "click", function(event) {
+ var action = this.getAttribute("data-wysihtml5-action");
+ that.execAction(action);
+ event.preventDefault();
+ });
+
+ editor.on("interaction:composer", function() {
+ that._updateLinkStates();
+ });
+
+ editor.on("focus:composer", function() {
+ that.bookmark = null;
+ });
+
+ if (this.editor.config.handleTables) {
+ editor.on("tableselect:composer", function() {
+ that.container.querySelectorAll('[data-wysihtml5-hiddentools="table"]')[0].style.display = "";
+ });
+ editor.on("tableunselect:composer", function() {
+ that.container.querySelectorAll('[data-wysihtml5-hiddentools="table"]')[0].style.display = "none";
+ });
+ }
+
+ editor.on("change_view", function(currentView) {
+ // Set timeout needed in order to let the blur event fire first
+ if (editor.textarea) {
+ setTimeout(function() {
+ that.commandsDisabled = (currentView !== "composer");
+ that._updateLinkStates();
+ if (that.commandsDisabled) {
+ dom.addClass(container, CLASS_NAME_COMMANDS_DISABLED);
+ } else {
+ dom.removeClass(container, CLASS_NAME_COMMANDS_DISABLED);
+ }
+ }, 0);
+ }
+ });
+ },
+
+ _updateLinkStates: function() {
+
+ var commandMapping = this.commandMapping,
+ actionMapping = this.actionMapping,
+ i,
+ state,
+ action,
+ command;
+ // every millisecond counts... this is executed quite often
+ for (i in commandMapping) {
+ command = commandMapping[i];
+ if (this.commandsDisabled) {
+ state = false;
+ dom.removeClass(command.link, CLASS_NAME_COMMAND_ACTIVE);
+ if (command.group) {
+ dom.removeClass(command.group, CLASS_NAME_COMMAND_ACTIVE);
+ }
+ if (command.dialog) {
+ command.dialog.hide();
+ }
+ } else {
+ state = this.composer.commands.state(command.name, command.value);
+ dom.removeClass(command.link, CLASS_NAME_COMMAND_DISABLED);
+ if (command.group) {
+ dom.removeClass(command.group, CLASS_NAME_COMMAND_DISABLED);
+ }
+ }
+ if (command.state === state) {
+ continue;
+ }
+
+ command.state = state;
+ if (state) {
+ dom.addClass(command.link, CLASS_NAME_COMMAND_ACTIVE);
+ if (command.group) {
+ dom.addClass(command.group, CLASS_NAME_COMMAND_ACTIVE);
+ }
+ if (command.dialog) {
+ if (typeof(state) === "object" || wysihtml5.lang.object(state).isArray()) {
+
+ if (!command.dialog.multiselect && wysihtml5.lang.object(state).isArray()) {
+ // Grab first and only object/element in state array, otherwise convert state into boolean
+ // to avoid showing a dialog for multiple selected elements which may have different attributes
+ // eg. when two links with different href are selected, the state will be an array consisting of both link elements
+ // but the dialog interface can only update one
+ state = state.length === 1 ? state[0] : true;
+ command.state = state;
+ }
+ command.dialog.show(state);
+ } else {
+ command.dialog.hide();
+ }
+ }
+ } else {
+ dom.removeClass(command.link, CLASS_NAME_COMMAND_ACTIVE);
+ if (command.group) {
+ dom.removeClass(command.group, CLASS_NAME_COMMAND_ACTIVE);
+ }
+ if (command.dialog) {
+ command.dialog.hide();
+ }
+ }
+ }
+
+ for (i in actionMapping) {
+ action = actionMapping[i];
+
+ if (action.name === "change_view") {
+ action.state = this.editor.currentView === this.editor.textarea;
+ if (action.state) {
+ dom.addClass(action.link, CLASS_NAME_ACTION_ACTIVE);
+ } else {
+ dom.removeClass(action.link, CLASS_NAME_ACTION_ACTIVE);
+ }
+ }
+ }
+ },
+
+ show: function() {
+ this.container.style.display = "";
+ },
+
+ hide: function() {
+ this.container.style.display = "none";
+ }
+ });
+
+})(wysihtml5);
+;(function(wysihtml5) {
+ wysihtml5.toolbar.Dialog_createTable = wysihtml5.toolbar.Dialog.extend({
+ show: function(elementToChange) {
+ this.base(elementToChange);
+
+ }
+
+ });
+})(wysihtml5);
+;(function(wysihtml5) {
+ var dom = wysihtml5.dom,
+ SELECTOR_FIELDS = "[data-wysihtml5-dialog-field]",
+ ATTRIBUTE_FIELDS = "data-wysihtml5-dialog-field";
+
+ wysihtml5.toolbar.Dialog_foreColorStyle = wysihtml5.toolbar.Dialog.extend({
+ multiselect: true,
+
+ _serialize: function() {
+ var data = {},
+ fields = this.container.querySelectorAll(SELECTOR_FIELDS),
+ length = fields.length,
+ i = 0;
+
+ for (; i<length; i++) {
+ data[fields[i].getAttribute(ATTRIBUTE_FIELDS)] = fields[i].value;
+ }
+ return data;
+ },
+
+ _interpolate: function(avoidHiddenFields) {
+ var field,
+ fieldName,
+ newValue,
+ focusedElement = document.querySelector(":focus"),
+ fields = this.container.querySelectorAll(SELECTOR_FIELDS),
+ length = fields.length,
+ i = 0,
+ firstElement = (this.elementToChange) ? ((wysihtml5.lang.object(this.elementToChange).isArray()) ? this.elementToChange[0] : this.elementToChange) : null,
+ colorStr = (firstElement) ? firstElement.getAttribute('style') : null,
+ color = (colorStr) ? wysihtml5.quirks.styleParser.parseColor(colorStr, "color") : null;
+
+ for (; i<length; i++) {
+ field = fields[i];
+ // Never change elements where the user is currently typing in
+ if (field === focusedElement) {
+ continue;
+ }
+ // Don't update hidden fields3
+ if (avoidHiddenFields && field.type === "hidden") {
+ continue;
+ }
+ if (field.getAttribute(ATTRIBUTE_FIELDS) === "color") {
+ if (color) {
+ if (color[3] && color[3] != 1) {
+ field.value = "rgba(" + color[0] + "," + color[1] + "," + color[2] + "," + color[3] + ");";
+ } else {
+ field.value = "rgb(" + color[0] + "," + color[1] + "," + color[2] + ");";
+ }
+ } else {
+ field.value = "rgb(0,0,0);";
+ }
+ }
+ }
+ }
+
+ });
+})(wysihtml5);
+;(function(wysihtml5) {
+ var dom = wysihtml5.dom,
+ SELECTOR_FIELDS = "[data-wysihtml5-dialog-field]",
+ ATTRIBUTE_FIELDS = "data-wysihtml5-dialog-field";
+
+ wysihtml5.toolbar.Dialog_fontSizeStyle = wysihtml5.toolbar.Dialog.extend({
+ multiselect: true,
+
+ _serialize: function() {
+ return {"size" : this.container.querySelector('[data-wysihtml5-dialog-field="size"]').value};
+ },
+
+ _interpolate: function(avoidHiddenFields) {
+ var focusedElement = document.querySelector(":focus"),
+ field = this.container.querySelector("[data-wysihtml5-dialog-field='size']"),
+ firstElement = (this.elementToChange) ? ((wysihtml5.lang.object(this.elementToChange).isArray()) ? this.elementToChange[0] : this.elementToChange) : null,
+ styleStr = (firstElement) ? firstElement.getAttribute('style') : null,
+ size = (styleStr) ? wysihtml5.quirks.styleParser.parseFontSize(styleStr) : null;
+
+ if (field && field !== focusedElement && size && !(/^\s*$/).test(size)) {
+ field.value = size;
+ }
+ }
+
+ });
+})(wysihtml5);
+/*!
+
+ 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
+*/
+var Handlebars=function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return h[a]||"&amp;"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof g?a.toString():a||0===a?(a=""+a,j.test(a)?a.replace(i,b):a):""}function e(a){return a||0===a?m(a)&&0===a.length?!0:!1:!0}var f={},g=a,h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i=/[&<>"'`]/g,j=/[&<>"'`]/;f.extend=c;var k=Object.prototype.toString;f.toString=k;var l=function(a){return"function"==typeof a};l(/x/)&&(l=function(a){return"function"==typeof a&&"[object Function]"===k.call(a)});var l;f.isFunction=l;var m=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===k.call(a):!1};return f.isArray=m,f.escapeExpression=d,f.isEmpty=e,f}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=new Error,b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(a){if(2===arguments.length)return void 0;throw new h("Missing helper: '"+a+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse||function(){},e=c.fn;return m(b)&&(b=b.call(this)),b===!0?e(this):b===!1||null==b?d(this):l(b)?b.length>0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper("each",function(a,b){var c,d=b.fn,e=b.inverse,f=0,g="";if(m(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(l(a))for(var h=a.length;h>f;f++)c&&(c.index=f,c.first=0===f,c.last=f===a.length-1),g+=d(a[f],{data:c});else for(var i in a)a.hasOwnProperty(i)&&(c&&(c.key=i,c.index=f,c.first=0===f),g+=d(a[i],{data:c}),f++);return 0===f&&(g=e(this)),g}),a.registerHelper("if",function(a,b){return m(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||g.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){return m(a)&&(a=a.call(this)),g.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){p.log(a,b)}var f={},g=a,h=b,i="1.3.0";f.VERSION=i;var j=4;f.COMPILER_REVISION=j;var k={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};f.REVISION_CHANGES=k;var l=g.isArray,m=g.isFunction,n=g.toString,o="[object Object]";f.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:p,log:e,registerHelper:function(a,b,c){if(n.call(a)===o){if(c||b)throw new h("Arg not supported with multiple helpers");g.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){n.call(a)===o?g.extend(this.partials,a):this.partials[a]=b}};var p={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(p.level<=a){var c=p.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};f.logger=p,f.log=e;var q=function(a){var b={};return g.extend(b,a),b};return f.createFrame=q,f}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");var c=function(a,c,d,e,f,g){var h=b.VM.invokePartial.apply(this,arguments);if(null!=h)return h;if(b.compile){var i={helpers:e,partials:f,data:g};return f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,i)}throw new l("The partial "+c+" could not be compiled when running in runtime-only mode")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){e=e||{};var f,g,h=e.partial?e:b;e.partial||(f=e.helpers,g=e.partials);var i=a.call(d,h,c,f,g,e.data);return e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,g):void 0}function i(){return""}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e);return f}();this["wysihtml5"] = this["wysihtml5"] || {};
+this["wysihtml5"]["tpl"] = this["wysihtml5"]["tpl"] || {};
+
+this["wysihtml5"]["tpl"]["blockquote"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+function program3(depth0,data) {
+
+
+ return " \n <span class=\"fa fa-quote-left\"></span>\n ";
+ }
+
+function program5(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-quote\"></span>\n ";
+ }
+
+ buffer += "<li>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"blockquote\" data-wysihtml5-display-format-name=\"false\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n</li>\n";
+ return buffer;
+ });
+
+this["wysihtml5"]["tpl"]["color"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+ buffer += "<li class=\"dropdown\">\n <a class=\"btn btn-default dropdown-toggle ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\" data-toggle=\"dropdown\" tabindex=\"-1\">\n <span class=\"current-color\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.black)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</span>\n <b class=\"caret\"></b>\n </a>\n <ul class=\"dropdown-menu\">\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"black\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"black\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.black)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"silver\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"silver\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.silver)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"gray\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"gray\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.gray)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"maroon\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"maroon\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.maroon)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"red\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"red\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.red)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"purple\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"purple\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.purple)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"green\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"green\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.green)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"olive\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"olive\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.olive)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"navy\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"navy\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.navy)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"blue\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"blue\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.blue)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><div class=\"wysihtml5-colors\" data-wysihtml5-command-value=\"orange\"></div><a class=\"wysihtml5-colors-title\" data-wysihtml5-command=\"foreColor\" data-wysihtml5-command-value=\"orange\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.colours)),stack1 == null || stack1 === false ? stack1 : stack1.orange)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n </ul>\n</li>\n";
+ return buffer;
+ });
+
+this["wysihtml5"]["tpl"]["emphasis"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+function program3(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"small\" title=\"CTRL+S\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.small)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n ";
+ return buffer;
+ }
+
+ buffer += "<li>\n <div class=\"btn-group\">\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"bold\" title=\"CTRL+B\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.bold)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"italic\" title=\"CTRL+I\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.italic)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"underline\" title=\"CTRL+U\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.underline)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.emphasis)),stack1 == null || stack1 === false ? stack1 : stack1.small), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </div>\n</li>\n";
+ return buffer;
+ });
+
+this["wysihtml5"]["tpl"]["font-styles"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+function program3(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-font\"></span>\n ";
+ }
+
+function program5(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-font\"></span>\n ";
+ }
+
+ buffer += "<li class=\"dropdown\">\n <a class=\"btn btn-default dropdown-toggle ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\" data-toggle=\"dropdown\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n <span class=\"current-font\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.normal)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</span>\n <b class=\"caret\"></b>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"p\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.normal)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"h1\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h1)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"h2\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h2)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"h3\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h3)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"h4\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h4)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"h5\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h5)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n <li><a data-wysihtml5-command=\"formatBlock\" data-wysihtml5-command-value=\"h6\" tabindex=\"-1\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.font_styles)),stack1 == null || stack1 === false ? stack1 : stack1.h6)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a></li>\n </ul>\n</li>\n";
+ return buffer;
+ });
+
+this["wysihtml5"]["tpl"]["html"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+function program3(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-pencil\"></span>\n ";
+ }
+
+function program5(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-pencil\"></span>\n ";
+ }
+
+ buffer += "<li>\n <div class=\"btn-group\">\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-action=\"change_view\" title=\""
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.html)),stack1 == null || stack1 === false ? stack1 : stack1.edit)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n </div>\n</li>\n";
+ return buffer;
+ });
+
+this["wysihtml5"]["tpl"]["image"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+
+ return "modal-sm";
+ }
+
+function program3(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+function program5(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-file-image-o\"></span>\n ";
+ }
+
+function program7(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-picture\"></span>\n ";
+ }
+
+ buffer += "<li>\n <div class=\"bootstrap-wysihtml5-insert-image-modal modal fade\" data-wysihtml5-dialog=\"insertImage\">\n <div class=\"modal-dialog ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.smallmodals), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <a class=\"close\" data-dismiss=\"modal\">&times;</a>\n <h3>"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</h3>\n </div>\n <div class=\"modal-body\">\n <div class=\"form-group\">\n <input value=\"http://\" class=\"bootstrap-wysihtml5-insert-image-url form-control\" data-wysihtml5-dialog-field=\"src\">\n </div> \n </div>\n <div class=\"modal-footer\">\n <a class=\"btn btn-default\" data-dismiss=\"modal\" data-wysihtml5-dialog-action=\"cancel\" href=\"#\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.cancel)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n <a class=\"btn btn-primary\" data-dismiss=\"modal\" data-wysihtml5-dialog-action=\"save\" href=\"#\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n </div>\n </div>\n </div>\n </div>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"insertImage\" title=\""
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.image)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n</li>\n";
+ return buffer;
+ });
+
+this["wysihtml5"]["tpl"]["link"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+
+ return "modal-sm";
+ }
+
+function program3(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+function program5(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-share-square-o\"></span>\n ";
+ }
+
+function program7(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-share\"></span>\n ";
+ }
+
+ buffer += "<li>\n <div class=\"bootstrap-wysihtml5-insert-link-modal modal fade\" data-wysihtml5-dialog=\"createLink\">\n <div class=\"modal-dialog ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.smallmodals), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <a class=\"close\" data-dismiss=\"modal\">&times;</a>\n <h3>"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</h3>\n </div>\n <div class=\"modal-body\">\n <div class=\"form-group\">\n <input value=\"http://\" class=\"bootstrap-wysihtml5-insert-link-url form-control\" data-wysihtml5-dialog-field=\"href\">\n </div> \n <div class=\"checkbox\">\n <label> \n <input type=\"checkbox\" class=\"bootstrap-wysihtml5-insert-link-target\" checked>"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.target)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\n </label>\n </div>\n </div>\n <div class=\"modal-footer\">\n <a class=\"btn btn-default\" data-dismiss=\"modal\" data-wysihtml5-dialog-action=\"cancel\" href=\"#\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.cancel)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n <a href=\"#\" class=\"btn btn-primary\" data-dismiss=\"modal\" data-wysihtml5-dialog-action=\"save\">"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "</a>\n </div>\n </div>\n </div>\n </div>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"createLink\" title=\""
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.link)),stack1 == null || stack1 === false ? stack1 : stack1.insert)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n</li>\n";
+ return buffer;
+ });
+
+this["wysihtml5"]["tpl"]["lists"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
+ this.compilerInfo = [4,'>= 1.0.0'];
+helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
+ var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this;
+
+function program1(depth0,data) {
+
+ var buffer = "", stack1;
+ buffer += "btn-"
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1));
+ return buffer;
+ }
+
+function program3(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-list-ul\"></span>\n ";
+ }
+
+function program5(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-list\"></span>\n ";
+ }
+
+function program7(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-list-ol\"></span>\n ";
+ }
+
+function program9(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-th-list\"></span>\n ";
+ }
+
+function program11(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-outdent\"></span>\n ";
+ }
+
+function program13(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-indent-right\"></span>\n ";
+ }
+
+function program15(depth0,data) {
+
+
+ return "\n <span class=\"fa fa-indent\"></span>\n ";
+ }
+
+function program17(depth0,data) {
+
+
+ return "\n <span class=\"glyphicon glyphicon-indent-left\"></span>\n ";
+ }
+
+ buffer += "<li>\n <div class=\"btn-group\">\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"insertUnorderedList\" title=\""
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.unordered)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"insertOrderedList\" title=\""
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.ordered)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(9, program9, data),fn:self.program(7, program7, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"Outdent\" title=\""
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.outdent)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(13, program13, data),fn:self.program(11, program11, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n <a class=\"btn ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.size), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += " btn-default\" data-wysihtml5-command=\"Indent\" title=\""
+ + escapeExpression(((stack1 = ((stack1 = ((stack1 = (depth0 && depth0.locale)),stack1 == null || stack1 === false ? stack1 : stack1.lists)),stack1 == null || stack1 === false ? stack1 : stack1.indent)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ + "\" tabindex=\"-1\">\n ";
+ stack1 = helpers['if'].call(depth0, ((stack1 = ((stack1 = (depth0 && depth0.options)),stack1 == null || stack1 === false ? stack1 : stack1.toolbar)),stack1 == null || stack1 === false ? stack1 : stack1.fa), {hash:{},inverse:self.program(17, program17, data),fn:self.program(15, program15, data),data:data});
+ if(stack1 || stack1 === 0) { buffer += stack1; }
+ buffer += "\n </a>\n </div>\n</li>\n";
+ return buffer;
+ });(function (factory) {
+ 'use strict';
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define('bootstrap.wysihtml5', ['jquery', 'wysihtml5', 'bootstrap', 'bootstrap.wysihtml5.templates', 'bootstrap.wysihtml5.commands'], factory);
+ } else {
+ // Browser globals
+ factory(jQuery, wysihtml5); // jshint ignore:line
+ }
+}(function ($, wysihtml5) {
+ 'use strict';
+ var bsWysihtml5 = function($, wysihtml5) {
+
+ var templates = function(key, locale, options) {
+ if(wysihtml5.tpl[key]) {
+ return wysihtml5.tpl[key]({locale: locale, options: options});
+ }
+ };
+
+ var Wysihtml5 = function(el, options) {
+ this.el = el;
+ var toolbarOpts = $.extend(true, {}, defaultOptions, options);
+ for(var t in toolbarOpts.customTemplates) {
+ if (toolbarOpts.customTemplates.hasOwnProperty(t)) {
+ wysihtml5.tpl[t] = toolbarOpts.customTemplates[t];
+ }
+ }
+ this.toolbar = this.createToolbar(el, toolbarOpts);
+ this.editor = this.createEditor(toolbarOpts);
+ };
+
+ Wysihtml5.prototype = {
+
+ constructor: Wysihtml5,
+
+ createEditor: function(options) {
+ options = options || {};
+
+ // Add the toolbar to a clone of the options object so multiple instances
+ // of the WYISYWG don't break because 'toolbar' is already defined
+ options = $.extend(true, {}, options);
+ options.toolbar = this.toolbar[0];
+
+ this.initializeEditor(this.el[0], options);
+ },
+
+
+ initializeEditor: function(el, options) {
+ var editor = new wysihtml5.Editor(this.el[0], options);
+
+ editor.on('beforeload', this.syncBootstrapDialogEvents);
+ editor.on('beforeload', this.loadParserRules);
+
+ // #30 - body is in IE 10 not created by default, which leads to nullpointer
+ // 2014/02/13 - adapted to wysihtml5-0.4, does not work in IE
+ if(editor.composer.editableArea.contentDocument) {
+ this.addMoreShortcuts(editor,
+ editor.composer.editableArea.contentDocument.body || editor.composer.editableArea.contentDocument,
+ options.shortcuts);
+ } else {
+ this.addMoreShortcuts(editor, editor.composer.editableArea, options.shortcuts);
+ }
+
+ if(options && options.events) {
+ for(var eventName in options.events) {
+ if (options.events.hasOwnProperty(eventName)) {
+ editor.on(eventName, options.events[eventName]);
+ }
+ }
+ }
+
+ return editor;
+ },
+
+ loadParserRules: function() {
+ if($.type(this.config.parserRules) === 'string') {
+ $.ajax({
+ dataType: 'json',
+ url: this.config.parserRules,
+ context: this,
+ error: function (jqXHR, textStatus, errorThrown) {
+ console.log(errorThrown);
+ },
+ success: function (parserRules) {
+ this.config.parserRules = parserRules;
+ console.log('parserrules loaded');
+ }
+ });
+ }
+
+ if(this.config.pasteParserRulesets && $.type(this.config.pasteParserRulesets) === 'string') {
+ $.ajax({
+ dataType: 'json',
+ url: this.config.pasteParserRulesets,
+ context: this,
+ error: function (jqXHR, textStatus, errorThrown) {
+ console.log(errorThrown);
+ },
+ success: function (pasteParserRulesets) {
+ this.config.pasteParserRulesets = pasteParserRulesets;
+ }
+ });
+ }
+ },
+
+ //sync wysihtml5 events for dialogs with bootstrap events
+ syncBootstrapDialogEvents: function() {
+ var editor = this;
+ $.map(this.toolbar.commandMapping, function(value) {
+ return [value];
+ }).filter(function(commandObj) {
+ return commandObj.dialog;
+ }).map(function(commandObj) {
+ return commandObj.dialog;
+ }).forEach(function(dialog) {
+ dialog.on('show', function() {
+ $(this.container).modal('show');
+ });
+ dialog.on('hide', function() {
+ $(this.container).modal('hide');
+ setTimeout(editor.composer.focus, 0);
+ });
+ $(dialog.container).on('shown.bs.modal', function () {
+ $(this).find('input, select, textarea').first().focus();
+ });
+ });
+ this.on('change_view', function() {
+ $(this.toolbar.container.children).find('a.btn').not('[data-wysihtml5-action="change_view"]').toggleClass('disabled');
+ });
+ },
+
+ createToolbar: function(el, options) {
+ var self = this;
+ var toolbar = $('<ul/>', {
+ 'class' : 'wysihtml5-toolbar',
+ 'style': 'display:none'
+ });
+ var culture = options.locale || defaultOptions.locale || 'en';
+ if(!locale.hasOwnProperty(culture)) {
+ console.debug('Locale \'' + culture + '\' not found. Available locales are: ' + Object.keys(locale) + '. Falling back to \'en\'.');
+ culture = 'en';
+ }
+ var localeObject = $.extend(true, {}, locale.en, locale[culture]);
+ for(var key in options.toolbar) {
+ if(options.toolbar[key]) {
+ toolbar.append(templates(key, localeObject, options));
+ }
+ }
+
+ toolbar.find('a[data-wysihtml5-command="formatBlock"]').click(function(e) {
+ var target = e.delegateTarget || e.target || e.srcElement,
+ el = $(target),
+ showformat = el.data('wysihtml5-display-format-name'),
+ formatname = el.data('wysihtml5-format-name') || el.html();
+ if(showformat === undefined || showformat === 'true') {
+ self.toolbar.find('.current-font').text(formatname);
+ }
+ });
+
+ toolbar.find('a[data-wysihtml5-command="foreColor"]').click(function(e) {
+ var target = e.target || e.srcElement;
+ var el = $(target);
+ self.toolbar.find('.current-color').text(el.html());
+ });
+
+ this.el.before(toolbar);
+
+ return toolbar;
+ },
+
+ addMoreShortcuts: function(editor, el, shortcuts) {
+ /* some additional shortcuts */
+ wysihtml5.dom.observe(el, 'keydown', function(event) {
+ var keyCode = event.keyCode,
+ command = shortcuts[keyCode];
+ if ((event.ctrlKey || event.metaKey || event.altKey) && command && wysihtml5.commands[command]) {
+ var commandObj = editor.toolbar.commandMapping[command + ':null'];
+ if (commandObj && commandObj.dialog && !commandObj.state) {
+ commandObj.dialog.show();
+ } else {
+ wysihtml5.commands[command].exec(editor.composer, command);
+ }
+ event.preventDefault();
+ }
+ });
+ }
+ };
+
+ // these define our public api
+ var methods = {
+ resetDefaults: function() {
+ $.fn.wysihtml5.defaultOptions = $.extend(true, {}, $.fn.wysihtml5.defaultOptionsCache);
+ },
+ bypassDefaults: function(options) {
+ return this.each(function () {
+ var $this = $(this);
+ $this.data('wysihtml5', new Wysihtml5($this, options));
+ });
+ },
+ shallowExtend: function (options) {
+ var settings = $.extend({}, $.fn.wysihtml5.defaultOptions, options || {}, $(this).data());
+ var that = this;
+ return methods.bypassDefaults.apply(that, [settings]);
+ },
+ deepExtend: function(options) {
+ var settings = $.extend(true, {}, $.fn.wysihtml5.defaultOptions, options || {});
+ var that = this;
+ return methods.bypassDefaults.apply(that, [settings]);
+ },
+ init: function(options) {
+ var that = this;
+ return methods.shallowExtend.apply(that, [options]);
+ }
+ };
+
+ $.fn.wysihtml5 = function ( method ) {
+ if ( methods[method] ) {
+ return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
+ } else if ( typeof method === 'object' || ! method ) {
+ return methods.init.apply( this, arguments );
+ } else {
+ $.error( 'Method ' + method + ' does not exist on jQuery.wysihtml5' );
+ }
+ };
+
+ $.fn.wysihtml5.Constructor = Wysihtml5;
+
+ var defaultOptions = $.fn.wysihtml5.defaultOptions = {
+ toolbar: {
+ 'font-styles': true,
+ 'color': false,
+ 'emphasis': {
+ 'small': true
+ },
+ 'blockquote': true,
+ 'lists': true,
+ 'html': false,
+ 'link': true,
+ 'image': true,
+ 'smallmodals': false
+ },
+ useLineBreaks: false,
+ parserRules: {
+ classes: {
+ 'wysiwyg-color-silver' : 1,
+ 'wysiwyg-color-gray' : 1,
+ 'wysiwyg-color-white' : 1,
+ 'wysiwyg-color-maroon' : 1,
+ 'wysiwyg-color-red' : 1,
+ 'wysiwyg-color-purple' : 1,
+ 'wysiwyg-color-fuchsia' : 1,
+ 'wysiwyg-color-green' : 1,
+ 'wysiwyg-color-lime' : 1,
+ 'wysiwyg-color-olive' : 1,
+ 'wysiwyg-color-yellow' : 1,
+ 'wysiwyg-color-navy' : 1,
+ 'wysiwyg-color-blue' : 1,
+ 'wysiwyg-color-teal' : 1,
+ 'wysiwyg-color-aqua' : 1,
+ 'wysiwyg-color-orange' : 1
+ },
+ tags: {
+ 'b': {},
+ 'i': {},
+ 'strong': {},
+ 'em': {},
+ 'p': {},
+ 'br': {},
+ 'ol': {},
+ 'ul': {},
+ 'li': {},
+ 'h1': {},
+ 'h2': {},
+ 'h3': {},
+ 'h4': {},
+ 'h5': {},
+ 'h6': {},
+ 'blockquote': {},
+ 'u': 1,
+ 'img': {
+ 'check_attributes': {
+ 'width': 'numbers',
+ 'alt': 'alt',
+ 'src': 'url',
+ 'height': 'numbers'
+ }
+ },
+ 'a': {
+ 'check_attributes': {
+ 'href': 'url'
+ },
+ 'set_attributes': {
+ 'target': '_blank',
+ 'rel': 'nofollow'
+ }
+ },
+ 'span': 1,
+ 'div': 1,
+ 'small': 1,
+ 'code': 1,
+ 'pre': 1
+ }
+ },
+ locale: 'en',
+ shortcuts: {
+ '83': 'small',// S
+ '75': 'createLink'// K
+ }
+ };
+
+ if (typeof $.fn.wysihtml5.defaultOptionsCache === 'undefined') {
+ $.fn.wysihtml5.defaultOptionsCache = $.extend(true, {}, $.fn.wysihtml5.defaultOptions);
+ }
+
+ var locale = $.fn.wysihtml5.locale = {};
+ };
+ bsWysihtml5($, wysihtml5);
+}));
+(function(wysihtml5) {
+ wysihtml5.commands.small = {
+ exec: function(composer, command) {
+ return wysihtml5.commands.formatInline.exec(composer, command, "small");
+ },
+
+ state: function(composer, command) {
+ return wysihtml5.commands.formatInline.state(composer, command, "small");
+ }
+ };
+})(wysihtml5);
+
+/**
+ * English translation for bootstrap-wysihtml5
+ */
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define('bootstrap.wysihtml5.en-US', ['jquery', 'bootstrap.wysihtml5'], factory);
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+ $.fn.wysihtml5.locale.en = $.fn.wysihtml5.locale['en-US'] = {
+ font_styles: {
+ normal: 'Normal text',
+ h1: 'Heading 1',
+ h2: 'Heading 2',
+ h3: 'Heading 3',
+ h4: 'Heading 4',
+ h5: 'Heading 5',
+ h6: 'Heading 6'
+ },
+ emphasis: {
+ bold: 'Bold',
+ italic: 'Italic',
+ underline: 'Underline',
+ small: 'Small'
+ },
+ lists: {
+ unordered: 'Unordered list',
+ ordered: 'Ordered list',
+ outdent: 'Outdent',
+ indent: 'Indent'
+ },
+ link: {
+ insert: 'Insert link',
+ cancel: 'Cancel',
+ target: 'Open link in new window'
+ },
+ image: {
+ insert: 'Insert image',
+ cancel: 'Cancel'
+ },
+ html: {
+ edit: 'Edit HTML'
+ },
+ colours: {
+ black: 'Black',
+ silver: 'Silver',
+ gray: 'Grey',
+ maroon: 'Maroon',
+ red: 'Red',
+ purple: 'Purple',
+ green: 'Green',
+ olive: 'Olive',
+ navy: 'Navy',
+ blue: 'Blue',
+ orange: 'Orange'
+ }
+ };
+}));
diff --git a/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js
new file mode 100644
index 0000000..58765c0
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js
@@ -0,0 +1,8 @@
+/*! bootstrap3-wysihtml5-bower 2014-09-26 */
+var wysihtml5,Base,Handlebars;Object.defineProperty&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(Element.prototype,"textContent")&&!Object.getOwnPropertyDescriptor(Element.prototype,"textContent").get&&!function(){var a=Object.getOwnPropertyDescriptor(Element.prototype,"innerText");Object.defineProperty(Element.prototype,"textContent",{get:function(){return a.get.call(this)},set:function(b){return a.set.call(this,b)}})}(),Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}),wysihtml5={version:"0.4.15",commands:{},dom:{},quirks:{},toolbar:{},lang:{},selection:{},views:{},INVISIBLE_SPACE:"",EMPTY_FUNCTION:function(){},ELEMENT_NODE:1,TEXT_NODE:3,BACKSPACE_KEY:8,ENTER_KEY:13,ESCAPE_KEY:27,SPACE_KEY:32,DELETE_KEY:46},function(a,b){"function"==typeof define&&define.amd?define(a):b.rangy=a()}(function(){function a(a,b){var c=typeof a[b];return c==x||!(c!=w||!a[b])||"unknown"==c}function b(a,b){return!(typeof a[b]!=w||!a[b])}function c(a,b){return typeof a[b]!=y}function d(a){return function(b,c){for(var d=c.length;d--;)if(!a(b,c[d]))return!1;return!0}}function e(a){return a&&D(a,C)&&F(a,B)}function f(a){return b(a,"body")?a.body:a.getElementsByTagName("body")[0]}function g(c){b(window,"console")&&a(window.console,"log")&&window.console.log(c)}function h(a,b){b?window.alert(a):g(a)}function i(a){H.initialized=!0,H.supported=!1,h("Rangy is not supported on this page in your browser. Reason: "+a,H.config.alertOnFail)}function j(a){h("Rangy warning: "+a,H.config.alertOnWarn)}function k(a){return a.message||a.description||a+""}function l(){var b,c,d,h,j,l,m,o,p;if(!H.initialized){if(c=!1,d=!1,a(document,"createRange")&&(b=document.createRange(),D(b,A)&&F(b,z)&&(c=!0)),h=f(document),!h||"body"!=h.nodeName.toLowerCase())return i("No body element found"),void 0;if(h&&a(h,"createTextRange")&&(b=h.createTextRange(),e(b)&&(d=!0)),!c&&!d)return i("Neither Range nor TextRange are available"),void 0;H.initialized=!0,H.features={implementsDomRange:c,implementsTextRange:d};for(m in G)(j=G[m])instanceof n&&j.init(j,H);for(o=0,p=s.length;p>o;++o)try{s[o](H)}catch(q){l="Rangy init listener threw an exception. Continuing. Detail: "+k(q),g(l)}}}function m(a){a=a||window,l();for(var b=0,c=t.length;c>b;++b)t[b](a)}function n(a,b,c){this.name=a,this.dependencies=b,this.initialized=!1,this.supported=!1,this.initializer=c}function o(a,b,c,d){var e=new n(b,c,function(a){if(!a.initialized){a.initialized=!0;try{d(H,a),a.supported=!0}catch(c){var e="Module '"+b+"' failed to load: "+k(c);g(e)}}});G[b]=e}function p(){}function q(){}var r,s,t,u,v,w="object",x="function",y="undefined",z=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],A=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],B=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],C=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"],D=d(a),E=d(b),F=d(c),G={},H={version:"1.3alpha.20140804",initialized:!1,supported:!0,util:{isHostMethod:a,isHostObject:b,isHostProperty:c,areHostMethods:D,areHostObjects:E,areHostProperties:F,isTextRange:e,getBody:f},features:{},modules:G,config:{alertOnFail:!0,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==y?!0:rangyAutoInitialize}};return H.fail=i,H.warn=j,{}.hasOwnProperty?H.util.extend=function(a,b,c){var d,e,f;for(f in b)b.hasOwnProperty(f)&&(d=a[f],e=b[f],c&&null!==d&&"object"==typeof d&&null!==e&&"object"==typeof e&&H.util.extend(d,e,!0),a[f]=e);return b.hasOwnProperty("toString")&&(a.toString=b.toString),a}:i("hasOwnProperty not supported"),function(){var a,b,c=document.createElement("div");c.appendChild(document.createElement("span")),a=[].slice;try{1==a.call(c.childNodes,0)[0].nodeType&&(b=function(b){return a.call(b,0)})}catch(d){}b||(b=function(a){var b,c,d=[];for(b=0,c=a.length;c>b;++b)d[b]=a[b];return d}),H.util.toArray=b}(),a(document,"addEventListener")?r=function(a,b,c){a.addEventListener(b,c,!1)}:a(document,"attachEvent")?r=function(a,b,c){a.attachEvent("on"+b,c)}:i("Document does not have required addEventListener or attachEvent method"),H.util.addListener=r,s=[],H.init=l,H.addInitListener=function(a){H.initialized?a(H):s.push(a)},t=[],H.addShimListener=function(a){t.push(a)},H.shim=H.createMissingNativeApi=m,n.prototype={init:function(){var a,b,c,d,e=this.dependencies||[];for(a=0,b=e.length;b>a;++a){if(d=e[a],c=G[d],!(c&&c instanceof n))throw Error("required module '"+d+"' not found");if(c.init(),!c.supported)throw Error("required module '"+d+"' not supported")}this.initializer(this)},fail:function(a){throw this.initialized=!0,this.supported=!1,Error("Module '"+this.name+"' failed to load: "+a)},warn:function(a){H.warn("Module "+this.name+": "+a)},deprecationNotice:function(a,b){H.warn("DEPRECATED: "+a+" in module "+this.name+"is deprecated. Please use "+b+" instead")},createError:function(a){return Error("Error in Rangy "+this.name+" module: "+a)}},H.createModule=function(a){var b,c,d;2==arguments.length?(b=arguments[1],c=[]):(b=arguments[2],c=arguments[1]),d=o(!1,a,c,b),H.initialized&&d.init()},H.createCoreModule=function(a,b,c){o(!0,a,b,c)},H.RangePrototype=p,H.rangePrototype=new p,H.selectionPrototype=new q,u=!1,v=function(){u||(u=!0,!H.initialized&&H.config.autoInitialize&&l())},typeof window==y?(i("No window found"),void 0):typeof document==y?(i("No document found"),void 0):(a(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",v,!1),r(window,"load",v),H.createCoreModule("DomUtil",[],function(a,b){function c(a){var b;return typeof a.namespaceURI==I||null===(b=a.namespaceURI)||"http://www.w3.org/1999/xhtml"==b}function d(a){var b=a.parentNode;return 1==b.nodeType?b:null}function e(a){for(var b=0;a=a.previousSibling;)++b;return b}function f(a){switch(a.nodeType){case 7:case 10:return 0;case 3:case 8:return a.length;default:return a.childNodes.length}}function g(a,b){var c,d=[];for(c=a;c;c=c.parentNode)d.push(c);for(c=b;c;c=c.parentNode)if(F(d,c))return c;return null}function h(a,b,c){for(var d=c?b:b.parentNode;d;){if(d===a)return!0;d=d.parentNode}return!1}function i(a,b){return h(a,b,!0)}function j(a,b,c){for(var d,e=c?a:a.parentNode;e;){if(d=e.parentNode,d===b)return e;e=d}return null}function k(a){var b=a.nodeType;return 3==b||4==b||8==b}function l(a){if(!a)return!1;var b=a.nodeType;return 3==b||8==b}function m(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a}function n(a,b,c){var d,f,g=a.cloneNode(!1);if(g.deleteData(0,b),a.deleteData(b,a.length-b),m(g,a),c)for(d=0;f=c[d++];)f.node==a&&f.offset>b?(f.node=g,f.offset-=b):f.node==a.parentNode&&f.offset>e(a)&&++f.offset;return g}function o(a){if(9==a.nodeType)return a;if(typeof a.ownerDocument!=I)return a.ownerDocument;if(typeof a.document!=I)return a.document;if(a.parentNode)return o(a.parentNode);throw b.createError("getDocument: no document found for node")}function p(a){var c=o(a);if(typeof c.defaultView!=I)return c.defaultView;if(typeof c.parentWindow!=I)return c.parentWindow;throw b.createError("Cannot get a window object for node")}function q(a){if(typeof a.contentDocument!=I)return a.contentDocument;if(typeof a.contentWindow!=I)return a.contentWindow.document;throw b.createError("getIframeDocument: No Document object found for iframe element")}function r(a){if(typeof a.contentWindow!=I)return a.contentWindow;if(typeof a.contentDocument!=I)return a.contentDocument.defaultView;throw b.createError("getIframeWindow: No Window object found for iframe element")}function s(a){return a&&J.isHostMethod(a,"setTimeout")&&J.isHostObject(a,"document")}function t(a,b,c){var d;if(a?J.isHostProperty(a,"nodeType")?d=1==a.nodeType&&"iframe"==a.tagName.toLowerCase()?q(a):o(a):s(a)&&(d=a.document):d=document,!d)throw b.createError(c+"(): Parameter must be a Window object or DOM node");return d}function u(a){for(var b;b=a.parentNode;)a=b;return a}function v(a,c,d,f){var h,i,k,l,m;if(a==d)return c===f?0:f>c?-1:1;if(h=j(d,a,!0))return c<=e(h)?-1:1;if(h=j(a,d,!0))return e(h)<f?-1:1;if(i=g(a,d),!i)throw Error("comparePoints error: nodes have no common ancestor");if(k=a===i?i:j(a,i,!0),l=d===i?i:j(d,i,!0),k===l)throw b.createError("comparePoints got to case 4 and childA and childB are the same!");for(m=i.firstChild;m;){if(m===k)return-1;if(m===l)return 1;m=m.nextSibling}}function w(a){var b;try{return b=a.parentNode,!1}catch(c){return!0}}function x(a){if(!a)return"[No node]";if(G&&w(a))return"[Broken node]";if(k(a))return'"'+a.data+'"';if(1==a.nodeType){var b=a.id?' id="'+a.id+'"':"";return"<"+a.nodeName+b+">[index:"+e(a)+",length:"+a.childNodes.length+"]["+(a.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return a.nodeName}function y(a){for(var b,c=o(a).createDocumentFragment();b=a.firstChild;)c.appendChild(b);return c}function z(a){this.root=a,this._next=a}function A(a){return new z(a)}function B(a,b){this.node=a,this.offset=b}function C(a){this.code=this[a],this.codeName=a,this.message="DOMException: "+this.codeName}var D,E,F,G,H,I="undefined",J=a.util;J.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||b.fail("document missing a Node creation method"),J.isHostMethod(document,"getElementsByTagName")||b.fail("document missing getElementsByTagName method"),D=document.createElement("div"),J.areHostMethods(D,["insertBefore","appendChild","cloneNode"]||!J.areHostObjects(D,["previousSibling","nextSibling","childNodes","parentNode"]))||b.fail("Incomplete Element implementation"),J.isHostProperty(D,"innerHTML")||b.fail("Element is missing innerHTML property"),E=document.createTextNode("test"),J.areHostMethods(E,["splitText","deleteData","insertData","appendData","cloneNode"]||!J.areHostObjects(D,["previousSibling","nextSibling","childNodes","parentNode"])||!J.areHostProperties(E,["data"]))||b.fail("Incomplete Text Node implementation"),F=function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1},G=!1,function(){var b,c=document.createElement("b");c.innerHTML="1",b=c.firstChild,c.innerHTML="<br>",G=w(b),a.features.crashyTextNodes=G}(),typeof window.getComputedStyle!=I?H=function(a,b){return p(a).getComputedStyle(a,null)[b]}:typeof document.documentElement.currentStyle!=I?H=function(a,b){return a.currentStyle[b]}:b.fail("No means of obtaining computed style properties found"),z.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var a,b,c=this._current=this._next;if(this._current)if(a=c.firstChild,a)this._next=a;else{for(b=null;c!==this.root&&!(b=c.nextSibling);)c=c.parentNode;this._next=b}return this._current},detach:function(){this._current=this._next=this.root=null}},B.prototype={equals:function(a){return!!a&&this.node===a.node&&this.offset==a.offset},inspect:function(){return"[DomPosition("+x(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},C.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},C.prototype.toString=function(){return this.message},a.dom={arrayContains:F,isHtmlNamespace:c,parentElement:d,getNodeIndex:e,getNodeLength:f,getCommonAncestor:g,isAncestorOf:h,isOrIsAncestorOf:i,getClosestAncestorIn:j,isCharacterDataNode:k,isTextOrCommentNode:l,insertAfter:m,splitDataNode:n,getDocument:o,getWindow:p,getIframeWindow:r,getIframeDocument:q,getBody:J.getBody,isWindow:s,getContentDocument:t,getRootContainer:u,comparePoints:v,isBrokenNode:w,inspectNode:x,getComputedStyleProperty:H,fragmentFromNodeChildren:y,createIterator:A,DomPosition:B},a.DOMException=C}),H.createCoreModule("DomRange",["DomUtil"],function(a){function b(a,b){return 3!=a.nodeType&&(gb(a,b.startContainer)||gb(a,b.endContainer))}function c(a){return a.document||hb(a.startContainer)}function d(a){return new cb(a.parentNode,fb(a))}function e(a){return new cb(a.parentNode,fb(a)+1)}function f(a,b,c){var d=11==a.nodeType?a.firstChild:a;return eb(b)?c==b.length?ab.insertAfter(a,b):b.parentNode.insertBefore(a,0==c?b:jb(b,c)):c>=b.childNodes.length?b.appendChild(a):b.insertBefore(a,b.childNodes[c]),d}function g(a,b,d){if(y(a),y(b),c(b)!=c(a))throw new db("WRONG_DOCUMENT_ERR");var e=ib(a.startContainer,a.startOffset,b.endContainer,b.endOffset),f=ib(a.endContainer,a.endOffset,b.startContainer,b.startOffset);return d?0>=e&&f>=0:0>e&&f>0}function h(a){var b,d,e,f;for(e=c(a.range).createDocumentFragment();d=a.next();){if(b=a.isPartiallySelectedSubtree(),d=d.cloneNode(!b),b&&(f=a.getSubtreeIterator(),d.appendChild(h(f)),f.detach()),10==d.nodeType)throw new db("HIERARCHY_REQUEST_ERR");e.appendChild(d)}return e}function i(a,b,c){var d,e,f,g;for(c=c||{stop:!1};f=a.next();)if(a.isPartiallySelectedSubtree()){if(b(f)===!1)return c.stop=!0,void 0;if(g=a.getSubtreeIterator(),i(g,b,c),g.detach(),c.stop)return}else for(d=ab.createIterator(f);e=d.next();)if(b(e)===!1)return c.stop=!0,void 0}function j(a){for(var b;a.next();)a.isPartiallySelectedSubtree()?(b=a.getSubtreeIterator(),j(b),b.detach()):a.remove()}function k(a){for(var b,d,e=c(a.range).createDocumentFragment();b=a.next();){if(a.isPartiallySelectedSubtree()?(b=b.cloneNode(!1),d=a.getSubtreeIterator(),b.appendChild(k(d)),d.detach()):a.remove(),10==b.nodeType)throw new db("HIERARCHY_REQUEST_ERR");e.appendChild(b)}return e}function l(a,b,c){var d,e,f=!(!b||!b.length),g=!!c;return f&&(d=RegExp("^("+b.join("|")+")$")),e=[],i(new n(a,!1),function(b){var h,i;(!f||d.test(b.nodeType))&&(!g||c(b))&&(h=a.startContainer,b==h&&eb(h)&&a.startOffset==h.length||(i=a.endContainer,b==i&&eb(i)&&0==a.endOffset||e.push(b)))}),e}function m(a){var b=void 0===a.getName?"Range":a.getName();return"["+b+"("+ab.inspectNode(a.startContainer)+":"+a.startOffset+", "+ab.inspectNode(a.endContainer)+":"+a.endOffset+")]"}function n(a,b){if(this.range=a,this.clonePartiallySelectedTextNodes=b,!a.collapsed){this.sc=a.startContainer,this.so=a.startOffset,this.ec=a.endContainer,this.eo=a.endOffset;var c=a.commonAncestorContainer;this.sc===this.ec&&eb(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==c||eb(this.sc)?kb(this.sc,c,!0):this.sc.childNodes[this.so],this._last=this.ec!==c||eb(this.ec)?kb(this.ec,c,!0):this.ec.childNodes[this.eo-1])}}function o(a){return function(b,c){for(var d,e=c?b:b.parentNode;e;){if(d=e.nodeType,mb(a,d))return e;e=e.parentNode}return null}}function p(a,b){if(P(a,b))throw new db("INVALID_NODE_TYPE_ERR")}function q(a,b){if(!mb(b,a.nodeType))throw new db("INVALID_NODE_TYPE_ERR")}function r(a,b){if(0>b||b>(eb(a)?a.length:a.childNodes.length))throw new db("INDEX_SIZE_ERR")}function s(a,b){if(N(a,!0)!==N(b,!0))throw new db("WRONG_DOCUMENT_ERR")}function t(a){if(O(a,!0))throw new db("NO_MODIFICATION_ALLOWED_ERR")}function u(a,b){if(!a)throw new db(b)}function v(a){return ob&&ab.isBrokenNode(a)||!mb(J,a.nodeType)&&!N(a,!0)}function w(a,b){return b<=(eb(a)?a.length:a.childNodes.length)}function x(a){return!!a.startContainer&&!!a.endContainer&&!v(a.startContainer)&&!v(a.endContainer)&&w(a.startContainer,a.startOffset)&&w(a.endContainer,a.endOffset)}function y(a){if(!x(a))throw Error("Range error: Range is no longer valid after DOM mutation ("+a.inspect()+")")}function z(a,b){var c,d,e,f,g;y(a),c=a.startContainer,d=a.startOffset,e=a.endContainer,f=a.endOffset,g=c===e,eb(e)&&f>0&&f<e.length&&jb(e,f,b),eb(c)&&d>0&&d<c.length&&(c=jb(c,d,b),g?(f-=d,e=c):e==c.parentNode&&f>=fb(c)&&f++,d=0),a.setStartAndEnd(c,d,e,f)}function A(a){y(a);var b=a.commonAncestorContainer.parentNode.cloneNode(!1);return b.appendChild(a.cloneContents()),b.innerHTML}function B(a){a.START_TO_START=U,a.START_TO_END=V,a.END_TO_END=W,a.END_TO_START=X,a.NODE_BEFORE=Y,a.NODE_AFTER=Z,a.NODE_BEFORE_AND_AFTER=$,a.NODE_INSIDE=_}function C(a){B(a),B(a.prototype)}function D(a,b){return function(){var c,d,f,g,h,j,k;return y(this),c=this.startContainer,d=this.startOffset,f=this.commonAncestorContainer,g=new n(this,!0),c!==f&&(h=kb(c,f,!0),j=e(h),c=j.node,d=j.offset),i(g,t),g.reset(),k=a(g),g.detach(),b(this,c,d,c,d),k}}function E(c,f){function g(a,b){return function(c){q(c,I),q(nb(c),J);var f=(a?d:e)(c);(b?h:i)(this,f.node,f.offset)}}function h(a,b,c){var d=a.endContainer,e=a.endOffset;(b!==a.startContainer||c!==a.startOffset)&&((nb(b)!=nb(d)||1==ib(b,c,d,e))&&(d=b,e=c),f(a,b,c,d,e))}function i(a,b,c){var d=a.startContainer,e=a.startOffset;(b!==a.endContainer||c!==a.endOffset)&&((nb(b)!=nb(d)||-1==ib(b,c,d,e))&&(d=b,e=c),f(a,d,e,b,c))}var l=function(){};l.prototype=a.rangePrototype,c.prototype=new l,bb.extend(c.prototype,{setStart:function(a,b){p(a,!0),r(a,b),h(this,a,b)},setEnd:function(a,b){p(a,!0),r(a,b),i(this,a,b)},setStartAndEnd:function(){var a=arguments,b=a[0],c=a[1],d=b,e=c;switch(a.length){case 3:e=a[2];break;case 4:d=a[2],e=a[3]}f(this,b,c,d,e)},setBoundary:function(a,b,c){this["set"+(c?"Start":"End")](a,b)},setStartBefore:g(!0,!0),setStartAfter:g(!1,!0),setEndBefore:g(!0,!1),setEndAfter:g(!1,!1),collapse:function(a){y(this),a?f(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):f(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(a){p(a,!0),f(this,a,0,a,lb(a))},selectNode:function(a){p(a,!1),q(a,I);var b=d(a),c=e(a);f(this,b.node,b.offset,c.node,c.offset)},extractContents:D(k,f),deleteContents:D(j,f),canSurroundContents:function(){var a,c;return y(this),t(this.startContainer),t(this.endContainer),a=new n(this,!0),c=a._first&&b(a._first,this)||a._last&&b(a._last,this),a.detach(),!c},splitBoundaries:function(){z(this)},splitBoundariesPreservingPositions:function(a){z(this,a)},normalizeBoundaries:function(){var a,b,c,d,e,g,h,i,j;y(this),a=this.startContainer,b=this.startOffset,c=this.endContainer,d=this.endOffset,e=function(a){var b=a.nextSibling;b&&b.nodeType==a.nodeType&&(c=a,d=a.length,a.appendData(b.data),b.parentNode.removeChild(b))},g=function(e){var f,g,h=e.previousSibling;h&&h.nodeType==e.nodeType&&(a=e,f=e.length,b=h.length,e.insertData(0,h.data),h.parentNode.removeChild(h),a==c?(d+=b,c=a):c==e.parentNode&&(g=fb(e),d==g?(c=e,d=f):d>g&&d--))},h=!0,eb(c)?c.length==d&&e(c):(d>0&&(i=c.childNodes[d-1],i&&eb(i)&&e(i)),h=!this.collapsed),h?eb(a)?0==b&&g(a):b<a.childNodes.length&&(j=a.childNodes[b],j&&eb(j)&&g(j)):(a=c,b=d),f(this,a,b,c,d)},collapseToPoint:function(a,b){p(a,!0),r(a,b),this.setStartAndEnd(a,b)}}),C(c)}function F(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset,a.commonAncestorContainer=a.collapsed?a.startContainer:ab.getCommonAncestor(a.startContainer,a.endContainer)}function G(a,b,c,d,e){a.startContainer=b,a.startOffset=c,a.endContainer=d,a.endOffset=e,a.document=ab.getDocument(b),F(a)}function H(a){this.startContainer=a,this.startOffset=0,this.endContainer=a,this.endOffset=0,this.document=a,F(this)}var I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab=a.dom,bb=a.util,cb=ab.DomPosition,db=a.DOMException,eb=ab.isCharacterDataNode,fb=ab.getNodeIndex,gb=ab.isOrIsAncestorOf,hb=ab.getDocument,ib=ab.comparePoints,jb=ab.splitDataNode,kb=ab.getClosestAncestorIn,lb=ab.getNodeLength,mb=ab.arrayContains,nb=ab.getRootContainer,ob=a.features.crashyTextNodes;n.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var a=this._current=this._next;return a&&(this._next=a!==this._last?a.nextSibling:null,eb(a)&&this.clonePartiallySelectedTextNodes&&(a===this.ec&&(a=a.cloneNode(!0)).deleteData(this.eo,a.length-this.eo),this._current===this.sc&&(a=a.cloneNode(!0)).deleteData(0,this.so))),a},remove:function(){var a,b,c=this._current;!eb(c)||c!==this.sc&&c!==this.ec?c.parentNode&&c.parentNode.removeChild(c):(a=c===this.sc?this.so:0,b=c===this.ec?this.eo:c.length,a!=b&&c.deleteData(a,b-a))},isPartiallySelectedSubtree:function(){var a=this._current;return b(a,this.range)},getSubtreeIterator:function(){var a,b,d,e,f,g;return this.isSingleCharacterDataNode?(a=this.range.cloneRange(),a.collapse(!1)):(a=new H(c(this.range)),b=this._current,d=b,e=0,f=b,g=lb(b),gb(b,this.sc)&&(d=this.sc,e=this.so),gb(b,this.ec)&&(f=this.ec,g=this.eo),G(a,d,e,f,g)),new n(a,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}},I=[1,3,4,5,7,8,10],J=[2,9,11],K=[5,6,10,12],L=[1,3,4,5,7,8,10,11],M=[1,3,4,5,7,8],N=o([9,11]),O=o(K),P=o([6,10,12]),Q=document.createElement("style"),R=!1;try{Q.innerHTML="<b>x</b>",R=3==Q.firstChild.nodeType}catch(pb){}a.features.htmlParsingConforms=R,S=R?function(a){var b,c=this.startContainer,d=hb(c);if(!c)throw new db("INVALID_STATE_ERR");return b=null,1==c.nodeType?b=c:eb(c)&&(b=ab.parentElement(c)),b=null===b||"HTML"==b.nodeName&&ab.isHtmlNamespace(hb(b).documentElement)&&ab.isHtmlNamespace(b)?d.createElement("body"):b.cloneNode(!1),b.innerHTML=a,ab.fragmentFromNodeChildren(b)}:function(a){var b=c(this),d=b.createElement("body");return d.innerHTML=a,ab.fragmentFromNodeChildren(d)},T=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],U=0,V=1,W=2,X=3,Y=0,Z=1,$=2,_=3,bb.extend(a.rangePrototype,{compareBoundaryPoints:function(a,b){var c,d,e,f,g,h;return y(this),s(this.startContainer,b.startContainer),g=a==X||a==U?"start":"end",h=a==V||a==U?"start":"end",c=this[g+"Container"],d=this[g+"Offset"],e=b[h+"Container"],f=b[h+"Offset"],ib(c,d,e,f)},insertNode:function(a){if(y(this),q(a,L),t(this.startContainer),gb(a,this.startContainer))throw new db("HIERARCHY_REQUEST_ERR");var b=f(a,this.startContainer,this.startOffset);this.setStartBefore(b)},cloneContents:function(){var a,b,d;return y(this),this.collapsed?c(this).createDocumentFragment():this.startContainer===this.endContainer&&eb(this.startContainer)?(a=this.startContainer.cloneNode(!0),a.data=a.data.slice(this.startOffset,this.endOffset),b=c(this).createDocumentFragment(),b.appendChild(a),b):(d=new n(this,!0),a=h(d),d.detach(),a)},canSurroundContents:function(){var a,c;return y(this),t(this.startContainer),t(this.endContainer),a=new n(this,!0),c=a._first&&b(a._first,this)||a._last&&b(a._last,this),a.detach(),!c},surroundContents:function(a){if(q(a,M),!this.canSurroundContents())throw new db("INVALID_STATE_ERR");var b=this.extractContents();if(a.hasChildNodes())for(;a.lastChild;)a.removeChild(a.lastChild);f(a,this.startContainer,this.startOffset),a.appendChild(b),this.selectNode(a)},cloneRange:function(){var a,b,d;for(y(this),a=new H(c(this)),b=T.length;b--;)d=T[b],a[d]=this[d];return a},toString:function(){var a,b,c;return y(this),a=this.startContainer,a===this.endContainer&&eb(a)?3==a.nodeType||4==a.nodeType?a.data.slice(this.startOffset,this.endOffset):"":(b=[],c=new n(this,!0),i(c,function(a){(3==a.nodeType||4==a.nodeType)&&b.push(a.data)}),c.detach(),b.join(""))},compareNode:function(a){var b,c,d,e;if(y(this),b=a.parentNode,c=fb(a),!b)throw new db("NOT_FOUND_ERR");return d=this.comparePoint(b,c),e=this.comparePoint(b,c+1),0>d?e>0?$:Y:e>0?Z:_},comparePoint:function(a,b){return y(this),u(a,"HIERARCHY_REQUEST_ERR"),s(a,this.startContainer),ib(a,b,this.startContainer,this.startOffset)<0?-1:ib(a,b,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:S,toHtml:function(){return A(this)},intersectsNode:function(a,b){var d,e,f,g;return y(this),u(a,"NOT_FOUND_ERR"),hb(a)!==c(this)?!1:(d=a.parentNode,e=fb(a),u(d,"NOT_FOUND_ERR"),f=ib(d,e,this.endContainer,this.endOffset),g=ib(d,e+1,this.startContainer,this.startOffset),b?0>=f&&g>=0:0>f&&g>0)},isPointInRange:function(a,b){return y(this),u(a,"HIERARCHY_REQUEST_ERR"),s(a,this.startContainer),ib(a,b,this.startContainer,this.startOffset)>=0&&ib(a,b,this.endContainer,this.endOffset)<=0},intersectsRange:function(a){return g(this,a,!1)},intersectsOrTouchesRange:function(a){return g(this,a,!0)},intersection:function(a){var b,c,d;return this.intersectsRange(a)?(b=ib(this.startContainer,this.startOffset,a.startContainer,a.startOffset),c=ib(this.endContainer,this.endOffset,a.endContainer,a.endOffset),d=this.cloneRange(),-1==b&&d.setStart(a.startContainer,a.startOffset),1==c&&d.setEnd(a.endContainer,a.endOffset),d):null},union:function(a){if(this.intersectsOrTouchesRange(a)){var b=this.cloneRange();return-1==ib(a.startContainer,a.startOffset,this.startContainer,this.startOffset)&&b.setStart(a.startContainer,a.startOffset),1==ib(a.endContainer,a.endOffset,this.endContainer,this.endOffset)&&b.setEnd(a.endContainer,a.endOffset),b}throw new db("Ranges do not intersect")},containsNode:function(a,b){return b?this.intersectsNode(a,!1):this.compareNode(a)==_},containsNodeContents:function(a){return this.comparePoint(a,0)>=0&&this.comparePoint(a,lb(a))<=0},containsRange:function(a){var b=this.intersection(a);return null!==b&&a.equals(b)},containsNodeText:function(a){var b,c,d=this.cloneRange();return d.selectNode(a),b=d.getNodes([3]),b.length>0?(d.setStart(b[0],0),c=b.pop(),d.setEnd(c,c.length),this.containsRange(d)):this.containsNodeContents(a)},getNodes:function(a,b){return y(this),l(this,a,b)},getDocument:function(){return c(this)},collapseBefore:function(a){this.setEndBefore(a),this.collapse(!1)},collapseAfter:function(a){this.setStartAfter(a),this.collapse(!0)},getBookmark:function(b){var d,e,f,g=c(this),h=a.createRange(g);return b=b||ab.getBody(g),h.selectNodeContents(b),d=this.intersection(h),e=0,f=0,d&&(h.setEnd(d.startContainer,d.startOffset),e=(""+h).length,f=e+(""+d).length),{start:e,end:f,containerNode:b}},moveToBookmark:function(a){var b,c,d,e,f,g,h,i=a.containerNode,j=0;for(this.setStart(i,0),this.collapse(!0),b=[i],d=!1,e=!1;!e&&(c=b.pop());)if(3==c.nodeType)f=j+c.length,!d&&a.start>=j&&a.start<=f&&(this.setStart(c,a.start-j),d=!0),d&&a.end>=j&&a.end<=f&&(this.setEnd(c,a.end-j),e=!0),j=f;else for(h=c.childNodes,g=h.length;g--;)b.push(h[g])},getName:function(){return"DomRange"},equals:function(a){return H.rangesEqual(this,a)},isValid:function(){return x(this)},inspect:function(){return m(this)},detach:function(){}}),E(H,G),bb.extend(H,{rangeProperties:T,RangeIterator:n,copyComparisonConstants:C,createPrototypeRange:E,inspect:m,toHtml:A,getRangeDocument:c,rangesEqual:function(a,b){return a.startContainer===b.startContainer&&a.startOffset===b.startOffset&&a.endContainer===b.endContainer&&a.endOffset===b.endOffset}}),a.DomRange=H}),H.createCoreModule("WrappedRange",["DomRange"],function(a,b){var c,d,e,f,g,h,i,j,k=a.dom,l=a.util,m=k.DomPosition,n=a.DomRange,o=k.getBody,p=k.getContentDocument,q=k.isCharacterDataNode;a.features.implementsDomRange&&!function(){function d(a){for(var b,c=s.length;c--;)b=s[c],a[b]=a.nativeRange[b];a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset}function e(a,b,c,d,e){var f=a.startContainer!==b||a.startOffset!=c,g=a.endContainer!==d||a.endOffset!=e,h=!a.equals(a.nativeRange);(f||g||h)&&(a.setEnd(d,e),a.setStart(b,c))}var f,g,h,i,j,m,q,r,s=n.rangeProperties;c=function(a){if(!a)throw b.createError("WrappedRange: Range must be specified");this.nativeRange=a,d(this)},n.createPrototypeRange(c,e),f=c.prototype,f.selectNode=function(a){this.nativeRange.selectNode(a),d(this)},f.cloneContents=function(){return this.nativeRange.cloneContents()},f.surroundContents=function(a){this.nativeRange.surroundContents(a),d(this)},f.collapse=function(a){this.nativeRange.collapse(a),d(this)},f.cloneRange=function(){return new c(this.nativeRange.cloneRange())},f.refresh=function(){d(this)},f.toString=function(){return""+this.nativeRange},h=document.createTextNode("test"),o(document).appendChild(h),i=document.createRange(),i.setStart(h,0),i.setEnd(h,0);try{i.setStart(h,1),f.setStart=function(a,b){this.nativeRange.setStart(a,b),d(this)},f.setEnd=function(a,b){this.nativeRange.setEnd(a,b),d(this)},g=function(a){return function(b){this.nativeRange[a](b),d(this)}}}catch(t){f.setStart=function(a,b){try{this.nativeRange.setStart(a,b)}catch(c){this.nativeRange.setEnd(a,b),this.nativeRange.setStart(a,b)}d(this)},f.setEnd=function(a,b){try{this.nativeRange.setEnd(a,b)}catch(c){this.nativeRange.setStart(a,b),this.nativeRange.setEnd(a,b)}d(this)},g=function(a,b){return function(c){try{this.nativeRange[a](c)}catch(e){this.nativeRange[b](c),this.nativeRange[a](c)}d(this)}}}f.setStartBefore=g("setStartBefore","setEndBefore"),f.setStartAfter=g("setStartAfter","setEndAfter"),f.setEndBefore=g("setEndBefore","setStartBefore"),f.setEndAfter=g("setEndAfter","setStartAfter"),f.selectNodeContents=function(a){this.setStartAndEnd(a,0,k.getNodeLength(a))},i.selectNodeContents(h),i.setEnd(h,3),j=document.createRange(),j.selectNodeContents(h),j.setEnd(h,4),j.setStart(h,2),f.compareBoundaryPoints=-1==i.compareBoundaryPoints(i.START_TO_END,j)&&1==i.compareBoundaryPoints(i.END_TO_START,j)?function(a,b){return b=b.nativeRange||b,a==b.START_TO_END?a=b.END_TO_START:a==b.END_TO_START&&(a=b.START_TO_END),this.nativeRange.compareBoundaryPoints(a,b)}:function(a,b){return this.nativeRange.compareBoundaryPoints(a,b.nativeRange||b)},m=document.createElement("div"),m.innerHTML="123",q=m.firstChild,r=o(document),r.appendChild(m),i.setStart(q,1),i.setEnd(q,2),i.deleteContents(),"13"==q.data&&(f.deleteContents=function(){this.nativeRange.deleteContents(),d(this)},f.extractContents=function(){var a=this.nativeRange.extractContents();return d(this),a}),r.removeChild(m),r=null,l.isHostMethod(i,"createContextualFragment")&&(f.createContextualFragment=function(a){return this.nativeRange.createContextualFragment(a)}),o(document).removeChild(h),f.getName=function(){return"WrappedRange"},a.WrappedRange=c,a.createNativeRange=function(a){return a=p(a,b,"createNativeRange"),a.createRange()}}(),a.features.implementsTextRange&&(e=function(a){var b,c,d,e=a.parentElement(),f=a.duplicate();return f.collapse(!0),b=f.parentElement(),f=a.duplicate(),f.collapse(!1),c=f.parentElement(),d=b==c?b:k.getCommonAncestor(b,c),d==e?d:k.getCommonAncestor(e,d)},f=function(a){return 0==a.compareEndPoints("StartToEnd",a)},g=function(a,b,c,d,e){var f,g,h,i,j,l,n,o,p,r,s,t,u,v,w,x,y=a.duplicate();if(y.collapse(c),f=y.parentElement(),k.isOrIsAncestorOf(b,f)||(f=b),!f.canHaveHTML)return g=new m(f.parentNode,k.getNodeIndex(f)),{boundaryPosition:g,nodeInfo:{nodeIndex:g.offset,containerElement:g.node}};for(h=k.getDocument(f).createElement("span"),h.parentNode&&h.parentNode.removeChild(h),j=c?"StartToStart":"StartToEnd",r=e&&e.containerElement==f?e.nodeIndex:0,s=f.childNodes.length,t=s,u=t;;){if(u==s?f.appendChild(h):f.insertBefore(h,f.childNodes[u]),y.moveToElementText(h),i=y.compareEndPoints(j,a),0==i||r==t)break;if(-1==i){if(t==r+1)break;r=u}else t=t==r+1?r:u;u=Math.floor((r+t)/2),f.removeChild(h)}if(p=h.nextSibling,-1==i&&p&&q(p)){if(y.setEndPoint(c?"EndToStart":"EndToEnd",a),/[\r\n]/.test(p.data))for(w=y.duplicate(),x=w.text.replace(/\r\n/g,"\r").length,v=w.moveStart("character",x);-1==(i=w.compareEndPoints("StartToEnd",w));)v++,w.moveStart("character",1);else v=y.text.length;o=new m(p,v)}else l=(d||!c)&&h.previousSibling,n=(d||c)&&h.nextSibling,o=n&&q(n)?new m(n,0):l&&q(l)?new m(l,l.data.length):new m(f,k.getNodeIndex(h));return h.parentNode.removeChild(h),{boundaryPosition:o,nodeInfo:{nodeIndex:u,containerElement:f}}},h=function(a,b){var c,d,e,f,g=a.offset,h=k.getDocument(a.node),i=o(h).createTextRange(),j=q(a.node);return j?(c=a.node,d=c.parentNode):(f=a.node.childNodes,c=g<f.length?f[g]:null,d=a.node),e=h.createElement("span"),e.innerHTML="&#feff;",c?d.insertBefore(e,c):d.appendChild(e),i.moveToElementText(e),i.collapse(!b),d.removeChild(e),j&&i[b?"moveStart":"moveEnd"]("character",g),i},d=function(a){this.textRange=a,this.refresh()},d.prototype=new n(document),d.prototype.refresh=function(){var a,b,c,d=e(this.textRange);
+f(this.textRange)?b=a=g(this.textRange,d,!0,!0).boundaryPosition:(c=g(this.textRange,d,!0,!1),a=c.boundaryPosition,b=g(this.textRange,d,!1,!1,c.nodeInfo).boundaryPosition),this.setStart(a.node,a.offset),this.setEnd(b.node,b.offset)},d.prototype.getName=function(){return"WrappedTextRange"},n.copyComparisonConstants(d),i=function(a){var b,c,d;return a.collapsed?h(new m(a.startContainer,a.startOffset),!0):(b=h(new m(a.startContainer,a.startOffset),!0),c=h(new m(a.endContainer,a.endOffset),!1),d=o(n.getRangeDocument(a)).createTextRange(),d.setEndPoint("StartToStart",b),d.setEndPoint("EndToEnd",c),d)},d.rangeToTextRange=i,d.prototype.toTextRange=function(){return i(this)},a.WrappedTextRange=d,(!a.features.implementsDomRange||a.config.preferTextRange)&&(j=function(){return this}(),void 0===j.Range&&(j.Range=d),a.createNativeRange=function(a){return a=p(a,b,"createNativeRange"),o(a).createTextRange()},a.WrappedRange=d)),a.createRange=function(c){return c=p(c,b,"createRange"),new a.WrappedRange(a.createNativeRange(c))},a.createRangyRange=function(a){return a=p(a,b,"createRangyRange"),new n(a)},a.createIframeRange=function(c){return b.deprecationNotice("createIframeRange()","createRange(iframeEl)"),a.createRange(c)},a.createIframeRangyRange=function(c){return b.deprecationNotice("createIframeRangyRange()","createRangyRange(iframeEl)"),a.createRangyRange(c)},a.addShimListener(function(b){var c=b.document;void 0===c.createRange&&(c.createRange=function(){return a.createRange(c)}),c=b=null})}),H.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(a,b){function c(a){return"string"==typeof a?/^backward(s)?$/i.test(a):!!a}function d(a,c){if(a){if(A.isWindow(a))return a;if(a instanceof r)return a.win;var d=A.getContentDocument(a,b,c);return A.getWindow(d)}return window}function e(a){return d(a,"getWinSelection").getSelection()}function f(a){return d(a,"getDocSelection").document.selection}function g(a){var b=!1;return a.anchorNode&&(b=1==A.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset)),b}function h(a,b,c){var d=c?"end":"start",e=c?"start":"end";a.anchorNode=b[d+"Container"],a.anchorOffset=b[d+"Offset"],a.focusNode=b[e+"Container"],a.focusOffset=b[e+"Offset"]}function i(a){var b=a.nativeSelection;a.anchorNode=b.anchorNode,a.anchorOffset=b.anchorOffset,a.focusNode=b.focusNode,a.focusOffset=b.focusOffset}function j(a){a.anchorNode=a.focusNode=null,a.anchorOffset=a.focusOffset=0,a.rangeCount=0,a.isCollapsed=!0,a._ranges.length=0}function k(b){var c;return b instanceof D?(c=a.createNativeRange(b.getDocument()),c.setEnd(b.endContainer,b.endOffset),c.setStart(b.startContainer,b.startOffset)):b instanceof E?c=b.nativeRange:J.implementsDomRange&&b instanceof A.getWindow(b.startContainer).Range&&(c=b),c}function l(a){if(!a.length||1!=a[0].nodeType)return!1;for(var b=1,c=a.length;c>b;++b)if(!A.isAncestorOf(a[0],a[b]))return!1;return!0}function m(a){var c=a.getNodes();if(!l(c))throw b.createError("getSingleElementFromRange: range "+a.inspect()+" did not consist of a single element");return c[0]}function n(a){return!!a&&void 0!==a.text}function o(a,b){var c=new E(b);a._ranges=[c],h(a,c,!1),a.rangeCount=1,a.isCollapsed=c.collapsed}function p(b){var c,d,e,f;if(b._ranges.length=0,"None"==b.docSelection.type)j(b);else if(c=b.docSelection.createRange(),n(c))o(b,c);else{for(b.rangeCount=c.length,e=L(c.item(0)),f=0;f<b.rangeCount;++f)d=a.createRange(e),d.selectNode(c.item(f)),b._ranges.push(d);b.isCollapsed=1==b.rangeCount&&b._ranges[0].collapsed,h(b,b._ranges[b.rangeCount-1],!1)}}function q(a,c){var d,e,f=a.docSelection.createRange(),g=m(c),h=L(f.item(0)),i=M(h).createControlRange();for(d=0,e=f.length;e>d;++d)i.add(f.item(d));try{i.add(g)}catch(j){throw b.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}i.select(),p(a)}function r(a,b,c){this.nativeSelection=a,this.docSelection=b,this._ranges=[],this.win=c,this.refresh()}function s(a){a.win=a.anchorNode=a.focusNode=a._ranges=null,a.rangeCount=a.anchorOffset=a.focusOffset=0,a.detached=!0}function t(a,b){for(var c,d,e=bb.length;e--;)if(c=bb[e],d=c.selection,"deleteAll"==b)s(d);else if(c.win==a)return"delete"==b?(bb.splice(e,1),!0):d;return"deleteAll"==b&&(bb.length=0),null}function u(a,c){var d,e,f,g=L(c[0].startContainer),h=M(g).createControlRange();for(d=0,f=c.length;f>d;++d){e=m(c[d]);try{h.add(e)}catch(i){throw b.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}h.select(),p(a)}function v(a,b){if(a.win.document!=L(b))throw new F("WRONG_DOCUMENT_ERR")}function w(b){return function(c,d){var e;this.rangeCount?(e=this.getRangeAt(0),e["set"+(b?"Start":"End")](c,d)):(e=a.createRange(this.win.document),e.setStartAndEnd(c,d)),this.setSingleRange(e,this.isBackward())}}function x(a){var b,c,d=[],e=new G(a.anchorNode,a.anchorOffset),f=new G(a.focusNode,a.focusOffset),g="function"==typeof a.getName?a.getName():"Selection";if(void 0!==a.rangeCount)for(b=0,c=a.rangeCount;c>b;++b)d[b]=D.inspect(a.getRangeAt(b));return"["+g+"(Ranges: "+d.join(", ")+")(anchor: "+e.inspect()+", focus: "+f.inspect()+"]"}var y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ab,bb,cb,db,eb,fb,gb,hb;if(a.config.checkSelectionRanges=!0,y="boolean",z="number",A=a.dom,B=a.util,C=B.isHostMethod,D=a.DomRange,E=a.WrappedRange,F=a.DOMException,G=A.DomPosition,J=a.features,K="Control",L=A.getDocument,M=A.getBody,N=D.rangesEqual,O=C(window,"getSelection"),P=B.isHostObject(document,"selection"),J.implementsWinGetSelection=O,J.implementsDocSelection=P,Q=P&&(!O||a.config.preferTextRange),Q?(H=f,a.isSelectionValid=function(a){var b=d(a,"isSelectionValid").document,c=b.selection;return"None"!=c.type||L(c.createRange().parentElement())==b}):O?(H=e,a.isSelectionValid=function(){return!0}):b.fail("Neither document.selection or window.getSelection() detected."),a.getNativeSelection=H,R=H(),S=a.createNativeRange(document),T=M(document),U=B.areHostProperties(R,["anchorNode","focusNode","anchorOffset","focusOffset"]),J.selectionHasAnchorAndFocus=U,V=C(R,"extend"),J.selectionHasExtend=V,W=typeof R.rangeCount==z,J.selectionHasRangeCount=W,X=!1,Y=!0,Z=V?function(b,c){var d=D.getRangeDocument(c),e=a.createRange(d);e.collapseToPoint(c.endContainer,c.endOffset),b.addRange(k(e)),b.extend(c.startContainer,c.startOffset)}:null,B.areHostMethods(R,["addRange","getRangeAt","removeAllRanges"])&&typeof R.rangeCount==z&&J.implementsDomRange&&!function(){var b,c,d,e,f,h,i,j,k,l,m,n=window.getSelection();if(n){for(b=n.rangeCount,c=b>1,d=[],e=g(n),f=0;b>f;++f)d[f]=n.getRangeAt(f);for(h=M(document),i=h.appendChild(document.createElement("div")),i.contentEditable="false",j=i.appendChild(document.createTextNode("   ")),k=document.createRange(),k.setStart(j,1),k.collapse(!0),n.addRange(k),Y=1==n.rangeCount,n.removeAllRanges(),c||(l=window.navigator.appVersion.match(/Chrome\/(.*?) /),l&&parseInt(l[1])>=36?X=!1:(m=k.cloneRange(),k.setStart(j,0),m.setEnd(j,3),m.setStart(j,2),n.addRange(k),n.addRange(m),X=2==n.rangeCount)),h.removeChild(i),n.removeAllRanges(),f=0;b>f;++f)0==f&&e?Z?Z(n,d[f]):(a.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),n.addRange(d[f])):n.addRange(d[f])}}(),J.selectionSupportsMultipleRanges=X,J.collapsedNonEditableSelectionsSupported=Y,$=!1,T&&C(T,"createControlRange")&&(_=T.createControlRange(),B.areHostProperties(_,["item","add"])&&($=!0)),J.implementsControlRange=$,I=U?function(a){return a.anchorNode===a.focusNode&&a.anchorOffset===a.focusOffset}:function(a){return a.rangeCount?a.getRangeAt(a.rangeCount-1).collapsed:!1},C(R,"getRangeAt")?ab=function(a,b){try{return a.getRangeAt(b)}catch(c){return null}}:U&&(ab=function(b){var c=L(b.anchorNode),d=a.createRange(c);return d.setStartAndEnd(b.anchorNode,b.anchorOffset,b.focusNode,b.focusOffset),d.collapsed!==this.isCollapsed&&d.setStartAndEnd(b.focusNode,b.focusOffset,b.anchorNode,b.anchorOffset),d}),r.prototype=a.selectionPrototype,bb=[],cb=function(a){var b,c,e;return a&&a instanceof r?(a.refresh(),a):(a=d(a,"getNativeSelection"),b=t(a),c=H(a),e=P?f(a):null,b?(b.nativeSelection=c,b.docSelection=e,b.refresh()):(b=new r(c,e,a),bb.push({win:a,selection:b})),b)},a.getSelection=cb,a.getIframeSelection=function(c){return b.deprecationNotice("getIframeSelection()","getSelection(iframeEl)"),a.getSelection(A.getIframeWindow(c))},db=r.prototype,!Q&&U&&B.areHostMethods(R,["removeAllRanges","addRange"]))db.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),j(this)},eb=function(a,b){Z(a.nativeSelection,b),a.refresh()},db.addRange=W?function(b,d){var e,f;$&&P&&this.docSelection.type==K?q(this,b):c(d)&&V?eb(this,b):(X?e=this.rangeCount:(this.removeAllRanges(),e=0),this.nativeSelection.addRange(k(b).cloneRange()),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==e+1?(a.config.checkSelectionRanges&&(f=ab(this.nativeSelection,this.rangeCount-1),f&&!N(f,b)&&(b=new E(f))),this._ranges[this.rangeCount-1]=b,h(this,b,hb(this.nativeSelection)),this.isCollapsed=I(this)):this.refresh())}:function(a,b){c(b)&&V?eb(this,a):(this.nativeSelection.addRange(k(a)),this.refresh())},db.setRanges=function(a){if($&&P&&a.length>1)u(this,a);else{this.removeAllRanges();for(var b=0,c=a.length;c>b;++b)this.addRange(a[b])}};else{if(!(C(R,"empty")&&C(S,"select")&&$&&Q))return b.fail("No means of selecting a Range or TextRange was found"),!1;db.removeAllRanges=function(){var a,b,c;try{this.docSelection.empty(),"None"!=this.docSelection.type&&(this.anchorNode?a=L(this.anchorNode):this.docSelection.type==K&&(b=this.docSelection.createRange(),b.length&&(a=L(b.item(0)))),a&&(c=M(a).createTextRange(),c.select(),this.docSelection.empty()))}catch(d){}j(this)},db.addRange=function(b){this.docSelection.type==K?q(this,b):(a.WrappedTextRange.rangeToTextRange(b).select(),this._ranges[0]=b,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,h(this,b,!1))},db.setRanges=function(a){this.removeAllRanges();var b=a.length;b>1?u(this,a):b&&this.addRange(a[0])}}if(db.getRangeAt=function(a){if(0>a||a>=this.rangeCount)throw new F("INDEX_SIZE_ERR");return this._ranges[a].cloneRange()},Q)fb=function(b){var c;a.isSelectionValid(b.win)?c=b.docSelection.createRange():(c=M(b.win.document).createTextRange(),c.collapse(!0)),b.docSelection.type==K?p(b):n(c)?o(b,c):j(b)};else if(C(R,"getRangeAt")&&typeof R.rangeCount==z)fb=function(b){if($&&P&&b.docSelection.type==K)p(b);else if(b._ranges.length=b.rangeCount=b.nativeSelection.rangeCount,b.rangeCount){for(var c=0,d=b.rangeCount;d>c;++c)b._ranges[c]=new a.WrappedRange(b.nativeSelection.getRangeAt(c));h(b,b._ranges[b.rangeCount-1],hb(b.nativeSelection)),b.isCollapsed=I(b)}else j(b)};else{if(!U||typeof R.isCollapsed!=y||typeof S.collapsed!=y||!J.implementsDomRange)return b.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;fb=function(a){var b,c=a.nativeSelection;c.anchorNode?(b=ab(c,0),a._ranges=[b],a.rangeCount=1,i(a),a.isCollapsed=I(a)):j(a)}}db.refresh=function(a){var b,c=a?this._ranges.slice(0):null,d=this.anchorNode,e=this.anchorOffset;if(fb(this),a){if(b=c.length,b!=this._ranges.length)return!0;if(this.anchorNode!=d||this.anchorOffset!=e)return!0;for(;b--;)if(!N(c[b],this._ranges[b]))return!0;return!1}},gb=function(a,b){var c,d,e=a.getAllRanges();for(a.removeAllRanges(),c=0,d=e.length;d>c;++c)N(b,e[c])||a.addRange(e[c]);a.rangeCount||j(a)},db.removeRange=$&&P?function(a){var b,c,d,e,f,g,h,i;if(this.docSelection.type==K){for(b=this.docSelection.createRange(),c=m(a),d=L(b.item(0)),e=M(d).createControlRange(),g=!1,h=0,i=b.length;i>h;++h)f=b.item(h),f!==c||g?e.add(b.item(h)):g=!0;e.select(),p(this)}else gb(this,a)}:function(a){gb(this,a)},!Q&&U&&J.implementsDomRange?(hb=g,db.isBackward=function(){return hb(this)}):hb=db.isBackward=function(){return!1},db.isBackwards=db.isBackward,db.toString=function(){var a,b,c=[];for(a=0,b=this.rangeCount;b>a;++a)c[a]=""+this._ranges[a];return c.join("")},db.collapse=function(b,c){v(this,b);var d=a.createRange(b);d.collapseToPoint(b,c),this.setSingleRange(d),this.isCollapsed=!0},db.collapseToStart=function(){if(!this.rangeCount)throw new F("INVALID_STATE_ERR");var a=this._ranges[0];this.collapse(a.startContainer,a.startOffset)},db.collapseToEnd=function(){if(!this.rangeCount)throw new F("INVALID_STATE_ERR");var a=this._ranges[this.rangeCount-1];this.collapse(a.endContainer,a.endOffset)},db.selectAllChildren=function(b){v(this,b);var c=a.createRange(b);c.selectNodeContents(b),this.setSingleRange(c)},db.deleteFromDocument=function(){var a,b,c,d,e;if($&&P&&this.docSelection.type==K){for(a=this.docSelection.createRange();a.length;)b=a.item(0),a.remove(b),b.parentNode.removeChild(b);this.refresh()}else if(this.rangeCount&&(c=this.getAllRanges(),c.length)){for(this.removeAllRanges(),d=0,e=c.length;e>d;++d)c[d].deleteContents();this.addRange(c[e-1])}},db.eachRange=function(a,b){for(var c=0,d=this._ranges.length;d>c;++c)if(a(this.getRangeAt(c)))return b},db.getAllRanges=function(){var a=[];return this.eachRange(function(b){a.push(b)}),a},db.setSingleRange=function(a,b){this.removeAllRanges(),this.addRange(a,b)},db.callMethodOnEachRange=function(a,b){var c=[];return this.eachRange(function(d){c.push(d[a].apply(d,b))}),c},db.setStart=w(!0),db.setEnd=w(!1),a.rangePrototype.select=function(a){cb(this.getDocument()).setSingleRange(this,a)},db.changeEachRange=function(a){var b=[],c=this.isBackward();this.eachRange(function(c){a(c),b.push(c)}),this.removeAllRanges(),c&&1==b.length?this.addRange(b[0],"backward"):this.setRanges(b)},db.containsNode=function(a,b){return this.eachRange(function(c){return c.containsNode(a,b)},!0)||!1},db.getBookmark=function(a){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[a])}},db.moveToBookmark=function(b){var c,d,e,f=[];for(c=0;d=b.rangeBookmarks[c++];)e=a.createRange(this.win),e.moveToBookmark(d),f.push(e);b.backward?this.setSingleRange(f[0],"backward"):this.setRanges(f)},db.toHtml=function(){var a=[];return this.eachRange(function(b){a.push(D.toHtml(b))}),a.join("")},J.implementsTextRange&&(db.getNativeTextRange=function(){var c,d;if(c=this.docSelection){if(d=c.createRange(),n(d))return d;throw b.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return a.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw b.createError("getNativeTextRange: selection contains no range")}),db.getName=function(){return"WrappedSelection"},db.inspect=function(){return x(this)},db.detach=function(){t(this.win,"delete"),s(this)},r.detachAll=function(){t(null,"deleteAll")},r.inspect=x,r.isDirectionBackward=c,a.Selection=r,a.selectionPrototype=db,a.addShimListener(function(a){void 0===a.getSelection&&(a.getSelection=function(){return cb(a)}),a=null})}),H)},this),function(a,b){"function"==typeof define&&define.amd?define(["rangy"],a):a(b.rangy)}(function(a){a.createModule("SaveRestore",["WrappedRange"],function(a,b){function c(a,b){return(b||document).getElementById(a)}function d(a,b){var c,d="selectionBoundary_"+ +new Date+"_"+(""+Math.random()).slice(2),e=o.getDocument(a.startContainer),f=a.cloneRange();return f.collapse(b),c=e.createElement("span"),c.id=d,c.style.lineHeight="0",c.style.display="none",c.className="rangySelectionBoundary",c.appendChild(e.createTextNode(p)),f.insertNode(c),c}function e(a,d,e,f){var g=c(e,a);g?(d[f?"setStartBefore":"setEndBefore"](g),g.parentNode.removeChild(g)):b.warn("Marker element has been removed. Cannot restore selection.")}function f(a,b){return b.compareBoundaryPoints(a.START_TO_START,a)}function g(b,c){var e,f,g=a.DomRange.getRangeDocument(b),h=""+b;return b.collapsed?(f=d(b,!1),{document:g,markerId:f.id,collapsed:!0}):(f=d(b,!1),e=d(b,!0),{document:g,startMarkerId:e.id,endMarkerId:f.id,collapsed:!1,backward:c,toString:function(){return"original text: '"+h+"', new text: '"+b+"'"}})}function h(d,f){var g,h,i,j=d.document;return void 0===f&&(f=!0),g=a.createRange(j),d.collapsed?(h=c(d.markerId,j),h?(h.style.display="inline",i=h.previousSibling,i&&3==i.nodeType?(h.parentNode.removeChild(h),g.collapseToPoint(i,i.length)):(g.collapseBefore(h),h.parentNode.removeChild(h))):b.warn("Marker element has been removed. Cannot restore selection.")):(e(j,g,d.startMarkerId,!0),e(j,g,d.endMarkerId,!1)),f&&g.normalizeBoundaries(),g}function i(b,d){var e,h,i,j,k=[];for(b=b.slice(0),b.sort(f),i=0,j=b.length;j>i;++i)k[i]=g(b[i],d);for(i=j-1;i>=0;--i)e=b[i],h=a.DomRange.getRangeDocument(e),e.collapsed?e.collapseAfter(c(k[i].markerId,h)):(e.setEndBefore(c(k[i].endMarkerId,h)),e.setStartAfter(c(k[i].startMarkerId,h)));return k}function j(c){var d,e,f,g;return a.isSelectionValid(c)?(d=a.getSelection(c),e=d.getAllRanges(),f=1==e.length&&d.isBackward(),g=i(e,f),f?d.setSingleRange(e[0],"backward"):d.setRanges(e),{win:c,rangeInfos:g,restored:!1}):(b.warn("Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus."),null)}function k(a){var b,c=[],d=a.length;for(b=d-1;b>=0;b--)c[b]=h(a[b],!0);return c}function l(b,c){var d,e,f,g;b.restored||(d=b.rangeInfos,e=a.getSelection(b.win),f=k(d),g=d.length,1==g&&c&&a.features.selectionHasExtend&&d[0].backward?(e.removeAllRanges(),e.addRange(f[0],!0)):e.setRanges(f),b.restored=!0)}function m(a,b){var d=c(b,a);d&&d.parentNode.removeChild(d)}function n(a){var b,c,d,e=a.rangeInfos;for(b=0,c=e.length;c>b;++b)d=e[b],d.collapsed?m(a.doc,d.markerId):(m(a.doc,d.startMarkerId),m(a.doc,d.endMarkerId))}var o=a.dom,p="";a.util.extend(a,{saveRange:g,restoreRange:h,saveRanges:i,restoreRanges:k,saveSelection:j,restoreSelection:l,removeMarkerElement:m,removeMarkers:n})})},this),Base=function(){},Base.extend=function(a,b){var c,d,e,f=Base.prototype.extend;return Base._prototyping=!0,c=new this,f.call(c,a),c.base=function(){},delete Base._prototyping,d=c.constructor,e=c.constructor=function(){if(!Base._prototyping)if(this._constructing||this.constructor==e)this._constructing=!0,d.apply(this,arguments),delete this._constructing;else if(null!=arguments[0])return(arguments[0].extend||f).call(arguments[0],c)},e.ancestor=this,e.extend=this.extend,e.forEach=this.forEach,e.implement=this.implement,e.prototype=c,e.toString=this.toString,e.valueOf=function(a){return"object"==a?e:d.valueOf()},f.call(e,b),"function"==typeof e.init&&e.init(),e},Base.prototype={extend:function(a,b){var c,d,e,f,g,h,i;if(arguments.length>1)c=this[a],!c||"function"!=typeof b||c.valueOf&&c.valueOf()==b.valueOf()||!/\bbase\b/.test(b)||(d=b.valueOf(),b=function(){var a,b=this.base||Base.prototype.base;return this.base=c,a=d.apply(this,arguments),this.base=b,a},b.valueOf=function(a){return"object"==a?b:d},b.toString=Base.toString),this[a]=b;else if(a){for(e=Base.prototype.extend,Base._prototyping||"function"==typeof this||(e=this.extend||e),f={toSource:null},g=["constructor","toString","valueOf"],h=Base._prototyping?0:1;i=g[h++];)a[i]!=f[i]&&e.call(this,i,a[i]);for(i in a)f[i]||e.call(this,i,a[i])}return this}},Base=Base.extend({constructor:function(){this.extend(arguments[0])}},{ancestor:Object,version:"1.1",forEach:function(a,b,c){for(var d in a)void 0===this.prototype[d]&&b.call(c,a[d],d,a)},implement:function(){for(var a=0;a<arguments.length;a++)"function"==typeof arguments[a]?arguments[a](this.prototype):this.prototype.extend(arguments[a]);return this},toString:function(){return this.valueOf()+""}}),wysihtml5.browser=function(){function a(a){return+(/ipad|iphone|ipod/.test(a)&&a.match(/ os (\d+).+? like mac os x/)||[void 0,0])[1]}function b(a){return+(a.match(/android (\d+)/)||[void 0,0])[1]}function c(a,b){var c,d=-1;return"Microsoft Internet Explorer"==navigator.appName?c=RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"):"Netscape"==navigator.appName&&(c=RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})")),c&&null!=c.exec(navigator.userAgent)&&(d=parseFloat(RegExp.$1)),-1===d?!1:a?b?"<"===b?d>a:">"===b?a>d:"<="===b?d>=a:">="===b?a>=d:void 0:a===d:!0}var d=navigator.userAgent,e=document.createElement("div"),f=-1!==d.indexOf("Gecko")&&-1===d.indexOf("KHTML"),g=-1!==d.indexOf("AppleWebKit/"),h=-1!==d.indexOf("Chrome/"),i=-1!==d.indexOf("Opera/");return{USER_AGENT:d,supported:function(){var c=this.USER_AGENT.toLowerCase(),d="contentEditable"in e,f=document.execCommand&&document.queryCommandSupported&&document.queryCommandState,g=document.querySelector&&document.querySelectorAll,h=this.isIos()&&a(c)<5||this.isAndroid()&&b(c)<4||-1!==c.indexOf("opera mobi")||-1!==c.indexOf("hpwos/");return d&&f&&g&&!h},isTouchDevice:function(){return this.supportsEvent("touchmove")},isIos:function(){return/ipad|iphone|ipod/i.test(this.USER_AGENT)},isAndroid:function(){return-1!==this.USER_AGENT.indexOf("Android")},supportsSandboxedIframes:function(){return c()},throwsMixedContentWarningWhenIframeSrcIsEmpty:function(){return!("querySelector"in document)},displaysCaretInEmptyContentEditableCorrectly:function(){return c()},hasCurrentStyleProperty:function(){return"currentStyle"in e},hasHistoryIssue:function(){return f&&"Mac"===navigator.platform.substr(0,3)},insertsLineBreaksOnReturn:function(){return f},supportsPlaceholderAttributeOn:function(a){return"placeholder"in a},supportsEvent:function(a){return"on"+a in e||function(){return e.setAttribute("on"+a,"return;"),"function"==typeof e["on"+a]}()},supportsEventsInIframeCorrectly:function(){return!i},supportsHTML5Tags:function(a){var b=a.createElement("div"),c="<article>foo</article>";return b.innerHTML=c,b.innerHTML.toLowerCase()===c},supportsCommand:function(){var a={formatBlock:c(10,"<="),insertUnorderedList:c(),insertOrderedList:c()},b={insertHTML:f};return function(c,d){var e=a[d];if(!e){try{return c.queryCommandSupported(d)}catch(f){}try{return c.queryCommandEnabled(d)}catch(g){return!!b[d]}}return!1}}(),doesAutoLinkingInContentEditable:function(){return c()},canDisableAutoLinking:function(){return this.supportsCommand(document,"AutoUrlDetect")},clearsContentEditableCorrectly:function(){return f||i||g},supportsGetAttributeCorrectly:function(){var a=document.createElement("td");return"1"!=a.getAttribute("rowspan")},canSelectImagesInContentEditable:function(){return f||c()||i},autoScrollsToCaret:function(){return!g},autoClosesUnclosedTags:function(){var a,b,c=e.cloneNode(!1);return c.innerHTML="<p><div></div>",b=c.innerHTML.toLowerCase(),a="<p></p><div></div>"===b||"<p><div></div></p>"===b,this.autoClosesUnclosedTags=function(){return a},a},supportsNativeGetElementsByClassName:function(){return-1!==(document.getElementsByClassName+"").indexOf("[native code]")},supportsSelectionModify:function(){return"getSelection"in window&&"modify"in window.getSelection()},needsSpaceAfterLineBreak:function(){return i},supportsSpeechApiOn:function(a){var b=d.match(/Chrome\/(\d+)/)||[void 0,0];return b[1]>=11&&("onwebkitspeechchange"in a||"speech"in a)},crashesWhenDefineProperty:function(a){return c(9)&&("XMLHttpRequest"===a||"XDomainRequest"===a)},doesAsyncFocus:function(){return c()},hasProblemsSettingCaretAfterImg:function(){return c()},hasUndoInContextMenu:function(){return f||h||i},hasInsertNodeIssue:function(){return i},hasIframeFocusIssue:function(){return c()},createsNestedInvalidMarkupAfterPaste:function(){return g},supportsMutationEvents:function(){return"MutationEvent"in window},supportsModenPaste:function(){return!("clipboardData"in window)}}}(),wysihtml5.lang.array=function(a){return{contains:function(b){if(Array.isArray(b)){for(var c=b.length;c--;)if(-1!==wysihtml5.lang.array(a).indexOf(b[c]))return!0;return!1}return-1!==wysihtml5.lang.array(a).indexOf(b)},indexOf:function(b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},without:function(b){b=wysihtml5.lang.array(b);for(var c=[],d=0,e=a.length;e>d;d++)b.contains(a[d])||c.push(a[d]);return c},get:function(){for(var b=0,c=a.length,d=[];c>b;b++)d.push(a[b]);return d},map:function(b,c){if(Array.prototype.map)return a.map(b,c);for(var d=a.length>>>0,e=Array(d),f=0;d>f;f++)e[f]=b.call(c,a[f],f,a);return e},unique:function(){for(var b=[],c=a.length,d=0;c>d;)wysihtml5.lang.array(b).contains(a[d])||b.push(a[d]),d++;return b}}},wysihtml5.lang.Dispatcher=Base.extend({on:function(a,b){return this.events=this.events||{},this.events[a]=this.events[a]||[],this.events[a].push(b),this},off:function(a,b){this.events=this.events||{};var c,d,e=0;if(a){for(c=this.events[a]||[],d=[];e<c.length;e++)c[e]!==b&&b&&d.push(c[e]);this.events[a]=d}else this.events={};return this},fire:function(a,b){this.events=this.events||{};for(var c=this.events[a]||[],d=0;d<c.length;d++)c[d].call(this,b);return this},observe:function(){return this.on.apply(this,arguments)},stopObserving:function(){return this.off.apply(this,arguments)}}),wysihtml5.lang.object=function(a){return{merge:function(b){for(var c in b)a[c]=b[c];return this},get:function(){return a},clone:function(b){var c,d={};if(null===a||!wysihtml5.lang.object(a).isPlainObject())return a;for(c in a)a.hasOwnProperty(c)&&(d[c]=b?wysihtml5.lang.object(a[c]).clone(b):a[c]);return d},isArray:function(){return"[object Array]"===Object.prototype.toString.call(a)},isFunction:function(){return"[object Function]"===Object.prototype.toString.call(a)},isPlainObject:function(){return"[object Object]"===Object.prototype.toString.call(a)}}},function(){var a=/^\s+/,b=/\s+$/,c=/[&<>\t"]/g,d={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"," ":"&nbsp; "};wysihtml5.lang.string=function(e){return e+="",{trim:function(){return e.replace(a,"").replace(b,"")},interpolate:function(a){for(var b in a)e=this.replace("#{"+b+"}").by(a[b]);return e},replace:function(a){return{by:function(b){return e.split(a).join(b)}}},escapeHTML:function(a,b){var f=e.replace(c,function(a){return d[a]});return a&&(f=f.replace(/(?:\r\n|\r|\n)/g,"<br />")),b&&(f=f.replace(/ /gi,"&nbsp; ")),f}}}}(),function(a){function b(a,b){return f(a,b)?a:(a===a.ownerDocument.documentElement&&(a=a.ownerDocument.body),g(a,b))}function c(a){return a.replace(i,function(a,b){var c,d,e=(b.match(j)||[])[1]||"",f=l[e];return b=b.replace(j,""),b.split(f).length>b.split(e).length&&(b+=e,e=""),c=b,d=b,b.length>k&&(d=d.substr(0,k)+"..."),"www."===c.substr(0,4)&&(c="http://"+c),'<a href="'+c+'">'+d+"</a>"+e})}function d(a){var b=a._wysihtml5_tempElement;return b||(b=a._wysihtml5_tempElement=a.createElement("div")),b}function e(b){var e=b.parentNode,f=a.lang.string(b.data).escapeHTML(),g=d(e.ownerDocument);for(g.innerHTML="<span></span>"+c(f),g.removeChild(g.firstChild);g.firstChild;)e.insertBefore(g.firstChild,b);e.removeChild(b)}function f(b,c){for(var d;b.parentNode;){if(b=b.parentNode,d=b.nodeName,b.className&&a.lang.array(b.className.split(" ")).contains(c))return!0;if(h.contains(d))return!0;if("body"===d)return!1}return!1}function g(b,c){if(!(h.contains(b.nodeName)||b.className&&a.lang.array(b.className.split(" ")).contains(c))){if(b.nodeType===a.TEXT_NODE&&b.data.match(i))return e(b),void 0;for(var d=a.lang.array(b.childNodes).get(),f=d.length,j=0;f>j;j++)g(d[j],c);return b}}var h=a.lang.array(["CODE","PRE","A","SCRIPT","HEAD","TITLE","STYLE"]),i=/((https?:\/\/|www\.)[^\s<]{3,})/gi,j=/([^\w\/\-](,?))$/i,k=100,l={")":"(","]":"[","}":"{"};a.dom.autoLink=b,a.dom.autoLink.URL_REG_EXP=i}(wysihtml5),function(a){var b=a.dom;b.addClass=function(a,c){var d=a.classList;return d?d.add(c):(b.hasClass(a,c)||(a.className+=" "+c),void 0)},b.removeClass=function(a,b){var c=a.classList;return c?c.remove(b):(a.className=a.className.replace(RegExp("(^|\\s+)"+b+"(\\s+|$)")," "),void 0)},b.hasClass=function(a,b){var c,d=a.classList;return d?d.contains(b):(c=a.className,c.length>0&&(c==b||RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))}}(wysihtml5),wysihtml5.dom.contains=function(){var a=document.documentElement;return a.contains?function(a,b){return b.nodeType!==wysihtml5.ELEMENT_NODE&&(b=b.parentNode),a!==b&&a.contains(b)}:a.compareDocumentPosition?function(a,b){return!!(16&a.compareDocumentPosition(b))}:void 0}(),wysihtml5.dom.convertToList=function(){function a(a,b){var c=a.createElement("li");return b.appendChild(c),c}function b(a,b){return a.createElement(b)}function c(c,d,e){if("UL"===c.nodeName||"OL"===c.nodeName||"MENU"===c.nodeName)return c;var f,g,h,i,j,k,l,m,n,o=c.ownerDocument,p=b(o,d),q=c.querySelectorAll("br"),r=q.length;for(n=0;r>n;n++)for(i=q[n];(j=i.parentNode)&&j!==c&&j.lastChild===i;){if("block"===wysihtml5.dom.getStyle("display").from(j)){j.removeChild(i);break}wysihtml5.dom.insert(i).after(i.parentNode)}for(f=wysihtml5.lang.array(c.childNodes).get(),g=f.length,n=0;g>n;n++)m=m||a(o,p),h=f[n],k="block"===wysihtml5.dom.getStyle("display").from(h),l="BR"===h.nodeName,!k||e&&wysihtml5.dom.hasClass(h,e)?l?m=m.firstChild?null:m:m.appendChild(h):(m=m.firstChild?a(o,p):m,m.appendChild(h),m=null);return 0===f.length&&a(o,p),c.parentNode.replaceChild(p,c),p}return c}(),wysihtml5.dom.copyAttributes=function(a){return{from:function(b){return{to:function(c){for(var d,e=0,f=a.length;f>e;e++)d=a[e],void 0!==b[d]&&""!==b[d]&&(c[d]=b[d]);return{andTo:arguments.callee}}}}}},function(a){var b=["-webkit-box-sizing","-moz-box-sizing","-ms-box-sizing","box-sizing"],c=function(b){return d(b)?parseInt(a.getStyle("width").from(b),10)<b.offsetWidth:!1},d=function(c){for(var d=0,e=b.length;e>d;d++)if("border-box"===a.getStyle(b[d]).from(c))return b[d]};a.copyStyles=function(d){return{from:function(e){c(e)&&(d=wysihtml5.lang.array(d).without(b));for(var f,g="",h=d.length,i=0;h>i;i++)f=d[i],g+=f+":"+a.getStyle(f).from(e)+";";return{to:function(b){return a.setStyles(g).on(b),{andTo:arguments.callee}}}}}}}(wysihtml5.dom),function(a){a.dom.delegate=function(b,c,d,e){return a.dom.observe(b,d,function(d){for(var f=d.target,g=a.lang.array(b.querySelectorAll(c));f&&f!==b;){if(g.contains(f)){e.call(f,d);break}f=f.parentNode}})}}(wysihtml5),function(a){a.dom.domNode=function(b){var c=[a.ELEMENT_NODE,a.TEXT_NODE],d=function(b){return b.nodeType===a.TEXT_NODE&&/^\s*$/g.test(b.data)};return{prev:function(e){var f=b.previousSibling,g=e&&e.nodeTypes?e.nodeTypes:c;return f?!a.lang.array(g).contains(f.nodeType)||e&&e.ignoreBlankTexts&&d(f)?a.dom.domNode(f).prev(e):f:null},next:function(e){var f=b.nextSibling,g=e&&e.nodeTypes?e.nodeTypes:c;return f?!a.lang.array(g).contains(f.nodeType)||e&&e.ignoreBlankTexts&&d(f)?a.dom.domNode(f).next(e):f:null}}}}(wysihtml5),wysihtml5.dom.getAsDom=function(){var a=function(a,b){var c=b.createElement("div");c.style.display="none",b.body.appendChild(c);try{c.innerHTML=a}catch(d){}return b.body.removeChild(c),c},b=function(a){if(!a._wysihtml5_supportsHTML5Tags){for(var b=0,d=c.length;d>b;b++)a.createElement(c[b]);a._wysihtml5_supportsHTML5Tags=!0}},c=["abbr","article","aside","audio","bdi","canvas","command","datalist","details","figcaption","figure","footer","header","hgroup","keygen","mark","meter","nav","output","progress","rp","rt","ruby","svg","section","source","summary","time","track","video","wbr"];return function(c,d){d=d||document;var e;return"object"==typeof c&&c.nodeType?(e=d.createElement("div"),e.appendChild(c)):wysihtml5.browser.supportsHTML5Tags(d)?(e=d.createElement("div"),e.innerHTML=c):(b(d),e=a(c,d)),e}}(),wysihtml5.dom.getParentElement=function(){function a(a,b){return b&&b.length?"string"==typeof b?a===b:wysihtml5.lang.array(b).contains(a):!0}function b(a){return a.nodeType===wysihtml5.ELEMENT_NODE}function c(a,b,c){var d=(a.className||"").match(c)||[];return b?d[d.length-1]===b:!!d.length}function d(a,b,c){var d=(a.getAttribute("style")||"").match(c)||[];return b?d[d.length-1]===b:!!d.length}return function(e,f,g,h){var i=f.cssStyle||f.styleRegExp,j=f.className||f.classRegExp;for(g=g||50;g--&&e&&"BODY"!==e.nodeName&&(!h||e!==h);){if(b(e)&&a(e.nodeName,f.nodeName)&&(!i||d(e,f.cssStyle,f.styleRegExp))&&(!j||c(e,f.className,f.classRegExp)))return e;e=e.parentNode}return null}}(),wysihtml5.dom.getStyle=function(){function a(a){return a.replace(c,function(a){return a.charAt(1).toUpperCase()
+})}var b={"float":"styleFloat"in document.createElement("div").style?"styleFloat":"cssFloat"},c=/\-[a-z]/g;return function(c){return{from:function(d){var e,f,g,h,i,j,k,l,m;if(d.nodeType===wysihtml5.ELEMENT_NODE){if(e=d.ownerDocument,f=b[c]||a(c),g=d.style,h=d.currentStyle,i=g[f],i)return i;if(h)try{return h[f]}catch(n){}return j=e.defaultView||e.parentWindow,k=("height"===c||"width"===c)&&"TEXTAREA"===d.nodeName,j.getComputedStyle?(k&&(l=g.overflow,g.overflow="hidden"),m=j.getComputedStyle(d,null).getPropertyValue(c),k&&(g.overflow=l||""),m):void 0}}}}}(),wysihtml5.dom.getTextNodes=function(a,b){var c=[];for(a=a.firstChild;a;a=a.nextSibling)3==a.nodeType?b&&/^\s*$/.test(a.innerText||a.textContent)||c.push(a):c=c.concat(wysihtml5.dom.getTextNodes(a,b));return c},wysihtml5.dom.hasElementWithTagName=function(){function a(a){return a._wysihtml5_identifier||(a._wysihtml5_identifier=c++)}var b={},c=1;return function(c,d){var e=a(c)+":"+d,f=b[e];return f||(f=b[e]=c.getElementsByTagName(d)),f.length>0}}(),function(a){function b(a){return a._wysihtml5_identifier||(a._wysihtml5_identifier=d++)}var c={},d=1;a.dom.hasElementWithClassName=function(d,e){if(!a.browser.supportsNativeGetElementsByClassName())return!!d.querySelector("."+e);var f=b(d)+":"+e,g=c[f];return g||(g=c[f]=d.getElementsByClassName(e)),g.length>0}}(wysihtml5),wysihtml5.dom.insert=function(a){return{after:function(b){b.parentNode.insertBefore(a,b.nextSibling)},before:function(b){b.parentNode.insertBefore(a,b)},into:function(b){b.appendChild(a)}}},wysihtml5.dom.insertCSS=function(a){return a=a.join("\n"),{into:function(b){var c,d,e=b.createElement("style");return e.type="text/css",e.styleSheet?e.styleSheet.cssText=a:e.appendChild(b.createTextNode(a)),c=b.querySelector("head link"),c?(c.parentNode.insertBefore(e,c),void 0):(d=b.querySelector("head"),d&&d.appendChild(e),void 0)}}},function(a){a.dom.lineBreaks=function(b){function c(a){return"BR"===a.nodeName}function d(b){return c(b)?!0:"block"===a.dom.getStyle("display").from(b)?!0:!1}return{add:function(){var c=b.ownerDocument,e=a.dom.domNode(b).next({ignoreBlankTexts:!0}),f=a.dom.domNode(b).prev({ignoreBlankTexts:!0});e&&!d(e)&&a.dom.insert(c.createElement("br")).after(b),f&&!d(f)&&a.dom.insert(c.createElement("br")).before(b)},remove:function(){var d=a.dom.domNode(b).next({ignoreBlankTexts:!0}),e=a.dom.domNode(b).prev({ignoreBlankTexts:!0});d&&c(d)&&d.parentNode.removeChild(d),e&&c(e)&&e.parentNode.removeChild(e)}}}}(wysihtml5),wysihtml5.dom.observe=function(a,b,c){b="string"==typeof b?[b]:b;for(var d,e,f=0,g=b.length;g>f;f++)e=b[f],a.addEventListener?a.addEventListener(e,c,!1):(d=function(b){"target"in b||(b.target=b.srcElement),b.preventDefault=b.preventDefault||function(){this.returnValue=!1},b.stopPropagation=b.stopPropagation||function(){this.cancelBubble=!0},c.call(a,b)},a.attachEvent("on"+e,d));return{stop:function(){for(var e,f=0,g=b.length;g>f;f++)e=b[f],a.removeEventListener?a.removeEventListener(e,c,!1):a.detachEvent("on"+e,d)}}},wysihtml5.dom.parse=function(a,b){function c(a,b){var c,f,g,h,i,j,k,l,m;for(wysihtml5.lang.object(t).merge(s).merge(b.rules).get(),c=b.context||a.ownerDocument||document,f=c.createDocumentFragment(),g="string"==typeof a,h=!1,b.clearInternals===!0&&(h=!0),i=g?wysihtml5.dom.getAsDom(a,c):a,t.selectors&&e(i,t.selectors);i.firstChild;)k=i.firstChild,j=d(k,b.cleanUp,h,b.uneditableClass),j&&f.appendChild(j),k!==j&&i.removeChild(k);if(b.unjoinNbsps)for(l=wysihtml5.dom.getTextNodes(f),m=l.length;m--;)l[m].nodeValue=l[m].nodeValue.replace(/([\S\u00A0])\u00A0/gi,"$1 ");return i.innerHTML="",i.appendChild(f),g?wysihtml5.quirks.getCorrectInnerHTML(i):i}function d(a,b,c,e){var f,g,h,i=a.nodeType,j=a.childNodes,k=j.length,l=p[i],m=0;if(e&&1===i&&wysihtml5.dom.hasClass(a,e))return a;if(g=l&&l(a,c),!g){if(g===!1){for(f=a.ownerDocument.createDocumentFragment(),m=k;m--;)j[m]&&(h=d(j[m],b,c,e),h&&(j[m]===h&&m--,f.insertBefore(h,f.firstChild)));return"block"===wysihtml5.dom.getStyle("display").from(a)&&f.appendChild(a.ownerDocument.createElement("br")),wysihtml5.lang.array(["div","pre","p","table","td","th","ul","ol","li","dd","dl","footer","header","section","h1","h2","h3","h4","h5","h6"]).contains(a.nodeName.toLowerCase())&&a.parentNode.lastChild!==a&&(a.nextSibling&&3===a.nextSibling.nodeType&&/^\s/.test(a.nextSibling.nodeValue)||f.appendChild(a.ownerDocument.createTextNode(" "))),f.normalize&&f.normalize(),f}return null}for(m=0;k>m;m++)j[m]&&(h=d(j[m],b,c,e),h&&(j[m]===h&&m--,g.appendChild(h)));if(b&&g.nodeName.toLowerCase()===q&&(!g.childNodes.length||/^\s*$/gi.test(g.innerHTML)&&(c||"_wysihtml5-temp-placeholder"!==a.className&&"rangySelectionBoundary"!==a.className)||!g.attributes.length)){for(f=g.ownerDocument.createDocumentFragment();g.firstChild;)f.appendChild(g.firstChild);return f.normalize&&f.normalize(),f}return g.normalize&&g.normalize(),g}function e(a,b){var c,d,e,f;for(c in b)if(b.hasOwnProperty(c))for(wysihtml5.lang.object(b[c]).isFunction()?d=b[c]:"string"==typeof b[c]&&z[b[c]]&&(d=z[b[c]]),e=a.querySelectorAll(c),f=e.length;f--;)d(e[f])}function f(a,b){var c,d,e,f=t.tags,h=a.nodeName.toLowerCase(),j=a.scopeName;if(a._wysihtml5)return null;if(a._wysihtml5=1,"wysihtml5-temp"===a.className)return null;if(j&&"HTML"!=j&&(h=j+":"+h),"outerHTML"in a&&(wysihtml5.browser.autoClosesUnclosedTags()||"P"!==a.nodeName||"</p>"===a.outerHTML.slice(-4).toLowerCase()||(h="div")),h in f){if(c=f[h],!c||c.remove)return null;if(c.unwrap)return!1;c="string"==typeof c?{rename_tag:c}:c}else{if(!a.firstChild)return null;c={rename_tag:q}}if(c.one_of_type&&!g(a,t,c.one_of_type,b)){if(!c.remove_action)return null;if("unwrap"===c.remove_action)return!1;if("rename"!==c.remove_action)return null;e=c.remove_action_rename_to||q}return d=a.ownerDocument.createElement(e||c.rename_tag||h),m(a,d,c,b),i(a,d,c),a=null,d.normalize&&d.normalize(),d}function g(a,b,c,d){var e,f;if("SPAN"===a.nodeName&&!d&&("_wysihtml5-temp-placeholder"===a.className||"rangySelectionBoundary"===a.className))return!0;for(f in c)if(c.hasOwnProperty(f)&&b.type_definitions&&b.type_definitions[f]&&(e=b.type_definitions[f],h(a,e)))return!0;return!1}function h(a,b){var c,d,e,f,g,h,i,j,k=a.getAttribute("class"),l=a.getAttribute("style");if(b.methods)for(h in b.methods)if(b.methods.hasOwnProperty(h)&&y[h]&&y[h](a))return!0;if(k&&b.classes)for(k=k.replace(/^\s+/g,"").replace(/\s+$/g,"").split(r),c=k.length,i=0;c>i;i++)if(b.classes[k[i]])return!0;if(l&&b.styles){l=l.split(";");for(d in b.styles)if(b.styles.hasOwnProperty(d))for(j=l.length;j--;)if(g=l[j].split(":"),g[0].replace(/\s/g,"").toLowerCase()===d&&(b.styles[d]===!0||1===b.styles[d]||wysihtml5.lang.array(b.styles[d]).contains(g[1].replace(/\s/g,"").toLowerCase())))return!0}if(b.attrs)for(e in b.attrs)if(b.attrs.hasOwnProperty(e)&&(f=wysihtml5.dom.getAttribute(a,e),"string"==typeof f&&f.search(b.attrs[e])>-1))return!0;return!1}function i(a,b,c){var d,e;if(c&&c.keep_styles)for(d in c.keep_styles)if(c.keep_styles.hasOwnProperty(d)){if(e="float"===d?a.style.styleFloat||a.style.cssFloat:a.style[d],c.keep_styles[d]instanceof RegExp&&!c.keep_styles[d].test(e))continue;"float"===d?b.style[a.style.styleFloat?"styleFloat":"cssFloat"]=e:a.style[d]&&(b.style[d]=e)}}function j(a,b){var c,d=[];for(c in b)b.hasOwnProperty(c)&&0===c.indexOf(a)&&d.push(c);return d}function k(a,b,c,d){var e,f=v[c];return f&&(b||"alt"===a&&"IMG"==d)&&(e=f(b),"string"==typeof e)?e:!1}function l(a,b){var c,d,e,f,g,h=wysihtml5.lang.object(t.attributes||{}).clone(),i=wysihtml5.lang.object(h).merge(wysihtml5.lang.object(b||{}).clone()).get(),l={},m=wysihtml5.dom.getAttributes(a);for(c in i)if(/\*$/.test(c))for(e=j(c.slice(0,-1),m),f=0,g=e.length;g>f;f++)d=k(e[f],m[e[f]],i[c],a.nodeName),d!==!1&&(l[e[f]]=d);else d=k(c,m[c],i[c],a.nodeName),d!==!1&&(l[c]=d);return l}function m(a,b,c,d){var e,f,g,h,i,j={},k=c.set_class,m=c.add_class,n=c.add_style,o=c.set_attributes,p=t.classes,q=0,s=[],u=[],v=[],y=[];if(o&&(j=wysihtml5.lang.object(o).clone()),j=wysihtml5.lang.object(j).merge(l(a,c.check_attributes)).get(),k&&s.push(k),m)for(h in m)i=x[m[h]],i&&(g=i(wysihtml5.dom.getAttribute(a,h)),"string"==typeof g&&s.push(g));if(n)for(h in n)i=w[n[h]],i&&(newStyle=i(wysihtml5.dom.getAttribute(a,h)),"string"==typeof newStyle&&u.push(newStyle));if("string"==typeof p&&"any"===p&&a.getAttribute("class"))if(t.classes_blacklist){for(y=a.getAttribute("class"),y&&(s=s.concat(y.split(r))),e=s.length;e>q;q++)f=s[q],t.classes_blacklist[f]||v.push(f);v.length&&(j["class"]=wysihtml5.lang.array(v).unique().join(" "))}else j["class"]=a.getAttribute("class");else{for(d||(p["_wysihtml5-temp-placeholder"]=1,p._rangySelectionBoundary=1,p["wysiwyg-tmp-selected-cell"]=1),y=a.getAttribute("class"),y&&(s=s.concat(y.split(r))),e=s.length;e>q;q++)f=s[q],p[f]&&v.push(f);v.length&&(j["class"]=wysihtml5.lang.array(v).unique().join(" "))}j["class"]&&d&&(j["class"]=j["class"].replace("wysiwyg-tmp-selected-cell",""),/^\s*$/g.test(j["class"])&&delete j["class"]),u.length&&(j.style=wysihtml5.lang.array(u).unique().join(" "));for(h in j)try{b.setAttribute(h,j[h])}catch(z){}j.src&&(void 0!==j.width&&b.setAttribute("width",j.width),void 0!==j.height&&b.setAttribute("height",j.height))}function n(a){var b,c=a.nextSibling;return c&&c.nodeType===wysihtml5.TEXT_NODE?(c.data=a.data.replace(u,"")+c.data.replace(u,""),void 0):(b=a.data.replace(u,""),a.ownerDocument.createTextNode(b))}function o(a){return t.comments?a.ownerDocument.createComment(a.nodeValue):void 0}var p={1:f,3:n,8:o},q="span",r=/\s+/,s={tags:{},classes:{}},t={},u=/\uFEFF/g,v={url:function(){var a=/^https?:\/\//i;return function(b){return b&&b.match(a)?b.replace(a,function(a){return a.toLowerCase()}):null}}(),src:function(){var a=/^(\/|https?:\/\/)/i;return function(b){return b&&b.match(a)?b.replace(a,function(a){return a.toLowerCase()}):null}}(),href:function(){var a=/^(#|\/|https?:\/\/|mailto:)/i;return function(b){return b&&b.match(a)?b.replace(a,function(a){return a.toLowerCase()}):null}}(),alt:function(){var a=/[^ a-z0-9_\-]/gi;return function(b){return b?b.replace(a,""):""}}(),numbers:function(){var a=/\D/g;return function(b){return b=(b||"").replace(a,""),b||null}}(),any:function(){return function(a){return a}}()},w={align_text:function(){var a={left:"text-align: left;",right:"text-align: right;",center:"text-align: center;"};return function(b){return a[(b+"").toLowerCase()]}}()},x={align_img:function(){var a={left:"wysiwyg-float-left",right:"wysiwyg-float-right"};return function(b){return a[(b+"").toLowerCase()]}}(),align_text:function(){var a={left:"wysiwyg-text-align-left",right:"wysiwyg-text-align-right",center:"wysiwyg-text-align-center",justify:"wysiwyg-text-align-justify"};return function(b){return a[(b+"").toLowerCase()]}}(),clear_br:function(){var a={left:"wysiwyg-clear-left",right:"wysiwyg-clear-right",both:"wysiwyg-clear-both",all:"wysiwyg-clear-both"};return function(b){return a[(b+"").toLowerCase()]}}(),size_font:function(){var a={1:"wysiwyg-font-size-xx-small",2:"wysiwyg-font-size-small",3:"wysiwyg-font-size-medium",4:"wysiwyg-font-size-large",5:"wysiwyg-font-size-x-large",6:"wysiwyg-font-size-xx-large",7:"wysiwyg-font-size-xx-large","-":"wysiwyg-font-size-smaller","+":"wysiwyg-font-size-larger"};return function(b){return a[(b+"").charAt(0)]}}()},y={has_visible_contet:function(){var a,b=["img","video","picture","br","script","noscript","style","table","iframe","object","embed","audio","svg","input","button","select","textarea","canvas"];return function(c){if(a=(c.innerText||c.textContent).replace(/\s/g,""),a&&a.length>0)return!0;for(var d=b.length;d--;)if(c.querySelector(b[d]))return!0;return c.offsetWidth&&c.offsetWidth>0&&c.offsetHeight&&c.offsetHeight>0?!0:!1}}()},z={unwrap:function(a){wysihtml5.dom.unwrap(a)},remove:function(a){a.parentNode.removeChild(a)}};return c(a,b)},wysihtml5.dom.removeEmptyTextNodes=function(a){for(var b,c=wysihtml5.lang.array(a.childNodes).get(),d=c.length,e=0;d>e;e++)b=c[e],b.nodeType===wysihtml5.TEXT_NODE&&""===b.data&&b.parentNode.removeChild(b)},wysihtml5.dom.renameElement=function(a,b){for(var c,d=a.ownerDocument.createElement(b);c=a.firstChild;)d.appendChild(c);return wysihtml5.dom.copyAttributes(["align","className"]).from(a).to(d),a.parentNode.replaceChild(d,a),d},wysihtml5.dom.replaceWithChildNodes=function(a){if(a.parentNode){if(!a.firstChild)return a.parentNode.removeChild(a),void 0;for(var b=a.ownerDocument.createDocumentFragment();a.firstChild;)b.appendChild(a.firstChild);a.parentNode.replaceChild(b,a),a=b=null}},function(a){function b(b){return"block"===a.getStyle("display").from(b)}function c(a){return"BR"===a.nodeName}function d(a){var b=a.ownerDocument.createElement("br");a.appendChild(b)}function e(a,e){if(a.nodeName.match(/^(MENU|UL|OL)$/)){var f,g,h,i,j,k,l=a.ownerDocument,m=l.createDocumentFragment(),n=wysihtml5.dom.domNode(a).prev({ignoreBlankTexts:!0});if(e)for(!n||b(n)||c(n)||d(m);k=a.firstElementChild||a.firstChild;){for(g=k.lastChild;f=k.firstChild;)h=f===g,i=h&&!b(f)&&!c(f),m.appendChild(f),i&&d(m);k.parentNode.removeChild(k)}else for(;k=a.firstElementChild||a.firstChild;){if(k.querySelector&&k.querySelector("div, p, ul, ol, menu, blockquote, h1, h2, h3, h4, h5, h6"))for(;f=k.firstChild;)m.appendChild(f);else{for(j=l.createElement("p");f=k.firstChild;)j.appendChild(f);m.appendChild(j)}k.parentNode.removeChild(k)}a.parentNode.replaceChild(m,a)}}a.resolveList=e}(wysihtml5.dom),function(a){var b=document,c=["parent","top","opener","frameElement","frames","localStorage","globalStorage","sessionStorage","indexedDB"],d=["open","close","openDialog","showModalDialog","alert","confirm","prompt","openDatabase","postMessage","XMLHttpRequest","XDomainRequest"],e=["referrer","write","open","close"];a.dom.Sandbox=Base.extend({constructor:function(b,c){this.callback=b||a.EMPTY_FUNCTION,this.config=a.lang.object({}).merge(c).get(),this.editableArea=this._createIframe()},insertInto:function(a){"string"==typeof a&&(a=b.getElementById(a)),a.appendChild(this.editableArea)},getIframe:function(){return this.editableArea},getWindow:function(){this._readyError()},getDocument:function(){this._readyError()},destroy:function(){var a=this.getIframe();a.parentNode.removeChild(a)},_readyError:function(){throw Error("wysihtml5.Sandbox: Sandbox iframe isn't loaded yet")},_createIframe:function(){var c=this,d=b.createElement("iframe");return d.className="wysihtml5-sandbox",a.dom.setAttributes({security:"restricted",allowtransparency:"true",frameborder:0,width:0,height:0,marginwidth:0,marginheight:0}).on(d),a.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty()&&(d.src="javascript:'<html></html>'"),d.onload=function(){d.onreadystatechange=d.onload=null,c._onLoadIframe(d)},d.onreadystatechange=function(){/loaded|complete/.test(d.readyState)&&(d.onreadystatechange=d.onload=null,c._onLoadIframe(d))},d},_onLoadIframe:function(f){var g,h,i,j,k,l,m;if(a.dom.contains(b.documentElement,f)){if(g=this,h=f.contentWindow,i=f.contentWindow.document,j=b.characterSet||b.charset||"utf-8",k=this._getHtml({charset:j,stylesheets:this.config.stylesheets}),i.open("text/html","replace"),i.write(k),i.close(),this.getWindow=function(){return f.contentWindow},this.getDocument=function(){return f.contentWindow.document},h.onerror=function(a,b,c){throw Error("wysihtml5.Sandbox: "+a,b,c)},!a.browser.supportsSandboxedIframes()){for(l=0,m=c.length;m>l;l++)this._unset(h,c[l]);for(l=0,m=d.length;m>l;l++)this._unset(h,d[l],a.EMPTY_FUNCTION);for(l=0,m=e.length;m>l;l++)this._unset(i,e[l]);this._unset(i,"cookie","",!0)}this.loaded=!0,setTimeout(function(){g.callback(g)},0)}},_getHtml:function(b){var c,d=b.stylesheets,e="",f=0;if(d="string"==typeof d?[d]:d,d)for(c=d.length;c>f;f++)e+='<link rel="stylesheet" href="'+d[f]+'">';return b.stylesheets=e,a.lang.string('<!DOCTYPE html><html><head><meta charset="#{charset}">#{stylesheets}</head><body></body></html>').interpolate(b)},_unset:function(b,c,d,e){try{b[c]=d}catch(f){}try{b.__defineGetter__(c,function(){return d})}catch(f){}if(e)try{b.__defineSetter__(c,function(){})}catch(f){}if(!a.browser.crashesWhenDefineProperty(c))try{var g={get:function(){return d}};e&&(g.set=function(){}),Object.defineProperty(b,c,g)}catch(f){}}})}(wysihtml5),function(a){var b=document;a.dom.ContentEditableArea=Base.extend({getContentEditable:function(){return this.element},getWindow:function(){return this.element.ownerDocument.defaultView},getDocument:function(){return this.element.ownerDocument},constructor:function(b,c,d){this.callback=b||a.EMPTY_FUNCTION,this.config=a.lang.object({}).merge(c).get(),this.element=d?this._bindElement(d):this._createElement()},_createElement:function(){var a=b.createElement("div");return a.className="wysihtml5-sandbox",this._loadElement(a),a},_bindElement:function(a){return a.className=a.className&&""!=a.className?a.className+" wysihtml5-sandbox":"wysihtml5-sandbox",this._loadElement(a,!0),a},_loadElement:function(a,b){var c,d=this;b||(c=this._getHtml(),a.innerHTML=c),this.getWindow=function(){return a.ownerDocument.defaultView},this.getDocument=function(){return a.ownerDocument},this.loaded=!0,setTimeout(function(){d.callback(d)},0)},_getHtml:function(){return""}})}(wysihtml5),function(){var a={className:"class"};wysihtml5.dom.setAttributes=function(b){return{on:function(c){for(var d in b)c.setAttribute(a[d]||d,b[d])}}}}(),wysihtml5.dom.setStyles=function(a){return{on:function(b){var c,d=b.style;if("string"==typeof a)return d.cssText+=";"+a,void 0;for(c in a)"float"===c?(d.cssFloat=a[c],d.styleFloat=a[c]):d[c]=a[c]}}},function(a){a.simulatePlaceholder=function(b,c,d){var e="placeholder",f=function(){var b=c.element.offsetWidth>0&&c.element.offsetHeight>0;c.hasPlaceholderSet()&&(c.clear(),c.element.focus(),b&&setTimeout(function(){var a=c.selection.getSelection();a.focusNode&&a.anchorNode||c.selection.selectNode(c.element.firstChild||c.element)},0)),c.placeholderSet=!1,a.removeClass(c.element,e)},g=function(){c.isEmpty()&&(c.placeholderSet=!0,c.setValue(d),a.addClass(c.element,e))};b.on("set_placeholder",g).on("unset_placeholder",f).on("focus:composer",f).on("paste:composer",f).on("blur:composer",g),g()}}(wysihtml5.dom),function(a){var b=document.documentElement;"textContent"in b?(a.setTextContent=function(a,b){a.textContent=b},a.getTextContent=function(a){return a.textContent}):"innerText"in b?(a.setTextContent=function(a,b){a.innerText=b},a.getTextContent=function(a){return a.innerText}):(a.setTextContent=function(a,b){a.nodeValue=b},a.getTextContent=function(a){return a.nodeValue})}(wysihtml5.dom),wysihtml5.dom.getAttribute=function(a,b){var c,d,e,f=!wysihtml5.browser.supportsGetAttributeCorrectly();return b=b.toLowerCase(),c=a.nodeName,"IMG"==c&&"src"==b&&wysihtml5.dom.isLoadedImage(a)===!0?a.src:f&&"outerHTML"in a?(d=a.outerHTML.toLowerCase(),e=-1!=d.indexOf(" "+b+"="),e?a.getAttribute(b):null):a.getAttribute(b)},wysihtml5.dom.getAttributes=function(a){var b,c=!wysihtml5.browser.supportsGetAttributeCorrectly(),d=a.nodeName,e=[];for(b in a.attributes)(a.attributes.hasOwnProperty&&a.attributes.hasOwnProperty(b)||!a.attributes.hasOwnProperty&&Object.prototype.hasOwnProperty.call(a.attributes,b))&&a.attributes[b].specified&&("IMG"==d&&"src"==a.attributes[b].name.toLowerCase()&&wysihtml5.dom.isLoadedImage(a)===!0?e.src=a.src:wysihtml5.lang.array(["rowspan","colspan"]).contains(a.attributes[b].name.toLowerCase())&&c?1!==a.attributes[b].value&&(e[a.attributes[b].name]=a.attributes[b].value):e[a.attributes[b].name]=a.attributes[b].value);return e},wysihtml5.dom.isLoadedImage=function(a){try{return a.complete&&!a.mozMatchesSelector(":-moz-broken")}catch(b){if(a.complete&&"complete"===a.readyState)return!0}},function(a){function b(a,b){var c,d,e,f,g=[];for(d=0,e=a.length;e>d;d++)if(c=a[d].querySelectorAll(b),c)for(f=c.length;f--;g.unshift(c[f]));return g}function d(a){a.parentNode.removeChild(a)}function e(a,b){a.parentNode.insertBefore(b,a.nextSibling)}function f(a,b){for(var c=a.nextSibling;1!=c.nodeType;)if(c=c.nextSibling,!b||b==c.tagName.toLowerCase())return c;return null}var g=a.dom,h=function(a){this.el=a,this.isColspan=!1,this.isRowspan=!1,this.firstCol=!0,this.lastCol=!0,this.firstRow=!0,this.lastRow=!0,this.isReal=!0,this.spanCollection=[],this.modified=!1},i=function(a,b){a?(this.cell=a,this.table=g.getParentElement(a,{nodeName:["TABLE"]})):b&&(this.table=b,this.cell=this.table.querySelectorAll("th, td")[0])};i.prototype={addSpannedCellToMap:function(a,b,c,d,e,f){var g,i,j=[],k=c+(f?parseInt(f,10)-1:0),l=d+(e?parseInt(e,10)-1:0);for(g=c;k>=g;g++)for(void 0===b[g]&&(b[g]=[]),i=d;l>=i;i++)b[g][i]=new h(a),b[g][i].isColspan=e&&parseInt(e,10)>1,b[g][i].isRowspan=f&&parseInt(f,10)>1,b[g][i].firstCol=i==d,b[g][i].lastCol=i==l,b[g][i].firstRow=g==c,b[g][i].lastRow=g==k,b[g][i].isReal=i==d&&g==c,b[g][i].spanCollection=j,j.push(b[g][i])},setCellAsModified:function(a){if(a.modified=!0,a.spanCollection.length>0)for(var b=0,c=a.spanCollection.length;c>b;b++)a.spanCollection[b].modified=!0},setTableMap:function(){var a,b,c,d,e,f,i,j,k=[],l=this.getTableRows();for(a=0;a<l.length;a++)for(b=l[a],c=this.getRowCells(b),f=0,void 0===k[a]&&(k[a]=[]),d=0;d<c.length;d++){for(e=c[d];void 0!==k[a][f];)f++;i=g.getAttribute(e,"colspan"),j=g.getAttribute(e,"rowspan"),i||j?(this.addSpannedCellToMap(e,k,a,f,i,j),f+=i?parseInt(i,10):1):(k[a][f]=new h(e),f++)}return this.map=k,k},getRowCells:function(c){var d=this.table.querySelectorAll("table"),e=d?b(d,"th, td"):[],f=c.querySelectorAll("th, td"),g=e.length>0?a.lang.array(f).without(e):f;return g},getTableRows:function(){var c=this.table.querySelectorAll("table"),d=c?b(c,"tr"):[],e=this.table.querySelectorAll("tr"),f=d.length>0?a.lang.array(e).without(d):e;return f},getMapIndex:function(a){var b,c,d=this.map.length,e=this.map&&this.map[0]?this.map[0].length:0;for(b=0;d>b;b++)for(c=0;e>c;c++)if(this.map[b][c].el===a)return{row:b,col:c};return!1},getElementAtIndex:function(a){return this.setTableMap(),this.map[a.row]&&this.map[a.row][a.col]&&this.map[a.row][a.col].el?this.map[a.row][a.col].el:null},getMapElsTo:function(a){var b,c,d,e,f,g,h=[];if(this.setTableMap(),this.idx_start=this.getMapIndex(this.cell),this.idx_end=this.getMapIndex(a),(this.idx_start.row>this.idx_end.row||this.idx_start.row==this.idx_end.row&&this.idx_start.col>this.idx_end.col)&&(b=this.idx_start,this.idx_start=this.idx_end,this.idx_end=b),this.idx_start.col>this.idx_end.col&&(c=this.idx_start.col,this.idx_start.col=this.idx_end.col,this.idx_end.col=c),null!=this.idx_start&&null!=this.idx_end)for(d=this.idx_start.row,e=this.idx_end.row;e>=d;d++)for(f=this.idx_start.col,g=this.idx_end.col;g>=f;f++)h.push(this.map[d][f].el);return h},orderSelectionEnds:function(a){var b,c;return this.setTableMap(),this.idx_start=this.getMapIndex(this.cell),this.idx_end=this.getMapIndex(a),(this.idx_start.row>this.idx_end.row||this.idx_start.row==this.idx_end.row&&this.idx_start.col>this.idx_end.col)&&(b=this.idx_start,this.idx_start=this.idx_end,this.idx_end=b),this.idx_start.col>this.idx_end.col&&(c=this.idx_start.col,this.idx_start.col=this.idx_end.col,this.idx_end.col=c),{start:this.map[this.idx_start.row][this.idx_start.col].el,end:this.map[this.idx_end.row][this.idx_end.col].el}},createCells:function(a,b,c){var d,e,f,g=this.table.ownerDocument,h=g.createDocumentFragment();for(e=0;b>e;e++){if(d=g.createElement(a),c)for(f in c)c.hasOwnProperty(f)&&d.setAttribute(f,c[f]);d.appendChild(document.createTextNode(" ")),h.appendChild(d)}return h},correctColIndexForUnreals:function(a,b){var c,d,e=this.map[b],f=-1;for(c=0,d=a;a>c;c++)e[c].isReal&&f++;return f},getLastNewCellOnRow:function(a,b){var c,d,e,f,g=this.getRowCells(a);for(e=0,f=g.length;f>e;e++)if(c=g[e],d=this.getMapIndex(c),d===!1||void 0!==b&&d.row!=b)return c;return null},removeEmptyTable:function(){var a=this.table.querySelectorAll("td, th");return a&&0!=a.length?!1:(d(this.table),!0)},splitRowToCells:function(a){var b,c,d;a.isColspan&&(b=parseInt(g.getAttribute(a.el,"colspan")||1,10),c=a.el.tagName.toLowerCase(),b>1&&(d=this.createCells(c,b-1),e(a.el,d)),a.el.removeAttribute("colspan"))},getRealRowEl:function(a,b){var c,d,e=null,f=null;for(b=b||this.idx,c=0,d=this.map[b.row].length;d>c;c++)if(f=this.map[b.row][c],f.isReal&&(e=g.getParentElement(f.el,{nodeName:["TR"]}),e))return e;return null===e&&a&&(e=g.getParentElement(this.map[b.row][b.col].el,{nodeName:["TR"]})||null),e},injectRowAt:function(a,b,c,d,f){var h,i,j=this.getRealRowEl(!1,{row:a,col:b}),k=this.createCells(d,c);j?(h=this.correctColIndexForUnreals(b,a),h>=0?e(this.getRowCells(j)[h],k):j.insertBefore(k,j.firstChild)):(i=this.table.ownerDocument.createElement("tr"),i.appendChild(k),e(g.getParentElement(f.el,{nodeName:["TR"]}),i))},canMerge:function(a){var b,c,d,e,f,g;for(this.to=a,this.setTableMap(),this.idx_start=this.getMapIndex(this.cell),this.idx_end=this.getMapIndex(this.to),(this.idx_start.row>this.idx_end.row||this.idx_start.row==this.idx_end.row&&this.idx_start.col>this.idx_end.col)&&(b=this.idx_start,this.idx_start=this.idx_end,this.idx_end=b),this.idx_start.col>this.idx_end.col&&(c=this.idx_start.col,this.idx_start.col=this.idx_end.col,this.idx_end.col=c),d=this.idx_start.row,e=this.idx_end.row;e>=d;d++)for(f=this.idx_start.col,g=this.idx_end.col;g>=f;f++)if(this.map[d][f].isColspan||this.map[d][f].isRowspan)return!1;return!0},decreaseCellSpan:function(a,b){var c=parseInt(g.getAttribute(a.el,b),10)-1;c>=1?a.el.setAttribute(b,c):(a.el.removeAttribute(b),"colspan"==b&&(a.isColspan=!1),"rowspan"==b&&(a.isRowspan=!1),a.firstCol=!0,a.lastCol=!0,a.firstRow=!0,a.lastRow=!0,a.isReal=!0)},removeSurplusLines:function(){var a,b,c,e,f,h,i,j;if(this.setTableMap(),this.map){for(c=0,e=this.map.length;e>c;c++){for(a=this.map[c],i=!0,f=0,h=a.length;h>f;f++)if(b=a[f],!(g.getAttribute(b.el,"rowspan")&&parseInt(g.getAttribute(b.el,"rowspan"),10)>1&&b.firstRow!==!0)){i=!1;break}if(i)for(f=0;h>f;f++)this.decreaseCellSpan(a[f],"rowspan")}for(j=this.getTableRows(),c=0,e=j.length;e>c;c++)a=j[c],0==a.childNodes.length&&/^\s*$/.test(a.textContent||a.innerText)&&d(a)}},fillMissingCells:function(){var a,b,c,d=0,f=0,g=null;if(this.setTableMap(),this.map){for(d=this.map.length,a=0;d>a;a++)this.map[a].length>f&&(f=this.map[a].length);for(b=0;d>b;b++)for(c=0;f>c;c++)this.map[b]&&!this.map[b][c]&&c>0&&(this.map[b][c]=new h(this.createCells("td",1)),g=this.map[b][c-1],g&&g.el&&g.el.parent&&e(this.map[b][c-1].el,this.map[b][c].el))}},rectify:function(){return this.removeEmptyTable()?!1:(this.removeSurplusLines(),this.fillMissingCells(),!0)},unmerge:function(){var a,b,c,d,e,f;if(this.rectify()&&(this.setTableMap(),this.idx=this.getMapIndex(this.cell),this.idx)){if(a=this.map[this.idx.row][this.idx.col],b=g.getAttribute(a.el,"colspan")?parseInt(g.getAttribute(a.el,"colspan"),10):1,c=a.el.tagName.toLowerCase(),a.isRowspan){if(d=parseInt(g.getAttribute(a.el,"rowspan"),10),d>1)for(e=1,f=d-1;f>=e;e++)this.injectRowAt(this.idx.row+e,this.idx.col,b,c,a);a.el.removeAttribute("rowspan")}this.splitRowToCells(a)}},merge:function(a){var b,c,e,f,g,h;if(this.rectify())if(this.canMerge(a)){for(b=this.idx_end.row-this.idx_start.row+1,c=this.idx_end.col-this.idx_start.col+1,e=this.idx_start.row,f=this.idx_end.row;f>=e;e++)for(g=this.idx_start.col,h=this.idx_end.col;h>=g;g++)e==this.idx_start.row&&g==this.idx_start.col?(b>1&&this.map[e][g].el.setAttribute("rowspan",b),c>1&&this.map[e][g].el.setAttribute("colspan",c)):(/^\s*<br\/?>\s*$/.test(this.map[e][g].el.innerHTML.toLowerCase())||(this.map[this.idx_start.row][this.idx_start.col].el.innerHTML+=" "+this.map[e][g].el.innerHTML),d(this.map[e][g].el));this.rectify()}else window.console&&void 0},collapseCellToNextRow:function(a){var b,c,d,f=this.getMapIndex(a.el),h=f.row+1,i={row:h,col:f.col};h<this.map.length&&(b=this.getRealRowEl(!1,i),null!==b&&(c=this.correctColIndexForUnreals(i.col,i.row),c>=0?e(this.getRowCells(b)[c],a.el):(d=this.getLastNewCellOnRow(b,h),null!==d?e(d,a.el):b.insertBefore(a.el,b.firstChild)),parseInt(g.getAttribute(a.el,"rowspan"),10)>2?a.el.setAttribute("rowspan",parseInt(g.getAttribute(a.el,"rowspan"),10)-1):a.el.removeAttribute("rowspan")))},removeRowCell:function(a){a.isReal?a.isRowspan?this.collapseCellToNextRow(a):d(a.el):parseInt(g.getAttribute(a.el,"rowspan"),10)>2?a.el.setAttribute("rowspan",parseInt(g.getAttribute(a.el,"rowspan"),10)-1):a.el.removeAttribute("rowspan")},getRowElementsByCell:function(){var a,b,c,d=[];if(this.setTableMap(),this.idx=this.getMapIndex(this.cell),this.idx!==!1)for(a=this.map[this.idx.row],b=0,c=a.length;c>b;b++)a[b].isReal&&d.push(a[b].el);return d},getColumnElementsByCell:function(){var a,b,c=[];if(this.setTableMap(),this.idx=this.getMapIndex(this.cell),this.idx!==!1)for(a=0,b=this.map.length;b>a;a++)this.map[a][this.idx.col]&&this.map[a][this.idx.col].isReal&&c.push(this.map[a][this.idx.col].el);return c},removeRow:function(){var a,b,c,e=g.getParentElement(this.cell,{nodeName:["TR"]});if(e){if(this.setTableMap(),this.idx=this.getMapIndex(this.cell),this.idx!==!1)for(a=this.map[this.idx.row],b=0,c=a.length;c>b;b++)a[b].modified||(this.setCellAsModified(a[b]),this.removeRowCell(a[b]));d(e)}},removeColCell:function(a){a.isColspan?parseInt(g.getAttribute(a.el,"colspan"),10)>2?a.el.setAttribute("colspan",parseInt(g.getAttribute(a.el,"colspan"),10)-1):a.el.removeAttribute("colspan"):a.isReal&&d(a.el)},removeColumn:function(){if(this.setTableMap(),this.idx=this.getMapIndex(this.cell),this.idx!==!1)for(var a=0,b=this.map.length;b>a;a++)this.map[a][this.idx.col].modified||(this.setCellAsModified(this.map[a][this.idx.col]),this.removeColCell(this.map[a][this.idx.col]))},remove:function(a){if(this.rectify()){switch(a){case"row":this.removeRow();break;case"column":this.removeColumn()}this.rectify()}},addRow:function(a){var b,c,d,f,h,i=this.table.ownerDocument;if(this.setTableMap(),this.idx=this.getMapIndex(this.cell),"below"==a&&g.getAttribute(this.cell,"rowspan")&&(this.idx.row=this.idx.row+parseInt(g.getAttribute(this.cell,"rowspan"),10)-1),this.idx!==!1){for(b=this.map[this.idx.row],c=i.createElement("tr"),d=0,f=b.length;f>d;d++)b[d].modified||(this.setCellAsModified(b[d]),this.addRowCell(b[d],c,a));switch(a){case"below":e(this.getRealRowEl(!0),c);break;case"above":h=g.getParentElement(this.map[this.idx.row][this.idx.col].el,{nodeName:["TR"]}),h&&h.parentNode.insertBefore(c,h)}}},addRowCell:function(a,b,d){var e=a.isColspan?{colspan:g.getAttribute(a.el,"colspan")}:null;a.isReal?"above"!=d&&a.isRowspan?a.el.setAttribute("rowspan",parseInt(g.getAttribute(a.el,"rowspan"),10)+1):b.appendChild(this.createCells("td",1,e)):"above"!=d&&a.isRowspan&&a.lastRow?b.appendChild(this.createCells("td",1,e)):c.isRowspan&&a.el.attr("rowspan",parseInt(g.getAttribute(a.el,"rowspan"),10)+1)},add:function(a){this.rectify()&&(("below"==a||"above"==a)&&this.addRow(a),("before"==a||"after"==a)&&this.addColumn(a))},addColCell:function(a,b,d){var f,h=a.el.tagName.toLowerCase();switch(d){case"before":f=!a.isColspan||a.firstCol;break;case"after":f=!a.isColspan||a.lastCol||a.isColspan&&c.el==this.cell}if(f){switch(d){case"before":a.el.parentNode.insertBefore(this.createCells(h,1),a.el);break;case"after":e(a.el,this.createCells(h,1))}a.isRowspan&&this.handleCellAddWithRowspan(a,b+1,d)}else a.el.setAttribute("colspan",parseInt(g.getAttribute(a.el,"colspan"),10)+1)},addColumn:function(a){var b,c,d,e;if(this.setTableMap(),this.idx=this.getMapIndex(this.cell),"after"==a&&g.getAttribute(this.cell,"colspan")&&(this.idx.col=this.idx.col+parseInt(g.getAttribute(this.cell,"colspan"),10)-1),this.idx!==!1)for(d=0,e=this.map.length;e>d;d++)b=this.map[d],b[this.idx.col]&&(c=b[this.idx.col],c.modified||(this.setCellAsModified(c),this.addColCell(c,d,a)))},handleCellAddWithRowspan:function(a,b,c){var d,h,i,j,k=parseInt(g.getAttribute(this.cell,"rowspan"),10)-1,l=g.getParentElement(a.el,{nodeName:["TR"]}),m=a.el.tagName.toLowerCase(),n=this.table.ownerDocument;for(j=0;k>j;j++)if(d=this.correctColIndexForUnreals(this.idx.col,b+j),l=f(l,"tr"),l)if(d>0)switch(c){case"before":h=this.getRowCells(l),d>0&&this.map[b+j][this.idx.col].el!=h[d]&&d==h.length-1?e(h[d],this.createCells(m,1)):h[d].parentNode.insertBefore(this.createCells(m,1),h[d]);
+break;case"after":e(this.getRowCells(l)[d],this.createCells(m,1))}else l.insertBefore(this.createCells(m,1),l.firstChild);else i=n.createElement("tr"),i.appendChild(this.createCells(m,1)),this.table.appendChild(i)}},g.table={getCellsBetween:function(a,b){var c=new i(a);return c.getMapElsTo(b)},addCells:function(a,b){var c=new i(a);c.add(b)},removeCells:function(a,b){var c=new i(a);c.remove(b)},mergeCellsBetween:function(a,b){var c=new i(a);c.merge(b)},unmergeCell:function(a){var b=new i(a);b.unmerge()},orderSelectionEnds:function(a,b){var c=new i(a);return c.orderSelectionEnds(b)},indexOf:function(a){var b=new i(a);return b.setTableMap(),b.getMapIndex(a)},findCell:function(a,b){var c=new i(null,a);return c.getElementAtIndex(b)},findRowByCell:function(a){var b=new i(a);return b.getRowElementsByCell()},findColumnByCell:function(a){var b=new i(a);return b.getColumnElementsByCell()},canMerge:function(a,b){var c=new i(a);return c.canMerge(b)}}}(wysihtml5),wysihtml5.dom.query=function(a,b){var c,d,e,f,g=[];for(a.nodeType&&(a=[a]),d=0,e=a.length;e>d;d++)if(c=a[d].querySelectorAll(b),c)for(f=c.length;f--;g.unshift(c[f]));return g},wysihtml5.dom.compareDocumentPosition=function(){var a=document.documentElement;return a.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)}:function(a,b){var c,d,e,f,g,h,i,j,k;if(c=9===a.nodeType?a:a.ownerDocument,d=9===b.nodeType?b:b.ownerDocument,a===b)return 0;if(a===b.ownerDocument)return 20;if(a.ownerDocument===b)return 10;if(c!==d)return 1;if(2===a.nodeType&&a.childNodes&&-1!==wysihtml5.lang.array(a.childNodes).indexOf(b))return 20;if(2===b.nodeType&&b.childNodes&&-1!==wysihtml5.lang.array(b.childNodes).indexOf(a))return 10;for(e=a,f=[],g=null;e;){if(e==b)return 10;f.push(e),e=e.parentNode}for(e=b,g=null;e;){if(e==a)return 20;if(h=wysihtml5.lang.array(f).indexOf(e),-1!==h)return i=f[h],j=wysihtml5.lang.array(i.childNodes).indexOf(f[h-1]),k=wysihtml5.lang.array(i.childNodes).indexOf(g),j>k?2:4;g=e,e=e.parentNode}return 1}}(),wysihtml5.dom.unwrap=function(a){if(a.parentNode){for(;a.lastChild;)wysihtml5.dom.insert(a.lastChild).after(a);a.parentNode.removeChild(a)}},wysihtml5.dom.getPastedHtml=function(a){var b;return a.clipboardData&&(wysihtml5.lang.array(a.clipboardData.types).contains("text/html")?b=a.clipboardData.getData("text/html"):wysihtml5.lang.array(a.clipboardData.types).contains("text/plain")&&(b=wysihtml5.lang.string(a.clipboardData.getData("text/plain")).escapeHTML(!0,!0))),b},wysihtml5.dom.getPastedHtmlWithDiv=function(a,b){var c=a.selection.getBookmark(),d=a.element.ownerDocument,e=d.createElement("DIV");d.body.appendChild(e),e.style.width="1px",e.style.height="1px",e.style.overflow="hidden",e.setAttribute("contenteditable","true"),e.focus(),setTimeout(function(){a.selection.setBookmark(c),b(e.innerHTML),e.parentNode.removeChild(e)},0)},wysihtml5.quirks.cleanPastedHTML=function(){var a=function(a){var b=wysihtml5.lang.string(a).trim(),c=b.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");return RegExp("^((?!^"+c+"$).)*$","i")},b=function(b,c){var d,e,f=wysihtml5.lang.object(b).clone(!0);for(d in f.tags)if(f.tags.hasOwnProperty(d)&&f.tags[d].keep_styles)for(e in f.tags[d].keep_styles)f.tags[d].keep_styles.hasOwnProperty(e)&&c[e]&&(f.tags[d].keep_styles[e]=a(c[e]));return f},c=function(a,b){var c,d,e;if(!a)return null;for(d=0,e=a.length;e>d;d++)if(a[d].condition||(c=a[d].set),a[d].condition&&a[d].condition.test(b))return a[d].set;return c};return function(a,d){var e,f={color:wysihtml5.dom.getStyle("color").from(d.referenceNode),fontSize:wysihtml5.dom.getStyle("font-size").from(d.referenceNode)},g=b(c(d.rules,a)||{},f);return e=wysihtml5.dom.parse(a,{rules:g,cleanUp:!0,context:d.referenceNode.ownerDocument,uneditableClass:d.uneditableClass,clearInternals:!0,unjoinNbsps:!0}),e}}(),wysihtml5.quirks.ensureProperClearing=function(){var a=function(){var a=this;setTimeout(function(){var b=a.innerHTML.toLowerCase();("<p>&nbsp;</p>"==b||"<p>&nbsp;</p><p>&nbsp;</p>"==b)&&(a.innerHTML="")},0)};return function(b){wysihtml5.dom.observe(b.element,["cut","keydown"],a)}}(),function(a){var b="%7E";a.quirks.getCorrectInnerHTML=function(c){var d,e,f,g,h,i=c.innerHTML;if(-1===i.indexOf(b))return i;for(d=c.querySelectorAll("[href*='~'], [src*='~']"),h=0,g=d.length;g>h;h++)e=d[h].href||d[h].src,f=a.lang.string(e).replace("~").by(b),i=a.lang.string(i).replace(f).by(e);return i}}(wysihtml5),function(a){var b="wysihtml5-quirks-redraw";a.quirks.redraw=function(c){a.dom.addClass(c,b),a.dom.removeClass(c,b);try{var d=c.ownerDocument;d.execCommand("italic",!1,null),d.execCommand("italic",!1,null)}catch(e){}}}(wysihtml5),wysihtml5.quirks.tableCellsSelection=function(a,b){function c(){return k.observe(a,"mousedown",function(a){var b=wysihtml5.dom.getParentElement(a.target,{nodeName:["TD","TH"]});b&&d(b)}),l}function d(c){l.start=c,l.end=c,l.cells=[c],l.table=k.getParentElement(l.start,{nodeName:["TABLE"]}),l.table&&(e(),k.addClass(c,m),n=k.observe(a,"mousemove",g),o=k.observe(a,"mouseup",h),b.fire("tableselectstart").fire("tableselectstart:composer"))}function e(){var b,c;if(a&&(b=a.querySelectorAll("."+m),b.length>0))for(c=0;c<b.length;c++)k.removeClass(b[c],m)}function f(a){for(var b=0;b<a.length;b++)k.addClass(a[b],m)}function g(a){var c,d=null,g=k.getParentElement(a.target,{nodeName:["TD","TH"]});g&&l.table&&l.start&&(d=k.getParentElement(g,{nodeName:["TABLE"]}),d&&d===l.table&&(e(),c=l.end,l.end=g,l.cells=k.table.getCellsBetween(l.start,g),l.cells.length>1&&b.composer.selection.deselect(),f(l.cells),l.end!==c&&b.fire("tableselectchange").fire("tableselectchange:composer")))}function h(){n.stop(),o.stop(),b.fire("tableselect").fire("tableselect:composer"),setTimeout(function(){i()},0)}function i(){var c=k.observe(a.ownerDocument,"click",function(a){c.stop(),k.getParentElement(a.target,{nodeName:["TABLE"]})!=l.table&&(e(),l.table=null,l.start=null,l.end=null,b.fire("tableunselect").fire("tableunselect:composer"))})}function j(a,c){l.start=a,l.end=c,l.table=k.getParentElement(l.start,{nodeName:["TABLE"]}),selectedCells=k.table.getCellsBetween(l.start,l.end),f(selectedCells),i(),b.fire("tableselect").fire("tableselect:composer")}var k=wysihtml5.dom,l={table:null,start:null,end:null,cells:null,select:j},m="wysiwyg-tmp-selected-cell",n=null,o=null;return c()},function(a){var b=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([\d\.]+)\s*\)/i,c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i,d=/^#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])/i,e=/^#([0-9a-f])([0-9a-f])([0-9a-f])/i,f=function(a){return RegExp("(^|\\s|;)"+a+"\\s*:\\s*[^;$]+","gi")};a.quirks.styleParser={parseColor:function(g,h){var i,j,k,l=f(h),m=g.match(l),n=10;if(m){for(k=m.length;k--;)m[k]=a.lang.string(m[k].split(":")[1]).trim();if(i=m[m.length-1],b.test(i))j=i.match(b);else if(c.test(i))j=i.match(c);else if(d.test(i))j=i.match(d),n=16;else if(e.test(i))return j=i.match(e),j.shift(),j.push(1),a.lang.array(j).map(function(a,b){return 3>b?16*parseInt(a,16)+parseInt(a,16):parseFloat(a)});if(j)return j.shift(),j[3]||j.push(1),a.lang.array(j).map(function(a,b){return 3>b?parseInt(a,n):parseFloat(a)})}return!1},unparseColor:function(a,b){if(b){if("hex"==b)return a[0].toString(16).toUpperCase()+a[1].toString(16).toUpperCase()+a[2].toString(16).toUpperCase();if("hash"==b)return"#"+a[0].toString(16).toUpperCase()+a[1].toString(16).toUpperCase()+a[2].toString(16).toUpperCase();if("rgb"==b)return"rgb("+a[0]+","+a[1]+","+a[2]+")";if("rgba"==b)return"rgba("+a[0]+","+a[1]+","+a[2]+","+a[3]+")";if("csv"==b)return a[0]+","+a[1]+","+a[2]+","+a[3]}return a[3]&&1!==a[3]?"rgba("+a[0]+","+a[1]+","+a[2]+","+a[3]+")":"rgb("+a[0]+","+a[1]+","+a[2]+")"},parseFontSize:function(b){var c=b.match(f("font-size"));return c?a.lang.string(c[c.length-1].split(":")[1]).trim():!1}}}(wysihtml5),function(a){function b(a){var b=0;if(a.parentNode)do b+=a.offsetTop||0,a=a.offsetParent;while(a);return b}function c(a,b){for(var c=0;b!==a;)if(c++,b=b.parentNode,!b)throw Error("not a descendant of ancestor!");return c}function d(a){if(!a.canSurroundContents())for(var b=a.commonAncestorContainer,d=c(b,a.startContainer),e=c(b,a.endContainer);!a.canSurroundContents();)d>e?(a.setStartBefore(a.startContainer),d=c(b,a.startContainer)):(a.setEndAfter(a.endContainer),e=c(b,a.endContainer))}var e=a.dom;a.Selection=Base.extend({constructor:function(a,b,c){window.rangy.init(),this.editor=a,this.composer=a.composer,this.doc=this.composer.doc,this.contain=b,this.unselectableClass=c||!1},getBookmark:function(){var a=this.getRange();return a&&d(a),a&&a.cloneRange()},setBookmark:function(a){a&&this.setSelection(a)},setBefore:function(a){var b=rangy.createRange(this.doc);return b.setStartBefore(a),b.setEndBefore(a),this.setSelection(b)},setAfter:function(a){var b=rangy.createRange(this.doc);return b.setStartAfter(a),b.setEndAfter(a),this.setSelection(b)},selectNode:function(b,c){var d=rangy.createRange(this.doc),f=b.nodeType===a.ELEMENT_NODE,g="canHaveHTML"in b?b.canHaveHTML:"IMG"!==b.nodeName,h=f?b.innerHTML:b.data,i=""===h||h===a.INVISIBLE_SPACE,j=e.getStyle("display").from(b),k="block"===j||"list-item"===j;if(i&&f&&g&&!c)try{b.innerHTML=a.INVISIBLE_SPACE}catch(l){}g?d.selectNodeContents(b):d.selectNode(b),g&&i&&f?d.collapse(k):g&&i&&(d.setStartAfter(b),d.setEndAfter(b)),this.setSelection(d)},getSelectedNode:function(a){var b,c;return a&&this.doc.selection&&"Control"===this.doc.selection.type&&(c=this.doc.selection.createRange(),c&&c.length)?c.item(0):(b=this.getSelection(this.doc),b.focusNode===b.anchorNode?b.focusNode:(c=this.getRange(this.doc),c?c.commonAncestorContainer:this.doc.body))},fixSelBorders:function(){var a=this.getRange();d(a),this.setSelection(a)},getSelectedOwnNodes:function(){var a,b,c=this.getOwnRanges(),d=[];for(a=0,b=c.length;b>a;a++)d.push(c[a].commonAncestorContainer||this.doc.body);return d},findNodesInSelection:function(b){var c,d,e,f=this.getOwnRanges(),g=[];for(d=0,e=f.length;e>d;d++)c=f[d].getNodes([1],function(c){return a.lang.array(b).contains(c.nodeName)}),g=g.concat(c);return g},containsUneditable:function(){var a,b,c=this.getOwnUneditables(),d=this.getSelection();for(a=0,b=c.length;b>a;a++)if(d.containsNode(c[a]))return!0;return!1},deleteContents:function(){var a,b=this.getOwnRanges();for(a=b.length;a--;)b[a].deleteContents();this.setSelection(b[0])},getPreviousNode:function(b,c){var d,e,f;return b||(d=this.getSelection(),b=d.anchorNode),b===this.contain?!1:(e=b.previousSibling,e===this.contain?!1:(e&&3!==e.nodeType&&1!==e.nodeType?e=this.getPreviousNode(e,c):e&&3===e.nodeType&&/^\s*$/.test(e.textContent)?e=this.getPreviousNode(e,c):c&&e&&1===e.nodeType&&!a.lang.array(["BR","HR","IMG"]).contains(e.nodeName)&&/^[\s]*$/.test(e.innerHTML)?e=this.getPreviousNode(e,c):e||b===this.contain||(f=b.parentNode,f!==this.contain&&(e=this.getPreviousNode(f,c))),e!==this.contain?e:!1))},getSelectionParentsByTag:function(){var b,c,d,e=this.getSelectedOwnNodes(),f=[];for(c=0,d=e.length;d>c;c++)b=e[c].nodeName&&"LI"===e[c].nodeName?e[c]:a.dom.getParentElement(e[c],{nodeName:["LI"]},!1,this.contain),b&&f.push(b);return f.length?f:null},getRangeToNodeEnd:function(){if(this.isCollapsed()){var a=this.getRange(),b=a.startContainer,c=a.startOffset,d=rangy.createRange(this.doc);return d.selectNodeContents(b),d.setStart(b,c),d}},caretIsLastInSelection:function(){var a=(rangy.createRange(this.doc),this.getSelection(),this.getRangeToNodeEnd().cloneContents()),b=a.textContent;return/^\s*$/.test(b)},caretIsFirstInSelection:function(){var b=rangy.createRange(this.doc),c=this.getSelection(),d=this.getRange(),e=d.startContainer;return e.nodeType===a.TEXT_NODE?this.isCollapsed()&&e.nodeType===a.TEXT_NODE&&/^\s*$/.test(e.data.substr(0,d.startOffset)):(b.selectNodeContents(this.getRange().commonAncestorContainer),b.collapse(!0),this.isCollapsed()&&(b.startContainer===c.anchorNode||b.endContainer===c.anchorNode)&&b.startOffset===c.anchorOffset)},caretIsInTheBeginnig:function(b){var c=this.getSelection(),d=c.anchorNode,e=c.anchorOffset;return b?0===e&&(d.nodeName&&d.nodeName===b.toUpperCase()||a.dom.getParentElement(d.parentNode,{nodeName:b},1)):0===e&&!this.getPreviousNode(d,!0)},caretIsBeforeUneditable:function(){var a,b,c,d,e=this.getSelection(),f=e.anchorNode,g=e.anchorOffset;if(0===g&&(a=this.getPreviousNode(f,!0),a))for(b=this.getOwnUneditables(),c=0,d=b.length;d>c;c++)if(a===b[c])return b[c];return!1},executeAndRestoreRangy:function(a){var b=this.doc.defaultView||this.doc.parentWindow,c=rangy.saveSelection(b);if(c)try{a()}catch(d){setTimeout(function(){throw d},0)}else a();rangy.restoreSelection(c)},executeAndRestore:function(b,c){var d,f,g,h,i,j,k,l,m,n=this.doc.body,o=c&&n.scrollTop,p=c&&n.scrollLeft,q="_wysihtml5-temp-placeholder",r='<span class="'+q+'">'+a.INVISIBLE_SPACE+"</span>",s=this.getRange(!0);if(!s)return b(n,n),void 0;s.collapsed||(k=s.cloneRange(),j=k.createContextualFragment(r),k.collapse(!1),k.insertNode(j),k.detach()),i=s.createContextualFragment(r),s.insertNode(i),j&&(d=this.contain.querySelectorAll("."+q),s.setStartBefore(d[0]),s.setEndAfter(d[d.length-1])),this.setSelection(s);try{b(s.startContainer,s.endContainer)}catch(t){setTimeout(function(){throw t},0)}if(d=this.contain.querySelectorAll("."+q),d&&d.length)for(l=rangy.createRange(this.doc),g=d[0].nextSibling,d.length>1&&(h=d[d.length-1].previousSibling),h&&g?(l.setStartBefore(g),l.setEndAfter(h)):(f=this.doc.createTextNode(a.INVISIBLE_SPACE),e.insert(f).after(d[0]),l.setStartBefore(f),l.setEndAfter(f)),this.setSelection(l),m=d.length;m--;)d[m].parentNode.removeChild(d[m]);else this.contain.focus();c&&(n.scrollTop=o,n.scrollLeft=p);try{d.parentNode.removeChild(d)}catch(u){}},set:function(a,b){var c=rangy.createRange(this.doc);c.setStart(a,b||0),this.setSelection(c)},insertHTML:function(a){var b,c=(rangy.createRange(this.doc),this.doc.createElement("DIV")),d=this.doc.createDocumentFragment();for(c.innerHTML=a,b=c.lastChild;c.firstChild;)d.appendChild(c.firstChild);this.insertNode(d),b&&this.setAfter(b)},insertNode:function(a){var b=this.getRange();b&&b.insertNode(a)},surround:function(a){var b,c,d=this.getOwnRanges(),e=[];if(0==d.length)return e;for(c=d.length;c--;){b=this.doc.createElement(a.nodeName),e.push(b),a.className&&(b.className=a.className),a.cssStyle&&b.setAttribute("style",a.cssStyle);try{d[c].surroundContents(b),this.selectNode(b)}catch(f){b.appendChild(d[c].extractContents()),d[c].insertNode(b)}}return e},deblockAndSurround:function(b){var c,d,e,f=this.doc.createElement("div"),g=rangy.createRange(this.doc);if(f.className=b.className,this.composer.commands.exec("formatBlock",b.nodeName,b.className),c=this.contain.querySelectorAll("."+b.className),c[0])for(c[0].parentNode.insertBefore(f,c[0]),g.setStartBefore(c[0]),g.setEndAfter(c[c.length-1]),d=g.extractContents();d.firstChild;)if(e=d.firstChild,1==e.nodeType&&a.dom.hasClass(e,b.className)){for(;e.firstChild;)f.appendChild(e.firstChild);"BR"!==e.nodeName&&f.appendChild(this.doc.createElement("br")),d.removeChild(e)}else f.appendChild(e);else f=null;return f},scrollIntoView:function(){var c,d=this.doc,e=5,f=d.documentElement.scrollHeight>d.documentElement.offsetHeight,g=d._wysihtml5ScrollIntoViewElement=d._wysihtml5ScrollIntoViewElement||function(){var b=d.createElement("span");return b.innerHTML=a.INVISIBLE_SPACE,b}();f&&(this.insertNode(g),c=b(g),g.parentNode.removeChild(g),c>=d.body.scrollTop+d.documentElement.offsetHeight-e&&(d.body.scrollTop=c))},selectLine:function(){a.browser.supportsSelectionModify()?this._selectLine_W3C():this.doc.selection&&this._selectLine_MSIE()},_selectLine_W3C:function(){var a=this.doc.defaultView,b=a.getSelection();b.modify("move","left","lineboundary"),b.modify("extend","right","lineboundary")},_selectLine_MSIE:function(){var a,b,c,d,e,f=this.doc.selection.createRange(),g=f.boundingTop,h=this.doc.body.scrollWidth;if(f.moveToPoint){for(0===g&&(c=this.doc.createElement("span"),this.insertNode(c),g=c.offsetTop,c.parentNode.removeChild(c)),g+=1,d=-10;h>d;d+=2)try{f.moveToPoint(d,g);break}catch(i){}for(a=g,b=this.doc.selection.createRange(),e=h;e>=0;e--)try{b.moveToPoint(e,a);break}catch(j){}f.setEndPoint("EndToEnd",b),f.select()}},getText:function(){var a=this.getSelection();return a?""+a:""},getNodes:function(a,b){var c=this.getRange();return c?c.getNodes([a],b):[]},fixRangeOverflow:function(a){var b,c;this.contain&&this.contain.firstChild&&a&&(b=a.compareNode(this.contain),2!==b?(1===b&&a.setStartBefore(this.contain.firstChild),0===b&&a.setEndAfter(this.contain.lastChild),3===b&&(a.setStartBefore(this.contain.firstChild),a.setEndAfter(this.contain.lastChild))):this._detectInlineRangeProblems(a)&&(c=a.endContainer.previousElementSibling,c&&a.setEnd(c,this._endOffsetForNode(c))))},_endOffsetForNode:function(a){var b=document.createRange();return b.selectNodeContents(a),b.endOffset},_detectInlineRangeProblems:function(a){var b=e.compareDocumentPosition(a.startContainer,a.endContainer);return 0==a.endOffset&&4&b},getRange:function(a){var b=this.getSelection(),c=b&&b.rangeCount&&b.getRangeAt(0);return a!==!0&&this.fixRangeOverflow(c),c},getOwnUneditables:function(){var b=e.query(this.contain,"."+this.unselectableClass),c=e.query(b,"."+this.unselectableClass);return a.lang.array(b).without(c)},getOwnRanges:function(){var a,b,c,d,e,f,g,h=[],i=this.getRange();if(i&&h.push(i),this.unselectableClass&&this.contain&&i&&(b=this.getOwnUneditables(),b.length>0))for(d=0,e=b.length;e>d;d++)for(a=[],f=0,g=h.length;g>f;f++){if(h[f])switch(h[f].compareNode(b[d])){case 2:break;case 3:c=h[f].cloneRange(),c.setEndBefore(b[d]),a.push(c),c=h[f].cloneRange(),c.setStartAfter(b[d]),a.push(c);break;default:a.push(h[f])}h=a}return h},getSelection:function(){return rangy.getSelection(this.doc.defaultView||this.doc.parentWindow)},setSelection:function(a){var b=this.doc.defaultView||this.doc.parentWindow,c=rangy.getSelection(b);return c.setSingleRange(a)},createRange:function(){return rangy.createRange(this.doc)},isCollapsed:function(){return this.getSelection().isCollapsed},getHtml:function(){return this.getSelection().toHtml()},isEndToEndInNode:function(b){var c=this.getRange(),d=c.commonAncestorContainer,e=c.startContainer,f=c.endContainer;if(d.nodeType===a.TEXT_NODE&&(d=d.parentNode),e.nodeType===a.TEXT_NODE&&!/^\s*$/.test(e.data.substr(c.startOffset)))return!1;if(f.nodeType===a.TEXT_NODE&&!/^\s*$/.test(f.data.substr(c.endOffset)))return!1;for(;e&&e!==d;){if(e.nodeType!==a.TEXT_NODE&&!a.dom.contains(d,e))return!1;if(a.dom.domNode(e).prev({ignoreBlankTexts:!0}))return!1;e=e.parentNode}for(;f&&f!==d;){if(f.nodeType!==a.TEXT_NODE&&!a.dom.contains(d,f))return!1;if(a.dom.domNode(f).next({ignoreBlankTexts:!0}))return!1;f=f.parentNode}return a.lang.array(b).contains(d.nodeName)?d:!1},deselect:function(){var a=this.getSelection();a&&a.removeAllRanges()}})}(wysihtml5),function(a,b){function c(a,b,c){if(!a.className)return!1;var d=a.className.match(c)||[];return d[d.length-1]===b}function d(a,b){if(!a.getAttribute||!a.getAttribute("style"))return!1;a.getAttribute("style").match(b);return a.getAttribute("style").match(b)?!0:!1}function e(a,b,c){a.getAttribute("style")?(h(a,c),a.getAttribute("style")&&!/^\s*$/.test(a.getAttribute("style"))?a.setAttribute("style",b+";"+a.getAttribute("style")):a.setAttribute("style",b)):a.setAttribute("style",b)}function f(a,b,c){a.className?(g(a,c),a.className+=" "+b):a.className=b}function g(a,b){a.className&&(a.className=a.className.replace(b,""))}function h(a,b){var c,d,e=[];if(a.getAttribute("style")){for(c=a.getAttribute("style").split(";"),d=c.length;d--;)c[d].match(b)||/^\s*$/.test(c[d])||e.push(c[d]);e.length?a.setAttribute("style",e.join(";")):a.removeAttribute("style")}}function i(a,b){var c,d,e,f=[],g=b.split(";"),h=a.getAttribute("style");if(h){for(h=h.replace(/\s/gi,"").toLowerCase(),f.push(RegExp("(^|\\s|;)"+b.replace(/\s/gi,"").replace(/([\(\)])/gi,"\\$1").toLowerCase().replace(";",";?").replace(/rgb\\\((\d+),(\d+),(\d+)\\\)/gi,"\\s?rgb\\($1,\\s?$2,\\s?$3\\)"),"gi")),c=g.length;c-->0;)/^\s*$/.test(g[c])||f.push(RegExp("(^|\\s|;)"+g[c].replace(/\s/gi,"").replace(/([\(\)])/gi,"\\$1").toLowerCase().replace(";",";?").replace(/rgb\\\((\d+),(\d+),(\d+)\\\)/gi,"\\s?rgb\\($1,\\s?$2,\\s?$3\\)"),"gi"));for(d=0,e=f.length;e>d;d++)if(h.match(f[d]))return f[d]}return!1}function j(c,d,e,f){return e?i(c,e):f?a.dom.hasClass(c,f):b.dom.arrayContains(d,c.tagName.toLowerCase())}function k(a,b,c,d){for(var e=a.length;e--;)if(!j(a[e],b,c,d))return!1;return a.length?!0:!1}function l(a,b,c){var d=i(a,b);return d?(h(a,d),"remove"):(e(a,b,c),"change")}function m(a,b){return a.className.replace(u," ")==b.className.replace(u," ")}function n(a){for(var b=a.parentNode;a.firstChild;)b.insertBefore(a.firstChild,a);b.removeChild(a)}function o(a,b){if(a.attributes.length!=b.attributes.length)return!1;for(var c,d,e,f=0,g=a.attributes.length;g>f;++f)if(c=a.attributes[f],e=c.name,"class"!=e){if(d=b.attributes.getNamedItem(e),c.specified!=d.specified)return!1;if(c.specified&&c.nodeValue!==d.nodeValue)return!1}return!0}function p(a,c){return b.dom.isCharacterDataNode(a)?0==c?!!a.previousSibling:c==a.length?!!a.nextSibling:!0:c>0&&c<a.childNodes.length}function q(a,c,d,e){var f,g;if(b.dom.isCharacterDataNode(c)&&(0==d?(d=b.dom.getNodeIndex(c),c=c.parentNode):d==c.length?(d=b.dom.getNodeIndex(c)+1,c=c.parentNode):f=b.dom.splitDataNode(c,d)),!(f||e&&c===e)){for(f=c.cloneNode(!1),f.id&&f.removeAttribute("id");g=c.childNodes[d];)f.appendChild(g);b.dom.insertAfter(f,c)}return c==a?f:q(a,f.parentNode,b.dom.getNodeIndex(f),e)}function r(b){this.isElementMerge=b.nodeType==a.ELEMENT_NODE,this.firstTextNode=this.isElementMerge?b.lastChild:b,this.textNodes=[this.firstTextNode]}function s(a,b,c,d,e,f,g){this.tagNames=a||[t],this.cssClass=b||(b===!1?!1:""),this.similarClassRegExp=c,this.cssStyle=e||"",this.similarStyleRegExp=f,this.normalize=d,this.applyToAnyTagName=!1,this.container=g}var t="span",u=/\s+/g;r.prototype={doMerge:function(){var a,b,c,d,e,f=[];for(d=0,e=this.textNodes.length;e>d;++d)a=this.textNodes[d],b=a.parentNode,f[d]=a.data,d&&(b.removeChild(a),b.hasChildNodes()||b.parentNode.removeChild(b));return this.firstTextNode.data=c=f.join(""),c},getLength:function(){for(var a=this.textNodes.length,b=0;a--;)b+=this.textNodes[a].length;return b},toString:function(){var a,b,c=[];for(a=0,b=this.textNodes.length;b>a;++a)c[a]="'"+this.textNodes[a].data+"'";return"[Merge("+c.join(",")+")]"}},s.prototype={getAncestorWithClass:function(d){for(var e;d;){if(e=this.cssClass?c(d,this.cssClass,this.similarClassRegExp):""!==this.cssStyle?!1:!0,d.nodeType==a.ELEMENT_NODE&&"false"!=d.getAttribute("contenteditable")&&b.dom.arrayContains(this.tagNames,d.tagName.toLowerCase())&&e)return d;d=d.parentNode}return!1},getAncestorWithStyle:function(c){for(var e;c;){if(e=this.cssStyle?d(c,this.similarStyleRegExp):!1,c.nodeType==a.ELEMENT_NODE&&"false"!=c.getAttribute("contenteditable")&&b.dom.arrayContains(this.tagNames,c.tagName.toLowerCase())&&e)return c;c=c.parentNode}return!1},getMatchingAncestor:function(a){var b=this.getAncestorWithClass(a),c=!1;return b?this.cssStyle&&(c="class"):(b=this.getAncestorWithStyle(a),b&&(c="style")),{element:b,type:c}},postApply:function(a,b){var c,d,e,f,g,h,i=a[0],j=a[a.length-1],k=[],l=i,m=j,n=0,o=j.length;for(f=0,g=a.length;g>f;++f)d=a[f],e=null,d&&d.parentNode&&(e=this.getAdjacentMergeableTextNode(d.parentNode,!1)),e?(c||(c=new r(e),k.push(c)),c.textNodes.push(d),d===i&&(l=c.firstTextNode,n=l.length),d===j&&(m=c.firstTextNode,o=c.getLength())):c=null;if(j&&j.parentNode&&(h=this.getAdjacentMergeableTextNode(j.parentNode,!0),h&&(c||(c=new r(j),k.push(c)),c.textNodes.push(h))),k.length){for(f=0,g=k.length;g>f;++f)k[f].doMerge();b.setStart(l,n),b.setEnd(m,o)}},getAdjacentMergeableTextNode:function(b,c){var d,e=b.nodeType==a.TEXT_NODE,f=e?b.parentNode:b,g=c?"nextSibling":"previousSibling";if(e){if(d=b[g],d&&d.nodeType==a.TEXT_NODE)return d}else if(d=f[g],d&&this.areElementsMergeable(b,d))return d[c?"firstChild":"lastChild"];return null},areElementsMergeable:function(a,c){return b.dom.arrayContains(this.tagNames,(a.tagName||"").toLowerCase())&&b.dom.arrayContains(this.tagNames,(c.tagName||"").toLowerCase())&&m(a,c)&&o(a,c)},createContainer:function(a){var b=a.createElement(this.tagNames[0]);return this.cssClass&&(b.className=this.cssClass),this.cssStyle&&b.setAttribute("style",this.cssStyle),b},applyToTextNode:function(a){var c,d=a.parentNode;1==d.childNodes.length&&b.dom.arrayContains(this.tagNames,d.tagName.toLowerCase())?(this.cssClass&&f(d,this.cssClass,this.similarClassRegExp),this.cssStyle&&e(d,this.cssStyle,this.similarStyleRegExp)):(c=this.createContainer(b.dom.getDocument(a)),a.parentNode.insertBefore(c,a),c.appendChild(a))},isRemovable:function(c){return b.dom.arrayContains(this.tagNames,c.tagName.toLowerCase())&&""===a.lang.string(c.className).trim()&&(!c.getAttribute("style")||""===a.lang.string(c.getAttribute("style")).trim())},undoToTextNode:function(a,b,c,d){var e,f=c?!1:!0,h=c||d,i=!1;b.containsNode(h)||(e=b.cloneRange(),e.selectNode(h),e.isPointInRange(b.endContainer,b.endOffset)&&p(b.endContainer,b.endOffset)&&(q(h,b.endContainer,b.endOffset,this.container),b.setEndAfter(h)),e.isPointInRange(b.startContainer,b.startOffset)&&p(b.startContainer,b.startOffset)&&(h=q(h,b.startContainer,b.startOffset,this.container))),!f&&this.similarClassRegExp&&g(h,this.similarClassRegExp),f&&this.similarStyleRegExp&&(i="change"===l(h,this.cssStyle,this.similarStyleRegExp)),this.isRemovable(h)&&!i&&n(h)},applyToRange:function(b){var c,d,e,f,g,h;for(d=b.length;d--;){if(c=b[d].getNodes([a.TEXT_NODE]),!c.length)try{return e=this.createContainer(b[d].endContainer.ownerDocument),b[d].surroundContents(e),this.selectNode(b[d],e),void 0}catch(i){}if(b[d].splitBoundaries(),c=b[d].getNodes([a.TEXT_NODE]),c.length){for(g=0,h=c.length;h>g;++g)f=c[g],this.getMatchingAncestor(f).element||this.applyToTextNode(f);b[d].setStart(c[0],0),f=c[c.length-1],b[d].setEnd(f,f.length),this.normalize&&this.postApply(c,b[d])}}},undoToRange:function(b){var c,d,e,f,g,h,i,j;for(f=b.length;f--;){for(c=b[f].getNodes([a.TEXT_NODE]),c.length?(b[f].splitBoundaries(),c=b[f].getNodes([a.TEXT_NODE])):(g=b[f].endContainer.ownerDocument,h=g.createTextNode(a.INVISIBLE_SPACE),b[f].insertNode(h),b[f].selectNode(h),c=[h]),i=0,j=c.length;j>i;++i)b[f].isValid()&&(d=c[i],e=this.getMatchingAncestor(d),"style"===e.type?this.undoToTextNode(d,b[f],!1,e.element):e.element&&this.undoToTextNode(d,b[f],e.element));1==j?this.selectNode(b[f],c[0]):(b[f].setStart(c[0],0),d=c[c.length-1],b[f].setEnd(d,d.length),this.normalize&&this.postApply(c,b[f]))}},selectNode:function(b,c){var d=c.nodeType===a.ELEMENT_NODE,e="canHaveHTML"in c?c.canHaveHTML:!0,f=d?c.innerHTML:c.data,g=""===f||f===a.INVISIBLE_SPACE;if(g&&d&&e)try{c.innerHTML=a.INVISIBLE_SPACE}catch(h){}b.selectNodeContents(c),g&&d?b.collapse(!1):g&&(b.setStartAfter(c),b.setEndAfter(c))},getTextSelectedByRange:function(a,b){var c,d,e=b.cloneRange();return e.selectNodeContents(a),c=e.intersection(b),d=c?""+c:"",e.detach(),d},isAppliedToRange:function(b){var c,d,e,f,g,h,i=[],j="full";for(e=b.length;e--;){if(d=b[e].getNodes([a.TEXT_NODE]),!d.length)return c=this.getMatchingAncestor(b[e].startContainer).element,c?{elements:[c],coverage:j}:!1;for(f=0,g=d.length;g>f;++f)h=this.getTextSelectedByRange(d[f],b[e]),c=this.getMatchingAncestor(d[f]).element,c&&""!=h?(i.push(c),1===a.dom.getTextNodes(c,!0).length?j="full":"full"===j&&(j="inline")):c||(j="partial")}return i.length?{elements:i,coverage:j}:!1},toggleRange:function(a){var b,c=this.isAppliedToRange(a);c?"full"===c.coverage?this.undoToRange(a):"inline"===c.coverage?(b=k(c.elements,this.tagNames,this.cssStyle,this.cssClass),this.undoToRange(a),b||this.applyToRange(a)):(k(c.elements,this.tagNames,this.cssStyle,this.cssClass)||this.undoToRange(a),this.applyToRange(a)):this.applyToRange(a)}},a.selection.HTMLApplier=s}(wysihtml5,rangy),wysihtml5.Commands=Base.extend({constructor:function(a){this.editor=a,this.composer=a.composer,this.doc=this.composer.doc},support:function(a){return wysihtml5.browser.supportsCommand(this.doc,a)},exec:function(a,b){var c=wysihtml5.commands[a],d=wysihtml5.lang.array(arguments).get(),e=c&&c.exec,f=null;if(this.editor.fire("beforecommand:composer"),e)d.unshift(this.composer),f=e.apply(c,d);else try{f=this.doc.execCommand(a,!1,b)}catch(g){}return this.editor.fire("aftercommand:composer"),f},state:function(a){var b=wysihtml5.commands[a],c=wysihtml5.lang.array(arguments).get(),d=b&&b.state;if(d)return c.unshift(this.composer),d.apply(b,c);try{return this.doc.queryCommandState(a)}catch(e){return!1}},stateValue:function(a){var b=wysihtml5.commands[a],c=wysihtml5.lang.array(arguments).get(),d=b&&b.stateValue;return d?(c.unshift(this.composer),d.apply(b,c)):!1}}),wysihtml5.commands.bold={exec:function(a,b){wysihtml5.commands.formatInline.execWithToggle(a,b,"b")},state:function(a,b){return wysihtml5.commands.formatInline.state(a,b,"b")}},function(a){function b(b,c){var g,h,i,j,k,l,m,n,o,p=b.doc,q="_wysihtml5-temp-"+ +new Date,r=/non-matching-class/g,s=0;for(a.commands.formatInline.exec(b,d,e,q,r,d,d,!0,!0),h=p.querySelectorAll(e+"."+q),g=h.length;g>s;s++){i=h[s],i.removeAttribute("class");for(o in c)"text"!==o&&i.setAttribute(o,c[o])}l=i,1===g&&(m=f.getTextContent(i),j=!!i.querySelector("*"),k=""===m||m===a.INVISIBLE_SPACE,!j&&k&&(f.setTextContent(i,c.text||i.href),n=p.createTextNode(" "),b.selection.setAfter(i),f.insert(n).after(i),l=n)),b.selection.setAfter(l)}function c(a,b,c){var d,e,f,g;for(e=b.length;e--;){for(d=b[e].attributes,f=d.length;f--;)b[e].removeAttribute(d.item(f).name);for(g in c)c.hasOwnProperty(g)&&b[e].setAttribute(g,c[g])}}var d,e="A",f=a.dom;a.commands.createLink={exec:function(a,d,e){var f=this.state(a,d);f?a.selection.executeAndRestore(function(){c(a,f,e)}):(e="object"==typeof e?e:{href:e},b(a,e))},state:function(b,c){return a.commands.formatInline.state(b,c,"A")}}}(wysihtml5),function(a){function b(a,b){for(var d,e,f,g=b.length,h=0;g>h;h++)d=b[h],e=c.getParentElement(d,{nodeName:"code"}),f=c.getTextContent(d),f.match(c.autoLink.URL_REG_EXP)&&!e?e=c.renameElement(d,"code"):c.replaceWithChildNodes(d)}var c=a.dom;a.commands.removeLink={exec:function(a,c){var d=this.state(a,c);d&&a.selection.executeAndRestore(function(){b(a,d)})},state:function(b,c){return a.commands.formatInline.state(b,c,"A")}}}(wysihtml5),function(a){var b=/wysiwyg-font-size-[0-9a-z\-]+/g;a.commands.fontSize={exec:function(c,d,e){a.commands.formatInline.execWithToggle(c,d,"span","wysiwyg-font-size-"+e,b)},state:function(c,d,e){return a.commands.formatInline.state(c,d,"span","wysiwyg-font-size-"+e,b)}}}(wysihtml5),function(a){var b=/(\s|^)font-size\s*:\s*[^;\s]+;?/gi;a.commands.fontSizeStyle={exec:function(c,d,e){e="object"==typeof e?e.size:e,/^\s*$/.test(e)||a.commands.formatInline.execWithToggle(c,d,"span",!1,!1,"font-size:"+e,b)},state:function(c,d){return a.commands.formatInline.state(c,d,"span",!1,!1,"font-size",b)},stateValue:function(b,c){var d,e=this.state(b,c);return e&&a.lang.object(e).isArray()&&(e=e[0]),e&&(d=e.getAttribute("style"),d)?a.quirks.styleParser.parseFontSize(d):!1}}}(wysihtml5),function(a){var b=/wysiwyg-color-[0-9a-z]+/g;a.commands.foreColor={exec:function(c,d,e){a.commands.formatInline.execWithToggle(c,d,"span","wysiwyg-color-"+e,b)},state:function(c,d,e){return a.commands.formatInline.state(c,d,"span","wysiwyg-color-"+e,b)}}}(wysihtml5),function(a){var b=/(\s|^)color\s*:\s*[^;\s]+;?/gi;a.commands.foreColorStyle={exec:function(c,d,e){var f,g=a.quirks.styleParser.parseColor("object"==typeof e?"color:"+e.color:"color:"+e,"color");g&&(f="color: rgb("+g[0]+","+g[1]+","+g[2]+");",1!==g[3]&&(f+="color: rgba("+g[0]+","+g[1]+","+g[2]+","+g[3]+");"),a.commands.formatInline.execWithToggle(c,d,"span",!1,!1,f,b))},state:function(c,d){return a.commands.formatInline.state(c,d,"span",!1,!1,"color",b)},stateValue:function(b,c,d){var e,f=this.state(b,c);return f&&a.lang.object(f).isArray()&&(f=f[0]),f&&(e=f.getAttribute("style"),e&&e)?(val=a.quirks.styleParser.parseColor(e,"color"),a.quirks.styleParser.unparseColor(val,d)):!1
+}}}(wysihtml5),function(a){var b=/(\s|^)background-color\s*:\s*[^;\s]+;?/gi;a.commands.bgColorStyle={exec:function(c,d,e){var f,g=a.quirks.styleParser.parseColor("object"==typeof e?"background-color:"+e.color:"background-color:"+e,"background-color");g&&(f="background-color: rgb("+g[0]+","+g[1]+","+g[2]+");",1!==g[3]&&(f+="background-color: rgba("+g[0]+","+g[1]+","+g[2]+","+g[3]+");"),a.commands.formatInline.execWithToggle(c,d,"span",!1,!1,f,b))},state:function(c,d){return a.commands.formatInline.state(c,d,"span",!1,!1,"background-color",b)},stateValue:function(b,c,d){var e,f=this.state(b,c),g=!1;return f&&a.lang.object(f).isArray()&&(f=f[0]),f&&(e=f.getAttribute("style"),e)?(g=a.quirks.styleParser.parseColor(e,"background-color"),a.quirks.styleParser.unparseColor(g,d)):!1}}}(wysihtml5),function(a){function b(b,c,e){b.className?(d(b,e),b.className=a.lang.string(b.className+" "+c).trim()):b.className=c}function c(b,c,d){e(b,d),b.getAttribute("style")?b.setAttribute("style",a.lang.string(b.getAttribute("style")+" "+c).trim()):b.setAttribute("style",c)}function d(b,c){var d=c.test(b.className);return b.className=b.className.replace(c,""),""==a.lang.string(b.className).trim()&&b.removeAttribute("class"),d}function e(b,c){var d=c.test(b.getAttribute("style"));return b.setAttribute("style",(b.getAttribute("style")||"").replace(c,"")),""==a.lang.string(b.getAttribute("style")||"").trim()&&b.removeAttribute("style"),d}function f(a){var b=a.lastChild;b&&g(b)&&b.parentNode.removeChild(b)}function g(a){return"BR"===a.nodeName}function h(b,c){var d,e,g;for(b.selection.isCollapsed()&&b.selection.selectLine(),d=b.selection.surround(c),e=0,g=d.length;g>e;e++)a.dom.lineBreaks(d[e]).remove(),f(d[e])}function i(b){return!!a.lang.string(b.className).trim()}function j(b){return!!a.lang.string(b.getAttribute("style")||"").trim()}var k=a.dom,l=["H1","H2","H3","H4","H5","H6","P","PRE","DIV"];a.commands.formatBlock={exec:function(f,g,m,n,o,p,q){var r,s,t,u,v,w=(f.doc,this.state(f,g,m,n,o,p,q)),x=f.config.useLineBreaks,y=x?"DIV":"P";return m="string"==typeof m?m.toUpperCase():m,w.length?(f.selection.executeAndRestoreRangy(function(){var b,c,f;for(b=w.length;b--;){if(o&&(s=d(w[b],o)),q&&(u=e(w[b],q)),(u||s)&&null===m&&w[b].nodeName!=y)return;c=i(w[b]),f=j(w[b]),c||f||!x&&"P"!==m?k.renameElement(w[b],"P"===m?"DIV":y):(a.dom.lineBreaks(w[b]).add(),k.replaceWithChildNodes(w[b]))}}),void 0):((null!==m&&!a.lang.array(l).contains(m)||(r=f.selection.findNodesInSelection(l).concat(f.selection.getSelectedOwnNodes()),f.selection.executeAndRestoreRangy(function(){for(var a=r.length;a--;)v=k.getParentElement(r[a],{nodeName:l}),v==f.element&&(v=null),v&&(m&&(v=k.renameElement(v,m)),n&&b(v,n,o),p&&c(v,p,q),t=!0)}),!t))&&h(f,{nodeName:m||y,className:n||null,cssStyle:p||null}),void 0)},state:function(b,c,d,e,f,g,h){var i,j,l,m=b.selection.getSelectedOwnNodes(),n=[];for(d="string"==typeof d?d.toUpperCase():d,j=0,l=m.length;l>j;j++)i=k.getParentElement(m[j],{nodeName:d,className:e,classRegExp:f,cssStyle:g,styleRegExp:h}),i&&-1==a.lang.array(n).indexOf(i)&&n.push(i);return 0==n.length?!1:n}}}(wysihtml5),wysihtml5.commands.formatCode={exec:function(a,b,c){var d,e,f,g=this.state(a);g?a.selection.executeAndRestore(function(){d=g.querySelector("code"),wysihtml5.dom.replaceWithChildNodes(g),d&&wysihtml5.dom.replaceWithChildNodes(d)}):(e=a.selection.getRange(),f=e.extractContents(),g=a.doc.createElement("pre"),d=a.doc.createElement("code"),c&&(d.className=c),g.appendChild(d),d.appendChild(f),e.insertNode(g),a.selection.selectNode(g))},state:function(a){var b=a.selection.getSelectedNode();return b&&b.nodeName&&"PRE"==b.nodeName&&b.firstChild&&b.firstChild.nodeName&&"CODE"==b.firstChild.nodeName?b:wysihtml5.dom.getParentElement(b,{nodeName:"CODE"})&&wysihtml5.dom.getParentElement(b,{nodeName:"PRE"})}},function(a){function b(a){var b=d[a];return b?[a.toLowerCase(),b.toLowerCase()]:[a.toLowerCase()]}function c(c,d,f,g,h,i){var j=c;return d&&(j+=":"+d),g&&(j+=":"+g),e[j]||(e[j]=new a.selection.HTMLApplier(b(c),d,f,!0,g,h,i)),e[j]}var d={strong:"b",em:"i",b:"strong",i:"em"},e={};a.commands.formatInline={exec:function(a,b,d,e,f,g,h,i,j){var k=a.selection.createRange(),l=a.selection.getOwnRanges();return l&&0!=l.length?(a.selection.getSelection().removeAllRanges(),c(d,e,f,g,h,a.element).toggleRange(l),i?j||a.cleanUp():(k.setStart(l[0].startContainer,l[0].startOffset),k.setEnd(l[l.length-1].endContainer,l[l.length-1].endOffset),a.selection.setSelection(k),a.selection.executeAndRestore(function(){j||a.cleanUp()},!0,!0)),void 0):!1},execWithToggle:function(b,c,d,e,f,g,h){var i,j=this;this.state(b,c,d,e,f,g,h)&&b.selection.isCollapsed()&&!b.selection.caretIsLastInSelection()&&!b.selection.caretIsFirstInSelection()?(i=j.state(b,c,d,e,f)[0],b.selection.executeAndRestoreRangy(function(){i.parentNode;b.selection.selectNode(i,!0),a.commands.formatInline.exec(b,c,d,e,f,g,h,!0,!0)})):this.state(b,c,d,e,f,g,h)&&!b.selection.isCollapsed()?b.selection.executeAndRestoreRangy(function(){a.commands.formatInline.exec(b,c,d,e,f,g,h,!0,!0)}):a.commands.formatInline.exec(b,c,d,e,f,g,h)},state:function(b,e,f,g,h,i,j){var k,l,m=b.doc,n=d[f]||f;return a.dom.hasElementWithTagName(m,f)||a.dom.hasElementWithTagName(m,n)?g&&!a.dom.hasElementWithClassName(m,g)?!1:(k=b.selection.getOwnRanges(),k&&0!==k.length?(l=c(f,g,h,i,j,b.element).isAppliedToRange(k),l&&l.elements?l.elements:!1):!1):!1}}}(wysihtml5),function(a){a.commands.insertBlockQuote={exec:function(b,c){var d=this.state(b,c),e=b.selection.isEndToEndInNode(["H1","H2","H3","H4","H5","H6","P"]);b.selection.executeAndRestore(function(){if(d)b.config.useLineBreaks&&a.dom.lineBreaks(d).add(),a.dom.unwrap(d);else if(b.selection.isCollapsed()&&b.selection.selectLine(),e){var c=e.ownerDocument.createElement("blockquote");a.dom.insert(c).after(e),c.appendChild(e)}else b.selection.surround({nodeName:"blockquote"})})},state:function(b){var c=b.selection.getSelectedNode(),d=a.dom.getParentElement(c,{nodeName:"BLOCKQUOTE"},!1,b.element);return d?d:!1}}}(wysihtml5),wysihtml5.commands.insertHTML={exec:function(a,b,c){a.commands.support(b)?a.doc.execCommand(b,!1,c):a.selection.insertHTML(c)},state:function(){return!1}},function(a){var b="IMG";a.commands.insertImage={exec:function(c,d,e){var f,g,h,i,j;if(e="object"==typeof e?e:{src:e},f=c.doc,g=this.state(c),g)return c.selection.setBefore(g),i=g.parentNode,i.removeChild(g),a.dom.removeEmptyTextNodes(i),"A"!==i.nodeName||i.firstChild||(c.selection.setAfter(i),i.parentNode.removeChild(i)),a.quirks.redraw(c.element),void 0;g=f.createElement(b);for(j in e)g.setAttribute("className"===j?"class":j,e[j]);c.selection.insertNode(g),a.browser.hasProblemsSettingCaretAfterImg()?(h=f.createTextNode(a.INVISIBLE_SPACE),c.selection.insertNode(h),c.selection.setAfter(h)):c.selection.setAfter(g)},state:function(c){var d,e,f,g=c.doc;return a.dom.hasElementWithTagName(g,b)?(d=c.selection.getSelectedNode(),d?d.nodeName===b?d:d.nodeType!==a.ELEMENT_NODE?!1:(e=c.selection.getText(),e=a.lang.string(e).trim(),e?!1:(f=c.selection.getNodes(a.ELEMENT_NODE,function(a){return"IMG"===a.nodeName}),1!==f.length?!1:f[0])):!1):!1}}}(wysihtml5),function(a){var b="<br>"+(a.browser.needsSpaceAfterLineBreak()?" ":"");a.commands.insertLineBreak={exec:function(c,d){c.commands.support(d)?(c.doc.execCommand(d,!1,null),a.browser.autoScrollsToCaret()||c.selection.scrollIntoView()):c.commands.exec("insertHTML",b)},state:function(){return!1}}}(wysihtml5),wysihtml5.commands.insertOrderedList={exec:function(a,b){wysihtml5.commands.insertList.exec(a,b,"OL")},state:function(a,b){return wysihtml5.commands.insertList.state(a,b,"OL")}},wysihtml5.commands.insertUnorderedList={exec:function(a,b){wysihtml5.commands.insertList.exec(a,b,"UL")},state:function(a,b){return wysihtml5.commands.insertList.state(a,b,"UL")}},wysihtml5.commands.insertList=function(a){var b=function(a,b){if(a&&a.nodeName){"string"==typeof b&&(b=[b]);for(var c=b.length;c--;)if(a.nodeName===b[c])return!0}return!1},c=function(c,d,e){var f,g,h={el:null,other:!1};return c&&(f=a.dom.getParentElement(c,{nodeName:"LI"}),g="UL"===d?"OL":"UL",b(c,d)?h.el=c:b(c,g)?h={el:c,other:!0}:f&&(b(f.parentNode,d)?h.el=f.parentNode:b(f.parentNode,g)&&(h={el:f.parentNode,other:!0}))),h.el&&!e.element.contains(h.el)&&(h.el=null),h},d=function(b,c,d){var e,g="UL"===c?"OL":"UL";d.selection.executeAndRestore(function(){var h,i,j=f(g,d);if(j.length)for(h=j.length;h--;)a.dom.renameElement(j[h],c.toLowerCase());else{for(e=f(["OL","UL"],d),i=e.length;i--;)a.dom.resolveList(e[i],d.config.useLineBreaks);a.dom.resolveList(b,d.config.useLineBreaks)}})},e=function(b,c,d){var e="UL"===c?"OL":"UL";d.selection.executeAndRestore(function(){var g,h=[b].concat(f(e,d));for(g=h.length;g--;)a.dom.renameElement(h[g],c.toLowerCase())})},f=function(a,c){var d,e=c.selection.getOwnRanges(),f=[];for(d=e.length;d--;)f=f.concat(e[d].getNodes([1],function(c){return b(c,a)}));return f},g=function(b,c){c.selection.executeAndRestoreRangy(function(){var d,e,f="_wysihtml5-temp-"+(new Date).getTime(),g=c.selection.deblockAndSurround({nodeName:"div",className:f}),h=/\uFEFF/g;g.innerHTML=g.innerHTML.replace(h,""),g&&(d=a.lang.array(["","<br>",a.INVISIBLE_SPACE]).contains(g.innerHTML),e=a.dom.convertToList(g,b.toLowerCase(),c.parent.config.uneditableContainerClassname),d&&c.selection.selectNode(e.querySelector("li"),!0))})};return{exec:function(a,b,f){var h=a.doc,i="OL"===f?"insertOrderedList":"insertUnorderedList",j=a.selection.getSelectedNode(),k=c(j,f,a);k.el?k.other?e(k.el,f,a):d(k.el,f,a):a.commands.support(i)?h.execCommand(i,!1,null):g(f,a)},state:function(a,b,d){var e=a.selection.getSelectedNode(),f=c(e,d,a);return f.el&&!f.other?f.el:!1}}}(wysihtml5),wysihtml5.commands.italic={exec:function(a,b){wysihtml5.commands.formatInline.execWithToggle(a,b,"i")},state:function(a,b){return wysihtml5.commands.formatInline.state(a,b,"i")}},function(a){var b="wysiwyg-text-align-center",c=/wysiwyg-text-align-[0-9a-z]+/g;a.commands.justifyCenter={exec:function(d){return a.commands.formatBlock.exec(d,"formatBlock",null,b,c)},state:function(d){return a.commands.formatBlock.state(d,"formatBlock",null,b,c)}}}(wysihtml5),function(a){var b="wysiwyg-text-align-left",c=/wysiwyg-text-align-[0-9a-z]+/g;a.commands.justifyLeft={exec:function(d){return a.commands.formatBlock.exec(d,"formatBlock",null,b,c)},state:function(d){return a.commands.formatBlock.state(d,"formatBlock",null,b,c)}}}(wysihtml5),function(a){var b="wysiwyg-text-align-right",c=/wysiwyg-text-align-[0-9a-z]+/g;a.commands.justifyRight={exec:function(d){return a.commands.formatBlock.exec(d,"formatBlock",null,b,c)},state:function(d){return a.commands.formatBlock.state(d,"formatBlock",null,b,c)}}}(wysihtml5),function(a){var b="wysiwyg-text-align-justify",c=/wysiwyg-text-align-[0-9a-z]+/g;a.commands.justifyFull={exec:function(d){return a.commands.formatBlock.exec(d,"formatBlock",null,b,c)},state:function(d){return a.commands.formatBlock.state(d,"formatBlock",null,b,c)}}}(wysihtml5),function(a){var b="text-align: right;",c=/(\s|^)text-align\s*:\s*[^;\s]+;?/gi;a.commands.alignRightStyle={exec:function(d){return a.commands.formatBlock.exec(d,"formatBlock",null,null,null,b,c)},state:function(d){return a.commands.formatBlock.state(d,"formatBlock",null,null,null,b,c)}}}(wysihtml5),function(a){var b="text-align: left;",c=/(\s|^)text-align\s*:\s*[^;\s]+;?/gi;a.commands.alignLeftStyle={exec:function(d){return a.commands.formatBlock.exec(d,"formatBlock",null,null,null,b,c)},state:function(d){return a.commands.formatBlock.state(d,"formatBlock",null,null,null,b,c)}}}(wysihtml5),function(a){var b="text-align: center;",c=/(\s|^)text-align\s*:\s*[^;\s]+;?/gi;a.commands.alignCenterStyle={exec:function(d){return a.commands.formatBlock.exec(d,"formatBlock",null,null,null,b,c)},state:function(d){return a.commands.formatBlock.state(d,"formatBlock",null,null,null,b,c)}}}(wysihtml5),wysihtml5.commands.redo={exec:function(a){return a.undoManager.redo()},state:function(){return!1}},wysihtml5.commands.underline={exec:function(a,b){wysihtml5.commands.formatInline.execWithToggle(a,b,"u")},state:function(a,b){return wysihtml5.commands.formatInline.state(a,b,"u")}},wysihtml5.commands.undo={exec:function(a){return a.undoManager.undo()},state:function(){return!1}},wysihtml5.commands.createTable={exec:function(a,b,c){var d,e,f;if(c&&c.cols&&c.rows&&parseInt(c.cols,10)>0&&parseInt(c.rows,10)>0){for(f=c.tableStyle?'<table style="'+c.tableStyle+'">':"<table>",f+="<tbody>",e=0;e<c.rows;e++){for(f+="<tr>",d=0;d<c.cols;d++)f+="<td>&nbsp;</td>";f+="</tr>"}f+="</tbody></table>",a.commands.exec("insertHTML",f)}},state:function(){return!1}},wysihtml5.commands.mergeTableCells={exec:function(a,b){a.tableSelection&&a.tableSelection.start&&a.tableSelection.end&&(this.state(a,b)?wysihtml5.dom.table.unmergeCell(a.tableSelection.start):wysihtml5.dom.table.mergeCellsBetween(a.tableSelection.start,a.tableSelection.end))},state:function(a){if(a.tableSelection){var b=a.tableSelection.start,c=a.tableSelection.end;if(b&&c&&b==c&&(wysihtml5.dom.getAttribute(b,"colspan")&&parseInt(wysihtml5.dom.getAttribute(b,"colspan"),10)>1||wysihtml5.dom.getAttribute(b,"rowspan")&&parseInt(wysihtml5.dom.getAttribute(b,"rowspan"),10)>1))return[b]}return!1}},wysihtml5.commands.addTableCells={exec:function(a,b,c){if(a.tableSelection&&a.tableSelection.start&&a.tableSelection.end){var d=wysihtml5.dom.table.orderSelectionEnds(a.tableSelection.start,a.tableSelection.end);"before"==c||"above"==c?wysihtml5.dom.table.addCells(d.start,c):("after"==c||"below"==c)&&wysihtml5.dom.table.addCells(d.end,c),setTimeout(function(){a.tableSelection.select(d.start,d.end)},0)}},state:function(){return!1}},wysihtml5.commands.deleteTableCells={exec:function(a,b,c){if(a.tableSelection&&a.tableSelection.start&&a.tableSelection.end){var d,e=wysihtml5.dom.table.orderSelectionEnds(a.tableSelection.start,a.tableSelection.end),f=wysihtml5.dom.table.indexOf(e.start),g=a.tableSelection.table;wysihtml5.dom.table.removeCells(e.start,c),setTimeout(function(){d=wysihtml5.dom.table.findCell(g,f),d||("row"==c&&(d=wysihtml5.dom.table.findCell(g,{row:f.row-1,col:f.col})),"column"==c&&(d=wysihtml5.dom.table.findCell(g,{row:f.row,col:f.col-1}))),d&&a.tableSelection.select(d,d)},0)}},state:function(){return!1}},wysihtml5.commands.indentList={exec:function(a){var b=a.selection.getSelectionParentsByTag("LI");return b?this.tryToPushLiLevel(b,a.selection):!1},state:function(){return!1},tryToPushLiLevel:function(a,b){var c,d,e,f,g,h=!1;return b.executeAndRestoreRangy(function(){for(var b=a.length;b--;)f=a[b],c="OL"===f.parentNode.nodeName?"OL":"UL",d=f.ownerDocument.createElement(c),e=wysihtml5.dom.domNode(f).prev({nodeTypes:[wysihtml5.ELEMENT_NODE]}),g=e?e.querySelector("ul, ol"):null,e&&(g?g.appendChild(f):(d.appendChild(f),e.appendChild(d)),h=!0)}),h}},wysihtml5.commands.outdentList={exec:function(a){var b=a.selection.getSelectionParentsByTag("LI");return b?this.tryToPullLiLevel(b,a):!1},state:function(){return!1},tryToPullLiLevel:function(a,b){var c,d,e,f,g,h=!1,i=this;return b.selection.executeAndRestoreRangy(function(){var j,k;for(j=a.length;j--;)if(f=a[j],f.parentNode&&(c=f.parentNode,"OL"===c.tagName||"UL"===c.tagName)){if(h=!0,d=wysihtml5.dom.getParentElement(c.parentNode,{nodeName:["OL","UL"]},!1,b.element),e=wysihtml5.dom.getParentElement(c.parentNode,{nodeName:["LI"]},!1,b.element),d&&e)f.nextSibling&&(g=i.getAfterList(c,f),f.appendChild(g)),d.insertBefore(f,e.nextSibling);else{for(f.nextSibling&&(g=i.getAfterList(c,f),f.appendChild(g)),k=f.childNodes.length;k--;)c.parentNode.insertBefore(f.childNodes[k],c.nextSibling);c.parentNode.insertBefore(document.createElement("br"),c.nextSibling),f.parentNode.removeChild(f)}0===c.childNodes.length&&c.parentNode.removeChild(c)}}),h},getAfterList:function(a,b){for(var c=a.nodeName,d=document.createElement(c);b.nextSibling;)d.appendChild(b.nextSibling);return d}},function(a){var b=90,c=89,d=8,e=46,f=25,g="data-wysihtml5-selection-node",h="data-wysihtml5-selection-offset",i=('<span id="_wysihtml5-undo" class="_wysihtml5-temp">'+a.INVISIBLE_SPACE+"</span>",'<span id="_wysihtml5-redo" class="_wysihtml5-temp">'+a.INVISIBLE_SPACE+"</span>",a.dom);a.UndoManager=a.lang.Dispatcher.extend({constructor:function(a){this.editor=a,this.composer=a.composer,this.element=this.composer.element,this.position=0,this.historyStr=[],this.historyDom=[],this.transact(),this._observe()},_observe:function(){{var a,f=this;this.composer.sandbox.getDocument()}i.observe(this.element,"keydown",function(a){if(!a.altKey&&(a.ctrlKey||a.metaKey)){var d=a.keyCode,e=d===b&&!a.shiftKey,g=d===b&&a.shiftKey||d===c;e?(f.undo(),a.preventDefault()):g&&(f.redo(),a.preventDefault())}}),i.observe(this.element,"keydown",function(b){var c=b.keyCode;c!==a&&(a=c,(c===d||c===e)&&f.transact())}),this.editor.on("newword:composer",function(){f.transact()}).on("beforecommand:composer",function(){f.transact()})},transact:function(){var b,c,d,e,i,j,k,l=this.historyStr[this.position-1],m=this.composer.getValue(!1,!1),n=this.element.offsetWidth>0&&this.element.offsetHeight>0;m!==l&&(j=this.historyStr.length=this.historyDom.length=this.position,j>f&&(this.historyStr.shift(),this.historyDom.shift(),this.position--),this.position++,n&&(b=this.composer.selection.getRange(),c=b&&b.startContainer?b.startContainer:this.element,d=b&&b.startOffset?b.startOffset:0,c.nodeType===a.ELEMENT_NODE?e=c:(e=c.parentNode,i=this.getChildNodeIndex(e,c)),e.setAttribute(h,d),void 0!==i&&e.setAttribute(g,i)),k=this.element.cloneNode(!!m),this.historyDom.push(k),this.historyStr.push(m),e&&(e.removeAttribute(h),e.removeAttribute(g)))},undo:function(){this.transact(),this.undoPossible()&&(this.set(this.historyDom[--this.position-1]),this.editor.fire("undo:composer"))},redo:function(){this.redoPossible()&&(this.set(this.historyDom[++this.position-1]),this.editor.fire("redo:composer"))},undoPossible:function(){return this.position>1},redoPossible:function(){return this.position<this.historyStr.length},set:function(a){var b,c,d,e,f,i;for(this.element.innerHTML="",b=0,c=a.childNodes,d=a.childNodes.length;d>b;b++)this.element.appendChild(c[b].cloneNode(!0));a.hasAttribute(h)?(e=a.getAttribute(h),i=a.getAttribute(g),f=this.element):(f=this.element.querySelector("["+h+"]")||this.element,e=f.getAttribute(h),i=f.getAttribute(g),f.removeAttribute(h),f.removeAttribute(g)),null!==i&&(f=this.getChildNodeByIndex(f,+i)),this.composer.selection.set(f,e)},getChildNodeIndex:function(a,b){for(var c=0,d=a.childNodes,e=d.length;e>c;c++)if(d[c]===b)return c},getChildNodeByIndex:function(a,b){return a.childNodes[b]}})}(wysihtml5),wysihtml5.views.View=Base.extend({constructor:function(a,b,c){this.parent=a,this.element=b,this.config=c,this.config.noTextarea||this._observeViewChange()},_observeViewChange:function(){var a=this;this.parent.on("beforeload",function(){a.parent.on("change_view",function(b){b===a.name?(a.parent.currentView=a,a.show(),setTimeout(function(){a.focus()},0)):a.hide()})})},focus:function(){if(this.element.ownerDocument.querySelector(":focus")!==this.element)try{this.element.focus()}catch(a){}},hide:function(){this.element.style.display="none"},show:function(){this.element.style.display=""},disable:function(){this.element.setAttribute("disabled","disabled")},enable:function(){this.element.removeAttribute("disabled")}}),function(a){var b=a.dom,c=a.browser;a.views.Composer=a.views.View.extend({name:"composer",CARET_HACK:"<br>",constructor:function(a,b,c){this.base(a,b,c),this.config.noTextarea?this.editableArea=b:this.textarea=this.parent.textarea,this.config.contentEditableMode?this._initContentEditableArea():this._initSandbox()},clear:function(){this.element.innerHTML=c.displaysCaretInEmptyContentEditableCorrectly()?"":this.CARET_HACK},getValue:function(b,c){var d=this.isEmpty()?"":a.quirks.getCorrectInnerHTML(this.element);return b!==!1&&(d=this.parent.parse(d,c===!1?!1:!0)),d},setValue:function(a,b){b&&(a=this.parent.parse(a));try{this.element.innerHTML=a}catch(c){this.element.innerText=a}},cleanUp:function(){this.parent.parse(this.element)},show:function(){this.editableArea.style.display=this._displayStyle||"",this.config.noTextarea||this.textarea.element.disabled||(this.disable(),this.enable())},hide:function(){this._displayStyle=b.getStyle("display").from(this.editableArea),"none"===this._displayStyle&&(this._displayStyle=null),this.editableArea.style.display="none"},disable:function(){this.parent.fire("disable:composer"),this.element.removeAttribute("contentEditable")},enable:function(){this.parent.fire("enable:composer"),this.element.setAttribute("contentEditable","true")},focus:function(b){a.browser.doesAsyncFocus()&&this.hasPlaceholderSet()&&this.clear(),this.base();var c=this.element.lastChild;b&&c&&this.selection&&("BR"===c.nodeName?this.selection.setBefore(this.element.lastChild):this.selection.setAfter(this.element.lastChild))},getTextContent:function(){return b.getTextContent(this.element)},hasPlaceholderSet:function(){return this.getTextContent()==(this.config.noTextarea?this.editableArea.getAttribute("data-placeholder"):this.textarea.element.getAttribute("placeholder"))&&this.placeholderSet},isEmpty:function(){var a=this.element.innerHTML.toLowerCase();return/^(\s|<br>|<\/br>|<p>|<\/p>)*$/i.test(a)||""===a||"<br>"===a||"<p></p>"===a||"<p><br></p>"===a||this.hasPlaceholderSet()},_initContentEditableArea:function(){var a=this;this.config.noTextarea?this.sandbox=new b.ContentEditableArea(function(){a._create()},{},this.editableArea):(this.sandbox=new b.ContentEditableArea(function(){a._create()}),this.editableArea=this.sandbox.getContentEditable(),b.insert(this.editableArea).after(this.textarea.element),this._createWysiwygFormField())},_initSandbox:function(){var a,c=this;this.sandbox=new b.Sandbox(function(){c._create()},{stylesheets:this.config.stylesheets}),this.editableArea=this.sandbox.getIframe(),a=this.textarea.element,b.insert(this.editableArea).after(a),this._createWysiwygFormField()},_createWysiwygFormField:function(){if(this.textarea.element.form){var a=document.createElement("input");a.type="hidden",a.name="_wysihtml5_mode",a.value=1,b.insert(a).after(this.textarea.element)}},_create:function(){var d,e,f=this;this.doc=this.sandbox.getDocument(),this.element=this.config.contentEditableMode?this.sandbox.getContentEditable():this.doc.body,this.config.noTextarea?this.cleanUp():(this.textarea=this.parent.textarea,this.element.innerHTML=this.textarea.getValue(!0,!1)),this.selection=new a.Selection(this.parent,this.element,this.config.uneditableContainerClassname),this.commands=new a.Commands(this.parent),this.config.noTextarea||b.copyAttributes(["className","spellcheck","title","lang","dir","accessKey"]).from(this.textarea.element).to(this.element),b.addClass(this.element,this.config.composerClassName),this.config.style&&!this.config.contentEditableMode&&this.style(),this.observe(),d=this.config.name,d&&(b.addClass(this.element,d),this.config.contentEditableMode||b.addClass(this.editableArea,d)),this.enable(),!this.config.noTextarea&&this.textarea.element.disabled&&this.disable(),e="string"==typeof this.config.placeholder?this.config.placeholder:this.config.noTextarea?this.editableArea.getAttribute("data-placeholder"):this.textarea.element.getAttribute("placeholder"),e&&b.simulatePlaceholder(this.parent,this,e),this.commands.exec("styleWithCSS",!1),this._initAutoLinking(),this._initObjectResizing(),this._initUndoManager(),this._initLineBreaking(),this.config.noTextarea||!this.textarea.element.hasAttribute("autofocus")&&document.querySelector(":focus")!=this.textarea.element||c.isIos()||setTimeout(function(){f.focus(!0)},100),c.clearsContentEditableCorrectly()||a.quirks.ensureProperClearing(this),this.initSync&&this.config.sync&&this.initSync(),this.config.noTextarea||this.textarea.hide(),this.parent.fire("beforeload").fire("load")},_initAutoLinking:function(){var d,e,f,g=this,h=c.canDisableAutoLinking(),i=c.doesAutoLinkingInContentEditable();h&&this.commands.exec("autoUrlDetect",!1),this.config.autoLink&&((!i||i&&h)&&(this.parent.on("newword:composer",function(){b.getTextContent(g.element).match(b.autoLink.URL_REG_EXP)&&g.selection.executeAndRestore(function(c,d){var e,f=g.element.querySelectorAll("."+g.config.uneditableContainerClassname),h=!1;for(e=f.length;e--;)a.dom.contains(f[e],d)&&(h=!0);h||b.autoLink(d.parentNode,[g.config.uneditableContainerClassname])})}),b.observe(this.element,"blur",function(){b.autoLink(g.element,[g.config.uneditableContainerClassname])})),d=this.sandbox.getDocument().getElementsByTagName("a"),e=b.autoLink.URL_REG_EXP,f=function(c){var d=a.lang.string(b.getTextContent(c)).trim();return"www."===d.substr(0,4)&&(d="http://"+d),d},b.observe(this.element,"keydown",function(a){if(d.length){var c,h=g.selection.getSelectedNode(a.target.ownerDocument),i=b.getParentElement(h,{nodeName:"A"},4);i&&(c=f(i),setTimeout(function(){var a=f(i);a!==c&&a.match(e)&&i.setAttribute("href",a)},0))}}))},_initObjectResizing:function(){if(this.commands.exec("enableObjectResizing",!0),c.supportsEvent("resizeend")){var d=["width","height"],e=d.length,f=this.element;b.observe(f,"resizeend",function(b){var c,g=b.target||b.srcElement,h=g.style,i=0;if("IMG"===g.nodeName){for(;e>i;i++)c=d[i],h[c]&&(g.setAttribute(c,parseInt(h[c],10)),h[c]="");a.quirks.redraw(f)}})}},_initUndoManager:function(){this.undoManager=new a.UndoManager(this.parent)},_initLineBreaking:function(){function d(a){var c=b.getParentElement(a,{nodeName:["P","DIV"]},2);c&&b.contains(e.element,c)&&e.selection.executeAndRestore(function(){e.config.useLineBreaks?b.replaceWithChildNodes(c):"P"!==c.nodeName&&b.renameElement(c,"p")})}var e=this,f=["LI","P","H1","H2","H3","H4","H5","H6"],g=["UL","OL","MENU"];this.config.useLineBreaks||b.observe(this.element,["focus","keydown"],function(){if(e.isEmpty()){var a=e.doc.createElement("P");e.element.innerHTML="",e.element.appendChild(a),c.displaysCaretInEmptyContentEditableCorrectly()?e.selection.selectNode(a,!0):(a.innerHTML="<br>",e.selection.setBefore(a.firstChild))}}),b.observe(this.element,"keydown",function(c){var h,i=c.keyCode;if(!c.shiftKey&&(i===a.ENTER_KEY||i===a.BACKSPACE_KEY))return h=b.getParentElement(e.selection.getSelectedNode(),{nodeName:f},4),h?(setTimeout(function(){var c,f=e.selection.getSelectedNode();if("LI"===h.nodeName){if(!f)return;c=b.getParentElement(f,{nodeName:g},2),c||d(f)}i===a.ENTER_KEY&&h.nodeName.match(/^H[1-6]$/)&&d(f)},0),void 0):(e.config.useLineBreaks&&i===a.ENTER_KEY&&!a.browser.insertsLineBreaksOnReturn()&&(c.preventDefault(),e.commands.exec("insertLineBreak")),void 0)})}})}(wysihtml5),function(a){var b=a.dom,c=document,d=window,e=c.createElement("div"),f=["background-color","color","cursor","font-family","font-size","font-style","font-variant","font-weight","line-height","letter-spacing","text-align","text-decoration","text-indent","text-rendering","word-break","word-wrap","word-spacing"],g=["background-color","border-collapse","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-top-color","border-top-style","border-top-width","clear","display","float","margin-bottom","margin-left","margin-right","margin-top","outline-color","outline-offset","outline-width","outline-style","padding-left","padding-right","padding-top","padding-bottom","position","top","left","right","bottom","z-index","vertical-align","text-align","-webkit-box-sizing","-moz-box-sizing","-ms-box-sizing","box-sizing","-webkit-box-shadow","-moz-box-shadow","-ms-box-shadow","box-shadow","-webkit-border-top-right-radius","-moz-border-radius-topright","border-top-right-radius","-webkit-border-bottom-right-radius","-moz-border-radius-bottomright","border-bottom-right-radius","-webkit-border-bottom-left-radius","-moz-border-radius-bottomleft","border-bottom-left-radius","-webkit-border-top-left-radius","-moz-border-radius-topleft","border-top-left-radius","width","height"],h=["html { height: 100%; }","body { height: 100%; padding: 1px 0 0 0; margin: -1px 0 0 0; }","body > p:first-child { margin-top: 0; }","._wysihtml5-temp { display: none; }",a.browser.isGecko?"body.placeholder { color: graytext !important; }":"body.placeholder { color: #a9a9a9 !important; }","img:-moz-broken { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }"],i=function(a){if(a.setActive)try{a.setActive()}catch(e){}else{var f=a.style,g=c.documentElement.scrollTop||c.body.scrollTop,h=c.documentElement.scrollLeft||c.body.scrollLeft,i={position:f.position,top:f.top,left:f.left,WebkitUserSelect:f.WebkitUserSelect};b.setStyles({position:"absolute",top:"-99999px",left:"-99999px",WebkitUserSelect:"none"}).on(a),a.focus(),b.setStyles(i).on(a),d.scrollTo&&d.scrollTo(h,g)}};a.views.Composer.prototype.style=function(){var d,j,k=this,l=c.querySelector(":focus"),m=this.textarea.element,n=m.hasAttribute("placeholder"),o=n&&m.getAttribute("placeholder"),p=m.style.display,q=m.disabled;return this.focusStylesHost=e.cloneNode(!1),this.blurStylesHost=e.cloneNode(!1),this.disabledStylesHost=e.cloneNode(!1),n&&m.removeAttribute("placeholder"),m===l&&m.blur(),m.disabled=!1,m.style.display=d="none",(m.getAttribute("rows")&&"auto"===b.getStyle("height").from(m)||m.getAttribute("cols")&&"auto"===b.getStyle("width").from(m))&&(m.style.display=d=p),b.copyStyles(g).from(m).to(this.editableArea).andTo(this.blurStylesHost),b.copyStyles(f).from(m).to(this.element).andTo(this.blurStylesHost),b.insertCSS(h).into(this.element.ownerDocument),m.disabled=!0,b.copyStyles(g).from(m).to(this.disabledStylesHost),b.copyStyles(f).from(m).to(this.disabledStylesHost),m.disabled=q,m.style.display=p,i(m),m.style.display=d,b.copyStyles(g).from(m).to(this.focusStylesHost),b.copyStyles(f).from(m).to(this.focusStylesHost),m.style.display=p,b.copyStyles(["display"]).from(m).to(this.editableArea),j=a.lang.array(g).without(["display"]),l?l.focus():m.blur(),n&&m.setAttribute("placeholder",o),this.parent.on("focus:composer",function(){b.copyStyles(j).from(k.focusStylesHost).to(k.editableArea),b.copyStyles(f).from(k.focusStylesHost).to(k.element)}),this.parent.on("blur:composer",function(){b.copyStyles(j).from(k.blurStylesHost).to(k.editableArea),b.copyStyles(f).from(k.blurStylesHost).to(k.element)}),this.parent.observe("disable:composer",function(){b.copyStyles(j).from(k.disabledStylesHost).to(k.editableArea),b.copyStyles(f).from(k.disabledStylesHost).to(k.element)}),this.parent.observe("enable:composer",function(){b.copyStyles(j).from(k.blurStylesHost).to(k.editableArea),b.copyStyles(f).from(k.blurStylesHost).to(k.element)}),this}}(wysihtml5),function(a){var b=a.dom,c=a.browser,d={66:"bold",73:"italic",85:"underline"},e=function(a,b,c){var d,e=a.getPreviousNode(b,!0),f=a.getSelectedNode();if(1!==f.nodeType&&f.parentNode!==c&&(f=f.parentNode),e)if(1==f.nodeType){if(d=f.firstChild,1==e.nodeType)for(;f.firstChild;)e.appendChild(f.firstChild);else for(;f.firstChild;)b.parentNode.insertBefore(f.firstChild,b);f.parentNode&&f.parentNode.removeChild(f),a.setBefore(d)}else 1==e.nodeType?e.appendChild(f):b.parentNode.insertBefore(f,b),a.setBefore(f)},f=function(a,b,c,d){var f,g,h;b.isCollapsed()?b.caretIsInTheBeginnig("LI")?(a.preventDefault(),d.commands.exec("outdentList")):b.caretIsInTheBeginnig()?a.preventDefault():(b.caretIsFirstInSelection()&&b.getPreviousNode()&&b.getPreviousNode().nodeName&&/^H\d$/gi.test(b.getPreviousNode().nodeName)&&(f=b.getPreviousNode(),a.preventDefault(),/^\s*$/.test(f.textContent||f.innerText)?f.parentNode.removeChild(f):(g=f.ownerDocument.createRange(),g.selectNodeContents(f),g.collapse(!1),b.setSelection(g))),h=b.caretIsBeforeUneditable(),h&&(a.preventDefault(),e(b,h,c))):b.containsUneditable()&&(a.preventDefault(),b.deleteContents())},g=function(a){if(a.selection.isCollapsed()){if(a.selection.caretIsInTheBeginnig("LI")&&a.commands.exec("indentList"))return}else a.selection.deleteContents();
+a.commands.exec("insertHTML","&emsp;")};a.views.Composer.prototype.observe=function(){var e,h,i=this,j=this.getValue(!1,!1),k=this.sandbox.getIframe?this.sandbox.getIframe():this.sandbox.getContentEditable(),l=this.element,m=c.supportsEventsInIframeCorrectly()||this.sandbox.getContentEditable?l:this.sandbox.getWindow(),n=["drop","paste","beforepaste"],o=["drop","paste","mouseup","focus","keyup"];b.observe(k,"DOMNodeRemoved",function(){clearInterval(e),i.parent.fire("destroy:composer")}),c.supportsMutationEvents()||(e=setInterval(function(){b.contains(document.documentElement,k)||(clearInterval(e),i.parent.fire("destroy:composer"))},250)),b.observe(m,o,function(){setTimeout(function(){i.parent.fire("interaction").fire("interaction:composer")},0)}),this.config.handleTables&&(!this.tableClickHandle&&this.doc.execCommand&&a.browser.supportsCommand(this.doc,"enableObjectResizing")&&a.browser.supportsCommand(this.doc,"enableInlineTableEditing")&&(this.sandbox.getIframe?this.tableClickHandle=b.observe(k,["focus","mouseup","mouseover"],function(){i.doc.execCommand("enableObjectResizing",!1,"false"),i.doc.execCommand("enableInlineTableEditing",!1,"false"),i.tableClickHandle.stop()}):setTimeout(function(){i.doc.execCommand("enableObjectResizing",!1,"false"),i.doc.execCommand("enableInlineTableEditing",!1,"false")},0)),this.tableSelection=a.quirks.tableCellsSelection(l,i.parent)),b.observe(m,"focus",function(a){i.parent.fire("focus",a).fire("focus:composer",a),setTimeout(function(){j=i.getValue(!1,!1)},0)}),b.observe(m,"blur",function(a){if(j!==i.getValue(!1,!1)){var b=a;"function"==typeof Object.create&&(b=Object.create(a,{type:{value:"change"}})),i.parent.fire("change",b).fire("change:composer",b)}i.parent.fire("blur",a).fire("blur:composer",a)}),b.observe(l,"dragenter",function(){i.parent.fire("unset_placeholder")}),b.observe(l,n,function(a){i.parent.fire(a.type,a).fire(a.type+":composer",a)}),this.config.copyedFromMarking&&b.observe(l,"copy",function(a){a.clipboardData&&(a.clipboardData.setData("text/html",i.config.copyedFromMarking+i.selection.getHtml()),a.preventDefault()),i.parent.fire(a.type,a).fire(a.type+":composer",a)}),b.observe(l,"keyup",function(b){var c=b.keyCode;(c===a.SPACE_KEY||c===a.ENTER_KEY)&&i.parent.fire("newword:composer")}),this.parent.on("paste:composer",function(){setTimeout(function(){i.parent.fire("newword:composer")},0)}),c.canSelectImagesInContentEditable()||b.observe(l,"mousedown",function(b){var c=b.target,d=l.querySelectorAll("img"),e=l.querySelectorAll("."+i.config.uneditableContainerClassname+" img"),f=a.lang.array(d).without(e);"IMG"===c.nodeName&&a.lang.array(f).contains(c)&&i.selection.selectNode(c)}),c.canSelectImagesInContentEditable()||b.observe(l,"drop",function(){setTimeout(function(){i.selection.getSelection().removeAllRanges()},0)}),c.hasHistoryIssue()&&c.supportsSelectionModify()&&b.observe(l,"keydown",function(a){if(a.metaKey||a.ctrlKey){var b=a.keyCode,c=l.ownerDocument.defaultView,d=c.getSelection();(37===b||39===b)&&(37===b&&(d.modify("extend","left","lineboundary"),a.shiftKey||d.collapseToStart()),39===b&&(d.modify("extend","right","lineboundary"),a.shiftKey||d.collapseToEnd()),a.preventDefault())}}),b.observe(l,"keydown",function(a){var b=a.keyCode,c=d[b];(a.ctrlKey||a.metaKey)&&!a.altKey&&c&&(i.commands.exec(c),a.preventDefault()),8===b?f(a,i.selection,l,i):i.config.handleTabKey&&9===b&&(a.preventDefault(),g(i,l))}),b.observe(l,"keydown",function(b){var c,d=i.selection.getSelectedNode(!0),e=b.keyCode;!d||"IMG"!==d.nodeName||e!==a.BACKSPACE_KEY&&e!==a.DELETE_KEY||(c=d.parentNode,c.removeChild(d),"A"!==c.nodeName||c.firstChild||c.parentNode.removeChild(c),setTimeout(function(){a.quirks.redraw(l)},0),b.preventDefault())}),!this.config.contentEditableMode&&c.hasIframeFocusIssue()&&(b.observe(k,"focus",function(){setTimeout(function(){i.doc.querySelector(":focus")!==i.element&&i.focus()},0)}),b.observe(this.element,"blur",function(){setTimeout(function(){i.selection.getSelection().removeAllRanges()},0)})),h={IMG:"Image: ",A:"Link: "},b.observe(l,"mouseover",function(a){var b,c,d=a.target,e=d.nodeName;("A"===e||"IMG"===e)&&(c=d.hasAttribute("title"),c||(b=h[e]+(d.getAttribute("href")||d.getAttribute("src")),d.setAttribute("title",b)))})}}(wysihtml5),function(a){var b=400;a.views.Synchronizer=Base.extend({constructor:function(a,b,c){this.editor=a,this.textarea=b,this.composer=c,this._observe()},fromComposerToTextarea:function(b){this.textarea.setValue(a.lang.string(this.composer.getValue(!1,!1)).trim(),b)},fromTextareaToComposer:function(a){var b=this.textarea.getValue(!1,!1);b?this.composer.setValue(b,a):(this.composer.clear(),this.editor.fire("set_placeholder"))},sync:function(a){"textarea"===this.editor.currentView.name?this.fromTextareaToComposer(a):this.fromComposerToTextarea(a)},_observe:function(){var c,d=this,e=this.textarea.element.form,f=function(){c=setInterval(function(){d.fromComposerToTextarea()},b)},g=function(){clearInterval(c),c=null};f(),e&&(a.dom.observe(e,"submit",function(){d.sync(!0)}),a.dom.observe(e,"reset",function(){setTimeout(function(){d.fromTextareaToComposer()},0)})),this.editor.on("change_view",function(a){"composer"!==a||c?"textarea"===a&&(d.fromComposerToTextarea(!0),g()):(d.fromTextareaToComposer(!0),f())}),this.editor.on("destroy:composer",g)}})}(wysihtml5),wysihtml5.views.Textarea=wysihtml5.views.View.extend({name:"textarea",constructor:function(a,b,c){this.base(a,b,c),this._observe()},clear:function(){this.element.value=""},getValue:function(a){var b=this.isEmpty()?"":this.element.value;return a!==!1&&(b=this.parent.parse(b)),b},setValue:function(a,b){b&&(a=this.parent.parse(a)),this.element.value=a},cleanUp:function(){var a=this.parent.parse(this.element.value);this.element.value=a},hasPlaceholderSet:function(){var a=wysihtml5.browser.supportsPlaceholderAttributeOn(this.element),b=this.element.getAttribute("placeholder")||null,c=this.element.value,d=!c;return a&&d||c===b},isEmpty:function(){return!wysihtml5.lang.string(this.element.value).trim()||this.hasPlaceholderSet()},_observe:function(){var a=this.element,b=this.parent,c={focusin:"focus",focusout:"blur"},d=wysihtml5.browser.supportsEvent("focusin")?["focusin","focusout","change"]:["focus","blur","change"];b.on("beforeload",function(){wysihtml5.dom.observe(a,d,function(a){var d=c[a.type]||a.type;b.fire(d).fire(d+":textarea")}),wysihtml5.dom.observe(a,["paste","drop"],function(){setTimeout(function(){b.fire("paste").fire("paste:textarea")},0)})})}}),function(a){var b,c={name:b,style:!0,toolbar:b,showToolbarAfterInit:!0,autoLink:!0,handleTables:!0,handleTabKey:!0,parserRules:{tags:{br:{},span:{},div:{},p:{}},classes:{}},pasteParserRulesets:null,parser:a.dom.parse,composerClassName:"wysihtml5-editor",bodyClassName:"wysihtml5-supported",useLineBreaks:!0,stylesheets:[],placeholderText:b,supportTouchDevices:!0,cleanUp:!0,contentEditableMode:!1,uneditableContainerClassname:"wysihtml5-uneditable-container",copyedFromMarking:'<meta name="copied-from" content="wysihtml5">'};a.Editor=a.lang.Dispatcher.extend({constructor:function(b,d){if(this.editableElement="string"==typeof b?document.getElementById(b):b,this.config=a.lang.object({}).merge(c).merge(d).get(),this._isCompatible=a.browser.supported(),"textarea"!=this.editableElement.nodeName.toLowerCase()&&(this.config.contentEditableMode=!0,this.config.noTextarea=!0),this.config.noTextarea||(this.textarea=new a.views.Textarea(this,this.editableElement,this.config),this.currentView=this.textarea),!this._isCompatible||!this.config.supportTouchDevices&&a.browser.isTouchDevice()){var e=this;return setTimeout(function(){e.fire("beforeload").fire("load")},0),void 0}a.dom.addClass(document.body,this.config.bodyClassName),this.composer=new a.views.Composer(this,this.editableElement,this.config),this.currentView=this.composer,"function"==typeof this.config.parser&&this._initParser(),this.on("beforeload",this.handleBeforeLoad)},handleBeforeLoad:function(){this.config.noTextarea||(this.synchronizer=new a.views.Synchronizer(this,this.textarea,this.composer)),this.config.toolbar&&(this.toolbar=new a.toolbar.Toolbar(this,this.config.toolbar,this.config.showToolbarAfterInit))},isCompatible:function(){return this._isCompatible},clear:function(){return this.currentView.clear(),this},getValue:function(a,b){return this.currentView.getValue(a,b)},setValue:function(a,b){return this.fire("unset_placeholder"),a?(this.currentView.setValue(a,b),this):this.clear()},cleanUp:function(){this.currentView.cleanUp()},focus:function(a){return this.currentView.focus(a),this},disable:function(){return this.currentView.disable(),this},enable:function(){return this.currentView.enable(),this},isEmpty:function(){return this.currentView.isEmpty()},hasPlaceholderSet:function(){return this.currentView.hasPlaceholderSet()},parse:function(b,c){var d=this.config.contentEditableMode?document:this.composer?this.composer.sandbox.getDocument():null,e=this.config.parser(b,{rules:this.config.parserRules,cleanUp:this.config.cleanUp,context:d,uneditableClass:this.config.uneditableContainerClassname,clearInternals:c});return"object"==typeof b&&a.quirks.redraw(b),e},_initParser:function(){var b,c=this;a.browser.supportsModenPaste()?this.on("paste:composer",function(d){d.preventDefault(),b=a.dom.getPastedHtml(d),b&&c._cleanAndPaste(b)}):this.on("beforepaste:composer",function(b){b.preventDefault(),a.dom.getPastedHtmlWithDiv(c.composer,function(a){a&&c._cleanAndPaste(a)})})},_cleanAndPaste:function(b){var c=a.quirks.cleanPastedHTML(b,{referenceNode:this.composer.element,rules:this.config.pasteParserRulesets||[{set:this.config.parserRules}],uneditableClass:this.config.uneditableContainerClassname});this.composer.selection.deleteContents(),this.composer.selection.insertHTML(c)}})}(wysihtml5),function(a){var b=a.dom,c="wysihtml5-command-dialog-opened",d="input, select, textarea",e="[data-wysihtml5-dialog-field]",f="data-wysihtml5-dialog-field";a.toolbar.Dialog=a.lang.Dispatcher.extend({constructor:function(a,b){this.link=a,this.container=b},_observe:function(){var e,f,g,h,i,j;if(!this._observed){for(e=this,f=function(a){var b=e._serialize();b==e.elementToChange?e.fire("edit",b):e.fire("save",b),e.hide(),a.preventDefault(),a.stopPropagation()},b.observe(e.link,"click",function(){b.hasClass(e.link,c)&&setTimeout(function(){e.hide()},0)}),b.observe(this.container,"keydown",function(b){var c=b.keyCode;c===a.ENTER_KEY&&f(b),c===a.ESCAPE_KEY&&(e.fire("cancel"),e.hide())}),b.delegate(this.container,"[data-wysihtml5-dialog-action=save]","click",f),b.delegate(this.container,"[data-wysihtml5-dialog-action=cancel]","click",function(a){e.fire("cancel"),e.hide(),a.preventDefault(),a.stopPropagation()}),g=this.container.querySelectorAll(d),h=0,i=g.length,j=function(){clearInterval(e.interval)};i>h;h++)b.observe(g[h],"change",j);this._observed=!0}},_serialize:function(){for(var a=this.elementToChange||{},b=this.container.querySelectorAll(e),c=b.length,d=0;c>d;d++)a[b[d].getAttribute(f)]=b[d].value;return a},_interpolate:function(a){for(var b,c,d,g=document.querySelector(":focus"),h=this.container.querySelectorAll(e),i=h.length,j=0;i>j;j++)b=h[j],b!==g&&(a&&"hidden"===b.type||(c=b.getAttribute(f),d=this.elementToChange&&"boolean"!=typeof this.elementToChange?this.elementToChange.getAttribute(c)||"":b.defaultValue,b.value=d))},show:function(a){if(!b.hasClass(this.link,c)){var e=this,f=this.container.querySelector(d);if(this.elementToChange=a,this._observe(),this._interpolate(),a&&(this.interval=setInterval(function(){e._interpolate(!0)},500)),b.addClass(this.link,c),this.container.style.display="",this.fire("show"),f&&!a)try{f.focus()}catch(g){}}},hide:function(){clearInterval(this.interval),this.elementToChange=null,b.removeClass(this.link,c),this.container.style.display="none",this.fire("hide")}})}(wysihtml5),function(a){var b=a.dom,c={position:"relative"},d={left:0,margin:0,opacity:0,overflow:"hidden",padding:0,position:"absolute",top:0,zIndex:1},e={cursor:"inherit",fontSize:"50px",height:"50px",marginTop:"-25px",outline:0,padding:0,position:"absolute",right:"-4px",top:"50%"},f={"x-webkit-speech":"",speech:""};a.toolbar.Speech=function(g,h){var i,j,k,l=document.createElement("input");return a.browser.supportsSpeechApiOn(l)?(i=g.editor.textarea.element.getAttribute("lang"),i&&(f.lang=i),j=document.createElement("div"),a.lang.object(d).merge({width:h.offsetWidth+"px",height:h.offsetHeight+"px"}),b.insert(l).into(j),b.insert(j).into(h),b.setStyles(e).on(l),b.setAttributes(f).on(l),b.setStyles(d).on(j),b.setStyles(c).on(h),k="onwebkitspeechchange"in l?"webkitspeechchange":"speechchange",b.observe(l,k,function(){g.execCommand("insertText",l.value),l.value=""}),b.observe(l,"click",function(a){b.hasClass(h,"wysihtml5-command-disabled")&&a.preventDefault(),a.stopPropagation()}),void 0):(h.style.display="none",void 0)}}(wysihtml5),function(a){var b="wysihtml5-command-disabled",c="wysihtml5-commands-disabled",d="wysihtml5-command-active",e="wysihtml5-action-active",f=a.dom;a.toolbar.Toolbar=Base.extend({constructor:function(f,g,h){this.editor=f,this.container="string"==typeof g?document.getElementById(g):g,this.composer=f.composer,this._getLinks("command"),this._getLinks("action"),this._observe(),h&&this.show(),null!=f.config.classNameCommandDisabled&&(b=f.config.classNameCommandDisabled),null!=f.config.classNameCommandsDisabled&&(c=f.config.classNameCommandsDisabled),null!=f.config.classNameCommandActive&&(d=f.config.classNameCommandActive),null!=f.config.classNameActionActive&&(e=f.config.classNameActionActive);for(var i=this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),j=i.length,k=0;j>k;k++)new a.toolbar.Speech(this,i[k])},_getLinks:function(b){for(var c,d,e,f,g,h=this[b+"Links"]=a.lang.array(this.container.querySelectorAll("[data-wysihtml5-"+b+"]")).get(),i=h.length,j=0,k=this[b+"Mapping"]={};i>j;j++)c=h[j],e=c.getAttribute("data-wysihtml5-"+b),f=c.getAttribute("data-wysihtml5-"+b+"-value"),d=this.container.querySelector("[data-wysihtml5-"+b+"-group='"+e+"']"),g=this._getDialog(c,e),k[e+":"+f]={link:c,group:d,name:e,value:f,dialog:g,state:!1}},_getDialog:function(b,c){var d,e,f=this,g=this.container.querySelector("[data-wysihtml5-dialog='"+c+"']");return g&&(d=a.toolbar["Dialog_"+c]?new a.toolbar["Dialog_"+c](b,g):new a.toolbar.Dialog(b,g),d.on("show",function(){e=f.composer.selection.getBookmark(),f.editor.fire("show:dialog",{command:c,dialogContainer:g,commandLink:b})}),d.on("save",function(a){e&&f.composer.selection.setBookmark(e),f._execCommand(c,a),f.editor.fire("save:dialog",{command:c,dialogContainer:g,commandLink:b})}),d.on("cancel",function(){f.editor.focus(!1),f.editor.fire("cancel:dialog",{command:c,dialogContainer:g,commandLink:b})})),d},execCommand:function(a,b){if(!this.commandsDisabled){var c=this.commandMapping[a+":"+b];c&&c.dialog&&!c.state?c.dialog.show():this._execCommand(a,b)}},_execCommand:function(a,b){this.editor.focus(!1),this.composer.commands.exec(a,b),this._updateLinkStates()},execAction:function(a){var b=this.editor;"change_view"===a&&b.textarea&&(b.currentView===b.textarea?b.fire("change_view","composer"):b.fire("change_view","textarea")),"showSource"==a&&b.fire("showSource")},_observe:function(){for(var a=this,b=this.editor,d=this.container,e=this.commandLinks.concat(this.actionLinks),g=e.length,h=0;g>h;h++)"A"===e[h].nodeName?f.setAttributes({href:"javascript:;",unselectable:"on"}).on(e[h]):f.setAttributes({unselectable:"on"}).on(e[h]);f.delegate(d,"[data-wysihtml5-command], [data-wysihtml5-action]","mousedown",function(a){a.preventDefault()}),f.delegate(d,"[data-wysihtml5-command]","click",function(b){var c=this,d=c.getAttribute("data-wysihtml5-command"),e=c.getAttribute("data-wysihtml5-command-value");a.execCommand(d,e),b.preventDefault()}),f.delegate(d,"[data-wysihtml5-action]","click",function(b){var c=this.getAttribute("data-wysihtml5-action");a.execAction(c),b.preventDefault()}),b.on("interaction:composer",function(){a._updateLinkStates()}),b.on("focus:composer",function(){a.bookmark=null}),this.editor.config.handleTables&&(b.on("tableselect:composer",function(){a.container.querySelectorAll('[data-wysihtml5-hiddentools="table"]')[0].style.display=""}),b.on("tableunselect:composer",function(){a.container.querySelectorAll('[data-wysihtml5-hiddentools="table"]')[0].style.display="none"})),b.on("change_view",function(e){b.textarea&&setTimeout(function(){a.commandsDisabled="composer"!==e,a._updateLinkStates(),a.commandsDisabled?f.addClass(d,c):f.removeClass(d,c)},0)})},_updateLinkStates:function(){var c,g,h,i,j=this.commandMapping,k=this.actionMapping;for(c in j)i=j[c],this.commandsDisabled?(g=!1,f.removeClass(i.link,d),i.group&&f.removeClass(i.group,d),i.dialog&&i.dialog.hide()):(g=this.composer.commands.state(i.name,i.value),f.removeClass(i.link,b),i.group&&f.removeClass(i.group,b)),i.state!==g&&(i.state=g,g?(f.addClass(i.link,d),i.group&&f.addClass(i.group,d),i.dialog&&("object"==typeof g||a.lang.object(g).isArray()?(!i.dialog.multiselect&&a.lang.object(g).isArray()&&(g=1===g.length?g[0]:!0,i.state=g),i.dialog.show(g)):i.dialog.hide())):(f.removeClass(i.link,d),i.group&&f.removeClass(i.group,d),i.dialog&&i.dialog.hide()));for(c in k)h=k[c],"change_view"===h.name&&(h.state=this.editor.currentView===this.editor.textarea,h.state?f.addClass(h.link,e):f.removeClass(h.link,e))},show:function(){this.container.style.display=""},hide:function(){this.container.style.display="none"}})}(wysihtml5),function(a){a.toolbar.Dialog_createTable=a.toolbar.Dialog.extend({show:function(a){this.base(a)}})}(wysihtml5),function(a){var b=(a.dom,"[data-wysihtml5-dialog-field]"),c="data-wysihtml5-dialog-field";a.toolbar.Dialog_foreColorStyle=a.toolbar.Dialog.extend({multiselect:!0,_serialize:function(){for(var a={},d=this.container.querySelectorAll(b),e=d.length,f=0;e>f;f++)a[d[f].getAttribute(c)]=d[f].value;return a},_interpolate:function(d){for(var e,f=document.querySelector(":focus"),g=this.container.querySelectorAll(b),h=g.length,i=0,j=this.elementToChange?a.lang.object(this.elementToChange).isArray()?this.elementToChange[0]:this.elementToChange:null,k=j?j.getAttribute("style"):null,l=k?a.quirks.styleParser.parseColor(k,"color"):null;h>i;i++)e=g[i],e!==f&&(d&&"hidden"===e.type||"color"===e.getAttribute(c)&&(e.value=l?l[3]&&1!=l[3]?"rgba("+l[0]+","+l[1]+","+l[2]+","+l[3]+");":"rgb("+l[0]+","+l[1]+","+l[2]+");":"rgb(0,0,0);"))}})}(wysihtml5),function(a){a.dom;a.toolbar.Dialog_fontSizeStyle=a.toolbar.Dialog.extend({multiselect:!0,_serialize:function(){return{size:this.container.querySelector('[data-wysihtml5-dialog-field="size"]').value}},_interpolate:function(){var b=document.querySelector(":focus"),c=this.container.querySelector("[data-wysihtml5-dialog-field='size']"),d=this.elementToChange?a.lang.object(this.elementToChange).isArray()?this.elementToChange[0]:this.elementToChange:null,e=d?d.getAttribute("style"):null,f=e?a.quirks.styleParser.parseFontSize(e):null;c&&c!==b&&f&&!/^\s*$/.test(f)&&(c.value=f)}})}(wysihtml5),Handlebars=function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return k[a]||"&amp;"}function c(a,b){for(var c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}function d(a){return a instanceof j?""+a:a||0===a?(a=""+a,m.test(a)?a.replace(l,b):a):""}function e(a){return a||0===a?h(a)&&0===a.length?!0:!1:!0}var f,g,h,i={},j=a,k={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},l=/[&<>"'`]/g,m=/[&<>"'`]/;return i.extend=c,f=Object.prototype.toString,i.toString=f,g=function(a){return"function"==typeof a},g(/x/)&&(g=function(a){return"function"==typeof a&&"[object Function]"===f.call(a)}),i.isFunction=g,h=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===f.call(a):!1},i.isArray=h,i.escapeExpression=d,i.isEmpty=e,i}(a),c=function(){"use strict";function a(a,b){var d,e,f;for(b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn),e=Error.prototype.constructor.call(this,a),f=0;f<c.length;f++)this[c[f]]=e[c[f]];d&&(this.lineNumber=d,this.column=b.firstColumn)}var b,c=["description","fileName","lineNumber","message","name","number","stack"];return a.prototype=Error(),b=a}(),d=function(a,b){"use strict";function c(a,b){this.helpers=a||{},this.partials=b||{},d(this)}function d(a){a.registerHelper("helperMissing",function(a){if(2===arguments.length)return void 0;throw new p("Missing helper: '"+a+"'")}),a.registerHelper("blockHelperMissing",function(b,c){var d=c.inverse||function(){},e=c.fn;return i(b)&&(b=b.call(this)),b===!0?e(this):b===!1||null==b?d(this):h(b)?b.length>0?a.helpers.each(b,c):d(this):e(b)}),a.registerHelper("each",function(a,b){var c,d,e,f=b.fn,g=b.inverse,j=0,k="";if(i(a)&&(a=a.call(this)),b.data&&(c=m(b.data)),a&&"object"==typeof a)if(h(a))for(d=a.length;d>j;j++)c&&(c.index=j,c.first=0===j,c.last=j===a.length-1),k+=f(a[j],{data:c});else for(e in a)a.hasOwnProperty(e)&&(c&&(c.key=e,c.index=j,c.first=0===j),k+=f(a[e],{data:c}),j++);return 0===j&&(k=g(this)),k}),a.registerHelper("if",function(a,b){return i(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||o.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){return i(a)&&(a=a.call(this)),o.isEmpty(a)?void 0:b.fn(a)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)})}function e(a,b){l.log(a,b)}var f,g,h,i,j,k,l,m,n={},o=a,p=b,q="1.3.0";return n.VERSION=q,f=4,n.COMPILER_REVISION=f,g={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"},n.REVISION_CHANGES=g,h=o.isArray,i=o.isFunction,j=o.toString,k="[object Object]",n.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:l,log:e,registerHelper:function(a,b,c){if(j.call(a)===k){if(c||b)throw new p("Arg not supported with multiple helpers");o.extend(this.helpers,a)}else c&&(b.not=c),this.helpers[a]=b},registerPartial:function(a,b){j.call(a)===k?o.extend(this.partials,a):this.partials[a]=b}},l={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(l.level<=a){var c=l.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}},n.logger=l,n.log=e,m=function(a){var b={};return o.extend(b,a),b},n.createFrame=m,n}(b,c),e=function(a,b,c){"use strict";function d(a){var b,c,d=a&&a[0]||1,e=m;if(d!==e){if(e>d)throw b=n[e],c=n[d],new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+b+") or downgrade your runtime to an older version ("+c+").");throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");var c=function(a,c,d,e,f,g){var h,i=b.VM.invokePartial.apply(this,arguments);if(null!=i)return i;if(b.compile)return h={helpers:e,partials:f,data:g},f[c]=b.compile(a,{data:void 0!==g},b),f[c](d,h);throw new l("The partial "+c+" could not be compiled when running in runtime-only mode")},d={escapeExpression:k.escapeExpression,invokePartial:c,programs:[],program:function(a,b,c){var d=this.programs[a];return c?d=g(a,b,c):d||(d=this.programs[a]=g(a,b)),d},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c={},k.extend(c,b),k.extend(c,a)),c},programWithDepth:b.VM.programWithDepth,noop:b.VM.noop,compilerInfo:null};return function(c,e){var f,g,h,i;return e=e||{},h=e.partial?e:b,e.partial||(f=e.helpers,g=e.partials),i=a.call(d,h,c,f,g,e.data),e.partial||b.VM.checkRevision(d.compilerInfo),i}}function f(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){return e=e||{},b.apply(this,[a,e.data||c].concat(d))};return e.program=a,e.depth=d.length,e}function g(a,b,c){var d=function(a,d){return d=d||{},b(a,d.data||c)};return d.program=a,d.depth=0,d}function h(a,b,c,d,e,f){var g={partial:!0,helpers:d,partials:e,data:f};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,g):void 0}function i(){return""}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES;return j.checkRevision=d,j.template=e,j.programWithDepth=f,j.program=g,j.invokePartial=h,j.noop=i,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,f=m}(d,a,c,b,e);return f}(),this.wysihtml5=this.wysihtml5||{},this.wysihtml5.tpl=this.wysihtml5.tpl||{},this.wysihtml5.tpl.blockquote=Handlebars.template(function(a,b,c,d,e){function f(a){var b,c="";return c+="btn-"+l((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===k?b.apply(a):b)),c}function g(){return' \n <span class="fa fa-quote-left"></span>\n '}function h(){return'\n <span class="glyphicon glyphicon-quote"></span>\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var i,j="",k="function",l=this.escapeExpression,m=this;return j+='<li>\n <a class="btn ',i=c["if"].call(b,(i=b&&b.options,i=null==i||i===!1?i:i.toolbar,null==i||i===!1?i:i.size),{hash:{},inverse:m.noop,fn:m.program(1,f,e),data:e}),(i||0===i)&&(j+=i),j+=' btn-default" data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="blockquote" data-wysihtml5-display-format-name="false" tabindex="-1">\n ',i=c["if"].call(b,(i=b&&b.options,i=null==i||i===!1?i:i.toolbar,null==i||i===!1?i:i.fa),{hash:{},inverse:m.program(5,h,e),fn:m.program(3,g,e),data:e}),(i||0===i)&&(j+=i),j+="\n </a>\n</li>\n",j}),this.wysihtml5.tpl.color=Handlebars.template(function(a,b,c,d,e){function f(a){var b,c="";return c+="btn-"+j((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===i?b.apply(a):b)),c}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var g,h="",i="function",j=this.escapeExpression,k=this;return h+='<li class="dropdown">\n <a class="btn btn-default dropdown-toggle ',g=c["if"].call(b,(g=b&&b.options,g=null==g||g===!1?g:g.toolbar,null==g||g===!1?g:g.size),{hash:{},inverse:k.noop,fn:k.program(1,f,e),data:e}),(g||0===g)&&(h+=g),h+='" data-toggle="dropdown" tabindex="-1">\n <span class="current-color">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.black,typeof g===i?g.apply(b):g))+'</span>\n <b class="caret"></b>\n </a>\n <ul class="dropdown-menu">\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="black"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="black">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.black,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="silver"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="silver">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.silver,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="gray"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="gray">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.gray,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="maroon"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="maroon">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.maroon,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="red"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="red">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.red,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="purple"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="purple">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.purple,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="green"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="green">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.green,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="olive"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="olive">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.olive,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="navy"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="navy">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.navy,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="blue"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="blue">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.blue,typeof g===i?g.apply(b):g))+'</a></li>\n <li><div class="wysihtml5-colors" data-wysihtml5-command-value="orange"></div><a class="wysihtml5-colors-title" data-wysihtml5-command="foreColor" data-wysihtml5-command-value="orange">'+j((g=b&&b.locale,g=null==g||g===!1?g:g.colours,g=null==g||g===!1?g:g.orange,typeof g===i?g.apply(b):g))+"</a></li>\n </ul>\n</li>\n",h}),this.wysihtml5.tpl.emphasis=Handlebars.template(function(a,b,c,d,e){function f(a){var b,c="";return c+="btn-"+k((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===j?b.apply(a):b)),c}function g(a,b){var d,e="";return e+='\n <a class="btn ',d=c["if"].call(a,(d=a&&a.options,d=null==d||d===!1?d:d.toolbar,null==d||d===!1?d:d.size),{hash:{},inverse:l.noop,fn:l.program(1,f,b),data:b}),(d||0===d)&&(e+=d),e+=' btn-default" data-wysihtml5-command="small" title="CTRL+S" tabindex="-1">'+k((d=a&&a.locale,d=null==d||d===!1?d:d.emphasis,d=null==d||d===!1?d:d.small,typeof d===j?d.apply(a):d))+"</a>\n ",e}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var h,i="",j="function",k=this.escapeExpression,l=this;return i+='<li>\n <div class="btn-group">\n <a class="btn ',h=c["if"].call(b,(h=b&&b.options,h=null==h||h===!1?h:h.toolbar,null==h||h===!1?h:h.size),{hash:{},inverse:l.noop,fn:l.program(1,f,e),data:e}),(h||0===h)&&(i+=h),i+=' btn-default" data-wysihtml5-command="bold" title="CTRL+B" tabindex="-1">'+k((h=b&&b.locale,h=null==h||h===!1?h:h.emphasis,h=null==h||h===!1?h:h.bold,typeof h===j?h.apply(b):h))+'</a>\n <a class="btn ',h=c["if"].call(b,(h=b&&b.options,h=null==h||h===!1?h:h.toolbar,null==h||h===!1?h:h.size),{hash:{},inverse:l.noop,fn:l.program(1,f,e),data:e}),(h||0===h)&&(i+=h),i+=' btn-default" data-wysihtml5-command="italic" title="CTRL+I" tabindex="-1">'+k((h=b&&b.locale,h=null==h||h===!1?h:h.emphasis,h=null==h||h===!1?h:h.italic,typeof h===j?h.apply(b):h))+'</a>\n <a class="btn ',h=c["if"].call(b,(h=b&&b.options,h=null==h||h===!1?h:h.toolbar,null==h||h===!1?h:h.size),{hash:{},inverse:l.noop,fn:l.program(1,f,e),data:e}),(h||0===h)&&(i+=h),i+=' btn-default" data-wysihtml5-command="underline" title="CTRL+U" tabindex="-1">'+k((h=b&&b.locale,h=null==h||h===!1?h:h.emphasis,h=null==h||h===!1?h:h.underline,typeof h===j?h.apply(b):h))+"</a>\n ",h=c["if"].call(b,(h=b&&b.options,h=null==h||h===!1?h:h.toolbar,h=null==h||h===!1?h:h.emphasis,null==h||h===!1?h:h.small),{hash:{},inverse:l.noop,fn:l.program(3,g,e),data:e}),(h||0===h)&&(i+=h),i+="\n </div>\n</li>\n",i
+}),this.wysihtml5.tpl["font-styles"]=Handlebars.template(function(a,b,c,d,e){function f(a){var b,c="";return c+="btn-"+l((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===k?b.apply(a):b)),c}function g(){return'\n <span class="fa fa-font"></span>\n '}function h(){return'\n <span class="glyphicon glyphicon-font"></span>\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var i,j="",k="function",l=this.escapeExpression,m=this;return j+='<li class="dropdown">\n <a class="btn btn-default dropdown-toggle ',i=c["if"].call(b,(i=b&&b.options,i=null==i||i===!1?i:i.toolbar,null==i||i===!1?i:i.size),{hash:{},inverse:m.noop,fn:m.program(1,f,e),data:e}),(i||0===i)&&(j+=i),j+='" data-toggle="dropdown">\n ',i=c["if"].call(b,(i=b&&b.options,i=null==i||i===!1?i:i.toolbar,null==i||i===!1?i:i.fa),{hash:{},inverse:m.program(5,h,e),fn:m.program(3,g,e),data:e}),(i||0===i)&&(j+=i),j+='\n <span class="current-font">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.normal,typeof i===k?i.apply(b):i))+'</span>\n <b class="caret"></b>\n </a>\n <ul class="dropdown-menu">\n <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="p" tabindex="-1">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.normal,typeof i===k?i.apply(b):i))+'</a></li>\n <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1" tabindex="-1">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.h1,typeof i===k?i.apply(b):i))+'</a></li>\n <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h2" tabindex="-1">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.h2,typeof i===k?i.apply(b):i))+'</a></li>\n <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h3" tabindex="-1">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.h3,typeof i===k?i.apply(b):i))+'</a></li>\n <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h4" tabindex="-1">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.h4,typeof i===k?i.apply(b):i))+'</a></li>\n <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h5" tabindex="-1">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.h5,typeof i===k?i.apply(b):i))+'</a></li>\n <li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h6" tabindex="-1">'+l((i=b&&b.locale,i=null==i||i===!1?i:i.font_styles,i=null==i||i===!1?i:i.h6,typeof i===k?i.apply(b):i))+"</a></li>\n </ul>\n</li>\n",j}),this.wysihtml5.tpl.html=Handlebars.template(function(a,b,c,d,e){function f(a){var b,c="";return c+="btn-"+l((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===k?b.apply(a):b)),c}function g(){return'\n <span class="fa fa-pencil"></span>\n '}function h(){return'\n <span class="glyphicon glyphicon-pencil"></span>\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var i,j="",k="function",l=this.escapeExpression,m=this;return j+='<li>\n <div class="btn-group">\n <a class="btn ',i=c["if"].call(b,(i=b&&b.options,i=null==i||i===!1?i:i.toolbar,null==i||i===!1?i:i.size),{hash:{},inverse:m.noop,fn:m.program(1,f,e),data:e}),(i||0===i)&&(j+=i),j+=' btn-default" data-wysihtml5-action="change_view" title="'+l((i=b&&b.locale,i=null==i||i===!1?i:i.html,i=null==i||i===!1?i:i.edit,typeof i===k?i.apply(b):i))+'" tabindex="-1">\n ',i=c["if"].call(b,(i=b&&b.options,i=null==i||i===!1?i:i.toolbar,null==i||i===!1?i:i.fa),{hash:{},inverse:m.program(5,h,e),fn:m.program(3,g,e),data:e}),(i||0===i)&&(j+=i),j+="\n </a>\n </div>\n</li>\n",j}),this.wysihtml5.tpl.image=Handlebars.template(function(a,b,c,d,e){function f(){return"modal-sm"}function g(a){var b,c="";return c+="btn-"+m((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===l?b.apply(a):b)),c}function h(){return'\n <span class="fa fa-file-image-o"></span>\n '}function i(){return'\n <span class="glyphicon glyphicon-picture"></span>\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var j,k="",l="function",m=this.escapeExpression,n=this;return k+='<li>\n <div class="bootstrap-wysihtml5-insert-image-modal modal fade" data-wysihtml5-dialog="insertImage">\n <div class="modal-dialog ',j=c["if"].call(b,(j=b&&b.options,j=null==j||j===!1?j:j.toolbar,null==j||j===!1?j:j.smallmodals),{hash:{},inverse:n.noop,fn:n.program(1,f,e),data:e}),(j||0===j)&&(k+=j),k+='">\n <div class="modal-content">\n <div class="modal-header">\n <a class="close" data-dismiss="modal">&times;</a>\n <h3>'+m((j=b&&b.locale,j=null==j||j===!1?j:j.image,j=null==j||j===!1?j:j.insert,typeof j===l?j.apply(b):j))+'</h3>\n </div>\n <div class="modal-body">\n <div class="form-group">\n <input value="http://" class="bootstrap-wysihtml5-insert-image-url form-control" data-wysihtml5-dialog-field="src">\n </div> \n </div>\n <div class="modal-footer">\n <a class="btn btn-default" data-dismiss="modal" data-wysihtml5-dialog-action="cancel" href="#">'+m((j=b&&b.locale,j=null==j||j===!1?j:j.image,j=null==j||j===!1?j:j.cancel,typeof j===l?j.apply(b):j))+'</a>\n <a class="btn btn-primary" data-dismiss="modal" data-wysihtml5-dialog-action="save" href="#">'+m((j=b&&b.locale,j=null==j||j===!1?j:j.image,j=null==j||j===!1?j:j.insert,typeof j===l?j.apply(b):j))+'</a>\n </div>\n </div>\n </div>\n </div>\n <a class="btn ',j=c["if"].call(b,(j=b&&b.options,j=null==j||j===!1?j:j.toolbar,null==j||j===!1?j:j.size),{hash:{},inverse:n.noop,fn:n.program(3,g,e),data:e}),(j||0===j)&&(k+=j),k+=' btn-default" data-wysihtml5-command="insertImage" title="'+m((j=b&&b.locale,j=null==j||j===!1?j:j.image,j=null==j||j===!1?j:j.insert,typeof j===l?j.apply(b):j))+'" tabindex="-1">\n ',j=c["if"].call(b,(j=b&&b.options,j=null==j||j===!1?j:j.toolbar,null==j||j===!1?j:j.fa),{hash:{},inverse:n.program(7,i,e),fn:n.program(5,h,e),data:e}),(j||0===j)&&(k+=j),k+="\n </a>\n</li>\n",k}),this.wysihtml5.tpl.link=Handlebars.template(function(a,b,c,d,e){function f(){return"modal-sm"}function g(a){var b,c="";return c+="btn-"+m((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===l?b.apply(a):b)),c}function h(){return'\n <span class="fa fa-share-square-o"></span>\n '}function i(){return'\n <span class="glyphicon glyphicon-share"></span>\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var j,k="",l="function",m=this.escapeExpression,n=this;return k+='<li>\n <div class="bootstrap-wysihtml5-insert-link-modal modal fade" data-wysihtml5-dialog="createLink">\n <div class="modal-dialog ',j=c["if"].call(b,(j=b&&b.options,j=null==j||j===!1?j:j.toolbar,null==j||j===!1?j:j.smallmodals),{hash:{},inverse:n.noop,fn:n.program(1,f,e),data:e}),(j||0===j)&&(k+=j),k+='">\n <div class="modal-content">\n <div class="modal-header">\n <a class="close" data-dismiss="modal">&times;</a>\n <h3>'+m((j=b&&b.locale,j=null==j||j===!1?j:j.link,j=null==j||j===!1?j:j.insert,typeof j===l?j.apply(b):j))+'</h3>\n </div>\n <div class="modal-body">\n <div class="form-group">\n <input value="http://" class="bootstrap-wysihtml5-insert-link-url form-control" data-wysihtml5-dialog-field="href">\n </div> \n <div class="checkbox">\n <label> \n <input type="checkbox" class="bootstrap-wysihtml5-insert-link-target" checked>'+m((j=b&&b.locale,j=null==j||j===!1?j:j.link,j=null==j||j===!1?j:j.target,typeof j===l?j.apply(b):j))+'\n </label>\n </div>\n </div>\n <div class="modal-footer">\n <a class="btn btn-default" data-dismiss="modal" data-wysihtml5-dialog-action="cancel" href="#">'+m((j=b&&b.locale,j=null==j||j===!1?j:j.link,j=null==j||j===!1?j:j.cancel,typeof j===l?j.apply(b):j))+'</a>\n <a href="#" class="btn btn-primary" data-dismiss="modal" data-wysihtml5-dialog-action="save">'+m((j=b&&b.locale,j=null==j||j===!1?j:j.link,j=null==j||j===!1?j:j.insert,typeof j===l?j.apply(b):j))+'</a>\n </div>\n </div>\n </div>\n </div>\n <a class="btn ',j=c["if"].call(b,(j=b&&b.options,j=null==j||j===!1?j:j.toolbar,null==j||j===!1?j:j.size),{hash:{},inverse:n.noop,fn:n.program(3,g,e),data:e}),(j||0===j)&&(k+=j),k+=' btn-default" data-wysihtml5-command="createLink" title="'+m((j=b&&b.locale,j=null==j||j===!1?j:j.link,j=null==j||j===!1?j:j.insert,typeof j===l?j.apply(b):j))+'" tabindex="-1">\n ',j=c["if"].call(b,(j=b&&b.options,j=null==j||j===!1?j:j.toolbar,null==j||j===!1?j:j.fa),{hash:{},inverse:n.program(7,i,e),fn:n.program(5,h,e),data:e}),(j||0===j)&&(k+=j),k+="\n </a>\n</li>\n",k}),this.wysihtml5.tpl.lists=Handlebars.template(function(a,b,c,d,e){function f(a){var b,c="";return c+="btn-"+r((b=a&&a.options,b=null==b||b===!1?b:b.toolbar,b=null==b||b===!1?b:b.size,typeof b===q?b.apply(a):b)),c}function g(){return'\n <span class="fa fa-list-ul"></span>\n '}function h(){return'\n <span class="glyphicon glyphicon-list"></span>\n '}function i(){return'\n <span class="fa fa-list-ol"></span>\n '}function j(){return'\n <span class="glyphicon glyphicon-th-list"></span>\n '}function k(){return'\n <span class="fa fa-outdent"></span>\n '}function l(){return'\n <span class="glyphicon glyphicon-indent-right"></span>\n '}function m(){return'\n <span class="fa fa-indent"></span>\n '}function n(){return'\n <span class="glyphicon glyphicon-indent-left"></span>\n '}this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var o,p="",q="function",r=this.escapeExpression,s=this;return p+='<li>\n <div class="btn-group">\n <a class="btn ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.size),{hash:{},inverse:s.noop,fn:s.program(1,f,e),data:e}),(o||0===o)&&(p+=o),p+=' btn-default" data-wysihtml5-command="insertUnorderedList" title="'+r((o=b&&b.locale,o=null==o||o===!1?o:o.lists,o=null==o||o===!1?o:o.unordered,typeof o===q?o.apply(b):o))+'" tabindex="-1">\n ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.fa),{hash:{},inverse:s.program(5,h,e),fn:s.program(3,g,e),data:e}),(o||0===o)&&(p+=o),p+='\n </a>\n <a class="btn ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.size),{hash:{},inverse:s.noop,fn:s.program(1,f,e),data:e}),(o||0===o)&&(p+=o),p+=' btn-default" data-wysihtml5-command="insertOrderedList" title="'+r((o=b&&b.locale,o=null==o||o===!1?o:o.lists,o=null==o||o===!1?o:o.ordered,typeof o===q?o.apply(b):o))+'" tabindex="-1">\n ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.fa),{hash:{},inverse:s.program(9,j,e),fn:s.program(7,i,e),data:e}),(o||0===o)&&(p+=o),p+='\n </a>\n <a class="btn ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.size),{hash:{},inverse:s.noop,fn:s.program(1,f,e),data:e}),(o||0===o)&&(p+=o),p+=' btn-default" data-wysihtml5-command="Outdent" title="'+r((o=b&&b.locale,o=null==o||o===!1?o:o.lists,o=null==o||o===!1?o:o.outdent,typeof o===q?o.apply(b):o))+'" tabindex="-1">\n ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.fa),{hash:{},inverse:s.program(13,l,e),fn:s.program(11,k,e),data:e}),(o||0===o)&&(p+=o),p+='\n </a>\n <a class="btn ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.size),{hash:{},inverse:s.noop,fn:s.program(1,f,e),data:e}),(o||0===o)&&(p+=o),p+=' btn-default" data-wysihtml5-command="Indent" title="'+r((o=b&&b.locale,o=null==o||o===!1?o:o.lists,o=null==o||o===!1?o:o.indent,typeof o===q?o.apply(b):o))+'" tabindex="-1">\n ',o=c["if"].call(b,(o=b&&b.options,o=null==o||o===!1?o:o.toolbar,null==o||o===!1?o:o.fa),{hash:{},inverse:s.program(17,n,e),fn:s.program(15,m,e),data:e}),(o||0===o)&&(p+=o),p+="\n </a>\n </div>\n</li>\n",p}),function(a){"use strict";"function"==typeof define&&define.amd?define("bootstrap.wysihtml5",["jquery","wysihtml5","bootstrap","bootstrap.wysihtml5.templates","bootstrap.wysihtml5.commands"],a):a(jQuery,wysihtml5)}(function(a,b){"use strict";var c=function(a,b){var c,d,e,f=function(a,c,d){return b.tpl[a]?b.tpl[a]({locale:c,options:d}):void 0},g=function(c,e){var f,g;this.el=c,f=a.extend(!0,{},d,e);for(g in f.customTemplates)f.customTemplates.hasOwnProperty(g)&&(b.tpl[g]=f.customTemplates[g]);this.toolbar=this.createToolbar(c,f),this.editor=this.createEditor(f)};g.prototype={constructor:g,createEditor:function(b){b=b||{},b=a.extend(!0,{},b),b.toolbar=this.toolbar[0],this.initializeEditor(this.el[0],b)},initializeEditor:function(a,c){var d,e=new b.Editor(this.el[0],c);if(e.on("beforeload",this.syncBootstrapDialogEvents),e.on("beforeload",this.loadParserRules),e.composer.editableArea.contentDocument?this.addMoreShortcuts(e,e.composer.editableArea.contentDocument.body||e.composer.editableArea.contentDocument,c.shortcuts):this.addMoreShortcuts(e,e.composer.editableArea,c.shortcuts),c&&c.events)for(d in c.events)c.events.hasOwnProperty(d)&&e.on(d,c.events[d]);return e},loadParserRules:function(){"string"===a.type(this.config.parserRules)&&a.ajax({dataType:"json",url:this.config.parserRules,context:this,error:function(a,b,c){void 0},success:function(a){this.config.parserRules=a,void 0}}),this.config.pasteParserRulesets&&"string"===a.type(this.config.pasteParserRulesets)&&a.ajax({dataType:"json",url:this.config.pasteParserRulesets,context:this,error:function(a,b,c){void 0},success:function(a){this.config.pasteParserRulesets=a}})},syncBootstrapDialogEvents:function(){var b=this;a.map(this.toolbar.commandMapping,function(a){return[a]}).filter(function(a){return a.dialog}).map(function(a){return a.dialog}).forEach(function(c){c.on("show",function(){a(this.container).modal("show")}),c.on("hide",function(){a(this.container).modal("hide"),setTimeout(b.composer.focus,0)}),a(c.container).on("shown.bs.modal",function(){a(this).find("input, select, textarea").first().focus()})}),this.on("change_view",function(){a(this.toolbar.container.children).find("a.btn").not('[data-wysihtml5-action="change_view"]').toggleClass("disabled")})},createToolbar:function(b,c){var g,h,i=this,j=a("<ul/>",{"class":"wysihtml5-toolbar",style:"display:none"}),k=c.locale||d.locale||"en";e.hasOwnProperty(k)||(void 0,k="en"),g=a.extend(!0,{},e.en,e[k]);for(h in c.toolbar)c.toolbar[h]&&j.append(f(h,g,c));return j.find('a[data-wysihtml5-command="formatBlock"]').click(function(b){var c=b.delegateTarget||b.target||b.srcElement,d=a(c),e=d.data("wysihtml5-display-format-name"),f=d.data("wysihtml5-format-name")||d.html();(void 0===e||"true"===e)&&i.toolbar.find(".current-font").text(f)}),j.find('a[data-wysihtml5-command="foreColor"]').click(function(b){var c=b.target||b.srcElement,d=a(c);i.toolbar.find(".current-color").text(d.html())}),this.el.before(j),j},addMoreShortcuts:function(a,c,d){b.dom.observe(c,"keydown",function(c){var e,f=c.keyCode,g=d[f];(c.ctrlKey||c.metaKey||c.altKey)&&g&&b.commands[g]&&(e=a.toolbar.commandMapping[g+":null"],e&&e.dialog&&!e.state?e.dialog.show():b.commands[g].exec(a.composer,g),c.preventDefault())})}},c={resetDefaults:function(){a.fn.wysihtml5.defaultOptions=a.extend(!0,{},a.fn.wysihtml5.defaultOptionsCache)},bypassDefaults:function(b){return this.each(function(){var c=a(this);c.data("wysihtml5",new g(c,b))})},shallowExtend:function(b){var d=a.extend({},a.fn.wysihtml5.defaultOptions,b||{},a(this).data()),e=this;return c.bypassDefaults.apply(e,[d])},deepExtend:function(b){var d=a.extend(!0,{},a.fn.wysihtml5.defaultOptions,b||{}),e=this;return c.bypassDefaults.apply(e,[d])},init:function(a){var b=this;return c.shallowExtend.apply(b,[a])}},a.fn.wysihtml5=function(b){return c[b]?c[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?(a.error("Method "+b+" does not exist on jQuery.wysihtml5"),void 0):c.init.apply(this,arguments)},a.fn.wysihtml5.Constructor=g,d=a.fn.wysihtml5.defaultOptions={toolbar:{"font-styles":!0,color:!1,emphasis:{small:!0},blockquote:!0,lists:!0,html:!1,link:!0,image:!0,smallmodals:!1},useLineBreaks:!1,parserRules:{classes:{"wysiwyg-color-silver":1,"wysiwyg-color-gray":1,"wysiwyg-color-white":1,"wysiwyg-color-maroon":1,"wysiwyg-color-red":1,"wysiwyg-color-purple":1,"wysiwyg-color-fuchsia":1,"wysiwyg-color-green":1,"wysiwyg-color-lime":1,"wysiwyg-color-olive":1,"wysiwyg-color-yellow":1,"wysiwyg-color-navy":1,"wysiwyg-color-blue":1,"wysiwyg-color-teal":1,"wysiwyg-color-aqua":1,"wysiwyg-color-orange":1},tags:{b:{},i:{},strong:{},em:{},p:{},br:{},ol:{},ul:{},li:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},blockquote:{},u:1,img:{check_attributes:{width:"numbers",alt:"alt",src:"url",height:"numbers"}},a:{check_attributes:{href:"url"},set_attributes:{target:"_blank",rel:"nofollow"}},span:1,div:1,small:1,code:1,pre:1}},locale:"en",shortcuts:{83:"small",75:"createLink"}},void 0===a.fn.wysihtml5.defaultOptionsCache&&(a.fn.wysihtml5.defaultOptionsCache=a.extend(!0,{},a.fn.wysihtml5.defaultOptions)),e=a.fn.wysihtml5.locale={}};c(a,b)}),function(a){a.commands.small={exec:function(b,c){return a.commands.formatInline.exec(b,c,"small")},state:function(b,c){return a.commands.formatInline.state(b,c,"small")}}}(wysihtml5),function(a){"function"==typeof define&&define.amd?define("bootstrap.wysihtml5.en-US",["jquery","bootstrap.wysihtml5"],a):a(jQuery)}(function(a){a.fn.wysihtml5.locale.en=a.fn.wysihtml5.locale["en-US"]={font_styles:{normal:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6"},emphasis:{bold:"Bold",italic:"Italic",underline:"Underline",small:"Small"},lists:{unordered:"Unordered list",ordered:"Ordered list",outdent:"Outdent",indent:"Indent"},link:{insert:"Insert link",cancel:"Cancel",target:"Open link in new window"},image:{insert:"Insert image",cancel:"Cancel"},html:{edit:"Edit HTML"},colours:{black:"Black",silver:"Silver",gray:"Grey",maroon:"Maroon",red:"Red",purple:"Purple",green:"Green",olive:"Olive",navy:"Navy",blue:"Blue",orange:"Orange"}}}); \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.css b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.css
new file mode 100644
index 0000000..51c58df
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.css
@@ -0,0 +1,117 @@
+ul.wysihtml5-toolbar {
+ margin: 0;
+ padding: 0;
+ display: block;
+}
+
+ul.wysihtml5-toolbar::after {
+ clear: both;
+ display: table;
+ content: "";
+}
+
+ul.wysihtml5-toolbar > li {
+ float: left;
+ display: list-item;
+ list-style: none;
+ margin: 0 5px 10px 0;
+}
+
+ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] {
+ font-weight: bold;
+}
+
+ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] {
+ font-style: italic;
+}
+
+ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] {
+ text-decoration: underline;
+}
+
+ul.wysihtml5-toolbar a.btn.wysihtml5-command-active {
+ background-image: none;
+ -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
+ -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
+ background-color: #E6E6E6;
+ background-color: #D9D9D9;
+ outline: 0;
+}
+
+ul.wysihtml5-commands-disabled .dropdown-menu {
+ display: none !important;
+}
+
+ul.wysihtml5-toolbar div.wysihtml5-colors {
+ display:block;
+ width: 50px;
+ height: 20px;
+ margin-top: 2px;
+ margin-left: 5px;
+ position: absolute;
+ pointer-events: none;
+}
+
+ul.wysihtml5-toolbar a.wysihtml5-colors-title {
+ padding-left: 70px;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] {
+ background: black !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] {
+ background: silver !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] {
+ background: gray !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] {
+ background: maroon !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] {
+ background: red !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] {
+ background: purple !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] {
+ background: green !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] {
+ background: olive !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] {
+ background: navy !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] {
+ background: blue !important;
+}
+
+ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] {
+ background: orange !important;
+}
+
+.glyphicon-quote:before {
+ content: "\201C";
+ font-family: Georgia, serif;
+ font-size: 50px;
+ position: absolute;
+ top: -4px;
+ left: -3px;
+ max-height: 100%;
+}
+
+.glyphicon-quote:after {
+ content: "\0000a0";
+}
+
diff --git a/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css
new file mode 100644
index 0000000..28f1831
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css
@@ -0,0 +1,3 @@
+/*! bootstrap3-wysihtml5-bower 2014-09-26 */
+
+ul.wysihtml5-toolbar{margin:0;padding:0;display:block}ul.wysihtml5-toolbar::after{clear:both;display:table;content:""}ul.wysihtml5-toolbar>li{float:left;display:list-item;list-style:none;margin:0 5px 10px 0}ul.wysihtml5-toolbar a[data-wysihtml5-command=bold]{font-weight:700}ul.wysihtml5-toolbar a[data-wysihtml5-command=italic]{font-style:italic}ul.wysihtml5-toolbar a[data-wysihtml5-command=underline]{text-decoration:underline}ul.wysihtml5-toolbar a.btn.wysihtml5-command-active{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);background-color:#D9D9D9;outline:0}ul.wysihtml5-commands-disabled .dropdown-menu{display:none!important}ul.wysihtml5-toolbar div.wysihtml5-colors{display:block;width:50px;height:20px;margin-top:2px;margin-left:5px;position:absolute;pointer-events:none}ul.wysihtml5-toolbar a.wysihtml5-colors-title{padding-left:70px}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=black]{background:#000!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=silver]{background:silver!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=gray]{background:gray!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=maroon]{background:maroon!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=red]{background:red!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=purple]{background:purple!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=green]{background:green!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=olive]{background:olive!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=navy]{background:navy!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=blue]{background:#00f!important}ul.wysihtml5-toolbar div[data-wysihtml5-command-value=orange]{background:orange!important}.glyphicon-quote:before{content:"\201C";font-family:Georgia,serif;font-size:50px;position:absolute;top:-4px;left:-3px;max-height:100%}.glyphicon-quote:after{content:"\0000a0"} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/all.css b/public/bower_components/admin-lte/plugins/iCheck/all.css
new file mode 100644
index 0000000..6439b74
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/all.css
@@ -0,0 +1,61 @@
+/* iCheck plugin skins
+----------------------------------- */
+@import url("minimal/_all.css");
+/*
+@import url("minimal/minimal.css");
+@import url("minimal/red.css");
+@import url("minimal/green.css");
+@import url("minimal/blue.css");
+@import url("minimal/aero.css");
+@import url("minimal/grey.css");
+@import url("minimal/orange.css");
+@import url("minimal/yellow.css");
+@import url("minimal/pink.css");
+@import url("minimal/purple.css");
+*/
+
+@import url("square/_all.css");
+/*
+@import url("square/square.css");
+@import url("square/red.css");
+@import url("square/green.css");
+@import url("square/blue.css");
+@import url("square/aero.css");
+@import url("square/grey.css");
+@import url("square/orange.css");
+@import url("square/yellow.css");
+@import url("square/pink.css");
+@import url("square/purple.css");
+*/
+
+@import url("flat/_all.css");
+/*
+@import url("flat/flat.css");
+@import url("flat/red.css");
+@import url("flat/green.css");
+@import url("flat/blue.css");
+@import url("flat/aero.css");
+@import url("flat/grey.css");
+@import url("flat/orange.css");
+@import url("flat/yellow.css");
+@import url("flat/pink.css");
+@import url("flat/purple.css");
+*/
+
+@import url("line/_all.css");
+/*
+@import url("line/line.css");
+@import url("line/red.css");
+@import url("line/green.css");
+@import url("line/blue.css");
+@import url("line/aero.css");
+@import url("line/grey.css");
+@import url("line/orange.css");
+@import url("line/yellow.css");
+@import url("line/pink.css");
+@import url("line/purple.css");
+*/
+
+@import url("polaris/polaris.css");
+
+@import url("futurico/futurico.css"); \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/_all.css b/public/bower_components/admin-lte/plugins/iCheck/flat/_all.css
new file mode 100644
index 0000000..21647b5
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/_all.css
@@ -0,0 +1,560 @@
+/* iCheck plugin Flat skin
+----------------------------------- */
+.icheckbox_flat,
+.iradio_flat {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(flat.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat {
+ background-position: 0 0;
+}
+ .icheckbox_flat.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat {
+ background-position: -88px 0;
+}
+ .iradio_flat.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat,
+ .iradio_flat {
+ background-image: url(flat@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* red */
+.icheckbox_flat-red,
+.iradio_flat-red {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(red.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-red {
+ background-position: 0 0;
+}
+ .icheckbox_flat-red.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-red.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-red.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-red {
+ background-position: -88px 0;
+}
+ .iradio_flat-red.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-red.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-red.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-red,
+ .iradio_flat-red {
+ background-image: url(red@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* green */
+.icheckbox_flat-green,
+.iradio_flat-green {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(green.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-green {
+ background-position: 0 0;
+}
+ .icheckbox_flat-green.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-green.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-green.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-green {
+ background-position: -88px 0;
+}
+ .iradio_flat-green.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-green.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-green.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-green,
+ .iradio_flat-green {
+ background-image: url(green@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* blue */
+.icheckbox_flat-blue,
+.iradio_flat-blue {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(blue.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-blue {
+ background-position: 0 0;
+}
+ .icheckbox_flat-blue.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-blue.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-blue.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-blue {
+ background-position: -88px 0;
+}
+ .iradio_flat-blue.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-blue.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-blue.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-blue,
+ .iradio_flat-blue {
+ background-image: url(blue@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* aero */
+.icheckbox_flat-aero,
+.iradio_flat-aero {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(aero.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-aero {
+ background-position: 0 0;
+}
+ .icheckbox_flat-aero.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-aero.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-aero.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-aero {
+ background-position: -88px 0;
+}
+ .iradio_flat-aero.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-aero.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-aero.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-aero,
+ .iradio_flat-aero {
+ background-image: url(aero@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* grey */
+.icheckbox_flat-grey,
+.iradio_flat-grey {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(grey.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-grey {
+ background-position: 0 0;
+}
+ .icheckbox_flat-grey.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-grey.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-grey.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-grey {
+ background-position: -88px 0;
+}
+ .iradio_flat-grey.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-grey.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-grey.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-grey,
+ .iradio_flat-grey {
+ background-image: url(grey@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* orange */
+.icheckbox_flat-orange,
+.iradio_flat-orange {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(orange.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-orange {
+ background-position: 0 0;
+}
+ .icheckbox_flat-orange.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-orange.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-orange.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-orange {
+ background-position: -88px 0;
+}
+ .iradio_flat-orange.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-orange.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-orange.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-orange,
+ .iradio_flat-orange {
+ background-image: url(orange@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* yellow */
+.icheckbox_flat-yellow,
+.iradio_flat-yellow {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(yellow.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-yellow {
+ background-position: 0 0;
+}
+ .icheckbox_flat-yellow.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-yellow.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-yellow.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-yellow {
+ background-position: -88px 0;
+}
+ .iradio_flat-yellow.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-yellow.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-yellow.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-yellow,
+ .iradio_flat-yellow {
+ background-image: url(yellow@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* pink */
+.icheckbox_flat-pink,
+.iradio_flat-pink {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(pink.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-pink {
+ background-position: 0 0;
+}
+ .icheckbox_flat-pink.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-pink.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-pink.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-pink {
+ background-position: -88px 0;
+}
+ .iradio_flat-pink.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-pink.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-pink.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-pink,
+ .iradio_flat-pink {
+ background-image: url(pink@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+}
+
+/* purple */
+.icheckbox_flat-purple,
+.iradio_flat-purple {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(purple.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-purple {
+ background-position: 0 0;
+}
+ .icheckbox_flat-purple.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-purple.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-purple.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-purple {
+ background-position: -88px 0;
+}
+ .iradio_flat-purple.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-purple.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-purple.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-purple,
+ .iradio_flat-purple {
+ background-image: url(purple@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/aero.css b/public/bower_components/admin-lte/plugins/iCheck/flat/aero.css
new file mode 100644
index 0000000..98fd65c
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/aero.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, aero
+----------------------------------- */
+.icheckbox_flat-aero,
+.iradio_flat-aero {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(aero.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-aero {
+ background-position: 0 0;
+}
+ .icheckbox_flat-aero.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-aero.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-aero.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-aero {
+ background-position: -88px 0;
+}
+ .iradio_flat-aero.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-aero.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-aero.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-aero,
+ .iradio_flat-aero {
+ background-image: url(aero@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/aero.png b/public/bower_components/admin-lte/plugins/iCheck/flat/aero.png
new file mode 100644
index 0000000..f4277aa
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/aero.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/aero@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/aero@2x.png
new file mode 100644
index 0000000..a9a7494
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/aero@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/blue.css b/public/bower_components/admin-lte/plugins/iCheck/flat/blue.css
new file mode 100644
index 0000000..0783674
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/blue.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, blue
+----------------------------------- */
+.icheckbox_flat-blue,
+.iradio_flat-blue {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(blue.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-blue {
+ background-position: 0 0;
+}
+ .icheckbox_flat-blue.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-blue.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-blue.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-blue {
+ background-position: -88px 0;
+}
+ .iradio_flat-blue.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-blue.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-blue.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-blue,
+ .iradio_flat-blue {
+ background-image: url(blue@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/blue.png b/public/bower_components/admin-lte/plugins/iCheck/flat/blue.png
new file mode 100644
index 0000000..4b6ef98
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/blue.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/blue@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/blue@2x.png
new file mode 100644
index 0000000..d52da05
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/blue@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/flat.css b/public/bower_components/admin-lte/plugins/iCheck/flat/flat.css
new file mode 100644
index 0000000..418620e
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/flat.css
@@ -0,0 +1,56 @@
+/* iCheck plugin flat skin, black
+----------------------------------- */
+.icheckbox_flat,
+.iradio_flat {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(flat.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat {
+ background-position: 0 0;
+}
+ .icheckbox_flat.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat {
+ background-position: -88px 0;
+}
+ .iradio_flat.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat,
+ .iradio_flat {
+ background-image: url(flat@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/flat.png b/public/bower_components/admin-lte/plugins/iCheck/flat/flat.png
new file mode 100644
index 0000000..15af826
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/flat.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/flat@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/flat@2x.png
new file mode 100644
index 0000000..e70e438
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/flat@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/green.css b/public/bower_components/admin-lte/plugins/iCheck/flat/green.css
new file mode 100644
index 0000000..c9d17c1
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/green.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, green
+----------------------------------- */
+.icheckbox_flat-green,
+.iradio_flat-green {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(green.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-green {
+ background-position: 0 0;
+}
+ .icheckbox_flat-green.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-green.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-green.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-green {
+ background-position: -88px 0;
+}
+ .iradio_flat-green.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-green.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-green.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-green,
+ .iradio_flat-green {
+ background-image: url(green@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/green.png b/public/bower_components/admin-lte/plugins/iCheck/flat/green.png
new file mode 100644
index 0000000..6b303fb
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/green.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/green@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/green@2x.png
new file mode 100644
index 0000000..92b4411
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/green@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/grey.css b/public/bower_components/admin-lte/plugins/iCheck/flat/grey.css
new file mode 100644
index 0000000..a451650
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/grey.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, grey
+----------------------------------- */
+.icheckbox_flat-grey,
+.iradio_flat-grey {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(grey.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-grey {
+ background-position: 0 0;
+}
+ .icheckbox_flat-grey.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-grey.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-grey.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-grey {
+ background-position: -88px 0;
+}
+ .iradio_flat-grey.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-grey.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-grey.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-grey,
+ .iradio_flat-grey {
+ background-image: url(grey@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/grey.png b/public/bower_components/admin-lte/plugins/iCheck/flat/grey.png
new file mode 100644
index 0000000..c6e2873
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/grey.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/grey@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/grey@2x.png
new file mode 100644
index 0000000..0b47b1c
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/grey@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/orange.css b/public/bower_components/admin-lte/plugins/iCheck/flat/orange.css
new file mode 100644
index 0000000..8c9c929
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/orange.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, orange
+----------------------------------- */
+.icheckbox_flat-orange,
+.iradio_flat-orange {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(orange.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-orange {
+ background-position: 0 0;
+}
+ .icheckbox_flat-orange.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-orange.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-orange.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-orange {
+ background-position: -88px 0;
+}
+ .iradio_flat-orange.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-orange.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-orange.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-orange,
+ .iradio_flat-orange {
+ background-image: url(orange@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/orange.png b/public/bower_components/admin-lte/plugins/iCheck/flat/orange.png
new file mode 100644
index 0000000..ec2532e
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/orange.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/orange@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/orange@2x.png
new file mode 100644
index 0000000..9350b50
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/orange@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/pink.css b/public/bower_components/admin-lte/plugins/iCheck/flat/pink.css
new file mode 100644
index 0000000..afa4956
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/pink.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, pink
+----------------------------------- */
+.icheckbox_flat-pink,
+.iradio_flat-pink {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(pink.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-pink {
+ background-position: 0 0;
+}
+ .icheckbox_flat-pink.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-pink.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-pink.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-pink {
+ background-position: -88px 0;
+}
+ .iradio_flat-pink.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-pink.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-pink.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-pink,
+ .iradio_flat-pink {
+ background-image: url(pink@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/pink.png b/public/bower_components/admin-lte/plugins/iCheck/flat/pink.png
new file mode 100644
index 0000000..3e65d9d
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/pink.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/pink@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/pink@2x.png
new file mode 100644
index 0000000..281ba06
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/pink@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/purple.css b/public/bower_components/admin-lte/plugins/iCheck/flat/purple.css
new file mode 100644
index 0000000..a9760b3
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/purple.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, purple
+----------------------------------- */
+.icheckbox_flat-purple,
+.iradio_flat-purple {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(purple.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-purple {
+ background-position: 0 0;
+}
+ .icheckbox_flat-purple.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-purple.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-purple.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-purple {
+ background-position: -88px 0;
+}
+ .iradio_flat-purple.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-purple.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-purple.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-purple,
+ .iradio_flat-purple {
+ background-image: url(purple@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/purple.png b/public/bower_components/admin-lte/plugins/iCheck/flat/purple.png
new file mode 100644
index 0000000..3699fd5
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/purple.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/purple@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/purple@2x.png
new file mode 100644
index 0000000..7f4be74
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/purple@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/red.css b/public/bower_components/admin-lte/plugins/iCheck/flat/red.css
new file mode 100644
index 0000000..34b71e4
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/red.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, red
+----------------------------------- */
+.icheckbox_flat-red,
+.iradio_flat-red {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(red.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-red {
+ background-position: 0 0;
+}
+ .icheckbox_flat-red.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-red.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-red.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-red {
+ background-position: -88px 0;
+}
+ .iradio_flat-red.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-red.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-red.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-red,
+ .iradio_flat-red {
+ background-image: url(red@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/red.png b/public/bower_components/admin-lte/plugins/iCheck/flat/red.png
new file mode 100644
index 0000000..0d5ac38
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/red.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/red@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/red@2x.png
new file mode 100644
index 0000000..38590d9
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/red@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/yellow.css b/public/bower_components/admin-lte/plugins/iCheck/flat/yellow.css
new file mode 100644
index 0000000..96ae5b1
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/yellow.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Flat skin, yellow
+----------------------------------- */
+.icheckbox_flat-yellow,
+.iradio_flat-yellow {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 20px;
+ height: 20px;
+ background: url(yellow.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_flat-yellow {
+ background-position: 0 0;
+}
+ .icheckbox_flat-yellow.checked {
+ background-position: -22px 0;
+ }
+ .icheckbox_flat-yellow.disabled {
+ background-position: -44px 0;
+ cursor: default;
+ }
+ .icheckbox_flat-yellow.checked.disabled {
+ background-position: -66px 0;
+ }
+
+.iradio_flat-yellow {
+ background-position: -88px 0;
+}
+ .iradio_flat-yellow.checked {
+ background-position: -110px 0;
+ }
+ .iradio_flat-yellow.disabled {
+ background-position: -132px 0;
+ cursor: default;
+ }
+ .iradio_flat-yellow.checked.disabled {
+ background-position: -154px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_flat-yellow,
+ .iradio_flat-yellow {
+ background-image: url(yellow@2x.png);
+ -webkit-background-size: 176px 22px;
+ background-size: 176px 22px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/yellow.png b/public/bower_components/admin-lte/plugins/iCheck/flat/yellow.png
new file mode 100644
index 0000000..909dadc
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/yellow.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/flat/yellow@2x.png b/public/bower_components/admin-lte/plugins/iCheck/flat/yellow@2x.png
new file mode 100644
index 0000000..9fd5d73
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/flat/yellow@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.css b/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.css
new file mode 100644
index 0000000..2654cf4
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.css
@@ -0,0 +1,56 @@
+/* iCheck plugin Futurico skin
+----------------------------------- */
+.icheckbox_futurico,
+.iradio_futurico {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 16px;
+ height: 17px;
+ background: url(futurico.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_futurico {
+ background-position: 0 0;
+}
+ .icheckbox_futurico.checked {
+ background-position: -18px 0;
+ }
+ .icheckbox_futurico.disabled {
+ background-position: -36px 0;
+ cursor: default;
+ }
+ .icheckbox_futurico.checked.disabled {
+ background-position: -54px 0;
+ }
+
+.iradio_futurico {
+ background-position: -72px 0;
+}
+ .iradio_futurico.checked {
+ background-position: -90px 0;
+ }
+ .iradio_futurico.disabled {
+ background-position: -108px 0;
+ cursor: default;
+ }
+ .iradio_futurico.checked.disabled {
+ background-position: -126px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_futurico,
+ .iradio_futurico {
+ background-image: url(futurico@2x.png);
+ -webkit-background-size: 144px 19px;
+ background-size: 144px 19px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.png b/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.png
new file mode 100644
index 0000000..50d62b5
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico@2x.png b/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico@2x.png
new file mode 100644
index 0000000..f7eb45a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/futurico/futurico@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/icheck.js b/public/bower_components/admin-lte/plugins/iCheck/icheck.js
new file mode 100644
index 0000000..4da1937
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/icheck.js
@@ -0,0 +1,478 @@
+/*!
+ * iCheck v1.0.1, http://git.io/arlzeA
+ * =================================
+ * Powerful jQuery and Zepto plugin for checkboxes and radio buttons customization
+ *
+ * (c) 2013 Damir Sultanov, http://fronteed.com
+ * MIT Licensed
+ */
+
+(function($) {
+
+ // Cached vars
+ var _iCheck = 'iCheck',
+ _iCheckHelper = _iCheck + '-helper',
+ _checkbox = 'checkbox',
+ _radio = 'radio',
+ _checked = 'checked',
+ _unchecked = 'un' + _checked,
+ _disabled = 'disabled',
+ _determinate = 'determinate',
+ _indeterminate = 'in' + _determinate,
+ _update = 'update',
+ _type = 'type',
+ _click = 'click',
+ _touch = 'touchbegin.i touchend.i',
+ _add = 'addClass',
+ _remove = 'removeClass',
+ _callback = 'trigger',
+ _label = 'label',
+ _cursor = 'cursor',
+ _mobile = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);
+
+ // Plugin init
+ $.fn[_iCheck] = function(options, fire) {
+
+ // Walker
+ var handle = 'input[type="' + _checkbox + '"], input[type="' + _radio + '"]',
+ stack = $(),
+ walker = function(object) {
+ object.each(function() {
+ var self = $(this);
+
+ if (self.is(handle)) {
+ stack = stack.add(self);
+ } else {
+ stack = stack.add(self.find(handle));
+ }
+ });
+ };
+
+ // Check if we should operate with some method
+ if (/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(options)) {
+
+ // Normalize method's name
+ options = options.toLowerCase();
+
+ // Find checkboxes and radio buttons
+ walker(this);
+
+ return stack.each(function() {
+ var self = $(this);
+
+ if (options == 'destroy') {
+ tidy(self, 'ifDestroyed');
+ } else {
+ operate(self, true, options);
+ }
+ // Fire method's callback
+ if ($.isFunction(fire)) {
+ fire();
+ }
+ });
+
+ // Customization
+ } else if (typeof options == 'object' || !options) {
+
+ // Check if any options were passed
+ var settings = $.extend({
+ checkedClass: _checked,
+ disabledClass: _disabled,
+ indeterminateClass: _indeterminate,
+ labelHover: true,
+ aria: false
+ }, options),
+
+ selector = settings.handle,
+ hoverClass = settings.hoverClass || 'hover',
+ focusClass = settings.focusClass || 'focus',
+ activeClass = settings.activeClass || 'active',
+ labelHover = !!settings.labelHover,
+ labelHoverClass = settings.labelHoverClass || 'hover',
+
+ // Setup clickable area
+ area = ('' + settings.increaseArea).replace('%', '') | 0;
+
+ // Selector limit
+ if (selector == _checkbox || selector == _radio) {
+ handle = 'input[type="' + selector + '"]';
+ }
+ // Clickable area limit
+ if (area < -50) {
+ area = -50;
+ }
+ // Walk around the selector
+ walker(this);
+
+ return stack.each(function() {
+ var self = $(this);
+
+ // If already customized
+ tidy(self);
+
+ var node = this,
+ id = node.id,
+
+ // Layer styles
+ offset = -area + '%',
+ size = 100 + (area * 2) + '%',
+ layer = {
+ position: 'absolute',
+ top: offset,
+ left: offset,
+ display: 'block',
+ width: size,
+ height: size,
+ margin: 0,
+ padding: 0,
+ background: '#fff',
+ border: 0,
+ opacity: 0
+ },
+
+ // Choose how to hide input
+ hide = _mobile ? {
+ position: 'absolute',
+ visibility: 'hidden'
+ } : area ? layer : {
+ position: 'absolute',
+ opacity: 0
+ },
+
+ // Get proper class
+ className = node[_type] == _checkbox ? settings.checkboxClass || 'i' + _checkbox : settings.radioClass || 'i' + _radio,
+
+ // Find assigned labels
+ label = $(_label + '[for="' + id + '"]').add(self.closest(_label)),
+
+ // Check ARIA option
+ aria = !!settings.aria,
+
+ // Set ARIA placeholder
+ ariaID = _iCheck + '-' + Math.random().toString(36).replace('0.', ''),
+
+ // Parent & helper
+ parent = '<div class="' + className + '" ' + (aria ? 'role="' + node[_type] + '" ' : ''),
+ helper;
+
+ // Set ARIA "labelledby"
+ if (label.length && aria) {
+ label.each(function() {
+ parent += 'aria-labelledby="';
+
+ if (this.id) {
+ parent += this.id;
+ } else {
+ this.id = ariaID;
+ parent += ariaID;
+ }
+
+ parent += '"';
+ });
+ }
+ // Wrap input
+ parent = self.wrap(parent + '/>')[_callback]('ifCreated').parent().append(settings.insert);
+
+ // Layer addition
+ helper = $('<ins class="' + _iCheckHelper + '"/>').css(layer).appendTo(parent);
+
+ // Finalize customization
+ self.data(_iCheck, {o: settings, s: self.attr('style')}).css(hide);
+ !!settings.inheritClass && parent[_add](node.className || '');
+ !!settings.inheritID && id && parent.attr('id', _iCheck + '-' + id);
+ parent.css('position') == 'static' && parent.css('position', 'relative');
+ operate(self, true, _update);
+
+ // Label events
+ if (label.length) {
+ label.on(_click + '.i mouseover.i mouseout.i ' + _touch, function(event) {
+ var type = event[_type],
+ item = $(this);
+
+ // Do nothing if input is disabled
+ if (!node[_disabled]) {
+
+ // Click
+ if (type == _click) {
+ if ($(event.target).is('a')) {
+ return;
+ }
+ operate(self, false, true);
+
+ // Hover state
+ } else if (labelHover) {
+
+ // mouseout|touchend
+ if (/ut|nd/.test(type)) {
+ parent[_remove](hoverClass);
+ item[_remove](labelHoverClass);
+ } else {
+ parent[_add](hoverClass);
+ item[_add](labelHoverClass);
+ }
+ }
+ if (_mobile) {
+ event.stopPropagation();
+ } else {
+ return false;
+ }
+ }
+ });
+ }
+ // Input events
+ self.on(_click + '.i focus.i blur.i keyup.i keydown.i keypress.i', function(event) {
+ var type = event[_type],
+ key = event.keyCode;
+
+ // Click
+ if (type == _click) {
+ return false;
+
+ // Keydown
+ } else if (type == 'keydown' && key == 32) {
+ if (!(node[_type] == _radio && node[_checked])) {
+ if (node[_checked]) {
+ off(self, _checked);
+ } else {
+ on(self, _checked);
+ }
+ }
+ return false;
+
+ // Keyup
+ } else if (type == 'keyup' && node[_type] == _radio) {
+ !node[_checked] && on(self, _checked);
+
+ // Focus/blur
+ } else if (/us|ur/.test(type)) {
+ parent[type == 'blur' ? _remove : _add](focusClass);
+ }
+ });
+
+ // Helper events
+ helper.on(_click + ' mousedown mouseup mouseover mouseout ' + _touch, function(event) {
+ var type = event[_type],
+
+ // mousedown|mouseup
+ toggle = /wn|up/.test(type) ? activeClass : hoverClass;
+
+ // Do nothing if input is disabled
+ if (!node[_disabled]) {
+
+ // Click
+ if (type == _click) {
+ operate(self, false, true);
+
+ // Active and hover states
+ } else {
+
+ // State is on
+ if (/wn|er|in/.test(type)) {
+
+ // mousedown|mouseover|touchbegin
+ parent[_add](toggle);
+
+ // State is off
+ } else {
+ parent[_remove](toggle + ' ' + activeClass);
+ }
+ // Label hover
+ if (label.length && labelHover && toggle == hoverClass) {
+
+ // mouseout|touchend
+ label[/ut|nd/.test(type) ? _remove : _add](labelHoverClass);
+ }
+ }
+ if (_mobile) {
+ event.stopPropagation();
+ } else {
+ return false;
+ }
+ }
+ });
+ });
+ } else {
+ return this;
+ }
+ };
+
+ // Do something with inputs
+ function operate(input, direct, method) {
+ var node = input[0],
+ state = /er/.test(method) ? _indeterminate : /bl/.test(method) ? _disabled : _checked,
+ active = method == _update ? {
+ checked: node[_checked],
+ disabled: node[_disabled],
+ indeterminate: input.attr(_indeterminate) == 'true' || input.attr(_determinate) == 'false'
+ } : node[state];
+
+ // Check, disable or indeterminate
+ if (/^(ch|di|in)/.test(method) && !active) {
+ on(input, state);
+
+ // Uncheck, enable or determinate
+ } else if (/^(un|en|de)/.test(method) && active) {
+ off(input, state);
+
+ // Update
+ } else if (method == _update) {
+
+ // Handle states
+ for (var state in active) {
+ if (active[state]) {
+ on(input, state, true);
+ } else {
+ off(input, state, true);
+ }
+ }
+ } else if (!direct || method == 'toggle') {
+
+ // Helper or label was clicked
+ if (!direct) {
+ input[_callback]('ifClicked');
+ }
+ // Toggle checked state
+ if (active) {
+ if (node[_type] !== _radio) {
+ off(input, state);
+ }
+ } else {
+ on(input, state);
+ }
+ }
+ }
+ // Add checked, disabled or indeterminate state
+ function on(input, state, keep) {
+ var node = input[0],
+ parent = input.parent(),
+ checked = state == _checked,
+ indeterminate = state == _indeterminate,
+ disabled = state == _disabled,
+ callback = indeterminate ? _determinate : checked ? _unchecked : 'enabled',
+ regular = option(input, callback + capitalize(node[_type])),
+ specific = option(input, state + capitalize(node[_type]));
+
+ // Prevent unnecessary actions
+ if (node[state] !== true) {
+
+ // Toggle assigned radio buttons
+ if (!keep && state == _checked && node[_type] == _radio && node.name) {
+ var form = input.closest('form'),
+ inputs = 'input[name="' + node.name + '"]';
+
+ inputs = form.length ? form.find(inputs) : $(inputs);
+
+ inputs.each(function() {
+ if (this !== node && $(this).data(_iCheck)) {
+ off($(this), state);
+ }
+ });
+ }
+ // Indeterminate state
+ if (indeterminate) {
+
+ // Add indeterminate state
+ node[state] = true;
+
+ // Remove checked state
+ if (node[_checked]) {
+ off(input, _checked, 'force');
+ }
+ // Checked or disabled state
+ } else {
+
+ // Add checked or disabled state
+ if (!keep) {
+ node[state] = true;
+ }
+ // Remove indeterminate state
+ if (checked && node[_indeterminate]) {
+ off(input, _indeterminate, false);
+ }
+ }
+ // Trigger callbacks
+ callbacks(input, checked, state, keep);
+ }
+ // Add proper cursor
+ if (node[_disabled] && !!option(input, _cursor, true)) {
+ parent.find('.' + _iCheckHelper).css(_cursor, 'default');
+ }
+ // Add state class
+ parent[_add](specific || option(input, state) || '');
+
+ // Set ARIA attribute
+ disabled ? parent.attr('aria-disabled', 'true') : parent.attr('aria-checked', indeterminate ? 'mixed' : 'true');
+
+ // Remove regular state class
+ parent[_remove](regular || option(input, callback) || '');
+ }
+ // Remove checked, disabled or indeterminate state
+ function off(input, state, keep) {
+ var node = input[0],
+ parent = input.parent(),
+ checked = state == _checked,
+ indeterminate = state == _indeterminate,
+ disabled = state == _disabled,
+ callback = indeterminate ? _determinate : checked ? _unchecked : 'enabled',
+ regular = option(input, callback + capitalize(node[_type])),
+ specific = option(input, state + capitalize(node[_type]));
+
+ // Prevent unnecessary actions
+ if (node[state] !== false) {
+
+ // Toggle state
+ if (indeterminate || !keep || keep == 'force') {
+ node[state] = false;
+ }
+ // Trigger callbacks
+ callbacks(input, checked, callback, keep);
+ }
+ // Add proper cursor
+ if (!node[_disabled] && !!option(input, _cursor, true)) {
+ parent.find('.' + _iCheckHelper).css(_cursor, 'pointer');
+ }
+ // Remove state class
+ parent[_remove](specific || option(input, state) || '');
+
+ // Set ARIA attribute
+ disabled ? parent.attr('aria-disabled', 'false') : parent.attr('aria-checked', 'false');
+
+ // Add regular state class
+ parent[_add](regular || option(input, callback) || '');
+ }
+ // Remove all traces
+ function tidy(input, callback) {
+ if (input.data(_iCheck)) {
+
+ // Remove everything except input
+ input.parent().html(input.attr('style', input.data(_iCheck).s || ''));
+
+ // Callback
+ if (callback) {
+ input[_callback](callback);
+ }
+ // Unbind events
+ input.off('.i').unwrap();
+ $(_label + '[for="' + input[0].id + '"]').add(input.closest(_label)).off('.i');
+ }
+ }
+ // Get some option
+ function option(input, state, regular) {
+ if (input.data(_iCheck)) {
+ return input.data(_iCheck).o[state + (regular ? '' : 'Class')];
+ }
+ }
+ // Capitalize some string
+ function capitalize(string) {
+ return string.charAt(0).toUpperCase() + string.slice(1);
+ }
+ // Executable handlers
+ function callbacks(input, checked, callback, keep) {
+ if (!keep) {
+ if (checked) {
+ input[_callback]('ifToggled');
+ }
+ input[_callback]('ifChanged')[_callback]('if' + capitalize(callback));
+ }
+ }
+})(window.jQuery || window.Zepto);
diff --git a/public/bower_components/admin-lte/plugins/iCheck/icheck.min.js b/public/bower_components/admin-lte/plugins/iCheck/icheck.min.js
new file mode 100644
index 0000000..d2720ed
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/icheck.min.js
@@ -0,0 +1,10 @@
+/*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
+(function(h){function F(a,b,d){var c=a[0],e=/er/.test(d)?m:/bl/.test(d)?s:l,f=d==H?{checked:c[l],disabled:c[s],indeterminate:"true"==a.attr(m)||"false"==a.attr(w)}:c[e];if(/^(ch|di|in)/.test(d)&&!f)D(a,e);else if(/^(un|en|de)/.test(d)&&f)t(a,e);else if(d==H)for(e in f)f[e]?D(a,e,!0):t(a,e,!0);else if(!b||"toggle"==d){if(!b)a[p]("ifClicked");f?c[n]!==u&&t(a,e):D(a,e)}}function D(a,b,d){var c=a[0],e=a.parent(),f=b==l,A=b==m,B=b==s,K=A?w:f?E:"enabled",p=k(a,K+x(c[n])),N=k(a,b+x(c[n]));if(!0!==c[b]){if(!d&&
+b==l&&c[n]==u&&c.name){var C=a.closest("form"),r='input[name="'+c.name+'"]',r=C.length?C.find(r):h(r);r.each(function(){this!==c&&h(this).data(q)&&t(h(this),b)})}A?(c[b]=!0,c[l]&&t(a,l,"force")):(d||(c[b]=!0),f&&c[m]&&t(a,m,!1));L(a,f,b,d)}c[s]&&k(a,y,!0)&&e.find("."+I).css(y,"default");e[v](N||k(a,b)||"");B?e.attr("aria-disabled","true"):e.attr("aria-checked",A?"mixed":"true");e[z](p||k(a,K)||"")}function t(a,b,d){var c=a[0],e=a.parent(),f=b==l,h=b==m,q=b==s,p=h?w:f?E:"enabled",t=k(a,p+x(c[n])),
+u=k(a,b+x(c[n]));if(!1!==c[b]){if(h||!d||"force"==d)c[b]=!1;L(a,f,p,d)}!c[s]&&k(a,y,!0)&&e.find("."+I).css(y,"pointer");e[z](u||k(a,b)||"");q?e.attr("aria-disabled","false"):e.attr("aria-checked","false");e[v](t||k(a,p)||"")}function M(a,b){if(a.data(q)){a.parent().html(a.attr("style",a.data(q).s||""));if(b)a[p](b);a.off(".i").unwrap();h(G+'[for="'+a[0].id+'"]').add(a.closest(G)).off(".i")}}function k(a,b,d){if(a.data(q))return a.data(q).o[b+(d?"":"Class")]}function x(a){return a.charAt(0).toUpperCase()+
+a.slice(1)}function L(a,b,d,c){if(!c){if(b)a[p]("ifToggled");a[p]("ifChanged")[p]("if"+x(d))}}var q="iCheck",I=q+"-helper",u="radio",l="checked",E="un"+l,s="disabled",w="determinate",m="in"+w,H="update",n="type",v="addClass",z="removeClass",p="trigger",G="label",y="cursor",J=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);h.fn[q]=function(a,b){var d='input[type="checkbox"], input[type="'+u+'"]',c=h(),e=function(a){a.each(function(){var a=h(this);c=a.is(d)?
+c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),e(this),c.each(function(){var c=h(this);"destroy"==a?M(c,"ifDestroyed"):F(c,!0,a);h.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var f=h.extend({checkedClass:l,disabledClass:s,indeterminateClass:m,labelHover:!0,aria:!1},a),k=f.handle,B=f.hoverClass||"hover",x=f.focusClass||"focus",w=f.activeClass||"active",y=!!f.labelHover,C=f.labelHoverClass||
+"hover",r=(""+f.increaseArea).replace("%","")|0;if("checkbox"==k||k==u)d='input[type="'+k+'"]';-50>r&&(r=-50);e(this);return c.each(function(){var a=h(this);M(a);var c=this,b=c.id,e=-r+"%",d=100+2*r+"%",d={position:"absolute",top:e,left:e,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},e=J?{position:"absolute",visibility:"hidden"}:r?d:{position:"absolute",opacity:0},k="checkbox"==c[n]?f.checkboxClass||"icheckbox":f.radioClass||"i"+u,m=h(G+'[for="'+b+'"]').add(a.closest(G)),
+A=!!f.aria,E=q+"-"+Math.random().toString(36).replace("0.",""),g='<div class="'+k+'" '+(A?'role="'+c[n]+'" ':"");m.length&&A&&m.each(function(){g+='aria-labelledby="';this.id?g+=this.id:(this.id=E,g+=E);g+='"'});g=a.wrap(g+"/>")[p]("ifCreated").parent().append(f.insert);d=h('<ins class="'+I+'"/>').css(d).appendTo(g);a.data(q,{o:f,s:a.attr("style")}).css(e);f.inheritClass&&g[v](c.className||"");f.inheritID&&b&&g.attr("id",q+"-"+b);"static"==g.css("position")&&g.css("position","relative");F(a,!0,H);
+if(m.length)m.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(b){var d=b[n],e=h(this);if(!c[s]){if("click"==d){if(h(b.target).is("a"))return;F(a,!1,!0)}else y&&(/ut|nd/.test(d)?(g[z](B),e[z](C)):(g[v](B),e[v](C)));if(J)b.stopPropagation();else return!1}});a.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[n];b=b.keyCode;if("click"==d)return!1;if("keydown"==d&&32==b)return c[n]==u&&c[l]||(c[l]?t(a,l):D(a,l)),!1;if("keyup"==d&&c[n]==u)!c[l]&&D(a,l);else if(/us|ur/.test(d))g["blur"==
+d?z:v](x)});d.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(b){var d=b[n],e=/wn|up/.test(d)?w:B;if(!c[s]){if("click"==d)F(a,!1,!0);else{if(/wn|er|in/.test(d))g[v](e);else g[z](e+" "+w);if(m.length&&y&&e==B)m[/ut|nd/.test(d)?z:v](C)}if(J)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto);
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/_all.css b/public/bower_components/admin-lte/plugins/iCheck/line/_all.css
new file mode 100644
index 0000000..a18d0d9
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/_all.css
@@ -0,0 +1,740 @@
+/* iCheck plugin Line skin
+----------------------------------- */
+.icheckbox_line,
+.iradio_line {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #000;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line .icheck_line-icon,
+ .iradio_line .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line.hover,
+ .icheckbox_line.checked.hover,
+ .iradio_line.hover {
+ background: #444;
+ }
+ .icheckbox_line.checked,
+ .iradio_line.checked {
+ background: #000;
+ }
+ .icheckbox_line.checked .icheck_line-icon,
+ .iradio_line.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line.disabled,
+ .iradio_line.disabled {
+ background: #ccc;
+ cursor: default;
+ }
+ .icheckbox_line.disabled .icheck_line-icon,
+ .iradio_line.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line.checked.disabled,
+ .iradio_line.checked.disabled {
+ background: #ccc;
+ }
+ .icheckbox_line.checked.disabled .icheck_line-icon,
+ .iradio_line.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line .icheck_line-icon,
+ .iradio_line .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* red */
+.icheckbox_line-red,
+.iradio_line-red {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #e56c69;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-red .icheck_line-icon,
+ .iradio_line-red .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-red.hover,
+ .icheckbox_line-red.checked.hover,
+ .iradio_line-red.hover {
+ background: #E98582;
+ }
+ .icheckbox_line-red.checked,
+ .iradio_line-red.checked {
+ background: #e56c69;
+ }
+ .icheckbox_line-red.checked .icheck_line-icon,
+ .iradio_line-red.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-red.disabled,
+ .iradio_line-red.disabled {
+ background: #F7D3D2;
+ cursor: default;
+ }
+ .icheckbox_line-red.disabled .icheck_line-icon,
+ .iradio_line-red.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-red.checked.disabled,
+ .iradio_line-red.checked.disabled {
+ background: #F7D3D2;
+ }
+ .icheckbox_line-red.checked.disabled .icheck_line-icon,
+ .iradio_line-red.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-red .icheck_line-icon,
+ .iradio_line-red .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* green */
+.icheckbox_line-green,
+.iradio_line-green {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #1b7e5a;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-green .icheck_line-icon,
+ .iradio_line-green .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-green.hover,
+ .icheckbox_line-green.checked.hover,
+ .iradio_line-green.hover {
+ background: #24AA7A;
+ }
+ .icheckbox_line-green.checked,
+ .iradio_line-green.checked {
+ background: #1b7e5a;
+ }
+ .icheckbox_line-green.checked .icheck_line-icon,
+ .iradio_line-green.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-green.disabled,
+ .iradio_line-green.disabled {
+ background: #89E6C4;
+ cursor: default;
+ }
+ .icheckbox_line-green.disabled .icheck_line-icon,
+ .iradio_line-green.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-green.checked.disabled,
+ .iradio_line-green.checked.disabled {
+ background: #89E6C4;
+ }
+ .icheckbox_line-green.checked.disabled .icheck_line-icon,
+ .iradio_line-green.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-green .icheck_line-icon,
+ .iradio_line-green .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* blue */
+.icheckbox_line-blue,
+.iradio_line-blue {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #2489c5;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-blue .icheck_line-icon,
+ .iradio_line-blue .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-blue.hover,
+ .icheckbox_line-blue.checked.hover,
+ .iradio_line-blue.hover {
+ background: #3DA0DB;
+ }
+ .icheckbox_line-blue.checked,
+ .iradio_line-blue.checked {
+ background: #2489c5;
+ }
+ .icheckbox_line-blue.checked .icheck_line-icon,
+ .iradio_line-blue.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-blue.disabled,
+ .iradio_line-blue.disabled {
+ background: #ADD7F0;
+ cursor: default;
+ }
+ .icheckbox_line-blue.disabled .icheck_line-icon,
+ .iradio_line-blue.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-blue.checked.disabled,
+ .iradio_line-blue.checked.disabled {
+ background: #ADD7F0;
+ }
+ .icheckbox_line-blue.checked.disabled .icheck_line-icon,
+ .iradio_line-blue.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-blue .icheck_line-icon,
+ .iradio_line-blue .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* aero */
+.icheckbox_line-aero,
+.iradio_line-aero {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #9cc2cb;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-aero .icheck_line-icon,
+ .iradio_line-aero .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-aero.hover,
+ .icheckbox_line-aero.checked.hover,
+ .iradio_line-aero.hover {
+ background: #B5D1D8;
+ }
+ .icheckbox_line-aero.checked,
+ .iradio_line-aero.checked {
+ background: #9cc2cb;
+ }
+ .icheckbox_line-aero.checked .icheck_line-icon,
+ .iradio_line-aero.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-aero.disabled,
+ .iradio_line-aero.disabled {
+ background: #D2E4E8;
+ cursor: default;
+ }
+ .icheckbox_line-aero.disabled .icheck_line-icon,
+ .iradio_line-aero.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-aero.checked.disabled,
+ .iradio_line-aero.checked.disabled {
+ background: #D2E4E8;
+ }
+ .icheckbox_line-aero.checked.disabled .icheck_line-icon,
+ .iradio_line-aero.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-aero .icheck_line-icon,
+ .iradio_line-aero .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* grey */
+.icheckbox_line-grey,
+.iradio_line-grey {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #73716e;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-grey .icheck_line-icon,
+ .iradio_line-grey .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-grey.hover,
+ .icheckbox_line-grey.checked.hover,
+ .iradio_line-grey.hover {
+ background: #8B8986;
+ }
+ .icheckbox_line-grey.checked,
+ .iradio_line-grey.checked {
+ background: #73716e;
+ }
+ .icheckbox_line-grey.checked .icheck_line-icon,
+ .iradio_line-grey.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-grey.disabled,
+ .iradio_line-grey.disabled {
+ background: #D5D4D3;
+ cursor: default;
+ }
+ .icheckbox_line-grey.disabled .icheck_line-icon,
+ .iradio_line-grey.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-grey.checked.disabled,
+ .iradio_line-grey.checked.disabled {
+ background: #D5D4D3;
+ }
+ .icheckbox_line-grey.checked.disabled .icheck_line-icon,
+ .iradio_line-grey.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-grey .icheck_line-icon,
+ .iradio_line-grey .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* orange */
+.icheckbox_line-orange,
+.iradio_line-orange {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #f70;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-orange .icheck_line-icon,
+ .iradio_line-orange .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-orange.hover,
+ .icheckbox_line-orange.checked.hover,
+ .iradio_line-orange.hover {
+ background: #FF9233;
+ }
+ .icheckbox_line-orange.checked,
+ .iradio_line-orange.checked {
+ background: #f70;
+ }
+ .icheckbox_line-orange.checked .icheck_line-icon,
+ .iradio_line-orange.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-orange.disabled,
+ .iradio_line-orange.disabled {
+ background: #FFD6B3;
+ cursor: default;
+ }
+ .icheckbox_line-orange.disabled .icheck_line-icon,
+ .iradio_line-orange.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-orange.checked.disabled,
+ .iradio_line-orange.checked.disabled {
+ background: #FFD6B3;
+ }
+ .icheckbox_line-orange.checked.disabled .icheck_line-icon,
+ .iradio_line-orange.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-orange .icheck_line-icon,
+ .iradio_line-orange .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* yellow */
+.icheckbox_line-yellow,
+.iradio_line-yellow {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #FFC414;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-yellow .icheck_line-icon,
+ .iradio_line-yellow .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-yellow.hover,
+ .icheckbox_line-yellow.checked.hover,
+ .iradio_line-yellow.hover {
+ background: #FFD34F;
+ }
+ .icheckbox_line-yellow.checked,
+ .iradio_line-yellow.checked {
+ background: #FFC414;
+ }
+ .icheckbox_line-yellow.checked .icheck_line-icon,
+ .iradio_line-yellow.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-yellow.disabled,
+ .iradio_line-yellow.disabled {
+ background: #FFE495;
+ cursor: default;
+ }
+ .icheckbox_line-yellow.disabled .icheck_line-icon,
+ .iradio_line-yellow.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-yellow.checked.disabled,
+ .iradio_line-yellow.checked.disabled {
+ background: #FFE495;
+ }
+ .icheckbox_line-yellow.checked.disabled .icheck_line-icon,
+ .iradio_line-yellow.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-yellow .icheck_line-icon,
+ .iradio_line-yellow .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* pink */
+.icheckbox_line-pink,
+.iradio_line-pink {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #a77a94;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-pink .icheck_line-icon,
+ .iradio_line-pink .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-pink.hover,
+ .icheckbox_line-pink.checked.hover,
+ .iradio_line-pink.hover {
+ background: #B995A9;
+ }
+ .icheckbox_line-pink.checked,
+ .iradio_line-pink.checked {
+ background: #a77a94;
+ }
+ .icheckbox_line-pink.checked .icheck_line-icon,
+ .iradio_line-pink.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-pink.disabled,
+ .iradio_line-pink.disabled {
+ background: #E0D0DA;
+ cursor: default;
+ }
+ .icheckbox_line-pink.disabled .icheck_line-icon,
+ .iradio_line-pink.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-pink.checked.disabled,
+ .iradio_line-pink.checked.disabled {
+ background: #E0D0DA;
+ }
+ .icheckbox_line-pink.checked.disabled .icheck_line-icon,
+ .iradio_line-pink.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-pink .icheck_line-icon,
+ .iradio_line-pink .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+}
+
+/* purple */
+.icheckbox_line-purple,
+.iradio_line-purple {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #6a5a8c;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-purple .icheck_line-icon,
+ .iradio_line-purple .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-purple.hover,
+ .icheckbox_line-purple.checked.hover,
+ .iradio_line-purple.hover {
+ background: #8677A7;
+ }
+ .icheckbox_line-purple.checked,
+ .iradio_line-purple.checked {
+ background: #6a5a8c;
+ }
+ .icheckbox_line-purple.checked .icheck_line-icon,
+ .iradio_line-purple.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-purple.disabled,
+ .iradio_line-purple.disabled {
+ background: #D2CCDE;
+ cursor: default;
+ }
+ .icheckbox_line-purple.disabled .icheck_line-icon,
+ .iradio_line-purple.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-purple.checked.disabled,
+ .iradio_line-purple.checked.disabled {
+ background: #D2CCDE;
+ }
+ .icheckbox_line-purple.checked.disabled .icheck_line-icon,
+ .iradio_line-purple.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-purple .icheck_line-icon,
+ .iradio_line-purple .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/aero.css b/public/bower_components/admin-lte/plugins/iCheck/line/aero.css
new file mode 100644
index 0000000..44989a4
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/aero.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, aero
+----------------------------------- */
+.icheckbox_line-aero,
+.iradio_line-aero {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #9cc2cb;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-aero .icheck_line-icon,
+ .iradio_line-aero .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-aero.hover,
+ .icheckbox_line-aero.checked.hover,
+ .iradio_line-aero.hover {
+ background: #B5D1D8;
+ }
+ .icheckbox_line-aero.checked,
+ .iradio_line-aero.checked {
+ background: #9cc2cb;
+ }
+ .icheckbox_line-aero.checked .icheck_line-icon,
+ .iradio_line-aero.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-aero.disabled,
+ .iradio_line-aero.disabled {
+ background: #D2E4E8;
+ cursor: default;
+ }
+ .icheckbox_line-aero.disabled .icheck_line-icon,
+ .iradio_line-aero.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-aero.checked.disabled,
+ .iradio_line-aero.checked.disabled {
+ background: #D2E4E8;
+ }
+ .icheckbox_line-aero.checked.disabled .icheck_line-icon,
+ .iradio_line-aero.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-aero .icheck_line-icon,
+ .iradio_line-aero .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/blue.css b/public/bower_components/admin-lte/plugins/iCheck/line/blue.css
new file mode 100644
index 0000000..5c9c0a7
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/blue.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, blue
+----------------------------------- */
+.icheckbox_line-blue,
+.iradio_line-blue {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #2489c5;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-blue .icheck_line-icon,
+ .iradio_line-blue .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-blue.hover,
+ .icheckbox_line-blue.checked.hover,
+ .iradio_line-blue.hover {
+ background: #3DA0DB;
+ }
+ .icheckbox_line-blue.checked,
+ .iradio_line-blue.checked {
+ background: #2489c5;
+ }
+ .icheckbox_line-blue.checked .icheck_line-icon,
+ .iradio_line-blue.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-blue.disabled,
+ .iradio_line-blue.disabled {
+ background: #ADD7F0;
+ cursor: default;
+ }
+ .icheckbox_line-blue.disabled .icheck_line-icon,
+ .iradio_line-blue.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-blue.checked.disabled,
+ .iradio_line-blue.checked.disabled {
+ background: #ADD7F0;
+ }
+ .icheckbox_line-blue.checked.disabled .icheck_line-icon,
+ .iradio_line-blue.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-blue .icheck_line-icon,
+ .iradio_line-blue .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/green.css b/public/bower_components/admin-lte/plugins/iCheck/line/green.css
new file mode 100644
index 0000000..8bbe514
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/green.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, green
+----------------------------------- */
+.icheckbox_line-green,
+.iradio_line-green {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #1b7e5a;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-green .icheck_line-icon,
+ .iradio_line-green .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-green.hover,
+ .icheckbox_line-green.checked.hover,
+ .iradio_line-green.hover {
+ background: #24AA7A;
+ }
+ .icheckbox_line-green.checked,
+ .iradio_line-green.checked {
+ background: #1b7e5a;
+ }
+ .icheckbox_line-green.checked .icheck_line-icon,
+ .iradio_line-green.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-green.disabled,
+ .iradio_line-green.disabled {
+ background: #89E6C4;
+ cursor: default;
+ }
+ .icheckbox_line-green.disabled .icheck_line-icon,
+ .iradio_line-green.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-green.checked.disabled,
+ .iradio_line-green.checked.disabled {
+ background: #89E6C4;
+ }
+ .icheckbox_line-green.checked.disabled .icheck_line-icon,
+ .iradio_line-green.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-green .icheck_line-icon,
+ .iradio_line-green .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/grey.css b/public/bower_components/admin-lte/plugins/iCheck/line/grey.css
new file mode 100644
index 0000000..fc16a80
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/grey.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, grey
+----------------------------------- */
+.icheckbox_line-grey,
+.iradio_line-grey {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #73716e;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-grey .icheck_line-icon,
+ .iradio_line-grey .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-grey.hover,
+ .icheckbox_line-grey.checked.hover,
+ .iradio_line-grey.hover {
+ background: #8B8986;
+ }
+ .icheckbox_line-grey.checked,
+ .iradio_line-grey.checked {
+ background: #73716e;
+ }
+ .icheckbox_line-grey.checked .icheck_line-icon,
+ .iradio_line-grey.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-grey.disabled,
+ .iradio_line-grey.disabled {
+ background: #D5D4D3;
+ cursor: default;
+ }
+ .icheckbox_line-grey.disabled .icheck_line-icon,
+ .iradio_line-grey.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-grey.checked.disabled,
+ .iradio_line-grey.checked.disabled {
+ background: #D5D4D3;
+ }
+ .icheckbox_line-grey.checked.disabled .icheck_line-icon,
+ .iradio_line-grey.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-grey .icheck_line-icon,
+ .iradio_line-grey .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/line.css b/public/bower_components/admin-lte/plugins/iCheck/line/line.css
new file mode 100644
index 0000000..dbde8d4
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/line.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, black
+----------------------------------- */
+.icheckbox_line,
+.iradio_line {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #000;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line .icheck_line-icon,
+ .iradio_line .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line.hover,
+ .icheckbox_line.checked.hover,
+ .iradio_line.hover {
+ background: #444;
+ }
+ .icheckbox_line.checked,
+ .iradio_line.checked {
+ background: #000;
+ }
+ .icheckbox_line.checked .icheck_line-icon,
+ .iradio_line.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line.disabled,
+ .iradio_line.disabled {
+ background: #ccc;
+ cursor: default;
+ }
+ .icheckbox_line.disabled .icheck_line-icon,
+ .iradio_line.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line.checked.disabled,
+ .iradio_line.checked.disabled {
+ background: #ccc;
+ }
+ .icheckbox_line.checked.disabled .icheck_line-icon,
+ .iradio_line.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line .icheck_line-icon,
+ .iradio_line .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/line.png b/public/bower_components/admin-lte/plugins/iCheck/line/line.png
new file mode 100644
index 0000000..d21d7a7
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/line.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/line@2x.png b/public/bower_components/admin-lte/plugins/iCheck/line/line@2x.png
new file mode 100644
index 0000000..62900a2
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/line@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/orange.css b/public/bower_components/admin-lte/plugins/iCheck/line/orange.css
new file mode 100644
index 0000000..210f334
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/orange.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, orange
+----------------------------------- */
+.icheckbox_line-orange,
+.iradio_line-orange {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #f70;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-orange .icheck_line-icon,
+ .iradio_line-orange .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-orange.hover,
+ .icheckbox_line-orange.checked.hover,
+ .iradio_line-orange.hover {
+ background: #FF9233;
+ }
+ .icheckbox_line-orange.checked,
+ .iradio_line-orange.checked {
+ background: #f70;
+ }
+ .icheckbox_line-orange.checked .icheck_line-icon,
+ .iradio_line-orange.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-orange.disabled,
+ .iradio_line-orange.disabled {
+ background: #FFD6B3;
+ cursor: default;
+ }
+ .icheckbox_line-orange.disabled .icheck_line-icon,
+ .iradio_line-orange.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-orange.checked.disabled,
+ .iradio_line-orange.checked.disabled {
+ background: #FFD6B3;
+ }
+ .icheckbox_line-orange.checked.disabled .icheck_line-icon,
+ .iradio_line-orange.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-orange .icheck_line-icon,
+ .iradio_line-orange .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/pink.css b/public/bower_components/admin-lte/plugins/iCheck/line/pink.css
new file mode 100644
index 0000000..44c9cea
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/pink.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, pink
+----------------------------------- */
+.icheckbox_line-pink,
+.iradio_line-pink {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #a77a94;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-pink .icheck_line-icon,
+ .iradio_line-pink .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-pink.hover,
+ .icheckbox_line-pink.checked.hover,
+ .iradio_line-pink.hover {
+ background: #B995A9;
+ }
+ .icheckbox_line-pink.checked,
+ .iradio_line-pink.checked {
+ background: #a77a94;
+ }
+ .icheckbox_line-pink.checked .icheck_line-icon,
+ .iradio_line-pink.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-pink.disabled,
+ .iradio_line-pink.disabled {
+ background: #E0D0DA;
+ cursor: default;
+ }
+ .icheckbox_line-pink.disabled .icheck_line-icon,
+ .iradio_line-pink.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-pink.checked.disabled,
+ .iradio_line-pink.checked.disabled {
+ background: #E0D0DA;
+ }
+ .icheckbox_line-pink.checked.disabled .icheck_line-icon,
+ .iradio_line-pink.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-pink .icheck_line-icon,
+ .iradio_line-pink .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/purple.css b/public/bower_components/admin-lte/plugins/iCheck/line/purple.css
new file mode 100644
index 0000000..be4c4e2
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/purple.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, purple
+----------------------------------- */
+.icheckbox_line-purple,
+.iradio_line-purple {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #6a5a8c;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-purple .icheck_line-icon,
+ .iradio_line-purple .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-purple.hover,
+ .icheckbox_line-purple.checked.hover,
+ .iradio_line-purple.hover {
+ background: #8677A7;
+ }
+ .icheckbox_line-purple.checked,
+ .iradio_line-purple.checked {
+ background: #6a5a8c;
+ }
+ .icheckbox_line-purple.checked .icheck_line-icon,
+ .iradio_line-purple.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-purple.disabled,
+ .iradio_line-purple.disabled {
+ background: #D2CCDE;
+ cursor: default;
+ }
+ .icheckbox_line-purple.disabled .icheck_line-icon,
+ .iradio_line-purple.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-purple.checked.disabled,
+ .iradio_line-purple.checked.disabled {
+ background: #D2CCDE;
+ }
+ .icheckbox_line-purple.checked.disabled .icheck_line-icon,
+ .iradio_line-purple.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-purple .icheck_line-icon,
+ .iradio_line-purple .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/red.css b/public/bower_components/admin-lte/plugins/iCheck/line/red.css
new file mode 100644
index 0000000..ebcd8be
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/red.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, red
+----------------------------------- */
+.icheckbox_line-red,
+.iradio_line-red {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #e56c69;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-red .icheck_line-icon,
+ .iradio_line-red .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-red.hover,
+ .icheckbox_line-red.checked.hover,
+ .iradio_line-red.hover {
+ background: #E98582;
+ }
+ .icheckbox_line-red.checked,
+ .iradio_line-red.checked {
+ background: #e56c69;
+ }
+ .icheckbox_line-red.checked .icheck_line-icon,
+ .iradio_line-red.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-red.disabled,
+ .iradio_line-red.disabled {
+ background: #F7D3D2;
+ cursor: default;
+ }
+ .icheckbox_line-red.disabled .icheck_line-icon,
+ .iradio_line-red.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-red.checked.disabled,
+ .iradio_line-red.checked.disabled {
+ background: #F7D3D2;
+ }
+ .icheckbox_line-red.checked.disabled .icheck_line-icon,
+ .iradio_line-red.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-red .icheck_line-icon,
+ .iradio_line-red .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/line/yellow.css b/public/bower_components/admin-lte/plugins/iCheck/line/yellow.css
new file mode 100644
index 0000000..8e08871
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/line/yellow.css
@@ -0,0 +1,74 @@
+/* iCheck plugin Line skin, yellow
+----------------------------------- */
+.icheckbox_line-yellow,
+.iradio_line-yellow {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 5px 15px 5px 38px;
+ font-size: 13px;
+ line-height: 17px;
+ color: #fff;
+ background: #FFC414;
+ border: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+}
+ .icheckbox_line-yellow .icheck_line-icon,
+ .iradio_line-yellow .icheck_line-icon {
+ position: absolute;
+ top: 50%;
+ left: 13px;
+ width: 13px;
+ height: 11px;
+ margin: -5px 0 0 0;
+ padding: 0;
+ overflow: hidden;
+ background: url(line.png) no-repeat;
+ border: none;
+ }
+ .icheckbox_line-yellow.hover,
+ .icheckbox_line-yellow.checked.hover,
+ .iradio_line-yellow.hover {
+ background: #FFD34F;
+ }
+ .icheckbox_line-yellow.checked,
+ .iradio_line-yellow.checked {
+ background: #FFC414;
+ }
+ .icheckbox_line-yellow.checked .icheck_line-icon,
+ .iradio_line-yellow.checked .icheck_line-icon {
+ background-position: -15px 0;
+ }
+ .icheckbox_line-yellow.disabled,
+ .iradio_line-yellow.disabled {
+ background: #FFE495;
+ cursor: default;
+ }
+ .icheckbox_line-yellow.disabled .icheck_line-icon,
+ .iradio_line-yellow.disabled .icheck_line-icon {
+ background-position: -30px 0;
+ }
+ .icheckbox_line-yellow.checked.disabled,
+ .iradio_line-yellow.checked.disabled {
+ background: #FFE495;
+ }
+ .icheckbox_line-yellow.checked.disabled .icheck_line-icon,
+ .iradio_line-yellow.checked.disabled .icheck_line-icon {
+ background-position: -45px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_line-yellow .icheck_line-icon,
+ .iradio_line-yellow .icheck_line-icon {
+ background-image: url(line@2x.png);
+ -webkit-background-size: 60px 13px;
+ background-size: 60px 13px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/_all.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/_all.css
new file mode 100644
index 0000000..b2165ec
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/_all.css
@@ -0,0 +1,557 @@
+/* red */
+.icheckbox_minimal-red,
+.iradio_minimal-red {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(red.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-red {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-red.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-red.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-red.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-red.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-red {
+ background-position: -100px 0;
+}
+ .iradio_minimal-red.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-red.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-red.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-red.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-red,
+ .iradio_minimal-red {
+ background-image: url(red@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* green */
+.icheckbox_minimal-green,
+.iradio_minimal-green {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(green.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-green {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-green.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-green.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-green.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-green.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-green {
+ background-position: -100px 0;
+}
+ .iradio_minimal-green.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-green.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-green.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-green.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-green,
+ .iradio_minimal-green {
+ background-image: url(green@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* blue */
+.icheckbox_minimal-blue,
+.iradio_minimal-blue {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(blue.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-blue {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-blue.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-blue.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-blue.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-blue.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-blue {
+ background-position: -100px 0;
+}
+ .iradio_minimal-blue.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-blue.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-blue.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-blue.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-blue,
+ .iradio_minimal-blue {
+ background-image: url(blue@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* aero */
+.icheckbox_minimal-aero,
+.iradio_minimal-aero {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(aero.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-aero {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-aero.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-aero.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-aero.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-aero.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-aero {
+ background-position: -100px 0;
+}
+ .iradio_minimal-aero.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-aero.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-aero.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-aero.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-aero,
+ .iradio_minimal-aero {
+ background-image: url(aero@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* grey */
+.icheckbox_minimal-grey,
+.iradio_minimal-grey {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(grey.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-grey {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-grey.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-grey.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-grey.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-grey.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-grey {
+ background-position: -100px 0;
+}
+ .iradio_minimal-grey.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-grey.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-grey.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-grey.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-grey,
+ .iradio_minimal-grey {
+ background-image: url(grey@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* orange */
+.icheckbox_minimal-orange,
+.iradio_minimal-orange {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(orange.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-orange {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-orange.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-orange.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-orange.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-orange.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-orange {
+ background-position: -100px 0;
+}
+ .iradio_minimal-orange.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-orange.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-orange.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-orange.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-orange,
+ .iradio_minimal-orange {
+ background-image: url(orange@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* yellow */
+.icheckbox_minimal-yellow,
+.iradio_minimal-yellow {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(yellow.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-yellow {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-yellow.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-yellow.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-yellow.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-yellow.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-yellow {
+ background-position: -100px 0;
+}
+ .iradio_minimal-yellow.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-yellow.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-yellow.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-yellow.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-yellow,
+ .iradio_minimal-yellow {
+ background-image: url(yellow@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* pink */
+.icheckbox_minimal-pink,
+.iradio_minimal-pink {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(pink.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-pink {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-pink.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-pink.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-pink.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-pink.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-pink {
+ background-position: -100px 0;
+}
+ .iradio_minimal-pink.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-pink.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-pink.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-pink.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-pink,
+ .iradio_minimal-pink {
+ background-image: url(pink@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+}
+
+/* purple */
+.icheckbox_minimal-purple,
+.iradio_minimal-purple {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(purple.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-purple {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-purple.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-purple.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-purple.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-purple.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-purple {
+ background-position: -100px 0;
+}
+ .iradio_minimal-purple.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-purple.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-purple.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-purple.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-purple,
+ .iradio_minimal-purple {
+ background-image: url(purple@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/aero.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/aero.css
new file mode 100644
index 0000000..c97acc8
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/aero.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, aero
+----------------------------------- */
+.icheckbox_minimal-aero,
+.iradio_minimal-aero {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(aero.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-aero {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-aero.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-aero.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-aero.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-aero.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-aero {
+ background-position: -100px 0;
+}
+ .iradio_minimal-aero.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-aero.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-aero.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-aero.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-aero,
+ .iradio_minimal-aero {
+ background-image: url(aero@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/aero.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/aero.png
new file mode 100644
index 0000000..dccf774
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/aero.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/aero@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/aero@2x.png
new file mode 100644
index 0000000..5537ee3
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/aero@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/blue.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/blue.css
new file mode 100644
index 0000000..42477cd
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/blue.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, blue
+----------------------------------- */
+.icheckbox_minimal-blue,
+.iradio_minimal-blue {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(blue.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-blue {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-blue.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-blue.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-blue.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-blue.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-blue {
+ background-position: -100px 0;
+}
+ .iradio_minimal-blue.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-blue.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-blue.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-blue.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-blue,
+ .iradio_minimal-blue {
+ background-image: url(blue@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/blue.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/blue.png
new file mode 100644
index 0000000..af04cee
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/blue.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/blue@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/blue@2x.png
new file mode 100644
index 0000000..f19210a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/blue@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/green.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/green.css
new file mode 100644
index 0000000..bd1e3d0
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/green.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, green
+----------------------------------- */
+.icheckbox_minimal-green,
+.iradio_minimal-green {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(green.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-green {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-green.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-green.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-green.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-green.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-green {
+ background-position: -100px 0;
+}
+ .iradio_minimal-green.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-green.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-green.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-green.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-green,
+ .iradio_minimal-green {
+ background-image: url(green@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/green.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/green.png
new file mode 100644
index 0000000..9171ebc
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/green.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/green@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/green@2x.png
new file mode 100644
index 0000000..7f18f96
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/green@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/grey.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/grey.css
new file mode 100644
index 0000000..6e2730c
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/grey.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, grey
+----------------------------------- */
+.icheckbox_minimal-grey,
+.iradio_minimal-grey {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(grey.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-grey {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-grey.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-grey.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-grey.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-grey.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-grey {
+ background-position: -100px 0;
+}
+ .iradio_minimal-grey.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-grey.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-grey.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-grey.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-grey,
+ .iradio_minimal-grey {
+ background-image: url(grey@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/grey.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/grey.png
new file mode 100644
index 0000000..22dcdbc
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/grey.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/grey@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/grey@2x.png
new file mode 100644
index 0000000..85e82dd
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/grey@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.css
new file mode 100644
index 0000000..7c0e52e
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, black
+----------------------------------- */
+.icheckbox_minimal,
+.iradio_minimal {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(minimal.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal {
+ background-position: 0 0;
+}
+ .icheckbox_minimal.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal {
+ background-position: -100px 0;
+}
+ .iradio_minimal.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal,
+ .iradio_minimal {
+ background-image: url(minimal@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.png
new file mode 100644
index 0000000..943be16
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal@2x.png
new file mode 100644
index 0000000..d62291d
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/minimal@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/orange.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/orange.css
new file mode 100644
index 0000000..842e400
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/orange.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, orange
+----------------------------------- */
+.icheckbox_minimal-orange,
+.iradio_minimal-orange {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(orange.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-orange {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-orange.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-orange.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-orange.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-orange.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-orange {
+ background-position: -100px 0;
+}
+ .iradio_minimal-orange.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-orange.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-orange.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-orange.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-orange,
+ .iradio_minimal-orange {
+ background-image: url(orange@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/orange.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/orange.png
new file mode 100644
index 0000000..f2a3149
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/orange.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/orange@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/orange@2x.png
new file mode 100644
index 0000000..68c8359
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/orange@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/pink.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/pink.css
new file mode 100644
index 0000000..10ace21
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/pink.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, pink
+----------------------------------- */
+.icheckbox_minimal-pink,
+.iradio_minimal-pink {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(pink.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-pink {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-pink.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-pink.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-pink.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-pink.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-pink {
+ background-position: -100px 0;
+}
+ .iradio_minimal-pink.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-pink.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-pink.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-pink.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-pink,
+ .iradio_minimal-pink {
+ background-image: url(pink@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/pink.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/pink.png
new file mode 100644
index 0000000..660553c
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/pink.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/pink@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/pink@2x.png
new file mode 100644
index 0000000..7d7b385
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/pink@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/purple.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/purple.css
new file mode 100644
index 0000000..1c5dcbc
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/purple.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, purple
+----------------------------------- */
+.icheckbox_minimal-purple,
+.iradio_minimal-purple {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(purple.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-purple {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-purple.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-purple.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-purple.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-purple.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-purple {
+ background-position: -100px 0;
+}
+ .iradio_minimal-purple.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-purple.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-purple.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-purple.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-purple,
+ .iradio_minimal-purple {
+ background-image: url(purple@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/purple.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/purple.png
new file mode 100644
index 0000000..48dec79
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/purple.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/purple@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/purple@2x.png
new file mode 100644
index 0000000..3bb7041
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/purple@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/red.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/red.css
new file mode 100644
index 0000000..9340c4f
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/red.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, red
+----------------------------------- */
+.icheckbox_minimal-red,
+.iradio_minimal-red {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(red.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-red {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-red.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-red.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-red.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-red.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-red {
+ background-position: -100px 0;
+}
+ .iradio_minimal-red.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-red.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-red.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-red.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-red,
+ .iradio_minimal-red {
+ background-image: url(red@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/red.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/red.png
new file mode 100644
index 0000000..4443f80
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/red.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/red@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/red@2x.png
new file mode 100644
index 0000000..2eb55a6
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/red@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.css b/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.css
new file mode 100644
index 0000000..2c38423
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Minimal skin, yellow
+----------------------------------- */
+.icheckbox_minimal-yellow,
+.iradio_minimal-yellow {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 18px;
+ height: 18px;
+ background: url(yellow.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_minimal-yellow {
+ background-position: 0 0;
+}
+ .icheckbox_minimal-yellow.hover {
+ background-position: -20px 0;
+ }
+ .icheckbox_minimal-yellow.checked {
+ background-position: -40px 0;
+ }
+ .icheckbox_minimal-yellow.disabled {
+ background-position: -60px 0;
+ cursor: default;
+ }
+ .icheckbox_minimal-yellow.checked.disabled {
+ background-position: -80px 0;
+ }
+
+.iradio_minimal-yellow {
+ background-position: -100px 0;
+}
+ .iradio_minimal-yellow.hover {
+ background-position: -120px 0;
+ }
+ .iradio_minimal-yellow.checked {
+ background-position: -140px 0;
+ }
+ .iradio_minimal-yellow.disabled {
+ background-position: -160px 0;
+ cursor: default;
+ }
+ .iradio_minimal-yellow.checked.disabled {
+ background-position: -180px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 1.5),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_minimal-yellow,
+ .iradio_minimal-yellow {
+ background-image: url(yellow@2x.png);
+ -webkit-background-size: 200px 20px;
+ background-size: 200px 20px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.png
new file mode 100644
index 0000000..0999b7e
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow@2x.png b/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow@2x.png
new file mode 100644
index 0000000..c16f2b7
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/minimal/yellow@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.css b/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.css
new file mode 100644
index 0000000..1cb4bcc
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Polaris skin
+----------------------------------- */
+.icheckbox_polaris,
+.iradio_polaris {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 29px;
+ height: 29px;
+ background: url(polaris.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_polaris {
+ background-position: 0 0;
+}
+ .icheckbox_polaris.hover {
+ background-position: -31px 0;
+ }
+ .icheckbox_polaris.checked {
+ background-position: -62px 0;
+ }
+ .icheckbox_polaris.disabled {
+ background-position: -93px 0;
+ cursor: default;
+ }
+ .icheckbox_polaris.checked.disabled {
+ background-position: -124px 0;
+ }
+
+.iradio_polaris {
+ background-position: -155px 0;
+}
+ .iradio_polaris.hover {
+ background-position: -186px 0;
+ }
+ .iradio_polaris.checked {
+ background-position: -217px 0;
+ }
+ .iradio_polaris.disabled {
+ background-position: -248px 0;
+ cursor: default;
+ }
+ .iradio_polaris.checked.disabled {
+ background-position: -279px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_polaris,
+ .iradio_polaris {
+ background-image: url(polaris@2x.png);
+ -webkit-background-size: 310px 31px;
+ background-size: 310px 31px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.png b/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.png
new file mode 100644
index 0000000..60c14e6
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris@2x.png b/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris@2x.png
new file mode 100644
index 0000000..c75b826
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/polaris/polaris@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/_all.css b/public/bower_components/admin-lte/plugins/iCheck/square/_all.css
new file mode 100644
index 0000000..a2ff036
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/_all.css
@@ -0,0 +1,620 @@
+/* iCheck plugin Square skin
+----------------------------------- */
+.icheckbox_square,
+.iradio_square {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(square.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square {
+ background-position: 0 0;
+}
+ .icheckbox_square.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square {
+ background-position: -120px 0;
+}
+ .iradio_square.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square,
+ .iradio_square {
+ background-image: url(square@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* red */
+.icheckbox_square-red,
+.iradio_square-red {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(red.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-red {
+ background-position: 0 0;
+}
+ .icheckbox_square-red.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-red.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-red.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-red.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-red {
+ background-position: -120px 0;
+}
+ .iradio_square-red.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-red.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-red.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-red.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-red,
+ .iradio_square-red {
+ background-image: url(red@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* green */
+.icheckbox_square-green,
+.iradio_square-green {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(green.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-green {
+ background-position: 0 0;
+}
+ .icheckbox_square-green.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-green.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-green.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-green.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-green {
+ background-position: -120px 0;
+}
+ .iradio_square-green.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-green.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-green.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-green.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-green,
+ .iradio_square-green {
+ background-image: url(green@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* blue */
+.icheckbox_square-blue,
+.iradio_square-blue {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(blue.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-blue {
+ background-position: 0 0;
+}
+ .icheckbox_square-blue.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-blue.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-blue.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-blue.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-blue {
+ background-position: -120px 0;
+}
+ .iradio_square-blue.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-blue.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-blue.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-blue.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-blue,
+ .iradio_square-blue {
+ background-image: url(blue@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* aero */
+.icheckbox_square-aero,
+.iradio_square-aero {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(aero.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-aero {
+ background-position: 0 0;
+}
+ .icheckbox_square-aero.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-aero.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-aero.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-aero.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-aero {
+ background-position: -120px 0;
+}
+ .iradio_square-aero.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-aero.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-aero.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-aero.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-aero,
+ .iradio_square-aero {
+ background-image: url(aero@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* grey */
+.icheckbox_square-grey,
+.iradio_square-grey {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(grey.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-grey {
+ background-position: 0 0;
+}
+ .icheckbox_square-grey.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-grey.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-grey.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-grey.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-grey {
+ background-position: -120px 0;
+}
+ .iradio_square-grey.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-grey.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-grey.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-grey.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-grey,
+ .iradio_square-grey {
+ background-image: url(grey@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* orange */
+.icheckbox_square-orange,
+.iradio_square-orange {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(orange.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-orange {
+ background-position: 0 0;
+}
+ .icheckbox_square-orange.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-orange.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-orange.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-orange.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-orange {
+ background-position: -120px 0;
+}
+ .iradio_square-orange.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-orange.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-orange.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-orange.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-orange,
+ .iradio_square-orange {
+ background-image: url(orange@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* yellow */
+.icheckbox_square-yellow,
+.iradio_square-yellow {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(yellow.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-yellow {
+ background-position: 0 0;
+}
+ .icheckbox_square-yellow.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-yellow.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-yellow.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-yellow.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-yellow {
+ background-position: -120px 0;
+}
+ .iradio_square-yellow.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-yellow.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-yellow.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-yellow.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-yellow,
+ .iradio_square-yellow {
+ background-image: url(yellow@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* pink */
+.icheckbox_square-pink,
+.iradio_square-pink {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(pink.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-pink {
+ background-position: 0 0;
+}
+ .icheckbox_square-pink.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-pink.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-pink.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-pink.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-pink {
+ background-position: -120px 0;
+}
+ .iradio_square-pink.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-pink.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-pink.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-pink.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-pink,
+ .iradio_square-pink {
+ background-image: url(pink@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+}
+
+/* purple */
+.icheckbox_square-purple,
+.iradio_square-purple {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(purple.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-purple {
+ background-position: 0 0;
+}
+ .icheckbox_square-purple.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-purple.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-purple.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-purple.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-purple {
+ background-position: -120px 0;
+}
+ .iradio_square-purple.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-purple.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-purple.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-purple.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-purple,
+ .iradio_square-purple {
+ background-image: url(purple@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/aero.css b/public/bower_components/admin-lte/plugins/iCheck/square/aero.css
new file mode 100644
index 0000000..51fca0a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/aero.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, aero
+----------------------------------- */
+.icheckbox_square-aero,
+.iradio_square-aero {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(aero.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-aero {
+ background-position: 0 0;
+}
+ .icheckbox_square-aero.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-aero.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-aero.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-aero.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-aero {
+ background-position: -120px 0;
+}
+ .iradio_square-aero.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-aero.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-aero.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-aero.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-aero,
+ .iradio_square-aero {
+ background-image: url(aero@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/aero.png b/public/bower_components/admin-lte/plugins/iCheck/square/aero.png
new file mode 100644
index 0000000..1a332e6
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/aero.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/aero@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/aero@2x.png
new file mode 100644
index 0000000..07c5a02
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/aero@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/blue.css b/public/bower_components/admin-lte/plugins/iCheck/square/blue.css
new file mode 100644
index 0000000..95340fe
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/blue.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, blue
+----------------------------------- */
+.icheckbox_square-blue,
+.iradio_square-blue {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(blue.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-blue {
+ background-position: 0 0;
+}
+ .icheckbox_square-blue.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-blue.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-blue.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-blue.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-blue {
+ background-position: -120px 0;
+}
+ .iradio_square-blue.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-blue.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-blue.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-blue.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-blue,
+ .iradio_square-blue {
+ background-image: url(blue@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/blue.png b/public/bower_components/admin-lte/plugins/iCheck/square/blue.png
new file mode 100644
index 0000000..a3e040f
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/blue.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/blue@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/blue@2x.png
new file mode 100644
index 0000000..8fdea12
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/blue@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/green.css b/public/bower_components/admin-lte/plugins/iCheck/square/green.css
new file mode 100644
index 0000000..eb43f2a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/green.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, green
+----------------------------------- */
+.icheckbox_square-green,
+.iradio_square-green {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(green.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-green {
+ background-position: 0 0;
+}
+ .icheckbox_square-green.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-green.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-green.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-green.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-green {
+ background-position: -120px 0;
+}
+ .iradio_square-green.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-green.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-green.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-green.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-green,
+ .iradio_square-green {
+ background-image: url(green@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/green.png b/public/bower_components/admin-lte/plugins/iCheck/square/green.png
new file mode 100644
index 0000000..465824e
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/green.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/green@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/green@2x.png
new file mode 100644
index 0000000..784e874
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/green@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/grey.css b/public/bower_components/admin-lte/plugins/iCheck/square/grey.css
new file mode 100644
index 0000000..ecc57ff
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/grey.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, grey
+----------------------------------- */
+.icheckbox_square-grey,
+.iradio_square-grey {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(grey.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-grey {
+ background-position: 0 0;
+}
+ .icheckbox_square-grey.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-grey.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-grey.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-grey.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-grey {
+ background-position: -120px 0;
+}
+ .iradio_square-grey.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-grey.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-grey.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-grey.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-grey,
+ .iradio_square-grey {
+ background-image: url(grey@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/grey.png b/public/bower_components/admin-lte/plugins/iCheck/square/grey.png
new file mode 100644
index 0000000..f693758
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/grey.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/grey@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/grey@2x.png
new file mode 100644
index 0000000..5d6341c
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/grey@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/orange.css b/public/bower_components/admin-lte/plugins/iCheck/square/orange.css
new file mode 100644
index 0000000..d0c7a2c
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/orange.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, orange
+----------------------------------- */
+.icheckbox_square-orange,
+.iradio_square-orange {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(orange.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-orange {
+ background-position: 0 0;
+}
+ .icheckbox_square-orange.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-orange.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-orange.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-orange.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-orange {
+ background-position: -120px 0;
+}
+ .iradio_square-orange.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-orange.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-orange.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-orange.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-orange,
+ .iradio_square-orange {
+ background-image: url(orange@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/orange.png b/public/bower_components/admin-lte/plugins/iCheck/square/orange.png
new file mode 100644
index 0000000..8460850
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/orange.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/orange@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/orange@2x.png
new file mode 100644
index 0000000..b1f2319
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/orange@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/pink.css b/public/bower_components/admin-lte/plugins/iCheck/square/pink.css
new file mode 100644
index 0000000..6b706f6
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/pink.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, pink
+----------------------------------- */
+.icheckbox_square-pink,
+.iradio_square-pink {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(pink.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-pink {
+ background-position: 0 0;
+}
+ .icheckbox_square-pink.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-pink.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-pink.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-pink.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-pink {
+ background-position: -120px 0;
+}
+ .iradio_square-pink.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-pink.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-pink.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-pink.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-pink,
+ .iradio_square-pink {
+ background-image: url(pink@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/pink.png b/public/bower_components/admin-lte/plugins/iCheck/square/pink.png
new file mode 100644
index 0000000..9c8b4e2
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/pink.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/pink@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/pink@2x.png
new file mode 100644
index 0000000..b1f3a6e
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/pink@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/purple.css b/public/bower_components/admin-lte/plugins/iCheck/square/purple.css
new file mode 100644
index 0000000..43051d3
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/purple.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, purple
+----------------------------------- */
+.icheckbox_square-purple,
+.iradio_square-purple {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(purple.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-purple {
+ background-position: 0 0;
+}
+ .icheckbox_square-purple.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-purple.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-purple.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-purple.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-purple {
+ background-position: -120px 0;
+}
+ .iradio_square-purple.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-purple.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-purple.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-purple.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-purple,
+ .iradio_square-purple {
+ background-image: url(purple@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/purple.png b/public/bower_components/admin-lte/plugins/iCheck/square/purple.png
new file mode 100644
index 0000000..6bfc16a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/purple.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/purple@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/purple@2x.png
new file mode 100644
index 0000000..6d3c8b1
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/purple@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/red.css b/public/bower_components/admin-lte/plugins/iCheck/square/red.css
new file mode 100644
index 0000000..40013c4
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/red.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, red
+----------------------------------- */
+.icheckbox_square-red,
+.iradio_square-red {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(red.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-red {
+ background-position: 0 0;
+}
+ .icheckbox_square-red.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-red.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-red.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-red.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-red {
+ background-position: -120px 0;
+}
+ .iradio_square-red.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-red.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-red.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-red.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-red,
+ .iradio_square-red {
+ background-image: url(red@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/red.png b/public/bower_components/admin-lte/plugins/iCheck/square/red.png
new file mode 100644
index 0000000..749675a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/red.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/red@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/red@2x.png
new file mode 100644
index 0000000..c05700a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/red@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/square.css b/public/bower_components/admin-lte/plugins/iCheck/square/square.css
new file mode 100644
index 0000000..b604fa8
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/square.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, black
+----------------------------------- */
+.icheckbox_square,
+.iradio_square {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(square.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square {
+ background-position: 0 0;
+}
+ .icheckbox_square.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square {
+ background-position: -120px 0;
+}
+ .iradio_square.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square,
+ .iradio_square {
+ background-image: url(square@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/square.png b/public/bower_components/admin-lte/plugins/iCheck/square/square.png
new file mode 100644
index 0000000..2a3c881
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/square.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/square@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/square@2x.png
new file mode 100644
index 0000000..9b56c44
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/square@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/yellow.css b/public/bower_components/admin-lte/plugins/iCheck/square/yellow.css
new file mode 100644
index 0000000..5511349
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/yellow.css
@@ -0,0 +1,62 @@
+/* iCheck plugin Square skin, yellow
+----------------------------------- */
+.icheckbox_square-yellow,
+.iradio_square-yellow {
+ display: inline-block;
+ *display: inline;
+ vertical-align: middle;
+ margin: 0;
+ padding: 0;
+ width: 22px;
+ height: 22px;
+ background: url(yellow.png) no-repeat;
+ border: none;
+ cursor: pointer;
+}
+
+.icheckbox_square-yellow {
+ background-position: 0 0;
+}
+ .icheckbox_square-yellow.hover {
+ background-position: -24px 0;
+ }
+ .icheckbox_square-yellow.checked {
+ background-position: -48px 0;
+ }
+ .icheckbox_square-yellow.disabled {
+ background-position: -72px 0;
+ cursor: default;
+ }
+ .icheckbox_square-yellow.checked.disabled {
+ background-position: -96px 0;
+ }
+
+.iradio_square-yellow {
+ background-position: -120px 0;
+}
+ .iradio_square-yellow.hover {
+ background-position: -144px 0;
+ }
+ .iradio_square-yellow.checked {
+ background-position: -168px 0;
+ }
+ .iradio_square-yellow.disabled {
+ background-position: -192px 0;
+ cursor: default;
+ }
+ .iradio_square-yellow.checked.disabled {
+ background-position: -216px 0;
+ }
+
+/* Retina support */
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
+ only screen and (-o-min-device-pixel-ratio: 3/2),
+ only screen and (min-device-pixel-ratio: 1.5) {
+ .icheckbox_square-yellow,
+ .iradio_square-yellow {
+ background-image: url(yellow@2x.png);
+ -webkit-background-size: 240px 24px;
+ background-size: 240px 24px;
+ }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/yellow.png b/public/bower_components/admin-lte/plugins/iCheck/square/yellow.png
new file mode 100644
index 0000000..b6c0330
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/yellow.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/iCheck/square/yellow@2x.png b/public/bower_components/admin-lte/plugins/iCheck/square/yellow@2x.png
new file mode 100644
index 0000000..6b8e328
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/iCheck/square/yellow@2x.png
Binary files differ
diff --git a/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.date.extensions.js b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.date.extensions.js
new file mode 100644
index 0000000..18f76c8
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.date.extensions.js
@@ -0,0 +1,488 @@
+/*
+Input Mask plugin extensions
+http://github.com/RobinHerbots/jquery.inputmask
+Copyright (c) 2010 - 2014 Robin Herbots
+Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+Version: 0.0.0
+
+Optional extensions on the jquery.inputmask base
+*/
+(function ($) {
+ //date & time aliases
+ $.extend($.inputmask.defaults.definitions, {
+ 'h': { //hours
+ validator: "[01][0-9]|2[0-3]",
+ cardinality: 2,
+ prevalidator: [{ validator: "[0-2]", cardinality: 1 }]
+ },
+ 's': { //seconds || minutes
+ validator: "[0-5][0-9]",
+ cardinality: 2,
+ prevalidator: [{ validator: "[0-5]", cardinality: 1 }]
+ },
+ 'd': { //basic day
+ validator: "0[1-9]|[12][0-9]|3[01]",
+ cardinality: 2,
+ prevalidator: [{ validator: "[0-3]", cardinality: 1 }]
+ },
+ 'm': { //basic month
+ validator: "0[1-9]|1[012]",
+ cardinality: 2,
+ prevalidator: [{ validator: "[01]", cardinality: 1 }]
+ },
+ 'y': { //basic year
+ validator: "(19|20)\\d{2}",
+ cardinality: 4,
+ prevalidator: [
+ { validator: "[12]", cardinality: 1 },
+ { validator: "(19|20)", cardinality: 2 },
+ { validator: "(19|20)\\d", cardinality: 3 }
+ ]
+ }
+ });
+ $.extend($.inputmask.defaults.aliases, {
+ 'dd/mm/yyyy': {
+ mask: "1/2/y",
+ placeholder: "dd/mm/yyyy",
+ regex: {
+ val1pre: new RegExp("[0-3]"), //daypre
+ val1: new RegExp("0[1-9]|[12][0-9]|3[01]"), //day
+ val2pre: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])"); }, //monthpre
+ val2: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))"); }//month
+ },
+ leapday: "29/02/",
+ separator: '/',
+ yearrange: { minyear: 1900, maxyear: 2099 },
+ isInYearRange: function (chrs, minyear, maxyear) {
+ var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length)));
+ var enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length)));
+ return (enteredyear != NaN ? minyear <= enteredyear && enteredyear <= maxyear : false) ||
+ (enteredyear2 != NaN ? minyear <= enteredyear2 && enteredyear2 <= maxyear : false);
+ },
+ determinebaseyear: function (minyear, maxyear, hint) {
+ var currentyear = (new Date()).getFullYear();
+ if (minyear > currentyear) return minyear;
+ if (maxyear < currentyear) {
+ var maxYearPrefix = maxyear.toString().slice(0, 2);
+ var maxYearPostfix = maxyear.toString().slice(2, 4);
+ while (maxyear < maxYearPrefix + hint) {
+ maxYearPrefix--;
+ }
+ var maxxYear = maxYearPrefix + maxYearPostfix;
+ return minyear > maxxYear ? minyear : maxxYear;
+ }
+
+ return currentyear;
+ },
+ onKeyUp: function (e, buffer, opts) {
+ var $input = $(this);
+ if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) {
+ var today = new Date();
+ $input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString());
+ }
+ },
+ definitions: {
+ '1': { //val1 ~ day or month
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var isValid = opts.regex.val1.test(chrs);
+ if (!strict && !isValid) {
+ if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
+ isValid = opts.regex.val1.test("0" + chrs.charAt(0));
+ if (isValid) {
+ buffer[pos - 1] = "0";
+ return { "pos": pos, "c": chrs.charAt(0) };
+ }
+ }
+ }
+ return isValid;
+ },
+ cardinality: 2,
+ prevalidator: [{
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var isValid = opts.regex.val1pre.test(chrs);
+ if (!strict && !isValid) {
+ isValid = opts.regex.val1.test("0" + chrs);
+ if (isValid) {
+ buffer[pos] = "0";
+ pos++;
+ return { "pos": pos };
+ }
+ }
+ return isValid;
+ }, cardinality: 1
+ }]
+ },
+ '2': { //val2 ~ day or month
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var frontValue = buffer.join('').substr(0, 3);
+ if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator;
+ var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
+ if (!strict && !isValid) {
+ if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
+ isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
+ if (isValid) {
+ buffer[pos - 1] = "0";
+ return { "pos": pos, "c": chrs.charAt(0) };
+ }
+ }
+ }
+ return isValid;
+ },
+ cardinality: 2,
+ prevalidator: [{
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var frontValue = buffer.join('').substr(0, 3);
+ if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator;
+ var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs);
+ if (!strict && !isValid) {
+ isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs);
+ if (isValid) {
+ buffer[pos] = "0";
+ pos++;
+ return { "pos": pos };
+ }
+ }
+ return isValid;
+ }, cardinality: 1
+ }]
+ },
+ 'y': { //year
+ validator: function (chrs, buffer, pos, strict, opts) {
+ if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
+ var dayMonthValue = buffer.join('').substr(0, 6);
+ if (dayMonthValue != opts.leapday)
+ return true;
+ else {
+ var year = parseInt(chrs, 10);//detect leap year
+ if (year % 4 === 0)
+ if (year % 100 === 0)
+ if (year % 400 === 0)
+ return true;
+ else return false;
+ else return true;
+ else return false;
+ }
+ } else return false;
+ },
+ cardinality: 4,
+ prevalidator: [
+ {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
+ if (!strict && !isValid) {
+ var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 1);
+
+ isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
+ if (isValid) {
+ buffer[pos++] = yearPrefix[0];
+ return { "pos": pos };
+ }
+ yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 2);
+
+ isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
+ if (isValid) {
+ buffer[pos++] = yearPrefix[0];
+ buffer[pos++] = yearPrefix[1];
+ return { "pos": pos };
+ }
+ }
+ return isValid;
+ },
+ cardinality: 1
+ },
+ {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
+ if (!strict && !isValid) {
+ var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2);
+
+ isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear);
+ if (isValid) {
+ buffer[pos++] = yearPrefix[1];
+ return { "pos": pos };
+ }
+
+ yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2);
+ if (opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) {
+ var dayMonthValue = buffer.join('').substr(0, 6);
+ if (dayMonthValue != opts.leapday)
+ isValid = true;
+ else {
+ var year = parseInt(chrs, 10);//detect leap year
+ if (year % 4 === 0)
+ if (year % 100 === 0)
+ if (year % 400 === 0)
+ isValid = true;
+ else isValid = false;
+ else isValid = true;
+ else isValid = false;
+ }
+ } else isValid = false;
+ if (isValid) {
+ buffer[pos - 1] = yearPrefix[0];
+ buffer[pos++] = yearPrefix[1];
+ buffer[pos++] = chrs[0];
+ return { "pos": pos };
+ }
+ }
+ return isValid;
+ }, cardinality: 2
+ },
+ {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
+ }, cardinality: 3
+ }
+ ]
+ }
+ },
+ insertMode: false,
+ autoUnmask: false
+ },
+ 'mm/dd/yyyy': {
+ placeholder: "mm/dd/yyyy",
+ alias: "dd/mm/yyyy", //reuse functionality of dd/mm/yyyy alias
+ regex: {
+ val2pre: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])"); }, //daypre
+ val2: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)"); }, //day
+ val1pre: new RegExp("[01]"), //monthpre
+ val1: new RegExp("0[1-9]|1[012]") //month
+ },
+ leapday: "02/29/",
+ onKeyUp: function (e, buffer, opts) {
+ var $input = $(this);
+ if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) {
+ var today = new Date();
+ $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString());
+ }
+ }
+ },
+ 'yyyy/mm/dd': {
+ mask: "y/1/2",
+ placeholder: "yyyy/mm/dd",
+ alias: "mm/dd/yyyy",
+ leapday: "/02/29",
+ onKeyUp: function (e, buffer, opts) {
+ var $input = $(this);
+ if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) {
+ var today = new Date();
+ $input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString());
+ }
+ },
+ definitions: {
+ '2': { //val2 ~ day or month
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var frontValue = buffer.join('').substr(5, 3);
+ if (frontValue.indexOf(opts.placeholder[5]) != -1) frontValue = "01" + opts.separator;
+ var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
+ if (!strict && !isValid) {
+ if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) {
+ isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
+ if (isValid) {
+ buffer[pos - 1] = "0";
+ return { "pos": pos, "c": chrs.charAt(0) };
+ }
+ }
+ }
+
+ //check leap yeap
+ if (isValid) {
+ var dayMonthValue = buffer.join('').substr(4, 4) + chrs;
+ if (dayMonthValue != opts.leapday)
+ return true;
+ else {
+ var year = parseInt(buffer.join('').substr(0, 4), 10); //detect leap year
+ if (year % 4 === 0)
+ if (year % 100 === 0)
+ if (year % 400 === 0)
+ return true;
+ else return false;
+ else return true;
+ else return false;
+ }
+ }
+
+ return isValid;
+ },
+ cardinality: 2,
+ prevalidator: [{
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var frontValue = buffer.join('').substr(5, 3);
+ if (frontValue.indexOf(opts.placeholder[5]) != -1) frontValue = "01" + opts.separator;
+ var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs);
+ if (!strict && !isValid) {
+ isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs);
+ if (isValid) {
+ buffer[pos] = "0";
+ pos++;
+ return { "pos": pos };
+ }
+ }
+ return isValid;
+ }, cardinality: 1
+ }]
+ }
+ }
+ },
+ 'dd.mm.yyyy': {
+ mask: "1.2.y",
+ placeholder: "dd.mm.yyyy",
+ leapday: "29.02.",
+ separator: '.',
+ alias: "dd/mm/yyyy"
+ },
+ 'dd-mm-yyyy': {
+ mask: "1-2-y",
+ placeholder: "dd-mm-yyyy",
+ leapday: "29-02-",
+ separator: '-',
+ alias: "dd/mm/yyyy"
+ },
+ 'mm.dd.yyyy': {
+ mask: "1.2.y",
+ placeholder: "mm.dd.yyyy",
+ leapday: "02.29.",
+ separator: '.',
+ alias: "mm/dd/yyyy"
+ },
+ 'mm-dd-yyyy': {
+ mask: "1-2-y",
+ placeholder: "mm-dd-yyyy",
+ leapday: "02-29-",
+ separator: '-',
+ alias: "mm/dd/yyyy"
+ },
+ 'yyyy.mm.dd': {
+ mask: "y.1.2",
+ placeholder: "yyyy.mm.dd",
+ leapday: ".02.29",
+ separator: '.',
+ alias: "yyyy/mm/dd"
+ },
+ 'yyyy-mm-dd': {
+ mask: "y-1-2",
+ placeholder: "yyyy-mm-dd",
+ leapday: "-02-29",
+ separator: '-',
+ alias: "yyyy/mm/dd"
+ },
+ 'datetime': {
+ mask: "1/2/y h:s",
+ placeholder: "dd/mm/yyyy hh:mm",
+ alias: "dd/mm/yyyy",
+ regex: {
+ hrspre: new RegExp("[012]"), //hours pre
+ hrs24: new RegExp("2[0-9]|1[3-9]"),
+ hrs: new RegExp("[01][0-9]|2[0-3]"), //hours
+ ampm: new RegExp("^[a|p|A|P][m|M]")
+ },
+ timeseparator: ':',
+ hourFormat: "24", // or 12
+ definitions: {
+ 'h': { //hours
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var isValid = opts.regex.hrs.test(chrs);
+ if (!strict && !isValid) {
+ if (chrs.charAt(1) == opts.timeseparator || "-.:".indexOf(chrs.charAt(1)) != -1) {
+ isValid = opts.regex.hrs.test("0" + chrs.charAt(0));
+ if (isValid) {
+ buffer[pos - 1] = "0";
+ buffer[pos] = chrs.charAt(0);
+ pos++;
+ return { "pos": pos };
+ }
+ }
+ }
+
+ if (isValid && opts.hourFormat !== "24" && opts.regex.hrs24.test(chrs)) {
+
+ var tmp = parseInt(chrs, 10);
+
+ if (tmp == 24) {
+ buffer[pos + 5] = "a";
+ buffer[pos + 6] = "m";
+ } else {
+ buffer[pos + 5] = "p";
+ buffer[pos + 6] = "m";
+ }
+
+ tmp = tmp - 12;
+
+ if (tmp < 10) {
+ buffer[pos] = tmp.toString();
+ buffer[pos - 1] = "0";
+ } else {
+ buffer[pos] = tmp.toString().charAt(1);
+ buffer[pos - 1] = tmp.toString().charAt(0);
+ }
+
+ return { "pos": pos, "c": buffer[pos] };
+ }
+
+ return isValid;
+ },
+ cardinality: 2,
+ prevalidator: [{
+ validator: function (chrs, buffer, pos, strict, opts) {
+ var isValid = opts.regex.hrspre.test(chrs);
+ if (!strict && !isValid) {
+ isValid = opts.regex.hrs.test("0" + chrs);
+ if (isValid) {
+ buffer[pos] = "0";
+ pos++;
+ return { "pos": pos };
+ }
+ }
+ return isValid;
+ }, cardinality: 1
+ }]
+ },
+ 't': { //am/pm
+ validator: function (chrs, buffer, pos, strict, opts) {
+ return opts.regex.ampm.test(chrs + "m");
+ },
+ casing: "lower",
+ cardinality: 1
+ }
+ },
+ insertMode: false,
+ autoUnmask: false
+ },
+ 'datetime12': {
+ mask: "1/2/y h:s t\\m",
+ placeholder: "dd/mm/yyyy hh:mm xm",
+ alias: "datetime",
+ hourFormat: "12"
+ },
+ 'hh:mm t': {
+ mask: "h:s t\\m",
+ placeholder: "hh:mm xm",
+ alias: "datetime",
+ hourFormat: "12"
+ },
+ 'h:s t': {
+ mask: "h:s t\\m",
+ placeholder: "hh:mm xm",
+ alias: "datetime",
+ hourFormat: "12"
+ },
+ 'hh:mm:ss': {
+ mask: "h:s:s",
+ autoUnmask: false
+ },
+ 'hh:mm': {
+ mask: "h:s",
+ autoUnmask: false
+ },
+ 'date': {
+ alias: "dd/mm/yyyy" // "mm/dd/yyyy"
+ },
+ 'mm/yyyy': {
+ mask: "1/y",
+ placeholder: "mm/yyyy",
+ leapday: "donotuse",
+ separator: '/',
+ alias: "mm/dd/yyyy"
+ }
+ });
+})(jQuery);
diff --git a/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.extensions.js b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.extensions.js
new file mode 100644
index 0000000..c89f91e
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.extensions.js
@@ -0,0 +1,122 @@
+/*
+Input Mask plugin extensions
+http://github.com/RobinHerbots/jquery.inputmask
+Copyright (c) 2010 - 2014 Robin Herbots
+Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+Version: 0.0.0
+
+Optional extensions on the jquery.inputmask base
+*/
+(function ($) {
+ //extra definitions
+ $.extend($.inputmask.defaults.definitions, {
+ 'A': {
+ validator: "[A-Za-z]",
+ cardinality: 1,
+ casing: "upper" //auto uppercasing
+ },
+ '#': {
+ validator: "[A-Za-z\u0410-\u044F\u0401\u04510-9]",
+ cardinality: 1,
+ casing: "upper"
+ }
+ });
+ $.extend($.inputmask.defaults.aliases, {
+ 'url': {
+ mask: "ir",
+ placeholder: "",
+ separator: "",
+ defaultPrefix: "http://",
+ regex: {
+ urlpre1: new RegExp("[fh]"),
+ urlpre2: new RegExp("(ft|ht)"),
+ urlpre3: new RegExp("(ftp|htt)"),
+ urlpre4: new RegExp("(ftp:|http|ftps)"),
+ urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"),
+ urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"),
+ urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"),
+ urlpre8: new RegExp("(ftp://|ftps://|http://|https://)")
+ },
+ definitions: {
+ 'i': {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ return true;
+ },
+ cardinality: 8,
+ prevalidator: (function () {
+ var result = [], prefixLimit = 8;
+ for (var i = 0; i < prefixLimit; i++) {
+ result[i] = (function () {
+ var j = i;
+ return {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ if (opts.regex["urlpre" + (j + 1)]) {
+ var tmp = chrs, k;
+ if (((j + 1) - chrs.length) > 0) {
+ tmp = buffer.join('').substring(0, ((j + 1) - chrs.length)) + "" + tmp;
+ }
+ var isValid = opts.regex["urlpre" + (j + 1)].test(tmp);
+ if (!strict && !isValid) {
+ pos = pos - j;
+ for (k = 0; k < opts.defaultPrefix.length; k++) {
+ buffer[pos] = opts.defaultPrefix[k]; pos++;
+ }
+ for (k = 0; k < tmp.length - 1; k++) {
+ buffer[pos] = tmp[k]; pos++;
+ }
+ return { "pos": pos };
+ }
+ return isValid;
+ } else {
+ return false;
+ }
+ }, cardinality: j
+ };
+ })();
+ }
+ return result;
+ })()
+ },
+ "r": {
+ validator: ".",
+ cardinality: 50
+ }
+ },
+ insertMode: false,
+ autoUnmask: false
+ },
+ "ip": { //ip-address mask
+ mask: ["[[x]y]z.[[x]y]z.[[x]y]z.x[yz]", "[[x]y]z.[[x]y]z.[[x]y]z.[[x]y][z]"],
+ definitions: {
+ 'x': {
+ validator: "[012]",
+ cardinality: 1,
+ definitionSymbol: "i"
+ },
+ 'y': {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ if (pos - 1 > -1 && buffer[pos - 1] != ".")
+ chrs = buffer[pos - 1] + chrs;
+ else chrs = "0" + chrs;
+ return new RegExp("2[0-5]|[01][0-9]").test(chrs);
+ },
+ cardinality: 1,
+ definitionSymbol: "i"
+ },
+ 'z': {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ if (pos - 1 > -1 && buffer[pos - 1] != ".") {
+ chrs = buffer[pos - 1] + chrs;
+ if (pos - 2 > -1 && buffer[pos - 2] != ".") {
+ chrs = buffer[pos - 2] + chrs;
+ } else chrs = "0" + chrs;
+ } else chrs = "00" + chrs;
+ return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
+ },
+ cardinality: 1,
+ definitionSymbol: "i"
+ }
+ }
+ }
+ });
+})(jQuery);
diff --git a/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.js b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.js
new file mode 100644
index 0000000..86cb320
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.js
@@ -0,0 +1,1627 @@
+/**
+* @license Input Mask plugin for jquery
+* http://github.com/RobinHerbots/jquery.inputmask
+* Copyright (c) 2010 - 2014 Robin Herbots
+* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+* Version: 0.0.0
+*/
+
+(function ($) {
+ if ($.fn.inputmask === undefined) {
+ //helper functions
+ function isInputEventSupported(eventName) {
+ var el = document.createElement('input'),
+ eventName = 'on' + eventName,
+ isSupported = (eventName in el);
+ if (!isSupported) {
+ el.setAttribute(eventName, 'return;');
+ isSupported = typeof el[eventName] == 'function';
+ }
+ el = null;
+ return isSupported;
+ }
+ function resolveAlias(aliasStr, options, opts) {
+ var aliasDefinition = opts.aliases[aliasStr];
+ if (aliasDefinition) {
+ if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts); //alias is another alias
+ $.extend(true, opts, aliasDefinition); //merge alias definition in the options
+ $.extend(true, opts, options); //reapply extra given options
+ return true;
+ }
+ return false;
+ }
+ function generateMaskSets(opts) {
+ var ms = [];
+ var genmasks = []; //used to keep track of the masks that where processed, to avoid duplicates
+ function getMaskTemplate(mask) {
+ if (opts.numericInput) {
+ mask = mask.split('').reverse().join('');
+ }
+ var escaped = false, outCount = 0, greedy = opts.greedy, repeat = opts.repeat;
+ if (repeat == "*") greedy = false;
+ //if (greedy == true && opts.placeholder == "") opts.placeholder = " ";
+ if (mask.length == 1 && greedy == false && repeat != 0) { opts.placeholder = ""; } //hide placeholder with single non-greedy mask
+ var singleMask = $.map(mask.split(""), function (element, index) {
+ var outElem = [];
+ if (element == opts.escapeChar) {
+ escaped = true;
+ }
+ else if ((element != opts.optionalmarker.start && element != opts.optionalmarker.end) || escaped) {
+ var maskdef = opts.definitions[element];
+ if (maskdef && !escaped) {
+ for (var i = 0; i < maskdef.cardinality; i++) {
+ outElem.push(opts.placeholder.charAt((outCount + i) % opts.placeholder.length));
+ }
+ } else {
+ outElem.push(element);
+ escaped = false;
+ }
+ outCount += outElem.length;
+ return outElem;
+ }
+ });
+
+ //allocate repetitions
+ var repeatedMask = singleMask.slice();
+ for (var i = 1; i < repeat && greedy; i++) {
+ repeatedMask = repeatedMask.concat(singleMask.slice());
+ }
+
+ return { "mask": repeatedMask, "repeat": repeat, "greedy": greedy };
+ }
+ //test definition => {fn: RegExp/function, cardinality: int, optionality: bool, newBlockMarker: bool, offset: int, casing: null/upper/lower, def: definitionSymbol}
+ function getTestingChain(mask) {
+ if (opts.numericInput) {
+ mask = mask.split('').reverse().join('');
+ }
+ var isOptional = false, escaped = false;
+ var newBlockMarker = false; //indicates wheter the begin/ending of a block should be indicated
+
+ return $.map(mask.split(""), function (element, index) {
+ var outElem = [];
+
+ if (element == opts.escapeChar) {
+ escaped = true;
+ } else if (element == opts.optionalmarker.start && !escaped) {
+ isOptional = true;
+ newBlockMarker = true;
+ }
+ else if (element == opts.optionalmarker.end && !escaped) {
+ isOptional = false;
+ newBlockMarker = true;
+ }
+ else {
+ var maskdef = opts.definitions[element];
+ if (maskdef && !escaped) {
+ var prevalidators = maskdef["prevalidator"], prevalidatorsL = prevalidators ? prevalidators.length : 0;
+ for (var i = 1; i < maskdef.cardinality; i++) {
+ var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator["validator"], cardinality = prevalidator["cardinality"];
+ outElem.push({ fn: validator ? typeof validator == 'string' ? new RegExp(validator) : new function () { this.test = validator; } : new RegExp("."), cardinality: cardinality ? cardinality : 1, optionality: isOptional, newBlockMarker: isOptional == true ? newBlockMarker : false, offset: 0, casing: maskdef["casing"], def: maskdef["definitionSymbol"] || element });
+ if (isOptional == true) //reset newBlockMarker
+ newBlockMarker = false;
+ }
+ outElem.push({ fn: maskdef.validator ? typeof maskdef.validator == 'string' ? new RegExp(maskdef.validator) : new function () { this.test = maskdef.validator; } : new RegExp("."), cardinality: maskdef.cardinality, optionality: isOptional, newBlockMarker: newBlockMarker, offset: 0, casing: maskdef["casing"], def: maskdef["definitionSymbol"] || element });
+ } else {
+ outElem.push({ fn: null, cardinality: 0, optionality: isOptional, newBlockMarker: newBlockMarker, offset: 0, casing: null, def: element });
+ escaped = false;
+ }
+ //reset newBlockMarker
+ newBlockMarker = false;
+ return outElem;
+ }
+ });
+ }
+ function markOptional(maskPart) { //needed for the clearOptionalTail functionality
+ return opts.optionalmarker.start + maskPart + opts.optionalmarker.end;
+ }
+ function splitFirstOptionalEndPart(maskPart) {
+ var optionalStartMarkers = 0, optionalEndMarkers = 0, mpl = maskPart.length;
+ for (var i = 0; i < mpl; i++) {
+ if (maskPart.charAt(i) == opts.optionalmarker.start) {
+ optionalStartMarkers++;
+ }
+ if (maskPart.charAt(i) == opts.optionalmarker.end) {
+ optionalEndMarkers++;
+ }
+ if (optionalStartMarkers > 0 && optionalStartMarkers == optionalEndMarkers)
+ break;
+ }
+ var maskParts = [maskPart.substring(0, i)];
+ if (i < mpl) {
+ maskParts.push(maskPart.substring(i + 1, mpl));
+ }
+ return maskParts;
+ }
+ function splitFirstOptionalStartPart(maskPart) {
+ var mpl = maskPart.length;
+ for (var i = 0; i < mpl; i++) {
+ if (maskPart.charAt(i) == opts.optionalmarker.start) {
+ break;
+ }
+ }
+ var maskParts = [maskPart.substring(0, i)];
+ if (i < mpl) {
+ maskParts.push(maskPart.substring(i + 1, mpl));
+ }
+ return maskParts;
+ }
+ function generateMask(maskPrefix, maskPart, metadata) {
+ var maskParts = splitFirstOptionalEndPart(maskPart);
+ var newMask, maskTemplate;
+
+ var masks = splitFirstOptionalStartPart(maskParts[0]);
+ if (masks.length > 1) {
+ newMask = maskPrefix + masks[0] + markOptional(masks[1]) + (maskParts.length > 1 ? maskParts[1] : "");
+ if ($.inArray(newMask, genmasks) == -1 && newMask != "") {
+ genmasks.push(newMask);
+ maskTemplate = getMaskTemplate(newMask);
+ ms.push({
+ "mask": newMask,
+ "_buffer": maskTemplate["mask"],
+ "buffer": maskTemplate["mask"].slice(),
+ "tests": getTestingChain(newMask),
+ "lastValidPosition": -1,
+ "greedy": maskTemplate["greedy"],
+ "repeat": maskTemplate["repeat"],
+ "metadata": metadata
+ });
+ }
+ newMask = maskPrefix + masks[0] + (maskParts.length > 1 ? maskParts[1] : "");
+ if ($.inArray(newMask, genmasks) == -1 && newMask != "") {
+ genmasks.push(newMask);
+ maskTemplate = getMaskTemplate(newMask);
+ ms.push({
+ "mask": newMask,
+ "_buffer": maskTemplate["mask"],
+ "buffer": maskTemplate["mask"].slice(),
+ "tests": getTestingChain(newMask),
+ "lastValidPosition": -1,
+ "greedy": maskTemplate["greedy"],
+ "repeat": maskTemplate["repeat"],
+ "metadata": metadata
+ });
+ }
+ if (splitFirstOptionalStartPart(masks[1]).length > 1) { //optional contains another optional
+ generateMask(maskPrefix + masks[0], masks[1] + maskParts[1], metadata);
+ }
+ if (maskParts.length > 1 && splitFirstOptionalStartPart(maskParts[1]).length > 1) {
+ generateMask(maskPrefix + masks[0] + markOptional(masks[1]), maskParts[1], metadata);
+ generateMask(maskPrefix + masks[0], maskParts[1], metadata);
+ }
+ }
+ else {
+ newMask = maskPrefix + maskParts;
+ if ($.inArray(newMask, genmasks) == -1 && newMask != "") {
+ genmasks.push(newMask);
+ maskTemplate = getMaskTemplate(newMask);
+ ms.push({
+ "mask": newMask,
+ "_buffer": maskTemplate["mask"],
+ "buffer": maskTemplate["mask"].slice(),
+ "tests": getTestingChain(newMask),
+ "lastValidPosition": -1,
+ "greedy": maskTemplate["greedy"],
+ "repeat": maskTemplate["repeat"],
+ "metadata": metadata
+ });
+ }
+ }
+
+ }
+
+ if ($.isFunction(opts.mask)) { //allow mask to be a preprocessing fn - should return a valid mask
+ opts.mask = opts.mask.call(this, opts);
+ }
+ if ($.isArray(opts.mask)) {
+ $.each(opts.mask, function (ndx, msk) {
+ if (msk["mask"] != undefined) {
+ generateMask("", msk["mask"].toString(), msk);
+ } else
+ generateMask("", msk.toString());
+ });
+ } else generateMask("", opts.mask.toString());
+
+ return opts.greedy ? ms : ms.sort(function (a, b) { return a["mask"].length - b["mask"].length; });
+ }
+
+ var msie10 = navigator.userAgent.match(new RegExp("msie 10", "i")) !== null,
+ iphone = navigator.userAgent.match(new RegExp("iphone", "i")) !== null,
+ android = navigator.userAgent.match(new RegExp("android.*safari.*", "i")) !== null,
+ androidchrome = navigator.userAgent.match(new RegExp("android.*chrome.*", "i")) !== null,
+ pasteEvent = isInputEventSupported('paste') ? 'paste' : isInputEventSupported('input') ? 'input' : "propertychange";
+
+
+ //masking scope
+ //actionObj definition see below
+ function maskScope(masksets, activeMasksetIndex, opts, actionObj) {
+ var isRTL = false,
+ valueOnFocus = getActiveBuffer().join(''),
+ $el, chromeValueOnInput,
+ skipKeyPressEvent = false, //Safari 5.1.x - modal dialog fires keypress twice workaround
+ skipInputEvent = false, //skip when triggered from within inputmask
+ ignorable = false;
+
+
+ //maskset helperfunctions
+
+ function getActiveMaskSet() {
+ return masksets[activeMasksetIndex];
+ }
+
+ function getActiveTests() {
+ return getActiveMaskSet()['tests'];
+ }
+
+ function getActiveBufferTemplate() {
+ return getActiveMaskSet()['_buffer'];
+ }
+
+ function getActiveBuffer() {
+ return getActiveMaskSet()['buffer'];
+ }
+
+ function isValid(pos, c, strict) { //strict true ~ no correction or autofill
+ strict = strict === true; //always set a value to strict to prevent possible strange behavior in the extensions
+
+ function _isValid(position, activeMaskset, c, strict) {
+ var testPos = determineTestPosition(position), loopend = c ? 1 : 0, chrs = '', buffer = activeMaskset["buffer"];
+ for (var i = activeMaskset['tests'][testPos].cardinality; i > loopend; i--) {
+ chrs += getBufferElement(buffer, testPos - (i - 1));
+ }
+
+ if (c) {
+ chrs += c;
+ }
+
+ //return is false or a json object => { pos: ??, c: ??} or true
+ return activeMaskset['tests'][testPos].fn != null ?
+ activeMaskset['tests'][testPos].fn.test(chrs, buffer, position, strict, opts)
+ : (c == getBufferElement(activeMaskset['_buffer'], position, true) || c == opts.skipOptionalPartCharacter) ?
+ { "refresh": true, c: getBufferElement(activeMaskset['_buffer'], position, true), pos: position }
+ : false;
+ }
+
+ function PostProcessResults(maskForwards, results) {
+ var hasValidActual = false;
+ $.each(results, function (ndx, rslt) {
+ hasValidActual = $.inArray(rslt["activeMasksetIndex"], maskForwards) == -1 && rslt["result"] !== false;
+ if (hasValidActual) return false;
+ });
+ if (hasValidActual) { //strip maskforwards
+ results = $.map(results, function (rslt, ndx) {
+ if ($.inArray(rslt["activeMasksetIndex"], maskForwards) == -1) {
+ return rslt;
+ } else {
+ masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = actualLVP;
+ }
+ });
+ } else { //keep maskforwards with the least forward
+ var lowestPos = -1, lowestIndex = -1, rsltValid;
+ $.each(results, function (ndx, rslt) {
+ if ($.inArray(rslt["activeMasksetIndex"], maskForwards) != -1 && rslt["result"] !== false & (lowestPos == -1 || lowestPos > rslt["result"]["pos"])) {
+ lowestPos = rslt["result"]["pos"];
+ lowestIndex = rslt["activeMasksetIndex"];
+ }
+ });
+ results = $.map(results, function (rslt, ndx) {
+ if ($.inArray(rslt["activeMasksetIndex"], maskForwards) != -1) {
+ if (rslt["result"]["pos"] == lowestPos) {
+ return rslt;
+ } else if (rslt["result"] !== false) {
+ for (var i = pos; i < lowestPos; i++) {
+ rsltValid = _isValid(i, masksets[rslt["activeMasksetIndex"]], masksets[lowestIndex]["buffer"][i], true);
+ if (rsltValid === false) {
+ masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = lowestPos - 1;
+ break;
+ } else {
+ setBufferElement(masksets[rslt["activeMasksetIndex"]]["buffer"], i, masksets[lowestIndex]["buffer"][i], true);
+ masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = i;
+ }
+ }
+ //also check check for the lowestpos with the new input
+ rsltValid = _isValid(lowestPos, masksets[rslt["activeMasksetIndex"]], c, true);
+ if (rsltValid !== false) {
+ setBufferElement(masksets[rslt["activeMasksetIndex"]]["buffer"], lowestPos, c, true);
+ masksets[rslt["activeMasksetIndex"]]["lastValidPosition"] = lowestPos;
+ }
+ //console.log("ndx " + rslt["activeMasksetIndex"] + " validate " + masksets[rslt["activeMasksetIndex"]]["buffer"].join('') + " lv " + masksets[rslt["activeMasksetIndex"]]['lastValidPosition']);
+ return rslt;
+ }
+ }
+ });
+ }
+ return results;
+ }
+
+ if (strict) {
+ var result = _isValid(pos, getActiveMaskSet(), c, strict); //only check validity in current mask when validating strict
+ if (result === true) {
+ result = { "pos": pos }; //always take a possible corrected maskposition into account
+ }
+ return result;
+ }
+
+ var results = [], result = false, currentActiveMasksetIndex = activeMasksetIndex,
+ actualBuffer = getActiveBuffer().slice(), actualLVP = getActiveMaskSet()["lastValidPosition"],
+ actualPrevious = seekPrevious(pos),
+ maskForwards = [];
+ $.each(masksets, function (index, value) {
+ if (typeof (value) == "object") {
+ activeMasksetIndex = index;
+
+ var maskPos = pos;
+ var lvp = getActiveMaskSet()['lastValidPosition'],
+ rsltValid;
+ if (lvp == actualLVP) {
+ if ((maskPos - actualLVP) > 1) {
+ for (var i = lvp == -1 ? 0 : lvp; i < maskPos; i++) {
+ rsltValid = _isValid(i, getActiveMaskSet(), actualBuffer[i], true);
+ if (rsltValid === false) {
+ break;
+ } else {
+ setBufferElement(getActiveBuffer(), i, actualBuffer[i], true);
+ if (rsltValid === true) {
+ rsltValid = { "pos": i }; //always take a possible corrected maskposition into account
+ }
+ var newValidPosition = rsltValid.pos || i;
+ if (getActiveMaskSet()['lastValidPosition'] < newValidPosition)
+ getActiveMaskSet()['lastValidPosition'] = newValidPosition; //set new position from isValid
+ }
+ }
+ }
+ //does the input match on a further position?
+ if (!isMask(maskPos) && !_isValid(maskPos, getActiveMaskSet(), c, strict)) {
+ var maxForward = seekNext(maskPos) - maskPos;
+ for (var fw = 0; fw < maxForward; fw++) {
+ if (_isValid(++maskPos, getActiveMaskSet(), c, strict) !== false)
+ break;
+ }
+ maskForwards.push(activeMasksetIndex);
+ //console.log('maskforward ' + activeMasksetIndex + " pos " + pos + " maskPos " + maskPos);
+ }
+ }
+
+ if (getActiveMaskSet()['lastValidPosition'] >= actualLVP || activeMasksetIndex == currentActiveMasksetIndex) {
+ if (maskPos >= 0 && maskPos < getMaskLength()) {
+ result = _isValid(maskPos, getActiveMaskSet(), c, strict);
+ if (result !== false) {
+ if (result === true) {
+ result = { "pos": maskPos }; //always take a possible corrected maskposition into account
+ }
+ var newValidPosition = result.pos || maskPos;
+ if (getActiveMaskSet()['lastValidPosition'] < newValidPosition)
+ getActiveMaskSet()['lastValidPosition'] = newValidPosition; //set new position from isValid
+ }
+ //console.log("pos " + pos + " ndx " + activeMasksetIndex + " validate " + getActiveBuffer().join('') + " lv " + getActiveMaskSet()['lastValidPosition']);
+ results.push({ "activeMasksetIndex": index, "result": result });
+ }
+ }
+ }
+ });
+ activeMasksetIndex = currentActiveMasksetIndex; //reset activeMasksetIndex
+
+ return PostProcessResults(maskForwards, results); //return results of the multiple mask validations
+ }
+
+ function determineActiveMasksetIndex() {
+ var currentMasksetIndex = activeMasksetIndex,
+ highestValid = { "activeMasksetIndex": 0, "lastValidPosition": -1, "next": -1 };
+ $.each(masksets, function (index, value) {
+ if (typeof (value) == "object") {
+ activeMasksetIndex = index;
+ if (getActiveMaskSet()['lastValidPosition'] > highestValid['lastValidPosition']) {
+ highestValid["activeMasksetIndex"] = index;
+ highestValid["lastValidPosition"] = getActiveMaskSet()['lastValidPosition'];
+ highestValid["next"] = seekNext(getActiveMaskSet()['lastValidPosition']);
+ } else if (getActiveMaskSet()['lastValidPosition'] == highestValid['lastValidPosition'] &&
+ (highestValid['next'] == -1 || highestValid['next'] > seekNext(getActiveMaskSet()['lastValidPosition']))) {
+ highestValid["activeMasksetIndex"] = index;
+ highestValid["lastValidPosition"] = getActiveMaskSet()['lastValidPosition'];
+ highestValid["next"] = seekNext(getActiveMaskSet()['lastValidPosition']);
+ }
+ }
+ });
+
+ activeMasksetIndex = highestValid["lastValidPosition"] != -1 && masksets[currentMasksetIndex]["lastValidPosition"] == highestValid["lastValidPosition"] ? currentMasksetIndex : highestValid["activeMasksetIndex"];
+ if (currentMasksetIndex != activeMasksetIndex) {
+ clearBuffer(getActiveBuffer(), seekNext(highestValid["lastValidPosition"]), getMaskLength());
+ getActiveMaskSet()["writeOutBuffer"] = true;
+ }
+ $el.data('_inputmask')['activeMasksetIndex'] = activeMasksetIndex; //store the activeMasksetIndex
+ }
+
+ function isMask(pos) {
+ var testPos = determineTestPosition(pos);
+ var test = getActiveTests()[testPos];
+
+ return test != undefined ? test.fn : false;
+ }
+
+ function determineTestPosition(pos) {
+ return pos % getActiveTests().length;
+ }
+
+ function getMaskLength() {
+ return opts.getMaskLength(getActiveBufferTemplate(), getActiveMaskSet()['greedy'], getActiveMaskSet()['repeat'], getActiveBuffer(), opts);
+ }
+
+ //pos: from position
+
+ function seekNext(pos) {
+ var maskL = getMaskLength();
+ if (pos >= maskL) return maskL;
+ var position = pos;
+ while (++position < maskL && !isMask(position)) {
+ }
+ return position;
+ }
+
+ //pos: from position
+
+ function seekPrevious(pos) {
+ var position = pos;
+ if (position <= 0) return 0;
+
+ while (--position > 0 && !isMask(position)) {
+ }
+ return position;
+ }
+
+ function setBufferElement(buffer, position, element, autoPrepare) {
+ if (autoPrepare) position = prepareBuffer(buffer, position);
+
+ var test = getActiveTests()[determineTestPosition(position)];
+ var elem = element;
+ if (elem != undefined && test != undefined) {
+ switch (test.casing) {
+ case "upper":
+ elem = element.toUpperCase();
+ break;
+ case "lower":
+ elem = element.toLowerCase();
+ break;
+ }
+ }
+
+ buffer[position] = elem;
+ }
+
+ function getBufferElement(buffer, position, autoPrepare) {
+ if (autoPrepare) position = prepareBuffer(buffer, position);
+ return buffer[position];
+ }
+
+ //needed to handle the non-greedy mask repetitions
+
+ function prepareBuffer(buffer, position) {
+ var j;
+ while (buffer[position] == undefined && buffer.length < getMaskLength()) {
+ j = 0;
+ while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer
+ buffer.push(getActiveBufferTemplate()[j++]);
+ }
+ }
+
+ return position;
+ }
+
+ function writeBuffer(input, buffer, caretPos) {
+ input._valueSet(buffer.join(''));
+ if (caretPos != undefined) {
+ caret(input, caretPos);
+ }
+ }
+
+ function clearBuffer(buffer, start, end, stripNomasks) {
+ for (var i = start, maskL = getMaskLength() ; i < end && i < maskL; i++) {
+ if (stripNomasks === true) {
+ if (!isMask(i))
+ setBufferElement(buffer, i, "");
+ } else
+ setBufferElement(buffer, i, getBufferElement(getActiveBufferTemplate().slice(), i, true));
+ }
+ }
+
+ function setReTargetPlaceHolder(buffer, pos) {
+ var testPos = determineTestPosition(pos);
+ setBufferElement(buffer, pos, getBufferElement(getActiveBufferTemplate(), testPos));
+ }
+
+ function getPlaceHolder(pos) {
+ return opts.placeholder.charAt(pos % opts.placeholder.length);
+ }
+
+ function checkVal(input, writeOut, strict, nptvl, intelliCheck) {
+ var inputValue = nptvl != undefined ? nptvl.slice() : truncateInput(input._valueGet()).split('');
+
+ $.each(masksets, function (ndx, ms) {
+ if (typeof (ms) == "object") {
+ ms["buffer"] = ms["_buffer"].slice();
+ ms["lastValidPosition"] = -1;
+ ms["p"] = -1;
+ }
+ });
+ if (strict !== true) activeMasksetIndex = 0;
+ if (writeOut) input._valueSet(""); //initial clear
+ var ml = getMaskLength();
+ $.each(inputValue, function (ndx, charCode) {
+ if (intelliCheck === true) {
+ var p = getActiveMaskSet()["p"], lvp = p == -1 ? p : seekPrevious(p),
+ pos = lvp == -1 ? ndx : seekNext(lvp);
+ if ($.inArray(charCode, getActiveBufferTemplate().slice(lvp + 1, pos)) == -1) {
+ keypressEvent.call(input, undefined, true, charCode.charCodeAt(0), writeOut, strict, ndx);
+ }
+ } else {
+ keypressEvent.call(input, undefined, true, charCode.charCodeAt(0), writeOut, strict, ndx);
+ }
+ });
+
+ if (strict === true && getActiveMaskSet()["p"] != -1) {
+ getActiveMaskSet()["lastValidPosition"] = seekPrevious(getActiveMaskSet()["p"]);
+ }
+ }
+
+ function escapeRegex(str) {
+ return $.inputmask.escapeRegex.call(this, str);
+ }
+
+ function truncateInput(inputValue) {
+ return inputValue.replace(new RegExp("(" + escapeRegex(getActiveBufferTemplate().join('')) + ")*$"), "");
+ }
+
+ function clearOptionalTail(input) {
+ var buffer = getActiveBuffer(), tmpBuffer = buffer.slice(), testPos, pos;
+ for (var pos = tmpBuffer.length - 1; pos >= 0; pos--) {
+ var testPos = determineTestPosition(pos);
+ if (getActiveTests()[testPos].optionality) {
+ if (!isMask(pos) || !isValid(pos, buffer[pos], true))
+ tmpBuffer.pop();
+ else break;
+ } else break;
+ }
+ writeBuffer(input, tmpBuffer);
+ }
+
+ function unmaskedvalue($input, skipDatepickerCheck) {
+ if (getActiveTests() && (skipDatepickerCheck === true || !$input.hasClass('hasDatepicker'))) {
+ //checkVal(input, false, true);
+ var umValue = $.map(getActiveBuffer(), function (element, index) {
+ return isMask(index) && isValid(index, element, true) ? element : null;
+ });
+ var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join('');
+ return opts.onUnMask != undefined ? opts.onUnMask.call(this, getActiveBuffer().join(''), unmaskedValue) : unmaskedValue;
+ } else {
+ return $input[0]._valueGet();
+ }
+ }
+
+ function TranslatePosition(pos) {
+ if (isRTL && typeof pos == 'number' && (!opts.greedy || opts.placeholder != "")) {
+ var bffrLght = getActiveBuffer().length;
+ pos = bffrLght - pos;
+ }
+ return pos;
+ }
+
+ function caret(input, begin, end) {
+ var npt = input.jquery && input.length > 0 ? input[0] : input, range;
+ if (typeof begin == 'number') {
+ begin = TranslatePosition(begin);
+ end = TranslatePosition(end);
+ if (!$(input).is(':visible')) {
+ return;
+ }
+ end = (typeof end == 'number') ? end : begin;
+ npt.scrollLeft = npt.scrollWidth;
+ if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
+ if (npt.setSelectionRange) {
+ npt.selectionStart = begin;
+ npt.selectionEnd = android ? begin : end;
+
+ } else if (npt.createTextRange) {
+ range = npt.createTextRange();
+ range.collapse(true);
+ range.moveEnd('character', end);
+ range.moveStart('character', begin);
+ range.select();
+ }
+ } else {
+ if (!$(input).is(':visible')) {
+ return { "begin": 0, "end": 0 };
+ }
+ if (npt.setSelectionRange) {
+ begin = npt.selectionStart;
+ end = npt.selectionEnd;
+ } else if (document.selection && document.selection.createRange) {
+ range = document.selection.createRange();
+ begin = 0 - range.duplicate().moveStart('character', -100000);
+ end = begin + range.text.length;
+ }
+ begin = TranslatePosition(begin);
+ end = TranslatePosition(end);
+ return { "begin": begin, "end": end };
+ }
+ }
+
+ function isComplete(buffer) { //return true / false / undefined (repeat *)
+ if (opts.repeat == "*") return undefined;
+ var complete = false, highestValidPosition = 0, currentActiveMasksetIndex = activeMasksetIndex;
+ $.each(masksets, function (ndx, ms) {
+ if (typeof (ms) == "object") {
+ activeMasksetIndex = ndx;
+ var aml = seekPrevious(getMaskLength());
+ if (ms["lastValidPosition"] >= highestValidPosition && ms["lastValidPosition"] == aml) {
+ var msComplete = true;
+ for (var i = 0; i <= aml; i++) {
+ var mask = isMask(i), testPos = determineTestPosition(i);
+ if ((mask && (buffer[i] == undefined || buffer[i] == getPlaceHolder(i))) || (!mask && buffer[i] != getActiveBufferTemplate()[testPos])) {
+ msComplete = false;
+ break;
+ }
+ }
+ complete = complete || msComplete;
+ if (complete) //break loop
+ return false;
+ }
+ highestValidPosition = ms["lastValidPosition"];
+ }
+ });
+ activeMasksetIndex = currentActiveMasksetIndex; //reset activeMaskset
+ return complete;
+ }
+
+ function isSelection(begin, end) {
+ return isRTL ? (begin - end) > 1 || ((begin - end) == 1 && opts.insertMode) :
+ (end - begin) > 1 || ((end - begin) == 1 && opts.insertMode);
+ }
+
+
+ //private functions
+ function installEventRuler(npt) {
+ var events = $._data(npt).events;
+
+ $.each(events, function (eventType, eventHandlers) {
+ $.each(eventHandlers, function (ndx, eventHandler) {
+ if (eventHandler.namespace == "inputmask") {
+ if (eventHandler.type != "setvalue") {
+ var handler = eventHandler.handler;
+ eventHandler.handler = function (e) {
+ if (this.readOnly || this.disabled)
+ e.preventDefault;
+ else
+ return handler.apply(this, arguments);
+ };
+ }
+ }
+ });
+ });
+ }
+
+ function patchValueProperty(npt) {
+ var valueProperty;
+ if (Object.getOwnPropertyDescriptor)
+ valueProperty = Object.getOwnPropertyDescriptor(npt, "value");
+ if (valueProperty && valueProperty.get) {
+ if (!npt._valueGet) {
+ var valueGet = valueProperty.get;
+ var valueSet = valueProperty.set;
+ npt._valueGet = function () {
+ return isRTL ? valueGet.call(this).split('').reverse().join('') : valueGet.call(this);
+ };
+ npt._valueSet = function (value) {
+ valueSet.call(this, isRTL ? value.split('').reverse().join('') : value);
+ };
+
+ Object.defineProperty(npt, "value", {
+ get: function () {
+ var $self = $(this), inputData = $(this).data('_inputmask'), masksets = inputData['masksets'],
+ activeMasksetIndex = inputData['activeMasksetIndex'];
+ return inputData && inputData['opts'].autoUnmask ? $self.inputmask('unmaskedvalue') : valueGet.call(this) != masksets[activeMasksetIndex]['_buffer'].join('') ? valueGet.call(this) : '';
+ },
+ set: function (value) {
+ valueSet.call(this, value);
+ $(this).triggerHandler('setvalue.inputmask');
+ }
+ });
+ }
+ } else if (document.__lookupGetter__ && npt.__lookupGetter__("value")) {
+ if (!npt._valueGet) {
+ var valueGet = npt.__lookupGetter__("value");
+ var valueSet = npt.__lookupSetter__("value");
+ npt._valueGet = function () {
+ return isRTL ? valueGet.call(this).split('').reverse().join('') : valueGet.call(this);
+ };
+ npt._valueSet = function (value) {
+ valueSet.call(this, isRTL ? value.split('').reverse().join('') : value);
+ };
+
+ npt.__defineGetter__("value", function () {
+ var $self = $(this), inputData = $(this).data('_inputmask'), masksets = inputData['masksets'],
+ activeMasksetIndex = inputData['activeMasksetIndex'];
+ return inputData && inputData['opts'].autoUnmask ? $self.inputmask('unmaskedvalue') : valueGet.call(this) != masksets[activeMasksetIndex]['_buffer'].join('') ? valueGet.call(this) : '';
+ });
+ npt.__defineSetter__("value", function (value) {
+ valueSet.call(this, value);
+ $(this).triggerHandler('setvalue.inputmask');
+ });
+ }
+ } else {
+ if (!npt._valueGet) {
+ npt._valueGet = function () { return isRTL ? this.value.split('').reverse().join('') : this.value; };
+ npt._valueSet = function (value) { this.value = isRTL ? value.split('').reverse().join('') : value; };
+ }
+ if ($.valHooks.text == undefined || $.valHooks.text.inputmaskpatch != true) {
+ var valueGet = $.valHooks.text && $.valHooks.text.get ? $.valHooks.text.get : function (elem) { return elem.value; };
+ var valueSet = $.valHooks.text && $.valHooks.text.set ? $.valHooks.text.set : function (elem, value) {
+ elem.value = value;
+ return elem;
+ };
+
+ jQuery.extend($.valHooks, {
+ text: {
+ get: function (elem) {
+ var $elem = $(elem);
+ if ($elem.data('_inputmask')) {
+ if ($elem.data('_inputmask')['opts'].autoUnmask)
+ return $elem.inputmask('unmaskedvalue');
+ else {
+ var result = valueGet(elem),
+ inputData = $elem.data('_inputmask'), masksets = inputData['masksets'],
+ activeMasksetIndex = inputData['activeMasksetIndex'];
+ return result != masksets[activeMasksetIndex]['_buffer'].join('') ? result : '';
+ }
+ } else return valueGet(elem);
+ },
+ set: function (elem, value) {
+ var $elem = $(elem);
+ var result = valueSet(elem, value);
+ if ($elem.data('_inputmask')) $elem.triggerHandler('setvalue.inputmask');
+ return result;
+ },
+ inputmaskpatch: true
+ }
+ });
+ }
+ }
+ }
+
+ //shift chars to left from start to end and put c at end position if defined
+
+ function shiftL(start, end, c, maskJumps) {
+ var buffer = getActiveBuffer();
+ if (maskJumps !== false) //jumping over nonmask position
+ while (!isMask(start) && start - 1 >= 0) start--;
+ for (var i = start; i < end && i < getMaskLength() ; i++) {
+ if (isMask(i)) {
+ setReTargetPlaceHolder(buffer, i);
+ var j = seekNext(i);
+ var p = getBufferElement(buffer, j);
+ if (p != getPlaceHolder(j)) {
+ if (j < getMaskLength() && isValid(i, p, true) !== false && getActiveTests()[determineTestPosition(i)].def == getActiveTests()[determineTestPosition(j)].def) {
+ setBufferElement(buffer, i, p, true);
+ } else {
+ if (isMask(i))
+ break;
+ }
+ }
+ } else {
+ setReTargetPlaceHolder(buffer, i);
+ }
+ }
+ if (c != undefined)
+ setBufferElement(buffer, seekPrevious(end), c);
+
+ if (getActiveMaskSet()["greedy"] == false) {
+ var trbuffer = truncateInput(buffer.join('')).split('');
+ buffer.length = trbuffer.length;
+ for (var i = 0, bl = buffer.length; i < bl; i++) {
+ buffer[i] = trbuffer[i];
+ }
+ if (buffer.length == 0) getActiveMaskSet()["buffer"] = getActiveBufferTemplate().slice();
+ }
+ return start; //return the used start position
+ }
+
+ function shiftR(start, end, c) {
+ var buffer = getActiveBuffer();
+ if (getBufferElement(buffer, start, true) != getPlaceHolder(start)) {
+ for (var i = seekPrevious(end) ; i > start && i >= 0; i--) {
+ if (isMask(i)) {
+ var j = seekPrevious(i);
+ var t = getBufferElement(buffer, j);
+ if (t != getPlaceHolder(j)) {
+ if (isValid(j, t, true) !== false && getActiveTests()[determineTestPosition(i)].def == getActiveTests()[determineTestPosition(j)].def) {
+ setBufferElement(buffer, i, t, true);
+ setReTargetPlaceHolder(buffer, j);
+ } //else break;
+ }
+ } else
+ setReTargetPlaceHolder(buffer, i);
+ }
+ }
+ if (c != undefined && getBufferElement(buffer, start) == getPlaceHolder(start))
+ setBufferElement(buffer, start, c);
+ var lengthBefore = buffer.length;
+ if (getActiveMaskSet()["greedy"] == false) {
+ var trbuffer = truncateInput(buffer.join('')).split('');
+ buffer.length = trbuffer.length;
+ for (var i = 0, bl = buffer.length; i < bl; i++) {
+ buffer[i] = trbuffer[i];
+ }
+ if (buffer.length == 0) getActiveMaskSet()["buffer"] = getActiveBufferTemplate().slice();
+ }
+ return end - (lengthBefore - buffer.length); //return new start position
+ }
+
+ function HandleRemove(input, k, pos) {
+ if (opts.numericInput || isRTL) {
+ switch (k) {
+ case opts.keyCode.BACKSPACE:
+ k = opts.keyCode.DELETE;
+ break;
+ case opts.keyCode.DELETE:
+ k = opts.keyCode.BACKSPACE;
+ break;
+ }
+ if (isRTL) {
+ var pend = pos.end;
+ pos.end = pos.begin;
+ pos.begin = pend;
+ }
+ }
+
+ var isSelection = true;
+ if (pos.begin == pos.end) {
+ var posBegin = k == opts.keyCode.BACKSPACE ? pos.begin - 1 : pos.begin;
+ if (opts.isNumeric && opts.radixPoint != "" && getActiveBuffer()[posBegin] == opts.radixPoint) {
+ pos.begin = (getActiveBuffer().length - 1 == posBegin) /* radixPoint is latest? delete it */ ? pos.begin : k == opts.keyCode.BACKSPACE ? posBegin : seekNext(posBegin);
+ pos.end = pos.begin;
+ }
+ isSelection = false;
+ if (k == opts.keyCode.BACKSPACE)
+ pos.begin--;
+ else if (k == opts.keyCode.DELETE)
+ pos.end++;
+ } else if (pos.end - pos.begin == 1 && !opts.insertMode) {
+ isSelection = false;
+ if (k == opts.keyCode.BACKSPACE)
+ pos.begin--;
+ }
+
+ clearBuffer(getActiveBuffer(), pos.begin, pos.end);
+
+ var ml = getMaskLength();
+ if (opts.greedy == false) {
+ shiftL(pos.begin, ml, undefined, !isRTL && (k == opts.keyCode.BACKSPACE && !isSelection));
+ } else {
+ var newpos = pos.begin;
+ for (var i = pos.begin; i < pos.end; i++) { //seeknext to skip placeholders at start in selection
+ if (isMask(i) || !isSelection)
+ newpos = shiftL(pos.begin, ml, undefined, !isRTL && (k == opts.keyCode.BACKSPACE && !isSelection));
+ }
+ if (!isSelection) pos.begin = newpos;
+ }
+ var firstMaskPos = seekNext(-1);
+ clearBuffer(getActiveBuffer(), pos.begin, pos.end, true);
+ checkVal(input, false, masksets[1] == undefined || firstMaskPos >= pos.end, getActiveBuffer());
+ if (getActiveMaskSet()['lastValidPosition'] < firstMaskPos) {
+ getActiveMaskSet()["lastValidPosition"] = -1;
+ getActiveMaskSet()["p"] = firstMaskPos;
+ } else {
+ getActiveMaskSet()["p"] = pos.begin;
+ }
+ }
+
+ function keydownEvent(e) {
+ //Safari 5.1.x - modal dialog fires keypress twice workaround
+ skipKeyPressEvent = false;
+ var input = this, $input = $(input), k = e.keyCode, pos = caret(input);
+
+ //backspace, delete, and escape get special treatment
+ if (k == opts.keyCode.BACKSPACE || k == opts.keyCode.DELETE || (iphone && k == 127) || e.ctrlKey && k == 88) { //backspace/delete
+ e.preventDefault(); //stop default action but allow propagation
+ if (k == 88) valueOnFocus = getActiveBuffer().join('');
+ HandleRemove(input, k, pos);
+ determineActiveMasksetIndex();
+ writeBuffer(input, getActiveBuffer(), getActiveMaskSet()["p"]);
+ if (input._valueGet() == getActiveBufferTemplate().join(''))
+ $input.trigger('cleared');
+
+ if (opts.showTooltip) { //update tooltip
+ $input.prop("title", getActiveMaskSet()["mask"]);
+ }
+ } else if (k == opts.keyCode.END || k == opts.keyCode.PAGE_DOWN) { //when END or PAGE_DOWN pressed set position at lastmatch
+ setTimeout(function () {
+ var caretPos = seekNext(getActiveMaskSet()["lastValidPosition"]);
+ if (!opts.insertMode && caretPos == getMaskLength() && !e.shiftKey) caretPos--;
+ caret(input, e.shiftKey ? pos.begin : caretPos, caretPos);
+ }, 0);
+ } else if ((k == opts.keyCode.HOME && !e.shiftKey) || k == opts.keyCode.PAGE_UP) { //Home or page_up
+ caret(input, 0, e.shiftKey ? pos.begin : 0);
+ } else if (k == opts.keyCode.ESCAPE || (k == 90 && e.ctrlKey)) { //escape && undo
+ checkVal(input, true, false, valueOnFocus.split(''));
+ $input.click();
+ } else if (k == opts.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) { //insert
+ opts.insertMode = !opts.insertMode;
+ caret(input, !opts.insertMode && pos.begin == getMaskLength() ? pos.begin - 1 : pos.begin);
+ } else if (opts.insertMode == false && !e.shiftKey) {
+ if (k == opts.keyCode.RIGHT) {
+ setTimeout(function () {
+ var caretPos = caret(input);
+ caret(input, caretPos.begin);
+ }, 0);
+ } else if (k == opts.keyCode.LEFT) {
+ setTimeout(function () {
+ var caretPos = caret(input);
+ caret(input, caretPos.begin - 1);
+ }, 0);
+ }
+ }
+
+ var currentCaretPos = caret(input);
+ if (opts.onKeyDown.call(this, e, getActiveBuffer(), opts) === true) //extra stuff to execute on keydown
+ caret(input, currentCaretPos.begin, currentCaretPos.end);
+ ignorable = $.inArray(k, opts.ignorables) != -1;
+ }
+
+
+ function keypressEvent(e, checkval, k, writeOut, strict, ndx) {
+ //Safari 5.1.x - modal dialog fires keypress twice workaround
+ if (k == undefined && skipKeyPressEvent) return false;
+ skipKeyPressEvent = true;
+
+ var input = this, $input = $(input);
+
+ e = e || window.event;
+ var k = checkval ? k : (e.which || e.charCode || e.keyCode);
+
+ if (checkval !== true && (!(e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable))) {
+ return true;
+ } else {
+ if (k) {
+ //special treat the decimal separator
+ if (checkval !== true && k == 46 && e.shiftKey == false && opts.radixPoint == ",") k = 44;
+
+ var pos, results, result, c = String.fromCharCode(k);
+ if (checkval) {
+ var pcaret = strict ? ndx : getActiveMaskSet()["lastValidPosition"] + 1;
+ pos = { begin: pcaret, end: pcaret };
+ } else {
+ pos = caret(input);
+ }
+
+ //should we clear a possible selection??
+ var isSlctn = isSelection(pos.begin, pos.end), redetermineLVP = false,
+ initialIndex = activeMasksetIndex;
+ if (isSlctn) {
+ activeMasksetIndex = initialIndex;
+ $.each(masksets, function (ndx, lmnt) { //init undobuffer for recovery when not valid
+ if (typeof (lmnt) == "object") {
+ activeMasksetIndex = ndx;
+ getActiveMaskSet()["undoBuffer"] = getActiveBuffer().join('');
+ }
+ });
+ HandleRemove(input, opts.keyCode.DELETE, pos);
+ if (!opts.insertMode) { //preserve some space
+ $.each(masksets, function (ndx, lmnt) {
+ if (typeof (lmnt) == "object") {
+ activeMasksetIndex = ndx;
+ shiftR(pos.begin, getMaskLength());
+ getActiveMaskSet()["lastValidPosition"] = seekNext(getActiveMaskSet()["lastValidPosition"]);
+ }
+ });
+ }
+ activeMasksetIndex = initialIndex; //restore index
+ }
+
+ var radixPosition = getActiveBuffer().join('').indexOf(opts.radixPoint);
+ if (opts.isNumeric && checkval !== true && radixPosition != -1) {
+ if (opts.greedy && pos.begin <= radixPosition) {
+ pos.begin = seekPrevious(pos.begin);
+ pos.end = pos.begin;
+ } else if (c == opts.radixPoint) {
+ pos.begin = radixPosition;
+ pos.end = pos.begin;
+ }
+ }
+
+
+ var p = pos.begin;
+ results = isValid(p, c, strict);
+ if (strict === true) results = [{ "activeMasksetIndex": activeMasksetIndex, "result": results }];
+ var minimalForwardPosition = -1;
+ $.each(results, function (index, result) {
+ activeMasksetIndex = result["activeMasksetIndex"];
+ getActiveMaskSet()["writeOutBuffer"] = true;
+ var np = result["result"];
+ if (np !== false) {
+ var refresh = false, buffer = getActiveBuffer();
+ if (np !== true) {
+ refresh = np["refresh"]; //only rewrite buffer from isValid
+ p = np.pos != undefined ? np.pos : p; //set new position from isValid
+ c = np.c != undefined ? np.c : c; //set new char from isValid
+ }
+ if (refresh !== true) {
+ if (opts.insertMode == true) {
+ var lastUnmaskedPosition = getMaskLength();
+ var bfrClone = buffer.slice();
+ while (getBufferElement(bfrClone, lastUnmaskedPosition, true) != getPlaceHolder(lastUnmaskedPosition) && lastUnmaskedPosition >= p) {
+ lastUnmaskedPosition = lastUnmaskedPosition == 0 ? -1 : seekPrevious(lastUnmaskedPosition);
+ }
+ if (lastUnmaskedPosition >= p) {
+ shiftR(p, getMaskLength(), c);
+ //shift the lvp if needed
+ var lvp = getActiveMaskSet()["lastValidPosition"], nlvp = seekNext(lvp);
+ if (nlvp != getMaskLength() && lvp >= p && (getBufferElement(getActiveBuffer(), nlvp, true) != getPlaceHolder(nlvp))) {
+ getActiveMaskSet()["lastValidPosition"] = nlvp;
+ }
+ } else getActiveMaskSet()["writeOutBuffer"] = false;
+ } else setBufferElement(buffer, p, c, true);
+ if (minimalForwardPosition == -1 || minimalForwardPosition > seekNext(p)) {
+ minimalForwardPosition = seekNext(p);
+ }
+ } else if (!strict) {
+ var nextPos = p < getMaskLength() ? p + 1 : p;
+ if (minimalForwardPosition == -1 || minimalForwardPosition > nextPos) {
+ minimalForwardPosition = nextPos;
+ }
+ }
+ if (minimalForwardPosition > getActiveMaskSet()["p"])
+ getActiveMaskSet()["p"] = minimalForwardPosition; //needed for checkval strict
+ }
+ });
+
+ if (strict !== true) {
+ activeMasksetIndex = initialIndex;
+ determineActiveMasksetIndex();
+ }
+ if (writeOut !== false) {
+ $.each(results, function (ndx, rslt) {
+ if (rslt["activeMasksetIndex"] == activeMasksetIndex) {
+ result = rslt;
+ return false;
+ }
+ });
+ if (result != undefined) {
+ var self = this;
+ setTimeout(function () { opts.onKeyValidation.call(self, result["result"], opts); }, 0);
+ if (getActiveMaskSet()["writeOutBuffer"] && result["result"] !== false) {
+ var buffer = getActiveBuffer();
+
+ var newCaretPosition;
+ if (checkval) {
+ newCaretPosition = undefined;
+ } else if (opts.numericInput) {
+ if (p > radixPosition) {
+ newCaretPosition = seekPrevious(minimalForwardPosition);
+ } else if (c == opts.radixPoint) {
+ newCaretPosition = minimalForwardPosition - 1;
+ } else newCaretPosition = seekPrevious(minimalForwardPosition - 1);
+ } else {
+ newCaretPosition = minimalForwardPosition;
+ }
+
+ writeBuffer(input, buffer, newCaretPosition);
+ if (checkval !== true) {
+ setTimeout(function () { //timeout needed for IE
+ if (isComplete(buffer) === true)
+ $input.trigger("complete");
+ skipInputEvent = true;
+ $input.trigger("input");
+ }, 0);
+ }
+ } else if (isSlctn) {
+ getActiveMaskSet()["buffer"] = getActiveMaskSet()["undoBuffer"].split('');
+ }
+ }
+ }
+
+ if (opts.showTooltip) { //update tooltip
+ $input.prop("title", getActiveMaskSet()["mask"]);
+ }
+
+ //needed for IE8 and below
+ if (e) e.preventDefault ? e.preventDefault() : e.returnValue = false;
+ }
+ }
+ }
+
+ function keyupEvent(e) {
+ var $input = $(this), input = this, k = e.keyCode, buffer = getActiveBuffer();
+
+ if (androidchrome && k == opts.keyCode.BACKSPACE) {
+ if (chromeValueOnInput == input._valueGet())
+ keydownEvent.call(this, e);
+ }
+
+ opts.onKeyUp.call(this, e, buffer, opts); //extra stuff to execute on keyup
+ if (k == opts.keyCode.TAB && opts.showMaskOnFocus) {
+ if ($input.hasClass('focus.inputmask') && input._valueGet().length == 0) {
+ buffer = getActiveBufferTemplate().slice();
+ writeBuffer(input, buffer);
+ caret(input, 0);
+ valueOnFocus = getActiveBuffer().join('');
+ } else {
+ writeBuffer(input, buffer);
+ if (buffer.join('') == getActiveBufferTemplate().join('') && $.inArray(opts.radixPoint, buffer) != -1) {
+ caret(input, TranslatePosition(0));
+ $input.click();
+ } else
+ caret(input, TranslatePosition(0), TranslatePosition(getMaskLength()));
+ }
+ }
+ }
+
+ function inputEvent(e) {
+ if (skipInputEvent === true) {
+ skipInputEvent = false;
+ return true;
+ }
+ var input = this, $input = $(input);
+
+ chromeValueOnInput = getActiveBuffer().join('');
+ checkVal(input, false, false);
+ writeBuffer(input, getActiveBuffer());
+ if (isComplete(getActiveBuffer()) === true)
+ $input.trigger("complete");
+ $input.click();
+ }
+
+ function mask(el) {
+ $el = $(el);
+ if ($el.is(":input")) {
+ //store tests & original buffer in the input element - used to get the unmasked value
+ $el.data('_inputmask', {
+ 'masksets': masksets,
+ 'activeMasksetIndex': activeMasksetIndex,
+ 'opts': opts,
+ 'isRTL': false
+ });
+
+ //show tooltip
+ if (opts.showTooltip) {
+ $el.prop("title", getActiveMaskSet()["mask"]);
+ }
+
+ //correct greedy setting if needed
+ getActiveMaskSet()['greedy'] = getActiveMaskSet()['greedy'] ? getActiveMaskSet()['greedy'] : getActiveMaskSet()['repeat'] == 0;
+
+ //handle maxlength attribute
+ if ($el.attr("maxLength") != null) //only when the attribute is set
+ {
+ var maxLength = $el.prop('maxLength');
+ if (maxLength > -1) { //handle *-repeat
+ $.each(masksets, function (ndx, ms) {
+ if (typeof (ms) == "object") {
+ if (ms["repeat"] == "*") {
+ ms["repeat"] = maxLength;
+ }
+ }
+ });
+ }
+ if (getMaskLength() >= maxLength && maxLength > -1) { //FF sets no defined max length to -1
+ if (maxLength < getActiveBufferTemplate().length) getActiveBufferTemplate().length = maxLength;
+ if (getActiveMaskSet()['greedy'] == false) {
+ getActiveMaskSet()['repeat'] = Math.round(maxLength / getActiveBufferTemplate().length);
+ }
+ $el.prop('maxLength', getMaskLength() * 2);
+ }
+ }
+
+ patchValueProperty(el);
+
+ if (opts.numericInput) opts.isNumeric = opts.numericInput;
+ if (el.dir == "rtl" || (opts.numericInput && opts.rightAlignNumerics) || (opts.isNumeric && opts.rightAlignNumerics))
+ $el.css("text-align", "right");
+
+ if (el.dir == "rtl" || opts.numericInput) {
+ el.dir = "ltr";
+ $el.removeAttr("dir");
+ var inputData = $el.data('_inputmask');
+ inputData['isRTL'] = true;
+ $el.data('_inputmask', inputData);
+ isRTL = true;
+ }
+
+ //unbind all events - to make sure that no other mask will interfere when re-masking
+ $el.unbind(".inputmask");
+ $el.removeClass('focus.inputmask');
+ //bind events
+ $el.closest('form').bind("submit", function () { //trigger change on submit if any
+ if (valueOnFocus != getActiveBuffer().join('')) {
+ $el.change();
+ }
+ }).bind('reset', function () {
+ setTimeout(function () {
+ $el.trigger("setvalue");
+ }, 0);
+ });
+ $el.bind("mouseenter.inputmask", function () {
+ var $input = $(this), input = this;
+ if (!$input.hasClass('focus.inputmask') && opts.showMaskOnHover) {
+ if (input._valueGet() != getActiveBuffer().join('')) {
+ writeBuffer(input, getActiveBuffer());
+ }
+ }
+ }).bind("blur.inputmask", function () {
+ var $input = $(this), input = this, nptValue = input._valueGet(), buffer = getActiveBuffer();
+ $input.removeClass('focus.inputmask');
+ if (valueOnFocus != getActiveBuffer().join('')) {
+ $input.change();
+ }
+ if (opts.clearMaskOnLostFocus && nptValue != '') {
+ if (nptValue == getActiveBufferTemplate().join(''))
+ input._valueSet('');
+ else { //clearout optional tail of the mask
+ clearOptionalTail(input);
+ }
+ }
+ if (isComplete(buffer) === false) {
+ $input.trigger("incomplete");
+ if (opts.clearIncomplete) {
+ $.each(masksets, function (ndx, ms) {
+ if (typeof (ms) == "object") {
+ ms["buffer"] = ms["_buffer"].slice();
+ ms["lastValidPosition"] = -1;
+ }
+ });
+ activeMasksetIndex = 0;
+ if (opts.clearMaskOnLostFocus)
+ input._valueSet('');
+ else {
+ buffer = getActiveBufferTemplate().slice();
+ writeBuffer(input, buffer);
+ }
+ }
+ }
+ }).bind("focus.inputmask", function () {
+ var $input = $(this), input = this, nptValue = input._valueGet();
+ if (opts.showMaskOnFocus && !$input.hasClass('focus.inputmask') && (!opts.showMaskOnHover || (opts.showMaskOnHover && nptValue == ''))) {
+ if (input._valueGet() != getActiveBuffer().join('')) {
+ writeBuffer(input, getActiveBuffer(), seekNext(getActiveMaskSet()["lastValidPosition"]));
+ }
+ }
+ $input.addClass('focus.inputmask');
+ valueOnFocus = getActiveBuffer().join('');
+ }).bind("mouseleave.inputmask", function () {
+ var $input = $(this), input = this;
+ if (opts.clearMaskOnLostFocus) {
+ if (!$input.hasClass('focus.inputmask') && input._valueGet() != $input.attr("placeholder")) {
+ if (input._valueGet() == getActiveBufferTemplate().join('') || input._valueGet() == '')
+ input._valueSet('');
+ else { //clearout optional tail of the mask
+ clearOptionalTail(input);
+ }
+ }
+ }
+ }).bind("click.inputmask", function () {
+ var input = this;
+ setTimeout(function () {
+ var selectedCaret = caret(input), buffer = getActiveBuffer();
+ if (selectedCaret.begin == selectedCaret.end) {
+ var clickPosition = isRTL ? TranslatePosition(selectedCaret.begin) : selectedCaret.begin,
+ lvp = getActiveMaskSet()["lastValidPosition"],
+ lastPosition;
+ if (opts.isNumeric) {
+ lastPosition = opts.skipRadixDance === false && opts.radixPoint != "" && $.inArray(opts.radixPoint, buffer) != -1 ?
+ (opts.numericInput ? seekNext($.inArray(opts.radixPoint, buffer)) : $.inArray(opts.radixPoint, buffer)) :
+ seekNext(lvp);
+ } else {
+ lastPosition = seekNext(lvp);
+ }
+ if (clickPosition < lastPosition) {
+ if (isMask(clickPosition))
+ caret(input, clickPosition);
+ else caret(input, seekNext(clickPosition));
+ } else
+ caret(input, lastPosition);
+ }
+ }, 0);
+ }).bind('dblclick.inputmask', function () {
+ var input = this;
+ setTimeout(function () {
+ caret(input, 0, seekNext(getActiveMaskSet()["lastValidPosition"]));
+ }, 0);
+ }).bind(pasteEvent + ".inputmask dragdrop.inputmask drop.inputmask", function (e) {
+ if (skipInputEvent === true) {
+ skipInputEvent = false;
+ return true;
+ }
+ var input = this, $input = $(input);
+
+ //paste event for IE8 and lower I guess ;-)
+ if (e.type == "propertychange" && input._valueGet().length <= getMaskLength()) {
+ return true;
+ }
+ setTimeout(function () {
+ var pasteValue = opts.onBeforePaste != undefined ? opts.onBeforePaste.call(this, input._valueGet()) : input._valueGet();
+ checkVal(input, true, false, pasteValue.split(''), true);
+ if (isComplete(getActiveBuffer()) === true)
+ $input.trigger("complete");
+ $input.click();
+ }, 0);
+ }).bind('setvalue.inputmask', function () {
+ var input = this;
+ checkVal(input, true);
+ valueOnFocus = getActiveBuffer().join('');
+ if (input._valueGet() == getActiveBufferTemplate().join(''))
+ input._valueSet('');
+ }).bind('complete.inputmask', opts.oncomplete
+ ).bind('incomplete.inputmask', opts.onincomplete
+ ).bind('cleared.inputmask', opts.oncleared
+ ).bind("keyup.inputmask", keyupEvent);
+
+ if (androidchrome) {
+ $el.bind("input.inputmask", inputEvent);
+ } else {
+ $el.bind("keydown.inputmask", keydownEvent
+ ).bind("keypress.inputmask", keypressEvent);
+ }
+
+ if (msie10)
+ $el.bind("input.inputmask", inputEvent);
+
+ //apply mask
+ checkVal(el, true, false);
+ valueOnFocus = getActiveBuffer().join('');
+ // Wrap document.activeElement in a try/catch block since IE9 throw "Unspecified error" if document.activeElement is undefined when we are in an IFrame.
+ var activeElement;
+ try {
+ activeElement = document.activeElement;
+ } catch (e) {
+ }
+ if (activeElement === el) { //position the caret when in focus
+ $el.addClass('focus.inputmask');
+ caret(el, seekNext(getActiveMaskSet()["lastValidPosition"]));
+ } else if (opts.clearMaskOnLostFocus) {
+ if (getActiveBuffer().join('') == getActiveBufferTemplate().join('')) {
+ el._valueSet('');
+ } else {
+ clearOptionalTail(el);
+ }
+ } else {
+ writeBuffer(el, getActiveBuffer());
+ }
+
+ installEventRuler(el);
+ }
+ }
+
+ //action object
+ if (actionObj != undefined) {
+ switch (actionObj["action"]) {
+ case "isComplete":
+ return isComplete(actionObj["buffer"]);
+ case "unmaskedvalue":
+ isRTL = actionObj["$input"].data('_inputmask')['isRTL'];
+ return unmaskedvalue(actionObj["$input"], actionObj["skipDatepickerCheck"]);
+ case "mask":
+ mask(actionObj["el"]);
+ break;
+ case "format":
+ $el = $({});
+ $el.data('_inputmask', {
+ 'masksets': masksets,
+ 'activeMasksetIndex': activeMasksetIndex,
+ 'opts': opts,
+ 'isRTL': opts.numericInput
+ });
+ if (opts.numericInput) {
+ opts.isNumeric = opts.numericInput;
+ isRTL = true;
+ }
+
+ checkVal($el, false, false, actionObj["value"].split(''), true);
+ return getActiveBuffer().join('');
+ }
+ }
+ }
+ $.inputmask = {
+ //options default
+ defaults: {
+ placeholder: "_",
+ optionalmarker: { start: "[", end: "]" },
+ quantifiermarker: { start: "{", end: "}" },
+ groupmarker: { start: "(", end: ")" },
+ escapeChar: "\\",
+ mask: null,
+ oncomplete: $.noop, //executes when the mask is complete
+ onincomplete: $.noop, //executes when the mask is incomplete and focus is lost
+ oncleared: $.noop, //executes when the mask is cleared
+ repeat: 0, //repetitions of the mask: * ~ forever, otherwise specify an integer
+ greedy: true, //true: allocated buffer for the mask and repetitions - false: allocate only if needed
+ autoUnmask: false, //automatically unmask when retrieving the value with $.fn.val or value if the browser supports __lookupGetter__ or getOwnPropertyDescriptor
+ clearMaskOnLostFocus: true,
+ insertMode: true, //insert the input or overwrite the input
+ clearIncomplete: false, //clear the incomplete input on blur
+ aliases: {}, //aliases definitions => see jquery.inputmask.extensions.js
+ onKeyUp: $.noop, //override to implement autocomplete on certain keys for example
+ onKeyDown: $.noop, //override to implement autocomplete on certain keys for example
+ onBeforePaste: undefined, //executes before masking the pasted value to allow preprocessing of the pasted value. args => pastedValue => return processedValue
+ onUnMask: undefined, //executes after unmasking to allow postprocessing of the unmaskedvalue. args => maskedValue, unmaskedValue
+ showMaskOnFocus: true, //show the mask-placeholder when the input has focus
+ showMaskOnHover: true, //show the mask-placeholder when hovering the empty input
+ onKeyValidation: $.noop, //executes on every key-press with the result of isValid. Params: result, opts
+ skipOptionalPartCharacter: " ", //a character which can be used to skip an optional part of a mask
+ showTooltip: false, //show the activemask as tooltip
+ numericInput: false, //numericInput input direction style (input shifts to the left while holding the caret position)
+ //numeric basic properties
+ isNumeric: false, //enable numeric features
+ radixPoint: "", //".", // | ","
+ skipRadixDance: false, //disable radixpoint caret positioning
+ rightAlignNumerics: true, //align numerics to the right
+ //numeric basic properties
+ definitions: {
+ '9': {
+ validator: "[0-9]",
+ cardinality: 1
+ },
+ 'a': {
+ validator: "[A-Za-z\u0410-\u044F\u0401\u0451]",
+ cardinality: 1
+ },
+ '*': {
+ validator: "[A-Za-z\u0410-\u044F\u0401\u04510-9]",
+ cardinality: 1
+ }
+ },
+ keyCode: {
+ ALT: 18, BACKSPACE: 8, CAPS_LOCK: 20, COMMA: 188, COMMAND: 91, COMMAND_LEFT: 91, COMMAND_RIGHT: 93, CONTROL: 17, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, INSERT: 45, LEFT: 37, MENU: 93, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SHIFT: 16, SPACE: 32, TAB: 9, UP: 38, WINDOWS: 91
+ },
+ //specify keycodes which should not be considered in the keypress event, otherwise the preventDefault will stop their default behavior especially in FF
+ ignorables: [8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123],
+ getMaskLength: function (buffer, greedy, repeat, currentBuffer, opts) {
+ var calculatedLength = buffer.length;
+ if (!greedy) {
+ if (repeat == "*") {
+ calculatedLength = currentBuffer.length + 1;
+ } else if (repeat > 1) {
+ calculatedLength += (buffer.length * (repeat - 1));
+ }
+ }
+ return calculatedLength;
+ }
+ },
+ escapeRegex: function (str) {
+ var specials = ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'];
+ return str.replace(new RegExp('(\\' + specials.join('|\\') + ')', 'gim'), '\\$1');
+ },
+ format: function (value, options) {
+ var opts = $.extend(true, {}, $.inputmask.defaults, options);
+ resolveAlias(opts.alias, options, opts);
+ return maskScope(generateMaskSets(opts), 0, opts, { "action": "format", "value": value });
+ }
+ };
+
+ $.fn.inputmask = function (fn, options) {
+ var opts = $.extend(true, {}, $.inputmask.defaults, options),
+ masksets,
+ activeMasksetIndex = 0;
+
+ if (typeof fn === "string") {
+ switch (fn) {
+ case "mask":
+ //resolve possible aliases given by options
+ resolveAlias(opts.alias, options, opts);
+ masksets = generateMaskSets(opts);
+ if (masksets.length == 0) { return this; }
+
+ return this.each(function () {
+ maskScope($.extend(true, {}, masksets), 0, opts, { "action": "mask", "el": this });
+ });
+ case "unmaskedvalue":
+ var $input = $(this), input = this;
+ if ($input.data('_inputmask')) {
+ masksets = $input.data('_inputmask')['masksets'];
+ activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex'];
+ opts = $input.data('_inputmask')['opts'];
+ return maskScope(masksets, activeMasksetIndex, opts, { "action": "unmaskedvalue", "$input": $input });
+ } else return $input.val();
+ case "remove":
+ return this.each(function () {
+ var $input = $(this), input = this;
+ if ($input.data('_inputmask')) {
+ masksets = $input.data('_inputmask')['masksets'];
+ activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex'];
+ opts = $input.data('_inputmask')['opts'];
+ //writeout the unmaskedvalue
+ input._valueSet(maskScope(masksets, activeMasksetIndex, opts, { "action": "unmaskedvalue", "$input": $input, "skipDatepickerCheck": true }));
+ //clear data
+ $input.removeData('_inputmask');
+ //unbind all events
+ $input.unbind(".inputmask");
+ $input.removeClass('focus.inputmask');
+ //restore the value property
+ var valueProperty;
+ if (Object.getOwnPropertyDescriptor)
+ valueProperty = Object.getOwnPropertyDescriptor(input, "value");
+ if (valueProperty && valueProperty.get) {
+ if (input._valueGet) {
+ Object.defineProperty(input, "value", {
+ get: input._valueGet,
+ set: input._valueSet
+ });
+ }
+ } else if (document.__lookupGetter__ && input.__lookupGetter__("value")) {
+ if (input._valueGet) {
+ input.__defineGetter__("value", input._valueGet);
+ input.__defineSetter__("value", input._valueSet);
+ }
+ }
+ try { //try catch needed for IE7 as it does not supports deleting fns
+ delete input._valueGet;
+ delete input._valueSet;
+ } catch (e) {
+ input._valueGet = undefined;
+ input._valueSet = undefined;
+
+ }
+ }
+ });
+ break;
+ case "getemptymask": //return the default (empty) mask value, usefull for setting the default value in validation
+ if (this.data('_inputmask')) {
+ masksets = this.data('_inputmask')['masksets'];
+ activeMasksetIndex = this.data('_inputmask')['activeMasksetIndex'];
+ return masksets[activeMasksetIndex]['_buffer'].join('');
+ }
+ else return "";
+ case "hasMaskedValue": //check wheter the returned value is masked or not; currently only works reliable when using jquery.val fn to retrieve the value
+ return this.data('_inputmask') ? !this.data('_inputmask')['opts'].autoUnmask : false;
+ case "isComplete":
+ masksets = this.data('_inputmask')['masksets'];
+ activeMasksetIndex = this.data('_inputmask')['activeMasksetIndex'];
+ opts = this.data('_inputmask')['opts'];
+ return maskScope(masksets, activeMasksetIndex, opts, { "action": "isComplete", "buffer": this[0]._valueGet().split('') });
+ case "getmetadata": //return mask metadata if exists
+ if (this.data('_inputmask')) {
+ masksets = this.data('_inputmask')['masksets'];
+ activeMasksetIndex = this.data('_inputmask')['activeMasksetIndex'];
+ return masksets[activeMasksetIndex]['metadata'];
+ }
+ else return undefined;
+ default:
+ //check if the fn is an alias
+ if (!resolveAlias(fn, options, opts)) {
+ //maybe fn is a mask so we try
+ //set mask
+ opts.mask = fn;
+ }
+ masksets = generateMaskSets(opts);
+ if (masksets.length == 0) { return this; }
+ return this.each(function () {
+ maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts, { "action": "mask", "el": this });
+ });
+
+ break;
+ }
+ } else if (typeof fn == "object") {
+ opts = $.extend(true, {}, $.inputmask.defaults, fn);
+
+ resolveAlias(opts.alias, fn, opts); //resolve aliases
+ masksets = generateMaskSets(opts);
+ if (masksets.length == 0) { return this; }
+ return this.each(function () {
+ maskScope($.extend(true, {}, masksets), activeMasksetIndex, opts, { "action": "mask", "el": this });
+ });
+ } else if (fn == undefined) {
+ //look for data-inputmask atribute - the attribute should only contain optipns
+ return this.each(function () {
+ var attrOptions = $(this).attr("data-inputmask");
+ if (attrOptions && attrOptions != "") {
+ try {
+ attrOptions = attrOptions.replace(new RegExp("'", "g"), '"');
+ var dataoptions = $.parseJSON("{" + attrOptions + "}");
+ $.extend(true, dataoptions, options);
+ opts = $.extend(true, {}, $.inputmask.defaults, dataoptions);
+ resolveAlias(opts.alias, dataoptions, opts);
+ opts.alias = undefined;
+ $(this).inputmask(opts);
+ } catch (ex) { } //need a more relax parseJSON
+ }
+ });
+ }
+ };
+ }
+})(jQuery);
diff --git a/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.numeric.extensions.js b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.numeric.extensions.js
new file mode 100644
index 0000000..2efb33f
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.numeric.extensions.js
@@ -0,0 +1,177 @@
+/*
+Input Mask plugin extensions
+http://github.com/RobinHerbots/jquery.inputmask
+Copyright (c) 2010 - 2014 Robin Herbots
+Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+Version: 0.0.0
+
+Optional extensions on the jquery.inputmask base
+*/
+(function ($) {
+ //number aliases
+ $.extend($.inputmask.defaults.aliases, {
+ 'decimal': {
+ mask: "~",
+ placeholder: "",
+ repeat: "*",
+ greedy: false,
+ numericInput: false,
+ isNumeric: true,
+ digits: "*", //number of fractionalDigits
+ groupSeparator: "",//",", // | "."
+ radixPoint: ".",
+ groupSize: 3,
+ autoGroup: false,
+ allowPlus: true,
+ allowMinus: true,
+ //todo
+ integerDigits: "*", //number of integerDigits
+ defaultValue: "",
+ prefix: "",
+ suffix: "",
+
+ //todo
+ getMaskLength: function (buffer, greedy, repeat, currentBuffer, opts) { //custom getMaskLength to take the groupSeparator into account
+ var calculatedLength = buffer.length;
+
+ if (!greedy) {
+ if (repeat == "*") {
+ calculatedLength = currentBuffer.length + 1;
+ } else if (repeat > 1) {
+ calculatedLength += (buffer.length * (repeat - 1));
+ }
+ }
+
+ var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
+ var escapedRadixPoint = $.inputmask.escapeRegex.call(this, opts.radixPoint);
+ var currentBufferStr = currentBuffer.join(''), strippedBufferStr = currentBufferStr.replace(new RegExp(escapedGroupSeparator, "g"), "").replace(new RegExp(escapedRadixPoint), ""),
+ groupOffset = currentBufferStr.length - strippedBufferStr.length;
+ return calculatedLength + groupOffset;
+ },
+ postFormat: function (buffer, pos, reformatOnly, opts) {
+ if (opts.groupSeparator == "") return pos;
+ var cbuf = buffer.slice(),
+ radixPos = $.inArray(opts.radixPoint, buffer);
+ if (!reformatOnly) {
+ cbuf.splice(pos, 0, "?"); //set position indicator
+ }
+ var bufVal = cbuf.join('');
+ if (opts.autoGroup || (reformatOnly && bufVal.indexOf(opts.groupSeparator) != -1)) {
+ var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
+ bufVal = bufVal.replace(new RegExp(escapedGroupSeparator, "g"), '');
+ var radixSplit = bufVal.split(opts.radixPoint);
+ bufVal = radixSplit[0];
+ var reg = new RegExp('([-\+]?[\\d\?]+)([\\d\?]{' + opts.groupSize + '})');
+ while (reg.test(bufVal)) {
+ bufVal = bufVal.replace(reg, '$1' + opts.groupSeparator + '$2');
+ bufVal = bufVal.replace(opts.groupSeparator + opts.groupSeparator, opts.groupSeparator);
+ }
+ if (radixSplit.length > 1)
+ bufVal += opts.radixPoint + radixSplit[1];
+ }
+ buffer.length = bufVal.length; //align the length
+ for (var i = 0, l = bufVal.length; i < l; i++) {
+ buffer[i] = bufVal.charAt(i);
+ }
+ var newPos = $.inArray("?", buffer);
+ if (!reformatOnly) buffer.splice(newPos, 1);
+
+ return reformatOnly ? pos : newPos;
+ },
+ regex: {
+ number: function (opts) {
+ var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
+ var escapedRadixPoint = $.inputmask.escapeRegex.call(this, opts.radixPoint);
+ var digitExpression = isNaN(opts.digits) ? opts.digits : '{0,' + opts.digits + '}';
+ var signedExpression = opts.allowPlus || opts.allowMinus ? "[" + (opts.allowPlus ? "\+" : "") + (opts.allowMinus ? "-" : "") + "]?" : "";
+ return new RegExp("^" + signedExpression + "(\\d+|\\d{1," + opts.groupSize + "}((" + escapedGroupSeparator + "\\d{" + opts.groupSize + "})?)+)(" + escapedRadixPoint + "\\d" + digitExpression + ")?$");
+ }
+ },
+ onKeyDown: function (e, buffer, opts) {
+ var $input = $(this), input = this;
+ if (e.keyCode == opts.keyCode.TAB) {
+ var radixPosition = $.inArray(opts.radixPoint, buffer);
+ if (radixPosition != -1) {
+ var masksets = $input.data('_inputmask')['masksets'];
+ var activeMasksetIndex = $input.data('_inputmask')['activeMasksetIndex'];
+ for (var i = 1; i <= opts.digits && i < opts.getMaskLength(masksets[activeMasksetIndex]["_buffer"], masksets[activeMasksetIndex]["greedy"], masksets[activeMasksetIndex]["repeat"], buffer, opts) ; i++) {
+ if (buffer[radixPosition + i] == undefined || buffer[radixPosition + i] == "") buffer[radixPosition + i] = "0";
+ }
+ input._valueSet(buffer.join(''));
+ }
+ } else if (e.keyCode == opts.keyCode.DELETE || e.keyCode == opts.keyCode.BACKSPACE) {
+ opts.postFormat(buffer, 0, true, opts);
+ input._valueSet(buffer.join(''));
+ return true;
+ }
+ },
+ definitions: {
+ '~': { //real number
+ validator: function (chrs, buffer, pos, strict, opts) {
+ if (chrs == "") return false;
+ if (!strict && pos <= 1 && buffer[0] === '0' && new RegExp("[\\d-]").test(chrs) && buffer.join('').length == 1) { //handle first char
+ buffer[0] = "";
+ return { "pos": 0 };
+ }
+
+ var cbuf = strict ? buffer.slice(0, pos) : buffer.slice();
+
+ cbuf.splice(pos, 0, chrs);
+ var bufferStr = cbuf.join('');
+
+ //strip groupseparator
+ var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
+ bufferStr = bufferStr.replace(new RegExp(escapedGroupSeparator, "g"), '');
+
+ var isValid = opts.regex.number(opts).test(bufferStr);
+ if (!isValid) {
+ //let's help the regex a bit
+ bufferStr += "0";
+ isValid = opts.regex.number(opts).test(bufferStr);
+ if (!isValid) {
+ //make a valid group
+ var lastGroupSeparator = bufferStr.lastIndexOf(opts.groupSeparator);
+ for (var i = bufferStr.length - lastGroupSeparator; i <= 3; i++) {
+ bufferStr += "0";
+ }
+
+ isValid = opts.regex.number(opts).test(bufferStr);
+ if (!isValid && !strict) {
+ if (chrs == opts.radixPoint) {
+ isValid = opts.regex.number(opts).test("0" + bufferStr + "0");
+ if (isValid) {
+ buffer[pos] = "0";
+ pos++;
+ return { "pos": pos };
+ }
+ }
+ }
+ }
+ }
+
+ if (isValid != false && !strict && chrs != opts.radixPoint) {
+ var newPos = opts.postFormat(buffer, pos, false, opts);
+ return { "pos": newPos };
+ }
+
+ return isValid;
+ },
+ cardinality: 1,
+ prevalidator: null
+ }
+ },
+ insertMode: true,
+ autoUnmask: false
+ },
+ 'integer': {
+ regex: {
+ number: function (opts) {
+ var escapedGroupSeparator = $.inputmask.escapeRegex.call(this, opts.groupSeparator);
+ var signedExpression = opts.allowPlus || opts.allowMinus ? "[" + (opts.allowPlus ? "\+" : "") + (opts.allowMinus ? "-" : "") + "]?" : "";
+ return new RegExp("^" + signedExpression + "(\\d+|\\d{1," + opts.groupSize + "}((" + escapedGroupSeparator + "\\d{" + opts.groupSize + "})?)+)$");
+ }
+ },
+ alias: "decimal"
+ }
+ });
+})(jQuery);
diff --git a/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.phone.extensions.js b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.phone.extensions.js
new file mode 100644
index 0000000..554d4ef
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.phone.extensions.js
@@ -0,0 +1,50 @@
+/*
+Input Mask plugin extensions
+http://github.com/RobinHerbots/jquery.inputmask
+Copyright (c) 2010 - 2014 Robin Herbots
+Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+Version: 0.0.0
+
+Phone extension.
+When using this extension make sure you specify the correct url to get the masks
+
+ $(selector).inputmask("phone", {
+ url: "Scripts/jquery.inputmask/phone-codes/phone-codes.json",
+ onKeyValidation: function () { //show some metadata in the console
+ console.log($(this).inputmask("getmetadata")["name_en"]);
+ }
+ });
+
+
+*/
+(function ($) {
+ $.extend($.inputmask.defaults.aliases, {
+ 'phone': {
+ url: "phone-codes/phone-codes.json",
+ mask: function (opts) {
+ opts.definitions = {
+ 'p': {
+ validator: function () { return false; },
+ cardinality: 1
+ },
+ '#': {
+ validator: "[0-9]",
+ cardinality: 1
+ }
+ };
+ var maskList = [];
+ $.ajax({
+ url: opts.url,
+ async: false,
+ dataType: 'json',
+ success: function (response) {
+ maskList = response;
+ }
+ });
+
+ maskList.splice(0, 0, "+p(ppp)ppp-pppp");
+ return maskList;
+ }
+ }
+ });
+})(jQuery);
diff --git a/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.regex.extensions.js b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.regex.extensions.js
new file mode 100644
index 0000000..e956569
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/jquery.inputmask.regex.extensions.js
@@ -0,0 +1,169 @@
+/*
+Input Mask plugin extensions
+http://github.com/RobinHerbots/jquery.inputmask
+Copyright (c) 2010 - 2014 Robin Herbots
+Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
+Version: 0.0.0
+
+Regex extensions on the jquery.inputmask base
+Allows for using regular expressions as a mask
+*/
+(function ($) {
+ $.extend($.inputmask.defaults.aliases, { // $(selector).inputmask("Regex", { regex: "[0-9]*"}
+ 'Regex': {
+ mask: "r",
+ greedy: false,
+ repeat: "*",
+ regex: null,
+ regexTokens: null,
+ //Thx to https://github.com/slevithan/regex-colorizer for the tokenizer regex
+ tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g,
+ quantifierFilter: /[0-9]+[^,]/,
+ definitions: {
+ 'r': {
+ validator: function (chrs, buffer, pos, strict, opts) {
+ function regexToken() {
+ this.matches = [];
+ this.isGroup = false;
+ this.isQuantifier = false;
+ this.isLiteral = false;
+ }
+ function analyseRegex() {
+ var currentToken = new regexToken(), match, m, opengroups = [];
+
+ opts.regexTokens = [];
+
+ // The tokenizer regex does most of the tokenization grunt work
+ while (match = opts.tokenizer.exec(opts.regex)) {
+ m = match[0];
+ switch (m.charAt(0)) {
+ case "[": // Character class
+ case "\\": // Escape or backreference
+ if (opengroups.length > 0) {
+ opengroups[opengroups.length - 1]["matches"].push(m);
+ } else {
+ currentToken.matches.push(m);
+ }
+ break;
+ case "(": // Group opening
+ if (!currentToken.isGroup && currentToken.matches.length > 0)
+ opts.regexTokens.push(currentToken);
+ currentToken = new regexToken();
+ currentToken.isGroup = true;
+ opengroups.push(currentToken);
+ break;
+ case ")": // Group closing
+ var groupToken = opengroups.pop();
+ if (opengroups.length > 0) {
+ opengroups[opengroups.length - 1]["matches"].push(groupToken);
+ } else {
+ opts.regexTokens.push(groupToken);
+ currentToken = new regexToken();
+ }
+ break;
+ case "{": //Quantifier
+ var quantifier = new regexToken();
+ quantifier.isQuantifier = true;
+ quantifier.matches.push(m);
+ if (opengroups.length > 0) {
+ opengroups[opengroups.length - 1]["matches"].push(quantifier);
+ } else {
+ currentToken.matches.push(quantifier);
+ }
+ break;
+ default:
+ // Vertical bar (alternator)
+ // ^ or $ anchor
+ // Dot (.)
+ // Literal character sequence
+ var literal = new regexToken();
+ literal.isLiteral = true;
+ literal.matches.push(m);
+ if (opengroups.length > 0) {
+ opengroups[opengroups.length - 1]["matches"].push(literal);
+ } else {
+ currentToken.matches.push(literal);
+ }
+ }
+ }
+
+ if (currentToken.matches.length > 0)
+ opts.regexTokens.push(currentToken);
+ }
+ function validateRegexToken(token, fromGroup) {
+ var isvalid = false;
+ if (fromGroup) {
+ regexPart += "(";
+ openGroupCount++;
+ }
+ for (var mndx = 0; mndx < token["matches"].length; mndx++) {
+ var matchToken = token["matches"][mndx];
+ if (matchToken["isGroup"] == true) {
+ isvalid = validateRegexToken(matchToken, true);
+ } else if (matchToken["isQuantifier"] == true) {
+ matchToken = matchToken["matches"][0];
+ var quantifierMax = opts.quantifierFilter.exec(matchToken)[0].replace("}", "");
+ var testExp = regexPart + "{1," + quantifierMax + "}"; //relax quantifier validation
+ for (var j = 0; j < openGroupCount; j++) {
+ testExp += ")";
+ }
+ var exp = new RegExp("^(" + testExp + ")$");
+ isvalid = exp.test(bufferStr);
+ regexPart += matchToken;
+ } else if (matchToken["isLiteral"] == true) {
+ matchToken = matchToken["matches"][0];
+ var testExp = regexPart, openGroupCloser = "";
+ for (var j = 0; j < openGroupCount; j++) {
+ openGroupCloser += ")";
+ }
+ for (var k = 0; k < matchToken.length; k++) { //relax literal validation
+ testExp = (testExp + matchToken[k]).replace(/\|$/, "");
+ var exp = new RegExp("^(" + testExp + openGroupCloser + ")$");
+ isvalid = exp.test(bufferStr);
+ if (isvalid) break;
+ }
+ regexPart += matchToken;
+ //console.log(bufferStr + " " + exp + " " + isvalid);
+ } else {
+ regexPart += matchToken;
+ var testExp = regexPart.replace(/\|$/, "");
+ for (var j = 0; j < openGroupCount; j++) {
+ testExp += ")";
+ }
+ var exp = new RegExp("^(" + testExp + ")$");
+ isvalid = exp.test(bufferStr);
+ //console.log(bufferStr + " " + exp + " " + isvalid);
+ }
+ if (isvalid) break;
+ }
+
+ if (fromGroup) {
+ regexPart += ")";
+ openGroupCount--;
+ }
+
+ return isvalid;
+ }
+
+
+ if (opts.regexTokens == null) {
+ analyseRegex();
+ }
+
+ var cbuffer = buffer.slice(), regexPart = "", isValid = false, openGroupCount = 0;
+ cbuffer.splice(pos, 0, chrs);
+ var bufferStr = cbuffer.join('');
+ for (var i = 0; i < opts.regexTokens.length; i++) {
+ var regexToken = opts.regexTokens[i];
+ isValid = validateRegexToken(regexToken, regexToken["isGroup"]);
+ if (isValid) break;
+ }
+
+ return isValid;
+ },
+ cardinality: 1
+ }
+ }
+ }
+ });
+})(jQuery);
diff --git a/public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-be.json b/public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-be.json
new file mode 100644
index 0000000..b510b78
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-be.json
@@ -0,0 +1,45 @@
+[
+ { "mask": "+32(53)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Aalst (Alost)" },
+ { "mask": "+32(3)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Antwerpen (Anvers)" },
+ { "mask": "+32(63)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Arlon" },
+ { "mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ath" },
+ { "mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Brugge (Bruges)" },
+ { "mask": "+32(2)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Brussel/Bruxelles (Brussels)" },
+ { "mask": "+32(71)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Charleroi" },
+ { "mask": "+32(60)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Chimay" },
+ { "mask": "+32(83)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ciney" },
+ { "mask": "+32(52)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dendermonde" },
+ { "mask": "+32(13)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Diest" },
+ { "mask": "+32(82)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Dinant" },
+ { "mask": "+32(86)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Durbuy" },
+ { "mask": "+32(89)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Genk" },
+ { "mask": "+32(9)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Gent (Gand)" },
+ { "mask": "+32(11)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Hasselt" },
+ { "mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Herentals" },
+ { "mask": "+32(85)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Huy (Hoei)" },
+ { "mask": "+32(64)##-##-##", "cc": "BE", "cd": "Belgium", "city": "La Louvière" },
+ { "mask": "+32(16)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Leuven (Louvain)" },
+ { "mask": "+32(61)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Libramont" },
+ { "mask": "+32(4)###-##-##", "cc": "BE", "cd": "Belgium", "city": "Liège (Luik)" },
+ { "mask": "+32(15)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mechelen (Malines)" },
+ { "mask": "+32(47#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },
+ { "mask": "+32(48#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },
+ { "mask": "+32(49#)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mobile Phones" },
+ { "mask": "+32(65)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Mons (Bergen)" },
+ { "mask": "+32(81)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Namur (Namen)" },
+ { "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nieuwpoort (Nieuport)" },
+ { "mask": "+32(54)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ninove" },
+ { "mask": "+32(67)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Nivelles (Nijvel)" },
+ { "mask": "+32(59)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Oostende (Ostende)" },
+ { "mask": "+32(51)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Roeselare (Roulers)" },
+ { "mask": "+32(55)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Ronse" },
+ { "mask": "+32(80)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Stavelot" },
+ { "mask": "+32(12)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tongeren (Tongres)" },
+ { "mask": "+32(69)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Tounai" },
+ { "mask": "+32(14)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Turnhout" },
+ { "mask": "+32(87)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Verviers" },
+ { "mask": "+32(58)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Veurne" },
+ { "mask": "+32(19)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wareme" },
+ { "mask": "+32(10)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Wavre (Waver)" },
+ { "mask": "+32(50)##-##-##", "cc": "BE", "cd": "Belgium", "city": "Zeebrugge" }
+] \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-codes.json b/public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-codes.json
new file mode 100644
index 0000000..15bbd3a
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/phone-codes/phone-codes.json
@@ -0,0 +1,294 @@
+[
+ { "mask": "+247-####", "cc": "AC", "name_en": "Ascension", "desc_en": "", "name_ru": "Остров Вознесения", "desc_ru": "" },
+ { "mask": "+376-###-###", "cc": "AD", "name_en": "Andorra", "desc_en": "", "name_ru": "Андорра", "desc_ru": "" },
+ { "mask": "+971-5#-###-####", "cc": "AE", "name_en": "United Arab Emirates", "desc_en": "mobile", "name_ru": "Объединенные Арабские Эмираты", "desc_ru": "мобильные" },
+ { "mask": "+971-#-###-####", "cc": "AE", "name_en": "United Arab Emirates", "desc_en": "", "name_ru": "Объединенные Арабские Эмираты", "desc_ru": "" },
+ { "mask": "+93-##-###-####", "cc": "AF", "name_en": "Afghanistan", "desc_en": "", "name_ru": "Афганистан", "desc_ru": "" },
+ { "mask": "+1(268)###-####", "cc": "AG", "name_en": "Antigua & Barbuda", "desc_en": "", "name_ru": "Антигуа и Барбуда", "desc_ru": "" },
+ { "mask": "+1(264)###-####", "cc": "AI", "name_en": "Anguilla", "desc_en": "", "name_ru": "Ангилья", "desc_ru": "" },
+ { "mask": "+355(###)###-###", "cc": "AL", "name_en": "Albania", "desc_en": "", "name_ru": "Албания", "desc_ru": "" },
+ { "mask": "+374-##-###-###", "cc": "AM", "name_en": "Armenia", "desc_en": "", "name_ru": "Армения", "desc_ru": "" },
+ { "mask": "+599-###-####", "cc": "AN", "name_en": "Caribbean Netherlands", "desc_en": "", "name_ru": "Карибские Нидерланды", "desc_ru": "" },
+ { "mask": "+599-###-####", "cc": "AN", "name_en": "Netherlands Antilles", "desc_en": "", "name_ru": "Нидерландские Антильские острова", "desc_ru": "" },
+ { "mask": "+599-9###-####", "cc": "AN", "name_en": "Netherlands Antilles", "desc_en": "Curacao", "name_ru": "Нидерландские Антильские острова", "desc_ru": "Кюрасао" },
+ { "mask": "+244(###)###-###", "cc": "AO", "name_en": "Angola", "desc_en": "", "name_ru": "Ангола", "desc_ru": "" },
+ { "mask": "+672-1##-###", "cc": "AQ", "name_en": "Australian bases in Antarctica", "desc_en": "", "name_ru": "Австралийская антарктическая база", "desc_ru": "" },
+ { "mask": "+54(###)###-####", "cc": "AR", "name_en": "Argentina", "desc_en": "", "name_ru": "Аргентина", "desc_ru": "" },
+ { "mask": "+1(684)###-####", "cc": "AS", "name_en": "American Samoa", "desc_en": "", "name_ru": "Американское Самоа", "desc_ru": "" },
+ { "mask": "+43(###)###-####", "cc": "AT", "name_en": "Austria", "desc_en": "", "name_ru": "Австрия", "desc_ru": "" },
+ { "mask": "+61-#-####-####", "cc": "AU", "name_en": "Australia", "desc_en": "", "name_ru": "Австралия", "desc_ru": "" },
+ { "mask": "+297-###-####", "cc": "AW", "name_en": "Aruba", "desc_en": "", "name_ru": "Аруба", "desc_ru": "" },
+ { "mask": "+994-##-###-##-##", "cc": "AZ", "name_en": "Azerbaijan", "desc_en": "", "name_ru": "Азербайджан", "desc_ru": "" },
+ { "mask": "+387-##-#####", "cc": "BA", "name_en": "Bosnia and Herzegovina", "desc_en": "", "name_ru": "Босния и Герцеговина", "desc_ru": "" },
+ { "mask": "+387-##-####", "cc": "BA", "name_en": "Bosnia and Herzegovina", "desc_en": "", "name_ru": "Босния и Герцеговина", "desc_ru": "" },
+ { "mask": "+1(246)###-####", "cc": "BB", "name_en": "Barbados", "desc_en": "", "name_ru": "Барбадос", "desc_ru": "" },
+ { "mask": "+880-##-###-###", "cc": "BD", "name_en": "Bangladesh", "desc_en": "", "name_ru": "Бангладеш", "desc_ru": "" },
+ { "mask": "+32(###)###-###", "cc": "BE", "name_en": "Belgium", "desc_en": "", "name_ru": "Бельгия", "desc_ru": "" },
+ { "mask": "+226-##-##-####", "cc": "BF", "name_en": "Burkina Faso", "desc_en": "", "name_ru": "Буркина Фасо", "desc_ru": "" },
+ { "mask": "+359(###)###-###", "cc": "BG", "name_en": "Bulgaria", "desc_en": "", "name_ru": "Болгария", "desc_ru": "" },
+ { "mask": "+973-####-####", "cc": "BH", "name_en": "Bahrain", "desc_en": "", "name_ru": "Бахрейн", "desc_ru": "" },
+ { "mask": "+257-##-##-####", "cc": "BI", "name_en": "Burundi", "desc_en": "", "name_ru": "Бурунди", "desc_ru": "" },
+ { "mask": "+229-##-##-####", "cc": "BJ", "name_en": "Benin", "desc_en": "", "name_ru": "Бенин", "desc_ru": "" },
+ { "mask": "+1(441)###-####", "cc": "BM", "name_en": "Bermuda", "desc_en": "", "name_ru": "Бермудские острова", "desc_ru": "" },
+ { "mask": "+673-###-####", "cc": "BN", "name_en": "Brunei Darussalam", "desc_en": "", "name_ru": "Бруней-Даруссалам", "desc_ru": "" },
+ { "mask": "+591-#-###-####", "cc": "BO", "name_en": "Bolivia", "desc_en": "", "name_ru": "Боливия", "desc_ru": "" },
+ { "mask": "+55-##-####[#]-####", "cc": "BR", "name_en": "Brazil", "desc_en": "", "name_ru": "Бразилия", "desc_ru": "" },
+ { "mask": "+1(242)###-####", "cc": "BS", "name_en": "Bahamas", "desc_en": "", "name_ru": "Багамские Острова", "desc_ru": "" },
+ { "mask": "+975-17-###-###", "cc": "BT", "name_en": "Bhutan", "desc_en": "", "name_ru": "Бутан", "desc_ru": "" },
+ { "mask": "+975-#-###-###", "cc": "BT", "name_en": "Bhutan", "desc_en": "", "name_ru": "Бутан", "desc_ru": "" },
+ { "mask": "+267-##-###-###", "cc": "BW", "name_en": "Botswana", "desc_en": "", "name_ru": "Ботсвана", "desc_ru": "" },
+ { "mask": "+375(##)###-##-##", "cc": "BY", "name_en": "Belarus", "desc_en": "", "name_ru": "Беларусь (Белоруссия)", "desc_ru": "" },
+ { "mask": "+501-###-####", "cc": "BZ", "name_en": "Belize", "desc_en": "", "name_ru": "Белиз", "desc_ru": "" },
+ { "mask": "+243(###)###-###", "cc": "CD", "name_en": "Dem. Rep. Congo", "desc_en": "", "name_ru": "Дем. Респ. Конго (Киншаса)", "desc_ru": "" },
+ { "mask": "+236-##-##-####", "cc": "CF", "name_en": "Central African Republic", "desc_en": "", "name_ru": "Центральноафриканская Республика", "desc_ru": "" },
+ { "mask": "+242-##-###-####", "cc": "CG", "name_en": "Congo (Brazzaville)", "desc_en": "", "name_ru": "Конго (Браззавиль)", "desc_ru": "" },
+ { "mask": "+41-##-###-####", "cc": "CH", "name_en": "Switzerland", "desc_en": "", "name_ru": "Швейцария", "desc_ru": "" },
+ { "mask": "+225-##-###-###", "cc": "CI", "name_en": "Cote d’Ivoire (Ivory Coast)", "desc_en": "", "name_ru": "Кот-д’Ивуар", "desc_ru": "" },
+ { "mask": "+682-##-###", "cc": "CK", "name_en": "Cook Islands", "desc_en": "", "name_ru": "Острова Кука", "desc_ru": "" },
+ { "mask": "+56-#-####-####", "cc": "CL", "name_en": "Chile", "desc_en": "", "name_ru": "Чили", "desc_ru": "" },
+ { "mask": "+237-####-####", "cc": "CM", "name_en": "Cameroon", "desc_en": "", "name_ru": "Камерун", "desc_ru": "" },
+ { "mask": "+86(###)####-####", "cc": "CN", "name_en": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" },
+ { "mask": "+86(###)####-###", "cc": "CN", "name_en": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" },
+ { "mask": "+86-##-#####-#####", "cc": "CN", "name_en": "China (PRC)", "desc_en": "", "name_ru": "Китайская Н.Р.", "desc_ru": "" },
+ { "mask": "+57(###)###-####", "cc": "CO", "name_en": "Colombia", "desc_en": "", "name_ru": "Колумбия", "desc_ru": "" },
+ { "mask": "+506-####-####", "cc": "CR", "name_en": "Costa Rica", "desc_en": "", "name_ru": "Коста-Рика", "desc_ru": "" },
+ { "mask": "+53-#-###-####", "cc": "CU", "name_en": "Cuba", "desc_en": "", "name_ru": "Куба", "desc_ru": "" },
+ { "mask": "+238(###)##-##", "cc": "CV", "name_en": "Cape Verde", "desc_en": "", "name_ru": "Кабо-Верде", "desc_ru": "" },
+ { "mask": "+599-###-####", "cc": "CW", "name_en": "Curacao", "desc_en": "", "name_ru": "Кюрасао", "desc_ru": "" },
+ { "mask": "+357-##-###-###", "cc": "CY", "name_en": "Cyprus", "desc_en": "", "name_ru": "Кипр", "desc_ru": "" },
+ { "mask": "+420(###)###-###", "cc": "CZ", "name_en": "Czech Republic", "desc_en": "", "name_ru": "Чехия", "desc_ru": "" },
+ { "mask": "+49(####)###-####", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
+ { "mask": "+49(###)###-####", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
+ { "mask": "+49(###)##-####", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
+ { "mask": "+49(###)##-###", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
+ { "mask": "+49(###)##-##", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
+ { "mask": "+49-###-###", "cc": "DE", "name_en": "Germany", "desc_en": "", "name_ru": "Германия", "desc_ru": "" },
+ { "mask": "+253-##-##-##-##", "cc": "DJ", "name_en": "Djibouti", "desc_en": "", "name_ru": "Джибути", "desc_ru": "" },
+ { "mask": "+45-##-##-##-##", "cc": "DK", "name_en": "Denmark", "desc_en": "", "name_ru": "Дания", "desc_ru": "" },
+ { "mask": "+1(767)###-####", "cc": "DM", "name_en": "Dominica", "desc_en": "", "name_ru": "Доминика", "desc_ru": "" },
+ { "mask": "+1(809)###-####", "cc": "DO", "name_en": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" },
+ { "mask": "+1(829)###-####", "cc": "DO", "name_en": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" },
+ { "mask": "+1(849)###-####", "cc": "DO", "name_en": "Dominican Republic", "desc_en": "", "name_ru": "Доминиканская Республика", "desc_ru": "" },
+ { "mask": "+213-##-###-####", "cc": "DZ", "name_en": "Algeria", "desc_en": "", "name_ru": "Алжир", "desc_ru": "" },
+ { "mask": "+593-##-###-####", "cc": "EC", "name_en": "Ecuador ", "desc_en": "mobile", "name_ru": "Эквадор ", "desc_ru": "мобильные" },
+ { "mask": "+593-#-###-####", "cc": "EC", "name_en": "Ecuador", "desc_en": "", "name_ru": "Эквадор", "desc_ru": "" },
+ { "mask": "+372-####-####", "cc": "EE", "name_en": "Estonia ", "desc_en": "mobile", "name_ru": "Эстония ", "desc_ru": "мобильные" },
+ { "mask": "+372-###-####", "cc": "EE", "name_en": "Estonia", "desc_en": "", "name_ru": "Эстония", "desc_ru": "" },
+ { "mask": "+20(###)###-####", "cc": "EG", "name_en": "Egypt", "desc_en": "", "name_ru": "Египет", "desc_ru": "" },
+ { "mask": "+291-#-###-###", "cc": "ER", "name_en": "Eritrea", "desc_en": "", "name_ru": "Эритрея", "desc_ru": "" },
+ { "mask": "+34(###)###-###", "cc": "ES", "name_en": "Spain", "desc_en": "", "name_ru": "Испания", "desc_ru": "" },
+ { "mask": "+251-##-###-####", "cc": "ET", "name_en": "Ethiopia", "desc_en": "", "name_ru": "Эфиопия", "desc_ru": "" },
+ { "mask": "+358(###)###-##-##", "cc": "FI", "name_en": "Finland", "desc_en": "", "name_ru": "Финляндия", "desc_ru": "" },
+ { "mask": "+679-##-#####", "cc": "FJ", "name_en": "Fiji", "desc_en": "", "name_ru": "Фиджи", "desc_ru": "" },
+ { "mask": "+500-#####", "cc": "FK", "name_en": "Falkland Islands", "desc_en": "", "name_ru": "Фолклендские острова", "desc_ru": "" },
+ { "mask": "+691-###-####", "cc": "FM", "name_en": "F.S. Micronesia", "desc_en": "", "name_ru": "Ф.Ш. Микронезии", "desc_ru": "" },
+ { "mask": "+298-###-###", "cc": "FO", "name_en": "Faroe Islands", "desc_en": "", "name_ru": "Фарерские острова", "desc_ru": "" },
+ { "mask": "+262-#####-####", "cc": "FR", "name_en": "Mayotte", "desc_en": "", "name_ru": "Майотта", "desc_ru": "" },
+ { "mask": "+33(###)###-###", "cc": "FR", "name_en": "France", "desc_en": "", "name_ru": "Франция", "desc_ru": "" },
+ { "mask": "+508-##-####", "cc": "FR", "name_en": "St Pierre & Miquelon", "desc_en": "", "name_ru": "Сен-Пьер и Микелон", "desc_ru": "" },
+ { "mask": "+590(###)###-###", "cc": "FR", "name_en": "Guadeloupe", "desc_en": "", "name_ru": "Гваделупа", "desc_ru": "" },
+ { "mask": "+241-#-##-##-##", "cc": "GA", "name_en": "Gabon", "desc_en": "", "name_ru": "Габон", "desc_ru": "" },
+ { "mask": "+1(473)###-####", "cc": "GD", "name_en": "Grenada", "desc_en": "", "name_ru": "Гренада", "desc_ru": "" },
+ { "mask": "+995(###)###-###", "cc": "GE", "name_en": "Rep. of Georgia", "desc_en": "", "name_ru": "Грузия", "desc_ru": "" },
+ { "mask": "+594-#####-####", "cc": "GF", "name_en": "Guiana (French)", "desc_en": "", "name_ru": "Фр. Гвиана", "desc_ru": "" },
+ { "mask": "+233(###)###-###", "cc": "GH", "name_en": "Ghana", "desc_en": "", "name_ru": "Гана", "desc_ru": "" },
+ { "mask": "+350-###-#####", "cc": "GI", "name_en": "Gibraltar", "desc_en": "", "name_ru": "Гибралтар", "desc_ru": "" },
+ { "mask": "+299-##-##-##", "cc": "GL", "name_en": "Greenland", "desc_en": "", "name_ru": "Гренландия", "desc_ru": "" },
+ { "mask": "+220(###)##-##", "cc": "GM", "name_en": "Gambia", "desc_en": "", "name_ru": "Гамбия", "desc_ru": "" },
+ { "mask": "+224-##-###-###", "cc": "GN", "name_en": "Guinea", "desc_en": "", "name_ru": "Гвинея", "desc_ru": "" },
+ { "mask": "+240-##-###-####", "cc": "GQ", "name_en": "Equatorial Guinea", "desc_en": "", "name_ru": "Экваториальная Гвинея", "desc_ru": "" },
+ { "mask": "+30(###)###-####", "cc": "GR", "name_en": "Greece", "desc_en": "", "name_ru": "Греция", "desc_ru": "" },
+ { "mask": "+502-#-###-####", "cc": "GT", "name_en": "Guatemala", "desc_en": "", "name_ru": "Гватемала", "desc_ru": "" },
+ { "mask": "+1(671)###-####", "cc": "GU", "name_en": "Guam", "desc_en": "", "name_ru": "Гуам", "desc_ru": "" },
+ { "mask": "+245-#-######", "cc": "GW", "name_en": "Guinea-Bissau", "desc_en": "", "name_ru": "Гвинея-Бисау", "desc_ru": "" },
+ { "mask": "+592-###-####", "cc": "GY", "name_en": "Guyana", "desc_en": "", "name_ru": "Гайана", "desc_ru": "" },
+ { "mask": "+852-####-####", "cc": "HK", "name_en": "Hong Kong", "desc_en": "", "name_ru": "Гонконг", "desc_ru": "" },
+ { "mask": "+504-####-####", "cc": "HN", "name_en": "Honduras", "desc_en": "", "name_ru": "Гондурас", "desc_ru": "" },
+ { "mask": "+385-##-###-###", "cc": "HR", "name_en": "Croatia", "desc_en": "", "name_ru": "Хорватия", "desc_ru": "" },
+ { "mask": "+509-##-##-####", "cc": "HT", "name_en": "Haiti", "desc_en": "", "name_ru": "Гаити", "desc_ru": "" },
+ { "mask": "+36(###)###-###", "cc": "HU", "name_en": "Hungary", "desc_en": "", "name_ru": "Венгрия", "desc_ru": "" },
+ { "mask": "+62(8##)###-####", "cc": "ID", "name_en": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" },
+ { "mask": "+62-##-###-##", "cc": "ID", "name_en": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" },
+ { "mask": "+62-##-###-###", "cc": "ID", "name_en": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" },
+ { "mask": "+62-##-###-####", "cc": "ID", "name_en": "Indonesia", "desc_en": "", "name_ru": "Индонезия", "desc_ru": "" },
+ { "mask": "+62(8##)###-###", "cc": "ID", "name_en": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" },
+ { "mask": "+62(8##)###-##-###", "cc": "ID", "name_en": "Indonesia ", "desc_en": "mobile", "name_ru": "Индонезия ", "desc_ru": "мобильные" },
+ { "mask": "+353(###)###-###", "cc": "IE", "name_en": "Ireland", "desc_en": "", "name_ru": "Ирландия", "desc_ru": "" },
+ { "mask": "+972-5#-###-####", "cc": "IL", "name_en": "Israel ", "desc_en": "mobile", "name_ru": "Израиль ", "desc_ru": "мобильные" },
+ { "mask": "+972-#-###-####", "cc": "IL", "name_en": "Israel", "desc_en": "", "name_ru": "Израиль", "desc_ru": "" },
+ { "mask": "+91(####)###-###", "cc": "IN", "name_en": "India", "desc_en": "", "name_ru": "Индия", "desc_ru": "" },
+ { "mask": "+246-###-####", "cc": "IO", "name_en": "Diego Garcia", "desc_en": "", "name_ru": "Диего-Гарсия", "desc_ru": "" },
+ { "mask": "+964(###)###-####", "cc": "IQ", "name_en": "Iraq", "desc_en": "", "name_ru": "Ирак", "desc_ru": "" },
+ { "mask": "+98(###)###-####", "cc": "IR", "name_en": "Iran", "desc_en": "", "name_ru": "Иран", "desc_ru": "" },
+ { "mask": "+354-###-####", "cc": "IS", "name_en": "Iceland", "desc_en": "", "name_ru": "Исландия", "desc_ru": "" },
+ { "mask": "+39(###)####-###", "cc": "IT", "name_en": "Italy", "desc_en": "", "name_ru": "Италия", "desc_ru": "" },
+ { "mask": "+1(876)###-####", "cc": "JM", "name_en": "Jamaica", "desc_en": "", "name_ru": "Ямайка", "desc_ru": "" },
+ { "mask": "+962-#-####-####", "cc": "JO", "name_en": "Jordan", "desc_en": "", "name_ru": "Иордания", "desc_ru": "" },
+ { "mask": "+81-##-####-####", "cc": "JP", "name_en": "Japan ", "desc_en": "mobile", "name_ru": "Япония ", "desc_ru": "мобильные" },
+ { "mask": "+81(###)###-###", "cc": "JP", "name_en": "Japan", "desc_en": "", "name_ru": "Япония", "desc_ru": "" },
+ { "mask": "+254-###-######", "cc": "KE", "name_en": "Kenya", "desc_en": "", "name_ru": "Кения", "desc_ru": "" },
+ { "mask": "+996(###)###-###", "cc": "KG", "name_en": "Kyrgyzstan", "desc_en": "", "name_ru": "Киргизия", "desc_ru": "" },
+ { "mask": "+855-##-###-###", "cc": "KH", "name_en": "Cambodia", "desc_en": "", "name_ru": "Камбоджа", "desc_ru": "" },
+ { "mask": "+686-##-###", "cc": "KI", "name_en": "Kiribati", "desc_en": "", "name_ru": "Кирибати", "desc_ru": "" },
+ { "mask": "+269-##-#####", "cc": "KM", "name_en": "Comoros", "desc_en": "", "name_ru": "Коморы", "desc_ru": "" },
+ { "mask": "+1(869)###-####", "cc": "KN", "name_en": "Saint Kitts & Nevis", "desc_en": "", "name_ru": "Сент-Китс и Невис", "desc_ru": "" },
+ { "mask": "+850-191-###-####", "cc": "KP", "name_en": "DPR Korea (North) ", "desc_en": "mobile", "name_ru": "Корейская НДР ", "desc_ru": "мобильные" },
+ { "mask": "+850-##-###-###", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
+ { "mask": "+850-###-####-###", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
+ { "mask": "+850-###-###", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
+ { "mask": "+850-####-####", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
+ { "mask": "+850-####-#############", "cc": "KP", "name_en": "DPR Korea (North)", "desc_en": "", "name_ru": "Корейская НДР", "desc_ru": "" },
+ { "mask": "+82-##-###-####", "cc": "KR", "name_en": "Korea (South)", "desc_en": "", "name_ru": "Респ. Корея", "desc_ru": "" },
+ { "mask": "+965-####-####", "cc": "KW", "name_en": "Kuwait", "desc_en": "", "name_ru": "Кувейт", "desc_ru": "" },
+ { "mask": "+1(345)###-####", "cc": "KY", "name_en": "Cayman Islands", "desc_en": "", "name_ru": "Каймановы острова", "desc_ru": "" },
+ { "mask": "+7(6##)###-##-##", "cc": "KZ", "name_en": "Kazakhstan", "desc_en": "", "name_ru": "Казахстан", "desc_ru": "" },
+ { "mask": "+7(7##)###-##-##", "cc": "KZ", "name_en": "Kazakhstan", "desc_en": "", "name_ru": "Казахстан", "desc_ru": "" },
+ { "mask": "+856(20##)###-###", "cc": "LA", "name_en": "Laos ", "desc_en": "mobile", "name_ru": "Лаос ", "desc_ru": "мобильные" },
+ { "mask": "+856-##-###-###", "cc": "LA", "name_en": "Laos", "desc_en": "", "name_ru": "Лаос", "desc_ru": "" },
+ { "mask": "+961-##-###-###", "cc": "LB", "name_en": "Lebanon ", "desc_en": "mobile", "name_ru": "Ливан ", "desc_ru": "мобильные" },
+ { "mask": "+961-#-###-###", "cc": "LB", "name_en": "Lebanon", "desc_en": "", "name_ru": "Ливан", "desc_ru": "" },
+ { "mask": "+1(758)###-####", "cc": "LC", "name_en": "Saint Lucia", "desc_en": "", "name_ru": "Сент-Люсия", "desc_ru": "" },
+ { "mask": "+423(###)###-####", "cc": "LI", "name_en": "Liechtenstein", "desc_en": "", "name_ru": "Лихтенштейн", "desc_ru": "" },
+ { "mask": "+94-##-###-####", "cc": "LK", "name_en": "Sri Lanka", "desc_en": "", "name_ru": "Шри-Ланка", "desc_ru": "" },
+ { "mask": "+231-##-###-###", "cc": "LR", "name_en": "Liberia", "desc_en": "", "name_ru": "Либерия", "desc_ru": "" },
+ { "mask": "+266-#-###-####", "cc": "LS", "name_en": "Lesotho", "desc_en": "", "name_ru": "Лесото", "desc_ru": "" },
+ { "mask": "+370(###)##-###", "cc": "LT", "name_en": "Lithuania", "desc_en": "", "name_ru": "Литва", "desc_ru": "" },
+ { "mask": "+352(###)###-###", "cc": "LU", "name_en": "Luxembourg", "desc_en": "", "name_ru": "Люксембург", "desc_ru": "" },
+ { "mask": "+371-##-###-###", "cc": "LV", "name_en": "Latvia", "desc_en": "", "name_ru": "Латвия", "desc_ru": "" },
+ { "mask": "+218-##-###-###", "cc": "LY", "name_en": "Libya", "desc_en": "", "name_ru": "Ливия", "desc_ru": "" },
+ { "mask": "+218-21-###-####", "cc": "LY", "name_en": "Libya", "desc_en": "Tripoli", "name_ru": "Ливия", "desc_ru": "Триполи" },
+ { "mask": "+212-##-####-###", "cc": "MA", "name_en": "Morocco", "desc_en": "", "name_ru": "Марокко", "desc_ru": "" },
+ { "mask": "+377(###)###-###", "cc": "MC", "name_en": "Monaco", "desc_en": "", "name_ru": "Монако", "desc_ru": "" },
+ { "mask": "+377-##-###-###", "cc": "MC", "name_en": "Monaco", "desc_en": "", "name_ru": "Монако", "desc_ru": "" },
+ { "mask": "+373-####-####", "cc": "MD", "name_en": "Moldova", "desc_en": "", "name_ru": "Молдова", "desc_ru": "" },
+ { "mask": "+382-##-###-###", "cc": "ME", "name_en": "Montenegro", "desc_en": "", "name_ru": "Черногория", "desc_ru": "" },
+ { "mask": "+261-##-##-#####", "cc": "MG", "name_en": "Madagascar", "desc_en": "", "name_ru": "Мадагаскар", "desc_ru": "" },
+ { "mask": "+692-###-####", "cc": "MH", "name_en": "Marshall Islands", "desc_en": "", "name_ru": "Маршалловы Острова", "desc_ru": "" },
+ { "mask": "+389-##-###-###", "cc": "MK", "name_en": "Republic of Macedonia", "desc_en": "", "name_ru": "Респ. Македония", "desc_ru": "" },
+ { "mask": "+223-##-##-####", "cc": "ML", "name_en": "Mali", "desc_en": "", "name_ru": "Мали", "desc_ru": "" },
+ { "mask": "+95-##-###-###", "cc": "MM", "name_en": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" },
+ { "mask": "+95-#-###-###", "cc": "MM", "name_en": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" },
+ { "mask": "+95-###-###", "cc": "MM", "name_en": "Burma (Myanmar)", "desc_en": "", "name_ru": "Бирма (Мьянма)", "desc_ru": "" },
+ { "mask": "+976-##-##-####", "cc": "MN", "name_en": "Mongolia", "desc_en": "", "name_ru": "Монголия", "desc_ru": "" },
+ { "mask": "+853-####-####", "cc": "MO", "name_en": "Macau", "desc_en": "", "name_ru": "Макао", "desc_ru": "" },
+ { "mask": "+1(670)###-####", "cc": "MP", "name_en": "Northern Mariana Islands", "desc_en": "", "name_ru": "Северные Марианские острова Сайпан", "desc_ru": "" },
+ { "mask": "+596(###)##-##-##", "cc": "MQ", "name_en": "Martinique", "desc_en": "", "name_ru": "Мартиника", "desc_ru": "" },
+ { "mask": "+222-##-##-####", "cc": "MR", "name_en": "Mauritania", "desc_en": "", "name_ru": "Мавритания", "desc_ru": "" },
+ { "mask": "+1(664)###-####", "cc": "MS", "name_en": "Montserrat", "desc_en": "", "name_ru": "Монтсеррат", "desc_ru": "" },
+ { "mask": "+356-####-####", "cc": "MT", "name_en": "Malta", "desc_en": "", "name_ru": "Мальта", "desc_ru": "" },
+ { "mask": "+230-###-####", "cc": "MU", "name_en": "Mauritius", "desc_en": "", "name_ru": "Маврикий", "desc_ru": "" },
+ { "mask": "+960-###-####", "cc": "MV", "name_en": "Maldives", "desc_en": "", "name_ru": "Мальдивские острова", "desc_ru": "" },
+ { "mask": "+265-1-###-###", "cc": "MW", "name_en": "Malawi", "desc_en": "Telecom Ltd", "name_ru": "Малави", "desc_ru": "Telecom Ltd" },
+ { "mask": "+265-#-####-####", "cc": "MW", "name_en": "Malawi", "desc_en": "", "name_ru": "Малави", "desc_ru": "" },
+ { "mask": "+52(###)###-####", "cc": "MX", "name_en": "Mexico", "desc_en": "", "name_ru": "Мексика", "desc_ru": "" },
+ { "mask": "+52-##-##-####", "cc": "MX", "name_en": "Mexico", "desc_en": "", "name_ru": "Мексика", "desc_ru": "" },
+ { "mask": "+60-##-###-####", "cc": "MY", "name_en": "Malaysia ", "desc_en": "mobile", "name_ru": "Малайзия ", "desc_ru": "мобильные" },
+ { "mask": "+60(###)###-###", "cc": "MY", "name_en": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" },
+ { "mask": "+60-##-###-###", "cc": "MY", "name_en": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" },
+ { "mask": "+60-#-###-###", "cc": "MY", "name_en": "Malaysia", "desc_en": "", "name_ru": "Малайзия", "desc_ru": "" },
+ { "mask": "+258-##-###-###", "cc": "MZ", "name_en": "Mozambique", "desc_en": "", "name_ru": "Мозамбик", "desc_ru": "" },
+ { "mask": "+264-##-###-####", "cc": "NA", "name_en": "Namibia", "desc_en": "", "name_ru": "Намибия", "desc_ru": "" },
+ { "mask": "+687-##-####", "cc": "NC", "name_en": "New Caledonia", "desc_en": "", "name_ru": "Новая Каледония", "desc_ru": "" },
+ { "mask": "+227-##-##-####", "cc": "NE", "name_en": "Niger", "desc_en": "", "name_ru": "Нигер", "desc_ru": "" },
+ { "mask": "+672-3##-###", "cc": "NF", "name_en": "Norfolk Island", "desc_en": "", "name_ru": "Норфолк (остров)", "desc_ru": "" },
+ { "mask": "+234(###)###-####", "cc": "NG", "name_en": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" },
+ { "mask": "+234-##-###-###", "cc": "NG", "name_en": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" },
+ { "mask": "+234-##-###-##", "cc": "NG", "name_en": "Nigeria", "desc_en": "", "name_ru": "Нигерия", "desc_ru": "" },
+ { "mask": "+234(###)###-####", "cc": "NG", "name_en": "Nigeria ", "desc_en": "mobile", "name_ru": "Нигерия ", "desc_ru": "мобильные" },
+ { "mask": "+505-####-####", "cc": "NI", "name_en": "Nicaragua", "desc_en": "", "name_ru": "Никарагуа", "desc_ru": "" },
+ { "mask": "+31-##-###-####", "cc": "NL", "name_en": "Netherlands", "desc_en": "", "name_ru": "Нидерланды", "desc_ru": "" },
+ { "mask": "+47(###)##-###", "cc": "NO", "name_en": "Norway", "desc_en": "", "name_ru": "Норвегия", "desc_ru": "" },
+ { "mask": "+977-##-###-###", "cc": "NP", "name_en": "Nepal", "desc_en": "", "name_ru": "Непал", "desc_ru": "" },
+ { "mask": "+674-###-####", "cc": "NR", "name_en": "Nauru", "desc_en": "", "name_ru": "Науру", "desc_ru": "" },
+ { "mask": "+683-####", "cc": "NU", "name_en": "Niue", "desc_en": "", "name_ru": "Ниуэ", "desc_ru": "" },
+ { "mask": "+64(###)###-###", "cc": "NZ", "name_en": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" },
+ { "mask": "+64-##-###-###", "cc": "NZ", "name_en": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" },
+ { "mask": "+64(###)###-####", "cc": "NZ", "name_en": "New Zealand", "desc_en": "", "name_ru": "Новая Зеландия", "desc_ru": "" },
+ { "mask": "+968-##-###-###", "cc": "OM", "name_en": "Oman", "desc_en": "", "name_ru": "Оман", "desc_ru": "" },
+ { "mask": "+507-###-####", "cc": "PA", "name_en": "Panama", "desc_en": "", "name_ru": "Панама", "desc_ru": "" },
+ { "mask": "+51(###)###-###", "cc": "PE", "name_en": "Peru", "desc_en": "", "name_ru": "Перу", "desc_ru": "" },
+ { "mask": "+689-##-##-##", "cc": "PF", "name_en": "French Polynesia", "desc_en": "", "name_ru": "Французская Полинезия (Таити)", "desc_ru": "" },
+ { "mask": "+675(###)##-###", "cc": "PG", "name_en": "Papua New Guinea", "desc_en": "", "name_ru": "Папуа-Новая Гвинея", "desc_ru": "" },
+ { "mask": "+63(###)###-####", "cc": "PH", "name_en": "Philippines", "desc_en": "", "name_ru": "Филиппины", "desc_ru": "" },
+ { "mask": "+92(###)###-####", "cc": "PK", "name_en": "Pakistan", "desc_en": "", "name_ru": "Пакистан", "desc_ru": "" },
+ { "mask": "+48(###)###-###", "cc": "PL", "name_en": "Poland", "desc_en": "", "name_ru": "Польша", "desc_ru": "" },
+ { "mask": "+970-##-###-####", "cc": "PS", "name_en": "Palestine", "desc_en": "", "name_ru": "Палестина", "desc_ru": "" },
+ { "mask": "+351-##-###-####", "cc": "PT", "name_en": "Portugal", "desc_en": "", "name_ru": "Португалия", "desc_ru": "" },
+ { "mask": "+680-###-####", "cc": "PW", "name_en": "Palau", "desc_en": "", "name_ru": "Палау", "desc_ru": "" },
+ { "mask": "+595(###)###-###", "cc": "PY", "name_en": "Paraguay", "desc_en": "", "name_ru": "Парагвай", "desc_ru": "" },
+ { "mask": "+974-####-####", "cc": "QA", "name_en": "Qatar", "desc_en": "", "name_ru": "Катар", "desc_ru": "" },
+ { "mask": "+262-#####-####", "cc": "RE", "name_en": "Reunion", "desc_en": "", "name_ru": "Реюньон", "desc_ru": "" },
+ { "mask": "+40-##-###-####", "cc": "RO", "name_en": "Romania", "desc_en": "", "name_ru": "Румыния", "desc_ru": "" },
+ { "mask": "+381-##-###-####", "cc": "RS", "name_en": "Serbia", "desc_en": "", "name_ru": "Сербия", "desc_ru": "" },
+ { "mask": "+7(###)###-##-##", "cc": "RU", "name_en": "Russia", "desc_en": "", "name_ru": "Россия", "desc_ru": "" },
+ { "mask": "+250(###)###-###", "cc": "RW", "name_en": "Rwanda", "desc_en": "", "name_ru": "Руанда", "desc_ru": "" },
+ { "mask": "+966-5-####-####", "cc": "SA", "name_en": "Saudi Arabia ", "desc_en": "mobile", "name_ru": "Саудовская Аравия ", "desc_ru": "мобильные" },
+ { "mask": "+966-#-###-####", "cc": "SA", "name_en": "Saudi Arabia", "desc_en": "", "name_ru": "Саудовская Аравия", "desc_ru": "" },
+ { "mask": "+677-###-####", "cc": "SB", "name_en": "Solomon Islands ", "desc_en": "mobile", "name_ru": "Соломоновы Острова ", "desc_ru": "мобильные" },
+ { "mask": "+677-#####", "cc": "SB", "name_en": "Solomon Islands", "desc_en": "", "name_ru": "Соломоновы Острова", "desc_ru": "" },
+ { "mask": "+248-#-###-###", "cc": "SC", "name_en": "Seychelles", "desc_en": "", "name_ru": "Сейшелы", "desc_ru": "" },
+ { "mask": "+249-##-###-####", "cc": "SD", "name_en": "Sudan", "desc_en": "", "name_ru": "Судан", "desc_ru": "" },
+ { "mask": "+46-##-###-####", "cc": "SE", "name_en": "Sweden", "desc_en": "", "name_ru": "Швеция", "desc_ru": "" },
+ { "mask": "+65-####-####", "cc": "SG", "name_en": "Singapore", "desc_en": "", "name_ru": "Сингапур", "desc_ru": "" },
+ { "mask": "+290-####", "cc": "SH", "name_en": "Saint Helena", "desc_en": "", "name_ru": "Остров Святой Елены", "desc_ru": "" },
+ { "mask": "+290-####", "cc": "SH", "name_en": "Tristan da Cunha", "desc_en": "", "name_ru": "Тристан-да-Кунья", "desc_ru": "" },
+ { "mask": "+386-##-###-###", "cc": "SI", "name_en": "Slovenia", "desc_en": "", "name_ru": "Словения", "desc_ru": "" },
+ { "mask": "+421(###)###-###", "cc": "SK", "name_en": "Slovakia", "desc_en": "", "name_ru": "Словакия", "desc_ru": "" },
+ { "mask": "+232-##-######", "cc": "SL", "name_en": "Sierra Leone", "desc_en": "", "name_ru": "Сьерра-Леоне", "desc_ru": "" },
+ { "mask": "+378-####-######", "cc": "SM", "name_en": "San Marino", "desc_en": "", "name_ru": "Сан-Марино", "desc_ru": "" },
+ { "mask": "+221-##-###-####", "cc": "SN", "name_en": "Senegal", "desc_en": "", "name_ru": "Сенегал", "desc_ru": "" },
+ { "mask": "+252-##-###-###", "cc": "SO", "name_en": "Somalia", "desc_en": "", "name_ru": "Сомали", "desc_ru": "" },
+ { "mask": "+252-#-###-###", "cc": "SO", "name_en": "Somalia", "desc_en": "", "name_ru": "Сомали", "desc_ru": "" },
+ { "mask": "+252-#-###-###", "cc": "SO", "name_en": "Somalia ", "desc_en": "mobile", "name_ru": "Сомали ", "desc_ru": "мобильные" },
+ { "mask": "+597-###-####", "cc": "SR", "name_en": "Suriname ", "desc_en": "mobile", "name_ru": "Суринам ", "desc_ru": "мобильные" },
+ { "mask": "+597-###-###", "cc": "SR", "name_en": "Suriname", "desc_en": "", "name_ru": "Суринам", "desc_ru": "" },
+ { "mask": "+211-##-###-####", "cc": "SS", "name_en": "South Sudan", "desc_en": "", "name_ru": "Южный Судан", "desc_ru": "" },
+ { "mask": "+239-##-#####", "cc": "ST", "name_en": "Sao Tome and Principe", "desc_en": "", "name_ru": "Сан-Томе и Принсипи", "desc_ru": "" },
+ { "mask": "+503-##-##-####", "cc": "SV", "name_en": "El Salvador", "desc_en": "", "name_ru": "Сальвадор", "desc_ru": "" },
+ { "mask": "+1(721)###-####", "cc": "SX", "name_en": "Sint Maarten", "desc_en": "", "name_ru": "Синт-Маартен", "desc_ru": "" },
+ { "mask": "+963-##-####-###", "cc": "SY", "name_en": "Syrian Arab Republic", "desc_en": "", "name_ru": "Сирийская арабская республика", "desc_ru": "" },
+ { "mask": "+268-##-##-####", "cc": "SZ", "name_en": "Swaziland", "desc_en": "", "name_ru": "Свазиленд", "desc_ru": "" },
+ { "mask": "+1(649)###-####", "cc": "TC", "name_en": "Turks & Caicos", "desc_en": "", "name_ru": "Тёркс и Кайкос", "desc_ru": "" },
+ { "mask": "+235-##-##-##-##", "cc": "TD", "name_en": "Chad", "desc_en": "", "name_ru": "Чад", "desc_ru": "" },
+ { "mask": "+228-##-###-###", "cc": "TG", "name_en": "Togo", "desc_en": "", "name_ru": "Того", "desc_ru": "" },
+ { "mask": "+66-##-###-####", "cc": "TH", "name_en": "Thailand ", "desc_en": "mobile", "name_ru": "Таиланд ", "desc_ru": "мобильные" },
+ { "mask": "+66-##-###-###", "cc": "TH", "name_en": "Thailand", "desc_en": "", "name_ru": "Таиланд", "desc_ru": "" },
+ { "mask": "+992-##-###-####", "cc": "TJ", "name_en": "Tajikistan", "desc_en": "", "name_ru": "Таджикистан", "desc_ru": "" },
+ { "mask": "+690-####", "cc": "TK", "name_en": "Tokelau", "desc_en": "", "name_ru": "Токелау", "desc_ru": "" },
+ { "mask": "+670-###-####", "cc": "TL", "name_en": "East Timor", "desc_en": "", "name_ru": "Восточный Тимор", "desc_ru": "" },
+ { "mask": "+670-77#-#####", "cc": "TL", "name_en": "East Timor", "desc_en": "Timor Telecom", "name_ru": "Восточный Тимор", "desc_ru": "Timor Telecom" },
+ { "mask": "+670-78#-#####", "cc": "TL", "name_en": "East Timor", "desc_en": "Timor Telecom", "name_ru": "Восточный Тимор", "desc_ru": "Timor Telecom" },
+ { "mask": "+993-#-###-####", "cc": "TM", "name_en": "Turkmenistan", "desc_en": "", "name_ru": "Туркменистан", "desc_ru": "" },
+ { "mask": "+216-##-###-###", "cc": "TN", "name_en": "Tunisia", "desc_en": "", "name_ru": "Тунис", "desc_ru": "" },
+ { "mask": "+676-#####", "cc": "TO", "name_en": "Tonga", "desc_en": "", "name_ru": "Тонга", "desc_ru": "" },
+ { "mask": "+90(###)###-####", "cc": "TR", "name_en": "Turkey", "desc_en": "", "name_ru": "Турция", "desc_ru": "" },
+ { "mask": "+1(868)###-####", "cc": "TT", "name_en": "Trinidad & Tobago", "desc_en": "", "name_ru": "Тринидад и Тобаго", "desc_ru": "" },
+ { "mask": "+688-90####", "cc": "TV", "name_en": "Tuvalu ", "desc_en": "mobile", "name_ru": "Тувалу ", "desc_ru": "мобильные" },
+ { "mask": "+688-2####", "cc": "TV", "name_en": "Tuvalu", "desc_en": "", "name_ru": "Тувалу", "desc_ru": "" },
+ { "mask": "+886-#-####-####", "cc": "TW", "name_en": "Taiwan", "desc_en": "", "name_ru": "Тайвань", "desc_ru": "" },
+ { "mask": "+886-####-####", "cc": "TW", "name_en": "Taiwan", "desc_en": "", "name_ru": "Тайвань", "desc_ru": "" },
+ { "mask": "+255-##-###-####", "cc": "TZ", "name_en": "Tanzania", "desc_en": "", "name_ru": "Танзания", "desc_ru": "" },
+ { "mask": "+380(##)###-##-##", "cc": "UA", "name_en": "Ukraine", "desc_en": "", "name_ru": "Украина", "desc_ru": "" },
+ { "mask": "+256(###)###-###", "cc": "UG", "name_en": "Uganda", "desc_en": "", "name_ru": "Уганда", "desc_ru": "" },
+ { "mask": "+44-##-####-####", "cc": "UK", "name_en": "United Kingdom", "desc_en": "", "name_ru": "Великобритания", "desc_ru": "" },
+ { "mask": "+598-#-###-##-##", "cc": "UY", "name_en": "Uruguay", "desc_en": "", "name_ru": "Уругвай", "desc_ru": "" },
+ { "mask": "+998-##-###-####", "cc": "UZ", "name_en": "Uzbekistan", "desc_en": "", "name_ru": "Узбекистан", "desc_ru": "" },
+ { "mask": "+39-6-698-#####", "cc": "VA", "name_en": "Vatican City", "desc_en": "", "name_ru": "Ватикан", "desc_ru": "" },
+ { "mask": "+1(784)###-####", "cc": "VC", "name_en": "Saint Vincent & the Grenadines", "desc_en": "", "name_ru": "Сент-Винсент и Гренадины", "desc_ru": "" },
+ { "mask": "+58(###)###-####", "cc": "VE", "name_en": "Venezuela", "desc_en": "", "name_ru": "Венесуэла", "desc_ru": "" },
+ { "mask": "+1(284)###-####", "cc": "VG", "name_en": "British Virgin Islands", "desc_en": "", "name_ru": "Британские Виргинские острова", "desc_ru": "" },
+ { "mask": "+1(340)###-####", "cc": "VI", "name_en": "US Virgin Islands", "desc_en": "", "name_ru": "Американские Виргинские острова", "desc_ru": "" },
+ { "mask": "+84-##-####-###", "cc": "VN", "name_en": "Vietnam", "desc_en": "", "name_ru": "Вьетнам", "desc_ru": "" },
+ { "mask": "+84(###)####-###", "cc": "VN", "name_en": "Vietnam", "desc_en": "", "name_ru": "Вьетнам", "desc_ru": "" },
+ { "mask": "+678-##-#####", "cc": "VU", "name_en": "Vanuatu ", "desc_en": "mobile", "name_ru": "Вануату ", "desc_ru": "мобильные" },
+ { "mask": "+678-#####", "cc": "VU", "name_en": "Vanuatu", "desc_en": "", "name_ru": "Вануату", "desc_ru": "" },
+ { "mask": "+681-##-####", "cc": "WF", "name_en": "Wallis and Futuna", "desc_en": "", "name_ru": "Уоллис и Футуна", "desc_ru": "" },
+ { "mask": "+685-##-####", "cc": "WS", "name_en": "Samoa", "desc_en": "", "name_ru": "Самоа", "desc_ru": "" },
+ { "mask": "+967-###-###-###", "cc": "YE", "name_en": "Yemen ", "desc_en": "mobile", "name_ru": "Йемен ", "desc_ru": "мобильные" },
+ { "mask": "+967-#-###-###", "cc": "YE", "name_en": "Yemen", "desc_en": "", "name_ru": "Йемен", "desc_ru": "" },
+ { "mask": "+967-##-###-###", "cc": "YE", "name_en": "Yemen", "desc_en": "", "name_ru": "Йемен", "desc_ru": "" },
+ { "mask": "+27-##-###-####", "cc": "ZA", "name_en": "South Africa", "desc_en": "", "name_ru": "Южно-Африканская Респ.", "desc_ru": "" },
+ { "mask": "+260-##-###-####", "cc": "ZM", "name_en": "Zambia", "desc_en": "", "name_ru": "Замбия", "desc_ru": "" },
+ { "mask": "+263-#-######", "cc": "ZW", "name_en": "Zimbabwe", "desc_en": "", "name_ru": "Зимбабве", "desc_ru": "" },
+ { "mask": "+1(###)###-####", "cc": ["US", "CA"], "name_en": "USA and Canada", "desc_en": "", "name_ru": "США и Канада", "desc_ru": "" }
+]
diff --git a/public/bower_components/admin-lte/plugins/input-mask/phone-codes/readme.txt b/public/bower_components/admin-lte/plugins/input-mask/phone-codes/readme.txt
new file mode 100644
index 0000000..0a170a7
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/input-mask/phone-codes/readme.txt
@@ -0,0 +1 @@
+more phone masks can be found at https://github.com/andr-04/inputmask-multi \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.js b/public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.js
new file mode 100644
index 0000000..31ee9cd
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.js
@@ -0,0 +1,16617 @@
+/*! jQuery UI - v1.11.4 - 2015-03-11
+* http://jqueryui.com
+* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+(function( factory ) {
+ if ( typeof define === "function" && define.amd ) {
+
+ // AMD. Register as an anonymous module.
+ define([ "jquery" ], factory );
+ } else {
+
+ // Browser globals
+ factory( jQuery );
+ }
+}(function( $ ) {
+/*!
+ * jQuery UI Core 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/ui-core/
+ */
+
+
+// $.ui might exist from components with no dependencies, e.g., $.ui.position
+$.ui = $.ui || {};
+
+$.extend( $.ui, {
+ version: "1.11.4",
+
+ keyCode: {
+ BACKSPACE: 8,
+ COMMA: 188,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ LEFT: 37,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38
+ }
+});
+
+// plugins
+$.fn.extend({
+ scrollParent: function( includeHidden ) {
+ var position = this.css( "position" ),
+ excludeStaticParent = position === "absolute",
+ overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
+ scrollParent = this.parents().filter( function() {
+ var parent = $( this );
+ if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
+ return false;
+ }
+ return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
+ }).eq( 0 );
+
+ return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
+ },
+
+ uniqueId: (function() {
+ var uuid = 0;
+
+ return function() {
+ return this.each(function() {
+ if ( !this.id ) {
+ this.id = "ui-id-" + ( ++uuid );
+ }
+ });
+ };
+ })(),
+
+ removeUniqueId: function() {
+ return this.each(function() {
+ if ( /^ui-id-\d+$/.test( this.id ) ) {
+ $( this ).removeAttr( "id" );
+ }
+ });
+ }
+});
+
+// selectors
+function focusable( element, isTabIndexNotNaN ) {
+ var map, mapName, img,
+ nodeName = element.nodeName.toLowerCase();
+ if ( "area" === nodeName ) {
+ map = element.parentNode;
+ mapName = map.name;
+ if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
+ return false;
+ }
+ img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
+ return !!img && visible( img );
+ }
+ return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
+ !element.disabled :
+ "a" === nodeName ?
+ element.href || isTabIndexNotNaN :
+ isTabIndexNotNaN) &&
+ // the element and all of its ancestors must be visible
+ visible( element );
+}
+
+function visible( element ) {
+ return $.expr.filters.visible( element ) &&
+ !$( element ).parents().addBack().filter(function() {
+ return $.css( this, "visibility" ) === "hidden";
+ }).length;
+}
+
+$.extend( $.expr[ ":" ], {
+ data: $.expr.createPseudo ?
+ $.expr.createPseudo(function( dataName ) {
+ return function( elem ) {
+ return !!$.data( elem, dataName );
+ };
+ }) :
+ // support: jQuery <1.8
+ function( elem, i, match ) {
+ return !!$.data( elem, match[ 3 ] );
+ },
+
+ focusable: function( element ) {
+ return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
+ },
+
+ tabbable: function( element ) {
+ var tabIndex = $.attr( element, "tabindex" ),
+ isTabIndexNaN = isNaN( tabIndex );
+ return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
+ }
+});
+
+// support: jQuery <1.8
+if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
+ $.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+ }
+ });
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each(function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ });
+ };
+
+ $.fn[ "outer" + name] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each(function() {
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
+ });
+ };
+ });
+}
+
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
+ $.fn.removeData = (function( removeData ) {
+ return function( key ) {
+ if ( arguments.length ) {
+ return removeData.call( this, $.camelCase( key ) );
+ } else {
+ return removeData.call( this );
+ }
+ };
+ })( $.fn.removeData );
+}
+
+// deprecated
+$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+
+$.fn.extend({
+ focus: (function( orig ) {
+ return function( delay, fn ) {
+ return typeof delay === "number" ?
+ this.each(function() {
+ var elem = this;
+ setTimeout(function() {
+ $( elem ).focus();
+ if ( fn ) {
+ fn.call( elem );
+ }
+ }, delay );
+ }) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.focus ),
+
+ disableSelection: (function() {
+ var eventType = "onselectstart" in document.createElement( "div" ) ?
+ "selectstart" :
+ "mousedown";
+
+ return function() {
+ return this.bind( eventType + ".ui-disableSelection", function( event ) {
+ event.preventDefault();
+ });
+ };
+ })(),
+
+ enableSelection: function() {
+ return this.unbind( ".ui-disableSelection" );
+ },
+
+ zIndex: function( zIndex ) {
+ if ( zIndex !== undefined ) {
+ return this.css( "zIndex", zIndex );
+ }
+
+ if ( this.length ) {
+ var elem = $( this[ 0 ] ), position, value;
+ while ( elem.length && elem[ 0 ] !== document ) {
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
+ // This makes behavior of this function consistent across browsers
+ // WebKit always returns auto if the element is positioned
+ position = elem.css( "position" );
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+ // IE returns 0 when zIndex is not specified
+ // other browsers return a string
+ // we ignore the case of nested elements with an explicit value of 0
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+ value = parseInt( elem.css( "zIndex" ), 10 );
+ if ( !isNaN( value ) && value !== 0 ) {
+ return value;
+ }
+ }
+ elem = elem.parent();
+ }
+ }
+
+ return 0;
+ }
+});
+
+// $.ui.plugin is deprecated. Use $.widget() extensions instead.
+$.ui.plugin = {
+ add: function( module, option, set ) {
+ var i,
+ proto = $.ui[ module ].prototype;
+ for ( i in set ) {
+ proto.plugins[ i ] = proto.plugins[ i ] || [];
+ proto.plugins[ i ].push( [ option, set[ i ] ] );
+ }
+ },
+ call: function( instance, name, args, allowDisconnected ) {
+ var i,
+ set = instance.plugins[ name ];
+
+ if ( !set ) {
+ return;
+ }
+
+ if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
+ return;
+ }
+
+ for ( i = 0; i < set.length; i++ ) {
+ if ( instance.options[ set[ i ][ 0 ] ] ) {
+ set[ i ][ 1 ].apply( instance.element, args );
+ }
+ }
+ }
+};
+
+
+/*!
+ * jQuery UI Widget 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/jQuery.widget/
+ */
+
+
+var widget_uuid = 0,
+ widget_slice = Array.prototype.slice;
+
+$.cleanData = (function( orig ) {
+ return function( elems ) {
+ var events, elem, i;
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
+ try {
+
+ // Only trigger remove when necessary to save time
+ events = $._data( elem, "events" );
+ if ( events && events.remove ) {
+ $( elem ).triggerHandler( "remove" );
+ }
+
+ // http://bugs.jquery.com/ticket/8235
+ } catch ( e ) {}
+ }
+ orig( elems );
+ };
+})( $.cleanData );
+
+$.widget = function( name, base, prototype ) {
+ var fullName, existingConstructor, constructor, basePrototype,
+ // proxiedPrototype allows the provided prototype to remain unmodified
+ // so that it can be used as a mixin for multiple widgets (#8876)
+ proxiedPrototype = {},
+ namespace = name.split( "." )[ 0 ];
+
+ name = name.split( "." )[ 1 ];
+ fullName = namespace + "-" + name;
+
+ if ( !prototype ) {
+ prototype = base;
+ base = $.Widget;
+ }
+
+ // create selector for plugin
+ $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
+ return !!$.data( elem, fullName );
+ };
+
+ $[ namespace ] = $[ namespace ] || {};
+ existingConstructor = $[ namespace ][ name ];
+ constructor = $[ namespace ][ name ] = function( options, element ) {
+ // allow instantiation without "new" keyword
+ if ( !this._createWidget ) {
+ return new constructor( options, element );
+ }
+
+ // allow instantiation without initializing for simple inheritance
+ // must use "new" keyword (the code above always passes args)
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+ };
+ // extend with the existing constructor to carry over any static properties
+ $.extend( constructor, existingConstructor, {
+ version: prototype.version,
+ // copy the object used to create the prototype in case we need to
+ // redefine the widget later
+ _proto: $.extend( {}, prototype ),
+ // track widgets that inherit from this widget in case this widget is
+ // redefined after a widget inherits from it
+ _childConstructors: []
+ });
+
+ basePrototype = new base();
+ // we need to make the options hash a property directly on the new instance
+ // otherwise we'll modify the options hash on the prototype that we're
+ // inheriting from
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
+ $.each( prototype, function( prop, value ) {
+ if ( !$.isFunction( value ) ) {
+ proxiedPrototype[ prop ] = value;
+ return;
+ }
+ proxiedPrototype[ prop ] = (function() {
+ var _super = function() {
+ return base.prototype[ prop ].apply( this, arguments );
+ },
+ _superApply = function( args ) {
+ return base.prototype[ prop ].apply( this, args );
+ };
+ return function() {
+ var __super = this._super,
+ __superApply = this._superApply,
+ returnValue;
+
+ this._super = _super;
+ this._superApply = _superApply;
+
+ returnValue = value.apply( this, arguments );
+
+ this._super = __super;
+ this._superApply = __superApply;
+
+ return returnValue;
+ };
+ })();
+ });
+ constructor.prototype = $.widget.extend( basePrototype, {
+ // TODO: remove support for widgetEventPrefix
+ // always use the name + a colon as the prefix, e.g., draggable:start
+ // don't prefix for widgets that aren't DOM-based
+ widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
+ }, proxiedPrototype, {
+ constructor: constructor,
+ namespace: namespace,
+ widgetName: name,
+ widgetFullName: fullName
+ });
+
+ // If this widget is being redefined then we need to find all widgets that
+ // are inheriting from it and redefine all of them so that they inherit from
+ // the new version of this widget. We're essentially trying to replace one
+ // level in the prototype chain.
+ if ( existingConstructor ) {
+ $.each( existingConstructor._childConstructors, function( i, child ) {
+ var childPrototype = child.prototype;
+
+ // redefine the child widget using the same prototype that was
+ // originally used, but inherit from the new version of the base
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
+ });
+ // remove the list of existing child constructors from the old constructor
+ // so the old child constructors can be garbage collected
+ delete existingConstructor._childConstructors;
+ } else {
+ base._childConstructors.push( constructor );
+ }
+
+ $.widget.bridge( name, constructor );
+
+ return constructor;
+};
+
+$.widget.extend = function( target ) {
+ var input = widget_slice.call( arguments, 1 ),
+ inputIndex = 0,
+ inputLength = input.length,
+ key,
+ value;
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
+ for ( key in input[ inputIndex ] ) {
+ value = input[ inputIndex ][ key ];
+ if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+ // Clone objects
+ if ( $.isPlainObject( value ) ) {
+ target[ key ] = $.isPlainObject( target[ key ] ) ?
+ $.widget.extend( {}, target[ key ], value ) :
+ // Don't extend strings, arrays, etc. with objects
+ $.widget.extend( {}, value );
+ // Copy everything else by reference
+ } else {
+ target[ key ] = value;
+ }
+ }
+ }
+ }
+ return target;
+};
+
+$.widget.bridge = function( name, object ) {
+ var fullName = object.prototype.widgetFullName || name;
+ $.fn[ name ] = function( options ) {
+ var isMethodCall = typeof options === "string",
+ args = widget_slice.call( arguments, 1 ),
+ returnValue = this;
+
+ if ( isMethodCall ) {
+ this.each(function() {
+ var methodValue,
+ instance = $.data( this, fullName );
+ if ( options === "instance" ) {
+ returnValue = instance;
+ return false;
+ }
+ if ( !instance ) {
+ return $.error( "cannot call methods on " + name + " prior to initialization; " +
+ "attempted to call method '" + options + "'" );
+ }
+ if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
+ return $.error( "no such method '" + options + "' for " + name + " widget instance" );
+ }
+ methodValue = instance[ options ].apply( instance, args );
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue && methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
+ return false;
+ }
+ });
+ } else {
+
+ // Allow multiple hashes to be passed on init
+ if ( args.length ) {
+ options = $.widget.extend.apply( null, [ options ].concat(args) );
+ }
+
+ this.each(function() {
+ var instance = $.data( this, fullName );
+ if ( instance ) {
+ instance.option( options || {} );
+ if ( instance._init ) {
+ instance._init();
+ }
+ } else {
+ $.data( this, fullName, new object( options, this ) );
+ }
+ });
+ }
+
+ return returnValue;
+ };
+};
+
+$.Widget = function( /* options, element */ ) {};
+$.Widget._childConstructors = [];
+
+$.Widget.prototype = {
+ widgetName: "widget",
+ widgetEventPrefix: "",
+ defaultElement: "<div>",
+ options: {
+ disabled: false,
+
+ // callbacks
+ create: null
+ },
+ _createWidget: function( options, element ) {
+ element = $( element || this.defaultElement || this )[ 0 ];
+ this.element = $( element );
+ this.uuid = widget_uuid++;
+ this.eventNamespace = "." + this.widgetName + this.uuid;
+
+ this.bindings = $();
+ this.hoverable = $();
+ this.focusable = $();
+
+ if ( element !== this ) {
+ $.data( element, this.widgetFullName, this );
+ this._on( true, this.element, {
+ remove: function( event ) {
+ if ( event.target === element ) {
+ this.destroy();
+ }
+ }
+ });
+ this.document = $( element.style ?
+ // element within the document
+ element.ownerDocument :
+ // element is window or document
+ element.document || element );
+ this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
+ }
+
+ this.options = $.widget.extend( {},
+ this.options,
+ this._getCreateOptions(),
+ options );
+
+ this._create();
+ this._trigger( "create", null, this._getCreateEventData() );
+ this._init();
+ },
+ _getCreateOptions: $.noop,
+ _getCreateEventData: $.noop,
+ _create: $.noop,
+ _init: $.noop,
+
+ destroy: function() {
+ this._destroy();
+ // we can probably remove the unbind calls in 2.0
+ // all event bindings should go through this._on()
+ this.element
+ .unbind( this.eventNamespace )
+ .removeData( this.widgetFullName )
+ // support: jquery <1.6.3
+ // http://bugs.jquery.com/ticket/9413
+ .removeData( $.camelCase( this.widgetFullName ) );
+ this.widget()
+ .unbind( this.eventNamespace )
+ .removeAttr( "aria-disabled" )
+ .removeClass(
+ this.widgetFullName + "-disabled " +
+ "ui-state-disabled" );
+
+ // clean up events and states
+ this.bindings.unbind( this.eventNamespace );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ },
+ _destroy: $.noop,
+
+ widget: function() {
+ return this.element;
+ },
+
+ option: function( key, value ) {
+ var options = key,
+ parts,
+ curOption,
+ i;
+
+ if ( arguments.length === 0 ) {
+ // don't return a reference to the internal hash
+ return $.widget.extend( {}, this.options );
+ }
+
+ if ( typeof key === "string" ) {
+ // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+ options = {};
+ parts = key.split( "." );
+ key = parts.shift();
+ if ( parts.length ) {
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
+ for ( i = 0; i < parts.length - 1; i++ ) {
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
+ curOption = curOption[ parts[ i ] ];
+ }
+ key = parts.pop();
+ if ( arguments.length === 1 ) {
+ return curOption[ key ] === undefined ? null : curOption[ key ];
+ }
+ curOption[ key ] = value;
+ } else {
+ if ( arguments.length === 1 ) {
+ return this.options[ key ] === undefined ? null : this.options[ key ];
+ }
+ options[ key ] = value;
+ }
+ }
+
+ this._setOptions( options );
+
+ return this;
+ },
+ _setOptions: function( options ) {
+ var key;
+
+ for ( key in options ) {
+ this._setOption( key, options[ key ] );
+ }
+
+ return this;
+ },
+ _setOption: function( key, value ) {
+ this.options[ key ] = value;
+
+ if ( key === "disabled" ) {
+ this.widget()
+ .toggleClass( this.widgetFullName + "-disabled", !!value );
+
+ // If the widget is becoming disabled, then nothing is interactive
+ if ( value ) {
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ }
+ }
+
+ return this;
+ },
+
+ enable: function() {
+ return this._setOptions({ disabled: false });
+ },
+ disable: function() {
+ return this._setOptions({ disabled: true });
+ },
+
+ _on: function( suppressDisabledCheck, element, handlers ) {
+ var delegateElement,
+ instance = this;
+
+ // no suppressDisabledCheck flag, shuffle arguments
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
+ handlers = element;
+ element = suppressDisabledCheck;
+ suppressDisabledCheck = false;
+ }
+
+ // no element argument, shuffle and use this.element
+ if ( !handlers ) {
+ handlers = element;
+ element = this.element;
+ delegateElement = this.widget();
+ } else {
+ element = delegateElement = $( element );
+ this.bindings = this.bindings.add( element );
+ }
+
+ $.each( handlers, function( event, handler ) {
+ function handlerProxy() {
+ // allow widgets to customize the disabled handling
+ // - disabled as an array instead of boolean
+ // - disabled class as method for disabling individual parts
+ if ( !suppressDisabledCheck &&
+ ( instance.options.disabled === true ||
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
+ return;
+ }
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+
+ // copy the guid so direct unbinding works
+ if ( typeof handler !== "string" ) {
+ handlerProxy.guid = handler.guid =
+ handler.guid || handlerProxy.guid || $.guid++;
+ }
+
+ var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
+ eventName = match[1] + instance.eventNamespace,
+ selector = match[2];
+ if ( selector ) {
+ delegateElement.delegate( selector, eventName, handlerProxy );
+ } else {
+ element.bind( eventName, handlerProxy );
+ }
+ });
+ },
+
+ _off: function( element, eventName ) {
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
+ this.eventNamespace;
+ element.unbind( eventName ).undelegate( eventName );
+
+ // Clear the stack to avoid memory leaks (#10056)
+ this.bindings = $( this.bindings.not( element ).get() );
+ this.focusable = $( this.focusable.not( element ).get() );
+ this.hoverable = $( this.hoverable.not( element ).get() );
+ },
+
+ _delay: function( handler, delay ) {
+ function handlerProxy() {
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+ var instance = this;
+ return setTimeout( handlerProxy, delay || 0 );
+ },
+
+ _hoverable: function( element ) {
+ this.hoverable = this.hoverable.add( element );
+ this._on( element, {
+ mouseenter: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-hover" );
+ },
+ mouseleave: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-hover" );
+ }
+ });
+ },
+
+ _focusable: function( element ) {
+ this.focusable = this.focusable.add( element );
+ this._on( element, {
+ focusin: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-focus" );
+ },
+ focusout: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-focus" );
+ }
+ });
+ },
+
+ _trigger: function( type, event, data ) {
+ var prop, orig,
+ callback = this.options[ type ];
+
+ data = data || {};
+ event = $.Event( event );
+ event.type = ( type === this.widgetEventPrefix ?
+ type :
+ this.widgetEventPrefix + type ).toLowerCase();
+ // the original event may come from any element
+ // so we need to reset the target on the new event
+ event.target = this.element[ 0 ];
+
+ // copy original event properties over to the new event
+ orig = event.originalEvent;
+ if ( orig ) {
+ for ( prop in orig ) {
+ if ( !( prop in event ) ) {
+ event[ prop ] = orig[ prop ];
+ }
+ }
+ }
+
+ this.element.trigger( event, data );
+ return !( $.isFunction( callback ) &&
+ callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
+ event.isDefaultPrevented() );
+ }
+};
+
+$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
+ if ( typeof options === "string" ) {
+ options = { effect: options };
+ }
+ var hasOptions,
+ effectName = !options ?
+ method :
+ options === true || typeof options === "number" ?
+ defaultEffect :
+ options.effect || defaultEffect;
+ options = options || {};
+ if ( typeof options === "number" ) {
+ options = { duration: options };
+ }
+ hasOptions = !$.isEmptyObject( options );
+ options.complete = callback;
+ if ( options.delay ) {
+ element.delay( options.delay );
+ }
+ if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
+ element[ method ]( options );
+ } else if ( effectName !== method && element[ effectName ] ) {
+ element[ effectName ]( options.duration, options.easing, callback );
+ } else {
+ element.queue(function( next ) {
+ $( this )[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ next();
+ });
+ }
+ };
+});
+
+var widget = $.widget;
+
+
+/*!
+ * jQuery UI Mouse 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/mouse/
+ */
+
+
+var mouseHandled = false;
+$( document ).mouseup( function() {
+ mouseHandled = false;
+});
+
+var mouse = $.widget("ui.mouse", {
+ version: "1.11.4",
+ options: {
+ cancel: "input,textarea,button,select,option",
+ distance: 1,
+ delay: 0
+ },
+ _mouseInit: function() {
+ var that = this;
+
+ this.element
+ .bind("mousedown." + this.widgetName, function(event) {
+ return that._mouseDown(event);
+ })
+ .bind("click." + this.widgetName, function(event) {
+ if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
+ $.removeData(event.target, that.widgetName + ".preventClickEvent");
+ event.stopImmediatePropagation();
+ return false;
+ }
+ });
+
+ this.started = false;
+ },
+
+ // TODO: make sure destroying one instance of mouse doesn't mess with
+ // other instances of mouse
+ _mouseDestroy: function() {
+ this.element.unbind("." + this.widgetName);
+ if ( this._mouseMoveDelegate ) {
+ this.document
+ .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
+ .unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
+ }
+ },
+
+ _mouseDown: function(event) {
+ // don't let more than one widget handle mouseStart
+ if ( mouseHandled ) {
+ return;
+ }
+
+ this._mouseMoved = false;
+
+ // we may have missed mouseup (out of window)
+ (this._mouseStarted && this._mouseUp(event));
+
+ this._mouseDownEvent = event;
+
+ var that = this,
+ btnIsLeft = (event.which === 1),
+ // event.target.nodeName works around a bug in IE 8 with
+ // disabled inputs (#7620)
+ elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
+ if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
+ return true;
+ }
+
+ this.mouseDelayMet = !this.options.delay;
+ if (!this.mouseDelayMet) {
+ this._mouseDelayTimer = setTimeout(function() {
+ that.mouseDelayMet = true;
+ }, this.options.delay);
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted = (this._mouseStart(event) !== false);
+ if (!this._mouseStarted) {
+ event.preventDefault();
+ return true;
+ }
+ }
+
+ // Click event may never have fired (Gecko & Opera)
+ if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
+ $.removeData(event.target, this.widgetName + ".preventClickEvent");
+ }
+
+ // these delegates are required to keep context
+ this._mouseMoveDelegate = function(event) {
+ return that._mouseMove(event);
+ };
+ this._mouseUpDelegate = function(event) {
+ return that._mouseUp(event);
+ };
+
+ this.document
+ .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+ .bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
+
+ event.preventDefault();
+
+ mouseHandled = true;
+ return true;
+ },
+
+ _mouseMove: function(event) {
+ // Only check for mouseups outside the document if you've moved inside the document
+ // at least once. This prevents the firing of mouseup in the case of IE<9, which will
+ // fire a mousemove event if content is placed under the cursor. See #7778
+ // Support: IE <9
+ if ( this._mouseMoved ) {
+ // IE mouseup check - mouseup happened when mouse was out of window
+ if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
+ return this._mouseUp(event);
+
+ // Iframe mouseup check - mouseup occurred in another document
+ } else if ( !event.which ) {
+ return this._mouseUp( event );
+ }
+ }
+
+ if ( event.which || event.button ) {
+ this._mouseMoved = true;
+ }
+
+ if (this._mouseStarted) {
+ this._mouseDrag(event);
+ return event.preventDefault();
+ }
+
+ if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
+ this._mouseStarted =
+ (this._mouseStart(this._mouseDownEvent, event) !== false);
+ (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
+ }
+
+ return !this._mouseStarted;
+ },
+
+ _mouseUp: function(event) {
+ this.document
+ .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
+ .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
+
+ if (this._mouseStarted) {
+ this._mouseStarted = false;
+
+ if (event.target === this._mouseDownEvent.target) {
+ $.data(event.target, this.widgetName + ".preventClickEvent", true);
+ }
+
+ this._mouseStop(event);
+ }
+
+ mouseHandled = false;
+ return false;
+ },
+
+ _mouseDistanceMet: function(event) {
+ return (Math.max(
+ Math.abs(this._mouseDownEvent.pageX - event.pageX),
+ Math.abs(this._mouseDownEvent.pageY - event.pageY)
+ ) >= this.options.distance
+ );
+ },
+
+ _mouseDelayMet: function(/* event */) {
+ return this.mouseDelayMet;
+ },
+
+ // These are placeholder methods, to be overriden by extending plugin
+ _mouseStart: function(/* event */) {},
+ _mouseDrag: function(/* event */) {},
+ _mouseStop: function(/* event */) {},
+ _mouseCapture: function(/* event */) { return true; }
+});
+
+
+/*!
+ * jQuery UI Position 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/position/
+ */
+
+(function() {
+
+$.ui = $.ui || {};
+
+var cachedScrollbarWidth, supportsOffsetFractions,
+ max = Math.max,
+ abs = Math.abs,
+ round = Math.round,
+ rhorizontal = /left|center|right/,
+ rvertical = /top|center|bottom/,
+ roffset = /[\+\-]\d+(\.[\d]+)?%?/,
+ rposition = /^\w+/,
+ rpercent = /%$/,
+ _position = $.fn.position;
+
+function getOffsets( offsets, width, height ) {
+ return [
+ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
+ parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
+ ];
+}
+
+function parseCss( element, property ) {
+ return parseInt( $.css( element, property ), 10 ) || 0;
+}
+
+function getDimensions( elem ) {
+ var raw = elem[0];
+ if ( raw.nodeType === 9 ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: 0, left: 0 }
+ };
+ }
+ if ( $.isWindow( raw ) ) {
+ return {
+ width: elem.width(),
+ height: elem.height(),
+ offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
+ };
+ }
+ if ( raw.preventDefault ) {
+ return {
+ width: 0,
+ height: 0,
+ offset: { top: raw.pageY, left: raw.pageX }
+ };
+ }
+ return {
+ width: elem.outerWidth(),
+ height: elem.outerHeight(),
+ offset: elem.offset()
+ };
+}
+
+$.position = {
+ scrollbarWidth: function() {
+ if ( cachedScrollbarWidth !== undefined ) {
+ return cachedScrollbarWidth;
+ }
+ var w1, w2,
+ div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
+ innerDiv = div.children()[0];
+
+ $( "body" ).append( div );
+ w1 = innerDiv.offsetWidth;
+ div.css( "overflow", "scroll" );
+
+ w2 = innerDiv.offsetWidth;
+
+ if ( w1 === w2 ) {
+ w2 = div[0].clientWidth;
+ }
+
+ div.remove();
+
+ return (cachedScrollbarWidth = w1 - w2);
+ },
+ getScrollInfo: function( within ) {
+ var overflowX = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-x" ),
+ overflowY = within.isWindow || within.isDocument ? "" :
+ within.element.css( "overflow-y" ),
+ hasOverflowX = overflowX === "scroll" ||
+ ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
+ hasOverflowY = overflowY === "scroll" ||
+ ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
+ return {
+ width: hasOverflowY ? $.position.scrollbarWidth() : 0,
+ height: hasOverflowX ? $.position.scrollbarWidth() : 0
+ };
+ },
+ getWithinInfo: function( element ) {
+ var withinElement = $( element || window ),
+ isWindow = $.isWindow( withinElement[0] ),
+ isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
+ return {
+ element: withinElement,
+ isWindow: isWindow,
+ isDocument: isDocument,
+ offset: withinElement.offset() || { left: 0, top: 0 },
+ scrollLeft: withinElement.scrollLeft(),
+ scrollTop: withinElement.scrollTop(),
+
+ // support: jQuery 1.6.x
+ // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
+ width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
+ height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
+ };
+ }
+};
+
+$.fn.position = function( options ) {
+ if ( !options || !options.of ) {
+ return _position.apply( this, arguments );
+ }
+
+ // make a copy, we don't want to modify arguments
+ options = $.extend( {}, options );
+
+ var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
+ target = $( options.of ),
+ within = $.position.getWithinInfo( options.within ),
+ scrollInfo = $.position.getScrollInfo( within ),
+ collision = ( options.collision || "flip" ).split( " " ),
+ offsets = {};
+
+ dimensions = getDimensions( target );
+ if ( target[0].preventDefault ) {
+ // force left top to allow flipping
+ options.at = "left top";
+ }
+ targetWidth = dimensions.width;
+ targetHeight = dimensions.height;
+ targetOffset = dimensions.offset;
+ // clone to reuse original targetOffset later
+ basePosition = $.extend( {}, targetOffset );
+
+ // force my and at to have valid horizontal and vertical positions
+ // if a value is missing or invalid, it will be converted to center
+ $.each( [ "my", "at" ], function() {
+ var pos = ( options[ this ] || "" ).split( " " ),
+ horizontalOffset,
+ verticalOffset;
+
+ if ( pos.length === 1) {
+ pos = rhorizontal.test( pos[ 0 ] ) ?
+ pos.concat( [ "center" ] ) :
+ rvertical.test( pos[ 0 ] ) ?
+ [ "center" ].concat( pos ) :
+ [ "center", "center" ];
+ }
+ pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
+ pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
+
+ // calculate offsets
+ horizontalOffset = roffset.exec( pos[ 0 ] );
+ verticalOffset = roffset.exec( pos[ 1 ] );
+ offsets[ this ] = [
+ horizontalOffset ? horizontalOffset[ 0 ] : 0,
+ verticalOffset ? verticalOffset[ 0 ] : 0
+ ];
+
+ // reduce to just the positions without the offsets
+ options[ this ] = [
+ rposition.exec( pos[ 0 ] )[ 0 ],
+ rposition.exec( pos[ 1 ] )[ 0 ]
+ ];
+ });
+
+ // normalize collision option
+ if ( collision.length === 1 ) {
+ collision[ 1 ] = collision[ 0 ];
+ }
+
+ if ( options.at[ 0 ] === "right" ) {
+ basePosition.left += targetWidth;
+ } else if ( options.at[ 0 ] === "center" ) {
+ basePosition.left += targetWidth / 2;
+ }
+
+ if ( options.at[ 1 ] === "bottom" ) {
+ basePosition.top += targetHeight;
+ } else if ( options.at[ 1 ] === "center" ) {
+ basePosition.top += targetHeight / 2;
+ }
+
+ atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
+ basePosition.left += atOffset[ 0 ];
+ basePosition.top += atOffset[ 1 ];
+
+ return this.each(function() {
+ var collisionPosition, using,
+ elem = $( this ),
+ elemWidth = elem.outerWidth(),
+ elemHeight = elem.outerHeight(),
+ marginLeft = parseCss( this, "marginLeft" ),
+ marginTop = parseCss( this, "marginTop" ),
+ collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
+ collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
+ position = $.extend( {}, basePosition ),
+ myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
+
+ if ( options.my[ 0 ] === "right" ) {
+ position.left -= elemWidth;
+ } else if ( options.my[ 0 ] === "center" ) {
+ position.left -= elemWidth / 2;
+ }
+
+ if ( options.my[ 1 ] === "bottom" ) {
+ position.top -= elemHeight;
+ } else if ( options.my[ 1 ] === "center" ) {
+ position.top -= elemHeight / 2;
+ }
+
+ position.left += myOffset[ 0 ];
+ position.top += myOffset[ 1 ];
+
+ // if the browser doesn't support fractions, then round for consistent results
+ if ( !supportsOffsetFractions ) {
+ position.left = round( position.left );
+ position.top = round( position.top );
+ }
+
+ collisionPosition = {
+ marginLeft: marginLeft,
+ marginTop: marginTop
+ };
+
+ $.each( [ "left", "top" ], function( i, dir ) {
+ if ( $.ui.position[ collision[ i ] ] ) {
+ $.ui.position[ collision[ i ] ][ dir ]( position, {
+ targetWidth: targetWidth,
+ targetHeight: targetHeight,
+ elemWidth: elemWidth,
+ elemHeight: elemHeight,
+ collisionPosition: collisionPosition,
+ collisionWidth: collisionWidth,
+ collisionHeight: collisionHeight,
+ offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
+ my: options.my,
+ at: options.at,
+ within: within,
+ elem: elem
+ });
+ }
+ });
+
+ if ( options.using ) {
+ // adds feedback as second argument to using callback, if present
+ using = function( props ) {
+ var left = targetOffset.left - position.left,
+ right = left + targetWidth - elemWidth,
+ top = targetOffset.top - position.top,
+ bottom = top + targetHeight - elemHeight,
+ feedback = {
+ target: {
+ element: target,
+ left: targetOffset.left,
+ top: targetOffset.top,
+ width: targetWidth,
+ height: targetHeight
+ },
+ element: {
+ element: elem,
+ left: position.left,
+ top: position.top,
+ width: elemWidth,
+ height: elemHeight
+ },
+ horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
+ vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
+ };
+ if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
+ feedback.horizontal = "center";
+ }
+ if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
+ feedback.vertical = "middle";
+ }
+ if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
+ feedback.important = "horizontal";
+ } else {
+ feedback.important = "vertical";
+ }
+ options.using.call( this, props, feedback );
+ };
+ }
+
+ elem.offset( $.extend( position, { using: using } ) );
+ });
+};
+
+$.ui.position = {
+ fit: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
+ outerWidth = within.width,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = withinOffset - collisionPosLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
+ newOverRight;
+
+ // element is wider than within
+ if ( data.collisionWidth > outerWidth ) {
+ // element is initially over the left side of within
+ if ( overLeft > 0 && overRight <= 0 ) {
+ newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
+ position.left += overLeft - newOverRight;
+ // element is initially over right side of within
+ } else if ( overRight > 0 && overLeft <= 0 ) {
+ position.left = withinOffset;
+ // element is initially over both left and right sides of within
+ } else {
+ if ( overLeft > overRight ) {
+ position.left = withinOffset + outerWidth - data.collisionWidth;
+ } else {
+ position.left = withinOffset;
+ }
+ }
+ // too far left -> align with left edge
+ } else if ( overLeft > 0 ) {
+ position.left += overLeft;
+ // too far right -> align with right edge
+ } else if ( overRight > 0 ) {
+ position.left -= overRight;
+ // adjust based on position and margin
+ } else {
+ position.left = max( position.left - collisionPosLeft, position.left );
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
+ outerHeight = data.within.height,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = withinOffset - collisionPosTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
+ newOverBottom;
+
+ // element is taller than within
+ if ( data.collisionHeight > outerHeight ) {
+ // element is initially over the top of within
+ if ( overTop > 0 && overBottom <= 0 ) {
+ newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
+ position.top += overTop - newOverBottom;
+ // element is initially over bottom of within
+ } else if ( overBottom > 0 && overTop <= 0 ) {
+ position.top = withinOffset;
+ // element is initially over both top and bottom of within
+ } else {
+ if ( overTop > overBottom ) {
+ position.top = withinOffset + outerHeight - data.collisionHeight;
+ } else {
+ position.top = withinOffset;
+ }
+ }
+ // too far up -> align with top
+ } else if ( overTop > 0 ) {
+ position.top += overTop;
+ // too far down -> align with bottom edge
+ } else if ( overBottom > 0 ) {
+ position.top -= overBottom;
+ // adjust based on position and margin
+ } else {
+ position.top = max( position.top - collisionPosTop, position.top );
+ }
+ }
+ },
+ flip: {
+ left: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.left + within.scrollLeft,
+ outerWidth = within.width,
+ offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
+ collisionPosLeft = position.left - data.collisionPosition.marginLeft,
+ overLeft = collisionPosLeft - offsetLeft,
+ overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
+ myOffset = data.my[ 0 ] === "left" ?
+ -data.elemWidth :
+ data.my[ 0 ] === "right" ?
+ data.elemWidth :
+ 0,
+ atOffset = data.at[ 0 ] === "left" ?
+ data.targetWidth :
+ data.at[ 0 ] === "right" ?
+ -data.targetWidth :
+ 0,
+ offset = -2 * data.offset[ 0 ],
+ newOverRight,
+ newOverLeft;
+
+ if ( overLeft < 0 ) {
+ newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
+ if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ } else if ( overRight > 0 ) {
+ newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
+ if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
+ position.left += myOffset + atOffset + offset;
+ }
+ }
+ },
+ top: function( position, data ) {
+ var within = data.within,
+ withinOffset = within.offset.top + within.scrollTop,
+ outerHeight = within.height,
+ offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
+ collisionPosTop = position.top - data.collisionPosition.marginTop,
+ overTop = collisionPosTop - offsetTop,
+ overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
+ top = data.my[ 1 ] === "top",
+ myOffset = top ?
+ -data.elemHeight :
+ data.my[ 1 ] === "bottom" ?
+ data.elemHeight :
+ 0,
+ atOffset = data.at[ 1 ] === "top" ?
+ data.targetHeight :
+ data.at[ 1 ] === "bottom" ?
+ -data.targetHeight :
+ 0,
+ offset = -2 * data.offset[ 1 ],
+ newOverTop,
+ newOverBottom;
+ if ( overTop < 0 ) {
+ newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
+ if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ } else if ( overBottom > 0 ) {
+ newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
+ if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
+ position.top += myOffset + atOffset + offset;
+ }
+ }
+ }
+ },
+ flipfit: {
+ left: function() {
+ $.ui.position.flip.left.apply( this, arguments );
+ $.ui.position.fit.left.apply( this, arguments );
+ },
+ top: function() {
+ $.ui.position.flip.top.apply( this, arguments );
+ $.ui.position.fit.top.apply( this, arguments );
+ }
+ }
+};
+
+// fraction support test
+(function() {
+ var testElement, testElementParent, testElementStyle, offsetLeft, i,
+ body = document.getElementsByTagName( "body" )[ 0 ],
+ div = document.createElement( "div" );
+
+ //Create a "fake body" for testing based on method used in jQuery.support
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
+ visibility: "hidden",
+ width: 0,
+ height: 0,
+ border: 0,
+ margin: 0,
+ background: "none"
+ };
+ if ( body ) {
+ $.extend( testElementStyle, {
+ position: "absolute",
+ left: "-1000px",
+ top: "-1000px"
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
+ }
+ testElement.appendChild( div );
+ testElementParent = body || document.documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
+
+ div.style.cssText = "position: absolute; left: 10.7432222px;";
+
+ offsetLeft = $( div ).offset().left;
+ supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
+
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
+})();
+
+})();
+
+var position = $.ui.position;
+
+
+/*!
+ * jQuery UI Accordion 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/accordion/
+ */
+
+
+var accordion = $.widget( "ui.accordion", {
+ version: "1.11.4",
+ options: {
+ active: 0,
+ animate: {},
+ collapsible: false,
+ event: "click",
+ header: "> li > :first-child,> :not(li):even",
+ heightStyle: "auto",
+ icons: {
+ activeHeader: "ui-icon-triangle-1-s",
+ header: "ui-icon-triangle-1-e"
+ },
+
+ // callbacks
+ activate: null,
+ beforeActivate: null
+ },
+
+ hideProps: {
+ borderTopWidth: "hide",
+ borderBottomWidth: "hide",
+ paddingTop: "hide",
+ paddingBottom: "hide",
+ height: "hide"
+ },
+
+ showProps: {
+ borderTopWidth: "show",
+ borderBottomWidth: "show",
+ paddingTop: "show",
+ paddingBottom: "show",
+ height: "show"
+ },
+
+ _create: function() {
+ var options = this.options;
+ this.prevShow = this.prevHide = $();
+ this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
+ // ARIA
+ .attr( "role", "tablist" );
+
+ // don't allow collapsible: false and active: false / null
+ if ( !options.collapsible && (options.active === false || options.active == null) ) {
+ options.active = 0;
+ }
+
+ this._processPanels();
+ // handle negative values
+ if ( options.active < 0 ) {
+ options.active += this.headers.length;
+ }
+ this._refresh();
+ },
+
+ _getCreateEventData: function() {
+ return {
+ header: this.active,
+ panel: !this.active.length ? $() : this.active.next()
+ };
+ },
+
+ _createIcons: function() {
+ var icons = this.options.icons;
+ if ( icons ) {
+ $( "<span>" )
+ .addClass( "ui-accordion-header-icon ui-icon " + icons.header )
+ .prependTo( this.headers );
+ this.active.children( ".ui-accordion-header-icon" )
+ .removeClass( icons.header )
+ .addClass( icons.activeHeader );
+ this.headers.addClass( "ui-accordion-icons" );
+ }
+ },
+
+ _destroyIcons: function() {
+ this.headers
+ .removeClass( "ui-accordion-icons" )
+ .children( ".ui-accordion-header-icon" )
+ .remove();
+ },
+
+ _destroy: function() {
+ var contents;
+
+ // clean up main element
+ this.element
+ .removeClass( "ui-accordion ui-widget ui-helper-reset" )
+ .removeAttr( "role" );
+
+ // clean up headers
+ this.headers
+ .removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
+ "ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-selected" )
+ .removeAttr( "aria-controls" )
+ .removeAttr( "tabIndex" )
+ .removeUniqueId();
+
+ this._destroyIcons();
+
+ // clean up content panels
+ contents = this.headers.next()
+ .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
+ "ui-accordion-content ui-accordion-content-active ui-state-disabled" )
+ .css( "display", "" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-labelledby" )
+ .removeUniqueId();
+
+ if ( this.options.heightStyle !== "content" ) {
+ contents.css( "height", "" );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "active" ) {
+ // _activate() will handle invalid values and update this.options
+ this._activate( value );
+ return;
+ }
+
+ if ( key === "event" ) {
+ if ( this.options.event ) {
+ this._off( this.headers, this.options.event );
+ }
+ this._setupEvents( value );
+ }
+
+ this._super( key, value );
+
+ // setting collapsible: false while collapsed; open first panel
+ if ( key === "collapsible" && !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
+
+ if ( key === "icons" ) {
+ this._destroyIcons();
+ if ( value ) {
+ this._createIcons();
+ }
+ }
+
+ // #5332 - opacity doesn't cascade to positioned elements in IE
+ // so we need to add the disabled class to the headers and panels
+ if ( key === "disabled" ) {
+ this.element
+ .toggleClass( "ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ this.headers.add( this.headers.next() )
+ .toggleClass( "ui-state-disabled", !!value );
+ }
+ },
+
+ _keydown: function( event ) {
+ if ( event.altKey || event.ctrlKey ) {
+ return;
+ }
+
+ var keyCode = $.ui.keyCode,
+ length = this.headers.length,
+ currentIndex = this.headers.index( event.target ),
+ toFocus = false;
+
+ switch ( event.keyCode ) {
+ case keyCode.RIGHT:
+ case keyCode.DOWN:
+ toFocus = this.headers[ ( currentIndex + 1 ) % length ];
+ break;
+ case keyCode.LEFT:
+ case keyCode.UP:
+ toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
+ break;
+ case keyCode.SPACE:
+ case keyCode.ENTER:
+ this._eventHandler( event );
+ break;
+ case keyCode.HOME:
+ toFocus = this.headers[ 0 ];
+ break;
+ case keyCode.END:
+ toFocus = this.headers[ length - 1 ];
+ break;
+ }
+
+ if ( toFocus ) {
+ $( event.target ).attr( "tabIndex", -1 );
+ $( toFocus ).attr( "tabIndex", 0 );
+ toFocus.focus();
+ event.preventDefault();
+ }
+ },
+
+ _panelKeyDown: function( event ) {
+ if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
+ $( event.currentTarget ).prev().focus();
+ }
+ },
+
+ refresh: function() {
+ var options = this.options;
+ this._processPanels();
+
+ // was collapsed or no panel
+ if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
+ options.active = false;
+ this.active = $();
+ // active false only when collapsible is true
+ } else if ( options.active === false ) {
+ this._activate( 0 );
+ // was active, but active panel is gone
+ } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+ // all remaining panel are disabled
+ if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
+ options.active = false;
+ this.active = $();
+ // activate previous panel
+ } else {
+ this._activate( Math.max( 0, options.active - 1 ) );
+ }
+ // was active, active panel still exists
+ } else {
+ // make sure active index is correct
+ options.active = this.headers.index( this.active );
+ }
+
+ this._destroyIcons();
+
+ this._refresh();
+ },
+
+ _processPanels: function() {
+ var prevHeaders = this.headers,
+ prevPanels = this.panels;
+
+ this.headers = this.element.find( this.options.header )
+ .addClass( "ui-accordion-header ui-state-default ui-corner-all" );
+
+ this.panels = this.headers.next()
+ .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
+ .filter( ":not(.ui-accordion-content-active)" )
+ .hide();
+
+ // Avoid memory leaks (#10056)
+ if ( prevPanels ) {
+ this._off( prevHeaders.not( this.headers ) );
+ this._off( prevPanels.not( this.panels ) );
+ }
+ },
+
+ _refresh: function() {
+ var maxHeight,
+ options = this.options,
+ heightStyle = options.heightStyle,
+ parent = this.element.parent();
+
+ this.active = this._findActive( options.active )
+ .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
+ .removeClass( "ui-corner-all" );
+ this.active.next()
+ .addClass( "ui-accordion-content-active" )
+ .show();
+
+ this.headers
+ .attr( "role", "tab" )
+ .each(function() {
+ var header = $( this ),
+ headerId = header.uniqueId().attr( "id" ),
+ panel = header.next(),
+ panelId = panel.uniqueId().attr( "id" );
+ header.attr( "aria-controls", panelId );
+ panel.attr( "aria-labelledby", headerId );
+ })
+ .next()
+ .attr( "role", "tabpanel" );
+
+ this.headers
+ .not( this.active )
+ .attr({
+ "aria-selected": "false",
+ "aria-expanded": "false",
+ tabIndex: -1
+ })
+ .next()
+ .attr({
+ "aria-hidden": "true"
+ })
+ .hide();
+
+ // make sure at least one header is in the tab order
+ if ( !this.active.length ) {
+ this.headers.eq( 0 ).attr( "tabIndex", 0 );
+ } else {
+ this.active.attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ })
+ .next()
+ .attr({
+ "aria-hidden": "false"
+ });
+ }
+
+ this._createIcons();
+
+ this._setupEvents( options.event );
+
+ if ( heightStyle === "fill" ) {
+ maxHeight = parent.height();
+ this.element.siblings( ":visible" ).each(function() {
+ var elem = $( this ),
+ position = elem.css( "position" );
+
+ if ( position === "absolute" || position === "fixed" ) {
+ return;
+ }
+ maxHeight -= elem.outerHeight( true );
+ });
+
+ this.headers.each(function() {
+ maxHeight -= $( this ).outerHeight( true );
+ });
+
+ this.headers.next()
+ .each(function() {
+ $( this ).height( Math.max( 0, maxHeight -
+ $( this ).innerHeight() + $( this ).height() ) );
+ })
+ .css( "overflow", "auto" );
+ } else if ( heightStyle === "auto" ) {
+ maxHeight = 0;
+ this.headers.next()
+ .each(function() {
+ maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
+ })
+ .height( maxHeight );
+ }
+ },
+
+ _activate: function( index ) {
+ var active = this._findActive( index )[ 0 ];
+
+ // trying to activate the already active panel
+ if ( active === this.active[ 0 ] ) {
+ return;
+ }
+
+ // trying to collapse, simulate a click on the currently active header
+ active = active || this.active[ 0 ];
+
+ this._eventHandler({
+ target: active,
+ currentTarget: active,
+ preventDefault: $.noop
+ });
+ },
+
+ _findActive: function( selector ) {
+ return typeof selector === "number" ? this.headers.eq( selector ) : $();
+ },
+
+ _setupEvents: function( event ) {
+ var events = {
+ keydown: "_keydown"
+ };
+ if ( event ) {
+ $.each( event.split( " " ), function( index, eventName ) {
+ events[ eventName ] = "_eventHandler";
+ });
+ }
+
+ this._off( this.headers.add( this.headers.next() ) );
+ this._on( this.headers, events );
+ this._on( this.headers.next(), { keydown: "_panelKeyDown" });
+ this._hoverable( this.headers );
+ this._focusable( this.headers );
+ },
+
+ _eventHandler: function( event ) {
+ var options = this.options,
+ active = this.active,
+ clicked = $( event.currentTarget ),
+ clickedIsActive = clicked[ 0 ] === active[ 0 ],
+ collapsing = clickedIsActive && options.collapsible,
+ toShow = collapsing ? $() : clicked.next(),
+ toHide = active.next(),
+ eventData = {
+ oldHeader: active,
+ oldPanel: toHide,
+ newHeader: collapsing ? $() : clicked,
+ newPanel: toShow
+ };
+
+ event.preventDefault();
+
+ if (
+ // click on active header, but not collapsible
+ ( clickedIsActive && !options.collapsible ) ||
+ // allow canceling activation
+ ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
+ return;
+ }
+
+ options.active = collapsing ? false : this.headers.index( clicked );
+
+ // when the call to ._toggle() comes after the class changes
+ // it causes a very odd bug in IE 8 (see #6720)
+ this.active = clickedIsActive ? $() : clicked;
+ this._toggle( eventData );
+
+ // switch classes
+ // corner classes on the previously active header stay after the animation
+ active.removeClass( "ui-accordion-header-active ui-state-active" );
+ if ( options.icons ) {
+ active.children( ".ui-accordion-header-icon" )
+ .removeClass( options.icons.activeHeader )
+ .addClass( options.icons.header );
+ }
+
+ if ( !clickedIsActive ) {
+ clicked
+ .removeClass( "ui-corner-all" )
+ .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
+ if ( options.icons ) {
+ clicked.children( ".ui-accordion-header-icon" )
+ .removeClass( options.icons.header )
+ .addClass( options.icons.activeHeader );
+ }
+
+ clicked
+ .next()
+ .addClass( "ui-accordion-content-active" );
+ }
+ },
+
+ _toggle: function( data ) {
+ var toShow = data.newPanel,
+ toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
+
+ // handle activating a panel during the animation for another activation
+ this.prevShow.add( this.prevHide ).stop( true, true );
+ this.prevShow = toShow;
+ this.prevHide = toHide;
+
+ if ( this.options.animate ) {
+ this._animate( toShow, toHide, data );
+ } else {
+ toHide.hide();
+ toShow.show();
+ this._toggleComplete( data );
+ }
+
+ toHide.attr({
+ "aria-hidden": "true"
+ });
+ toHide.prev().attr({
+ "aria-selected": "false",
+ "aria-expanded": "false"
+ });
+ // if we're switching panels, remove the old header from the tab order
+ // if we're opening from collapsed state, remove the previous header from the tab order
+ // if we're collapsing, then keep the collapsing header in the tab order
+ if ( toShow.length && toHide.length ) {
+ toHide.prev().attr({
+ "tabIndex": -1,
+ "aria-expanded": "false"
+ });
+ } else if ( toShow.length ) {
+ this.headers.filter(function() {
+ return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
+ })
+ .attr( "tabIndex", -1 );
+ }
+
+ toShow
+ .attr( "aria-hidden", "false" )
+ .prev()
+ .attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ });
+ },
+
+ _animate: function( toShow, toHide, data ) {
+ var total, easing, duration,
+ that = this,
+ adjust = 0,
+ boxSizing = toShow.css( "box-sizing" ),
+ down = toShow.length &&
+ ( !toHide.length || ( toShow.index() < toHide.index() ) ),
+ animate = this.options.animate || {},
+ options = down && animate.down || animate,
+ complete = function() {
+ that._toggleComplete( data );
+ };
+
+ if ( typeof options === "number" ) {
+ duration = options;
+ }
+ if ( typeof options === "string" ) {
+ easing = options;
+ }
+ // fall back from options to animation in case of partial down settings
+ easing = easing || options.easing || animate.easing;
+ duration = duration || options.duration || animate.duration;
+
+ if ( !toHide.length ) {
+ return toShow.animate( this.showProps, duration, easing, complete );
+ }
+ if ( !toShow.length ) {
+ return toHide.animate( this.hideProps, duration, easing, complete );
+ }
+
+ total = toShow.show().outerHeight();
+ toHide.animate( this.hideProps, {
+ duration: duration,
+ easing: easing,
+ step: function( now, fx ) {
+ fx.now = Math.round( now );
+ }
+ });
+ toShow
+ .hide()
+ .animate( this.showProps, {
+ duration: duration,
+ easing: easing,
+ complete: complete,
+ step: function( now, fx ) {
+ fx.now = Math.round( now );
+ if ( fx.prop !== "height" ) {
+ if ( boxSizing === "content-box" ) {
+ adjust += fx.now;
+ }
+ } else if ( that.options.heightStyle !== "content" ) {
+ fx.now = Math.round( total - toHide.outerHeight() - adjust );
+ adjust = 0;
+ }
+ }
+ });
+ },
+
+ _toggleComplete: function( data ) {
+ var toHide = data.oldPanel;
+
+ toHide
+ .removeClass( "ui-accordion-content-active" )
+ .prev()
+ .removeClass( "ui-corner-top" )
+ .addClass( "ui-corner-all" );
+
+ // Work around for rendering bug in IE (#5421)
+ if ( toHide.length ) {
+ toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
+ }
+ this._trigger( "activate", null, data );
+ }
+});
+
+
+/*!
+ * jQuery UI Menu 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/menu/
+ */
+
+
+var menu = $.widget( "ui.menu", {
+ version: "1.11.4",
+ defaultElement: "<ul>",
+ delay: 300,
+ options: {
+ icons: {
+ submenu: "ui-icon-carat-1-e"
+ },
+ items: "> *",
+ menus: "ul",
+ position: {
+ my: "left-1 top",
+ at: "right top"
+ },
+ role: "menu",
+
+ // callbacks
+ blur: null,
+ focus: null,
+ select: null
+ },
+
+ _create: function() {
+ this.activeMenu = this.element;
+
+ // Flag used to prevent firing of the click handler
+ // as the event bubbles up through nested menus
+ this.mouseHandled = false;
+ this.element
+ .uniqueId()
+ .addClass( "ui-menu ui-widget ui-widget-content" )
+ .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
+ .attr({
+ role: this.options.role,
+ tabIndex: 0
+ });
+
+ if ( this.options.disabled ) {
+ this.element
+ .addClass( "ui-state-disabled" )
+ .attr( "aria-disabled", "true" );
+ }
+
+ this._on({
+ // Prevent focus from sticking to links inside menu after clicking
+ // them (focus should always stay on UL during navigation).
+ "mousedown .ui-menu-item": function( event ) {
+ event.preventDefault();
+ },
+ "click .ui-menu-item": function( event ) {
+ var target = $( event.target );
+ if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
+ this.select( event );
+
+ // Only set the mouseHandled flag if the event will bubble, see #9469.
+ if ( !event.isPropagationStopped() ) {
+ this.mouseHandled = true;
+ }
+
+ // Open submenu on click
+ if ( target.has( ".ui-menu" ).length ) {
+ this.expand( event );
+ } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
+
+ // Redirect focus to the menu
+ this.element.trigger( "focus", [ true ] );
+
+ // If the active item is on the top level, let it stay active.
+ // Otherwise, blur the active item since it is no longer visible.
+ if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
+ clearTimeout( this.timer );
+ }
+ }
+ }
+ },
+ "mouseenter .ui-menu-item": function( event ) {
+ // Ignore mouse events while typeahead is active, see #10458.
+ // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
+ // is over an item in the menu
+ if ( this.previousFilter ) {
+ return;
+ }
+ var target = $( event.currentTarget );
+ // Remove ui-state-active class from siblings of the newly focused menu item
+ // to avoid a jump caused by adjacent elements both having a class with a border
+ target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
+ this.focus( event, target );
+ },
+ mouseleave: "collapseAll",
+ "mouseleave .ui-menu": "collapseAll",
+ focus: function( event, keepActiveItem ) {
+ // If there's already an active item, keep it active
+ // If not, activate the first item
+ var item = this.active || this.element.find( this.options.items ).eq( 0 );
+
+ if ( !keepActiveItem ) {
+ this.focus( event, item );
+ }
+ },
+ blur: function( event ) {
+ this._delay(function() {
+ if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
+ this.collapseAll( event );
+ }
+ });
+ },
+ keydown: "_keydown"
+ });
+
+ this.refresh();
+
+ // Clicks outside of a menu collapse any open menus
+ this._on( this.document, {
+ click: function( event ) {
+ if ( this._closeOnDocumentClick( event ) ) {
+ this.collapseAll( event );
+ }
+
+ // Reset the mouseHandled flag
+ this.mouseHandled = false;
+ }
+ });
+ },
+
+ _destroy: function() {
+ // Destroy (sub)menus
+ this.element
+ .removeAttr( "aria-activedescendant" )
+ .find( ".ui-menu" ).addBack()
+ .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
+ .removeAttr( "role" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "aria-labelledby" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-disabled" )
+ .removeUniqueId()
+ .show();
+
+ // Destroy menu items
+ this.element.find( ".ui-menu-item" )
+ .removeClass( "ui-menu-item" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-disabled" )
+ .removeUniqueId()
+ .removeClass( "ui-state-hover" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-haspopup" )
+ .children().each( function() {
+ var elem = $( this );
+ if ( elem.data( "ui-menu-submenu-carat" ) ) {
+ elem.remove();
+ }
+ });
+
+ // Destroy menu dividers
+ this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
+ },
+
+ _keydown: function( event ) {
+ var match, prev, character, skip,
+ preventDefault = true;
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.PAGE_UP:
+ this.previousPage( event );
+ break;
+ case $.ui.keyCode.PAGE_DOWN:
+ this.nextPage( event );
+ break;
+ case $.ui.keyCode.HOME:
+ this._move( "first", "first", event );
+ break;
+ case $.ui.keyCode.END:
+ this._move( "last", "last", event );
+ break;
+ case $.ui.keyCode.UP:
+ this.previous( event );
+ break;
+ case $.ui.keyCode.DOWN:
+ this.next( event );
+ break;
+ case $.ui.keyCode.LEFT:
+ this.collapse( event );
+ break;
+ case $.ui.keyCode.RIGHT:
+ if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
+ this.expand( event );
+ }
+ break;
+ case $.ui.keyCode.ENTER:
+ case $.ui.keyCode.SPACE:
+ this._activate( event );
+ break;
+ case $.ui.keyCode.ESCAPE:
+ this.collapse( event );
+ break;
+ default:
+ preventDefault = false;
+ prev = this.previousFilter || "";
+ character = String.fromCharCode( event.keyCode );
+ skip = false;
+
+ clearTimeout( this.filterTimer );
+
+ if ( character === prev ) {
+ skip = true;
+ } else {
+ character = prev + character;
+ }
+
+ match = this._filterMenuItems( character );
+ match = skip && match.index( this.active.next() ) !== -1 ?
+ this.active.nextAll( ".ui-menu-item" ) :
+ match;
+
+ // If no matches on the current filter, reset to the last character pressed
+ // to move down the menu to the first item that starts with that character
+ if ( !match.length ) {
+ character = String.fromCharCode( event.keyCode );
+ match = this._filterMenuItems( character );
+ }
+
+ if ( match.length ) {
+ this.focus( event, match );
+ this.previousFilter = character;
+ this.filterTimer = this._delay(function() {
+ delete this.previousFilter;
+ }, 1000 );
+ } else {
+ delete this.previousFilter;
+ }
+ }
+
+ if ( preventDefault ) {
+ event.preventDefault();
+ }
+ },
+
+ _activate: function( event ) {
+ if ( !this.active.is( ".ui-state-disabled" ) ) {
+ if ( this.active.is( "[aria-haspopup='true']" ) ) {
+ this.expand( event );
+ } else {
+ this.select( event );
+ }
+ }
+ },
+
+ refresh: function() {
+ var menus, items,
+ that = this,
+ icon = this.options.icons.submenu,
+ submenus = this.element.find( this.options.menus );
+
+ this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
+
+ // Initialize nested menus
+ submenus.filter( ":not(.ui-menu)" )
+ .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
+ .hide()
+ .attr({
+ role: this.options.role,
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ })
+ .each(function() {
+ var menu = $( this ),
+ item = menu.parent(),
+ submenuCarat = $( "<span>" )
+ .addClass( "ui-menu-icon ui-icon " + icon )
+ .data( "ui-menu-submenu-carat", true );
+
+ item
+ .attr( "aria-haspopup", "true" )
+ .prepend( submenuCarat );
+ menu.attr( "aria-labelledby", item.attr( "id" ) );
+ });
+
+ menus = submenus.add( this.element );
+ items = menus.find( this.options.items );
+
+ // Initialize menu-items containing spaces and/or dashes only as dividers
+ items.not( ".ui-menu-item" ).each(function() {
+ var item = $( this );
+ if ( that._isDivider( item ) ) {
+ item.addClass( "ui-widget-content ui-menu-divider" );
+ }
+ });
+
+ // Don't refresh list items that are already adapted
+ items.not( ".ui-menu-item, .ui-menu-divider" )
+ .addClass( "ui-menu-item" )
+ .uniqueId()
+ .attr({
+ tabIndex: -1,
+ role: this._itemRole()
+ });
+
+ // Add aria-disabled attribute to any disabled menu item
+ items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
+
+ // If the active item has been removed, blur the menu
+ if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+ this.blur();
+ }
+ },
+
+ _itemRole: function() {
+ return {
+ menu: "menuitem",
+ listbox: "option"
+ }[ this.options.role ];
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "icons" ) {
+ this.element.find( ".ui-menu-icon" )
+ .removeClass( this.options.icons.submenu )
+ .addClass( value.submenu );
+ }
+ if ( key === "disabled" ) {
+ this.element
+ .toggleClass( "ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ }
+ this._super( key, value );
+ },
+
+ focus: function( event, item ) {
+ var nested, focused;
+ this.blur( event, event && event.type === "focus" );
+
+ this._scrollIntoView( item );
+
+ this.active = item.first();
+ focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
+ // Only update aria-activedescendant if there's a role
+ // otherwise we assume focus is managed elsewhere
+ if ( this.options.role ) {
+ this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
+ }
+
+ // Highlight active parent menu item, if any
+ this.active
+ .parent()
+ .closest( ".ui-menu-item" )
+ .addClass( "ui-state-active" );
+
+ if ( event && event.type === "keydown" ) {
+ this._close();
+ } else {
+ this.timer = this._delay(function() {
+ this._close();
+ }, this.delay );
+ }
+
+ nested = item.children( ".ui-menu" );
+ if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
+ this._startOpening(nested);
+ }
+ this.activeMenu = item.parent();
+
+ this._trigger( "focus", event, { item: item } );
+ },
+
+ _scrollIntoView: function( item ) {
+ var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
+ if ( this._hasScroll() ) {
+ borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
+ paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
+ offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
+ scroll = this.activeMenu.scrollTop();
+ elementHeight = this.activeMenu.height();
+ itemHeight = item.outerHeight();
+
+ if ( offset < 0 ) {
+ this.activeMenu.scrollTop( scroll + offset );
+ } else if ( offset + itemHeight > elementHeight ) {
+ this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
+ }
+ }
+ },
+
+ blur: function( event, fromFocus ) {
+ if ( !fromFocus ) {
+ clearTimeout( this.timer );
+ }
+
+ if ( !this.active ) {
+ return;
+ }
+
+ this.active.removeClass( "ui-state-focus" );
+ this.active = null;
+
+ this._trigger( "blur", event, { item: this.active } );
+ },
+
+ _startOpening: function( submenu ) {
+ clearTimeout( this.timer );
+
+ // Don't open if already open fixes a Firefox bug that caused a .5 pixel
+ // shift in the submenu position when mousing over the carat icon
+ if ( submenu.attr( "aria-hidden" ) !== "true" ) {
+ return;
+ }
+
+ this.timer = this._delay(function() {
+ this._close();
+ this._open( submenu );
+ }, this.delay );
+ },
+
+ _open: function( submenu ) {
+ var position = $.extend({
+ of: this.active
+ }, this.options.position );
+
+ clearTimeout( this.timer );
+ this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
+ .hide()
+ .attr( "aria-hidden", "true" );
+
+ submenu
+ .show()
+ .removeAttr( "aria-hidden" )
+ .attr( "aria-expanded", "true" )
+ .position( position );
+ },
+
+ collapseAll: function( event, all ) {
+ clearTimeout( this.timer );
+ this.timer = this._delay(function() {
+ // If we were passed an event, look for the submenu that contains the event
+ var currentMenu = all ? this.element :
+ $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
+
+ // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
+ if ( !currentMenu.length ) {
+ currentMenu = this.element;
+ }
+
+ this._close( currentMenu );
+
+ this.blur( event );
+ this.activeMenu = currentMenu;
+ }, this.delay );
+ },
+
+ // With no arguments, closes the currently active menu - if nothing is active
+ // it closes all menus. If passed an argument, it will search for menus BELOW
+ _close: function( startMenu ) {
+ if ( !startMenu ) {
+ startMenu = this.active ? this.active.parent() : this.element;
+ }
+
+ startMenu
+ .find( ".ui-menu" )
+ .hide()
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" )
+ .end()
+ .find( ".ui-state-active" ).not( ".ui-state-focus" )
+ .removeClass( "ui-state-active" );
+ },
+
+ _closeOnDocumentClick: function( event ) {
+ return !$( event.target ).closest( ".ui-menu" ).length;
+ },
+
+ _isDivider: function( item ) {
+
+ // Match hyphen, em dash, en dash
+ return !/[^\-\u2014\u2013\s]/.test( item.text() );
+ },
+
+ collapse: function( event ) {
+ var newItem = this.active &&
+ this.active.parent().closest( ".ui-menu-item", this.element );
+ if ( newItem && newItem.length ) {
+ this._close();
+ this.focus( event, newItem );
+ }
+ },
+
+ expand: function( event ) {
+ var newItem = this.active &&
+ this.active
+ .children( ".ui-menu " )
+ .find( this.options.items )
+ .first();
+
+ if ( newItem && newItem.length ) {
+ this._open( newItem.parent() );
+
+ // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
+ this._delay(function() {
+ this.focus( event, newItem );
+ });
+ }
+ },
+
+ next: function( event ) {
+ this._move( "next", "first", event );
+ },
+
+ previous: function( event ) {
+ this._move( "prev", "last", event );
+ },
+
+ isFirstItem: function() {
+ return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
+ },
+
+ isLastItem: function() {
+ return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
+ },
+
+ _move: function( direction, filter, event ) {
+ var next;
+ if ( this.active ) {
+ if ( direction === "first" || direction === "last" ) {
+ next = this.active
+ [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
+ .eq( -1 );
+ } else {
+ next = this.active
+ [ direction + "All" ]( ".ui-menu-item" )
+ .eq( 0 );
+ }
+ }
+ if ( !next || !next.length || !this.active ) {
+ next = this.activeMenu.find( this.options.items )[ filter ]();
+ }
+
+ this.focus( event, next );
+ },
+
+ nextPage: function( event ) {
+ var item, base, height;
+
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isLastItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.nextAll( ".ui-menu-item" ).each(function() {
+ item = $( this );
+ return item.offset().top - base - height < 0;
+ });
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.find( this.options.items )
+ [ !this.active ? "first" : "last" ]() );
+ }
+ },
+
+ previousPage: function( event ) {
+ var item, base, height;
+ if ( !this.active ) {
+ this.next( event );
+ return;
+ }
+ if ( this.isFirstItem() ) {
+ return;
+ }
+ if ( this._hasScroll() ) {
+ base = this.active.offset().top;
+ height = this.element.height();
+ this.active.prevAll( ".ui-menu-item" ).each(function() {
+ item = $( this );
+ return item.offset().top - base + height > 0;
+ });
+
+ this.focus( event, item );
+ } else {
+ this.focus( event, this.activeMenu.find( this.options.items ).first() );
+ }
+ },
+
+ _hasScroll: function() {
+ return this.element.outerHeight() < this.element.prop( "scrollHeight" );
+ },
+
+ select: function( event ) {
+ // TODO: It should never be possible to not have an active item at this
+ // point, but the tests don't trigger mouseenter before click.
+ this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
+ var ui = { item: this.active };
+ if ( !this.active.has( ".ui-menu" ).length ) {
+ this.collapseAll( event, true );
+ }
+ this._trigger( "select", event, ui );
+ },
+
+ _filterMenuItems: function(character) {
+ var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
+ regex = new RegExp( "^" + escapedCharacter, "i" );
+
+ return this.activeMenu
+ .find( this.options.items )
+
+ // Only match on items, not dividers or other content (#10571)
+ .filter( ".ui-menu-item" )
+ .filter(function() {
+ return regex.test( $.trim( $( this ).text() ) );
+ });
+ }
+});
+
+
+/*!
+ * jQuery UI Autocomplete 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/autocomplete/
+ */
+
+
+$.widget( "ui.autocomplete", {
+ version: "1.11.4",
+ defaultElement: "<input>",
+ options: {
+ appendTo: null,
+ autoFocus: false,
+ delay: 300,
+ minLength: 1,
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ source: null,
+
+ // callbacks
+ change: null,
+ close: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
+ },
+
+ requestIndex: 0,
+ pending: 0,
+
+ _create: function() {
+ // Some browsers only repeat keydown events, not keypress events,
+ // so we use the suppressKeyPress flag to determine if we've already
+ // handled the keydown event. #7269
+ // Unfortunately the code for & in keypress is the same as the up arrow,
+ // so we use the suppressKeyPressRepeat flag to avoid handling keypress
+ // events when we know the keydown event was used to modify the
+ // search term. #7799
+ var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
+ nodeName = this.element[ 0 ].nodeName.toLowerCase(),
+ isTextarea = nodeName === "textarea",
+ isInput = nodeName === "input";
+
+ this.isMultiLine =
+ // Textareas are always multi-line
+ isTextarea ? true :
+ // Inputs are always single-line, even if inside a contentEditable element
+ // IE also treats inputs as contentEditable
+ isInput ? false :
+ // All other element types are determined by whether or not they're contentEditable
+ this.element.prop( "isContentEditable" );
+
+ this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
+ this.isNewMenu = true;
+
+ this.element
+ .addClass( "ui-autocomplete-input" )
+ .attr( "autocomplete", "off" );
+
+ this._on( this.element, {
+ keydown: function( event ) {
+ if ( this.element.prop( "readOnly" ) ) {
+ suppressKeyPress = true;
+ suppressInput = true;
+ suppressKeyPressRepeat = true;
+ return;
+ }
+
+ suppressKeyPress = false;
+ suppressInput = false;
+ suppressKeyPressRepeat = false;
+ var keyCode = $.ui.keyCode;
+ switch ( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ suppressKeyPress = true;
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ suppressKeyPress = true;
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ suppressKeyPress = true;
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ suppressKeyPress = true;
+ this._keyEvent( "next", event );
+ break;
+ case keyCode.ENTER:
+ // when menu is open and has focus
+ if ( this.menu.active ) {
+ // #6055 - Opera still allows the keypress to occur
+ // which causes forms to submit
+ suppressKeyPress = true;
+ event.preventDefault();
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.TAB:
+ if ( this.menu.active ) {
+ this.menu.select( event );
+ }
+ break;
+ case keyCode.ESCAPE:
+ if ( this.menu.element.is( ":visible" ) ) {
+ if ( !this.isMultiLine ) {
+ this._value( this.term );
+ }
+ this.close( event );
+ // Different browsers have different default behavior for escape
+ // Single press can mean undo or clear
+ // Double press in IE means clear the whole form
+ event.preventDefault();
+ }
+ break;
+ default:
+ suppressKeyPressRepeat = true;
+ // search timeout should be triggered before the input value is changed
+ this._searchTimeout( event );
+ break;
+ }
+ },
+ keypress: function( event ) {
+ if ( suppressKeyPress ) {
+ suppressKeyPress = false;
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ event.preventDefault();
+ }
+ return;
+ }
+ if ( suppressKeyPressRepeat ) {
+ return;
+ }
+
+ // replicate some key handlers to allow them to repeat in Firefox and Opera
+ var keyCode = $.ui.keyCode;
+ switch ( event.keyCode ) {
+ case keyCode.PAGE_UP:
+ this._move( "previousPage", event );
+ break;
+ case keyCode.PAGE_DOWN:
+ this._move( "nextPage", event );
+ break;
+ case keyCode.UP:
+ this._keyEvent( "previous", event );
+ break;
+ case keyCode.DOWN:
+ this._keyEvent( "next", event );
+ break;
+ }
+ },
+ input: function( event ) {
+ if ( suppressInput ) {
+ suppressInput = false;
+ event.preventDefault();
+ return;
+ }
+ this._searchTimeout( event );
+ },
+ focus: function() {
+ this.selectedItem = null;
+ this.previous = this._value();
+ },
+ blur: function( event ) {
+ if ( this.cancelBlur ) {
+ delete this.cancelBlur;
+ return;
+ }
+
+ clearTimeout( this.searching );
+ this.close( event );
+ this._change( event );
+ }
+ });
+
+ this._initSource();
+ this.menu = $( "<ul>" )
+ .addClass( "ui-autocomplete ui-front" )
+ .appendTo( this._appendTo() )
+ .menu({
+ // disable ARIA support, the live region takes care of that
+ role: null
+ })
+ .hide()
+ .menu( "instance" );
+
+ this._on( this.menu.element, {
+ mousedown: function( event ) {
+ // prevent moving focus out of the text field
+ event.preventDefault();
+
+ // IE doesn't prevent moving focus even with event.preventDefault()
+ // so we set a flag to know when we should ignore the blur event
+ this.cancelBlur = true;
+ this._delay(function() {
+ delete this.cancelBlur;
+ });
+
+ // clicking on the scrollbar causes focus to shift to the body
+ // but we can't detect a mouseup or a click immediately afterward
+ // so we have to track the next mousedown and close the menu if
+ // the user clicks somewhere outside of the autocomplete
+ var menuElement = this.menu.element[ 0 ];
+ if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
+ this._delay(function() {
+ var that = this;
+ this.document.one( "mousedown", function( event ) {
+ if ( event.target !== that.element[ 0 ] &&
+ event.target !== menuElement &&
+ !$.contains( menuElement, event.target ) ) {
+ that.close();
+ }
+ });
+ });
+ }
+ },
+ menufocus: function( event, ui ) {
+ var label, item;
+ // support: Firefox
+ // Prevent accidental activation of menu items in Firefox (#7024 #9118)
+ if ( this.isNewMenu ) {
+ this.isNewMenu = false;
+ if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
+ this.menu.blur();
+
+ this.document.one( "mousemove", function() {
+ $( event.target ).trigger( event.originalEvent );
+ });
+
+ return;
+ }
+ }
+
+ item = ui.item.data( "ui-autocomplete-item" );
+ if ( false !== this._trigger( "focus", event, { item: item } ) ) {
+ // use value to match what will end up in the input, if it was a key event
+ if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
+ this._value( item.value );
+ }
+ }
+
+ // Announce the value in the liveRegion
+ label = ui.item.attr( "aria-label" ) || item.value;
+ if ( label && $.trim( label ).length ) {
+ this.liveRegion.children().hide();
+ $( "<div>" ).text( label ).appendTo( this.liveRegion );
+ }
+ },
+ menuselect: function( event, ui ) {
+ var item = ui.item.data( "ui-autocomplete-item" ),
+ previous = this.previous;
+
+ // only trigger when focus was lost (click on menu)
+ if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
+ this.element.focus();
+ this.previous = previous;
+ // #6109 - IE triggers two focus events and the second
+ // is asynchronous, so we need to reset the previous
+ // term synchronously and asynchronously :-(
+ this._delay(function() {
+ this.previous = previous;
+ this.selectedItem = item;
+ });
+ }
+
+ if ( false !== this._trigger( "select", event, { item: item } ) ) {
+ this._value( item.value );
+ }
+ // reset the term after the select event
+ // this allows custom select handling to work properly
+ this.term = this._value();
+
+ this.close( event );
+ this.selectedItem = item;
+ }
+ });
+
+ this.liveRegion = $( "<span>", {
+ role: "status",
+ "aria-live": "assertive",
+ "aria-relevant": "additions"
+ })
+ .addClass( "ui-helper-hidden-accessible" )
+ .appendTo( this.document[ 0 ].body );
+
+ // turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._on( this.window, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ });
+ },
+
+ _destroy: function() {
+ clearTimeout( this.searching );
+ this.element
+ .removeClass( "ui-autocomplete-input" )
+ .removeAttr( "autocomplete" );
+ this.menu.element.remove();
+ this.liveRegion.remove();
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "source" ) {
+ this._initSource();
+ }
+ if ( key === "appendTo" ) {
+ this.menu.element.appendTo( this._appendTo() );
+ }
+ if ( key === "disabled" && value && this.xhr ) {
+ this.xhr.abort();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+
+ if ( element ) {
+ element = element.jquery || element.nodeType ?
+ $( element ) :
+ this.document.find( element ).eq( 0 );
+ }
+
+ if ( !element || !element[ 0 ] ) {
+ element = this.element.closest( ".ui-front" );
+ }
+
+ if ( !element.length ) {
+ element = this.document[ 0 ].body;
+ }
+
+ return element;
+ },
+
+ _initSource: function() {
+ var array, url,
+ that = this;
+ if ( $.isArray( this.options.source ) ) {
+ array = this.options.source;
+ this.source = function( request, response ) {
+ response( $.ui.autocomplete.filter( array, request.term ) );
+ };
+ } else if ( typeof this.options.source === "string" ) {
+ url = this.options.source;
+ this.source = function( request, response ) {
+ if ( that.xhr ) {
+ that.xhr.abort();
+ }
+ that.xhr = $.ajax({
+ url: url,
+ data: request,
+ dataType: "json",
+ success: function( data ) {
+ response( data );
+ },
+ error: function() {
+ response([]);
+ }
+ });
+ };
+ } else {
+ this.source = this.options.source;
+ }
+ },
+
+ _searchTimeout: function( event ) {
+ clearTimeout( this.searching );
+ this.searching = this._delay(function() {
+
+ // Search if the value has changed, or if the user retypes the same value (see #7434)
+ var equalValues = this.term === this._value(),
+ menuVisible = this.menu.element.is( ":visible" ),
+ modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
+
+ if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
+ this.selectedItem = null;
+ this.search( null, event );
+ }
+ }, this.options.delay );
+ },
+
+ search: function( value, event ) {
+ value = value != null ? value : this._value();
+
+ // always save the actual value, not the one passed as an argument
+ this.term = this._value();
+
+ if ( value.length < this.options.minLength ) {
+ return this.close( event );
+ }
+
+ if ( this._trigger( "search", event ) === false ) {
+ return;
+ }
+
+ return this._search( value );
+ },
+
+ _search: function( value ) {
+ this.pending++;
+ this.element.addClass( "ui-autocomplete-loading" );
+ this.cancelSearch = false;
+
+ this.source( { term: value }, this._response() );
+ },
+
+ _response: function() {
+ var index = ++this.requestIndex;
+
+ return $.proxy(function( content ) {
+ if ( index === this.requestIndex ) {
+ this.__response( content );
+ }
+
+ this.pending--;
+ if ( !this.pending ) {
+ this.element.removeClass( "ui-autocomplete-loading" );
+ }
+ }, this );
+ },
+
+ __response: function( content ) {
+ if ( content ) {
+ content = this._normalize( content );
+ }
+ this._trigger( "response", null, { content: content } );
+ if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
+ this._suggest( content );
+ this._trigger( "open" );
+ } else {
+ // use ._close() instead of .close() so we don't cancel future searches
+ this._close();
+ }
+ },
+
+ close: function( event ) {
+ this.cancelSearch = true;
+ this._close( event );
+ },
+
+ _close: function( event ) {
+ if ( this.menu.element.is( ":visible" ) ) {
+ this.menu.element.hide();
+ this.menu.blur();
+ this.isNewMenu = true;
+ this._trigger( "close", event );
+ }
+ },
+
+ _change: function( event ) {
+ if ( this.previous !== this._value() ) {
+ this._trigger( "change", event, { item: this.selectedItem } );
+ }
+ },
+
+ _normalize: function( items ) {
+ // assume all items have the right format when the first item is complete
+ if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
+ return items;
+ }
+ return $.map( items, function( item ) {
+ if ( typeof item === "string" ) {
+ return {
+ label: item,
+ value: item
+ };
+ }
+ return $.extend( {}, item, {
+ label: item.label || item.value,
+ value: item.value || item.label
+ });
+ });
+ },
+
+ _suggest: function( items ) {
+ var ul = this.menu.element.empty();
+ this._renderMenu( ul, items );
+ this.isNewMenu = true;
+ this.menu.refresh();
+
+ // size and position menu
+ ul.show();
+ this._resizeMenu();
+ ul.position( $.extend({
+ of: this.element
+ }, this.options.position ) );
+
+ if ( this.options.autoFocus ) {
+ this.menu.next();
+ }
+ },
+
+ _resizeMenu: function() {
+ var ul = this.menu.element;
+ ul.outerWidth( Math.max(
+ // Firefox wraps long text (possibly a rounding bug)
+ // so we add 1px to avoid the wrapping (#7513)
+ ul.width( "" ).outerWidth() + 1,
+ this.element.outerWidth()
+ ) );
+ },
+
+ _renderMenu: function( ul, items ) {
+ var that = this;
+ $.each( items, function( index, item ) {
+ that._renderItemData( ul, item );
+ });
+ },
+
+ _renderItemData: function( ul, item ) {
+ return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
+ },
+
+ _renderItem: function( ul, item ) {
+ return $( "<li>" ).text( item.label ).appendTo( ul );
+ },
+
+ _move: function( direction, event ) {
+ if ( !this.menu.element.is( ":visible" ) ) {
+ this.search( null, event );
+ return;
+ }
+ if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
+ this.menu.isLastItem() && /^next/.test( direction ) ) {
+
+ if ( !this.isMultiLine ) {
+ this._value( this.term );
+ }
+
+ this.menu.blur();
+ return;
+ }
+ this.menu[ direction ]( event );
+ },
+
+ widget: function() {
+ return this.menu.element;
+ },
+
+ _value: function() {
+ return this.valueMethod.apply( this.element, arguments );
+ },
+
+ _keyEvent: function( keyEvent, event ) {
+ if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
+ this._move( keyEvent, event );
+
+ // prevents moving cursor to beginning/end of the text field in some browsers
+ event.preventDefault();
+ }
+ }
+});
+
+$.extend( $.ui.autocomplete, {
+ escapeRegex: function( value ) {
+ return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
+ },
+ filter: function( array, term ) {
+ var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
+ return $.grep( array, function( value ) {
+ return matcher.test( value.label || value.value || value );
+ });
+ }
+});
+
+// live region extension, adding a `messages` option
+// NOTE: This is an experimental API. We are still investigating
+// a full solution for string manipulation and internationalization.
+$.widget( "ui.autocomplete", $.ui.autocomplete, {
+ options: {
+ messages: {
+ noResults: "No search results.",
+ results: function( amount ) {
+ return amount + ( amount > 1 ? " results are" : " result is" ) +
+ " available, use up and down arrow keys to navigate.";
+ }
+ }
+ },
+
+ __response: function( content ) {
+ var message;
+ this._superApply( arguments );
+ if ( this.options.disabled || this.cancelSearch ) {
+ return;
+ }
+ if ( content && content.length ) {
+ message = this.options.messages.results( content.length );
+ } else {
+ message = this.options.messages.noResults;
+ }
+ this.liveRegion.children().hide();
+ $( "<div>" ).text( message ).appendTo( this.liveRegion );
+ }
+});
+
+var autocomplete = $.ui.autocomplete;
+
+
+/*!
+ * jQuery UI Button 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/button/
+ */
+
+
+var lastActive,
+ baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
+ typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
+ formResetHandler = function() {
+ var form = $( this );
+ setTimeout(function() {
+ form.find( ":ui-button" ).button( "refresh" );
+ }, 1 );
+ },
+ radioGroup = function( radio ) {
+ var name = radio.name,
+ form = radio.form,
+ radios = $( [] );
+ if ( name ) {
+ name = name.replace( /'/g, "\\'" );
+ if ( form ) {
+ radios = $( form ).find( "[name='" + name + "'][type=radio]" );
+ } else {
+ radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
+ .filter(function() {
+ return !this.form;
+ });
+ }
+ }
+ return radios;
+ };
+
+$.widget( "ui.button", {
+ version: "1.11.4",
+ defaultElement: "<button>",
+ options: {
+ disabled: null,
+ text: true,
+ label: null,
+ icons: {
+ primary: null,
+ secondary: null
+ }
+ },
+ _create: function() {
+ this.element.closest( "form" )
+ .unbind( "reset" + this.eventNamespace )
+ .bind( "reset" + this.eventNamespace, formResetHandler );
+
+ if ( typeof this.options.disabled !== "boolean" ) {
+ this.options.disabled = !!this.element.prop( "disabled" );
+ } else {
+ this.element.prop( "disabled", this.options.disabled );
+ }
+
+ this._determineButtonType();
+ this.hasTitle = !!this.buttonElement.attr( "title" );
+
+ var that = this,
+ options = this.options,
+ toggleButton = this.type === "checkbox" || this.type === "radio",
+ activeClass = !toggleButton ? "ui-state-active" : "";
+
+ if ( options.label === null ) {
+ options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
+ }
+
+ this._hoverable( this.buttonElement );
+
+ this.buttonElement
+ .addClass( baseClasses )
+ .attr( "role", "button" )
+ .bind( "mouseenter" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return;
+ }
+ if ( this === lastActive ) {
+ $( this ).addClass( "ui-state-active" );
+ }
+ })
+ .bind( "mouseleave" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return;
+ }
+ $( this ).removeClass( activeClass );
+ })
+ .bind( "click" + this.eventNamespace, function( event ) {
+ if ( options.disabled ) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ }
+ });
+
+ // Can't use _focusable() because the element that receives focus
+ // and the element that gets the ui-state-focus class are different
+ this._on({
+ focus: function() {
+ this.buttonElement.addClass( "ui-state-focus" );
+ },
+ blur: function() {
+ this.buttonElement.removeClass( "ui-state-focus" );
+ }
+ });
+
+ if ( toggleButton ) {
+ this.element.bind( "change" + this.eventNamespace, function() {
+ that.refresh();
+ });
+ }
+
+ if ( this.type === "checkbox" ) {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ });
+ } else if ( this.type === "radio" ) {
+ this.buttonElement.bind( "click" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).addClass( "ui-state-active" );
+ that.buttonElement.attr( "aria-pressed", "true" );
+
+ var radio = that.element[ 0 ];
+ radioGroup( radio )
+ .not( radio )
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ });
+ } else {
+ this.buttonElement
+ .bind( "mousedown" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).addClass( "ui-state-active" );
+ lastActive = this;
+ that.document.one( "mouseup", function() {
+ lastActive = null;
+ });
+ })
+ .bind( "mouseup" + this.eventNamespace, function() {
+ if ( options.disabled ) {
+ return false;
+ }
+ $( this ).removeClass( "ui-state-active" );
+ })
+ .bind( "keydown" + this.eventNamespace, function(event) {
+ if ( options.disabled ) {
+ return false;
+ }
+ if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
+ $( this ).addClass( "ui-state-active" );
+ }
+ })
+ // see #8559, we bind to blur here in case the button element loses
+ // focus between keydown and keyup, it would be left in an "active" state
+ .bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
+ $( this ).removeClass( "ui-state-active" );
+ });
+
+ if ( this.buttonElement.is("a") ) {
+ this.buttonElement.keyup(function(event) {
+ if ( event.keyCode === $.ui.keyCode.SPACE ) {
+ // TODO pass through original event correctly (just as 2nd argument doesn't work)
+ $( this ).click();
+ }
+ });
+ }
+ }
+
+ this._setOption( "disabled", options.disabled );
+ this._resetButton();
+ },
+
+ _determineButtonType: function() {
+ var ancestor, labelSelector, checked;
+
+ if ( this.element.is("[type=checkbox]") ) {
+ this.type = "checkbox";
+ } else if ( this.element.is("[type=radio]") ) {
+ this.type = "radio";
+ } else if ( this.element.is("input") ) {
+ this.type = "input";
+ } else {
+ this.type = "button";
+ }
+
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ // we don't search against the document in case the element
+ // is disconnected from the DOM
+ ancestor = this.element.parents().last();
+ labelSelector = "label[for='" + this.element.attr("id") + "']";
+ this.buttonElement = ancestor.find( labelSelector );
+ if ( !this.buttonElement.length ) {
+ ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
+ this.buttonElement = ancestor.filter( labelSelector );
+ if ( !this.buttonElement.length ) {
+ this.buttonElement = ancestor.find( labelSelector );
+ }
+ }
+ this.element.addClass( "ui-helper-hidden-accessible" );
+
+ checked = this.element.is( ":checked" );
+ if ( checked ) {
+ this.buttonElement.addClass( "ui-state-active" );
+ }
+ this.buttonElement.prop( "aria-pressed", checked );
+ } else {
+ this.buttonElement = this.element;
+ }
+ },
+
+ widget: function() {
+ return this.buttonElement;
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-helper-hidden-accessible" );
+ this.buttonElement
+ .removeClass( baseClasses + " ui-state-active " + typeClasses )
+ .removeAttr( "role" )
+ .removeAttr( "aria-pressed" )
+ .html( this.buttonElement.find(".ui-button-text").html() );
+
+ if ( !this.hasTitle ) {
+ this.buttonElement.removeAttr( "title" );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "disabled" ) {
+ this.widget().toggleClass( "ui-state-disabled", !!value );
+ this.element.prop( "disabled", !!value );
+ if ( value ) {
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ this.buttonElement.removeClass( "ui-state-focus" );
+ } else {
+ this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
+ }
+ }
+ return;
+ }
+ this._resetButton();
+ },
+
+ refresh: function() {
+ //See #8237 & #8828
+ var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
+
+ if ( isDisabled !== this.options.disabled ) {
+ this._setOption( "disabled", isDisabled );
+ }
+ if ( this.type === "radio" ) {
+ radioGroup( this.element[0] ).each(function() {
+ if ( $( this ).is( ":checked" ) ) {
+ $( this ).button( "widget" )
+ .addClass( "ui-state-active" )
+ .attr( "aria-pressed", "true" );
+ } else {
+ $( this ).button( "widget" )
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ }
+ });
+ } else if ( this.type === "checkbox" ) {
+ if ( this.element.is( ":checked" ) ) {
+ this.buttonElement
+ .addClass( "ui-state-active" )
+ .attr( "aria-pressed", "true" );
+ } else {
+ this.buttonElement
+ .removeClass( "ui-state-active" )
+ .attr( "aria-pressed", "false" );
+ }
+ }
+ },
+
+ _resetButton: function() {
+ if ( this.type === "input" ) {
+ if ( this.options.label ) {
+ this.element.val( this.options.label );
+ }
+ return;
+ }
+ var buttonElement = this.buttonElement.removeClass( typeClasses ),
+ buttonText = $( "<span></span>", this.document[0] )
+ .addClass( "ui-button-text" )
+ .html( this.options.label )
+ .appendTo( buttonElement.empty() )
+ .text(),
+ icons = this.options.icons,
+ multipleIcons = icons.primary && icons.secondary,
+ buttonClasses = [];
+
+ if ( icons.primary || icons.secondary ) {
+ if ( this.options.text ) {
+ buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
+ }
+
+ if ( icons.primary ) {
+ buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
+ }
+
+ if ( icons.secondary ) {
+ buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
+ }
+
+ if ( !this.options.text ) {
+ buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
+
+ if ( !this.hasTitle ) {
+ buttonElement.attr( "title", $.trim( buttonText ) );
+ }
+ }
+ } else {
+ buttonClasses.push( "ui-button-text-only" );
+ }
+ buttonElement.addClass( buttonClasses.join( " " ) );
+ }
+});
+
+$.widget( "ui.buttonset", {
+ version: "1.11.4",
+ options: {
+ items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
+ },
+
+ _create: function() {
+ this.element.addClass( "ui-buttonset" );
+ },
+
+ _init: function() {
+ this.refresh();
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "disabled" ) {
+ this.buttons.button( "option", key, value );
+ }
+
+ this._super( key, value );
+ },
+
+ refresh: function() {
+ var rtl = this.element.css( "direction" ) === "rtl",
+ allButtons = this.element.find( this.options.items ),
+ existingButtons = allButtons.filter( ":ui-button" );
+
+ // Initialize new buttons
+ allButtons.not( ":ui-button" ).button();
+
+ // Refresh existing buttons
+ existingButtons.button( "refresh" );
+
+ this.buttons = allButtons
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
+ .filter( ":first" )
+ .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
+ .end()
+ .filter( ":last" )
+ .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
+ .end()
+ .end();
+ },
+
+ _destroy: function() {
+ this.element.removeClass( "ui-buttonset" );
+ this.buttons
+ .map(function() {
+ return $( this ).button( "widget" )[ 0 ];
+ })
+ .removeClass( "ui-corner-left ui-corner-right" )
+ .end()
+ .button( "destroy" );
+ }
+});
+
+var button = $.ui.button;
+
+
+/*!
+ * jQuery UI Datepicker 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/datepicker/
+ */
+
+
+$.extend($.ui, { datepicker: { version: "1.11.4" } });
+
+var datepicker_instActive;
+
+function datepicker_getZindex( elem ) {
+ var position, value;
+ while ( elem.length && elem[ 0 ] !== document ) {
+ // Ignore z-index if position is set to a value where z-index is ignored by the browser
+ // This makes behavior of this function consistent across browsers
+ // WebKit always returns auto if the element is positioned
+ position = elem.css( "position" );
+ if ( position === "absolute" || position === "relative" || position === "fixed" ) {
+ // IE returns 0 when zIndex is not specified
+ // other browsers return a string
+ // we ignore the case of nested elements with an explicit value of 0
+ // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
+ value = parseInt( elem.css( "zIndex" ), 10 );
+ if ( !isNaN( value ) && value !== 0 ) {
+ return value;
+ }
+ }
+ elem = elem.parent();
+ }
+
+ return 0;
+}
+/* Date picker manager.
+ Use the singleton instance of this class, $.datepicker, to interact with the date picker.
+ Settings for (groups of) date pickers are maintained in an instance object,
+ allowing multiple different settings on the same page. */
+
+function Datepicker() {
+ this._curInst = null; // The current instance in use
+ this._keyEvent = false; // If the last event was a key event
+ this._disabledInputs = []; // List of date picker inputs that have been disabled
+ this._datepickerShowing = false; // True if the popup picker is showing , false if not
+ this._inDialog = false; // True if showing within a "dialog", false if not
+ this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
+ this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
+ this._appendClass = "ui-datepicker-append"; // The name of the append marker class
+ this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
+ this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
+ this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
+ this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
+ this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
+ this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
+ this.regional = []; // Available regional settings, indexed by language code
+ this.regional[""] = { // Default regional settings
+ closeText: "Done", // Display text for close link
+ prevText: "Prev", // Display text for previous month link
+ nextText: "Next", // Display text for next month link
+ currentText: "Today", // Display text for current month link
+ monthNames: ["January","February","March","April","May","June",
+ "July","August","September","October","November","December"], // Names of months for drop-down and formatting
+ monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
+ dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
+ dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
+ dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
+ weekHeader: "Wk", // Column header for week of the year
+ dateFormat: "mm/dd/yy", // See format options on parseDate
+ firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
+ isRTL: false, // True if right-to-left language, false if left-to-right
+ showMonthAfterYear: false, // True if the year select precedes month, false for month then year
+ yearSuffix: "" // Additional text to append to the year in the month headers
+ };
+ this._defaults = { // Global defaults for all the date picker instances
+ showOn: "focus", // "focus" for popup on focus,
+ // "button" for trigger button, or "both" for either
+ showAnim: "fadeIn", // Name of jQuery animation for popup
+ showOptions: {}, // Options for enhanced animations
+ defaultDate: null, // Used when field is blank: actual date,
+ // +/-number for offset from today, null for today
+ appendText: "", // Display text following the input box, e.g. showing the format
+ buttonText: "...", // Text for trigger button
+ buttonImage: "", // URL for trigger button image
+ buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
+ hideIfNoPrevNext: false, // True to hide next/previous month links
+ // if not applicable, false to just disable them
+ navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
+ gotoCurrent: false, // True if today link goes back to current selection instead
+ changeMonth: false, // True if month can be selected directly, false if only prev/next
+ changeYear: false, // True if year can be selected directly, false if only prev/next
+ yearRange: "c-10:c+10", // Range of years to display in drop-down,
+ // either relative to today's year (-nn:+nn), relative to currently displayed year
+ // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
+ showOtherMonths: false, // True to show dates in other months, false to leave blank
+ selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
+ showWeek: false, // True to show week of the year, false to not show it
+ calculateWeek: this.iso8601Week, // How to calculate the week of the year,
+ // takes a Date and returns the number of the week for it
+ shortYearCutoff: "+10", // Short year values < this are in the current century,
+ // > this are in the previous century,
+ // string value starting with "+" for current year + value
+ minDate: null, // The earliest selectable date, or null for no limit
+ maxDate: null, // The latest selectable date, or null for no limit
+ duration: "fast", // Duration of display/closure
+ beforeShowDay: null, // Function that takes a date and returns an array with
+ // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
+ // [2] = cell title (optional), e.g. $.datepicker.noWeekends
+ beforeShow: null, // Function that takes an input field and
+ // returns a set of custom settings for the date picker
+ onSelect: null, // Define a callback function when a date is selected
+ onChangeMonthYear: null, // Define a callback function when the month or year is changed
+ onClose: null, // Define a callback function when the datepicker is closed
+ numberOfMonths: 1, // Number of months to show at a time
+ showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
+ stepMonths: 1, // Number of months to step back/forward
+ stepBigMonths: 12, // Number of months to step back/forward for the big links
+ altField: "", // Selector for an alternate field to store selected dates into
+ altFormat: "", // The date format to use for the alternate field
+ constrainInput: true, // The input is constrained by the current date format
+ showButtonPanel: false, // True to show button panel, false to not show it
+ autoSize: false, // True to size the input for the date format, false to leave as is
+ disabled: false // The initial disabled state
+ };
+ $.extend(this._defaults, this.regional[""]);
+ this.regional.en = $.extend( true, {}, this.regional[ "" ]);
+ this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
+ this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
+}
+
+$.extend(Datepicker.prototype, {
+ /* Class name added to elements to indicate already configured with a date picker. */
+ markerClassName: "hasDatepicker",
+
+ //Keep track of the maximum number of rows displayed (see #7043)
+ maxRows: 4,
+
+ // TODO rename to "widget" when switching to widget factory
+ _widgetDatepicker: function() {
+ return this.dpDiv;
+ },
+
+ /* Override the default settings for all instances of the date picker.
+ * @param settings object - the new settings to use as defaults (anonymous object)
+ * @return the manager object
+ */
+ setDefaults: function(settings) {
+ datepicker_extendRemove(this._defaults, settings || {});
+ return this;
+ },
+
+ /* Attach the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param settings object - the new settings to use for this date picker instance (anonymous)
+ */
+ _attachDatepicker: function(target, settings) {
+ var nodeName, inline, inst;
+ nodeName = target.nodeName.toLowerCase();
+ inline = (nodeName === "div" || nodeName === "span");
+ if (!target.id) {
+ this.uuid += 1;
+ target.id = "dp" + this.uuid;
+ }
+ inst = this._newInst($(target), inline);
+ inst.settings = $.extend({}, settings || {});
+ if (nodeName === "input") {
+ this._connectDatepicker(target, inst);
+ } else if (inline) {
+ this._inlineDatepicker(target, inst);
+ }
+ },
+
+ /* Create a new instance object. */
+ _newInst: function(target, inline) {
+ var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
+ return {id: id, input: target, // associated target
+ selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
+ drawMonth: 0, drawYear: 0, // month being drawn
+ inline: inline, // is datepicker inline or not
+ dpDiv: (!inline ? this.dpDiv : // presentation div
+ datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
+ },
+
+ /* Attach the date picker to an input field. */
+ _connectDatepicker: function(target, inst) {
+ var input = $(target);
+ inst.append = $([]);
+ inst.trigger = $([]);
+ if (input.hasClass(this.markerClassName)) {
+ return;
+ }
+ this._attachments(input, inst);
+ input.addClass(this.markerClassName).keydown(this._doKeyDown).
+ keypress(this._doKeyPress).keyup(this._doKeyUp);
+ this._autoSize(inst);
+ $.data(target, "datepicker", inst);
+ //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
+ },
+
+ /* Make attachments based on settings. */
+ _attachments: function(input, inst) {
+ var showOn, buttonText, buttonImage,
+ appendText = this._get(inst, "appendText"),
+ isRTL = this._get(inst, "isRTL");
+
+ if (inst.append) {
+ inst.append.remove();
+ }
+ if (appendText) {
+ inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
+ input[isRTL ? "before" : "after"](inst.append);
+ }
+
+ input.unbind("focus", this._showDatepicker);
+
+ if (inst.trigger) {
+ inst.trigger.remove();
+ }
+
+ showOn = this._get(inst, "showOn");
+ if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
+ input.focus(this._showDatepicker);
+ }
+ if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
+ buttonText = this._get(inst, "buttonText");
+ buttonImage = this._get(inst, "buttonImage");
+ inst.trigger = $(this._get(inst, "buttonImageOnly") ?
+ $("<img/>").addClass(this._triggerClass).
+ attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
+ $("<button type='button'></button>").addClass(this._triggerClass).
+ html(!buttonImage ? buttonText : $("<img/>").attr(
+ { src:buttonImage, alt:buttonText, title:buttonText })));
+ input[isRTL ? "before" : "after"](inst.trigger);
+ inst.trigger.click(function() {
+ if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
+ $.datepicker._hideDatepicker();
+ } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
+ $.datepicker._hideDatepicker();
+ $.datepicker._showDatepicker(input[0]);
+ } else {
+ $.datepicker._showDatepicker(input[0]);
+ }
+ return false;
+ });
+ }
+ },
+
+ /* Apply the maximum length for the date format. */
+ _autoSize: function(inst) {
+ if (this._get(inst, "autoSize") && !inst.inline) {
+ var findMax, max, maxI, i,
+ date = new Date(2009, 12 - 1, 20), // Ensure double digits
+ dateFormat = this._get(inst, "dateFormat");
+
+ if (dateFormat.match(/[DM]/)) {
+ findMax = function(names) {
+ max = 0;
+ maxI = 0;
+ for (i = 0; i < names.length; i++) {
+ if (names[i].length > max) {
+ max = names[i].length;
+ maxI = i;
+ }
+ }
+ return maxI;
+ };
+ date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
+ "monthNames" : "monthNamesShort"))));
+ date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
+ "dayNames" : "dayNamesShort"))) + 20 - date.getDay());
+ }
+ inst.input.attr("size", this._formatDate(inst, date).length);
+ }
+ },
+
+ /* Attach an inline date picker to a div. */
+ _inlineDatepicker: function(target, inst) {
+ var divSpan = $(target);
+ if (divSpan.hasClass(this.markerClassName)) {
+ return;
+ }
+ divSpan.addClass(this.markerClassName).append(inst.dpDiv);
+ $.data(target, "datepicker", inst);
+ this._setDate(inst, this._getDefaultDate(inst), true);
+ this._updateDatepicker(inst);
+ this._updateAlternate(inst);
+ //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
+ if( inst.settings.disabled ) {
+ this._disableDatepicker( target );
+ }
+ // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
+ // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
+ inst.dpDiv.css( "display", "block" );
+ },
+
+ /* Pop-up the date picker in a "dialog" box.
+ * @param input element - ignored
+ * @param date string or Date - the initial date to display
+ * @param onSelect function - the function to call when a date is selected
+ * @param settings object - update the dialog date picker instance's settings (anonymous object)
+ * @param pos int[2] - coordinates for the dialog's position within the screen or
+ * event - with x/y coordinates or
+ * leave empty for default (screen centre)
+ * @return the manager object
+ */
+ _dialogDatepicker: function(input, date, onSelect, settings, pos) {
+ var id, browserWidth, browserHeight, scrollX, scrollY,
+ inst = this._dialogInst; // internal instance
+
+ if (!inst) {
+ this.uuid += 1;
+ id = "dp" + this.uuid;
+ this._dialogInput = $("<input type='text' id='" + id +
+ "' style='position: absolute; top: -100px; width: 0px;'/>");
+ this._dialogInput.keydown(this._doKeyDown);
+ $("body").append(this._dialogInput);
+ inst = this._dialogInst = this._newInst(this._dialogInput, false);
+ inst.settings = {};
+ $.data(this._dialogInput[0], "datepicker", inst);
+ }
+ datepicker_extendRemove(inst.settings, settings || {});
+ date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
+ this._dialogInput.val(date);
+
+ this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
+ if (!this._pos) {
+ browserWidth = document.documentElement.clientWidth;
+ browserHeight = document.documentElement.clientHeight;
+ scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+ scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+ this._pos = // should use actual width/height below
+ [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
+ }
+
+ // move input on screen for focus, but hidden behind dialog
+ this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
+ inst.settings.onSelect = onSelect;
+ this._inDialog = true;
+ this.dpDiv.addClass(this._dialogClass);
+ this._showDatepicker(this._dialogInput[0]);
+ if ($.blockUI) {
+ $.blockUI(this.dpDiv);
+ }
+ $.data(this._dialogInput[0], "datepicker", inst);
+ return this;
+ },
+
+ /* Detach a datepicker from its control.
+ * @param target element - the target input field or division or span
+ */
+ _destroyDatepicker: function(target) {
+ var nodeName,
+ $target = $(target),
+ inst = $.data(target, "datepicker");
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ $.removeData(target, "datepicker");
+ if (nodeName === "input") {
+ inst.append.remove();
+ inst.trigger.remove();
+ $target.removeClass(this.markerClassName).
+ unbind("focus", this._showDatepicker).
+ unbind("keydown", this._doKeyDown).
+ unbind("keypress", this._doKeyPress).
+ unbind("keyup", this._doKeyUp);
+ } else if (nodeName === "div" || nodeName === "span") {
+ $target.removeClass(this.markerClassName).empty();
+ }
+
+ if ( datepicker_instActive === inst ) {
+ datepicker_instActive = null;
+ }
+ },
+
+ /* Enable the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ */
+ _enableDatepicker: function(target) {
+ var nodeName, inline,
+ $target = $(target),
+ inst = $.data(target, "datepicker");
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ if (nodeName === "input") {
+ target.disabled = false;
+ inst.trigger.filter("button").
+ each(function() { this.disabled = false; }).end().
+ filter("img").css({opacity: "1.0", cursor: ""});
+ } else if (nodeName === "div" || nodeName === "span") {
+ inline = $target.children("." + this._inlineClass);
+ inline.children().removeClass("ui-state-disabled");
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+ prop("disabled", false);
+ }
+ this._disabledInputs = $.map(this._disabledInputs,
+ function(value) { return (value === target ? null : value); }); // delete entry
+ },
+
+ /* Disable the date picker to a jQuery selection.
+ * @param target element - the target input field or division or span
+ */
+ _disableDatepicker: function(target) {
+ var nodeName, inline,
+ $target = $(target),
+ inst = $.data(target, "datepicker");
+
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+
+ nodeName = target.nodeName.toLowerCase();
+ if (nodeName === "input") {
+ target.disabled = true;
+ inst.trigger.filter("button").
+ each(function() { this.disabled = true; }).end().
+ filter("img").css({opacity: "0.5", cursor: "default"});
+ } else if (nodeName === "div" || nodeName === "span") {
+ inline = $target.children("." + this._inlineClass);
+ inline.children().addClass("ui-state-disabled");
+ inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
+ prop("disabled", true);
+ }
+ this._disabledInputs = $.map(this._disabledInputs,
+ function(value) { return (value === target ? null : value); }); // delete entry
+ this._disabledInputs[this._disabledInputs.length] = target;
+ },
+
+ /* Is the first field in a jQuery collection disabled as a datepicker?
+ * @param target element - the target input field or division or span
+ * @return boolean - true if disabled, false if enabled
+ */
+ _isDisabledDatepicker: function(target) {
+ if (!target) {
+ return false;
+ }
+ for (var i = 0; i < this._disabledInputs.length; i++) {
+ if (this._disabledInputs[i] === target) {
+ return true;
+ }
+ }
+ return false;
+ },
+
+ /* Retrieve the instance data for the target control.
+ * @param target element - the target input field or division or span
+ * @return object - the associated instance data
+ * @throws error if a jQuery problem getting data
+ */
+ _getInst: function(target) {
+ try {
+ return $.data(target, "datepicker");
+ }
+ catch (err) {
+ throw "Missing instance data for this datepicker";
+ }
+ },
+
+ /* Update or retrieve the settings for a date picker attached to an input field or division.
+ * @param target element - the target input field or division or span
+ * @param name object - the new settings to update or
+ * string - the name of the setting to change or retrieve,
+ * when retrieving also "all" for all instance settings or
+ * "defaults" for all global defaults
+ * @param value any - the new value for the setting
+ * (omit if above is an object or to retrieve a value)
+ */
+ _optionDatepicker: function(target, name, value) {
+ var settings, date, minDate, maxDate,
+ inst = this._getInst(target);
+
+ if (arguments.length === 2 && typeof name === "string") {
+ return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
+ (inst ? (name === "all" ? $.extend({}, inst.settings) :
+ this._get(inst, name)) : null));
+ }
+
+ settings = name || {};
+ if (typeof name === "string") {
+ settings = {};
+ settings[name] = value;
+ }
+
+ if (inst) {
+ if (this._curInst === inst) {
+ this._hideDatepicker();
+ }
+
+ date = this._getDateDatepicker(target, true);
+ minDate = this._getMinMaxDate(inst, "min");
+ maxDate = this._getMinMaxDate(inst, "max");
+ datepicker_extendRemove(inst.settings, settings);
+ // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
+ if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
+ inst.settings.minDate = this._formatDate(inst, minDate);
+ }
+ if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
+ inst.settings.maxDate = this._formatDate(inst, maxDate);
+ }
+ if ( "disabled" in settings ) {
+ if ( settings.disabled ) {
+ this._disableDatepicker(target);
+ } else {
+ this._enableDatepicker(target);
+ }
+ }
+ this._attachments($(target), inst);
+ this._autoSize(inst);
+ this._setDate(inst, date);
+ this._updateAlternate(inst);
+ this._updateDatepicker(inst);
+ }
+ },
+
+ // change method deprecated
+ _changeDatepicker: function(target, name, value) {
+ this._optionDatepicker(target, name, value);
+ },
+
+ /* Redraw the date picker attached to an input field or division.
+ * @param target element - the target input field or division or span
+ */
+ _refreshDatepicker: function(target) {
+ var inst = this._getInst(target);
+ if (inst) {
+ this._updateDatepicker(inst);
+ }
+ },
+
+ /* Set the dates for a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param date Date - the new date
+ */
+ _setDateDatepicker: function(target, date) {
+ var inst = this._getInst(target);
+ if (inst) {
+ this._setDate(inst, date);
+ this._updateDatepicker(inst);
+ this._updateAlternate(inst);
+ }
+ },
+
+ /* Get the date(s) for the first entry in a jQuery selection.
+ * @param target element - the target input field or division or span
+ * @param noDefault boolean - true if no default date is to be used
+ * @return Date - the current date
+ */
+ _getDateDatepicker: function(target, noDefault) {
+ var inst = this._getInst(target);
+ if (inst && !inst.inline) {
+ this._setDateFromField(inst, noDefault);
+ }
+ return (inst ? this._getDate(inst) : null);
+ },
+
+ /* Handle keystrokes. */
+ _doKeyDown: function(event) {
+ var onSelect, dateStr, sel,
+ inst = $.datepicker._getInst(event.target),
+ handled = true,
+ isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
+
+ inst._keyEvent = true;
+ if ($.datepicker._datepickerShowing) {
+ switch (event.keyCode) {
+ case 9: $.datepicker._hideDatepicker();
+ handled = false;
+ break; // hide on tab out
+ case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
+ $.datepicker._currentClass + ")", inst.dpDiv);
+ if (sel[0]) {
+ $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
+ }
+
+ onSelect = $.datepicker._get(inst, "onSelect");
+ if (onSelect) {
+ dateStr = $.datepicker._formatDate(inst);
+
+ // trigger custom callback
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
+ } else {
+ $.datepicker._hideDatepicker();
+ }
+
+ return false; // don't submit the form
+ case 27: $.datepicker._hideDatepicker();
+ break; // hide on escape
+ case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ -$.datepicker._get(inst, "stepBigMonths") :
+ -$.datepicker._get(inst, "stepMonths")), "M");
+ break; // previous month/year on page up/+ ctrl
+ case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ +$.datepicker._get(inst, "stepBigMonths") :
+ +$.datepicker._get(inst, "stepMonths")), "M");
+ break; // next month/year on page down/+ ctrl
+ case 35: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._clearDate(event.target);
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // clear on ctrl or command +end
+ case 36: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._gotoToday(event.target);
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // current on ctrl or command +home
+ case 37: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ // -1 day on ctrl or command +left
+ if (event.originalEvent.altKey) {
+ $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ -$.datepicker._get(inst, "stepBigMonths") :
+ -$.datepicker._get(inst, "stepMonths")), "M");
+ }
+ // next month/year on alt +left on Mac
+ break;
+ case 38: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, -7, "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // -1 week on ctrl or command +up
+ case 39: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ // +1 day on ctrl or command +right
+ if (event.originalEvent.altKey) {
+ $.datepicker._adjustDate(event.target, (event.ctrlKey ?
+ +$.datepicker._get(inst, "stepBigMonths") :
+ +$.datepicker._get(inst, "stepMonths")), "M");
+ }
+ // next month/year on alt +right
+ break;
+ case 40: if (event.ctrlKey || event.metaKey) {
+ $.datepicker._adjustDate(event.target, +7, "D");
+ }
+ handled = event.ctrlKey || event.metaKey;
+ break; // +1 week on ctrl or command +down
+ default: handled = false;
+ }
+ } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
+ $.datepicker._showDatepicker(this);
+ } else {
+ handled = false;
+ }
+
+ if (handled) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ },
+
+ /* Filter entered characters - based on date format. */
+ _doKeyPress: function(event) {
+ var chars, chr,
+ inst = $.datepicker._getInst(event.target);
+
+ if ($.datepicker._get(inst, "constrainInput")) {
+ chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
+ chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
+ return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
+ }
+ },
+
+ /* Synchronise manual entry and field/alternate field. */
+ _doKeyUp: function(event) {
+ var date,
+ inst = $.datepicker._getInst(event.target);
+
+ if (inst.input.val() !== inst.lastVal) {
+ try {
+ date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+ (inst.input ? inst.input.val() : null),
+ $.datepicker._getFormatConfig(inst));
+
+ if (date) { // only if valid
+ $.datepicker._setDateFromField(inst);
+ $.datepicker._updateAlternate(inst);
+ $.datepicker._updateDatepicker(inst);
+ }
+ }
+ catch (err) {
+ }
+ }
+ return true;
+ },
+
+ /* Pop-up the date picker for a given input field.
+ * If false returned from beforeShow event handler do not show.
+ * @param input element - the input field attached to the date picker or
+ * event - if triggered by focus
+ */
+ _showDatepicker: function(input) {
+ input = input.target || input;
+ if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
+ input = $("input", input.parentNode)[0];
+ }
+
+ if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
+ return;
+ }
+
+ var inst, beforeShow, beforeShowSettings, isFixed,
+ offset, showAnim, duration;
+
+ inst = $.datepicker._getInst(input);
+ if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
+ $.datepicker._curInst.dpDiv.stop(true, true);
+ if ( inst && $.datepicker._datepickerShowing ) {
+ $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
+ }
+ }
+
+ beforeShow = $.datepicker._get(inst, "beforeShow");
+ beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
+ if(beforeShowSettings === false){
+ return;
+ }
+ datepicker_extendRemove(inst.settings, beforeShowSettings);
+
+ inst.lastVal = null;
+ $.datepicker._lastInput = input;
+ $.datepicker._setDateFromField(inst);
+
+ if ($.datepicker._inDialog) { // hide cursor
+ input.value = "";
+ }
+ if (!$.datepicker._pos) { // position below input
+ $.datepicker._pos = $.datepicker._findPos(input);
+ $.datepicker._pos[1] += input.offsetHeight; // add the height
+ }
+
+ isFixed = false;
+ $(input).parents().each(function() {
+ isFixed |= $(this).css("position") === "fixed";
+ return !isFixed;
+ });
+
+ offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
+ $.datepicker._pos = null;
+ //to avoid flashes on Firefox
+ inst.dpDiv.empty();
+ // determine sizing offscreen
+ inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
+ $.datepicker._updateDatepicker(inst);
+ // fix width for dynamic number of date pickers
+ // and adjust position before showing
+ offset = $.datepicker._checkOffset(inst, offset, isFixed);
+ inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
+ "static" : (isFixed ? "fixed" : "absolute")), display: "none",
+ left: offset.left + "px", top: offset.top + "px"});
+
+ if (!inst.inline) {
+ showAnim = $.datepicker._get(inst, "showAnim");
+ duration = $.datepicker._get(inst, "duration");
+ inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
+ $.datepicker._datepickerShowing = true;
+
+ if ( $.effects && $.effects.effect[ showAnim ] ) {
+ inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
+ } else {
+ inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
+ }
+
+ if ( $.datepicker._shouldFocusInput( inst ) ) {
+ inst.input.focus();
+ }
+
+ $.datepicker._curInst = inst;
+ }
+ },
+
+ /* Generate the date picker content. */
+ _updateDatepicker: function(inst) {
+ this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
+ datepicker_instActive = inst; // for delegate hover events
+ inst.dpDiv.empty().append(this._generateHTML(inst));
+ this._attachHandlers(inst);
+
+ var origyearshtml,
+ numMonths = this._getNumberOfMonths(inst),
+ cols = numMonths[1],
+ width = 17,
+ activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
+
+ if ( activeCell.length > 0 ) {
+ datepicker_handleMouseover.apply( activeCell.get( 0 ) );
+ }
+
+ inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
+ if (cols > 1) {
+ inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
+ }
+ inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
+ "Class"]("ui-datepicker-multi");
+ inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
+ "Class"]("ui-datepicker-rtl");
+
+ if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
+ inst.input.focus();
+ }
+
+ // deffered render of the years select (to avoid flashes on Firefox)
+ if( inst.yearshtml ){
+ origyearshtml = inst.yearshtml;
+ setTimeout(function(){
+ //assure that inst.yearshtml didn't change.
+ if( origyearshtml === inst.yearshtml && inst.yearshtml ){
+ inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
+ }
+ origyearshtml = inst.yearshtml = null;
+ }, 0);
+ }
+ },
+
+ // #6694 - don't focus the input if it's already focused
+ // this breaks the change event in IE
+ // Support: IE and jQuery <1.9
+ _shouldFocusInput: function( inst ) {
+ return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
+ },
+
+ /* Check positioning to remain on screen. */
+ _checkOffset: function(inst, offset, isFixed) {
+ var dpWidth = inst.dpDiv.outerWidth(),
+ dpHeight = inst.dpDiv.outerHeight(),
+ inputWidth = inst.input ? inst.input.outerWidth() : 0,
+ inputHeight = inst.input ? inst.input.outerHeight() : 0,
+ viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
+ viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
+
+ offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
+ offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
+ offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
+
+ // now check if datepicker is showing outside window viewport - move to a better place if so.
+ offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
+ Math.abs(offset.left + dpWidth - viewWidth) : 0);
+ offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
+ Math.abs(dpHeight + inputHeight) : 0);
+
+ return offset;
+ },
+
+ /* Find an object's position on the screen. */
+ _findPos: function(obj) {
+ var position,
+ inst = this._getInst(obj),
+ isRTL = this._get(inst, "isRTL");
+
+ while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
+ obj = obj[isRTL ? "previousSibling" : "nextSibling"];
+ }
+
+ position = $(obj).offset();
+ return [position.left, position.top];
+ },
+
+ /* Hide the date picker from view.
+ * @param input element - the input field attached to the date picker
+ */
+ _hideDatepicker: function(input) {
+ var showAnim, duration, postProcess, onClose,
+ inst = this._curInst;
+
+ if (!inst || (input && inst !== $.data(input, "datepicker"))) {
+ return;
+ }
+
+ if (this._datepickerShowing) {
+ showAnim = this._get(inst, "showAnim");
+ duration = this._get(inst, "duration");
+ postProcess = function() {
+ $.datepicker._tidyDialog(inst);
+ };
+
+ // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
+ if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
+ } else {
+ inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
+ (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
+ }
+
+ if (!showAnim) {
+ postProcess();
+ }
+ this._datepickerShowing = false;
+
+ onClose = this._get(inst, "onClose");
+ if (onClose) {
+ onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
+ }
+
+ this._lastInput = null;
+ if (this._inDialog) {
+ this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
+ if ($.blockUI) {
+ $.unblockUI();
+ $("body").append(this.dpDiv);
+ }
+ }
+ this._inDialog = false;
+ }
+ },
+
+ /* Tidy up after a dialog display. */
+ _tidyDialog: function(inst) {
+ inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
+ },
+
+ /* Close date picker if clicked elsewhere. */
+ _checkExternalClick: function(event) {
+ if (!$.datepicker._curInst) {
+ return;
+ }
+
+ var $target = $(event.target),
+ inst = $.datepicker._getInst($target[0]);
+
+ if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
+ $target.parents("#" + $.datepicker._mainDivId).length === 0 &&
+ !$target.hasClass($.datepicker.markerClassName) &&
+ !$target.closest("." + $.datepicker._triggerClass).length &&
+ $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
+ ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
+ $.datepicker._hideDatepicker();
+ }
+ },
+
+ /* Adjust one of the date sub-fields. */
+ _adjustDate: function(id, offset, period) {
+ var target = $(id),
+ inst = this._getInst(target[0]);
+
+ if (this._isDisabledDatepicker(target[0])) {
+ return;
+ }
+ this._adjustInstDate(inst, offset +
+ (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
+ period);
+ this._updateDatepicker(inst);
+ },
+
+ /* Action for current link. */
+ _gotoToday: function(id) {
+ var date,
+ target = $(id),
+ inst = this._getInst(target[0]);
+
+ if (this._get(inst, "gotoCurrent") && inst.currentDay) {
+ inst.selectedDay = inst.currentDay;
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth;
+ inst.drawYear = inst.selectedYear = inst.currentYear;
+ } else {
+ date = new Date();
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ }
+ this._notifyChange(inst);
+ this._adjustDate(target);
+ },
+
+ /* Action for selecting a new month/year. */
+ _selectMonthYear: function(id, select, period) {
+ var target = $(id),
+ inst = this._getInst(target[0]);
+
+ inst["selected" + (period === "M" ? "Month" : "Year")] =
+ inst["draw" + (period === "M" ? "Month" : "Year")] =
+ parseInt(select.options[select.selectedIndex].value,10);
+
+ this._notifyChange(inst);
+ this._adjustDate(target);
+ },
+
+ /* Action for selecting a day. */
+ _selectDay: function(id, month, year, td) {
+ var inst,
+ target = $(id);
+
+ if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
+ return;
+ }
+
+ inst = this._getInst(target[0]);
+ inst.selectedDay = inst.currentDay = $("a", td).html();
+ inst.selectedMonth = inst.currentMonth = month;
+ inst.selectedYear = inst.currentYear = year;
+ this._selectDate(id, this._formatDate(inst,
+ inst.currentDay, inst.currentMonth, inst.currentYear));
+ },
+
+ /* Erase the input field and hide the date picker. */
+ _clearDate: function(id) {
+ var target = $(id);
+ this._selectDate(target, "");
+ },
+
+ /* Update the input field with the selected date. */
+ _selectDate: function(id, dateStr) {
+ var onSelect,
+ target = $(id),
+ inst = this._getInst(target[0]);
+
+ dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
+ if (inst.input) {
+ inst.input.val(dateStr);
+ }
+ this._updateAlternate(inst);
+
+ onSelect = this._get(inst, "onSelect");
+ if (onSelect) {
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
+ } else if (inst.input) {
+ inst.input.trigger("change"); // fire the change event
+ }
+
+ if (inst.inline){
+ this._updateDatepicker(inst);
+ } else {
+ this._hideDatepicker();
+ this._lastInput = inst.input[0];
+ if (typeof(inst.input[0]) !== "object") {
+ inst.input.focus(); // restore focus
+ }
+ this._lastInput = null;
+ }
+ },
+
+ /* Update any alternate field to synchronise with the main field. */
+ _updateAlternate: function(inst) {
+ var altFormat, date, dateStr,
+ altField = this._get(inst, "altField");
+
+ if (altField) { // update alternate field too
+ altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
+ date = this._getDate(inst);
+ dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
+ $(altField).each(function() { $(this).val(dateStr); });
+ }
+ },
+
+ /* Set as beforeShowDay function to prevent selection of weekends.
+ * @param date Date - the date to customise
+ * @return [boolean, string] - is this date selectable?, what is its CSS class?
+ */
+ noWeekends: function(date) {
+ var day = date.getDay();
+ return [(day > 0 && day < 6), ""];
+ },
+
+ /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
+ * @param date Date - the date to get the week for
+ * @return number - the number of the week within the year that contains this date
+ */
+ iso8601Week: function(date) {
+ var time,
+ checkDate = new Date(date.getTime());
+
+ // Find Thursday of this week starting on Monday
+ checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
+
+ time = checkDate.getTime();
+ checkDate.setMonth(0); // Compare with Jan 1
+ checkDate.setDate(1);
+ return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
+ },
+
+ /* Parse a string value into a date object.
+ * See formatDate below for the possible formats.
+ *
+ * @param format string - the expected format of the date
+ * @param value string - the date in the above format
+ * @param settings Object - attributes include:
+ * shortYearCutoff number - the cutoff year for determining the century (optional)
+ * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
+ * dayNames string[7] - names of the days from Sunday (optional)
+ * monthNamesShort string[12] - abbreviated names of the months (optional)
+ * monthNames string[12] - names of the months (optional)
+ * @return Date - the extracted date value or null if value is blank
+ */
+ parseDate: function (format, value, settings) {
+ if (format == null || value == null) {
+ throw "Invalid arguments";
+ }
+
+ value = (typeof value === "object" ? value.toString() : value + "");
+ if (value === "") {
+ return null;
+ }
+
+ var iFormat, dim, extra,
+ iValue = 0,
+ shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
+ shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
+ dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+ dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+ monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+ monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+ year = -1,
+ month = -1,
+ day = -1,
+ doy = -1,
+ literal = false,
+ date,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ },
+ // Extract a number from the string value
+ getNumber = function(match) {
+ var isDoubled = lookAhead(match),
+ size = (match === "@" ? 14 : (match === "!" ? 20 :
+ (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
+ minSize = (match === "y" ? size : 1),
+ digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
+ num = value.substring(iValue).match(digits);
+ if (!num) {
+ throw "Missing number at position " + iValue;
+ }
+ iValue += num[0].length;
+ return parseInt(num[0], 10);
+ },
+ // Extract a name from the string value and convert to an index
+ getName = function(match, shortNames, longNames) {
+ var index = -1,
+ names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
+ return [ [k, v] ];
+ }).sort(function (a, b) {
+ return -(a[1].length - b[1].length);
+ });
+
+ $.each(names, function (i, pair) {
+ var name = pair[1];
+ if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
+ index = pair[0];
+ iValue += name.length;
+ return false;
+ }
+ });
+ if (index !== -1) {
+ return index + 1;
+ } else {
+ throw "Unknown name at position " + iValue;
+ }
+ },
+ // Confirm that a literal character matches the string value
+ checkLiteral = function() {
+ if (value.charAt(iValue) !== format.charAt(iFormat)) {
+ throw "Unexpected literal at position " + iValue;
+ }
+ iValue++;
+ };
+
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ checkLiteral();
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d":
+ day = getNumber("d");
+ break;
+ case "D":
+ getName("D", dayNamesShort, dayNames);
+ break;
+ case "o":
+ doy = getNumber("o");
+ break;
+ case "m":
+ month = getNumber("m");
+ break;
+ case "M":
+ month = getName("M", monthNamesShort, monthNames);
+ break;
+ case "y":
+ year = getNumber("y");
+ break;
+ case "@":
+ date = new Date(getNumber("@"));
+ year = date.getFullYear();
+ month = date.getMonth() + 1;
+ day = date.getDate();
+ break;
+ case "!":
+ date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
+ year = date.getFullYear();
+ month = date.getMonth() + 1;
+ day = date.getDate();
+ break;
+ case "'":
+ if (lookAhead("'")){
+ checkLiteral();
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ checkLiteral();
+ }
+ }
+ }
+
+ if (iValue < value.length){
+ extra = value.substr(iValue);
+ if (!/^\s+/.test(extra)) {
+ throw "Extra/unparsed characters found in date: " + extra;
+ }
+ }
+
+ if (year === -1) {
+ year = new Date().getFullYear();
+ } else if (year < 100) {
+ year += new Date().getFullYear() - new Date().getFullYear() % 100 +
+ (year <= shortYearCutoff ? 0 : -100);
+ }
+
+ if (doy > -1) {
+ month = 1;
+ day = doy;
+ do {
+ dim = this._getDaysInMonth(year, month - 1);
+ if (day <= dim) {
+ break;
+ }
+ month++;
+ day -= dim;
+ } while (true);
+ }
+
+ date = this._daylightSavingAdjust(new Date(year, month - 1, day));
+ if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
+ throw "Invalid date"; // E.g. 31/02/00
+ }
+ return date;
+ },
+
+ /* Standard date formats. */
+ ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
+ COOKIE: "D, dd M yy",
+ ISO_8601: "yy-mm-dd",
+ RFC_822: "D, d M y",
+ RFC_850: "DD, dd-M-y",
+ RFC_1036: "D, d M y",
+ RFC_1123: "D, d M yy",
+ RFC_2822: "D, d M yy",
+ RSS: "D, d M y", // RFC 822
+ TICKS: "!",
+ TIMESTAMP: "@",
+ W3C: "yy-mm-dd", // ISO 8601
+
+ _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
+ Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
+
+ /* Format a date object into a string value.
+ * The format can be combinations of the following:
+ * d - day of month (no leading zero)
+ * dd - day of month (two digit)
+ * o - day of year (no leading zeros)
+ * oo - day of year (three digit)
+ * D - day name short
+ * DD - day name long
+ * m - month of year (no leading zero)
+ * mm - month of year (two digit)
+ * M - month name short
+ * MM - month name long
+ * y - year (two digit)
+ * yy - year (four digit)
+ * @ - Unix timestamp (ms since 01/01/1970)
+ * ! - Windows ticks (100ns since 01/01/0001)
+ * "..." - literal text
+ * '' - single quote
+ *
+ * @param format string - the desired format of the date
+ * @param date Date - the date value to format
+ * @param settings Object - attributes include:
+ * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
+ * dayNames string[7] - names of the days from Sunday (optional)
+ * monthNamesShort string[12] - abbreviated names of the months (optional)
+ * monthNames string[12] - names of the months (optional)
+ * @return string - the date in the above format
+ */
+ formatDate: function (format, date, settings) {
+ if (!date) {
+ return "";
+ }
+
+ var iFormat,
+ dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
+ dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
+ monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
+ monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ },
+ // Format a number, with leading zero if necessary
+ formatNumber = function(match, value, len) {
+ var num = "" + value;
+ if (lookAhead(match)) {
+ while (num.length < len) {
+ num = "0" + num;
+ }
+ }
+ return num;
+ },
+ // Format a name, short or long as requested
+ formatName = function(match, value, shortNames, longNames) {
+ return (lookAhead(match) ? longNames[value] : shortNames[value]);
+ },
+ output = "",
+ literal = false;
+
+ if (date) {
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ output += format.charAt(iFormat);
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d":
+ output += formatNumber("d", date.getDate(), 2);
+ break;
+ case "D":
+ output += formatName("D", date.getDay(), dayNamesShort, dayNames);
+ break;
+ case "o":
+ output += formatNumber("o",
+ Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
+ break;
+ case "m":
+ output += formatNumber("m", date.getMonth() + 1, 2);
+ break;
+ case "M":
+ output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
+ break;
+ case "y":
+ output += (lookAhead("y") ? date.getFullYear() :
+ (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
+ break;
+ case "@":
+ output += date.getTime();
+ break;
+ case "!":
+ output += date.getTime() * 10000 + this._ticksTo1970;
+ break;
+ case "'":
+ if (lookAhead("'")) {
+ output += "'";
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ output += format.charAt(iFormat);
+ }
+ }
+ }
+ }
+ return output;
+ },
+
+ /* Extract all possible characters from the date format. */
+ _possibleChars: function (format) {
+ var iFormat,
+ chars = "",
+ literal = false,
+ // Check whether a format character is doubled
+ lookAhead = function(match) {
+ var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
+ if (matches) {
+ iFormat++;
+ }
+ return matches;
+ };
+
+ for (iFormat = 0; iFormat < format.length; iFormat++) {
+ if (literal) {
+ if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
+ literal = false;
+ } else {
+ chars += format.charAt(iFormat);
+ }
+ } else {
+ switch (format.charAt(iFormat)) {
+ case "d": case "m": case "y": case "@":
+ chars += "0123456789";
+ break;
+ case "D": case "M":
+ return null; // Accept anything
+ case "'":
+ if (lookAhead("'")) {
+ chars += "'";
+ } else {
+ literal = true;
+ }
+ break;
+ default:
+ chars += format.charAt(iFormat);
+ }
+ }
+ }
+ return chars;
+ },
+
+ /* Get a setting value, defaulting if necessary. */
+ _get: function(inst, name) {
+ return inst.settings[name] !== undefined ?
+ inst.settings[name] : this._defaults[name];
+ },
+
+ /* Parse existing date and initialise date picker. */
+ _setDateFromField: function(inst, noDefault) {
+ if (inst.input.val() === inst.lastVal) {
+ return;
+ }
+
+ var dateFormat = this._get(inst, "dateFormat"),
+ dates = inst.lastVal = inst.input ? inst.input.val() : null,
+ defaultDate = this._getDefaultDate(inst),
+ date = defaultDate,
+ settings = this._getFormatConfig(inst);
+
+ try {
+ date = this.parseDate(dateFormat, dates, settings) || defaultDate;
+ } catch (event) {
+ dates = (noDefault ? "" : dates);
+ }
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ inst.currentDay = (dates ? date.getDate() : 0);
+ inst.currentMonth = (dates ? date.getMonth() : 0);
+ inst.currentYear = (dates ? date.getFullYear() : 0);
+ this._adjustInstDate(inst);
+ },
+
+ /* Retrieve the default date shown on opening. */
+ _getDefaultDate: function(inst) {
+ return this._restrictMinMax(inst,
+ this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
+ },
+
+ /* A date may be specified as an exact value or a relative one. */
+ _determineDate: function(inst, date, defaultDate) {
+ var offsetNumeric = function(offset) {
+ var date = new Date();
+ date.setDate(date.getDate() + offset);
+ return date;
+ },
+ offsetString = function(offset) {
+ try {
+ return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
+ offset, $.datepicker._getFormatConfig(inst));
+ }
+ catch (e) {
+ // Ignore
+ }
+
+ var date = (offset.toLowerCase().match(/^c/) ?
+ $.datepicker._getDate(inst) : null) || new Date(),
+ year = date.getFullYear(),
+ month = date.getMonth(),
+ day = date.getDate(),
+ pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
+ matches = pattern.exec(offset);
+
+ while (matches) {
+ switch (matches[2] || "d") {
+ case "d" : case "D" :
+ day += parseInt(matches[1],10); break;
+ case "w" : case "W" :
+ day += parseInt(matches[1],10) * 7; break;
+ case "m" : case "M" :
+ month += parseInt(matches[1],10);
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+ break;
+ case "y": case "Y" :
+ year += parseInt(matches[1],10);
+ day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
+ break;
+ }
+ matches = pattern.exec(offset);
+ }
+ return new Date(year, month, day);
+ },
+ newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
+ (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
+
+ newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
+ if (newDate) {
+ newDate.setHours(0);
+ newDate.setMinutes(0);
+ newDate.setSeconds(0);
+ newDate.setMilliseconds(0);
+ }
+ return this._daylightSavingAdjust(newDate);
+ },
+
+ /* Handle switch to/from daylight saving.
+ * Hours may be non-zero on daylight saving cut-over:
+ * > 12 when midnight changeover, but then cannot generate
+ * midnight datetime, so jump to 1AM, otherwise reset.
+ * @param date (Date) the date to check
+ * @return (Date) the corrected date
+ */
+ _daylightSavingAdjust: function(date) {
+ if (!date) {
+ return null;
+ }
+ date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
+ return date;
+ },
+
+ /* Set the date(s) directly. */
+ _setDate: function(inst, date, noChange) {
+ var clear = !date,
+ origMonth = inst.selectedMonth,
+ origYear = inst.selectedYear,
+ newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
+
+ inst.selectedDay = inst.currentDay = newDate.getDate();
+ inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
+ inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
+ if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
+ this._notifyChange(inst);
+ }
+ this._adjustInstDate(inst);
+ if (inst.input) {
+ inst.input.val(clear ? "" : this._formatDate(inst));
+ }
+ },
+
+ /* Retrieve the date(s) directly. */
+ _getDate: function(inst) {
+ var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
+ this._daylightSavingAdjust(new Date(
+ inst.currentYear, inst.currentMonth, inst.currentDay)));
+ return startDate;
+ },
+
+ /* Attach the onxxx handlers. These are declared statically so
+ * they work with static code transformers like Caja.
+ */
+ _attachHandlers: function(inst) {
+ var stepMonths = this._get(inst, "stepMonths"),
+ id = "#" + inst.id.replace( /\\\\/g, "\\" );
+ inst.dpDiv.find("[data-handler]").map(function () {
+ var handler = {
+ prev: function () {
+ $.datepicker._adjustDate(id, -stepMonths, "M");
+ },
+ next: function () {
+ $.datepicker._adjustDate(id, +stepMonths, "M");
+ },
+ hide: function () {
+ $.datepicker._hideDatepicker();
+ },
+ today: function () {
+ $.datepicker._gotoToday(id);
+ },
+ selectDay: function () {
+ $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
+ return false;
+ },
+ selectMonth: function () {
+ $.datepicker._selectMonthYear(id, this, "M");
+ return false;
+ },
+ selectYear: function () {
+ $.datepicker._selectMonthYear(id, this, "Y");
+ return false;
+ }
+ };
+ $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
+ });
+ },
+
+ /* Generate the HTML for the current state of the date picker. */
+ _generateHTML: function(inst) {
+ var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
+ controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
+ monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
+ selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
+ cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
+ printDate, dRow, tbody, daySettings, otherMonth, unselectable,
+ tempDate = new Date(),
+ today = this._daylightSavingAdjust(
+ new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
+ isRTL = this._get(inst, "isRTL"),
+ showButtonPanel = this._get(inst, "showButtonPanel"),
+ hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
+ navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
+ numMonths = this._getNumberOfMonths(inst),
+ showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
+ stepMonths = this._get(inst, "stepMonths"),
+ isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
+ currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
+ new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
+ minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ drawMonth = inst.drawMonth - showCurrentAtPos,
+ drawYear = inst.drawYear;
+
+ if (drawMonth < 0) {
+ drawMonth += 12;
+ drawYear--;
+ }
+ if (maxDate) {
+ maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
+ maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
+ maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
+ while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
+ drawMonth--;
+ if (drawMonth < 0) {
+ drawMonth = 11;
+ drawYear--;
+ }
+ }
+ }
+ inst.drawMonth = drawMonth;
+ inst.drawYear = drawYear;
+
+ prevText = this._get(inst, "prevText");
+ prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
+ this._getFormatConfig(inst)));
+
+ prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
+ "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
+ " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
+ (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
+
+ nextText = this._get(inst, "nextText");
+ nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
+ this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
+ this._getFormatConfig(inst)));
+
+ next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
+ "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
+ " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
+ (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
+
+ currentText = this._get(inst, "currentText");
+ gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
+ currentText = (!navigationAsDateFormat ? currentText :
+ this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
+
+ controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
+ this._get(inst, "closeText") + "</button>" : "");
+
+ buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
+ (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
+ ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
+
+ firstDay = parseInt(this._get(inst, "firstDay"),10);
+ firstDay = (isNaN(firstDay) ? 0 : firstDay);
+
+ showWeek = this._get(inst, "showWeek");
+ dayNames = this._get(inst, "dayNames");
+ dayNamesMin = this._get(inst, "dayNamesMin");
+ monthNames = this._get(inst, "monthNames");
+ monthNamesShort = this._get(inst, "monthNamesShort");
+ beforeShowDay = this._get(inst, "beforeShowDay");
+ showOtherMonths = this._get(inst, "showOtherMonths");
+ selectOtherMonths = this._get(inst, "selectOtherMonths");
+ defaultDate = this._getDefaultDate(inst);
+ html = "";
+ dow;
+ for (row = 0; row < numMonths[0]; row++) {
+ group = "";
+ this.maxRows = 4;
+ for (col = 0; col < numMonths[1]; col++) {
+ selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
+ cornerClass = " ui-corner-all";
+ calender = "";
+ if (isMultiMonth) {
+ calender += "<div class='ui-datepicker-group";
+ if (numMonths[1] > 1) {
+ switch (col) {
+ case 0: calender += " ui-datepicker-group-first";
+ cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
+ case numMonths[1]-1: calender += " ui-datepicker-group-last";
+ cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
+ default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
+ }
+ }
+ calender += "'>";
+ }
+ calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
+ (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
+ (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
+ this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
+ row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
+ "</div><table class='ui-datepicker-calendar'><thead>" +
+ "<tr>";
+ thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
+ for (dow = 0; dow < 7; dow++) { // days of the week
+ day = (dow + firstDay) % 7;
+ thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
+ "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
+ }
+ calender += thead + "</tr></thead><tbody>";
+ daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
+ if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
+ inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
+ }
+ leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
+ curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
+ numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
+ this.maxRows = numRows;
+ printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
+ for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
+ calender += "<tr>";
+ tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
+ this._get(inst, "calculateWeek")(printDate) + "</td>");
+ for (dow = 0; dow < 7; dow++) { // create date picker days
+ daySettings = (beforeShowDay ?
+ beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
+ otherMonth = (printDate.getMonth() !== drawMonth);
+ unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
+ (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
+ tbody += "<td class='" +
+ ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
+ (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
+ ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
+ (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
+ // or defaultDate is current printedDate and defaultDate is selectedDate
+ " " + this._dayOverClass : "") + // highlight selected day
+ (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days
+ (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
+ (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
+ (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
+ ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
+ (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
+ (otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
+ (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
+ (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
+ (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
+ (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
+ "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
+ printDate.setDate(printDate.getDate() + 1);
+ printDate = this._daylightSavingAdjust(printDate);
+ }
+ calender += tbody + "</tr>";
+ }
+ drawMonth++;
+ if (drawMonth > 11) {
+ drawMonth = 0;
+ drawYear++;
+ }
+ calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
+ ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
+ group += calender;
+ }
+ html += group;
+ }
+ html += buttonPanel;
+ inst._keyEvent = false;
+ return html;
+ },
+
+ /* Generate the month and year header. */
+ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
+ secondary, monthNames, monthNamesShort) {
+
+ var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
+ changeMonth = this._get(inst, "changeMonth"),
+ changeYear = this._get(inst, "changeYear"),
+ showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
+ html = "<div class='ui-datepicker-title'>",
+ monthHtml = "";
+
+ // month selection
+ if (secondary || !changeMonth) {
+ monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
+ } else {
+ inMinYear = (minDate && minDate.getFullYear() === drawYear);
+ inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
+ monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
+ for ( month = 0; month < 12; month++) {
+ if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
+ monthHtml += "<option value='" + month + "'" +
+ (month === drawMonth ? " selected='selected'" : "") +
+ ">" + monthNamesShort[month] + "</option>";
+ }
+ }
+ monthHtml += "</select>";
+ }
+
+ if (!showMonthAfterYear) {
+ html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
+ }
+
+ // year selection
+ if ( !inst.yearshtml ) {
+ inst.yearshtml = "";
+ if (secondary || !changeYear) {
+ html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
+ } else {
+ // determine range of years to display
+ years = this._get(inst, "yearRange").split(":");
+ thisYear = new Date().getFullYear();
+ determineYear = function(value) {
+ var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
+ (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
+ parseInt(value, 10)));
+ return (isNaN(year) ? thisYear : year);
+ };
+ year = determineYear(years[0]);
+ endYear = Math.max(year, determineYear(years[1] || ""));
+ year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
+ endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
+ inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
+ for (; year <= endYear; year++) {
+ inst.yearshtml += "<option value='" + year + "'" +
+ (year === drawYear ? " selected='selected'" : "") +
+ ">" + year + "</option>";
+ }
+ inst.yearshtml += "</select>";
+
+ html += inst.yearshtml;
+ inst.yearshtml = null;
+ }
+ }
+
+ html += this._get(inst, "yearSuffix");
+ if (showMonthAfterYear) {
+ html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
+ }
+ html += "</div>"; // Close datepicker_header
+ return html;
+ },
+
+ /* Adjust one of the date sub-fields. */
+ _adjustInstDate: function(inst, offset, period) {
+ var year = inst.drawYear + (period === "Y" ? offset : 0),
+ month = inst.drawMonth + (period === "M" ? offset : 0),
+ day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
+ date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
+
+ inst.selectedDay = date.getDate();
+ inst.drawMonth = inst.selectedMonth = date.getMonth();
+ inst.drawYear = inst.selectedYear = date.getFullYear();
+ if (period === "M" || period === "Y") {
+ this._notifyChange(inst);
+ }
+ },
+
+ /* Ensure a date is within any min/max bounds. */
+ _restrictMinMax: function(inst, date) {
+ var minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ newDate = (minDate && date < minDate ? minDate : date);
+ return (maxDate && newDate > maxDate ? maxDate : newDate);
+ },
+
+ /* Notify change of month/year. */
+ _notifyChange: function(inst) {
+ var onChange = this._get(inst, "onChangeMonthYear");
+ if (onChange) {
+ onChange.apply((inst.input ? inst.input[0] : null),
+ [inst.selectedYear, inst.selectedMonth + 1, inst]);
+ }
+ },
+
+ /* Determine the number of months to show. */
+ _getNumberOfMonths: function(inst) {
+ var numMonths = this._get(inst, "numberOfMonths");
+ return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
+ },
+
+ /* Determine the current maximum date - ensure no time components are set. */
+ _getMinMaxDate: function(inst, minMax) {
+ return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
+ },
+
+ /* Find the number of days in a given month. */
+ _getDaysInMonth: function(year, month) {
+ return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
+ },
+
+ /* Find the day of the week of the first of a month. */
+ _getFirstDayOfMonth: function(year, month) {
+ return new Date(year, month, 1).getDay();
+ },
+
+ /* Determines if we should allow a "next/prev" month display change. */
+ _canAdjustMonth: function(inst, offset, curYear, curMonth) {
+ var numMonths = this._getNumberOfMonths(inst),
+ date = this._daylightSavingAdjust(new Date(curYear,
+ curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
+
+ if (offset < 0) {
+ date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
+ }
+ return this._isInRange(inst, date);
+ },
+
+ /* Is the given date in the accepted range? */
+ _isInRange: function(inst, date) {
+ var yearSplit, currentYear,
+ minDate = this._getMinMaxDate(inst, "min"),
+ maxDate = this._getMinMaxDate(inst, "max"),
+ minYear = null,
+ maxYear = null,
+ years = this._get(inst, "yearRange");
+ if (years){
+ yearSplit = years.split(":");
+ currentYear = new Date().getFullYear();
+ minYear = parseInt(yearSplit[0], 10);
+ maxYear = parseInt(yearSplit[1], 10);
+ if ( yearSplit[0].match(/[+\-].*/) ) {
+ minYear += currentYear;
+ }
+ if ( yearSplit[1].match(/[+\-].*/) ) {
+ maxYear += currentYear;
+ }
+ }
+
+ return ((!minDate || date.getTime() >= minDate.getTime()) &&
+ (!maxDate || date.getTime() <= maxDate.getTime()) &&
+ (!minYear || date.getFullYear() >= minYear) &&
+ (!maxYear || date.getFullYear() <= maxYear));
+ },
+
+ /* Provide the configuration settings for formatting/parsing. */
+ _getFormatConfig: function(inst) {
+ var shortYearCutoff = this._get(inst, "shortYearCutoff");
+ shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
+ new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
+ return {shortYearCutoff: shortYearCutoff,
+ dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
+ monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
+ },
+
+ /* Format the given date for display. */
+ _formatDate: function(inst, day, month, year) {
+ if (!day) {
+ inst.currentDay = inst.selectedDay;
+ inst.currentMonth = inst.selectedMonth;
+ inst.currentYear = inst.selectedYear;
+ }
+ var date = (day ? (typeof day === "object" ? day :
+ this._daylightSavingAdjust(new Date(year, month, day))) :
+ this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
+ return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
+ }
+});
+
+/*
+ * Bind hover events for datepicker elements.
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
+ * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
+ */
+function datepicker_bindHover(dpDiv) {
+ var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
+ return dpDiv.delegate(selector, "mouseout", function() {
+ $(this).removeClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).removeClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).removeClass("ui-datepicker-next-hover");
+ }
+ })
+ .delegate( selector, "mouseover", datepicker_handleMouseover );
+}
+
+function datepicker_handleMouseover() {
+ if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
+ $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
+ $(this).addClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).addClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).addClass("ui-datepicker-next-hover");
+ }
+ }
+}
+
+/* jQuery extend now ignores nulls! */
+function datepicker_extendRemove(target, props) {
+ $.extend(target, props);
+ for (var name in props) {
+ if (props[name] == null) {
+ target[name] = props[name];
+ }
+ }
+ return target;
+}
+
+/* Invoke the datepicker functionality.
+ @param options string - a command, optionally followed by additional parameters or
+ Object - settings for attaching new datepicker functionality
+ @return jQuery object */
+$.fn.datepicker = function(options){
+
+ /* Verify an empty collection wasn't passed - Fixes #6976 */
+ if ( !this.length ) {
+ return this;
+ }
+
+ /* Initialise the date picker. */
+ if (!$.datepicker.initialized) {
+ $(document).mousedown($.datepicker._checkExternalClick);
+ $.datepicker.initialized = true;
+ }
+
+ /* Append datepicker main container to body if not exist. */
+ if ($("#"+$.datepicker._mainDivId).length === 0) {
+ $("body").append($.datepicker.dpDiv);
+ }
+
+ var otherArgs = Array.prototype.slice.call(arguments, 1);
+ if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
+ return $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this[0]].concat(otherArgs));
+ }
+ return this.each(function() {
+ typeof options === "string" ?
+ $.datepicker["_" + options + "Datepicker"].
+ apply($.datepicker, [this].concat(otherArgs)) :
+ $.datepicker._attachDatepicker(this, options);
+ });
+};
+
+$.datepicker = new Datepicker(); // singleton instance
+$.datepicker.initialized = false;
+$.datepicker.uuid = new Date().getTime();
+$.datepicker.version = "1.11.4";
+
+var datepicker = $.datepicker;
+
+
+/*!
+ * jQuery UI Draggable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/draggable/
+ */
+
+
+$.widget("ui.draggable", $.ui.mouse, {
+ version: "1.11.4",
+ widgetEventPrefix: "drag",
+ options: {
+ addClasses: true,
+ appendTo: "parent",
+ axis: false,
+ connectToSortable: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ iframeFix: false,
+ opacity: false,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
+ scope: "default",
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: false,
+ zIndex: false,
+
+ // callbacks
+ drag: null,
+ start: null,
+ stop: null
+ },
+ _create: function() {
+
+ if ( this.options.helper === "original" ) {
+ this._setPositionRelative();
+ }
+ if (this.options.addClasses){
+ this.element.addClass("ui-draggable");
+ }
+ if (this.options.disabled){
+ this.element.addClass("ui-draggable-disabled");
+ }
+ this._setHandleClassName();
+
+ this._mouseInit();
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+ if ( key === "handle" ) {
+ this._removeHandleClassName();
+ this._setHandleClassName();
+ }
+ },
+
+ _destroy: function() {
+ if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
+ this.destroyOnClear = true;
+ return;
+ }
+ this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
+ this._removeHandleClassName();
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function(event) {
+ var o = this.options;
+
+ this._blurActiveElement( event );
+
+ // among others, prevent a drag on a resizable-handle
+ if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
+ return false;
+ }
+
+ //Quit if we're not on a valid handle
+ this.handle = this._getHandle(event);
+ if (!this.handle) {
+ return false;
+ }
+
+ this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
+
+ return true;
+
+ },
+
+ _blockFrames: function( selector ) {
+ this.iframeBlocks = this.document.find( selector ).map(function() {
+ var iframe = $( this );
+
+ return $( "<div>" )
+ .css( "position", "absolute" )
+ .appendTo( iframe.parent() )
+ .outerWidth( iframe.outerWidth() )
+ .outerHeight( iframe.outerHeight() )
+ .offset( iframe.offset() )[ 0 ];
+ });
+ },
+
+ _unblockFrames: function() {
+ if ( this.iframeBlocks ) {
+ this.iframeBlocks.remove();
+ delete this.iframeBlocks;
+ }
+ },
+
+ _blurActiveElement: function( event ) {
+ var document = this.document[ 0 ];
+
+ // Only need to blur if the event occurred on the draggable itself, see #10527
+ if ( !this.handleElement.is( event.target ) ) {
+ return;
+ }
+
+ // support: IE9
+ // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+ try {
+
+ // Support: IE9, IE10
+ // If the <body> is blurred, IE will switch windows, see #9520
+ if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
+
+ // Blur any element that currently has focus, see #4261
+ $( document.activeElement ).blur();
+ }
+ } catch ( error ) {}
+ },
+
+ _mouseStart: function(event) {
+
+ var o = this.options;
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ this.helper.addClass("ui-draggable-dragging");
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ //If ddmanager is used for droppables, set the global draggable
+ if ($.ui.ddmanager) {
+ $.ui.ddmanager.current = this;
+ }
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Store the helper's css position
+ this.cssPosition = this.helper.css( "position" );
+ this.scrollParent = this.helper.scrollParent( true );
+ this.offsetParent = this.helper.offsetParent();
+ this.hasFixedAncestor = this.helper.parents().filter(function() {
+ return $( this ).css( "position" ) === "fixed";
+ }).length > 0;
+
+ //The element's absolute position on the page minus margins
+ this.positionAbs = this.element.offset();
+ this._refreshOffsets( event );
+
+ //Generate the original position
+ this.originalPosition = this.position = this._generatePosition( event, false );
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+ //Set a containment if given in the options
+ this._setContainment();
+
+ //Trigger event + callbacks
+ if (this._trigger("start", event) === false) {
+ this._clear();
+ return false;
+ }
+
+ //Recache the helper size
+ this._cacheHelperProportions();
+
+ //Prepare the droppable offsets
+ if ($.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+
+ // Reset helper's right/bottom css if they're set and set explicit width/height instead
+ // as this prevents resizing of elements with right/bottom set (see #7772)
+ this._normalizeRightBottom();
+
+ this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
+ if ( $.ui.ddmanager ) {
+ $.ui.ddmanager.dragStart(this, event);
+ }
+
+ return true;
+ },
+
+ _refreshOffsets: function( event ) {
+ this.offset = {
+ top: this.positionAbs.top - this.margins.top,
+ left: this.positionAbs.left - this.margins.left,
+ scroll: false,
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset()
+ };
+
+ this.offset.click = {
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ };
+ },
+
+ _mouseDrag: function(event, noPropagation) {
+ // reset any necessary cached properties (see #5009)
+ if ( this.hasFixedAncestor ) {
+ this.offset.parent = this._getParentOffset();
+ }
+
+ //Compute the helpers position
+ this.position = this._generatePosition( event, true );
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Call plugins and callbacks and use the resulting position if something is returned
+ if (!noPropagation) {
+ var ui = this._uiHash();
+ if (this._trigger("drag", event, ui) === false) {
+ this._mouseUp({});
+ return false;
+ }
+ this.position = ui.position;
+ }
+
+ this.helper[ 0 ].style.left = this.position.left + "px";
+ this.helper[ 0 ].style.top = this.position.top + "px";
+
+ if ($.ui.ddmanager) {
+ $.ui.ddmanager.drag(this, event);
+ }
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ //If we are using droppables, inform the manager about the drop
+ var that = this,
+ dropped = false;
+ if ($.ui.ddmanager && !this.options.dropBehaviour) {
+ dropped = $.ui.ddmanager.drop(this, event);
+ }
+
+ //if a drop comes from outside (a sortable)
+ if (this.dropped) {
+ dropped = this.dropped;
+ this.dropped = false;
+ }
+
+ if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+ if (that._trigger("stop", event) !== false) {
+ that._clear();
+ }
+ });
+ } else {
+ if (this._trigger("stop", event) !== false) {
+ this._clear();
+ }
+ }
+
+ return false;
+ },
+
+ _mouseUp: function( event ) {
+ this._unblockFrames();
+
+ //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
+ if ( $.ui.ddmanager ) {
+ $.ui.ddmanager.dragStop(this, event);
+ }
+
+ // Only need to focus if the event occurred on the draggable itself, see #10527
+ if ( this.handleElement.is( event.target ) ) {
+ // The interaction is over; whether or not the click resulted in a drag, focus the element
+ this.element.focus();
+ }
+
+ return $.ui.mouse.prototype._mouseUp.call(this, event);
+ },
+
+ cancel: function() {
+
+ if (this.helper.is(".ui-draggable-dragging")) {
+ this._mouseUp({});
+ } else {
+ this._clear();
+ }
+
+ return this;
+
+ },
+
+ _getHandle: function(event) {
+ return this.options.handle ?
+ !!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
+ true;
+ },
+
+ _setHandleClassName: function() {
+ this.handleElement = this.options.handle ?
+ this.element.find( this.options.handle ) : this.element;
+ this.handleElement.addClass( "ui-draggable-handle" );
+ },
+
+ _removeHandleClassName: function() {
+ this.handleElement.removeClass( "ui-draggable-handle" );
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options,
+ helperIsFunction = $.isFunction( o.helper ),
+ helper = helperIsFunction ?
+ $( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
+ ( o.helper === "clone" ?
+ this.element.clone().removeAttr( "id" ) :
+ this.element );
+
+ if (!helper.parents("body").length) {
+ helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
+ }
+
+ // http://bugs.jqueryui.com/ticket/9446
+ // a helper function can return the original element
+ // which wouldn't have been set to relative in _create
+ if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
+ this._setPositionRelative();
+ }
+
+ if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
+ helper.css("position", "absolute");
+ }
+
+ return helper;
+
+ },
+
+ _setPositionRelative: function() {
+ if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
+ this.element[ 0 ].style.position = "relative";
+ }
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if (typeof obj === "string") {
+ obj = obj.split(" ");
+ }
+ if ($.isArray(obj)) {
+ obj = { left: +obj[0], top: +obj[1] || 0 };
+ }
+ if ("left" in obj) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ("right" in obj) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ("top" in obj) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ("bottom" in obj) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _isRootNode: function( element ) {
+ return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
+ },
+
+ _getParentOffset: function() {
+
+ //Get the offsetParent and cache its position
+ var po = this.offsetParent.offset(),
+ document = this.document[ 0 ];
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
+ po = { top: 0, left: 0 };
+ }
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+ if ( this.cssPosition !== "relative" ) {
+ return { top: 0, left: 0 };
+ }
+
+ var p = this.element.position(),
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
+
+ return {
+ top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
+ left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
+ };
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.element.css("marginLeft"), 10) || 0),
+ top: (parseInt(this.element.css("marginTop"), 10) || 0),
+ right: (parseInt(this.element.css("marginRight"), 10) || 0),
+ bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var isUserScrollable, c, ce,
+ o = this.options,
+ document = this.document[ 0 ];
+
+ this.relativeContainer = null;
+
+ if ( !o.containment ) {
+ this.containment = null;
+ return;
+ }
+
+ if ( o.containment === "window" ) {
+ this.containment = [
+ $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
+ $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
+ $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
+ $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+ ];
+ return;
+ }
+
+ if ( o.containment === "document") {
+ this.containment = [
+ 0,
+ 0,
+ $( document ).width() - this.helperProportions.width - this.margins.left,
+ ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+ ];
+ return;
+ }
+
+ if ( o.containment.constructor === Array ) {
+ this.containment = o.containment;
+ return;
+ }
+
+ if ( o.containment === "parent" ) {
+ o.containment = this.helper[ 0 ].parentNode;
+ }
+
+ c = $( o.containment );
+ ce = c[ 0 ];
+
+ if ( !ce ) {
+ return;
+ }
+
+ isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
+
+ this.containment = [
+ ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
+ ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
+ ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
+ ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
+ ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
+ this.helperProportions.width -
+ this.margins.left -
+ this.margins.right,
+ ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
+ ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
+ ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
+ this.helperProportions.height -
+ this.margins.top -
+ this.margins.bottom
+ ];
+ this.relativeContainer = c;
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if (!pos) {
+ pos = this.position;
+ }
+
+ var mod = d === "absolute" ? 1 : -1,
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
+
+ return {
+ top: (
+ pos.top + // The absolute mouse position
+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
+ ),
+ left: (
+ pos.left + // The absolute mouse position
+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function( event, constrainPosition ) {
+
+ var containment, co, top, left,
+ o = this.options,
+ scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
+ pageX = event.pageX,
+ pageY = event.pageY;
+
+ // Cache the scroll
+ if ( !scrollIsRootNode || !this.offset.scroll ) {
+ this.offset.scroll = {
+ top: this.scrollParent.scrollTop(),
+ left: this.scrollParent.scrollLeft()
+ };
+ }
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ // If we are not dragging yet, we won't check for options
+ if ( constrainPosition ) {
+ if ( this.containment ) {
+ if ( this.relativeContainer ){
+ co = this.relativeContainer.offset();
+ containment = [
+ this.containment[ 0 ] + co.left,
+ this.containment[ 1 ] + co.top,
+ this.containment[ 2 ] + co.left,
+ this.containment[ 3 ] + co.top
+ ];
+ } else {
+ containment = this.containment;
+ }
+
+ if (event.pageX - this.offset.click.left < containment[0]) {
+ pageX = containment[0] + this.offset.click.left;
+ }
+ if (event.pageY - this.offset.click.top < containment[1]) {
+ pageY = containment[1] + this.offset.click.top;
+ }
+ if (event.pageX - this.offset.click.left > containment[2]) {
+ pageX = containment[2] + this.offset.click.left;
+ }
+ if (event.pageY - this.offset.click.top > containment[3]) {
+ pageY = containment[3] + this.offset.click.top;
+ }
+ }
+
+ if (o.grid) {
+ //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
+ top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
+ pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
+ pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ if ( o.axis === "y" ) {
+ pageX = this.originalPageX;
+ }
+
+ if ( o.axis === "x" ) {
+ pageY = this.originalPageY;
+ }
+ }
+
+ return {
+ top: (
+ pageY - // The absolute mouse position
+ this.offset.click.top - // Click offset (relative to the element)
+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
+ ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
+ ),
+ left: (
+ pageX - // The absolute mouse position
+ this.offset.click.left - // Click offset (relative to the element)
+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
+ ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
+ )
+ };
+
+ },
+
+ _clear: function() {
+ this.helper.removeClass("ui-draggable-dragging");
+ if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
+ this.helper.remove();
+ }
+ this.helper = null;
+ this.cancelHelperRemoval = false;
+ if ( this.destroyOnClear ) {
+ this.destroy();
+ }
+ },
+
+ _normalizeRightBottom: function() {
+ if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
+ this.helper.width( this.helper.width() );
+ this.helper.css( "right", "auto" );
+ }
+ if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
+ this.helper.height( this.helper.height() );
+ this.helper.css( "bottom", "auto" );
+ }
+ },
+
+ // From now on bulk stuff - mainly helpers
+
+ _trigger: function( type, event, ui ) {
+ ui = ui || this._uiHash();
+ $.ui.plugin.call( this, type, [ event, ui, this ], true );
+
+ // Absolute position and offset (see #6884 ) have to be recalculated after plugins
+ if ( /^(drag|start|stop)/.test( type ) ) {
+ this.positionAbs = this._convertPositionTo( "absolute" );
+ ui.offset = this.positionAbs;
+ }
+ return $.Widget.prototype._trigger.call( this, type, event, ui );
+ },
+
+ plugins: {},
+
+ _uiHash: function() {
+ return {
+ helper: this.helper,
+ position: this.position,
+ originalPosition: this.originalPosition,
+ offset: this.positionAbs
+ };
+ }
+
+});
+
+$.ui.plugin.add( "draggable", "connectToSortable", {
+ start: function( event, ui, draggable ) {
+ var uiSortable = $.extend( {}, ui, {
+ item: draggable.element
+ });
+
+ draggable.sortables = [];
+ $( draggable.options.connectToSortable ).each(function() {
+ var sortable = $( this ).sortable( "instance" );
+
+ if ( sortable && !sortable.options.disabled ) {
+ draggable.sortables.push( sortable );
+
+ // refreshPositions is called at drag start to refresh the containerCache
+ // which is used in drag. This ensures it's initialized and synchronized
+ // with any changes that might have happened on the page since initialization.
+ sortable.refreshPositions();
+ sortable._trigger("activate", event, uiSortable);
+ }
+ });
+ },
+ stop: function( event, ui, draggable ) {
+ var uiSortable = $.extend( {}, ui, {
+ item: draggable.element
+ });
+
+ draggable.cancelHelperRemoval = false;
+
+ $.each( draggable.sortables, function() {
+ var sortable = this;
+
+ if ( sortable.isOver ) {
+ sortable.isOver = 0;
+
+ // Allow this sortable to handle removing the helper
+ draggable.cancelHelperRemoval = true;
+ sortable.cancelHelperRemoval = false;
+
+ // Use _storedCSS To restore properties in the sortable,
+ // as this also handles revert (#9675) since the draggable
+ // may have modified them in unexpected ways (#8809)
+ sortable._storedCSS = {
+ position: sortable.placeholder.css( "position" ),
+ top: sortable.placeholder.css( "top" ),
+ left: sortable.placeholder.css( "left" )
+ };
+
+ sortable._mouseStop(event);
+
+ // Once drag has ended, the sortable should return to using
+ // its original helper, not the shared helper from draggable
+ sortable.options.helper = sortable.options._helper;
+ } else {
+ // Prevent this Sortable from removing the helper.
+ // However, don't set the draggable to remove the helper
+ // either as another connected Sortable may yet handle the removal.
+ sortable.cancelHelperRemoval = true;
+
+ sortable._trigger( "deactivate", event, uiSortable );
+ }
+ });
+ },
+ drag: function( event, ui, draggable ) {
+ $.each( draggable.sortables, function() {
+ var innermostIntersecting = false,
+ sortable = this;
+
+ // Copy over variables that sortable's _intersectsWith uses
+ sortable.positionAbs = draggable.positionAbs;
+ sortable.helperProportions = draggable.helperProportions;
+ sortable.offset.click = draggable.offset.click;
+
+ if ( sortable._intersectsWith( sortable.containerCache ) ) {
+ innermostIntersecting = true;
+
+ $.each( draggable.sortables, function() {
+ // Copy over variables that sortable's _intersectsWith uses
+ this.positionAbs = draggable.positionAbs;
+ this.helperProportions = draggable.helperProportions;
+ this.offset.click = draggable.offset.click;
+
+ if ( this !== sortable &&
+ this._intersectsWith( this.containerCache ) &&
+ $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
+ innermostIntersecting = false;
+ }
+
+ return innermostIntersecting;
+ });
+ }
+
+ if ( innermostIntersecting ) {
+ // If it intersects, we use a little isOver variable and set it once,
+ // so that the move-in stuff gets fired only once.
+ if ( !sortable.isOver ) {
+ sortable.isOver = 1;
+
+ // Store draggable's parent in case we need to reappend to it later.
+ draggable._parent = ui.helper.parent();
+
+ sortable.currentItem = ui.helper
+ .appendTo( sortable.element )
+ .data( "ui-sortable-item", true );
+
+ // Store helper option to later restore it
+ sortable.options._helper = sortable.options.helper;
+
+ sortable.options.helper = function() {
+ return ui.helper[ 0 ];
+ };
+
+ // Fire the start events of the sortable with our passed browser event,
+ // and our own helper (so it doesn't create a new one)
+ event.target = sortable.currentItem[ 0 ];
+ sortable._mouseCapture( event, true );
+ sortable._mouseStart( event, true, true );
+
+ // Because the browser event is way off the new appended portlet,
+ // modify necessary variables to reflect the changes
+ sortable.offset.click.top = draggable.offset.click.top;
+ sortable.offset.click.left = draggable.offset.click.left;
+ sortable.offset.parent.left -= draggable.offset.parent.left -
+ sortable.offset.parent.left;
+ sortable.offset.parent.top -= draggable.offset.parent.top -
+ sortable.offset.parent.top;
+
+ draggable._trigger( "toSortable", event );
+
+ // Inform draggable that the helper is in a valid drop zone,
+ // used solely in the revert option to handle "valid/invalid".
+ draggable.dropped = sortable.element;
+
+ // Need to refreshPositions of all sortables in the case that
+ // adding to one sortable changes the location of the other sortables (#9675)
+ $.each( draggable.sortables, function() {
+ this.refreshPositions();
+ });
+
+ // hack so receive/update callbacks work (mostly)
+ draggable.currentItem = draggable.element;
+ sortable.fromOutside = draggable;
+ }
+
+ if ( sortable.currentItem ) {
+ sortable._mouseDrag( event );
+ // Copy the sortable's position because the draggable's can potentially reflect
+ // a relative position, while sortable is always absolute, which the dragged
+ // element has now become. (#8809)
+ ui.position = sortable.position;
+ }
+ } else {
+ // If it doesn't intersect with the sortable, and it intersected before,
+ // we fake the drag stop of the sortable, but make sure it doesn't remove
+ // the helper by using cancelHelperRemoval.
+ if ( sortable.isOver ) {
+
+ sortable.isOver = 0;
+ sortable.cancelHelperRemoval = true;
+
+ // Calling sortable's mouseStop would trigger a revert,
+ // so revert must be temporarily false until after mouseStop is called.
+ sortable.options._revert = sortable.options.revert;
+ sortable.options.revert = false;
+
+ sortable._trigger( "out", event, sortable._uiHash( sortable ) );
+ sortable._mouseStop( event, true );
+
+ // restore sortable behaviors that were modfied
+ // when the draggable entered the sortable area (#9481)
+ sortable.options.revert = sortable.options._revert;
+ sortable.options.helper = sortable.options._helper;
+
+ if ( sortable.placeholder ) {
+ sortable.placeholder.remove();
+ }
+
+ // Restore and recalculate the draggable's offset considering the sortable
+ // may have modified them in unexpected ways. (#8809, #10669)
+ ui.helper.appendTo( draggable._parent );
+ draggable._refreshOffsets( event );
+ ui.position = draggable._generatePosition( event, true );
+
+ draggable._trigger( "fromSortable", event );
+
+ // Inform draggable that the helper is no longer in a valid drop zone
+ draggable.dropped = false;
+
+ // Need to refreshPositions of all sortables just in case removing
+ // from one sortable changes the location of other sortables (#9675)
+ $.each( draggable.sortables, function() {
+ this.refreshPositions();
+ });
+ }
+ }
+ });
+ }
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+ start: function( event, ui, instance ) {
+ var t = $( "body" ),
+ o = instance.options;
+
+ if (t.css("cursor")) {
+ o._cursor = t.css("cursor");
+ }
+ t.css("cursor", o.cursor);
+ },
+ stop: function( event, ui, instance ) {
+ var o = instance.options;
+ if (o._cursor) {
+ $("body").css("cursor", o._cursor);
+ }
+ }
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+ start: function( event, ui, instance ) {
+ var t = $( ui.helper ),
+ o = instance.options;
+ if (t.css("opacity")) {
+ o._opacity = t.css("opacity");
+ }
+ t.css("opacity", o.opacity);
+ },
+ stop: function( event, ui, instance ) {
+ var o = instance.options;
+ if (o._opacity) {
+ $(ui.helper).css("opacity", o._opacity);
+ }
+ }
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+ start: function( event, ui, i ) {
+ if ( !i.scrollParentNotHidden ) {
+ i.scrollParentNotHidden = i.helper.scrollParent( false );
+ }
+
+ if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
+ i.overflowOffset = i.scrollParentNotHidden.offset();
+ }
+ },
+ drag: function( event, ui, i ) {
+
+ var o = i.options,
+ scrolled = false,
+ scrollParent = i.scrollParentNotHidden[ 0 ],
+ document = i.document[ 0 ];
+
+ if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
+ if ( !o.axis || o.axis !== "x" ) {
+ if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
+ scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
+ } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
+ scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
+ }
+ }
+
+ if ( !o.axis || o.axis !== "y" ) {
+ if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
+ scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
+ } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
+ scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
+ }
+ }
+
+ } else {
+
+ if (!o.axis || o.axis !== "x") {
+ if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+ } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+ }
+ }
+
+ if (!o.axis || o.axis !== "y") {
+ if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+ } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+ }
+ }
+
+ }
+
+ if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(i, event);
+ }
+
+ }
+});
+
+$.ui.plugin.add("draggable", "snap", {
+ start: function( event, ui, i ) {
+
+ var o = i.options;
+
+ i.snapElements = [];
+
+ $(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
+ var $t = $(this),
+ $o = $t.offset();
+ if (this !== i.element[0]) {
+ i.snapElements.push({
+ item: this,
+ width: $t.outerWidth(), height: $t.outerHeight(),
+ top: $o.top, left: $o.left
+ });
+ }
+ });
+
+ },
+ drag: function( event, ui, inst ) {
+
+ var ts, bs, ls, rs, l, r, t, b, i, first,
+ o = inst.options,
+ d = o.snapTolerance,
+ x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+ y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+ for (i = inst.snapElements.length - 1; i >= 0; i--){
+
+ l = inst.snapElements[i].left - inst.margins.left;
+ r = l + inst.snapElements[i].width;
+ t = inst.snapElements[i].top - inst.margins.top;
+ b = t + inst.snapElements[i].height;
+
+ if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
+ if (inst.snapElements[i].snapping) {
+ (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ }
+ inst.snapElements[i].snapping = false;
+ continue;
+ }
+
+ if (o.snapMode !== "inner") {
+ ts = Math.abs(t - y2) <= d;
+ bs = Math.abs(b - y1) <= d;
+ ls = Math.abs(l - x2) <= d;
+ rs = Math.abs(r - x1) <= d;
+ if (ts) {
+ ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
+ }
+ if (bs) {
+ ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
+ }
+ if (ls) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
+ }
+ if (rs) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
+ }
+ }
+
+ first = (ts || bs || ls || rs);
+
+ if (o.snapMode !== "outer") {
+ ts = Math.abs(t - y1) <= d;
+ bs = Math.abs(b - y2) <= d;
+ ls = Math.abs(l - x1) <= d;
+ rs = Math.abs(r - x2) <= d;
+ if (ts) {
+ ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
+ }
+ if (bs) {
+ ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
+ }
+ if (ls) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
+ }
+ if (rs) {
+ ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
+ }
+ }
+
+ if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
+ (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+ }
+ inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+ }
+
+ }
+});
+
+$.ui.plugin.add("draggable", "stack", {
+ start: function( event, ui, instance ) {
+ var min,
+ o = instance.options,
+ group = $.makeArray($(o.stack)).sort(function(a, b) {
+ return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
+ });
+
+ if (!group.length) { return; }
+
+ min = parseInt($(group[0]).css("zIndex"), 10) || 0;
+ $(group).each(function(i) {
+ $(this).css("zIndex", min + i);
+ });
+ this.css("zIndex", (min + group.length));
+ }
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+ start: function( event, ui, instance ) {
+ var t = $( ui.helper ),
+ o = instance.options;
+
+ if (t.css("zIndex")) {
+ o._zIndex = t.css("zIndex");
+ }
+ t.css("zIndex", o.zIndex);
+ },
+ stop: function( event, ui, instance ) {
+ var o = instance.options;
+
+ if (o._zIndex) {
+ $(ui.helper).css("zIndex", o._zIndex);
+ }
+ }
+});
+
+var draggable = $.ui.draggable;
+
+
+/*!
+ * jQuery UI Resizable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/resizable/
+ */
+
+
+$.widget("ui.resizable", $.ui.mouse, {
+ version: "1.11.4",
+ widgetEventPrefix: "resize",
+ options: {
+ alsoResize: false,
+ animate: false,
+ animateDuration: "slow",
+ animateEasing: "swing",
+ aspectRatio: false,
+ autoHide: false,
+ containment: false,
+ ghost: false,
+ grid: false,
+ handles: "e,s,se",
+ helper: false,
+ maxHeight: null,
+ maxWidth: null,
+ minHeight: 10,
+ minWidth: 10,
+ // See #7960
+ zIndex: 90,
+
+ // callbacks
+ resize: null,
+ start: null,
+ stop: null
+ },
+
+ _num: function( value ) {
+ return parseInt( value, 10 ) || 0;
+ },
+
+ _isNumber: function( value ) {
+ return !isNaN( parseInt( value, 10 ) );
+ },
+
+ _hasScroll: function( el, a ) {
+
+ if ( $( el ).css( "overflow" ) === "hidden") {
+ return false;
+ }
+
+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
+ has = false;
+
+ if ( el[ scroll ] > 0 ) {
+ return true;
+ }
+
+ // TODO: determine which cases actually cause this to happen
+ // if the element doesn't have the scroll set, see if it's possible to
+ // set the scroll
+ el[ scroll ] = 1;
+ has = ( el[ scroll ] > 0 );
+ el[ scroll ] = 0;
+ return has;
+ },
+
+ _create: function() {
+
+ var n, i, handle, axis, hname,
+ that = this,
+ o = this.options;
+ this.element.addClass("ui-resizable");
+
+ $.extend(this, {
+ _aspectRatio: !!(o.aspectRatio),
+ aspectRatio: o.aspectRatio,
+ originalElement: this.element,
+ _proportionallyResizeElements: [],
+ _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
+ });
+
+ // Wrap the element if it cannot hold child nodes
+ if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
+
+ this.element.wrap(
+ $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
+ position: this.element.css("position"),
+ width: this.element.outerWidth(),
+ height: this.element.outerHeight(),
+ top: this.element.css("top"),
+ left: this.element.css("left")
+ })
+ );
+
+ this.element = this.element.parent().data(
+ "ui-resizable", this.element.resizable( "instance" )
+ );
+
+ this.elementIsWrapper = true;
+
+ this.element.css({
+ marginLeft: this.originalElement.css("marginLeft"),
+ marginTop: this.originalElement.css("marginTop"),
+ marginRight: this.originalElement.css("marginRight"),
+ marginBottom: this.originalElement.css("marginBottom")
+ });
+ this.originalElement.css({
+ marginLeft: 0,
+ marginTop: 0,
+ marginRight: 0,
+ marginBottom: 0
+ });
+ // support: Safari
+ // Prevent Safari textarea resize
+ this.originalResizeStyle = this.originalElement.css("resize");
+ this.originalElement.css("resize", "none");
+
+ this._proportionallyResizeElements.push( this.originalElement.css({
+ position: "static",
+ zoom: 1,
+ display: "block"
+ }) );
+
+ // support: IE9
+ // avoid IE jump (hard set the margin)
+ this.originalElement.css({ margin: this.originalElement.css("margin") });
+
+ this._proportionallyResize();
+ }
+
+ this.handles = o.handles ||
+ ( !$(".ui-resizable-handle", this.element).length ?
+ "e,s,se" : {
+ n: ".ui-resizable-n",
+ e: ".ui-resizable-e",
+ s: ".ui-resizable-s",
+ w: ".ui-resizable-w",
+ se: ".ui-resizable-se",
+ sw: ".ui-resizable-sw",
+ ne: ".ui-resizable-ne",
+ nw: ".ui-resizable-nw"
+ } );
+
+ this._handles = $();
+ if ( this.handles.constructor === String ) {
+
+ if ( this.handles === "all") {
+ this.handles = "n,e,s,w,se,sw,ne,nw";
+ }
+
+ n = this.handles.split(",");
+ this.handles = {};
+
+ for (i = 0; i < n.length; i++) {
+
+ handle = $.trim(n[i]);
+ hname = "ui-resizable-" + handle;
+ axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
+
+ axis.css({ zIndex: o.zIndex });
+
+ // TODO : What's going on here?
+ if ("se" === handle) {
+ axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
+ }
+
+ this.handles[handle] = ".ui-resizable-" + handle;
+ this.element.append(axis);
+ }
+
+ }
+
+ this._renderAxis = function(target) {
+
+ var i, axis, padPos, padWrapper;
+
+ target = target || this.element;
+
+ for (i in this.handles) {
+
+ if (this.handles[i].constructor === String) {
+ this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
+ } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
+ this.handles[ i ] = $( this.handles[ i ] );
+ this._on( this.handles[ i ], { "mousedown": that._mouseDown });
+ }
+
+ if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
+
+ axis = $(this.handles[i], this.element);
+
+ padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
+
+ padPos = [ "padding",
+ /ne|nw|n/.test(i) ? "Top" :
+ /se|sw|s/.test(i) ? "Bottom" :
+ /^e$/.test(i) ? "Right" : "Left" ].join("");
+
+ target.css(padPos, padWrapper);
+
+ this._proportionallyResize();
+ }
+
+ this._handles = this._handles.add( this.handles[ i ] );
+ }
+ };
+
+ // TODO: make renderAxis a prototype function
+ this._renderAxis(this.element);
+
+ this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
+ this._handles.disableSelection();
+
+ this._handles.mouseover(function() {
+ if (!that.resizing) {
+ if (this.className) {
+ axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
+ }
+ that.axis = axis && axis[1] ? axis[1] : "se";
+ }
+ });
+
+ if (o.autoHide) {
+ this._handles.hide();
+ $(this.element)
+ .addClass("ui-resizable-autohide")
+ .mouseenter(function() {
+ if (o.disabled) {
+ return;
+ }
+ $(this).removeClass("ui-resizable-autohide");
+ that._handles.show();
+ })
+ .mouseleave(function() {
+ if (o.disabled) {
+ return;
+ }
+ if (!that.resizing) {
+ $(this).addClass("ui-resizable-autohide");
+ that._handles.hide();
+ }
+ });
+ }
+
+ this._mouseInit();
+ },
+
+ _destroy: function() {
+
+ this._mouseDestroy();
+
+ var wrapper,
+ _destroy = function(exp) {
+ $(exp)
+ .removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
+ .removeData("resizable")
+ .removeData("ui-resizable")
+ .unbind(".resizable")
+ .find(".ui-resizable-handle")
+ .remove();
+ };
+
+ // TODO: Unwrap at same DOM position
+ if (this.elementIsWrapper) {
+ _destroy(this.element);
+ wrapper = this.element;
+ this.originalElement.css({
+ position: wrapper.css("position"),
+ width: wrapper.outerWidth(),
+ height: wrapper.outerHeight(),
+ top: wrapper.css("top"),
+ left: wrapper.css("left")
+ }).insertAfter( wrapper );
+ wrapper.remove();
+ }
+
+ this.originalElement.css("resize", this.originalResizeStyle);
+ _destroy(this.originalElement);
+
+ return this;
+ },
+
+ _mouseCapture: function(event) {
+ var i, handle,
+ capture = false;
+
+ for (i in this.handles) {
+ handle = $(this.handles[i])[0];
+ if (handle === event.target || $.contains(handle, event.target)) {
+ capture = true;
+ }
+ }
+
+ return !this.options.disabled && capture;
+ },
+
+ _mouseStart: function(event) {
+
+ var curleft, curtop, cursor,
+ o = this.options,
+ el = this.element;
+
+ this.resizing = true;
+
+ this._renderProxy();
+
+ curleft = this._num(this.helper.css("left"));
+ curtop = this._num(this.helper.css("top"));
+
+ if (o.containment) {
+ curleft += $(o.containment).scrollLeft() || 0;
+ curtop += $(o.containment).scrollTop() || 0;
+ }
+
+ this.offset = this.helper.offset();
+ this.position = { left: curleft, top: curtop };
+
+ this.size = this._helper ? {
+ width: this.helper.width(),
+ height: this.helper.height()
+ } : {
+ width: el.width(),
+ height: el.height()
+ };
+
+ this.originalSize = this._helper ? {
+ width: el.outerWidth(),
+ height: el.outerHeight()
+ } : {
+ width: el.width(),
+ height: el.height()
+ };
+
+ this.sizeDiff = {
+ width: el.outerWidth() - el.width(),
+ height: el.outerHeight() - el.height()
+ };
+
+ this.originalPosition = { left: curleft, top: curtop };
+ this.originalMousePosition = { left: event.pageX, top: event.pageY };
+
+ this.aspectRatio = (typeof o.aspectRatio === "number") ?
+ o.aspectRatio :
+ ((this.originalSize.width / this.originalSize.height) || 1);
+
+ cursor = $(".ui-resizable-" + this.axis).css("cursor");
+ $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
+
+ el.addClass("ui-resizable-resizing");
+ this._propagate("start", event);
+ return true;
+ },
+
+ _mouseDrag: function(event) {
+
+ var data, props,
+ smp = this.originalMousePosition,
+ a = this.axis,
+ dx = (event.pageX - smp.left) || 0,
+ dy = (event.pageY - smp.top) || 0,
+ trigger = this._change[a];
+
+ this._updatePrevProperties();
+
+ if (!trigger) {
+ return false;
+ }
+
+ data = trigger.apply(this, [ event, dx, dy ]);
+
+ this._updateVirtualBoundaries(event.shiftKey);
+ if (this._aspectRatio || event.shiftKey) {
+ data = this._updateRatio(data, event);
+ }
+
+ data = this._respectSize(data, event);
+
+ this._updateCache(data);
+
+ this._propagate("resize", event);
+
+ props = this._applyChanges();
+
+ if ( !this._helper && this._proportionallyResizeElements.length ) {
+ this._proportionallyResize();
+ }
+
+ if ( !$.isEmptyObject( props ) ) {
+ this._updatePrevProperties();
+ this._trigger( "resize", event, this.ui() );
+ this._applyChanges();
+ }
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+
+ this.resizing = false;
+ var pr, ista, soffseth, soffsetw, s, left, top,
+ o = this.options, that = this;
+
+ if (this._helper) {
+
+ pr = this._proportionallyResizeElements;
+ ista = pr.length && (/textarea/i).test(pr[0].nodeName);
+ soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
+ soffsetw = ista ? 0 : that.sizeDiff.width;
+
+ s = {
+ width: (that.helper.width() - soffsetw),
+ height: (that.helper.height() - soffseth)
+ };
+ left = (parseInt(that.element.css("left"), 10) +
+ (that.position.left - that.originalPosition.left)) || null;
+ top = (parseInt(that.element.css("top"), 10) +
+ (that.position.top - that.originalPosition.top)) || null;
+
+ if (!o.animate) {
+ this.element.css($.extend(s, { top: top, left: left }));
+ }
+
+ that.helper.height(that.size.height);
+ that.helper.width(that.size.width);
+
+ if (this._helper && !o.animate) {
+ this._proportionallyResize();
+ }
+ }
+
+ $("body").css("cursor", "auto");
+
+ this.element.removeClass("ui-resizable-resizing");
+
+ this._propagate("stop", event);
+
+ if (this._helper) {
+ this.helper.remove();
+ }
+
+ return false;
+
+ },
+
+ _updatePrevProperties: function() {
+ this.prevPosition = {
+ top: this.position.top,
+ left: this.position.left
+ };
+ this.prevSize = {
+ width: this.size.width,
+ height: this.size.height
+ };
+ },
+
+ _applyChanges: function() {
+ var props = {};
+
+ if ( this.position.top !== this.prevPosition.top ) {
+ props.top = this.position.top + "px";
+ }
+ if ( this.position.left !== this.prevPosition.left ) {
+ props.left = this.position.left + "px";
+ }
+ if ( this.size.width !== this.prevSize.width ) {
+ props.width = this.size.width + "px";
+ }
+ if ( this.size.height !== this.prevSize.height ) {
+ props.height = this.size.height + "px";
+ }
+
+ this.helper.css( props );
+
+ return props;
+ },
+
+ _updateVirtualBoundaries: function(forceAspectRatio) {
+ var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
+ o = this.options;
+
+ b = {
+ minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
+ maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
+ minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
+ maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
+ };
+
+ if (this._aspectRatio || forceAspectRatio) {
+ pMinWidth = b.minHeight * this.aspectRatio;
+ pMinHeight = b.minWidth / this.aspectRatio;
+ pMaxWidth = b.maxHeight * this.aspectRatio;
+ pMaxHeight = b.maxWidth / this.aspectRatio;
+
+ if (pMinWidth > b.minWidth) {
+ b.minWidth = pMinWidth;
+ }
+ if (pMinHeight > b.minHeight) {
+ b.minHeight = pMinHeight;
+ }
+ if (pMaxWidth < b.maxWidth) {
+ b.maxWidth = pMaxWidth;
+ }
+ if (pMaxHeight < b.maxHeight) {
+ b.maxHeight = pMaxHeight;
+ }
+ }
+ this._vBoundaries = b;
+ },
+
+ _updateCache: function(data) {
+ this.offset = this.helper.offset();
+ if (this._isNumber(data.left)) {
+ this.position.left = data.left;
+ }
+ if (this._isNumber(data.top)) {
+ this.position.top = data.top;
+ }
+ if (this._isNumber(data.height)) {
+ this.size.height = data.height;
+ }
+ if (this._isNumber(data.width)) {
+ this.size.width = data.width;
+ }
+ },
+
+ _updateRatio: function( data ) {
+
+ var cpos = this.position,
+ csize = this.size,
+ a = this.axis;
+
+ if (this._isNumber(data.height)) {
+ data.width = (data.height * this.aspectRatio);
+ } else if (this._isNumber(data.width)) {
+ data.height = (data.width / this.aspectRatio);
+ }
+
+ if (a === "sw") {
+ data.left = cpos.left + (csize.width - data.width);
+ data.top = null;
+ }
+ if (a === "nw") {
+ data.top = cpos.top + (csize.height - data.height);
+ data.left = cpos.left + (csize.width - data.width);
+ }
+
+ return data;
+ },
+
+ _respectSize: function( data ) {
+
+ var o = this._vBoundaries,
+ a = this.axis,
+ ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
+ ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
+ isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
+ isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
+ dw = this.originalPosition.left + this.originalSize.width,
+ dh = this.position.top + this.size.height,
+ cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
+ if (isminw) {
+ data.width = o.minWidth;
+ }
+ if (isminh) {
+ data.height = o.minHeight;
+ }
+ if (ismaxw) {
+ data.width = o.maxWidth;
+ }
+ if (ismaxh) {
+ data.height = o.maxHeight;
+ }
+
+ if (isminw && cw) {
+ data.left = dw - o.minWidth;
+ }
+ if (ismaxw && cw) {
+ data.left = dw - o.maxWidth;
+ }
+ if (isminh && ch) {
+ data.top = dh - o.minHeight;
+ }
+ if (ismaxh && ch) {
+ data.top = dh - o.maxHeight;
+ }
+
+ // Fixing jump error on top/left - bug #2330
+ if (!data.width && !data.height && !data.left && data.top) {
+ data.top = null;
+ } else if (!data.width && !data.height && !data.top && data.left) {
+ data.left = null;
+ }
+
+ return data;
+ },
+
+ _getPaddingPlusBorderDimensions: function( element ) {
+ var i = 0,
+ widths = [],
+ borders = [
+ element.css( "borderTopWidth" ),
+ element.css( "borderRightWidth" ),
+ element.css( "borderBottomWidth" ),
+ element.css( "borderLeftWidth" )
+ ],
+ paddings = [
+ element.css( "paddingTop" ),
+ element.css( "paddingRight" ),
+ element.css( "paddingBottom" ),
+ element.css( "paddingLeft" )
+ ];
+
+ for ( ; i < 4; i++ ) {
+ widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
+ widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
+ }
+
+ return {
+ height: widths[ 0 ] + widths[ 2 ],
+ width: widths[ 1 ] + widths[ 3 ]
+ };
+ },
+
+ _proportionallyResize: function() {
+
+ if (!this._proportionallyResizeElements.length) {
+ return;
+ }
+
+ var prel,
+ i = 0,
+ element = this.helper || this.element;
+
+ for ( ; i < this._proportionallyResizeElements.length; i++) {
+
+ prel = this._proportionallyResizeElements[i];
+
+ // TODO: Seems like a bug to cache this.outerDimensions
+ // considering that we are in a loop.
+ if (!this.outerDimensions) {
+ this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
+ }
+
+ prel.css({
+ height: (element.height() - this.outerDimensions.height) || 0,
+ width: (element.width() - this.outerDimensions.width) || 0
+ });
+
+ }
+
+ },
+
+ _renderProxy: function() {
+
+ var el = this.element, o = this.options;
+ this.elementOffset = el.offset();
+
+ if (this._helper) {
+
+ this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
+
+ this.helper.addClass(this._helper).css({
+ width: this.element.outerWidth() - 1,
+ height: this.element.outerHeight() - 1,
+ position: "absolute",
+ left: this.elementOffset.left + "px",
+ top: this.elementOffset.top + "px",
+ zIndex: ++o.zIndex //TODO: Don't modify option
+ });
+
+ this.helper
+ .appendTo("body")
+ .disableSelection();
+
+ } else {
+ this.helper = this.element;
+ }
+
+ },
+
+ _change: {
+ e: function(event, dx) {
+ return { width: this.originalSize.width + dx };
+ },
+ w: function(event, dx) {
+ var cs = this.originalSize, sp = this.originalPosition;
+ return { left: sp.left + dx, width: cs.width - dx };
+ },
+ n: function(event, dx, dy) {
+ var cs = this.originalSize, sp = this.originalPosition;
+ return { top: sp.top + dy, height: cs.height - dy };
+ },
+ s: function(event, dx, dy) {
+ return { height: this.originalSize.height + dy };
+ },
+ se: function(event, dx, dy) {
+ return $.extend(this._change.s.apply(this, arguments),
+ this._change.e.apply(this, [ event, dx, dy ]));
+ },
+ sw: function(event, dx, dy) {
+ return $.extend(this._change.s.apply(this, arguments),
+ this._change.w.apply(this, [ event, dx, dy ]));
+ },
+ ne: function(event, dx, dy) {
+ return $.extend(this._change.n.apply(this, arguments),
+ this._change.e.apply(this, [ event, dx, dy ]));
+ },
+ nw: function(event, dx, dy) {
+ return $.extend(this._change.n.apply(this, arguments),
+ this._change.w.apply(this, [ event, dx, dy ]));
+ }
+ },
+
+ _propagate: function(n, event) {
+ $.ui.plugin.call(this, n, [ event, this.ui() ]);
+ (n !== "resize" && this._trigger(n, event, this.ui()));
+ },
+
+ plugins: {},
+
+ ui: function() {
+ return {
+ originalElement: this.originalElement,
+ element: this.element,
+ helper: this.helper,
+ position: this.position,
+ size: this.size,
+ originalSize: this.originalSize,
+ originalPosition: this.originalPosition
+ };
+ }
+
+});
+
+/*
+ * Resizable Extensions
+ */
+
+$.ui.plugin.add("resizable", "animate", {
+
+ stop: function( event ) {
+ var that = $(this).resizable( "instance" ),
+ o = that.options,
+ pr = that._proportionallyResizeElements,
+ ista = pr.length && (/textarea/i).test(pr[0].nodeName),
+ soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
+ soffsetw = ista ? 0 : that.sizeDiff.width,
+ style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
+ left = (parseInt(that.element.css("left"), 10) +
+ (that.position.left - that.originalPosition.left)) || null,
+ top = (parseInt(that.element.css("top"), 10) +
+ (that.position.top - that.originalPosition.top)) || null;
+
+ that.element.animate(
+ $.extend(style, top && left ? { top: top, left: left } : {}), {
+ duration: o.animateDuration,
+ easing: o.animateEasing,
+ step: function() {
+
+ var data = {
+ width: parseInt(that.element.css("width"), 10),
+ height: parseInt(that.element.css("height"), 10),
+ top: parseInt(that.element.css("top"), 10),
+ left: parseInt(that.element.css("left"), 10)
+ };
+
+ if (pr && pr.length) {
+ $(pr[0]).css({ width: data.width, height: data.height });
+ }
+
+ // propagating resize, and updating values for each animation step
+ that._updateCache(data);
+ that._propagate("resize", event);
+
+ }
+ }
+ );
+ }
+
+});
+
+$.ui.plugin.add( "resizable", "containment", {
+
+ start: function() {
+ var element, p, co, ch, cw, width, height,
+ that = $( this ).resizable( "instance" ),
+ o = that.options,
+ el = that.element,
+ oc = o.containment,
+ ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
+
+ if ( !ce ) {
+ return;
+ }
+
+ that.containerElement = $( ce );
+
+ if ( /document/.test( oc ) || oc === document ) {
+ that.containerOffset = {
+ left: 0,
+ top: 0
+ };
+ that.containerPosition = {
+ left: 0,
+ top: 0
+ };
+
+ that.parentData = {
+ element: $( document ),
+ left: 0,
+ top: 0,
+ width: $( document ).width(),
+ height: $( document ).height() || document.body.parentNode.scrollHeight
+ };
+ } else {
+ element = $( ce );
+ p = [];
+ $([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
+ p[ i ] = that._num( element.css( "padding" + name ) );
+ });
+
+ that.containerOffset = element.offset();
+ that.containerPosition = element.position();
+ that.containerSize = {
+ height: ( element.innerHeight() - p[ 3 ] ),
+ width: ( element.innerWidth() - p[ 1 ] )
+ };
+
+ co = that.containerOffset;
+ ch = that.containerSize.height;
+ cw = that.containerSize.width;
+ width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
+ height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
+
+ that.parentData = {
+ element: ce,
+ left: co.left,
+ top: co.top,
+ width: width,
+ height: height
+ };
+ }
+ },
+
+ resize: function( event ) {
+ var woset, hoset, isParent, isOffsetRelative,
+ that = $( this ).resizable( "instance" ),
+ o = that.options,
+ co = that.containerOffset,
+ cp = that.position,
+ pRatio = that._aspectRatio || event.shiftKey,
+ cop = {
+ top: 0,
+ left: 0
+ },
+ ce = that.containerElement,
+ continueResize = true;
+
+ if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
+ cop = co;
+ }
+
+ if ( cp.left < ( that._helper ? co.left : 0 ) ) {
+ that.size.width = that.size.width +
+ ( that._helper ?
+ ( that.position.left - co.left ) :
+ ( that.position.left - cop.left ) );
+
+ if ( pRatio ) {
+ that.size.height = that.size.width / that.aspectRatio;
+ continueResize = false;
+ }
+ that.position.left = o.helper ? co.left : 0;
+ }
+
+ if ( cp.top < ( that._helper ? co.top : 0 ) ) {
+ that.size.height = that.size.height +
+ ( that._helper ?
+ ( that.position.top - co.top ) :
+ that.position.top );
+
+ if ( pRatio ) {
+ that.size.width = that.size.height * that.aspectRatio;
+ continueResize = false;
+ }
+ that.position.top = that._helper ? co.top : 0;
+ }
+
+ isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
+ isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
+
+ if ( isParent && isOffsetRelative ) {
+ that.offset.left = that.parentData.left + that.position.left;
+ that.offset.top = that.parentData.top + that.position.top;
+ } else {
+ that.offset.left = that.element.offset().left;
+ that.offset.top = that.element.offset().top;
+ }
+
+ woset = Math.abs( that.sizeDiff.width +
+ (that._helper ?
+ that.offset.left - cop.left :
+ (that.offset.left - co.left)) );
+
+ hoset = Math.abs( that.sizeDiff.height +
+ (that._helper ?
+ that.offset.top - cop.top :
+ (that.offset.top - co.top)) );
+
+ if ( woset + that.size.width >= that.parentData.width ) {
+ that.size.width = that.parentData.width - woset;
+ if ( pRatio ) {
+ that.size.height = that.size.width / that.aspectRatio;
+ continueResize = false;
+ }
+ }
+
+ if ( hoset + that.size.height >= that.parentData.height ) {
+ that.size.height = that.parentData.height - hoset;
+ if ( pRatio ) {
+ that.size.width = that.size.height * that.aspectRatio;
+ continueResize = false;
+ }
+ }
+
+ if ( !continueResize ) {
+ that.position.left = that.prevPosition.left;
+ that.position.top = that.prevPosition.top;
+ that.size.width = that.prevSize.width;
+ that.size.height = that.prevSize.height;
+ }
+ },
+
+ stop: function() {
+ var that = $( this ).resizable( "instance" ),
+ o = that.options,
+ co = that.containerOffset,
+ cop = that.containerPosition,
+ ce = that.containerElement,
+ helper = $( that.helper ),
+ ho = helper.offset(),
+ w = helper.outerWidth() - that.sizeDiff.width,
+ h = helper.outerHeight() - that.sizeDiff.height;
+
+ if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
+ $( this ).css({
+ left: ho.left - cop.left - co.left,
+ width: w,
+ height: h
+ });
+ }
+
+ if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
+ $( this ).css({
+ left: ho.left - cop.left - co.left,
+ width: w,
+ height: h
+ });
+ }
+ }
+});
+
+$.ui.plugin.add("resizable", "alsoResize", {
+
+ start: function() {
+ var that = $(this).resizable( "instance" ),
+ o = that.options;
+
+ $(o.alsoResize).each(function() {
+ var el = $(this);
+ el.data("ui-resizable-alsoresize", {
+ width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
+ left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
+ });
+ });
+ },
+
+ resize: function(event, ui) {
+ var that = $(this).resizable( "instance" ),
+ o = that.options,
+ os = that.originalSize,
+ op = that.originalPosition,
+ delta = {
+ height: (that.size.height - os.height) || 0,
+ width: (that.size.width - os.width) || 0,
+ top: (that.position.top - op.top) || 0,
+ left: (that.position.left - op.left) || 0
+ };
+
+ $(o.alsoResize).each(function() {
+ var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
+ css = el.parents(ui.originalElement[0]).length ?
+ [ "width", "height" ] :
+ [ "width", "height", "top", "left" ];
+
+ $.each(css, function(i, prop) {
+ var sum = (start[prop] || 0) + (delta[prop] || 0);
+ if (sum && sum >= 0) {
+ style[prop] = sum || null;
+ }
+ });
+
+ el.css(style);
+ });
+ },
+
+ stop: function() {
+ $(this).removeData("resizable-alsoresize");
+ }
+});
+
+$.ui.plugin.add("resizable", "ghost", {
+
+ start: function() {
+
+ var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
+
+ that.ghost = that.originalElement.clone();
+ that.ghost
+ .css({
+ opacity: 0.25,
+ display: "block",
+ position: "relative",
+ height: cs.height,
+ width: cs.width,
+ margin: 0,
+ left: 0,
+ top: 0
+ })
+ .addClass("ui-resizable-ghost")
+ .addClass(typeof o.ghost === "string" ? o.ghost : "");
+
+ that.ghost.appendTo(that.helper);
+
+ },
+
+ resize: function() {
+ var that = $(this).resizable( "instance" );
+ if (that.ghost) {
+ that.ghost.css({
+ position: "relative",
+ height: that.size.height,
+ width: that.size.width
+ });
+ }
+ },
+
+ stop: function() {
+ var that = $(this).resizable( "instance" );
+ if (that.ghost && that.helper) {
+ that.helper.get(0).removeChild(that.ghost.get(0));
+ }
+ }
+
+});
+
+$.ui.plugin.add("resizable", "grid", {
+
+ resize: function() {
+ var outerDimensions,
+ that = $(this).resizable( "instance" ),
+ o = that.options,
+ cs = that.size,
+ os = that.originalSize,
+ op = that.originalPosition,
+ a = that.axis,
+ grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
+ gridX = (grid[0] || 1),
+ gridY = (grid[1] || 1),
+ ox = Math.round((cs.width - os.width) / gridX) * gridX,
+ oy = Math.round((cs.height - os.height) / gridY) * gridY,
+ newWidth = os.width + ox,
+ newHeight = os.height + oy,
+ isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
+ isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
+ isMinWidth = o.minWidth && (o.minWidth > newWidth),
+ isMinHeight = o.minHeight && (o.minHeight > newHeight);
+
+ o.grid = grid;
+
+ if (isMinWidth) {
+ newWidth += gridX;
+ }
+ if (isMinHeight) {
+ newHeight += gridY;
+ }
+ if (isMaxWidth) {
+ newWidth -= gridX;
+ }
+ if (isMaxHeight) {
+ newHeight -= gridY;
+ }
+
+ if (/^(se|s|e)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ } else if (/^(ne)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ that.position.top = op.top - oy;
+ } else if (/^(sw)$/.test(a)) {
+ that.size.width = newWidth;
+ that.size.height = newHeight;
+ that.position.left = op.left - ox;
+ } else {
+ if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
+ outerDimensions = that._getPaddingPlusBorderDimensions( this );
+ }
+
+ if ( newHeight - gridY > 0 ) {
+ that.size.height = newHeight;
+ that.position.top = op.top - oy;
+ } else {
+ newHeight = gridY - outerDimensions.height;
+ that.size.height = newHeight;
+ that.position.top = op.top + os.height - newHeight;
+ }
+ if ( newWidth - gridX > 0 ) {
+ that.size.width = newWidth;
+ that.position.left = op.left - ox;
+ } else {
+ newWidth = gridX - outerDimensions.width;
+ that.size.width = newWidth;
+ that.position.left = op.left + os.width - newWidth;
+ }
+ }
+ }
+
+});
+
+var resizable = $.ui.resizable;
+
+
+/*!
+ * jQuery UI Dialog 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/dialog/
+ */
+
+
+var dialog = $.widget( "ui.dialog", {
+ version: "1.11.4",
+ options: {
+ appendTo: "body",
+ autoOpen: true,
+ buttons: [],
+ closeOnEscape: true,
+ closeText: "Close",
+ dialogClass: "",
+ draggable: true,
+ hide: null,
+ height: "auto",
+ maxHeight: null,
+ maxWidth: null,
+ minHeight: 150,
+ minWidth: 150,
+ modal: false,
+ position: {
+ my: "center",
+ at: "center",
+ of: window,
+ collision: "fit",
+ // Ensure the titlebar is always visible
+ using: function( pos ) {
+ var topOffset = $( this ).css( pos ).offset().top;
+ if ( topOffset < 0 ) {
+ $( this ).css( "top", pos.top - topOffset );
+ }
+ }
+ },
+ resizable: true,
+ show: null,
+ title: null,
+ width: 300,
+
+ // callbacks
+ beforeClose: null,
+ close: null,
+ drag: null,
+ dragStart: null,
+ dragStop: null,
+ focus: null,
+ open: null,
+ resize: null,
+ resizeStart: null,
+ resizeStop: null
+ },
+
+ sizeRelatedOptions: {
+ buttons: true,
+ height: true,
+ maxHeight: true,
+ maxWidth: true,
+ minHeight: true,
+ minWidth: true,
+ width: true
+ },
+
+ resizableRelatedOptions: {
+ maxHeight: true,
+ maxWidth: true,
+ minHeight: true,
+ minWidth: true
+ },
+
+ _create: function() {
+ this.originalCss = {
+ display: this.element[ 0 ].style.display,
+ width: this.element[ 0 ].style.width,
+ minHeight: this.element[ 0 ].style.minHeight,
+ maxHeight: this.element[ 0 ].style.maxHeight,
+ height: this.element[ 0 ].style.height
+ };
+ this.originalPosition = {
+ parent: this.element.parent(),
+ index: this.element.parent().children().index( this.element )
+ };
+ this.originalTitle = this.element.attr( "title" );
+ this.options.title = this.options.title || this.originalTitle;
+
+ this._createWrapper();
+
+ this.element
+ .show()
+ .removeAttr( "title" )
+ .addClass( "ui-dialog-content ui-widget-content" )
+ .appendTo( this.uiDialog );
+
+ this._createTitlebar();
+ this._createButtonPane();
+
+ if ( this.options.draggable && $.fn.draggable ) {
+ this._makeDraggable();
+ }
+ if ( this.options.resizable && $.fn.resizable ) {
+ this._makeResizable();
+ }
+
+ this._isOpen = false;
+
+ this._trackFocus();
+ },
+
+ _init: function() {
+ if ( this.options.autoOpen ) {
+ this.open();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+ if ( element && (element.jquery || element.nodeType) ) {
+ return $( element );
+ }
+ return this.document.find( element || "body" ).eq( 0 );
+ },
+
+ _destroy: function() {
+ var next,
+ originalPosition = this.originalPosition;
+
+ this._untrackInstance();
+ this._destroyOverlay();
+
+ this.element
+ .removeUniqueId()
+ .removeClass( "ui-dialog-content ui-widget-content" )
+ .css( this.originalCss )
+ // Without detaching first, the following becomes really slow
+ .detach();
+
+ this.uiDialog.stop( true, true ).remove();
+
+ if ( this.originalTitle ) {
+ this.element.attr( "title", this.originalTitle );
+ }
+
+ next = originalPosition.parent.children().eq( originalPosition.index );
+ // Don't try to place the dialog next to itself (#8613)
+ if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
+ next.before( this.element );
+ } else {
+ originalPosition.parent.append( this.element );
+ }
+ },
+
+ widget: function() {
+ return this.uiDialog;
+ },
+
+ disable: $.noop,
+ enable: $.noop,
+
+ close: function( event ) {
+ var activeElement,
+ that = this;
+
+ if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
+ return;
+ }
+
+ this._isOpen = false;
+ this._focusedElement = null;
+ this._destroyOverlay();
+ this._untrackInstance();
+
+ if ( !this.opener.filter( ":focusable" ).focus().length ) {
+
+ // support: IE9
+ // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
+ try {
+ activeElement = this.document[ 0 ].activeElement;
+
+ // Support: IE9, IE10
+ // If the <body> is blurred, IE will switch windows, see #4520
+ if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
+
+ // Hiding a focused element doesn't trigger blur in WebKit
+ // so in case we have nothing to focus on, explicitly blur the active element
+ // https://bugs.webkit.org/show_bug.cgi?id=47182
+ $( activeElement ).blur();
+ }
+ } catch ( error ) {}
+ }
+
+ this._hide( this.uiDialog, this.options.hide, function() {
+ that._trigger( "close", event );
+ });
+ },
+
+ isOpen: function() {
+ return this._isOpen;
+ },
+
+ moveToTop: function() {
+ this._moveToTop();
+ },
+
+ _moveToTop: function( event, silent ) {
+ var moved = false,
+ zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
+ return +$( this ).css( "z-index" );
+ }).get(),
+ zIndexMax = Math.max.apply( null, zIndices );
+
+ if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
+ this.uiDialog.css( "z-index", zIndexMax + 1 );
+ moved = true;
+ }
+
+ if ( moved && !silent ) {
+ this._trigger( "focus", event );
+ }
+ return moved;
+ },
+
+ open: function() {
+ var that = this;
+ if ( this._isOpen ) {
+ if ( this._moveToTop() ) {
+ this._focusTabbable();
+ }
+ return;
+ }
+
+ this._isOpen = true;
+ this.opener = $( this.document[ 0 ].activeElement );
+
+ this._size();
+ this._position();
+ this._createOverlay();
+ this._moveToTop( null, true );
+
+ // Ensure the overlay is moved to the top with the dialog, but only when
+ // opening. The overlay shouldn't move after the dialog is open so that
+ // modeless dialogs opened after the modal dialog stack properly.
+ if ( this.overlay ) {
+ this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
+ }
+
+ this._show( this.uiDialog, this.options.show, function() {
+ that._focusTabbable();
+ that._trigger( "focus" );
+ });
+
+ // Track the dialog immediately upon openening in case a focus event
+ // somehow occurs outside of the dialog before an element inside the
+ // dialog is focused (#10152)
+ this._makeFocusTarget();
+
+ this._trigger( "open" );
+ },
+
+ _focusTabbable: function() {
+ // Set focus to the first match:
+ // 1. An element that was focused previously
+ // 2. First element inside the dialog matching [autofocus]
+ // 3. Tabbable element inside the content element
+ // 4. Tabbable element inside the buttonpane
+ // 5. The close button
+ // 6. The dialog itself
+ var hasFocus = this._focusedElement;
+ if ( !hasFocus ) {
+ hasFocus = this.element.find( "[autofocus]" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.element.find( ":tabbable" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
+ }
+ if ( !hasFocus.length ) {
+ hasFocus = this.uiDialog;
+ }
+ hasFocus.eq( 0 ).focus();
+ },
+
+ _keepFocus: function( event ) {
+ function checkFocus() {
+ var activeElement = this.document[0].activeElement,
+ isActive = this.uiDialog[0] === activeElement ||
+ $.contains( this.uiDialog[0], activeElement );
+ if ( !isActive ) {
+ this._focusTabbable();
+ }
+ }
+ event.preventDefault();
+ checkFocus.call( this );
+ // support: IE
+ // IE <= 8 doesn't prevent moving focus even with event.preventDefault()
+ // so we check again later
+ this._delay( checkFocus );
+ },
+
+ _createWrapper: function() {
+ this.uiDialog = $("<div>")
+ .addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
+ this.options.dialogClass )
+ .hide()
+ .attr({
+ // Setting tabIndex makes the div focusable
+ tabIndex: -1,
+ role: "dialog"
+ })
+ .appendTo( this._appendTo() );
+
+ this._on( this.uiDialog, {
+ keydown: function( event ) {
+ if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
+ event.keyCode === $.ui.keyCode.ESCAPE ) {
+ event.preventDefault();
+ this.close( event );
+ return;
+ }
+
+ // prevent tabbing out of dialogs
+ if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
+ return;
+ }
+ var tabbables = this.uiDialog.find( ":tabbable" ),
+ first = tabbables.filter( ":first" ),
+ last = tabbables.filter( ":last" );
+
+ if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
+ this._delay(function() {
+ first.focus();
+ });
+ event.preventDefault();
+ } else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
+ this._delay(function() {
+ last.focus();
+ });
+ event.preventDefault();
+ }
+ },
+ mousedown: function( event ) {
+ if ( this._moveToTop( event ) ) {
+ this._focusTabbable();
+ }
+ }
+ });
+
+ // We assume that any existing aria-describedby attribute means
+ // that the dialog content is marked up properly
+ // otherwise we brute force the content as the description
+ if ( !this.element.find( "[aria-describedby]" ).length ) {
+ this.uiDialog.attr({
+ "aria-describedby": this.element.uniqueId().attr( "id" )
+ });
+ }
+ },
+
+ _createTitlebar: function() {
+ var uiDialogTitle;
+
+ this.uiDialogTitlebar = $( "<div>" )
+ .addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
+ .prependTo( this.uiDialog );
+ this._on( this.uiDialogTitlebar, {
+ mousedown: function( event ) {
+ // Don't prevent click on close button (#8838)
+ // Focusing a dialog that is partially scrolled out of view
+ // causes the browser to scroll it into view, preventing the click event
+ if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
+ // Dialog isn't getting focus when dragging (#8063)
+ this.uiDialog.focus();
+ }
+ }
+ });
+
+ // support: IE
+ // Use type="button" to prevent enter keypresses in textboxes from closing the
+ // dialog in IE (#9312)
+ this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
+ .button({
+ label: this.options.closeText,
+ icons: {
+ primary: "ui-icon-closethick"
+ },
+ text: false
+ })
+ .addClass( "ui-dialog-titlebar-close" )
+ .appendTo( this.uiDialogTitlebar );
+ this._on( this.uiDialogTitlebarClose, {
+ click: function( event ) {
+ event.preventDefault();
+ this.close( event );
+ }
+ });
+
+ uiDialogTitle = $( "<span>" )
+ .uniqueId()
+ .addClass( "ui-dialog-title" )
+ .prependTo( this.uiDialogTitlebar );
+ this._title( uiDialogTitle );
+
+ this.uiDialog.attr({
+ "aria-labelledby": uiDialogTitle.attr( "id" )
+ });
+ },
+
+ _title: function( title ) {
+ if ( !this.options.title ) {
+ title.html( "&#160;" );
+ }
+ title.text( this.options.title );
+ },
+
+ _createButtonPane: function() {
+ this.uiDialogButtonPane = $( "<div>" )
+ .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
+
+ this.uiButtonSet = $( "<div>" )
+ .addClass( "ui-dialog-buttonset" )
+ .appendTo( this.uiDialogButtonPane );
+
+ this._createButtons();
+ },
+
+ _createButtons: function() {
+ var that = this,
+ buttons = this.options.buttons;
+
+ // if we already have a button pane, remove it
+ this.uiDialogButtonPane.remove();
+ this.uiButtonSet.empty();
+
+ if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
+ this.uiDialog.removeClass( "ui-dialog-buttons" );
+ return;
+ }
+
+ $.each( buttons, function( name, props ) {
+ var click, buttonOptions;
+ props = $.isFunction( props ) ?
+ { click: props, text: name } :
+ props;
+ // Default to a non-submitting button
+ props = $.extend( { type: "button" }, props );
+ // Change the context for the click callback to be the main element
+ click = props.click;
+ props.click = function() {
+ click.apply( that.element[ 0 ], arguments );
+ };
+ buttonOptions = {
+ icons: props.icons,
+ text: props.showText
+ };
+ delete props.icons;
+ delete props.showText;
+ $( "<button></button>", props )
+ .button( buttonOptions )
+ .appendTo( that.uiButtonSet );
+ });
+ this.uiDialog.addClass( "ui-dialog-buttons" );
+ this.uiDialogButtonPane.appendTo( this.uiDialog );
+ },
+
+ _makeDraggable: function() {
+ var that = this,
+ options = this.options;
+
+ function filteredUi( ui ) {
+ return {
+ position: ui.position,
+ offset: ui.offset
+ };
+ }
+
+ this.uiDialog.draggable({
+ cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
+ handle: ".ui-dialog-titlebar",
+ containment: "document",
+ start: function( event, ui ) {
+ $( this ).addClass( "ui-dialog-dragging" );
+ that._blockFrames();
+ that._trigger( "dragStart", event, filteredUi( ui ) );
+ },
+ drag: function( event, ui ) {
+ that._trigger( "drag", event, filteredUi( ui ) );
+ },
+ stop: function( event, ui ) {
+ var left = ui.offset.left - that.document.scrollLeft(),
+ top = ui.offset.top - that.document.scrollTop();
+
+ options.position = {
+ my: "left top",
+ at: "left" + (left >= 0 ? "+" : "") + left + " " +
+ "top" + (top >= 0 ? "+" : "") + top,
+ of: that.window
+ };
+ $( this ).removeClass( "ui-dialog-dragging" );
+ that._unblockFrames();
+ that._trigger( "dragStop", event, filteredUi( ui ) );
+ }
+ });
+ },
+
+ _makeResizable: function() {
+ var that = this,
+ options = this.options,
+ handles = options.resizable,
+ // .ui-resizable has position: relative defined in the stylesheet
+ // but dialogs have to use absolute or fixed positioning
+ position = this.uiDialog.css("position"),
+ resizeHandles = typeof handles === "string" ?
+ handles :
+ "n,e,s,w,se,sw,ne,nw";
+
+ function filteredUi( ui ) {
+ return {
+ originalPosition: ui.originalPosition,
+ originalSize: ui.originalSize,
+ position: ui.position,
+ size: ui.size
+ };
+ }
+
+ this.uiDialog.resizable({
+ cancel: ".ui-dialog-content",
+ containment: "document",
+ alsoResize: this.element,
+ maxWidth: options.maxWidth,
+ maxHeight: options.maxHeight,
+ minWidth: options.minWidth,
+ minHeight: this._minHeight(),
+ handles: resizeHandles,
+ start: function( event, ui ) {
+ $( this ).addClass( "ui-dialog-resizing" );
+ that._blockFrames();
+ that._trigger( "resizeStart", event, filteredUi( ui ) );
+ },
+ resize: function( event, ui ) {
+ that._trigger( "resize", event, filteredUi( ui ) );
+ },
+ stop: function( event, ui ) {
+ var offset = that.uiDialog.offset(),
+ left = offset.left - that.document.scrollLeft(),
+ top = offset.top - that.document.scrollTop();
+
+ options.height = that.uiDialog.height();
+ options.width = that.uiDialog.width();
+ options.position = {
+ my: "left top",
+ at: "left" + (left >= 0 ? "+" : "") + left + " " +
+ "top" + (top >= 0 ? "+" : "") + top,
+ of: that.window
+ };
+ $( this ).removeClass( "ui-dialog-resizing" );
+ that._unblockFrames();
+ that._trigger( "resizeStop", event, filteredUi( ui ) );
+ }
+ })
+ .css( "position", position );
+ },
+
+ _trackFocus: function() {
+ this._on( this.widget(), {
+ focusin: function( event ) {
+ this._makeFocusTarget();
+ this._focusedElement = $( event.target );
+ }
+ });
+ },
+
+ _makeFocusTarget: function() {
+ this._untrackInstance();
+ this._trackingInstances().unshift( this );
+ },
+
+ _untrackInstance: function() {
+ var instances = this._trackingInstances(),
+ exists = $.inArray( this, instances );
+ if ( exists !== -1 ) {
+ instances.splice( exists, 1 );
+ }
+ },
+
+ _trackingInstances: function() {
+ var instances = this.document.data( "ui-dialog-instances" );
+ if ( !instances ) {
+ instances = [];
+ this.document.data( "ui-dialog-instances", instances );
+ }
+ return instances;
+ },
+
+ _minHeight: function() {
+ var options = this.options;
+
+ return options.height === "auto" ?
+ options.minHeight :
+ Math.min( options.minHeight, options.height );
+ },
+
+ _position: function() {
+ // Need to show the dialog to get the actual offset in the position plugin
+ var isVisible = this.uiDialog.is( ":visible" );
+ if ( !isVisible ) {
+ this.uiDialog.show();
+ }
+ this.uiDialog.position( this.options.position );
+ if ( !isVisible ) {
+ this.uiDialog.hide();
+ }
+ },
+
+ _setOptions: function( options ) {
+ var that = this,
+ resize = false,
+ resizableOptions = {};
+
+ $.each( options, function( key, value ) {
+ that._setOption( key, value );
+
+ if ( key in that.sizeRelatedOptions ) {
+ resize = true;
+ }
+ if ( key in that.resizableRelatedOptions ) {
+ resizableOptions[ key ] = value;
+ }
+ });
+
+ if ( resize ) {
+ this._size();
+ this._position();
+ }
+ if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
+ this.uiDialog.resizable( "option", resizableOptions );
+ }
+ },
+
+ _setOption: function( key, value ) {
+ var isDraggable, isResizable,
+ uiDialog = this.uiDialog;
+
+ if ( key === "dialogClass" ) {
+ uiDialog
+ .removeClass( this.options.dialogClass )
+ .addClass( value );
+ }
+
+ if ( key === "disabled" ) {
+ return;
+ }
+
+ this._super( key, value );
+
+ if ( key === "appendTo" ) {
+ this.uiDialog.appendTo( this._appendTo() );
+ }
+
+ if ( key === "buttons" ) {
+ this._createButtons();
+ }
+
+ if ( key === "closeText" ) {
+ this.uiDialogTitlebarClose.button({
+ // Ensure that we always pass a string
+ label: "" + value
+ });
+ }
+
+ if ( key === "draggable" ) {
+ isDraggable = uiDialog.is( ":data(ui-draggable)" );
+ if ( isDraggable && !value ) {
+ uiDialog.draggable( "destroy" );
+ }
+
+ if ( !isDraggable && value ) {
+ this._makeDraggable();
+ }
+ }
+
+ if ( key === "position" ) {
+ this._position();
+ }
+
+ if ( key === "resizable" ) {
+ // currently resizable, becoming non-resizable
+ isResizable = uiDialog.is( ":data(ui-resizable)" );
+ if ( isResizable && !value ) {
+ uiDialog.resizable( "destroy" );
+ }
+
+ // currently resizable, changing handles
+ if ( isResizable && typeof value === "string" ) {
+ uiDialog.resizable( "option", "handles", value );
+ }
+
+ // currently non-resizable, becoming resizable
+ if ( !isResizable && value !== false ) {
+ this._makeResizable();
+ }
+ }
+
+ if ( key === "title" ) {
+ this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
+ }
+ },
+
+ _size: function() {
+ // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
+ // divs will both have width and height set, so we need to reset them
+ var nonContentHeight, minContentHeight, maxContentHeight,
+ options = this.options;
+
+ // Reset content sizing
+ this.element.show().css({
+ width: "auto",
+ minHeight: 0,
+ maxHeight: "none",
+ height: 0
+ });
+
+ if ( options.minWidth > options.width ) {
+ options.width = options.minWidth;
+ }
+
+ // reset wrapper sizing
+ // determine the height of all the non-content elements
+ nonContentHeight = this.uiDialog.css({
+ height: "auto",
+ width: options.width
+ })
+ .outerHeight();
+ minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
+ maxContentHeight = typeof options.maxHeight === "number" ?
+ Math.max( 0, options.maxHeight - nonContentHeight ) :
+ "none";
+
+ if ( options.height === "auto" ) {
+ this.element.css({
+ minHeight: minContentHeight,
+ maxHeight: maxContentHeight,
+ height: "auto"
+ });
+ } else {
+ this.element.height( Math.max( 0, options.height - nonContentHeight ) );
+ }
+
+ if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
+ this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
+ }
+ },
+
+ _blockFrames: function() {
+ this.iframeBlocks = this.document.find( "iframe" ).map(function() {
+ var iframe = $( this );
+
+ return $( "<div>" )
+ .css({
+ position: "absolute",
+ width: iframe.outerWidth(),
+ height: iframe.outerHeight()
+ })
+ .appendTo( iframe.parent() )
+ .offset( iframe.offset() )[0];
+ });
+ },
+
+ _unblockFrames: function() {
+ if ( this.iframeBlocks ) {
+ this.iframeBlocks.remove();
+ delete this.iframeBlocks;
+ }
+ },
+
+ _allowInteraction: function( event ) {
+ if ( $( event.target ).closest( ".ui-dialog" ).length ) {
+ return true;
+ }
+
+ // TODO: Remove hack when datepicker implements
+ // the .ui-front logic (#8989)
+ return !!$( event.target ).closest( ".ui-datepicker" ).length;
+ },
+
+ _createOverlay: function() {
+ if ( !this.options.modal ) {
+ return;
+ }
+
+ // We use a delay in case the overlay is created from an
+ // event that we're going to be cancelling (#2804)
+ var isOpening = true;
+ this._delay(function() {
+ isOpening = false;
+ });
+
+ if ( !this.document.data( "ui-dialog-overlays" ) ) {
+
+ // Prevent use of anchors and inputs
+ // Using _on() for an event handler shared across many instances is
+ // safe because the dialogs stack and must be closed in reverse order
+ this._on( this.document, {
+ focusin: function( event ) {
+ if ( isOpening ) {
+ return;
+ }
+
+ if ( !this._allowInteraction( event ) ) {
+ event.preventDefault();
+ this._trackingInstances()[ 0 ]._focusTabbable();
+ }
+ }
+ });
+ }
+
+ this.overlay = $( "<div>" )
+ .addClass( "ui-widget-overlay ui-front" )
+ .appendTo( this._appendTo() );
+ this._on( this.overlay, {
+ mousedown: "_keepFocus"
+ });
+ this.document.data( "ui-dialog-overlays",
+ (this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
+ },
+
+ _destroyOverlay: function() {
+ if ( !this.options.modal ) {
+ return;
+ }
+
+ if ( this.overlay ) {
+ var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
+
+ if ( !overlays ) {
+ this.document
+ .unbind( "focusin" )
+ .removeData( "ui-dialog-overlays" );
+ } else {
+ this.document.data( "ui-dialog-overlays", overlays );
+ }
+
+ this.overlay.remove();
+ this.overlay = null;
+ }
+ }
+});
+
+
+/*!
+ * jQuery UI Droppable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/droppable/
+ */
+
+
+$.widget( "ui.droppable", {
+ version: "1.11.4",
+ widgetEventPrefix: "drop",
+ options: {
+ accept: "*",
+ activeClass: false,
+ addClasses: true,
+ greedy: false,
+ hoverClass: false,
+ scope: "default",
+ tolerance: "intersect",
+
+ // callbacks
+ activate: null,
+ deactivate: null,
+ drop: null,
+ out: null,
+ over: null
+ },
+ _create: function() {
+
+ var proportions,
+ o = this.options,
+ accept = o.accept;
+
+ this.isover = false;
+ this.isout = true;
+
+ this.accept = $.isFunction( accept ) ? accept : function( d ) {
+ return d.is( accept );
+ };
+
+ this.proportions = function( /* valueToWrite */ ) {
+ if ( arguments.length ) {
+ // Store the droppable's proportions
+ proportions = arguments[ 0 ];
+ } else {
+ // Retrieve or derive the droppable's proportions
+ return proportions ?
+ proportions :
+ proportions = {
+ width: this.element[ 0 ].offsetWidth,
+ height: this.element[ 0 ].offsetHeight
+ };
+ }
+ };
+
+ this._addToManager( o.scope );
+
+ o.addClasses && this.element.addClass( "ui-droppable" );
+
+ },
+
+ _addToManager: function( scope ) {
+ // Add the reference and positions to the manager
+ $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
+ $.ui.ddmanager.droppables[ scope ].push( this );
+ },
+
+ _splice: function( drop ) {
+ var i = 0;
+ for ( ; i < drop.length; i++ ) {
+ if ( drop[ i ] === this ) {
+ drop.splice( i, 1 );
+ }
+ }
+ },
+
+ _destroy: function() {
+ var drop = $.ui.ddmanager.droppables[ this.options.scope ];
+
+ this._splice( drop );
+
+ this.element.removeClass( "ui-droppable ui-droppable-disabled" );
+ },
+
+ _setOption: function( key, value ) {
+
+ if ( key === "accept" ) {
+ this.accept = $.isFunction( value ) ? value : function( d ) {
+ return d.is( value );
+ };
+ } else if ( key === "scope" ) {
+ var drop = $.ui.ddmanager.droppables[ this.options.scope ];
+
+ this._splice( drop );
+ this._addToManager( value );
+ }
+
+ this._super( key, value );
+ },
+
+ _activate: function( event ) {
+ var draggable = $.ui.ddmanager.current;
+ if ( this.options.activeClass ) {
+ this.element.addClass( this.options.activeClass );
+ }
+ if ( draggable ){
+ this._trigger( "activate", event, this.ui( draggable ) );
+ }
+ },
+
+ _deactivate: function( event ) {
+ var draggable = $.ui.ddmanager.current;
+ if ( this.options.activeClass ) {
+ this.element.removeClass( this.options.activeClass );
+ }
+ if ( draggable ){
+ this._trigger( "deactivate", event, this.ui( draggable ) );
+ }
+ },
+
+ _over: function( event ) {
+
+ var draggable = $.ui.ddmanager.current;
+
+ // Bail if draggable and droppable are same element
+ if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+ return;
+ }
+
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ if ( this.options.hoverClass ) {
+ this.element.addClass( this.options.hoverClass );
+ }
+ this._trigger( "over", event, this.ui( draggable ) );
+ }
+
+ },
+
+ _out: function( event ) {
+
+ var draggable = $.ui.ddmanager.current;
+
+ // Bail if draggable and droppable are same element
+ if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+ return;
+ }
+
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ if ( this.options.hoverClass ) {
+ this.element.removeClass( this.options.hoverClass );
+ }
+ this._trigger( "out", event, this.ui( draggable ) );
+ }
+
+ },
+
+ _drop: function( event, custom ) {
+
+ var draggable = custom || $.ui.ddmanager.current,
+ childrenIntersection = false;
+
+ // Bail if draggable and droppable are same element
+ if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
+ return false;
+ }
+
+ this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
+ var inst = $( this ).droppable( "instance" );
+ if (
+ inst.options.greedy &&
+ !inst.options.disabled &&
+ inst.options.scope === draggable.options.scope &&
+ inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
+ $.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
+ ) { childrenIntersection = true; return false; }
+ });
+ if ( childrenIntersection ) {
+ return false;
+ }
+
+ if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ if ( this.options.activeClass ) {
+ this.element.removeClass( this.options.activeClass );
+ }
+ if ( this.options.hoverClass ) {
+ this.element.removeClass( this.options.hoverClass );
+ }
+ this._trigger( "drop", event, this.ui( draggable ) );
+ return this.element;
+ }
+
+ return false;
+
+ },
+
+ ui: function( c ) {
+ return {
+ draggable: ( c.currentItem || c.element ),
+ helper: c.helper,
+ position: c.position,
+ offset: c.positionAbs
+ };
+ }
+
+});
+
+$.ui.intersect = (function() {
+ function isOverAxis( x, reference, size ) {
+ return ( x >= reference ) && ( x < ( reference + size ) );
+ }
+
+ return function( draggable, droppable, toleranceMode, event ) {
+
+ if ( !droppable.offset ) {
+ return false;
+ }
+
+ var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
+ y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
+ x2 = x1 + draggable.helperProportions.width,
+ y2 = y1 + draggable.helperProportions.height,
+ l = droppable.offset.left,
+ t = droppable.offset.top,
+ r = l + droppable.proportions().width,
+ b = t + droppable.proportions().height;
+
+ switch ( toleranceMode ) {
+ case "fit":
+ return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
+ case "intersect":
+ return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
+ x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
+ t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
+ y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
+ case "pointer":
+ return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
+ case "touch":
+ return (
+ ( y1 >= t && y1 <= b ) || // Top edge touching
+ ( y2 >= t && y2 <= b ) || // Bottom edge touching
+ ( y1 < t && y2 > b ) // Surrounded vertically
+ ) && (
+ ( x1 >= l && x1 <= r ) || // Left edge touching
+ ( x2 >= l && x2 <= r ) || // Right edge touching
+ ( x1 < l && x2 > r ) // Surrounded horizontally
+ );
+ default:
+ return false;
+ }
+ };
+})();
+
+/*
+ This manager tracks offsets of draggables and droppables
+*/
+$.ui.ddmanager = {
+ current: null,
+ droppables: { "default": [] },
+ prepareOffsets: function( t, event ) {
+
+ var i, j,
+ m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
+ type = event ? event.type : null, // workaround for #2317
+ list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
+
+ droppablesLoop: for ( i = 0; i < m.length; i++ ) {
+
+ // No disabled and non-accepted
+ if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
+ continue;
+ }
+
+ // Filter out elements in the current dragged item
+ for ( j = 0; j < list.length; j++ ) {
+ if ( list[ j ] === m[ i ].element[ 0 ] ) {
+ m[ i ].proportions().height = 0;
+ continue droppablesLoop;
+ }
+ }
+
+ m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
+ if ( !m[ i ].visible ) {
+ continue;
+ }
+
+ // Activate the droppable if used directly from draggables
+ if ( type === "mousedown" ) {
+ m[ i ]._activate.call( m[ i ], event );
+ }
+
+ m[ i ].offset = m[ i ].element.offset();
+ m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
+
+ }
+
+ },
+ drop: function( draggable, event ) {
+
+ var dropped = false;
+ // Create a copy of the droppables in case the list changes during the drop (#9116)
+ $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
+
+ if ( !this.options ) {
+ return;
+ }
+ if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
+ dropped = this._drop.call( this, event ) || dropped;
+ }
+
+ if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
+ this.isout = true;
+ this.isover = false;
+ this._deactivate.call( this, event );
+ }
+
+ });
+ return dropped;
+
+ },
+ dragStart: function( draggable, event ) {
+ // Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
+ draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
+ if ( !draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+ });
+ },
+ drag: function( draggable, event ) {
+
+ // If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
+ if ( draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+
+ // Run through all droppables and check their positions based on specific tolerance options
+ $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
+
+ if ( this.options.disabled || this.greedyChild || !this.visible ) {
+ return;
+ }
+
+ var parentInstance, scope, parent,
+ intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
+ c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
+ if ( !c ) {
+ return;
+ }
+
+ if ( this.options.greedy ) {
+ // find droppable parents with same scope
+ scope = this.options.scope;
+ parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
+ return $( this ).droppable( "instance" ).options.scope === scope;
+ });
+
+ if ( parent.length ) {
+ parentInstance = $( parent[ 0 ] ).droppable( "instance" );
+ parentInstance.greedyChild = ( c === "isover" );
+ }
+ }
+
+ // we just moved into a greedy child
+ if ( parentInstance && c === "isover" ) {
+ parentInstance.isover = false;
+ parentInstance.isout = true;
+ parentInstance._out.call( parentInstance, event );
+ }
+
+ this[ c ] = true;
+ this[c === "isout" ? "isover" : "isout"] = false;
+ this[c === "isover" ? "_over" : "_out"].call( this, event );
+
+ // we just moved out of a greedy child
+ if ( parentInstance && c === "isout" ) {
+ parentInstance.isout = false;
+ parentInstance.isover = true;
+ parentInstance._over.call( parentInstance, event );
+ }
+ });
+
+ },
+ dragStop: function( draggable, event ) {
+ draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
+ // Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
+ if ( !draggable.options.refreshPositions ) {
+ $.ui.ddmanager.prepareOffsets( draggable, event );
+ }
+ }
+};
+
+var droppable = $.ui.droppable;
+
+
+/*!
+ * jQuery UI Effects 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/category/effects-core/
+ */
+
+
+var dataSpace = "ui-effects-",
+
+ // Create a local jQuery because jQuery Color relies on it and the
+ // global may not exist with AMD and a custom build (#10199)
+ jQuery = $;
+
+$.effects = {
+ effect: {}
+};
+
+/*!
+ * jQuery Color Animations v2.1.2
+ * https://github.com/jquery/jquery-color
+ *
+ * Copyright 2014 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * Date: Wed Jan 16 08:47:09 2013 -0600
+ */
+(function( jQuery, undefined ) {
+
+ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
+
+ // plusequals test for += 100 -= 100
+ rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
+ // a set of RE's that can match strings and generate color tuples.
+ stringParsers = [ {
+ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ],
+ execResult[ 2 ],
+ execResult[ 3 ],
+ execResult[ 4 ]
+ ];
+ }
+ }, {
+ re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ] * 2.55,
+ execResult[ 2 ] * 2.55,
+ execResult[ 3 ] * 2.55,
+ execResult[ 4 ]
+ ];
+ }
+ }, {
+ // this regex ignores A-F because it's compared against an already lowercased string
+ re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
+ parse: function( execResult ) {
+ return [
+ parseInt( execResult[ 1 ], 16 ),
+ parseInt( execResult[ 2 ], 16 ),
+ parseInt( execResult[ 3 ], 16 )
+ ];
+ }
+ }, {
+ // this regex ignores A-F because it's compared against an already lowercased string
+ re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
+ parse: function( execResult ) {
+ return [
+ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
+ parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
+ parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
+ ];
+ }
+ }, {
+ re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
+ space: "hsla",
+ parse: function( execResult ) {
+ return [
+ execResult[ 1 ],
+ execResult[ 2 ] / 100,
+ execResult[ 3 ] / 100,
+ execResult[ 4 ]
+ ];
+ }
+ } ],
+
+ // jQuery.Color( )
+ color = jQuery.Color = function( color, green, blue, alpha ) {
+ return new jQuery.Color.fn.parse( color, green, blue, alpha );
+ },
+ spaces = {
+ rgba: {
+ props: {
+ red: {
+ idx: 0,
+ type: "byte"
+ },
+ green: {
+ idx: 1,
+ type: "byte"
+ },
+ blue: {
+ idx: 2,
+ type: "byte"
+ }
+ }
+ },
+
+ hsla: {
+ props: {
+ hue: {
+ idx: 0,
+ type: "degrees"
+ },
+ saturation: {
+ idx: 1,
+ type: "percent"
+ },
+ lightness: {
+ idx: 2,
+ type: "percent"
+ }
+ }
+ }
+ },
+ propTypes = {
+ "byte": {
+ floor: true,
+ max: 255
+ },
+ "percent": {
+ max: 1
+ },
+ "degrees": {
+ mod: 360,
+ floor: true
+ }
+ },
+ support = color.support = {},
+
+ // element for support tests
+ supportElem = jQuery( "<p>" )[ 0 ],
+
+ // colors = jQuery.Color.names
+ colors,
+
+ // local aliases of functions called often
+ each = jQuery.each;
+
+// determine rgba support immediately
+supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
+support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
+
+// define cache name and alpha properties
+// for rgba and hsla spaces
+each( spaces, function( spaceName, space ) {
+ space.cache = "_" + spaceName;
+ space.props.alpha = {
+ idx: 3,
+ type: "percent",
+ def: 1
+ };
+});
+
+function clamp( value, prop, allowEmpty ) {
+ var type = propTypes[ prop.type ] || {};
+
+ if ( value == null ) {
+ return (allowEmpty || !prop.def) ? null : prop.def;
+ }
+
+ // ~~ is an short way of doing floor for positive numbers
+ value = type.floor ? ~~value : parseFloat( value );
+
+ // IE will pass in empty strings as value for alpha,
+ // which will hit this case
+ if ( isNaN( value ) ) {
+ return prop.def;
+ }
+
+ if ( type.mod ) {
+ // we add mod before modding to make sure that negatives values
+ // get converted properly: -10 -> 350
+ return (value + type.mod) % type.mod;
+ }
+
+ // for now all property types without mod have min and max
+ return 0 > value ? 0 : type.max < value ? type.max : value;
+}
+
+function stringParse( string ) {
+ var inst = color(),
+ rgba = inst._rgba = [];
+
+ string = string.toLowerCase();
+
+ each( stringParsers, function( i, parser ) {
+ var parsed,
+ match = parser.re.exec( string ),
+ values = match && parser.parse( match ),
+ spaceName = parser.space || "rgba";
+
+ if ( values ) {
+ parsed = inst[ spaceName ]( values );
+
+ // if this was an rgba parse the assignment might happen twice
+ // oh well....
+ inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
+ rgba = inst._rgba = parsed._rgba;
+
+ // exit each( stringParsers ) here because we matched
+ return false;
+ }
+ });
+
+ // Found a stringParser that handled it
+ if ( rgba.length ) {
+
+ // if this came from a parsed string, force "transparent" when alpha is 0
+ // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
+ if ( rgba.join() === "0,0,0,0" ) {
+ jQuery.extend( rgba, colors.transparent );
+ }
+ return inst;
+ }
+
+ // named colors
+ return colors[ string ];
+}
+
+color.fn = jQuery.extend( color.prototype, {
+ parse: function( red, green, blue, alpha ) {
+ if ( red === undefined ) {
+ this._rgba = [ null, null, null, null ];
+ return this;
+ }
+ if ( red.jquery || red.nodeType ) {
+ red = jQuery( red ).css( green );
+ green = undefined;
+ }
+
+ var inst = this,
+ type = jQuery.type( red ),
+ rgba = this._rgba = [];
+
+ // more than 1 argument specified - assume ( red, green, blue, alpha )
+ if ( green !== undefined ) {
+ red = [ red, green, blue, alpha ];
+ type = "array";
+ }
+
+ if ( type === "string" ) {
+ return this.parse( stringParse( red ) || colors._default );
+ }
+
+ if ( type === "array" ) {
+ each( spaces.rgba.props, function( key, prop ) {
+ rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
+ });
+ return this;
+ }
+
+ if ( type === "object" ) {
+ if ( red instanceof color ) {
+ each( spaces, function( spaceName, space ) {
+ if ( red[ space.cache ] ) {
+ inst[ space.cache ] = red[ space.cache ].slice();
+ }
+ });
+ } else {
+ each( spaces, function( spaceName, space ) {
+ var cache = space.cache;
+ each( space.props, function( key, prop ) {
+
+ // if the cache doesn't exist, and we know how to convert
+ if ( !inst[ cache ] && space.to ) {
+
+ // if the value was null, we don't need to copy it
+ // if the key was alpha, we don't need to copy it either
+ if ( key === "alpha" || red[ key ] == null ) {
+ return;
+ }
+ inst[ cache ] = space.to( inst._rgba );
+ }
+
+ // this is the only case where we allow nulls for ALL properties.
+ // call clamp with alwaysAllowEmpty
+ inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
+ });
+
+ // everything defined but alpha?
+ if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
+ // use the default of 1
+ inst[ cache ][ 3 ] = 1;
+ if ( space.from ) {
+ inst._rgba = space.from( inst[ cache ] );
+ }
+ }
+ });
+ }
+ return this;
+ }
+ },
+ is: function( compare ) {
+ var is = color( compare ),
+ same = true,
+ inst = this;
+
+ each( spaces, function( _, space ) {
+ var localCache,
+ isCache = is[ space.cache ];
+ if (isCache) {
+ localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
+ each( space.props, function( _, prop ) {
+ if ( isCache[ prop.idx ] != null ) {
+ same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
+ return same;
+ }
+ });
+ }
+ return same;
+ });
+ return same;
+ },
+ _space: function() {
+ var used = [],
+ inst = this;
+ each( spaces, function( spaceName, space ) {
+ if ( inst[ space.cache ] ) {
+ used.push( spaceName );
+ }
+ });
+ return used.pop();
+ },
+ transition: function( other, distance ) {
+ var end = color( other ),
+ spaceName = end._space(),
+ space = spaces[ spaceName ],
+ startColor = this.alpha() === 0 ? color( "transparent" ) : this,
+ start = startColor[ space.cache ] || space.to( startColor._rgba ),
+ result = start.slice();
+
+ end = end[ space.cache ];
+ each( space.props, function( key, prop ) {
+ var index = prop.idx,
+ startValue = start[ index ],
+ endValue = end[ index ],
+ type = propTypes[ prop.type ] || {};
+
+ // if null, don't override start value
+ if ( endValue === null ) {
+ return;
+ }
+ // if null - use end
+ if ( startValue === null ) {
+ result[ index ] = endValue;
+ } else {
+ if ( type.mod ) {
+ if ( endValue - startValue > type.mod / 2 ) {
+ startValue += type.mod;
+ } else if ( startValue - endValue > type.mod / 2 ) {
+ startValue -= type.mod;
+ }
+ }
+ result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
+ }
+ });
+ return this[ spaceName ]( result );
+ },
+ blend: function( opaque ) {
+ // if we are already opaque - return ourself
+ if ( this._rgba[ 3 ] === 1 ) {
+ return this;
+ }
+
+ var rgb = this._rgba.slice(),
+ a = rgb.pop(),
+ blend = color( opaque )._rgba;
+
+ return color( jQuery.map( rgb, function( v, i ) {
+ return ( 1 - a ) * blend[ i ] + a * v;
+ }));
+ },
+ toRgbaString: function() {
+ var prefix = "rgba(",
+ rgba = jQuery.map( this._rgba, function( v, i ) {
+ return v == null ? ( i > 2 ? 1 : 0 ) : v;
+ });
+
+ if ( rgba[ 3 ] === 1 ) {
+ rgba.pop();
+ prefix = "rgb(";
+ }
+
+ return prefix + rgba.join() + ")";
+ },
+ toHslaString: function() {
+ var prefix = "hsla(",
+ hsla = jQuery.map( this.hsla(), function( v, i ) {
+ if ( v == null ) {
+ v = i > 2 ? 1 : 0;
+ }
+
+ // catch 1 and 2
+ if ( i && i < 3 ) {
+ v = Math.round( v * 100 ) + "%";
+ }
+ return v;
+ });
+
+ if ( hsla[ 3 ] === 1 ) {
+ hsla.pop();
+ prefix = "hsl(";
+ }
+ return prefix + hsla.join() + ")";
+ },
+ toHexString: function( includeAlpha ) {
+ var rgba = this._rgba.slice(),
+ alpha = rgba.pop();
+
+ if ( includeAlpha ) {
+ rgba.push( ~~( alpha * 255 ) );
+ }
+
+ return "#" + jQuery.map( rgba, function( v ) {
+
+ // default to 0 when nulls exist
+ v = ( v || 0 ).toString( 16 );
+ return v.length === 1 ? "0" + v : v;
+ }).join("");
+ },
+ toString: function() {
+ return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
+ }
+});
+color.fn.parse.prototype = color.fn;
+
+// hsla conversions adapted from:
+// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
+
+function hue2rgb( p, q, h ) {
+ h = ( h + 1 ) % 1;
+ if ( h * 6 < 1 ) {
+ return p + ( q - p ) * h * 6;
+ }
+ if ( h * 2 < 1) {
+ return q;
+ }
+ if ( h * 3 < 2 ) {
+ return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
+ }
+ return p;
+}
+
+spaces.hsla.to = function( rgba ) {
+ if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
+ return [ null, null, null, rgba[ 3 ] ];
+ }
+ var r = rgba[ 0 ] / 255,
+ g = rgba[ 1 ] / 255,
+ b = rgba[ 2 ] / 255,
+ a = rgba[ 3 ],
+ max = Math.max( r, g, b ),
+ min = Math.min( r, g, b ),
+ diff = max - min,
+ add = max + min,
+ l = add * 0.5,
+ h, s;
+
+ if ( min === max ) {
+ h = 0;
+ } else if ( r === max ) {
+ h = ( 60 * ( g - b ) / diff ) + 360;
+ } else if ( g === max ) {
+ h = ( 60 * ( b - r ) / diff ) + 120;
+ } else {
+ h = ( 60 * ( r - g ) / diff ) + 240;
+ }
+
+ // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
+ // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
+ if ( diff === 0 ) {
+ s = 0;
+ } else if ( l <= 0.5 ) {
+ s = diff / add;
+ } else {
+ s = diff / ( 2 - add );
+ }
+ return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
+};
+
+spaces.hsla.from = function( hsla ) {
+ if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
+ return [ null, null, null, hsla[ 3 ] ];
+ }
+ var h = hsla[ 0 ] / 360,
+ s = hsla[ 1 ],
+ l = hsla[ 2 ],
+ a = hsla[ 3 ],
+ q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
+ p = 2 * l - q;
+
+ return [
+ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
+ Math.round( hue2rgb( p, q, h ) * 255 ),
+ Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
+ a
+ ];
+};
+
+each( spaces, function( spaceName, space ) {
+ var props = space.props,
+ cache = space.cache,
+ to = space.to,
+ from = space.from;
+
+ // makes rgba() and hsla()
+ color.fn[ spaceName ] = function( value ) {
+
+ // generate a cache for this space if it doesn't exist
+ if ( to && !this[ cache ] ) {
+ this[ cache ] = to( this._rgba );
+ }
+ if ( value === undefined ) {
+ return this[ cache ].slice();
+ }
+
+ var ret,
+ type = jQuery.type( value ),
+ arr = ( type === "array" || type === "object" ) ? value : arguments,
+ local = this[ cache ].slice();
+
+ each( props, function( key, prop ) {
+ var val = arr[ type === "object" ? key : prop.idx ];
+ if ( val == null ) {
+ val = local[ prop.idx ];
+ }
+ local[ prop.idx ] = clamp( val, prop );
+ });
+
+ if ( from ) {
+ ret = color( from( local ) );
+ ret[ cache ] = local;
+ return ret;
+ } else {
+ return color( local );
+ }
+ };
+
+ // makes red() green() blue() alpha() hue() saturation() lightness()
+ each( props, function( key, prop ) {
+ // alpha is included in more than one space
+ if ( color.fn[ key ] ) {
+ return;
+ }
+ color.fn[ key ] = function( value ) {
+ var vtype = jQuery.type( value ),
+ fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
+ local = this[ fn ](),
+ cur = local[ prop.idx ],
+ match;
+
+ if ( vtype === "undefined" ) {
+ return cur;
+ }
+
+ if ( vtype === "function" ) {
+ value = value.call( this, cur );
+ vtype = jQuery.type( value );
+ }
+ if ( value == null && prop.empty ) {
+ return this;
+ }
+ if ( vtype === "string" ) {
+ match = rplusequals.exec( value );
+ if ( match ) {
+ value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
+ }
+ }
+ local[ prop.idx ] = value;
+ return this[ fn ]( local );
+ };
+ });
+});
+
+// add cssHook and .fx.step function for each named hook.
+// accept a space separated string of properties
+color.hook = function( hook ) {
+ var hooks = hook.split( " " );
+ each( hooks, function( i, hook ) {
+ jQuery.cssHooks[ hook ] = {
+ set: function( elem, value ) {
+ var parsed, curElem,
+ backgroundColor = "";
+
+ if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
+ value = color( parsed || value );
+ if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
+ curElem = hook === "backgroundColor" ? elem.parentNode : elem;
+ while (
+ (backgroundColor === "" || backgroundColor === "transparent") &&
+ curElem && curElem.style
+ ) {
+ try {
+ backgroundColor = jQuery.css( curElem, "backgroundColor" );
+ curElem = curElem.parentNode;
+ } catch ( e ) {
+ }
+ }
+
+ value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
+ backgroundColor :
+ "_default" );
+ }
+
+ value = value.toRgbaString();
+ }
+ try {
+ elem.style[ hook ] = value;
+ } catch ( e ) {
+ // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
+ }
+ }
+ };
+ jQuery.fx.step[ hook ] = function( fx ) {
+ if ( !fx.colorInit ) {
+ fx.start = color( fx.elem, hook );
+ fx.end = color( fx.end );
+ fx.colorInit = true;
+ }
+ jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
+ };
+ });
+
+};
+
+color.hook( stepHooks );
+
+jQuery.cssHooks.borderColor = {
+ expand: function( value ) {
+ var expanded = {};
+
+ each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
+ expanded[ "border" + part + "Color" ] = value;
+ });
+ return expanded;
+ }
+};
+
+// Basic color names only.
+// Usage of any of the other color names requires adding yourself or including
+// jquery.color.svg-names.js.
+colors = jQuery.Color.names = {
+ // 4.1. Basic color keywords
+ aqua: "#00ffff",
+ black: "#000000",
+ blue: "#0000ff",
+ fuchsia: "#ff00ff",
+ gray: "#808080",
+ green: "#008000",
+ lime: "#00ff00",
+ maroon: "#800000",
+ navy: "#000080",
+ olive: "#808000",
+ purple: "#800080",
+ red: "#ff0000",
+ silver: "#c0c0c0",
+ teal: "#008080",
+ white: "#ffffff",
+ yellow: "#ffff00",
+
+ // 4.2.3. "transparent" color keyword
+ transparent: [ null, null, null, 0 ],
+
+ _default: "#ffffff"
+};
+
+})( jQuery );
+
+/******************************************************************************/
+/****************************** CLASS ANIMATIONS ******************************/
+/******************************************************************************/
+(function() {
+
+var classAnimationActions = [ "add", "remove", "toggle" ],
+ shorthandStyles = {
+ border: 1,
+ borderBottom: 1,
+ borderColor: 1,
+ borderLeft: 1,
+ borderRight: 1,
+ borderTop: 1,
+ borderWidth: 1,
+ margin: 1,
+ padding: 1
+ };
+
+$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
+ $.fx.step[ prop ] = function( fx ) {
+ if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
+ jQuery.style( fx.elem, prop, fx.end );
+ fx.setAttr = true;
+ }
+ };
+});
+
+function getElementStyles( elem ) {
+ var key, len,
+ style = elem.ownerDocument.defaultView ?
+ elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
+ elem.currentStyle,
+ styles = {};
+
+ if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
+ len = style.length;
+ while ( len-- ) {
+ key = style[ len ];
+ if ( typeof style[ key ] === "string" ) {
+ styles[ $.camelCase( key ) ] = style[ key ];
+ }
+ }
+ // support: Opera, IE <9
+ } else {
+ for ( key in style ) {
+ if ( typeof style[ key ] === "string" ) {
+ styles[ key ] = style[ key ];
+ }
+ }
+ }
+
+ return styles;
+}
+
+function styleDifference( oldStyle, newStyle ) {
+ var diff = {},
+ name, value;
+
+ for ( name in newStyle ) {
+ value = newStyle[ name ];
+ if ( oldStyle[ name ] !== value ) {
+ if ( !shorthandStyles[ name ] ) {
+ if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
+ diff[ name ] = value;
+ }
+ }
+ }
+ }
+
+ return diff;
+}
+
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
+$.effects.animateClass = function( value, duration, easing, callback ) {
+ var o = $.speed( duration, easing, callback );
+
+ return this.queue( function() {
+ var animated = $( this ),
+ baseClass = animated.attr( "class" ) || "",
+ applyClassChange,
+ allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
+
+ // map the animated objects to store the original styles.
+ allAnimations = allAnimations.map(function() {
+ var el = $( this );
+ return {
+ el: el,
+ start: getElementStyles( this )
+ };
+ });
+
+ // apply class change
+ applyClassChange = function() {
+ $.each( classAnimationActions, function(i, action) {
+ if ( value[ action ] ) {
+ animated[ action + "Class" ]( value[ action ] );
+ }
+ });
+ };
+ applyClassChange();
+
+ // map all animated objects again - calculate new styles and diff
+ allAnimations = allAnimations.map(function() {
+ this.end = getElementStyles( this.el[ 0 ] );
+ this.diff = styleDifference( this.start, this.end );
+ return this;
+ });
+
+ // apply original class
+ animated.attr( "class", baseClass );
+
+ // map all animated objects again - this time collecting a promise
+ allAnimations = allAnimations.map(function() {
+ var styleInfo = this,
+ dfd = $.Deferred(),
+ opts = $.extend({}, o, {
+ queue: false,
+ complete: function() {
+ dfd.resolve( styleInfo );
+ }
+ });
+
+ this.el.animate( this.diff, opts );
+ return dfd.promise();
+ });
+
+ // once all animations have completed:
+ $.when.apply( $, allAnimations.get() ).done(function() {
+
+ // set the final class
+ applyClassChange();
+
+ // for each animated element,
+ // clear all css properties that were animated
+ $.each( arguments, function() {
+ var el = this.el;
+ $.each( this.diff, function(key) {
+ el.css( key, "" );
+ });
+ });
+
+ // this is guarnteed to be there if you use jQuery.speed()
+ // it also handles dequeuing the next anim...
+ o.complete.call( animated[ 0 ] );
+ });
+ });
+};
+
+$.fn.extend({
+ addClass: (function( orig ) {
+ return function( classNames, speed, easing, callback ) {
+ return speed ?
+ $.effects.animateClass.call( this,
+ { add: classNames }, speed, easing, callback ) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.addClass ),
+
+ removeClass: (function( orig ) {
+ return function( classNames, speed, easing, callback ) {
+ return arguments.length > 1 ?
+ $.effects.animateClass.call( this,
+ { remove: classNames }, speed, easing, callback ) :
+ orig.apply( this, arguments );
+ };
+ })( $.fn.removeClass ),
+
+ toggleClass: (function( orig ) {
+ return function( classNames, force, speed, easing, callback ) {
+ if ( typeof force === "boolean" || force === undefined ) {
+ if ( !speed ) {
+ // without speed parameter
+ return orig.apply( this, arguments );
+ } else {
+ return $.effects.animateClass.call( this,
+ (force ? { add: classNames } : { remove: classNames }),
+ speed, easing, callback );
+ }
+ } else {
+ // without force parameter
+ return $.effects.animateClass.call( this,
+ { toggle: classNames }, force, speed, easing );
+ }
+ };
+ })( $.fn.toggleClass ),
+
+ switchClass: function( remove, add, speed, easing, callback) {
+ return $.effects.animateClass.call( this, {
+ add: add,
+ remove: remove
+ }, speed, easing, callback );
+ }
+});
+
+})();
+
+/******************************************************************************/
+/*********************************** EFFECTS **********************************/
+/******************************************************************************/
+
+(function() {
+
+$.extend( $.effects, {
+ version: "1.11.4",
+
+ // Saves a set of properties in a data storage
+ save: function( element, set ) {
+ for ( var i = 0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
+ }
+ }
+ },
+
+ // Restores a set of previously saved properties from a data storage
+ restore: function( element, set ) {
+ var val, i;
+ for ( i = 0; i < set.length; i++ ) {
+ if ( set[ i ] !== null ) {
+ val = element.data( dataSpace + set[ i ] );
+ // support: jQuery 1.6.2
+ // http://bugs.jquery.com/ticket/9917
+ // jQuery 1.6.2 incorrectly returns undefined for any falsy value.
+ // We can't differentiate between "" and 0 here, so we just assume
+ // empty string since it's likely to be a more common value...
+ if ( val === undefined ) {
+ val = "";
+ }
+ element.css( set[ i ], val );
+ }
+ }
+ },
+
+ setMode: function( el, mode ) {
+ if (mode === "toggle") {
+ mode = el.is( ":hidden" ) ? "show" : "hide";
+ }
+ return mode;
+ },
+
+ // Translates a [top,left] array into a baseline value
+ // this should be a little more flexible in the future to handle a string & hash
+ getBaseline: function( origin, original ) {
+ var y, x;
+ switch ( origin[ 0 ] ) {
+ case "top": y = 0; break;
+ case "middle": y = 0.5; break;
+ case "bottom": y = 1; break;
+ default: y = origin[ 0 ] / original.height;
+ }
+ switch ( origin[ 1 ] ) {
+ case "left": x = 0; break;
+ case "center": x = 0.5; break;
+ case "right": x = 1; break;
+ default: x = origin[ 1 ] / original.width;
+ }
+ return {
+ x: x,
+ y: y
+ };
+ },
+
+ // Wraps the element around a wrapper that copies position properties
+ createWrapper: function( element ) {
+
+ // if the element is already wrapped, return it
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
+ return element.parent();
+ }
+
+ // wrap the element
+ var props = {
+ width: element.outerWidth(true),
+ height: element.outerHeight(true),
+ "float": element.css( "float" )
+ },
+ wrapper = $( "<div></div>" )
+ .addClass( "ui-effects-wrapper" )
+ .css({
+ fontSize: "100%",
+ background: "transparent",
+ border: "none",
+ margin: 0,
+ padding: 0
+ }),
+ // Store the size in case width/height are defined in % - Fixes #5245
+ size = {
+ width: element.width(),
+ height: element.height()
+ },
+ active = document.activeElement;
+
+ // support: Firefox
+ // Firefox incorrectly exposes anonymous content
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=561664
+ try {
+ active.id;
+ } catch ( e ) {
+ active = document.body;
+ }
+
+ element.wrap( wrapper );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
+
+ // transfer positioning properties to the wrapper
+ if ( element.css( "position" ) === "static" ) {
+ wrapper.css({ position: "relative" });
+ element.css({ position: "relative" });
+ } else {
+ $.extend( props, {
+ position: element.css( "position" ),
+ zIndex: element.css( "z-index" )
+ });
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
+ props[ pos ] = element.css( pos );
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
+ props[ pos ] = "auto";
+ }
+ });
+ element.css({
+ position: "relative",
+ top: 0,
+ left: 0,
+ right: "auto",
+ bottom: "auto"
+ });
+ }
+ element.css(size);
+
+ return wrapper.css( props ).show();
+ },
+
+ removeWrapper: function( element ) {
+ var active = document.activeElement;
+
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
+ element.parent().replaceWith( element );
+
+ // Fixes #7595 - Elements lose focus when wrapped.
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
+ $( active ).focus();
+ }
+ }
+
+ return element;
+ },
+
+ setTransition: function( element, list, factor, value ) {
+ value = value || {};
+ $.each( list, function( i, x ) {
+ var unit = element.cssUnit( x );
+ if ( unit[ 0 ] > 0 ) {
+ value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
+ }
+ });
+ return value;
+ }
+});
+
+// return an effect options object for the given parameters:
+function _normalizeArguments( effect, options, speed, callback ) {
+
+ // allow passing all options as the first parameter
+ if ( $.isPlainObject( effect ) ) {
+ options = effect;
+ effect = effect.effect;
+ }
+
+ // convert to an object
+ effect = { effect: effect };
+
+ // catch (effect, null, ...)
+ if ( options == null ) {
+ options = {};
+ }
+
+ // catch (effect, callback)
+ if ( $.isFunction( options ) ) {
+ callback = options;
+ speed = null;
+ options = {};
+ }
+
+ // catch (effect, speed, ?)
+ if ( typeof options === "number" || $.fx.speeds[ options ] ) {
+ callback = speed;
+ speed = options;
+ options = {};
+ }
+
+ // catch (effect, options, callback)
+ if ( $.isFunction( speed ) ) {
+ callback = speed;
+ speed = null;
+ }
+
+ // add options to effect
+ if ( options ) {
+ $.extend( effect, options );
+ }
+
+ speed = speed || options.duration;
+ effect.duration = $.fx.off ? 0 :
+ typeof speed === "number" ? speed :
+ speed in $.fx.speeds ? $.fx.speeds[ speed ] :
+ $.fx.speeds._default;
+
+ effect.complete = callback || options.complete;
+
+ return effect;
+}
+
+function standardAnimationOption( option ) {
+ // Valid standard speeds (nothing, number, named speed)
+ if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
+ return true;
+ }
+
+ // Invalid strings - treat as "normal" speed
+ if ( typeof option === "string" && !$.effects.effect[ option ] ) {
+ return true;
+ }
+
+ // Complete callback
+ if ( $.isFunction( option ) ) {
+ return true;
+ }
+
+ // Options hash (but not naming an effect)
+ if ( typeof option === "object" && !option.effect ) {
+ return true;
+ }
+
+ // Didn't match any standard API
+ return false;
+}
+
+$.fn.extend({
+ effect: function( /* effect, options, speed, callback */ ) {
+ var args = _normalizeArguments.apply( this, arguments ),
+ mode = args.mode,
+ queue = args.queue,
+ effectMethod = $.effects.effect[ args.effect ];
+
+ if ( $.fx.off || !effectMethod ) {
+ // delegate to the original method (e.g., .show()) if possible
+ if ( mode ) {
+ return this[ mode ]( args.duration, args.complete );
+ } else {
+ return this.each( function() {
+ if ( args.complete ) {
+ args.complete.call( this );
+ }
+ });
+ }
+ }
+
+ function run( next ) {
+ var elem = $( this ),
+ complete = args.complete,
+ mode = args.mode;
+
+ function done() {
+ if ( $.isFunction( complete ) ) {
+ complete.call( elem[0] );
+ }
+ if ( $.isFunction( next ) ) {
+ next();
+ }
+ }
+
+ // If the element already has the correct final state, delegate to
+ // the core methods so the internal tracking of "olddisplay" works.
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
+ elem[ mode ]();
+ done();
+ } else {
+ effectMethod.call( elem[0], args, done );
+ }
+ }
+
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
+ },
+
+ show: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "show";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.show ),
+
+ hide: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "hide";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.hide ),
+
+ toggle: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "toggle";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.toggle ),
+
+ // helper functions
+ cssUnit: function(key) {
+ var style = this.css( key ),
+ val = [];
+
+ $.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
+ if ( style.indexOf( unit ) > 0 ) {
+ val = [ parseFloat( style ), unit ];
+ }
+ });
+ return val;
+ }
+});
+
+})();
+
+/******************************************************************************/
+/*********************************** EASING ***********************************/
+/******************************************************************************/
+
+(function() {
+
+// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
+
+var baseEasings = {};
+
+$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
+ baseEasings[ name ] = function( p ) {
+ return Math.pow( p, i + 2 );
+ };
+});
+
+$.extend( baseEasings, {
+ Sine: function( p ) {
+ return 1 - Math.cos( p * Math.PI / 2 );
+ },
+ Circ: function( p ) {
+ return 1 - Math.sqrt( 1 - p * p );
+ },
+ Elastic: function( p ) {
+ return p === 0 || p === 1 ? p :
+ -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
+ },
+ Back: function( p ) {
+ return p * p * ( 3 * p - 2 );
+ },
+ Bounce: function( p ) {
+ var pow2,
+ bounce = 4;
+
+ while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
+ return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
+ }
+});
+
+$.each( baseEasings, function( name, easeIn ) {
+ $.easing[ "easeIn" + name ] = easeIn;
+ $.easing[ "easeOut" + name ] = function( p ) {
+ return 1 - easeIn( 1 - p );
+ };
+ $.easing[ "easeInOut" + name ] = function( p ) {
+ return p < 0.5 ?
+ easeIn( p * 2 ) / 2 :
+ 1 - easeIn( p * -2 + 2 ) / 2;
+ };
+});
+
+})();
+
+var effect = $.effects;
+
+
+/*!
+ * jQuery UI Effects Blind 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/blind-effect/
+ */
+
+
+var effectBlind = $.effects.effect.blind = function( o, done ) {
+ // Create element
+ var el = $( this ),
+ rvertical = /up|down|vertical/,
+ rpositivemotion = /up|left|vertical|horizontal/,
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ direction = o.direction || "up",
+ vertical = rvertical.test( direction ),
+ ref = vertical ? "height" : "width",
+ ref2 = vertical ? "top" : "left",
+ motion = rpositivemotion.test( direction ),
+ animation = {},
+ show = mode === "show",
+ wrapper, distance, margin;
+
+ // if already wrapped, the wrapper's properties are my property. #6245
+ if ( el.parent().is( ".ui-effects-wrapper" ) ) {
+ $.effects.save( el.parent(), props );
+ } else {
+ $.effects.save( el, props );
+ }
+ el.show();
+ wrapper = $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+
+ distance = wrapper[ ref ]();
+ margin = parseFloat( wrapper.css( ref2 ) ) || 0;
+
+ animation[ ref ] = show ? distance : 0;
+ if ( !motion ) {
+ el
+ .css( vertical ? "bottom" : "right", 0 )
+ .css( vertical ? "top" : "left", "auto" )
+ .css({ position: "absolute" });
+
+ animation[ ref2 ] = show ? margin : distance + margin;
+ }
+
+ // start at 0 if we are showing
+ if ( show ) {
+ wrapper.css( ref, 0 );
+ if ( !motion ) {
+ wrapper.css( ref2, margin + distance );
+ }
+ }
+
+ // Animate
+ wrapper.animate( animation, {
+ duration: o.duration,
+ easing: o.easing,
+ queue: false,
+ complete: function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+};
+
+
+/*!
+ * jQuery UI Effects Bounce 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/bounce-effect/
+ */
+
+
+var effectBounce = $.effects.effect.bounce = function( o, done ) {
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+
+ // defaults:
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ hide = mode === "hide",
+ show = mode === "show",
+ direction = o.direction || "up",
+ distance = o.distance,
+ times = o.times || 5,
+
+ // number of internal animations
+ anims = times * 2 + ( show || hide ? 1 : 0 ),
+ speed = o.duration / anims,
+ easing = o.easing,
+
+ // utility:
+ ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
+ motion = ( direction === "up" || direction === "left" ),
+ i,
+ upAnim,
+ downAnim,
+
+ // we will need to re-assemble the queue to stack our animations in place
+ queue = el.queue(),
+ queuelen = queue.length;
+
+ // Avoid touching opacity to prevent clearType and PNG issues in IE
+ if ( show || hide ) {
+ props.push( "opacity" );
+ }
+
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el ); // Create Wrapper
+
+ // default distance for the BIGGEST bounce is the outer Distance / 3
+ if ( !distance ) {
+ distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
+ }
+
+ if ( show ) {
+ downAnim = { opacity: 1 };
+ downAnim[ ref ] = 0;
+
+ // if we are showing, force opacity 0 and set the initial position
+ // then do the "first" animation
+ el.css( "opacity", 0 )
+ .css( ref, motion ? -distance * 2 : distance * 2 )
+ .animate( downAnim, speed, easing );
+ }
+
+ // start at the smallest distance if we are hiding
+ if ( hide ) {
+ distance = distance / Math.pow( 2, times - 1 );
+ }
+
+ downAnim = {};
+ downAnim[ ref ] = 0;
+ // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
+ for ( i = 0; i < times; i++ ) {
+ upAnim = {};
+ upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
+
+ el.animate( upAnim, speed, easing )
+ .animate( downAnim, speed, easing );
+
+ distance = hide ? distance * 2 : distance / 2;
+ }
+
+ // Last Bounce when Hiding
+ if ( hide ) {
+ upAnim = { opacity: 0 };
+ upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
+
+ el.animate( upAnim, speed, easing );
+ }
+
+ el.queue(function() {
+ if ( hide ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ });
+
+ // inject all the animations we just queued to be first in line (after "inprogress")
+ if ( queuelen > 1) {
+ queue.splice.apply( queue,
+ [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+ }
+ el.dequeue();
+
+};
+
+
+/*!
+ * jQuery UI Effects Clip 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/clip-effect/
+ */
+
+
+var effectClip = $.effects.effect.clip = function( o, done ) {
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+ direction = o.direction || "vertical",
+ vert = direction === "vertical",
+ size = vert ? "height" : "width",
+ position = vert ? "top" : "left",
+ animation = {},
+ wrapper, animate, distance;
+
+ // Save & Show
+ $.effects.save( el, props );
+ el.show();
+
+ // Create Wrapper
+ wrapper = $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+ animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
+ distance = animate[ size ]();
+
+ // Shift
+ if ( show ) {
+ animate.css( size, 0 );
+ animate.css( position, distance / 2 );
+ }
+
+ // Create Animation Object:
+ animation[ size ] = show ? distance : 0;
+ animation[ position ] = show ? 0 : distance / 2;
+
+ // Animate
+ animate.animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( !show ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+
+};
+
+
+/*!
+ * jQuery UI Effects Drop 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/drop-effect/
+ */
+
+
+var effectDrop = $.effects.effect.drop = function( o, done ) {
+
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+ direction = o.direction || "left",
+ ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
+ motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
+ animation = {
+ opacity: show ? 1 : 0
+ },
+ distance;
+
+ // Adjust
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el );
+
+ distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
+
+ if ( show ) {
+ el
+ .css( "opacity", 0 )
+ .css( ref, motion === "pos" ? -distance : distance );
+ }
+
+ // Animation
+ animation[ ref ] = ( show ?
+ ( motion === "pos" ? "+=" : "-=" ) :
+ ( motion === "pos" ? "-=" : "+=" ) ) +
+ distance;
+
+ // Animate
+ el.animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+};
+
+
+/*!
+ * jQuery UI Effects Explode 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/explode-effect/
+ */
+
+
+var effectExplode = $.effects.effect.explode = function( o, done ) {
+
+ var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
+ cells = rows,
+ el = $( this ),
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+
+ // show and then visibility:hidden the element before calculating offset
+ offset = el.show().css( "visibility", "hidden" ).offset(),
+
+ // width and height of a piece
+ width = Math.ceil( el.outerWidth() / cells ),
+ height = Math.ceil( el.outerHeight() / rows ),
+ pieces = [],
+
+ // loop
+ i, j, left, top, mx, my;
+
+ // children animate complete:
+ function childComplete() {
+ pieces.push( this );
+ if ( pieces.length === rows * cells ) {
+ animComplete();
+ }
+ }
+
+ // clone the element for each row and cell.
+ for ( i = 0; i < rows ; i++ ) { // ===>
+ top = offset.top + i * height;
+ my = i - ( rows - 1 ) / 2 ;
+
+ for ( j = 0; j < cells ; j++ ) { // |||
+ left = offset.left + j * width;
+ mx = j - ( cells - 1 ) / 2 ;
+
+ // Create a clone of the now hidden main element that will be absolute positioned
+ // within a wrapper div off the -left and -top equal to size of our pieces
+ el
+ .clone()
+ .appendTo( "body" )
+ .wrap( "<div></div>" )
+ .css({
+ position: "absolute",
+ visibility: "visible",
+ left: -j * width,
+ top: -i * height
+ })
+
+ // select the wrapper - make it overflow: hidden and absolute positioned based on
+ // where the original was located +left and +top equal to the size of pieces
+ .parent()
+ .addClass( "ui-effects-explode" )
+ .css({
+ position: "absolute",
+ overflow: "hidden",
+ width: width,
+ height: height,
+ left: left + ( show ? mx * width : 0 ),
+ top: top + ( show ? my * height : 0 ),
+ opacity: show ? 0 : 1
+ }).animate({
+ left: left + ( show ? 0 : mx * width ),
+ top: top + ( show ? 0 : my * height ),
+ opacity: show ? 1 : 0
+ }, o.duration || 500, o.easing, childComplete );
+ }
+ }
+
+ function animComplete() {
+ el.css({
+ visibility: "visible"
+ });
+ $( pieces ).remove();
+ if ( !show ) {
+ el.hide();
+ }
+ done();
+ }
+};
+
+
+/*!
+ * jQuery UI Effects Fade 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/fade-effect/
+ */
+
+
+var effectFade = $.effects.effect.fade = function( o, done ) {
+ var el = $( this ),
+ mode = $.effects.setMode( el, o.mode || "toggle" );
+
+ el.animate({
+ opacity: mode
+ }, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: done
+ });
+};
+
+
+/*!
+ * jQuery UI Effects Fold 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/fold-effect/
+ */
+
+
+var effectFold = $.effects.effect.fold = function( o, done ) {
+
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "hide" ),
+ show = mode === "show",
+ hide = mode === "hide",
+ size = o.size || 15,
+ percent = /([0-9]+)%/.exec( size ),
+ horizFirst = !!o.horizFirst,
+ widthFirst = show !== horizFirst,
+ ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
+ duration = o.duration / 2,
+ wrapper, distance,
+ animation1 = {},
+ animation2 = {};
+
+ $.effects.save( el, props );
+ el.show();
+
+ // Create Wrapper
+ wrapper = $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+ distance = widthFirst ?
+ [ wrapper.width(), wrapper.height() ] :
+ [ wrapper.height(), wrapper.width() ];
+
+ if ( percent ) {
+ size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
+ }
+ if ( show ) {
+ wrapper.css( horizFirst ? {
+ height: 0,
+ width: size
+ } : {
+ height: size,
+ width: 0
+ });
+ }
+
+ // Animation
+ animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
+ animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
+
+ // Animate
+ wrapper
+ .animate( animation1, duration, o.easing )
+ .animate( animation2, duration, o.easing, function() {
+ if ( hide ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ });
+
+};
+
+
+/*!
+ * jQuery UI Effects Highlight 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/highlight-effect/
+ */
+
+
+var effectHighlight = $.effects.effect.highlight = function( o, done ) {
+ var elem = $( this ),
+ props = [ "backgroundImage", "backgroundColor", "opacity" ],
+ mode = $.effects.setMode( elem, o.mode || "show" ),
+ animation = {
+ backgroundColor: elem.css( "backgroundColor" )
+ };
+
+ if (mode === "hide") {
+ animation.opacity = 0;
+ }
+
+ $.effects.save( elem, props );
+
+ elem
+ .show()
+ .css({
+ backgroundImage: "none",
+ backgroundColor: o.color || "#ffff99"
+ })
+ .animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( mode === "hide" ) {
+ elem.hide();
+ }
+ $.effects.restore( elem, props );
+ done();
+ }
+ });
+};
+
+
+/*!
+ * jQuery UI Effects Size 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/size-effect/
+ */
+
+
+var effectSize = $.effects.effect.size = function( o, done ) {
+
+ // Create element
+ var original, baseline, factor,
+ el = $( this ),
+ props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
+
+ // Always restore
+ props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
+
+ // Copy for children
+ props2 = [ "width", "height", "overflow" ],
+ cProps = [ "fontSize" ],
+ vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
+ hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
+
+ // Set options
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ restore = o.restore || mode !== "effect",
+ scale = o.scale || "both",
+ origin = o.origin || [ "middle", "center" ],
+ position = el.css( "position" ),
+ props = restore ? props0 : props1,
+ zero = {
+ height: 0,
+ width: 0,
+ outerHeight: 0,
+ outerWidth: 0
+ };
+
+ if ( mode === "show" ) {
+ el.show();
+ }
+ original = {
+ height: el.height(),
+ width: el.width(),
+ outerHeight: el.outerHeight(),
+ outerWidth: el.outerWidth()
+ };
+
+ if ( o.mode === "toggle" && mode === "show" ) {
+ el.from = o.to || zero;
+ el.to = o.from || original;
+ } else {
+ el.from = o.from || ( mode === "show" ? zero : original );
+ el.to = o.to || ( mode === "hide" ? zero : original );
+ }
+
+ // Set scaling factor
+ factor = {
+ from: {
+ y: el.from.height / original.height,
+ x: el.from.width / original.width
+ },
+ to: {
+ y: el.to.height / original.height,
+ x: el.to.width / original.width
+ }
+ };
+
+ // Scale the css box
+ if ( scale === "box" || scale === "both" ) {
+
+ // Vertical props scaling
+ if ( factor.from.y !== factor.to.y ) {
+ props = props.concat( vProps );
+ el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
+ el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
+ }
+
+ // Horizontal props scaling
+ if ( factor.from.x !== factor.to.x ) {
+ props = props.concat( hProps );
+ el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
+ el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
+ }
+ }
+
+ // Scale the content
+ if ( scale === "content" || scale === "both" ) {
+
+ // Vertical props scaling
+ if ( factor.from.y !== factor.to.y ) {
+ props = props.concat( cProps ).concat( props2 );
+ el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
+ el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
+ }
+ }
+
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el );
+ el.css( "overflow", "hidden" ).css( el.from );
+
+ // Adjust
+ if (origin) { // Calculate baseline shifts
+ baseline = $.effects.getBaseline( origin, original );
+ el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
+ el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
+ el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
+ el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
+ }
+ el.css( el.from ); // set top & left
+
+ // Animate
+ if ( scale === "content" || scale === "both" ) { // Scale the children
+
+ // Add margins/font-size
+ vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
+ hProps = hProps.concat([ "marginLeft", "marginRight" ]);
+ props2 = props0.concat(vProps).concat(hProps);
+
+ el.find( "*[width]" ).each( function() {
+ var child = $( this ),
+ c_original = {
+ height: child.height(),
+ width: child.width(),
+ outerHeight: child.outerHeight(),
+ outerWidth: child.outerWidth()
+ };
+ if (restore) {
+ $.effects.save(child, props2);
+ }
+
+ child.from = {
+ height: c_original.height * factor.from.y,
+ width: c_original.width * factor.from.x,
+ outerHeight: c_original.outerHeight * factor.from.y,
+ outerWidth: c_original.outerWidth * factor.from.x
+ };
+ child.to = {
+ height: c_original.height * factor.to.y,
+ width: c_original.width * factor.to.x,
+ outerHeight: c_original.height * factor.to.y,
+ outerWidth: c_original.width * factor.to.x
+ };
+
+ // Vertical props scaling
+ if ( factor.from.y !== factor.to.y ) {
+ child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
+ child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
+ }
+
+ // Horizontal props scaling
+ if ( factor.from.x !== factor.to.x ) {
+ child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
+ child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
+ }
+
+ // Animate children
+ child.css( child.from );
+ child.animate( child.to, o.duration, o.easing, function() {
+
+ // Restore children
+ if ( restore ) {
+ $.effects.restore( child, props2 );
+ }
+ });
+ });
+ }
+
+ // Animate
+ el.animate( el.to, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( el.to.opacity === 0 ) {
+ el.css( "opacity", el.from.opacity );
+ }
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ if ( !restore ) {
+
+ // we need to calculate our new positioning based on the scaling
+ if ( position === "static" ) {
+ el.css({
+ position: "relative",
+ top: el.to.top,
+ left: el.to.left
+ });
+ } else {
+ $.each([ "top", "left" ], function( idx, pos ) {
+ el.css( pos, function( _, str ) {
+ var val = parseInt( str, 10 ),
+ toRef = idx ? el.to.left : el.to.top;
+
+ // if original was "auto", recalculate the new value from wrapper
+ if ( str === "auto" ) {
+ return toRef + "px";
+ }
+
+ return val + toRef + "px";
+ });
+ });
+ }
+ }
+
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+
+};
+
+
+/*!
+ * jQuery UI Effects Scale 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/scale-effect/
+ */
+
+
+var effectScale = $.effects.effect.scale = function( o, done ) {
+
+ // Create element
+ var el = $( this ),
+ options = $.extend( true, {}, o ),
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ percent = parseInt( o.percent, 10 ) ||
+ ( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
+ direction = o.direction || "both",
+ origin = o.origin,
+ original = {
+ height: el.height(),
+ width: el.width(),
+ outerHeight: el.outerHeight(),
+ outerWidth: el.outerWidth()
+ },
+ factor = {
+ y: direction !== "horizontal" ? (percent / 100) : 1,
+ x: direction !== "vertical" ? (percent / 100) : 1
+ };
+
+ // We are going to pass this effect to the size effect:
+ options.effect = "size";
+ options.queue = false;
+ options.complete = done;
+
+ // Set default origin and restore for show/hide
+ if ( mode !== "effect" ) {
+ options.origin = origin || [ "middle", "center" ];
+ options.restore = true;
+ }
+
+ options.from = o.from || ( mode === "show" ? {
+ height: 0,
+ width: 0,
+ outerHeight: 0,
+ outerWidth: 0
+ } : original );
+ options.to = {
+ height: original.height * factor.y,
+ width: original.width * factor.x,
+ outerHeight: original.outerHeight * factor.y,
+ outerWidth: original.outerWidth * factor.x
+ };
+
+ // Fade option to support puff
+ if ( options.fade ) {
+ if ( mode === "show" ) {
+ options.from.opacity = 0;
+ options.to.opacity = 1;
+ }
+ if ( mode === "hide" ) {
+ options.from.opacity = 1;
+ options.to.opacity = 0;
+ }
+ }
+
+ // Animate
+ el.effect( options );
+
+};
+
+
+/*!
+ * jQuery UI Effects Puff 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/puff-effect/
+ */
+
+
+var effectPuff = $.effects.effect.puff = function( o, done ) {
+ var elem = $( this ),
+ mode = $.effects.setMode( elem, o.mode || "hide" ),
+ hide = mode === "hide",
+ percent = parseInt( o.percent, 10 ) || 150,
+ factor = percent / 100,
+ original = {
+ height: elem.height(),
+ width: elem.width(),
+ outerHeight: elem.outerHeight(),
+ outerWidth: elem.outerWidth()
+ };
+
+ $.extend( o, {
+ effect: "scale",
+ queue: false,
+ fade: true,
+ mode: mode,
+ complete: done,
+ percent: hide ? percent : 100,
+ from: hide ?
+ original :
+ {
+ height: original.height * factor,
+ width: original.width * factor,
+ outerHeight: original.outerHeight * factor,
+ outerWidth: original.outerWidth * factor
+ }
+ });
+
+ elem.effect( o );
+};
+
+
+/*!
+ * jQuery UI Effects Pulsate 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/pulsate-effect/
+ */
+
+
+var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
+ var elem = $( this ),
+ mode = $.effects.setMode( elem, o.mode || "show" ),
+ show = mode === "show",
+ hide = mode === "hide",
+ showhide = ( show || mode === "hide" ),
+
+ // showing or hiding leaves of the "last" animation
+ anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
+ duration = o.duration / anims,
+ animateTo = 0,
+ queue = elem.queue(),
+ queuelen = queue.length,
+ i;
+
+ if ( show || !elem.is(":visible")) {
+ elem.css( "opacity", 0 ).show();
+ animateTo = 1;
+ }
+
+ // anims - 1 opacity "toggles"
+ for ( i = 1; i < anims; i++ ) {
+ elem.animate({
+ opacity: animateTo
+ }, duration, o.easing );
+ animateTo = 1 - animateTo;
+ }
+
+ elem.animate({
+ opacity: animateTo
+ }, duration, o.easing);
+
+ elem.queue(function() {
+ if ( hide ) {
+ elem.hide();
+ }
+ done();
+ });
+
+ // We just queued up "anims" animations, we need to put them next in the queue
+ if ( queuelen > 1 ) {
+ queue.splice.apply( queue,
+ [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+ }
+ elem.dequeue();
+};
+
+
+/*!
+ * jQuery UI Effects Shake 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/shake-effect/
+ */
+
+
+var effectShake = $.effects.effect.shake = function( o, done ) {
+
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
+ mode = $.effects.setMode( el, o.mode || "effect" ),
+ direction = o.direction || "left",
+ distance = o.distance || 20,
+ times = o.times || 3,
+ anims = times * 2 + 1,
+ speed = Math.round( o.duration / anims ),
+ ref = (direction === "up" || direction === "down") ? "top" : "left",
+ positiveMotion = (direction === "up" || direction === "left"),
+ animation = {},
+ animation1 = {},
+ animation2 = {},
+ i,
+
+ // we will need to re-assemble the queue to stack our animations in place
+ queue = el.queue(),
+ queuelen = queue.length;
+
+ $.effects.save( el, props );
+ el.show();
+ $.effects.createWrapper( el );
+
+ // Animation
+ animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
+ animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
+ animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
+
+ // Animate
+ el.animate( animation, speed, o.easing );
+
+ // Shakes
+ for ( i = 1; i < times; i++ ) {
+ el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
+ }
+ el
+ .animate( animation1, speed, o.easing )
+ .animate( animation, speed / 2, o.easing )
+ .queue(function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ });
+
+ // inject all the animations we just queued to be first in line (after "inprogress")
+ if ( queuelen > 1) {
+ queue.splice.apply( queue,
+ [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
+ }
+ el.dequeue();
+
+};
+
+
+/*!
+ * jQuery UI Effects Slide 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/slide-effect/
+ */
+
+
+var effectSlide = $.effects.effect.slide = function( o, done ) {
+
+ // Create element
+ var el = $( this ),
+ props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
+ mode = $.effects.setMode( el, o.mode || "show" ),
+ show = mode === "show",
+ direction = o.direction || "left",
+ ref = (direction === "up" || direction === "down") ? "top" : "left",
+ positiveMotion = (direction === "up" || direction === "left"),
+ distance,
+ animation = {};
+
+ // Adjust
+ $.effects.save( el, props );
+ el.show();
+ distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
+
+ $.effects.createWrapper( el ).css({
+ overflow: "hidden"
+ });
+
+ if ( show ) {
+ el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
+ }
+
+ // Animation
+ animation[ ref ] = ( show ?
+ ( positiveMotion ? "+=" : "-=") :
+ ( positiveMotion ? "-=" : "+=")) +
+ distance;
+
+ // Animate
+ el.animate( animation, {
+ queue: false,
+ duration: o.duration,
+ easing: o.easing,
+ complete: function() {
+ if ( mode === "hide" ) {
+ el.hide();
+ }
+ $.effects.restore( el, props );
+ $.effects.removeWrapper( el );
+ done();
+ }
+ });
+};
+
+
+/*!
+ * jQuery UI Effects Transfer 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/transfer-effect/
+ */
+
+
+var effectTransfer = $.effects.effect.transfer = function( o, done ) {
+ var elem = $( this ),
+ target = $( o.to ),
+ targetFixed = target.css( "position" ) === "fixed",
+ body = $("body"),
+ fixTop = targetFixed ? body.scrollTop() : 0,
+ fixLeft = targetFixed ? body.scrollLeft() : 0,
+ endPosition = target.offset(),
+ animation = {
+ top: endPosition.top - fixTop,
+ left: endPosition.left - fixLeft,
+ height: target.innerHeight(),
+ width: target.innerWidth()
+ },
+ startPosition = elem.offset(),
+ transfer = $( "<div class='ui-effects-transfer'></div>" )
+ .appendTo( document.body )
+ .addClass( o.className )
+ .css({
+ top: startPosition.top - fixTop,
+ left: startPosition.left - fixLeft,
+ height: elem.innerHeight(),
+ width: elem.innerWidth(),
+ position: targetFixed ? "fixed" : "absolute"
+ })
+ .animate( animation, o.duration, o.easing, function() {
+ transfer.remove();
+ done();
+ });
+};
+
+
+/*!
+ * jQuery UI Progressbar 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/progressbar/
+ */
+
+
+var progressbar = $.widget( "ui.progressbar", {
+ version: "1.11.4",
+ options: {
+ max: 100,
+ value: 0,
+
+ change: null,
+ complete: null
+ },
+
+ min: 0,
+
+ _create: function() {
+ // Constrain initial value
+ this.oldValue = this.options.value = this._constrainedValue();
+
+ this.element
+ .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
+ .attr({
+ // Only set static values, aria-valuenow and aria-valuemax are
+ // set inside _refreshValue()
+ role: "progressbar",
+ "aria-valuemin": this.min
+ });
+
+ this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
+ .appendTo( this.element );
+
+ this._refreshValue();
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
+
+ this.valueDiv.remove();
+ },
+
+ value: function( newValue ) {
+ if ( newValue === undefined ) {
+ return this.options.value;
+ }
+
+ this.options.value = this._constrainedValue( newValue );
+ this._refreshValue();
+ },
+
+ _constrainedValue: function( newValue ) {
+ if ( newValue === undefined ) {
+ newValue = this.options.value;
+ }
+
+ this.indeterminate = newValue === false;
+
+ // sanitize value
+ if ( typeof newValue !== "number" ) {
+ newValue = 0;
+ }
+
+ return this.indeterminate ? false :
+ Math.min( this.options.max, Math.max( this.min, newValue ) );
+ },
+
+ _setOptions: function( options ) {
+ // Ensure "value" option is set after other values (like max)
+ var value = options.value;
+ delete options.value;
+
+ this._super( options );
+
+ this.options.value = this._constrainedValue( value );
+ this._refreshValue();
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "max" ) {
+ // Don't allow a max less than min
+ value = Math.max( this.min, value );
+ }
+ if ( key === "disabled" ) {
+ this.element
+ .toggleClass( "ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ }
+ this._super( key, value );
+ },
+
+ _percentage: function() {
+ return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
+ },
+
+ _refreshValue: function() {
+ var value = this.options.value,
+ percentage = this._percentage();
+
+ this.valueDiv
+ .toggle( this.indeterminate || value > this.min )
+ .toggleClass( "ui-corner-right", value === this.options.max )
+ .width( percentage.toFixed(0) + "%" );
+
+ this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
+
+ if ( this.indeterminate ) {
+ this.element.removeAttr( "aria-valuenow" );
+ if ( !this.overlayDiv ) {
+ this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
+ }
+ } else {
+ this.element.attr({
+ "aria-valuemax": this.options.max,
+ "aria-valuenow": value
+ });
+ if ( this.overlayDiv ) {
+ this.overlayDiv.remove();
+ this.overlayDiv = null;
+ }
+ }
+
+ if ( this.oldValue !== value ) {
+ this.oldValue = value;
+ this._trigger( "change" );
+ }
+ if ( value === this.options.max ) {
+ this._trigger( "complete" );
+ }
+ }
+});
+
+
+/*!
+ * jQuery UI Selectable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/selectable/
+ */
+
+
+var selectable = $.widget("ui.selectable", $.ui.mouse, {
+ version: "1.11.4",
+ options: {
+ appendTo: "body",
+ autoRefresh: true,
+ distance: 0,
+ filter: "*",
+ tolerance: "touch",
+
+ // callbacks
+ selected: null,
+ selecting: null,
+ start: null,
+ stop: null,
+ unselected: null,
+ unselecting: null
+ },
+ _create: function() {
+ var selectees,
+ that = this;
+
+ this.element.addClass("ui-selectable");
+
+ this.dragged = false;
+
+ // cache selectee children based on filter
+ this.refresh = function() {
+ selectees = $(that.options.filter, that.element[0]);
+ selectees.addClass("ui-selectee");
+ selectees.each(function() {
+ var $this = $(this),
+ pos = $this.offset();
+ $.data(this, "selectable-item", {
+ element: this,
+ $element: $this,
+ left: pos.left,
+ top: pos.top,
+ right: pos.left + $this.outerWidth(),
+ bottom: pos.top + $this.outerHeight(),
+ startselected: false,
+ selected: $this.hasClass("ui-selected"),
+ selecting: $this.hasClass("ui-selecting"),
+ unselecting: $this.hasClass("ui-unselecting")
+ });
+ });
+ };
+ this.refresh();
+
+ this.selectees = selectees.addClass("ui-selectee");
+
+ this._mouseInit();
+
+ this.helper = $("<div class='ui-selectable-helper'></div>");
+ },
+
+ _destroy: function() {
+ this.selectees
+ .removeClass("ui-selectee")
+ .removeData("selectable-item");
+ this.element
+ .removeClass("ui-selectable ui-selectable-disabled");
+ this._mouseDestroy();
+ },
+
+ _mouseStart: function(event) {
+ var that = this,
+ options = this.options;
+
+ this.opos = [ event.pageX, event.pageY ];
+
+ if (this.options.disabled) {
+ return;
+ }
+
+ this.selectees = $(options.filter, this.element[0]);
+
+ this._trigger("start", event);
+
+ $(options.appendTo).append(this.helper);
+ // position helper (lasso)
+ this.helper.css({
+ "left": event.pageX,
+ "top": event.pageY,
+ "width": 0,
+ "height": 0
+ });
+
+ if (options.autoRefresh) {
+ this.refresh();
+ }
+
+ this.selectees.filter(".ui-selected").each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.startselected = true;
+ if (!event.metaKey && !event.ctrlKey) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ });
+
+ $(event.target).parents().addBack().each(function() {
+ var doSelect,
+ selectee = $.data(this, "selectable-item");
+ if (selectee) {
+ doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
+ selectee.$element
+ .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
+ .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
+ selectee.unselecting = !doSelect;
+ selectee.selecting = doSelect;
+ selectee.selected = doSelect;
+ // selectable (UN)SELECTING callback
+ if (doSelect) {
+ that._trigger("selecting", event, {
+ selecting: selectee.element
+ });
+ } else {
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ return false;
+ }
+ });
+
+ },
+
+ _mouseDrag: function(event) {
+
+ this.dragged = true;
+
+ if (this.options.disabled) {
+ return;
+ }
+
+ var tmp,
+ that = this,
+ options = this.options,
+ x1 = this.opos[0],
+ y1 = this.opos[1],
+ x2 = event.pageX,
+ y2 = event.pageY;
+
+ if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
+ if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
+ this.helper.css({ left: x1, top: y1, width: x2 - x1, height: y2 - y1 });
+
+ this.selectees.each(function() {
+ var selectee = $.data(this, "selectable-item"),
+ hit = false;
+
+ //prevent helper from being selected if appendTo: selectable
+ if (!selectee || selectee.element === that.element[0]) {
+ return;
+ }
+
+ if (options.tolerance === "touch") {
+ hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
+ } else if (options.tolerance === "fit") {
+ hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
+ }
+
+ if (hit) {
+ // SELECT
+ if (selectee.selected) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+ }
+ if (selectee.unselecting) {
+ selectee.$element.removeClass("ui-unselecting");
+ selectee.unselecting = false;
+ }
+ if (!selectee.selecting) {
+ selectee.$element.addClass("ui-selecting");
+ selectee.selecting = true;
+ // selectable SELECTING callback
+ that._trigger("selecting", event, {
+ selecting: selectee.element
+ });
+ }
+ } else {
+ // UNSELECT
+ if (selectee.selecting) {
+ if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
+ selectee.$element.removeClass("ui-selecting");
+ selectee.selecting = false;
+ selectee.$element.addClass("ui-selected");
+ selectee.selected = true;
+ } else {
+ selectee.$element.removeClass("ui-selecting");
+ selectee.selecting = false;
+ if (selectee.startselected) {
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ }
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ }
+ if (selectee.selected) {
+ if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
+ selectee.$element.removeClass("ui-selected");
+ selectee.selected = false;
+
+ selectee.$element.addClass("ui-unselecting");
+ selectee.unselecting = true;
+ // selectable UNSELECTING callback
+ that._trigger("unselecting", event, {
+ unselecting: selectee.element
+ });
+ }
+ }
+ }
+ });
+
+ return false;
+ },
+
+ _mouseStop: function(event) {
+ var that = this;
+
+ this.dragged = false;
+
+ $(".ui-unselecting", this.element[0]).each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.$element.removeClass("ui-unselecting");
+ selectee.unselecting = false;
+ selectee.startselected = false;
+ that._trigger("unselected", event, {
+ unselected: selectee.element
+ });
+ });
+ $(".ui-selecting", this.element[0]).each(function() {
+ var selectee = $.data(this, "selectable-item");
+ selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
+ selectee.selecting = false;
+ selectee.selected = true;
+ selectee.startselected = true;
+ that._trigger("selected", event, {
+ selected: selectee.element
+ });
+ });
+ this._trigger("stop", event);
+
+ this.helper.remove();
+
+ return false;
+ }
+
+});
+
+
+/*!
+ * jQuery UI Selectmenu 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/selectmenu
+ */
+
+
+var selectmenu = $.widget( "ui.selectmenu", {
+ version: "1.11.4",
+ defaultElement: "<select>",
+ options: {
+ appendTo: null,
+ disabled: null,
+ icons: {
+ button: "ui-icon-triangle-1-s"
+ },
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ width: null,
+
+ // callbacks
+ change: null,
+ close: null,
+ focus: null,
+ open: null,
+ select: null
+ },
+
+ _create: function() {
+ var selectmenuId = this.element.uniqueId().attr( "id" );
+ this.ids = {
+ element: selectmenuId,
+ button: selectmenuId + "-button",
+ menu: selectmenuId + "-menu"
+ };
+
+ this._drawButton();
+ this._drawMenu();
+
+ if ( this.options.disabled ) {
+ this.disable();
+ }
+ },
+
+ _drawButton: function() {
+ var that = this;
+
+ // Associate existing label with the new button
+ this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
+ this._on( this.label, {
+ click: function( event ) {
+ this.button.focus();
+ event.preventDefault();
+ }
+ });
+
+ // Hide original select element
+ this.element.hide();
+
+ // Create button
+ this.button = $( "<span>", {
+ "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
+ tabindex: this.options.disabled ? -1 : 0,
+ id: this.ids.button,
+ role: "combobox",
+ "aria-expanded": "false",
+ "aria-autocomplete": "list",
+ "aria-owns": this.ids.menu,
+ "aria-haspopup": "true"
+ })
+ .insertAfter( this.element );
+
+ $( "<span>", {
+ "class": "ui-icon " + this.options.icons.button
+ })
+ .prependTo( this.button );
+
+ this.buttonText = $( "<span>", {
+ "class": "ui-selectmenu-text"
+ })
+ .appendTo( this.button );
+
+ this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
+ this._resizeButton();
+
+ this._on( this.button, this._buttonEvents );
+ this.button.one( "focusin", function() {
+
+ // Delay rendering the menu items until the button receives focus.
+ // The menu may have already been rendered via a programmatic open.
+ if ( !that.menuItems ) {
+ that._refreshMenu();
+ }
+ });
+ this._hoverable( this.button );
+ this._focusable( this.button );
+ },
+
+ _drawMenu: function() {
+ var that = this;
+
+ // Create menu
+ this.menu = $( "<ul>", {
+ "aria-hidden": "true",
+ "aria-labelledby": this.ids.button,
+ id: this.ids.menu
+ });
+
+ // Wrap menu
+ this.menuWrap = $( "<div>", {
+ "class": "ui-selectmenu-menu ui-front"
+ })
+ .append( this.menu )
+ .appendTo( this._appendTo() );
+
+ // Initialize menu widget
+ this.menuInstance = this.menu
+ .menu({
+ role: "listbox",
+ select: function( event, ui ) {
+ event.preventDefault();
+
+ // support: IE8
+ // If the item was selected via a click, the text selection
+ // will be destroyed in IE
+ that._setSelection();
+
+ that._select( ui.item.data( "ui-selectmenu-item" ), event );
+ },
+ focus: function( event, ui ) {
+ var item = ui.item.data( "ui-selectmenu-item" );
+
+ // Prevent inital focus from firing and check if its a newly focused item
+ if ( that.focusIndex != null && item.index !== that.focusIndex ) {
+ that._trigger( "focus", event, { item: item } );
+ if ( !that.isOpen ) {
+ that._select( item, event );
+ }
+ }
+ that.focusIndex = item.index;
+
+ that.button.attr( "aria-activedescendant",
+ that.menuItems.eq( item.index ).attr( "id" ) );
+ }
+ })
+ .menu( "instance" );
+
+ // Adjust menu styles to dropdown
+ this.menu
+ .addClass( "ui-corner-bottom" )
+ .removeClass( "ui-corner-all" );
+
+ // Don't close the menu on mouseleave
+ this.menuInstance._off( this.menu, "mouseleave" );
+
+ // Cancel the menu's collapseAll on document click
+ this.menuInstance._closeOnDocumentClick = function() {
+ return false;
+ };
+
+ // Selects often contain empty items, but never contain dividers
+ this.menuInstance._isDivider = function() {
+ return false;
+ };
+ },
+
+ refresh: function() {
+ this._refreshMenu();
+ this._setText( this.buttonText, this._getSelectedItem().text() );
+ if ( !this.options.width ) {
+ this._resizeButton();
+ }
+ },
+
+ _refreshMenu: function() {
+ this.menu.empty();
+
+ var item,
+ options = this.element.find( "option" );
+
+ if ( !options.length ) {
+ return;
+ }
+
+ this._parseOptions( options );
+ this._renderMenu( this.menu, this.items );
+
+ this.menuInstance.refresh();
+ this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
+
+ item = this._getSelectedItem();
+
+ // Update the menu to have the correct item focused
+ this.menuInstance.focus( null, item );
+ this._setAria( item.data( "ui-selectmenu-item" ) );
+
+ // Set disabled state
+ this._setOption( "disabled", this.element.prop( "disabled" ) );
+ },
+
+ open: function( event ) {
+ if ( this.options.disabled ) {
+ return;
+ }
+
+ // If this is the first time the menu is being opened, render the items
+ if ( !this.menuItems ) {
+ this._refreshMenu();
+ } else {
+
+ // Menu clears focus on close, reset focus to selected item
+ this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
+ this.menuInstance.focus( null, this._getSelectedItem() );
+ }
+
+ this.isOpen = true;
+ this._toggleAttr();
+ this._resizeMenu();
+ this._position();
+
+ this._on( this.document, this._documentClick );
+
+ this._trigger( "open", event );
+ },
+
+ _position: function() {
+ this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
+ },
+
+ close: function( event ) {
+ if ( !this.isOpen ) {
+ return;
+ }
+
+ this.isOpen = false;
+ this._toggleAttr();
+
+ this.range = null;
+ this._off( this.document );
+
+ this._trigger( "close", event );
+ },
+
+ widget: function() {
+ return this.button;
+ },
+
+ menuWidget: function() {
+ return this.menu;
+ },
+
+ _renderMenu: function( ul, items ) {
+ var that = this,
+ currentOptgroup = "";
+
+ $.each( items, function( index, item ) {
+ if ( item.optgroup !== currentOptgroup ) {
+ $( "<li>", {
+ "class": "ui-selectmenu-optgroup ui-menu-divider" +
+ ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
+ " ui-state-disabled" :
+ "" ),
+ text: item.optgroup
+ })
+ .appendTo( ul );
+
+ currentOptgroup = item.optgroup;
+ }
+
+ that._renderItemData( ul, item );
+ });
+ },
+
+ _renderItemData: function( ul, item ) {
+ return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
+ },
+
+ _renderItem: function( ul, item ) {
+ var li = $( "<li>" );
+
+ if ( item.disabled ) {
+ li.addClass( "ui-state-disabled" );
+ }
+ this._setText( li, item.label );
+
+ return li.appendTo( ul );
+ },
+
+ _setText: function( element, value ) {
+ if ( value ) {
+ element.text( value );
+ } else {
+ element.html( "&#160;" );
+ }
+ },
+
+ _move: function( direction, event ) {
+ var item, next,
+ filter = ".ui-menu-item";
+
+ if ( this.isOpen ) {
+ item = this.menuItems.eq( this.focusIndex );
+ } else {
+ item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
+ filter += ":not(.ui-state-disabled)";
+ }
+
+ if ( direction === "first" || direction === "last" ) {
+ next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
+ } else {
+ next = item[ direction + "All" ]( filter ).eq( 0 );
+ }
+
+ if ( next.length ) {
+ this.menuInstance.focus( event, next );
+ }
+ },
+
+ _getSelectedItem: function() {
+ return this.menuItems.eq( this.element[ 0 ].selectedIndex );
+ },
+
+ _toggle: function( event ) {
+ this[ this.isOpen ? "close" : "open" ]( event );
+ },
+
+ _setSelection: function() {
+ var selection;
+
+ if ( !this.range ) {
+ return;
+ }
+
+ if ( window.getSelection ) {
+ selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange( this.range );
+
+ // support: IE8
+ } else {
+ this.range.select();
+ }
+
+ // support: IE
+ // Setting the text selection kills the button focus in IE, but
+ // restoring the focus doesn't kill the selection.
+ this.button.focus();
+ },
+
+ _documentClick: {
+ mousedown: function( event ) {
+ if ( !this.isOpen ) {
+ return;
+ }
+
+ if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
+ this.close( event );
+ }
+ }
+ },
+
+ _buttonEvents: {
+
+ // Prevent text selection from being reset when interacting with the selectmenu (#10144)
+ mousedown: function() {
+ var selection;
+
+ if ( window.getSelection ) {
+ selection = window.getSelection();
+ if ( selection.rangeCount ) {
+ this.range = selection.getRangeAt( 0 );
+ }
+
+ // support: IE8
+ } else {
+ this.range = document.selection.createRange();
+ }
+ },
+
+ click: function( event ) {
+ this._setSelection();
+ this._toggle( event );
+ },
+
+ keydown: function( event ) {
+ var preventDefault = true;
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.TAB:
+ case $.ui.keyCode.ESCAPE:
+ this.close( event );
+ preventDefault = false;
+ break;
+ case $.ui.keyCode.ENTER:
+ if ( this.isOpen ) {
+ this._selectFocusedItem( event );
+ }
+ break;
+ case $.ui.keyCode.UP:
+ if ( event.altKey ) {
+ this._toggle( event );
+ } else {
+ this._move( "prev", event );
+ }
+ break;
+ case $.ui.keyCode.DOWN:
+ if ( event.altKey ) {
+ this._toggle( event );
+ } else {
+ this._move( "next", event );
+ }
+ break;
+ case $.ui.keyCode.SPACE:
+ if ( this.isOpen ) {
+ this._selectFocusedItem( event );
+ } else {
+ this._toggle( event );
+ }
+ break;
+ case $.ui.keyCode.LEFT:
+ this._move( "prev", event );
+ break;
+ case $.ui.keyCode.RIGHT:
+ this._move( "next", event );
+ break;
+ case $.ui.keyCode.HOME:
+ case $.ui.keyCode.PAGE_UP:
+ this._move( "first", event );
+ break;
+ case $.ui.keyCode.END:
+ case $.ui.keyCode.PAGE_DOWN:
+ this._move( "last", event );
+ break;
+ default:
+ this.menu.trigger( event );
+ preventDefault = false;
+ }
+
+ if ( preventDefault ) {
+ event.preventDefault();
+ }
+ }
+ },
+
+ _selectFocusedItem: function( event ) {
+ var item = this.menuItems.eq( this.focusIndex );
+ if ( !item.hasClass( "ui-state-disabled" ) ) {
+ this._select( item.data( "ui-selectmenu-item" ), event );
+ }
+ },
+
+ _select: function( item, event ) {
+ var oldIndex = this.element[ 0 ].selectedIndex;
+
+ // Change native select element
+ this.element[ 0 ].selectedIndex = item.index;
+ this._setText( this.buttonText, item.label );
+ this._setAria( item );
+ this._trigger( "select", event, { item: item } );
+
+ if ( item.index !== oldIndex ) {
+ this._trigger( "change", event, { item: item } );
+ }
+
+ this.close( event );
+ },
+
+ _setAria: function( item ) {
+ var id = this.menuItems.eq( item.index ).attr( "id" );
+
+ this.button.attr({
+ "aria-labelledby": id,
+ "aria-activedescendant": id
+ });
+ this.menu.attr( "aria-activedescendant", id );
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "icons" ) {
+ this.button.find( "span.ui-icon" )
+ .removeClass( this.options.icons.button )
+ .addClass( value.button );
+ }
+
+ this._super( key, value );
+
+ if ( key === "appendTo" ) {
+ this.menuWrap.appendTo( this._appendTo() );
+ }
+
+ if ( key === "disabled" ) {
+ this.menuInstance.option( "disabled", value );
+ this.button
+ .toggleClass( "ui-state-disabled", value )
+ .attr( "aria-disabled", value );
+
+ this.element.prop( "disabled", value );
+ if ( value ) {
+ this.button.attr( "tabindex", -1 );
+ this.close();
+ } else {
+ this.button.attr( "tabindex", 0 );
+ }
+ }
+
+ if ( key === "width" ) {
+ this._resizeButton();
+ }
+ },
+
+ _appendTo: function() {
+ var element = this.options.appendTo;
+
+ if ( element ) {
+ element = element.jquery || element.nodeType ?
+ $( element ) :
+ this.document.find( element ).eq( 0 );
+ }
+
+ if ( !element || !element[ 0 ] ) {
+ element = this.element.closest( ".ui-front" );
+ }
+
+ if ( !element.length ) {
+ element = this.document[ 0 ].body;
+ }
+
+ return element;
+ },
+
+ _toggleAttr: function() {
+ this.button
+ .toggleClass( "ui-corner-top", this.isOpen )
+ .toggleClass( "ui-corner-all", !this.isOpen )
+ .attr( "aria-expanded", this.isOpen );
+ this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
+ this.menu.attr( "aria-hidden", !this.isOpen );
+ },
+
+ _resizeButton: function() {
+ var width = this.options.width;
+
+ if ( !width ) {
+ width = this.element.show().outerWidth();
+ this.element.hide();
+ }
+
+ this.button.outerWidth( width );
+ },
+
+ _resizeMenu: function() {
+ this.menu.outerWidth( Math.max(
+ this.button.outerWidth(),
+
+ // support: IE10
+ // IE10 wraps long text (possibly a rounding bug)
+ // so we add 1px to avoid the wrapping
+ this.menu.width( "" ).outerWidth() + 1
+ ) );
+ },
+
+ _getCreateOptions: function() {
+ return { disabled: this.element.prop( "disabled" ) };
+ },
+
+ _parseOptions: function( options ) {
+ var data = [];
+ options.each(function( index, item ) {
+ var option = $( item ),
+ optgroup = option.parent( "optgroup" );
+ data.push({
+ element: option,
+ index: index,
+ value: option.val(),
+ label: option.text(),
+ optgroup: optgroup.attr( "label" ) || "",
+ disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
+ });
+ });
+ this.items = data;
+ },
+
+ _destroy: function() {
+ this.menuWrap.remove();
+ this.button.remove();
+ this.element.show();
+ this.element.removeUniqueId();
+ this.label.attr( "for", this.ids.element );
+ }
+});
+
+
+/*!
+ * jQuery UI Slider 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/slider/
+ */
+
+
+var slider = $.widget( "ui.slider", $.ui.mouse, {
+ version: "1.11.4",
+ widgetEventPrefix: "slide",
+
+ options: {
+ animate: false,
+ distance: 0,
+ max: 100,
+ min: 0,
+ orientation: "horizontal",
+ range: false,
+ step: 1,
+ value: 0,
+ values: null,
+
+ // callbacks
+ change: null,
+ slide: null,
+ start: null,
+ stop: null
+ },
+
+ // number of pages in a slider
+ // (how many times can you page up/down to go through the whole range)
+ numPages: 5,
+
+ _create: function() {
+ this._keySliding = false;
+ this._mouseSliding = false;
+ this._animateOff = true;
+ this._handleIndex = null;
+ this._detectOrientation();
+ this._mouseInit();
+ this._calculateNewMax();
+
+ this.element
+ .addClass( "ui-slider" +
+ " ui-slider-" + this.orientation +
+ " ui-widget" +
+ " ui-widget-content" +
+ " ui-corner-all");
+
+ this._refresh();
+ this._setOption( "disabled", this.options.disabled );
+
+ this._animateOff = false;
+ },
+
+ _refresh: function() {
+ this._createRange();
+ this._createHandles();
+ this._setupEvents();
+ this._refreshValue();
+ },
+
+ _createHandles: function() {
+ var i, handleCount,
+ options = this.options,
+ existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
+ handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
+ handles = [];
+
+ handleCount = ( options.values && options.values.length ) || 1;
+
+ if ( existingHandles.length > handleCount ) {
+ existingHandles.slice( handleCount ).remove();
+ existingHandles = existingHandles.slice( 0, handleCount );
+ }
+
+ for ( i = existingHandles.length; i < handleCount; i++ ) {
+ handles.push( handle );
+ }
+
+ this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
+
+ this.handle = this.handles.eq( 0 );
+
+ this.handles.each(function( i ) {
+ $( this ).data( "ui-slider-handle-index", i );
+ });
+ },
+
+ _createRange: function() {
+ var options = this.options,
+ classes = "";
+
+ if ( options.range ) {
+ if ( options.range === true ) {
+ if ( !options.values ) {
+ options.values = [ this._valueMin(), this._valueMin() ];
+ } else if ( options.values.length && options.values.length !== 2 ) {
+ options.values = [ options.values[0], options.values[0] ];
+ } else if ( $.isArray( options.values ) ) {
+ options.values = options.values.slice(0);
+ }
+ }
+
+ if ( !this.range || !this.range.length ) {
+ this.range = $( "<div></div>" )
+ .appendTo( this.element );
+
+ classes = "ui-slider-range" +
+ // note: this isn't the most fittingly semantic framework class for this element,
+ // but worked best visually with a variety of themes
+ " ui-widget-header ui-corner-all";
+ } else {
+ this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
+ // Handle range switching from true to min/max
+ .css({
+ "left": "",
+ "bottom": ""
+ });
+ }
+
+ this.range.addClass( classes +
+ ( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
+ } else {
+ if ( this.range ) {
+ this.range.remove();
+ }
+ this.range = null;
+ }
+ },
+
+ _setupEvents: function() {
+ this._off( this.handles );
+ this._on( this.handles, this._handleEvents );
+ this._hoverable( this.handles );
+ this._focusable( this.handles );
+ },
+
+ _destroy: function() {
+ this.handles.remove();
+ if ( this.range ) {
+ this.range.remove();
+ }
+
+ this.element
+ .removeClass( "ui-slider" +
+ " ui-slider-horizontal" +
+ " ui-slider-vertical" +
+ " ui-widget" +
+ " ui-widget-content" +
+ " ui-corner-all" );
+
+ this._mouseDestroy();
+ },
+
+ _mouseCapture: function( event ) {
+ var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
+ that = this,
+ o = this.options;
+
+ if ( o.disabled ) {
+ return false;
+ }
+
+ this.elementSize = {
+ width: this.element.outerWidth(),
+ height: this.element.outerHeight()
+ };
+ this.elementOffset = this.element.offset();
+
+ position = { x: event.pageX, y: event.pageY };
+ normValue = this._normValueFromMouse( position );
+ distance = this._valueMax() - this._valueMin() + 1;
+ this.handles.each(function( i ) {
+ var thisDistance = Math.abs( normValue - that.values(i) );
+ if (( distance > thisDistance ) ||
+ ( distance === thisDistance &&
+ (i === that._lastChangedValue || that.values(i) === o.min ))) {
+ distance = thisDistance;
+ closestHandle = $( this );
+ index = i;
+ }
+ });
+
+ allowed = this._start( event, index );
+ if ( allowed === false ) {
+ return false;
+ }
+ this._mouseSliding = true;
+
+ this._handleIndex = index;
+
+ closestHandle
+ .addClass( "ui-state-active" )
+ .focus();
+
+ offset = closestHandle.offset();
+ mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
+ this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
+ left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
+ top: event.pageY - offset.top -
+ ( closestHandle.height() / 2 ) -
+ ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
+ ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
+ ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
+ };
+
+ if ( !this.handles.hasClass( "ui-state-hover" ) ) {
+ this._slide( event, index, normValue );
+ }
+ this._animateOff = true;
+ return true;
+ },
+
+ _mouseStart: function() {
+ return true;
+ },
+
+ _mouseDrag: function( event ) {
+ var position = { x: event.pageX, y: event.pageY },
+ normValue = this._normValueFromMouse( position );
+
+ this._slide( event, this._handleIndex, normValue );
+
+ return false;
+ },
+
+ _mouseStop: function( event ) {
+ this.handles.removeClass( "ui-state-active" );
+ this._mouseSliding = false;
+
+ this._stop( event, this._handleIndex );
+ this._change( event, this._handleIndex );
+
+ this._handleIndex = null;
+ this._clickOffset = null;
+ this._animateOff = false;
+
+ return false;
+ },
+
+ _detectOrientation: function() {
+ this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
+ },
+
+ _normValueFromMouse: function( position ) {
+ var pixelTotal,
+ pixelMouse,
+ percentMouse,
+ valueTotal,
+ valueMouse;
+
+ if ( this.orientation === "horizontal" ) {
+ pixelTotal = this.elementSize.width;
+ pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
+ } else {
+ pixelTotal = this.elementSize.height;
+ pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
+ }
+
+ percentMouse = ( pixelMouse / pixelTotal );
+ if ( percentMouse > 1 ) {
+ percentMouse = 1;
+ }
+ if ( percentMouse < 0 ) {
+ percentMouse = 0;
+ }
+ if ( this.orientation === "vertical" ) {
+ percentMouse = 1 - percentMouse;
+ }
+
+ valueTotal = this._valueMax() - this._valueMin();
+ valueMouse = this._valueMin() + percentMouse * valueTotal;
+
+ return this._trimAlignValue( valueMouse );
+ },
+
+ _start: function( event, index ) {
+ var uiHash = {
+ handle: this.handles[ index ],
+ value: this.value()
+ };
+ if ( this.options.values && this.options.values.length ) {
+ uiHash.value = this.values( index );
+ uiHash.values = this.values();
+ }
+ return this._trigger( "start", event, uiHash );
+ },
+
+ _slide: function( event, index, newVal ) {
+ var otherVal,
+ newValues,
+ allowed;
+
+ if ( this.options.values && this.options.values.length ) {
+ otherVal = this.values( index ? 0 : 1 );
+
+ if ( ( this.options.values.length === 2 && this.options.range === true ) &&
+ ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
+ ) {
+ newVal = otherVal;
+ }
+
+ if ( newVal !== this.values( index ) ) {
+ newValues = this.values();
+ newValues[ index ] = newVal;
+ // A slide can be canceled by returning false from the slide callback
+ allowed = this._trigger( "slide", event, {
+ handle: this.handles[ index ],
+ value: newVal,
+ values: newValues
+ } );
+ otherVal = this.values( index ? 0 : 1 );
+ if ( allowed !== false ) {
+ this.values( index, newVal );
+ }
+ }
+ } else {
+ if ( newVal !== this.value() ) {
+ // A slide can be canceled by returning false from the slide callback
+ allowed = this._trigger( "slide", event, {
+ handle: this.handles[ index ],
+ value: newVal
+ } );
+ if ( allowed !== false ) {
+ this.value( newVal );
+ }
+ }
+ }
+ },
+
+ _stop: function( event, index ) {
+ var uiHash = {
+ handle: this.handles[ index ],
+ value: this.value()
+ };
+ if ( this.options.values && this.options.values.length ) {
+ uiHash.value = this.values( index );
+ uiHash.values = this.values();
+ }
+
+ this._trigger( "stop", event, uiHash );
+ },
+
+ _change: function( event, index ) {
+ if ( !this._keySliding && !this._mouseSliding ) {
+ var uiHash = {
+ handle: this.handles[ index ],
+ value: this.value()
+ };
+ if ( this.options.values && this.options.values.length ) {
+ uiHash.value = this.values( index );
+ uiHash.values = this.values();
+ }
+
+ //store the last changed value index for reference when handles overlap
+ this._lastChangedValue = index;
+
+ this._trigger( "change", event, uiHash );
+ }
+ },
+
+ value: function( newValue ) {
+ if ( arguments.length ) {
+ this.options.value = this._trimAlignValue( newValue );
+ this._refreshValue();
+ this._change( null, 0 );
+ return;
+ }
+
+ return this._value();
+ },
+
+ values: function( index, newValue ) {
+ var vals,
+ newValues,
+ i;
+
+ if ( arguments.length > 1 ) {
+ this.options.values[ index ] = this._trimAlignValue( newValue );
+ this._refreshValue();
+ this._change( null, index );
+ return;
+ }
+
+ if ( arguments.length ) {
+ if ( $.isArray( arguments[ 0 ] ) ) {
+ vals = this.options.values;
+ newValues = arguments[ 0 ];
+ for ( i = 0; i < vals.length; i += 1 ) {
+ vals[ i ] = this._trimAlignValue( newValues[ i ] );
+ this._change( null, i );
+ }
+ this._refreshValue();
+ } else {
+ if ( this.options.values && this.options.values.length ) {
+ return this._values( index );
+ } else {
+ return this.value();
+ }
+ }
+ } else {
+ return this._values();
+ }
+ },
+
+ _setOption: function( key, value ) {
+ var i,
+ valsLength = 0;
+
+ if ( key === "range" && this.options.range === true ) {
+ if ( value === "min" ) {
+ this.options.value = this._values( 0 );
+ this.options.values = null;
+ } else if ( value === "max" ) {
+ this.options.value = this._values( this.options.values.length - 1 );
+ this.options.values = null;
+ }
+ }
+
+ if ( $.isArray( this.options.values ) ) {
+ valsLength = this.options.values.length;
+ }
+
+ if ( key === "disabled" ) {
+ this.element.toggleClass( "ui-state-disabled", !!value );
+ }
+
+ this._super( key, value );
+
+ switch ( key ) {
+ case "orientation":
+ this._detectOrientation();
+ this.element
+ .removeClass( "ui-slider-horizontal ui-slider-vertical" )
+ .addClass( "ui-slider-" + this.orientation );
+ this._refreshValue();
+
+ // Reset positioning from previous orientation
+ this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
+ break;
+ case "value":
+ this._animateOff = true;
+ this._refreshValue();
+ this._change( null, 0 );
+ this._animateOff = false;
+ break;
+ case "values":
+ this._animateOff = true;
+ this._refreshValue();
+ for ( i = 0; i < valsLength; i += 1 ) {
+ this._change( null, i );
+ }
+ this._animateOff = false;
+ break;
+ case "step":
+ case "min":
+ case "max":
+ this._animateOff = true;
+ this._calculateNewMax();
+ this._refreshValue();
+ this._animateOff = false;
+ break;
+ case "range":
+ this._animateOff = true;
+ this._refresh();
+ this._animateOff = false;
+ break;
+ }
+ },
+
+ //internal value getter
+ // _value() returns value trimmed by min and max, aligned by step
+ _value: function() {
+ var val = this.options.value;
+ val = this._trimAlignValue( val );
+
+ return val;
+ },
+
+ //internal values getter
+ // _values() returns array of values trimmed by min and max, aligned by step
+ // _values( index ) returns single value trimmed by min and max, aligned by step
+ _values: function( index ) {
+ var val,
+ vals,
+ i;
+
+ if ( arguments.length ) {
+ val = this.options.values[ index ];
+ val = this._trimAlignValue( val );
+
+ return val;
+ } else if ( this.options.values && this.options.values.length ) {
+ // .slice() creates a copy of the array
+ // this copy gets trimmed by min and max and then returned
+ vals = this.options.values.slice();
+ for ( i = 0; i < vals.length; i += 1) {
+ vals[ i ] = this._trimAlignValue( vals[ i ] );
+ }
+
+ return vals;
+ } else {
+ return [];
+ }
+ },
+
+ // returns the step-aligned value that val is closest to, between (inclusive) min and max
+ _trimAlignValue: function( val ) {
+ if ( val <= this._valueMin() ) {
+ return this._valueMin();
+ }
+ if ( val >= this._valueMax() ) {
+ return this._valueMax();
+ }
+ var step = ( this.options.step > 0 ) ? this.options.step : 1,
+ valModStep = (val - this._valueMin()) % step,
+ alignValue = val - valModStep;
+
+ if ( Math.abs(valModStep) * 2 >= step ) {
+ alignValue += ( valModStep > 0 ) ? step : ( -step );
+ }
+
+ // Since JavaScript has problems with large floats, round
+ // the final value to 5 digits after the decimal point (see #4124)
+ return parseFloat( alignValue.toFixed(5) );
+ },
+
+ _calculateNewMax: function() {
+ var max = this.options.max,
+ min = this._valueMin(),
+ step = this.options.step,
+ aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
+ max = aboveMin + min;
+ this.max = parseFloat( max.toFixed( this._precision() ) );
+ },
+
+ _precision: function() {
+ var precision = this._precisionOf( this.options.step );
+ if ( this.options.min !== null ) {
+ precision = Math.max( precision, this._precisionOf( this.options.min ) );
+ }
+ return precision;
+ },
+
+ _precisionOf: function( num ) {
+ var str = num.toString(),
+ decimal = str.indexOf( "." );
+ return decimal === -1 ? 0 : str.length - decimal - 1;
+ },
+
+ _valueMin: function() {
+ return this.options.min;
+ },
+
+ _valueMax: function() {
+ return this.max;
+ },
+
+ _refreshValue: function() {
+ var lastValPercent, valPercent, value, valueMin, valueMax,
+ oRange = this.options.range,
+ o = this.options,
+ that = this,
+ animate = ( !this._animateOff ) ? o.animate : false,
+ _set = {};
+
+ if ( this.options.values && this.options.values.length ) {
+ this.handles.each(function( i ) {
+ valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
+ _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
+ $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
+ if ( that.options.range === true ) {
+ if ( that.orientation === "horizontal" ) {
+ if ( i === 0 ) {
+ that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
+ }
+ if ( i === 1 ) {
+ that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ } else {
+ if ( i === 0 ) {
+ that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
+ }
+ if ( i === 1 ) {
+ that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ }
+ }
+ lastValPercent = valPercent;
+ });
+ } else {
+ value = this.value();
+ valueMin = this._valueMin();
+ valueMax = this._valueMax();
+ valPercent = ( valueMax !== valueMin ) ?
+ ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
+ 0;
+ _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
+ this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
+
+ if ( oRange === "min" && this.orientation === "horizontal" ) {
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
+ }
+ if ( oRange === "max" && this.orientation === "horizontal" ) {
+ this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ if ( oRange === "min" && this.orientation === "vertical" ) {
+ this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
+ }
+ if ( oRange === "max" && this.orientation === "vertical" ) {
+ this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
+ }
+ }
+ },
+
+ _handleEvents: {
+ keydown: function( event ) {
+ var allowed, curVal, newVal, step,
+ index = $( event.target ).data( "ui-slider-handle-index" );
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.HOME:
+ case $.ui.keyCode.END:
+ case $.ui.keyCode.PAGE_UP:
+ case $.ui.keyCode.PAGE_DOWN:
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.RIGHT:
+ case $.ui.keyCode.DOWN:
+ case $.ui.keyCode.LEFT:
+ event.preventDefault();
+ if ( !this._keySliding ) {
+ this._keySliding = true;
+ $( event.target ).addClass( "ui-state-active" );
+ allowed = this._start( event, index );
+ if ( allowed === false ) {
+ return;
+ }
+ }
+ break;
+ }
+
+ step = this.options.step;
+ if ( this.options.values && this.options.values.length ) {
+ curVal = newVal = this.values( index );
+ } else {
+ curVal = newVal = this.value();
+ }
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.HOME:
+ newVal = this._valueMin();
+ break;
+ case $.ui.keyCode.END:
+ newVal = this._valueMax();
+ break;
+ case $.ui.keyCode.PAGE_UP:
+ newVal = this._trimAlignValue(
+ curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
+ );
+ break;
+ case $.ui.keyCode.PAGE_DOWN:
+ newVal = this._trimAlignValue(
+ curVal - ( (this._valueMax() - this._valueMin()) / this.numPages ) );
+ break;
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.RIGHT:
+ if ( curVal === this._valueMax() ) {
+ return;
+ }
+ newVal = this._trimAlignValue( curVal + step );
+ break;
+ case $.ui.keyCode.DOWN:
+ case $.ui.keyCode.LEFT:
+ if ( curVal === this._valueMin() ) {
+ return;
+ }
+ newVal = this._trimAlignValue( curVal - step );
+ break;
+ }
+
+ this._slide( event, index, newVal );
+ },
+ keyup: function( event ) {
+ var index = $( event.target ).data( "ui-slider-handle-index" );
+
+ if ( this._keySliding ) {
+ this._keySliding = false;
+ this._stop( event, index );
+ this._change( event, index );
+ $( event.target ).removeClass( "ui-state-active" );
+ }
+ }
+ }
+});
+
+
+/*!
+ * jQuery UI Sortable 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/sortable/
+ */
+
+
+var sortable = $.widget("ui.sortable", $.ui.mouse, {
+ version: "1.11.4",
+ widgetEventPrefix: "sort",
+ ready: false,
+ options: {
+ appendTo: "parent",
+ axis: false,
+ connectWith: false,
+ containment: false,
+ cursor: "auto",
+ cursorAt: false,
+ dropOnEmpty: true,
+ forcePlaceholderSize: false,
+ forceHelperSize: false,
+ grid: false,
+ handle: false,
+ helper: "original",
+ items: "> *",
+ opacity: false,
+ placeholder: false,
+ revert: false,
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ scope: "default",
+ tolerance: "intersect",
+ zIndex: 1000,
+
+ // callbacks
+ activate: null,
+ beforeStop: null,
+ change: null,
+ deactivate: null,
+ out: null,
+ over: null,
+ receive: null,
+ remove: null,
+ sort: null,
+ start: null,
+ stop: null,
+ update: null
+ },
+
+ _isOverAxis: function( x, reference, size ) {
+ return ( x >= reference ) && ( x < ( reference + size ) );
+ },
+
+ _isFloating: function( item ) {
+ return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
+ },
+
+ _create: function() {
+ this.containerCache = {};
+ this.element.addClass("ui-sortable");
+
+ //Get the items
+ this.refresh();
+
+ //Let's determine the parent's offset
+ this.offset = this.element.offset();
+
+ //Initialize mouse events for interaction
+ this._mouseInit();
+
+ this._setHandleClassName();
+
+ //We're ready to go
+ this.ready = true;
+
+ },
+
+ _setOption: function( key, value ) {
+ this._super( key, value );
+
+ if ( key === "handle" ) {
+ this._setHandleClassName();
+ }
+ },
+
+ _setHandleClassName: function() {
+ this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
+ $.each( this.items, function() {
+ ( this.instance.options.handle ?
+ this.item.find( this.instance.options.handle ) : this.item )
+ .addClass( "ui-sortable-handle" );
+ });
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-sortable ui-sortable-disabled" )
+ .find( ".ui-sortable-handle" )
+ .removeClass( "ui-sortable-handle" );
+ this._mouseDestroy();
+
+ for ( var i = this.items.length - 1; i >= 0; i-- ) {
+ this.items[i].item.removeData(this.widgetName + "-item");
+ }
+
+ return this;
+ },
+
+ _mouseCapture: function(event, overrideHandle) {
+ var currentItem = null,
+ validHandle = false,
+ that = this;
+
+ if (this.reverting) {
+ return false;
+ }
+
+ if(this.options.disabled || this.options.type === "static") {
+ return false;
+ }
+
+ //We have to refresh the items data once first
+ this._refreshItems(event);
+
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
+ $(event.target).parents().each(function() {
+ if($.data(this, that.widgetName + "-item") === that) {
+ currentItem = $(this);
+ return false;
+ }
+ });
+ if($.data(event.target, that.widgetName + "-item") === that) {
+ currentItem = $(event.target);
+ }
+
+ if(!currentItem) {
+ return false;
+ }
+ if(this.options.handle && !overrideHandle) {
+ $(this.options.handle, currentItem).find("*").addBack().each(function() {
+ if(this === event.target) {
+ validHandle = true;
+ }
+ });
+ if(!validHandle) {
+ return false;
+ }
+ }
+
+ this.currentItem = currentItem;
+ this._removeCurrentsFromItems();
+ return true;
+
+ },
+
+ _mouseStart: function(event, overrideHandle, noActivation) {
+
+ var i, body,
+ o = this.options;
+
+ this.currentContainer = this;
+
+ //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
+ this.refreshPositions();
+
+ //Create and append the visible helper
+ this.helper = this._createHelper(event);
+
+ //Cache the helper size
+ this._cacheHelperProportions();
+
+ /*
+ * - Position generation -
+ * This block generates everything position related - it's the core of draggables.
+ */
+
+ //Cache the margins of the original element
+ this._cacheMargins();
+
+ //Get the next scrolling parent
+ this.scrollParent = this.helper.scrollParent();
+
+ //The element's absolute position on the page minus margins
+ this.offset = this.currentItem.offset();
+ this.offset = {
+ top: this.offset.top - this.margins.top,
+ left: this.offset.left - this.margins.left
+ };
+
+ $.extend(this.offset, {
+ click: { //Where the click happened, relative to the element
+ left: event.pageX - this.offset.left,
+ top: event.pageY - this.offset.top
+ },
+ parent: this._getParentOffset(),
+ relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+ });
+
+ // Only after we got the offset, we can change the helper's position to absolute
+ // TODO: Still need to figure out a way to make relative sorting possible
+ this.helper.css("position", "absolute");
+ this.cssPosition = this.helper.css("position");
+
+ //Generate the original position
+ this.originalPosition = this._generatePosition(event);
+ this.originalPageX = event.pageX;
+ this.originalPageY = event.pageY;
+
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+ (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+ //Cache the former DOM position
+ this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
+
+ //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
+ if(this.helper[0] !== this.currentItem[0]) {
+ this.currentItem.hide();
+ }
+
+ //Create the placeholder
+ this._createPlaceholder();
+
+ //Set a containment if given in the options
+ if(o.containment) {
+ this._setContainment();
+ }
+
+ if( o.cursor && o.cursor !== "auto" ) { // cursor option
+ body = this.document.find( "body" );
+
+ // support: IE
+ this.storedCursor = body.css( "cursor" );
+ body.css( "cursor", o.cursor );
+
+ this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
+ }
+
+ if(o.opacity) { // opacity option
+ if (this.helper.css("opacity")) {
+ this._storedOpacity = this.helper.css("opacity");
+ }
+ this.helper.css("opacity", o.opacity);
+ }
+
+ if(o.zIndex) { // zIndex option
+ if (this.helper.css("zIndex")) {
+ this._storedZIndex = this.helper.css("zIndex");
+ }
+ this.helper.css("zIndex", o.zIndex);
+ }
+
+ //Prepare scrolling
+ if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
+ this.overflowOffset = this.scrollParent.offset();
+ }
+
+ //Call callbacks
+ this._trigger("start", event, this._uiHash());
+
+ //Recache the helper size
+ if(!this._preserveHelperProportions) {
+ this._cacheHelperProportions();
+ }
+
+
+ //Post "activate" events to possible containers
+ if( !noActivation ) {
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
+ this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
+ }
+ }
+
+ //Prepare possible droppables
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.current = this;
+ }
+
+ if ($.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+
+ this.dragging = true;
+
+ this.helper.addClass("ui-sortable-helper");
+ this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+ return true;
+
+ },
+
+ _mouseDrag: function(event) {
+ var i, item, itemElement, intersection,
+ o = this.options,
+ scrolled = false;
+
+ //Compute the helpers position
+ this.position = this._generatePosition(event);
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ if (!this.lastPositionAbs) {
+ this.lastPositionAbs = this.positionAbs;
+ }
+
+ //Do scrolling
+ if(this.options.scroll) {
+ if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
+
+ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
+ } else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
+ }
+
+ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
+ } else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
+ }
+
+ } else {
+
+ if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
+ scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
+ } else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
+ scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
+ }
+
+ if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
+ scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
+ } else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
+ scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
+ }
+
+ }
+
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+ $.ui.ddmanager.prepareOffsets(this, event);
+ }
+ }
+
+ //Regenerate the absolute position used for position checks
+ this.positionAbs = this._convertPositionTo("absolute");
+
+ //Set the helper position
+ if(!this.options.axis || this.options.axis !== "y") {
+ this.helper[0].style.left = this.position.left+"px";
+ }
+ if(!this.options.axis || this.options.axis !== "x") {
+ this.helper[0].style.top = this.position.top+"px";
+ }
+
+ //Rearrange
+ for (i = this.items.length - 1; i >= 0; i--) {
+
+ //Cache variables and intersection, continue if no intersection
+ item = this.items[i];
+ itemElement = item.item[0];
+ intersection = this._intersectsWithPointer(item);
+ if (!intersection) {
+ continue;
+ }
+
+ // Only put the placeholder inside the current Container, skip all
+ // items from other containers. This works because when moving
+ // an item from one container to another the
+ // currentContainer is switched before the placeholder is moved.
+ //
+ // Without this, moving items in "sub-sortables" can cause
+ // the placeholder to jitter between the outer and inner container.
+ if (item.instance !== this.currentContainer) {
+ continue;
+ }
+
+ // cannot intersect with itself
+ // no useless actions that have been done before
+ // no action if the item moved is the parent of the item checked
+ if (itemElement !== this.currentItem[0] &&
+ this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
+ !$.contains(this.placeholder[0], itemElement) &&
+ (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
+ ) {
+
+ this.direction = intersection === 1 ? "down" : "up";
+
+ if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
+ this._rearrange(event, item);
+ } else {
+ break;
+ }
+
+ this._trigger("change", event, this._uiHash());
+ break;
+ }
+ }
+
+ //Post events to containers
+ this._contactContainers(event);
+
+ //Interconnect with droppables
+ if($.ui.ddmanager) {
+ $.ui.ddmanager.drag(this, event);
+ }
+
+ //Call callbacks
+ this._trigger("sort", event, this._uiHash());
+
+ this.lastPositionAbs = this.positionAbs;
+ return false;
+
+ },
+
+ _mouseStop: function(event, noPropagation) {
+
+ if(!event) {
+ return;
+ }
+
+ //If we are using droppables, inform the manager about the drop
+ if ($.ui.ddmanager && !this.options.dropBehaviour) {
+ $.ui.ddmanager.drop(this, event);
+ }
+
+ if(this.options.revert) {
+ var that = this,
+ cur = this.placeholder.offset(),
+ axis = this.options.axis,
+ animation = {};
+
+ if ( !axis || axis === "x" ) {
+ animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
+ }
+ if ( !axis || axis === "y" ) {
+ animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
+ }
+ this.reverting = true;
+ $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
+ that._clear(event);
+ });
+ } else {
+ this._clear(event, noPropagation);
+ }
+
+ return false;
+
+ },
+
+ cancel: function() {
+
+ if(this.dragging) {
+
+ this._mouseUp({ target: null });
+
+ if(this.options.helper === "original") {
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
+ } else {
+ this.currentItem.show();
+ }
+
+ //Post deactivating events to containers
+ for (var i = this.containers.length - 1; i >= 0; i--){
+ this.containers[i]._trigger("deactivate", null, this._uiHash(this));
+ if(this.containers[i].containerCache.over) {
+ this.containers[i]._trigger("out", null, this._uiHash(this));
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ if (this.placeholder) {
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
+ if(this.placeholder[0].parentNode) {
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
+ }
+ if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
+ this.helper.remove();
+ }
+
+ $.extend(this, {
+ helper: null,
+ dragging: false,
+ reverting: false,
+ _noFinalSort: null
+ });
+
+ if(this.domPosition.prev) {
+ $(this.domPosition.prev).after(this.currentItem);
+ } else {
+ $(this.domPosition.parent).prepend(this.currentItem);
+ }
+ }
+
+ return this;
+
+ },
+
+ serialize: function(o) {
+
+ var items = this._getItemsAsjQuery(o && o.connected),
+ str = [];
+ o = o || {};
+
+ $(items).each(function() {
+ var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
+ if (res) {
+ str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
+ }
+ });
+
+ if(!str.length && o.key) {
+ str.push(o.key + "=");
+ }
+
+ return str.join("&");
+
+ },
+
+ toArray: function(o) {
+
+ var items = this._getItemsAsjQuery(o && o.connected),
+ ret = [];
+
+ o = o || {};
+
+ items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
+ return ret;
+
+ },
+
+ /* Be careful with the following core functions */
+ _intersectsWith: function(item) {
+
+ var x1 = this.positionAbs.left,
+ x2 = x1 + this.helperProportions.width,
+ y1 = this.positionAbs.top,
+ y2 = y1 + this.helperProportions.height,
+ l = item.left,
+ r = l + item.width,
+ t = item.top,
+ b = t + item.height,
+ dyClick = this.offset.click.top,
+ dxClick = this.offset.click.left,
+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
+ isOverElement = isOverElementHeight && isOverElementWidth;
+
+ if ( this.options.tolerance === "pointer" ||
+ this.options.forcePointerForContainers ||
+ (this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
+ ) {
+ return isOverElement;
+ } else {
+
+ return (l < x1 + (this.helperProportions.width / 2) && // Right Half
+ x2 - (this.helperProportions.width / 2) < r && // Left Half
+ t < y1 + (this.helperProportions.height / 2) && // Bottom Half
+ y2 - (this.helperProportions.height / 2) < b ); // Top Half
+
+ }
+ },
+
+ _intersectsWithPointer: function(item) {
+
+ var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
+ isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
+ isOverElement = isOverElementHeight && isOverElementWidth,
+ verticalDirection = this._getDragVerticalDirection(),
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ if (!isOverElement) {
+ return false;
+ }
+
+ return this.floating ?
+ ( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
+ : ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
+
+ },
+
+ _intersectsWithSides: function(item) {
+
+ var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
+ isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
+ verticalDirection = this._getDragVerticalDirection(),
+ horizontalDirection = this._getDragHorizontalDirection();
+
+ if (this.floating && horizontalDirection) {
+ return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
+ } else {
+ return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
+ }
+
+ },
+
+ _getDragVerticalDirection: function() {
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
+ return delta !== 0 && (delta > 0 ? "down" : "up");
+ },
+
+ _getDragHorizontalDirection: function() {
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
+ return delta !== 0 && (delta > 0 ? "right" : "left");
+ },
+
+ refresh: function(event) {
+ this._refreshItems(event);
+ this._setHandleClassName();
+ this.refreshPositions();
+ return this;
+ },
+
+ _connectWith: function() {
+ var options = this.options;
+ return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
+ },
+
+ _getItemsAsjQuery: function(connected) {
+
+ var i, j, cur, inst,
+ items = [],
+ queries = [],
+ connectWith = this._connectWith();
+
+ if(connectWith && connected) {
+ for (i = connectWith.length - 1; i >= 0; i--){
+ cur = $(connectWith[i], this.document[0]);
+ for ( j = cur.length - 1; j >= 0; j--){
+ inst = $.data(cur[j], this.widgetFullName);
+ if(inst && inst !== this && !inst.options.disabled) {
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
+ }
+ }
+ }
+ }
+
+ queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
+
+ function addItems() {
+ items.push( this );
+ }
+ for (i = queries.length - 1; i >= 0; i--){
+ queries[i][0].each( addItems );
+ }
+
+ return $(items);
+
+ },
+
+ _removeCurrentsFromItems: function() {
+
+ var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
+
+ this.items = $.grep(this.items, function (item) {
+ for (var j=0; j < list.length; j++) {
+ if(list[j] === item.item[0]) {
+ return false;
+ }
+ }
+ return true;
+ });
+
+ },
+
+ _refreshItems: function(event) {
+
+ this.items = [];
+ this.containers = [this];
+
+ var i, j, cur, inst, targetData, _queries, item, queriesLength,
+ items = this.items,
+ queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
+ connectWith = this._connectWith();
+
+ if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
+ for (i = connectWith.length - 1; i >= 0; i--){
+ cur = $(connectWith[i], this.document[0]);
+ for (j = cur.length - 1; j >= 0; j--){
+ inst = $.data(cur[j], this.widgetFullName);
+ if(inst && inst !== this && !inst.options.disabled) {
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
+ this.containers.push(inst);
+ }
+ }
+ }
+ }
+
+ for (i = queries.length - 1; i >= 0; i--) {
+ targetData = queries[i][1];
+ _queries = queries[i][0];
+
+ for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
+ item = $(_queries[j]);
+
+ item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
+
+ items.push({
+ item: item,
+ instance: targetData,
+ width: 0, height: 0,
+ left: 0, top: 0
+ });
+ }
+ }
+
+ },
+
+ refreshPositions: function(fast) {
+
+ // Determine whether items are being displayed horizontally
+ this.floating = this.items.length ?
+ this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
+ false;
+
+ //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
+ if(this.offsetParent && this.helper) {
+ this.offset.parent = this._getParentOffset();
+ }
+
+ var i, item, t, p;
+
+ for (i = this.items.length - 1; i >= 0; i--){
+ item = this.items[i];
+
+ //We ignore calculating positions of all connected containers when we're not over them
+ if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
+ continue;
+ }
+
+ t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
+
+ if (!fast) {
+ item.width = t.outerWidth();
+ item.height = t.outerHeight();
+ }
+
+ p = t.offset();
+ item.left = p.left;
+ item.top = p.top;
+ }
+
+ if(this.options.custom && this.options.custom.refreshContainers) {
+ this.options.custom.refreshContainers.call(this);
+ } else {
+ for (i = this.containers.length - 1; i >= 0; i--){
+ p = this.containers[i].element.offset();
+ this.containers[i].containerCache.left = p.left;
+ this.containers[i].containerCache.top = p.top;
+ this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
+ this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
+ }
+ }
+
+ return this;
+ },
+
+ _createPlaceholder: function(that) {
+ that = that || this;
+ var className,
+ o = that.options;
+
+ if(!o.placeholder || o.placeholder.constructor === String) {
+ className = o.placeholder;
+ o.placeholder = {
+ element: function() {
+
+ var nodeName = that.currentItem[0].nodeName.toLowerCase(),
+ element = $( "<" + nodeName + ">", that.document[0] )
+ .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
+ .removeClass("ui-sortable-helper");
+
+ if ( nodeName === "tbody" ) {
+ that._createTrPlaceholder(
+ that.currentItem.find( "tr" ).eq( 0 ),
+ $( "<tr>", that.document[ 0 ] ).appendTo( element )
+ );
+ } else if ( nodeName === "tr" ) {
+ that._createTrPlaceholder( that.currentItem, element );
+ } else if ( nodeName === "img" ) {
+ element.attr( "src", that.currentItem.attr( "src" ) );
+ }
+
+ if ( !className ) {
+ element.css( "visibility", "hidden" );
+ }
+
+ return element;
+ },
+ update: function(container, p) {
+
+ // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
+ if(className && !o.forcePlaceholderSize) {
+ return;
+ }
+
+ //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
+ if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
+ if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
+ }
+ };
+ }
+
+ //Create the placeholder
+ that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
+
+ //Append it after the actual current item
+ that.currentItem.after(that.placeholder);
+
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
+ o.placeholder.update(that, that.placeholder);
+
+ },
+
+ _createTrPlaceholder: function( sourceTr, targetTr ) {
+ var that = this;
+
+ sourceTr.children().each(function() {
+ $( "<td>&#160;</td>", that.document[ 0 ] )
+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
+ .appendTo( targetTr );
+ });
+ },
+
+ _contactContainers: function(event) {
+ var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
+ innermostContainer = null,
+ innermostIndex = null;
+
+ // get innermost container that intersects with item
+ for (i = this.containers.length - 1; i >= 0; i--) {
+
+ // never consider a container that's located within the item itself
+ if($.contains(this.currentItem[0], this.containers[i].element[0])) {
+ continue;
+ }
+
+ if(this._intersectsWith(this.containers[i].containerCache)) {
+
+ // if we've already found a container and it's more "inner" than this, then continue
+ if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
+ continue;
+ }
+
+ innermostContainer = this.containers[i];
+ innermostIndex = i;
+
+ } else {
+ // container doesn't intersect. trigger "out" event if necessary
+ if(this.containers[i].containerCache.over) {
+ this.containers[i]._trigger("out", event, this._uiHash(this));
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ }
+
+ // if no intersecting containers found, return
+ if(!innermostContainer) {
+ return;
+ }
+
+ // move the item into the container if it's not there already
+ if(this.containers.length === 1) {
+ if (!this.containers[innermostIndex].containerCache.over) {
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
+ this.containers[innermostIndex].containerCache.over = 1;
+ }
+ } else {
+
+ //When entering a new container, we will find the item with the least distance and append our item near it
+ dist = 10000;
+ itemWithLeastDistance = null;
+ floating = innermostContainer.floating || this._isFloating(this.currentItem);
+ posProperty = floating ? "left" : "top";
+ sizeProperty = floating ? "width" : "height";
+ axis = floating ? "clientX" : "clientY";
+
+ for (j = this.items.length - 1; j >= 0; j--) {
+ if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
+ continue;
+ }
+ if(this.items[j].item[0] === this.currentItem[0]) {
+ continue;
+ }
+
+ cur = this.items[j].item.offset()[posProperty];
+ nearBottom = false;
+ if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
+ nearBottom = true;
+ }
+
+ if ( Math.abs( event[ axis ] - cur ) < dist ) {
+ dist = Math.abs( event[ axis ] - cur );
+ itemWithLeastDistance = this.items[ j ];
+ this.direction = nearBottom ? "up": "down";
+ }
+ }
+
+ //Check if dropOnEmpty is enabled
+ if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
+ return;
+ }
+
+ if(this.currentContainer === this.containers[innermostIndex]) {
+ if ( !this.currentContainer.containerCache.over ) {
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
+ this.currentContainer.containerCache.over = 1;
+ }
+ return;
+ }
+
+ itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
+ this._trigger("change", event, this._uiHash());
+ this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
+ this.currentContainer = this.containers[innermostIndex];
+
+ //Update the placeholder
+ this.options.placeholder.update(this.currentContainer, this.placeholder);
+
+ this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
+ this.containers[innermostIndex].containerCache.over = 1;
+ }
+
+
+ },
+
+ _createHelper: function(event) {
+
+ var o = this.options,
+ helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
+
+ //Add the helper to the DOM if that didn't happen already
+ if(!helper.parents("body").length) {
+ $(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
+ }
+
+ if(helper[0] === this.currentItem[0]) {
+ this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
+ }
+
+ if(!helper[0].style.width || o.forceHelperSize) {
+ helper.width(this.currentItem.width());
+ }
+ if(!helper[0].style.height || o.forceHelperSize) {
+ helper.height(this.currentItem.height());
+ }
+
+ return helper;
+
+ },
+
+ _adjustOffsetFromHelper: function(obj) {
+ if (typeof obj === "string") {
+ obj = obj.split(" ");
+ }
+ if ($.isArray(obj)) {
+ obj = {left: +obj[0], top: +obj[1] || 0};
+ }
+ if ("left" in obj) {
+ this.offset.click.left = obj.left + this.margins.left;
+ }
+ if ("right" in obj) {
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+ }
+ if ("top" in obj) {
+ this.offset.click.top = obj.top + this.margins.top;
+ }
+ if ("bottom" in obj) {
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+ }
+ },
+
+ _getParentOffset: function() {
+
+
+ //Get the offsetParent and cache its position
+ this.offsetParent = this.helper.offsetParent();
+ var po = this.offsetParent.offset();
+
+ // This is a special case where we need to modify a offset calculated on start, since the following happened:
+ // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+ // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+ if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+ po.left += this.scrollParent.scrollLeft();
+ po.top += this.scrollParent.scrollTop();
+ }
+
+ // This needs to be actually done for all browsers, since pageX/pageY includes this information
+ // with an ugly IE fix
+ if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
+ po = { top: 0, left: 0 };
+ }
+
+ return {
+ top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+ left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+ };
+
+ },
+
+ _getRelativeOffset: function() {
+
+ if(this.cssPosition === "relative") {
+ var p = this.currentItem.position();
+ return {
+ top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+ left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+ };
+ } else {
+ return { top: 0, left: 0 };
+ }
+
+ },
+
+ _cacheMargins: function() {
+ this.margins = {
+ left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
+ top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
+ };
+ },
+
+ _cacheHelperProportions: function() {
+ this.helperProportions = {
+ width: this.helper.outerWidth(),
+ height: this.helper.outerHeight()
+ };
+ },
+
+ _setContainment: function() {
+
+ var ce, co, over,
+ o = this.options;
+ if(o.containment === "parent") {
+ o.containment = this.helper[0].parentNode;
+ }
+ if(o.containment === "document" || o.containment === "window") {
+ this.containment = [
+ 0 - this.offset.relative.left - this.offset.parent.left,
+ 0 - this.offset.relative.top - this.offset.parent.top,
+ o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
+ (o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ if(!(/^(document|window|parent)$/).test(o.containment)) {
+ ce = $(o.containment)[0];
+ co = $(o.containment).offset();
+ over = ($(ce).css("overflow") !== "hidden");
+
+ this.containment = [
+ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
+ co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
+ co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
+ co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
+ ];
+ }
+
+ },
+
+ _convertPositionTo: function(d, pos) {
+
+ if(!pos) {
+ pos = this.position;
+ }
+ var mod = d === "absolute" ? 1 : -1,
+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
+ scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ return {
+ top: (
+ pos.top + // The absolute mouse position
+ this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+ ),
+ left: (
+ pos.left + // The absolute mouse position
+ this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+ )
+ };
+
+ },
+
+ _generatePosition: function(event) {
+
+ var top, left,
+ o = this.options,
+ pageX = event.pageX,
+ pageY = event.pageY,
+ scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+
+ // This is another very weird special case that only happens for relative elements:
+ // 1. If the css position is relative
+ // 2. and the scroll parent is the document or similar to the offset parent
+ // we have to refresh the relative offset during the scroll so there are no jumps
+ if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
+ this.offset.relative = this._getRelativeOffset();
+ }
+
+ /*
+ * - Position constraining -
+ * Constrain the position to a mix of grid, containment.
+ */
+
+ if(this.originalPosition) { //If we are not dragging yet, we won't check for options
+
+ if(this.containment) {
+ if(event.pageX - this.offset.click.left < this.containment[0]) {
+ pageX = this.containment[0] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top < this.containment[1]) {
+ pageY = this.containment[1] + this.offset.click.top;
+ }
+ if(event.pageX - this.offset.click.left > this.containment[2]) {
+ pageX = this.containment[2] + this.offset.click.left;
+ }
+ if(event.pageY - this.offset.click.top > this.containment[3]) {
+ pageY = this.containment[3] + this.offset.click.top;
+ }
+ }
+
+ if(o.grid) {
+ top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+ pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+ left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+ pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+ }
+
+ }
+
+ return {
+ top: (
+ pageY - // The absolute mouse position
+ this.offset.click.top - // Click offset (relative to the element)
+ this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+ ),
+ left: (
+ pageX - // The absolute mouse position
+ this.offset.click.left - // Click offset (relative to the element)
+ this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
+ this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
+ ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+ )
+ };
+
+ },
+
+ _rearrange: function(event, i, a, hardRefresh) {
+
+ a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
+
+ //Various things done here to improve the performance:
+ // 1. we create a setTimeout, that calls refreshPositions
+ // 2. on the instance, we have a counter variable, that get's higher after every append
+ // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
+ // 4. this lets only the last addition to the timeout stack through
+ this.counter = this.counter ? ++this.counter : 1;
+ var counter = this.counter;
+
+ this._delay(function() {
+ if(counter === this.counter) {
+ this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
+ }
+ });
+
+ },
+
+ _clear: function(event, noPropagation) {
+
+ this.reverting = false;
+ // We delay all events that have to be triggered to after the point where the placeholder has been removed and
+ // everything else normalized again
+ var i,
+ delayedTriggers = [];
+
+ // We first have to update the dom position of the actual currentItem
+ // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
+ if(!this._noFinalSort && this.currentItem.parent().length) {
+ this.placeholder.before(this.currentItem);
+ }
+ this._noFinalSort = null;
+
+ if(this.helper[0] === this.currentItem[0]) {
+ for(i in this._storedCSS) {
+ if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
+ this._storedCSS[i] = "";
+ }
+ }
+ this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
+ } else {
+ this.currentItem.show();
+ }
+
+ if(this.fromOutside && !noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
+ }
+ if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
+ }
+
+ // Check if the items Container has Changed and trigger appropriate
+ // events.
+ if (this !== this.currentContainer) {
+ if(!noPropagation) {
+ delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
+ delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.currentContainer));
+ }
+ }
+
+
+ //Post events to containers
+ function delayEvent( type, instance, container ) {
+ return function( event ) {
+ container._trigger( type, event, instance._uiHash( instance ) );
+ };
+ }
+ for (i = this.containers.length - 1; i >= 0; i--){
+ if (!noPropagation) {
+ delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
+ }
+ if(this.containers[i].containerCache.over) {
+ delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
+ this.containers[i].containerCache.over = 0;
+ }
+ }
+
+ //Do what was originally in plugins
+ if ( this.storedCursor ) {
+ this.document.find( "body" ).css( "cursor", this.storedCursor );
+ this.storedStylesheet.remove();
+ }
+ if(this._storedOpacity) {
+ this.helper.css("opacity", this._storedOpacity);
+ }
+ if(this._storedZIndex) {
+ this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
+ }
+
+ this.dragging = false;
+
+ if(!noPropagation) {
+ this._trigger("beforeStop", event, this._uiHash());
+ }
+
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
+ this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
+
+ if ( !this.cancelHelperRemoval ) {
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
+ this.helper.remove();
+ }
+ this.helper = null;
+ }
+
+ if(!noPropagation) {
+ for (i=0; i < delayedTriggers.length; i++) {
+ delayedTriggers[i].call(this, event);
+ } //Trigger all delayed events
+ this._trigger("stop", event, this._uiHash());
+ }
+
+ this.fromOutside = false;
+ return !this.cancelHelperRemoval;
+
+ },
+
+ _trigger: function() {
+ if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
+ this.cancel();
+ }
+ },
+
+ _uiHash: function(_inst) {
+ var inst = _inst || this;
+ return {
+ helper: inst.helper,
+ placeholder: inst.placeholder || $([]),
+ position: inst.position,
+ originalPosition: inst.originalPosition,
+ offset: inst.positionAbs,
+ item: inst.currentItem,
+ sender: _inst ? _inst.element : null
+ };
+ }
+
+});
+
+
+/*!
+ * jQuery UI Spinner 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/spinner/
+ */
+
+
+function spinner_modifier( fn ) {
+ return function() {
+ var previous = this.element.val();
+ fn.apply( this, arguments );
+ this._refresh();
+ if ( previous !== this.element.val() ) {
+ this._trigger( "change" );
+ }
+ };
+}
+
+var spinner = $.widget( "ui.spinner", {
+ version: "1.11.4",
+ defaultElement: "<input>",
+ widgetEventPrefix: "spin",
+ options: {
+ culture: null,
+ icons: {
+ down: "ui-icon-triangle-1-s",
+ up: "ui-icon-triangle-1-n"
+ },
+ incremental: true,
+ max: null,
+ min: null,
+ numberFormat: null,
+ page: 10,
+ step: 1,
+
+ change: null,
+ spin: null,
+ start: null,
+ stop: null
+ },
+
+ _create: function() {
+ // handle string values that need to be parsed
+ this._setOption( "max", this.options.max );
+ this._setOption( "min", this.options.min );
+ this._setOption( "step", this.options.step );
+
+ // Only format if there is a value, prevents the field from being marked
+ // as invalid in Firefox, see #9573.
+ if ( this.value() !== "" ) {
+ // Format the value, but don't constrain.
+ this._value( this.element.val(), true );
+ }
+
+ this._draw();
+ this._on( this._events );
+ this._refresh();
+
+ // turning off autocomplete prevents the browser from remembering the
+ // value when navigating through history, so we re-enable autocomplete
+ // if the page is unloaded before the widget is destroyed. #7790
+ this._on( this.window, {
+ beforeunload: function() {
+ this.element.removeAttr( "autocomplete" );
+ }
+ });
+ },
+
+ _getCreateOptions: function() {
+ var options = {},
+ element = this.element;
+
+ $.each( [ "min", "max", "step" ], function( i, option ) {
+ var value = element.attr( option );
+ if ( value !== undefined && value.length ) {
+ options[ option ] = value;
+ }
+ });
+
+ return options;
+ },
+
+ _events: {
+ keydown: function( event ) {
+ if ( this._start( event ) && this._keydown( event ) ) {
+ event.preventDefault();
+ }
+ },
+ keyup: "_stop",
+ focus: function() {
+ this.previous = this.element.val();
+ },
+ blur: function( event ) {
+ if ( this.cancelBlur ) {
+ delete this.cancelBlur;
+ return;
+ }
+
+ this._stop();
+ this._refresh();
+ if ( this.previous !== this.element.val() ) {
+ this._trigger( "change", event );
+ }
+ },
+ mousewheel: function( event, delta ) {
+ if ( !delta ) {
+ return;
+ }
+ if ( !this.spinning && !this._start( event ) ) {
+ return false;
+ }
+
+ this._spin( (delta > 0 ? 1 : -1) * this.options.step, event );
+ clearTimeout( this.mousewheelTimer );
+ this.mousewheelTimer = this._delay(function() {
+ if ( this.spinning ) {
+ this._stop( event );
+ }
+ }, 100 );
+ event.preventDefault();
+ },
+ "mousedown .ui-spinner-button": function( event ) {
+ var previous;
+
+ // We never want the buttons to have focus; whenever the user is
+ // interacting with the spinner, the focus should be on the input.
+ // If the input is focused then this.previous is properly set from
+ // when the input first received focus. If the input is not focused
+ // then we need to set this.previous based on the value before spinning.
+ previous = this.element[0] === this.document[0].activeElement ?
+ this.previous : this.element.val();
+ function checkFocus() {
+ var isActive = this.element[0] === this.document[0].activeElement;
+ if ( !isActive ) {
+ this.element.focus();
+ this.previous = previous;
+ // support: IE
+ // IE sets focus asynchronously, so we need to check if focus
+ // moved off of the input because the user clicked on the button.
+ this._delay(function() {
+ this.previous = previous;
+ });
+ }
+ }
+
+ // ensure focus is on (or stays on) the text field
+ event.preventDefault();
+ checkFocus.call( this );
+
+ // support: IE
+ // IE doesn't prevent moving focus even with event.preventDefault()
+ // so we set a flag to know when we should ignore the blur event
+ // and check (again) if focus moved off of the input.
+ this.cancelBlur = true;
+ this._delay(function() {
+ delete this.cancelBlur;
+ checkFocus.call( this );
+ });
+
+ if ( this._start( event ) === false ) {
+ return;
+ }
+
+ this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
+ },
+ "mouseup .ui-spinner-button": "_stop",
+ "mouseenter .ui-spinner-button": function( event ) {
+ // button will add ui-state-active if mouse was down while mouseleave and kept down
+ if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) {
+ return;
+ }
+
+ if ( this._start( event ) === false ) {
+ return false;
+ }
+ this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
+ },
+ // TODO: do we really want to consider this a stop?
+ // shouldn't we just stop the repeater and wait until mouseup before
+ // we trigger the stop event?
+ "mouseleave .ui-spinner-button": "_stop"
+ },
+
+ _draw: function() {
+ var uiSpinner = this.uiSpinner = this.element
+ .addClass( "ui-spinner-input" )
+ .attr( "autocomplete", "off" )
+ .wrap( this._uiSpinnerHtml() )
+ .parent()
+ // add buttons
+ .append( this._buttonHtml() );
+
+ this.element.attr( "role", "spinbutton" );
+
+ // button bindings
+ this.buttons = uiSpinner.find( ".ui-spinner-button" )
+ .attr( "tabIndex", -1 )
+ .button()
+ .removeClass( "ui-corner-all" );
+
+ // IE 6 doesn't understand height: 50% for the buttons
+ // unless the wrapper has an explicit height
+ if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
+ uiSpinner.height() > 0 ) {
+ uiSpinner.height( uiSpinner.height() );
+ }
+
+ // disable spinner if element was already disabled
+ if ( this.options.disabled ) {
+ this.disable();
+ }
+ },
+
+ _keydown: function( event ) {
+ var options = this.options,
+ keyCode = $.ui.keyCode;
+
+ switch ( event.keyCode ) {
+ case keyCode.UP:
+ this._repeat( null, 1, event );
+ return true;
+ case keyCode.DOWN:
+ this._repeat( null, -1, event );
+ return true;
+ case keyCode.PAGE_UP:
+ this._repeat( null, options.page, event );
+ return true;
+ case keyCode.PAGE_DOWN:
+ this._repeat( null, -options.page, event );
+ return true;
+ }
+
+ return false;
+ },
+
+ _uiSpinnerHtml: function() {
+ return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
+ },
+
+ _buttonHtml: function() {
+ return "" +
+ "<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
+ "<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
+ "</a>" +
+ "<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
+ "<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
+ "</a>";
+ },
+
+ _start: function( event ) {
+ if ( !this.spinning && this._trigger( "start", event ) === false ) {
+ return false;
+ }
+
+ if ( !this.counter ) {
+ this.counter = 1;
+ }
+ this.spinning = true;
+ return true;
+ },
+
+ _repeat: function( i, steps, event ) {
+ i = i || 500;
+
+ clearTimeout( this.timer );
+ this.timer = this._delay(function() {
+ this._repeat( 40, steps, event );
+ }, i );
+
+ this._spin( steps * this.options.step, event );
+ },
+
+ _spin: function( step, event ) {
+ var value = this.value() || 0;
+
+ if ( !this.counter ) {
+ this.counter = 1;
+ }
+
+ value = this._adjustValue( value + step * this._increment( this.counter ) );
+
+ if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false) {
+ this._value( value );
+ this.counter++;
+ }
+ },
+
+ _increment: function( i ) {
+ var incremental = this.options.incremental;
+
+ if ( incremental ) {
+ return $.isFunction( incremental ) ?
+ incremental( i ) :
+ Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
+ }
+
+ return 1;
+ },
+
+ _precision: function() {
+ var precision = this._precisionOf( this.options.step );
+ if ( this.options.min !== null ) {
+ precision = Math.max( precision, this._precisionOf( this.options.min ) );
+ }
+ return precision;
+ },
+
+ _precisionOf: function( num ) {
+ var str = num.toString(),
+ decimal = str.indexOf( "." );
+ return decimal === -1 ? 0 : str.length - decimal - 1;
+ },
+
+ _adjustValue: function( value ) {
+ var base, aboveMin,
+ options = this.options;
+
+ // make sure we're at a valid step
+ // - find out where we are relative to the base (min or 0)
+ base = options.min !== null ? options.min : 0;
+ aboveMin = value - base;
+ // - round to the nearest step
+ aboveMin = Math.round(aboveMin / options.step) * options.step;
+ // - rounding is based on 0, so adjust back to our base
+ value = base + aboveMin;
+
+ // fix precision from bad JS floating point math
+ value = parseFloat( value.toFixed( this._precision() ) );
+
+ // clamp the value
+ if ( options.max !== null && value > options.max) {
+ return options.max;
+ }
+ if ( options.min !== null && value < options.min ) {
+ return options.min;
+ }
+
+ return value;
+ },
+
+ _stop: function( event ) {
+ if ( !this.spinning ) {
+ return;
+ }
+
+ clearTimeout( this.timer );
+ clearTimeout( this.mousewheelTimer );
+ this.counter = 0;
+ this.spinning = false;
+ this._trigger( "stop", event );
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "culture" || key === "numberFormat" ) {
+ var prevValue = this._parse( this.element.val() );
+ this.options[ key ] = value;
+ this.element.val( this._format( prevValue ) );
+ return;
+ }
+
+ if ( key === "max" || key === "min" || key === "step" ) {
+ if ( typeof value === "string" ) {
+ value = this._parse( value );
+ }
+ }
+ if ( key === "icons" ) {
+ this.buttons.first().find( ".ui-icon" )
+ .removeClass( this.options.icons.up )
+ .addClass( value.up );
+ this.buttons.last().find( ".ui-icon" )
+ .removeClass( this.options.icons.down )
+ .addClass( value.down );
+ }
+
+ this._super( key, value );
+
+ if ( key === "disabled" ) {
+ this.widget().toggleClass( "ui-state-disabled", !!value );
+ this.element.prop( "disabled", !!value );
+ this.buttons.button( value ? "disable" : "enable" );
+ }
+ },
+
+ _setOptions: spinner_modifier(function( options ) {
+ this._super( options );
+ }),
+
+ _parse: function( val ) {
+ if ( typeof val === "string" && val !== "" ) {
+ val = window.Globalize && this.options.numberFormat ?
+ Globalize.parseFloat( val, 10, this.options.culture ) : +val;
+ }
+ return val === "" || isNaN( val ) ? null : val;
+ },
+
+ _format: function( value ) {
+ if ( value === "" ) {
+ return "";
+ }
+ return window.Globalize && this.options.numberFormat ?
+ Globalize.format( value, this.options.numberFormat, this.options.culture ) :
+ value;
+ },
+
+ _refresh: function() {
+ this.element.attr({
+ "aria-valuemin": this.options.min,
+ "aria-valuemax": this.options.max,
+ // TODO: what should we do with values that can't be parsed?
+ "aria-valuenow": this._parse( this.element.val() )
+ });
+ },
+
+ isValid: function() {
+ var value = this.value();
+
+ // null is invalid
+ if ( value === null ) {
+ return false;
+ }
+
+ // if value gets adjusted, it's invalid
+ return value === this._adjustValue( value );
+ },
+
+ // update the value without triggering change
+ _value: function( value, allowAny ) {
+ var parsed;
+ if ( value !== "" ) {
+ parsed = this._parse( value );
+ if ( parsed !== null ) {
+ if ( !allowAny ) {
+ parsed = this._adjustValue( parsed );
+ }
+ value = this._format( parsed );
+ }
+ }
+ this.element.val( value );
+ this._refresh();
+ },
+
+ _destroy: function() {
+ this.element
+ .removeClass( "ui-spinner-input" )
+ .prop( "disabled", false )
+ .removeAttr( "autocomplete" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
+ this.uiSpinner.replaceWith( this.element );
+ },
+
+ stepUp: spinner_modifier(function( steps ) {
+ this._stepUp( steps );
+ }),
+ _stepUp: function( steps ) {
+ if ( this._start() ) {
+ this._spin( (steps || 1) * this.options.step );
+ this._stop();
+ }
+ },
+
+ stepDown: spinner_modifier(function( steps ) {
+ this._stepDown( steps );
+ }),
+ _stepDown: function( steps ) {
+ if ( this._start() ) {
+ this._spin( (steps || 1) * -this.options.step );
+ this._stop();
+ }
+ },
+
+ pageUp: spinner_modifier(function( pages ) {
+ this._stepUp( (pages || 1) * this.options.page );
+ }),
+
+ pageDown: spinner_modifier(function( pages ) {
+ this._stepDown( (pages || 1) * this.options.page );
+ }),
+
+ value: function( newVal ) {
+ if ( !arguments.length ) {
+ return this._parse( this.element.val() );
+ }
+ spinner_modifier( this._value ).call( this, newVal );
+ },
+
+ widget: function() {
+ return this.uiSpinner;
+ }
+});
+
+
+/*!
+ * jQuery UI Tabs 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/tabs/
+ */
+
+
+var tabs = $.widget( "ui.tabs", {
+ version: "1.11.4",
+ delay: 300,
+ options: {
+ active: null,
+ collapsible: false,
+ event: "click",
+ heightStyle: "content",
+ hide: null,
+ show: null,
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ beforeLoad: null,
+ load: null
+ },
+
+ _isLocal: (function() {
+ var rhash = /#.*$/;
+
+ return function( anchor ) {
+ var anchorUrl, locationUrl;
+
+ // support: IE7
+ // IE7 doesn't normalize the href property when set via script (#9317)
+ anchor = anchor.cloneNode( false );
+
+ anchorUrl = anchor.href.replace( rhash, "" );
+ locationUrl = location.href.replace( rhash, "" );
+
+ // decoding may throw an error if the URL isn't UTF-8 (#9518)
+ try {
+ anchorUrl = decodeURIComponent( anchorUrl );
+ } catch ( error ) {}
+ try {
+ locationUrl = decodeURIComponent( locationUrl );
+ } catch ( error ) {}
+
+ return anchor.hash.length > 1 && anchorUrl === locationUrl;
+ };
+ })(),
+
+ _create: function() {
+ var that = this,
+ options = this.options;
+
+ this.running = false;
+
+ this.element
+ .addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
+ .toggleClass( "ui-tabs-collapsible", options.collapsible );
+
+ this._processTabs();
+ options.active = this._initialActive();
+
+ // Take disabling tabs via class attribute from HTML
+ // into account and update option properly.
+ if ( $.isArray( options.disabled ) ) {
+ options.disabled = $.unique( options.disabled.concat(
+ $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
+ return that.tabs.index( li );
+ })
+ ) ).sort();
+ }
+
+ // check for length avoids error when initializing empty list
+ if ( this.options.active !== false && this.anchors.length ) {
+ this.active = this._findActive( options.active );
+ } else {
+ this.active = $();
+ }
+
+ this._refresh();
+
+ if ( this.active.length ) {
+ this.load( options.active );
+ }
+ },
+
+ _initialActive: function() {
+ var active = this.options.active,
+ collapsible = this.options.collapsible,
+ locationHash = location.hash.substring( 1 );
+
+ if ( active === null ) {
+ // check the fragment identifier in the URL
+ if ( locationHash ) {
+ this.tabs.each(function( i, tab ) {
+ if ( $( tab ).attr( "aria-controls" ) === locationHash ) {
+ active = i;
+ return false;
+ }
+ });
+ }
+
+ // check for a tab marked active via a class
+ if ( active === null ) {
+ active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
+ }
+
+ // no active tab, set to false
+ if ( active === null || active === -1 ) {
+ active = this.tabs.length ? 0 : false;
+ }
+ }
+
+ // handle numbers: negative, out of range
+ if ( active !== false ) {
+ active = this.tabs.index( this.tabs.eq( active ) );
+ if ( active === -1 ) {
+ active = collapsible ? false : 0;
+ }
+ }
+
+ // don't allow collapsible: false and active: false
+ if ( !collapsible && active === false && this.anchors.length ) {
+ active = 0;
+ }
+
+ return active;
+ },
+
+ _getCreateEventData: function() {
+ return {
+ tab: this.active,
+ panel: !this.active.length ? $() : this._getPanelForTab( this.active )
+ };
+ },
+
+ _tabKeydown: function( event ) {
+ var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
+ selectedIndex = this.tabs.index( focusedTab ),
+ goingForward = true;
+
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ switch ( event.keyCode ) {
+ case $.ui.keyCode.RIGHT:
+ case $.ui.keyCode.DOWN:
+ selectedIndex++;
+ break;
+ case $.ui.keyCode.UP:
+ case $.ui.keyCode.LEFT:
+ goingForward = false;
+ selectedIndex--;
+ break;
+ case $.ui.keyCode.END:
+ selectedIndex = this.anchors.length - 1;
+ break;
+ case $.ui.keyCode.HOME:
+ selectedIndex = 0;
+ break;
+ case $.ui.keyCode.SPACE:
+ // Activate only, no collapsing
+ event.preventDefault();
+ clearTimeout( this.activating );
+ this._activate( selectedIndex );
+ return;
+ case $.ui.keyCode.ENTER:
+ // Toggle (cancel delayed activation, allow collapsing)
+ event.preventDefault();
+ clearTimeout( this.activating );
+ // Determine if we should collapse or activate
+ this._activate( selectedIndex === this.options.active ? false : selectedIndex );
+ return;
+ default:
+ return;
+ }
+
+ // Focus the appropriate tab, based on which key was pressed
+ event.preventDefault();
+ clearTimeout( this.activating );
+ selectedIndex = this._focusNextTab( selectedIndex, goingForward );
+
+ // Navigating with control/command key will prevent automatic activation
+ if ( !event.ctrlKey && !event.metaKey ) {
+
+ // Update aria-selected immediately so that AT think the tab is already selected.
+ // Otherwise AT may confuse the user by stating that they need to activate the tab,
+ // but the tab will already be activated by the time the announcement finishes.
+ focusedTab.attr( "aria-selected", "false" );
+ this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" );
+
+ this.activating = this._delay(function() {
+ this.option( "active", selectedIndex );
+ }, this.delay );
+ }
+ },
+
+ _panelKeydown: function( event ) {
+ if ( this._handlePageNav( event ) ) {
+ return;
+ }
+
+ // Ctrl+up moves focus to the current tab
+ if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
+ event.preventDefault();
+ this.active.focus();
+ }
+ },
+
+ // Alt+page up/down moves focus to the previous/next tab (and activates)
+ _handlePageNav: function( event ) {
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
+ this._activate( this._focusNextTab( this.options.active - 1, false ) );
+ return true;
+ }
+ if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
+ this._activate( this._focusNextTab( this.options.active + 1, true ) );
+ return true;
+ }
+ },
+
+ _findNextTab: function( index, goingForward ) {
+ var lastTabIndex = this.tabs.length - 1;
+
+ function constrain() {
+ if ( index > lastTabIndex ) {
+ index = 0;
+ }
+ if ( index < 0 ) {
+ index = lastTabIndex;
+ }
+ return index;
+ }
+
+ while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) {
+ index = goingForward ? index + 1 : index - 1;
+ }
+
+ return index;
+ },
+
+ _focusNextTab: function( index, goingForward ) {
+ index = this._findNextTab( index, goingForward );
+ this.tabs.eq( index ).focus();
+ return index;
+ },
+
+ _setOption: function( key, value ) {
+ if ( key === "active" ) {
+ // _activate() will handle invalid values and update this.options
+ this._activate( value );
+ return;
+ }
+
+ if ( key === "disabled" ) {
+ // don't use the widget factory's disabled handling
+ this._setupDisabled( value );
+ return;
+ }
+
+ this._super( key, value);
+
+ if ( key === "collapsible" ) {
+ this.element.toggleClass( "ui-tabs-collapsible", value );
+ // Setting collapsible: false while collapsed; open first panel
+ if ( !value && this.options.active === false ) {
+ this._activate( 0 );
+ }
+ }
+
+ if ( key === "event" ) {
+ this._setupEvents( value );
+ }
+
+ if ( key === "heightStyle" ) {
+ this._setupHeightStyle( value );
+ }
+ },
+
+ _sanitizeSelector: function( hash ) {
+ return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
+ },
+
+ refresh: function() {
+ var options = this.options,
+ lis = this.tablist.children( ":has(a[href])" );
+
+ // get disabled tabs from class attribute from HTML
+ // this will get converted to a boolean if needed in _refresh()
+ options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
+ return lis.index( tab );
+ });
+
+ this._processTabs();
+
+ // was collapsed or no tabs
+ if ( options.active === false || !this.anchors.length ) {
+ options.active = false;
+ this.active = $();
+ // was active, but active tab is gone
+ } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) {
+ // all remaining tabs are disabled
+ if ( this.tabs.length === options.disabled.length ) {
+ options.active = false;
+ this.active = $();
+ // activate previous tab
+ } else {
+ this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) );
+ }
+ // was active, active tab still exists
+ } else {
+ // make sure active index is correct
+ options.active = this.tabs.index( this.active );
+ }
+
+ this._refresh();
+ },
+
+ _refresh: function() {
+ this._setupDisabled( this.options.disabled );
+ this._setupEvents( this.options.event );
+ this._setupHeightStyle( this.options.heightStyle );
+
+ this.tabs.not( this.active ).attr({
+ "aria-selected": "false",
+ "aria-expanded": "false",
+ tabIndex: -1
+ });
+ this.panels.not( this._getPanelForTab( this.active ) )
+ .hide()
+ .attr({
+ "aria-hidden": "true"
+ });
+
+ // Make sure one tab is in the tab order
+ if ( !this.active.length ) {
+ this.tabs.eq( 0 ).attr( "tabIndex", 0 );
+ } else {
+ this.active
+ .addClass( "ui-tabs-active ui-state-active" )
+ .attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ });
+ this._getPanelForTab( this.active )
+ .show()
+ .attr({
+ "aria-hidden": "false"
+ });
+ }
+ },
+
+ _processTabs: function() {
+ var that = this,
+ prevTabs = this.tabs,
+ prevAnchors = this.anchors,
+ prevPanels = this.panels;
+
+ this.tablist = this._getList()
+ .addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
+ .attr( "role", "tablist" )
+
+ // Prevent users from focusing disabled tabs via click
+ .delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
+ if ( $( this ).is( ".ui-state-disabled" ) ) {
+ event.preventDefault();
+ }
+ })
+
+ // support: IE <9
+ // Preventing the default action in mousedown doesn't prevent IE
+ // from focusing the element, so if the anchor gets focused, blur.
+ // We don't have to worry about focusing the previously focused
+ // element since clicking on a non-focusable element should focus
+ // the body anyway.
+ .delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
+ if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
+ this.blur();
+ }
+ });
+
+ this.tabs = this.tablist.find( "> li:has(a[href])" )
+ .addClass( "ui-state-default ui-corner-top" )
+ .attr({
+ role: "tab",
+ tabIndex: -1
+ });
+
+ this.anchors = this.tabs.map(function() {
+ return $( "a", this )[ 0 ];
+ })
+ .addClass( "ui-tabs-anchor" )
+ .attr({
+ role: "presentation",
+ tabIndex: -1
+ });
+
+ this.panels = $();
+
+ this.anchors.each(function( i, anchor ) {
+ var selector, panel, panelId,
+ anchorId = $( anchor ).uniqueId().attr( "id" ),
+ tab = $( anchor ).closest( "li" ),
+ originalAriaControls = tab.attr( "aria-controls" );
+
+ // inline tab
+ if ( that._isLocal( anchor ) ) {
+ selector = anchor.hash;
+ panelId = selector.substring( 1 );
+ panel = that.element.find( that._sanitizeSelector( selector ) );
+ // remote tab
+ } else {
+ // If the tab doesn't already have aria-controls,
+ // generate an id by using a throw-away element
+ panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id;
+ selector = "#" + panelId;
+ panel = that.element.find( selector );
+ if ( !panel.length ) {
+ panel = that._createPanel( panelId );
+ panel.insertAfter( that.panels[ i - 1 ] || that.tablist );
+ }
+ panel.attr( "aria-live", "polite" );
+ }
+
+ if ( panel.length) {
+ that.panels = that.panels.add( panel );
+ }
+ if ( originalAriaControls ) {
+ tab.data( "ui-tabs-aria-controls", originalAriaControls );
+ }
+ tab.attr({
+ "aria-controls": panelId,
+ "aria-labelledby": anchorId
+ });
+ panel.attr( "aria-labelledby", anchorId );
+ });
+
+ this.panels
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .attr( "role", "tabpanel" );
+
+ // Avoid memory leaks (#10056)
+ if ( prevTabs ) {
+ this._off( prevTabs.not( this.tabs ) );
+ this._off( prevAnchors.not( this.anchors ) );
+ this._off( prevPanels.not( this.panels ) );
+ }
+ },
+
+ // allow overriding how to find the list for rare usage scenarios (#7715)
+ _getList: function() {
+ return this.tablist || this.element.find( "ol,ul" ).eq( 0 );
+ },
+
+ _createPanel: function( id ) {
+ return $( "<div>" )
+ .attr( "id", id )
+ .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
+ .data( "ui-tabs-destroy", true );
+ },
+
+ _setupDisabled: function( disabled ) {
+ if ( $.isArray( disabled ) ) {
+ if ( !disabled.length ) {
+ disabled = false;
+ } else if ( disabled.length === this.anchors.length ) {
+ disabled = true;
+ }
+ }
+
+ // disable tabs
+ for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
+ if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
+ $( li )
+ .addClass( "ui-state-disabled" )
+ .attr( "aria-disabled", "true" );
+ } else {
+ $( li )
+ .removeClass( "ui-state-disabled" )
+ .removeAttr( "aria-disabled" );
+ }
+ }
+
+ this.options.disabled = disabled;
+ },
+
+ _setupEvents: function( event ) {
+ var events = {};
+ if ( event ) {
+ $.each( event.split(" "), function( index, eventName ) {
+ events[ eventName ] = "_eventHandler";
+ });
+ }
+
+ this._off( this.anchors.add( this.tabs ).add( this.panels ) );
+ // Always prevent the default action, even when disabled
+ this._on( true, this.anchors, {
+ click: function( event ) {
+ event.preventDefault();
+ }
+ });
+ this._on( this.anchors, events );
+ this._on( this.tabs, { keydown: "_tabKeydown" } );
+ this._on( this.panels, { keydown: "_panelKeydown" } );
+
+ this._focusable( this.tabs );
+ this._hoverable( this.tabs );
+ },
+
+ _setupHeightStyle: function( heightStyle ) {
+ var maxHeight,
+ parent = this.element.parent();
+
+ if ( heightStyle === "fill" ) {
+ maxHeight = parent.height();
+ maxHeight -= this.element.outerHeight() - this.element.height();
+
+ this.element.siblings( ":visible" ).each(function() {
+ var elem = $( this ),
+ position = elem.css( "position" );
+
+ if ( position === "absolute" || position === "fixed" ) {
+ return;
+ }
+ maxHeight -= elem.outerHeight( true );
+ });
+
+ this.element.children().not( this.panels ).each(function() {
+ maxHeight -= $( this ).outerHeight( true );
+ });
+
+ this.panels.each(function() {
+ $( this ).height( Math.max( 0, maxHeight -
+ $( this ).innerHeight() + $( this ).height() ) );
+ })
+ .css( "overflow", "auto" );
+ } else if ( heightStyle === "auto" ) {
+ maxHeight = 0;
+ this.panels.each(function() {
+ maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
+ }).height( maxHeight );
+ }
+ },
+
+ _eventHandler: function( event ) {
+ var options = this.options,
+ active = this.active,
+ anchor = $( event.currentTarget ),
+ tab = anchor.closest( "li" ),
+ clickedIsActive = tab[ 0 ] === active[ 0 ],
+ collapsing = clickedIsActive && options.collapsible,
+ toShow = collapsing ? $() : this._getPanelForTab( tab ),
+ toHide = !active.length ? $() : this._getPanelForTab( active ),
+ eventData = {
+ oldTab: active,
+ oldPanel: toHide,
+ newTab: collapsing ? $() : tab,
+ newPanel: toShow
+ };
+
+ event.preventDefault();
+
+ if ( tab.hasClass( "ui-state-disabled" ) ||
+ // tab is already loading
+ tab.hasClass( "ui-tabs-loading" ) ||
+ // can't switch durning an animation
+ this.running ||
+ // click on active header, but not collapsible
+ ( clickedIsActive && !options.collapsible ) ||
+ // allow canceling activation
+ ( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
+ return;
+ }
+
+ options.active = collapsing ? false : this.tabs.index( tab );
+
+ this.active = clickedIsActive ? $() : tab;
+ if ( this.xhr ) {
+ this.xhr.abort();
+ }
+
+ if ( !toHide.length && !toShow.length ) {
+ $.error( "jQuery UI Tabs: Mismatching fragment identifier." );
+ }
+
+ if ( toShow.length ) {
+ this.load( this.tabs.index( tab ), event );
+ }
+ this._toggle( event, eventData );
+ },
+
+ // handles show/hide for selecting tabs
+ _toggle: function( event, eventData ) {
+ var that = this,
+ toShow = eventData.newPanel,
+ toHide = eventData.oldPanel;
+
+ this.running = true;
+
+ function complete() {
+ that.running = false;
+ that._trigger( "activate", event, eventData );
+ }
+
+ function show() {
+ eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
+
+ if ( toShow.length && that.options.show ) {
+ that._show( toShow, that.options.show, complete );
+ } else {
+ toShow.show();
+ complete();
+ }
+ }
+
+ // start out by hiding, then showing, then completing
+ if ( toHide.length && this.options.hide ) {
+ this._hide( toHide, this.options.hide, function() {
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ show();
+ });
+ } else {
+ eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
+ toHide.hide();
+ show();
+ }
+
+ toHide.attr( "aria-hidden", "true" );
+ eventData.oldTab.attr({
+ "aria-selected": "false",
+ "aria-expanded": "false"
+ });
+ // If we're switching tabs, remove the old tab from the tab order.
+ // If we're opening from collapsed state, remove the previous tab from the tab order.
+ // If we're collapsing, then keep the collapsing tab in the tab order.
+ if ( toShow.length && toHide.length ) {
+ eventData.oldTab.attr( "tabIndex", -1 );
+ } else if ( toShow.length ) {
+ this.tabs.filter(function() {
+ return $( this ).attr( "tabIndex" ) === 0;
+ })
+ .attr( "tabIndex", -1 );
+ }
+
+ toShow.attr( "aria-hidden", "false" );
+ eventData.newTab.attr({
+ "aria-selected": "true",
+ "aria-expanded": "true",
+ tabIndex: 0
+ });
+ },
+
+ _activate: function( index ) {
+ var anchor,
+ active = this._findActive( index );
+
+ // trying to activate the already active panel
+ if ( active[ 0 ] === this.active[ 0 ] ) {
+ return;
+ }
+
+ // trying to collapse, simulate a click on the current active header
+ if ( !active.length ) {
+ active = this.active;
+ }
+
+ anchor = active.find( ".ui-tabs-anchor" )[ 0 ];
+ this._eventHandler({
+ target: anchor,
+ currentTarget: anchor,
+ preventDefault: $.noop
+ });
+ },
+
+ _findActive: function( index ) {
+ return index === false ? $() : this.tabs.eq( index );
+ },
+
+ _getIndex: function( index ) {
+ // meta-function to give users option to provide a href string instead of a numerical index.
+ if ( typeof index === "string" ) {
+ index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
+ }
+
+ return index;
+ },
+
+ _destroy: function() {
+ if ( this.xhr ) {
+ this.xhr.abort();
+ }
+
+ this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
+
+ this.tablist
+ .removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
+ .removeAttr( "role" );
+
+ this.anchors
+ .removeClass( "ui-tabs-anchor" )
+ .removeAttr( "role" )
+ .removeAttr( "tabIndex" )
+ .removeUniqueId();
+
+ this.tablist.unbind( this.eventNamespace );
+
+ this.tabs.add( this.panels ).each(function() {
+ if ( $.data( this, "ui-tabs-destroy" ) ) {
+ $( this ).remove();
+ } else {
+ $( this )
+ .removeClass( "ui-state-default ui-state-active ui-state-disabled " +
+ "ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel" )
+ .removeAttr( "tabIndex" )
+ .removeAttr( "aria-live" )
+ .removeAttr( "aria-busy" )
+ .removeAttr( "aria-selected" )
+ .removeAttr( "aria-labelledby" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-expanded" )
+ .removeAttr( "role" );
+ }
+ });
+
+ this.tabs.each(function() {
+ var li = $( this ),
+ prev = li.data( "ui-tabs-aria-controls" );
+ if ( prev ) {
+ li
+ .attr( "aria-controls", prev )
+ .removeData( "ui-tabs-aria-controls" );
+ } else {
+ li.removeAttr( "aria-controls" );
+ }
+ });
+
+ this.panels.show();
+
+ if ( this.options.heightStyle !== "content" ) {
+ this.panels.css( "height", "" );
+ }
+ },
+
+ enable: function( index ) {
+ var disabled = this.options.disabled;
+ if ( disabled === false ) {
+ return;
+ }
+
+ if ( index === undefined ) {
+ disabled = false;
+ } else {
+ index = this._getIndex( index );
+ if ( $.isArray( disabled ) ) {
+ disabled = $.map( disabled, function( num ) {
+ return num !== index ? num : null;
+ });
+ } else {
+ disabled = $.map( this.tabs, function( li, num ) {
+ return num !== index ? num : null;
+ });
+ }
+ }
+ this._setupDisabled( disabled );
+ },
+
+ disable: function( index ) {
+ var disabled = this.options.disabled;
+ if ( disabled === true ) {
+ return;
+ }
+
+ if ( index === undefined ) {
+ disabled = true;
+ } else {
+ index = this._getIndex( index );
+ if ( $.inArray( index, disabled ) !== -1 ) {
+ return;
+ }
+ if ( $.isArray( disabled ) ) {
+ disabled = $.merge( [ index ], disabled ).sort();
+ } else {
+ disabled = [ index ];
+ }
+ }
+ this._setupDisabled( disabled );
+ },
+
+ load: function( index, event ) {
+ index = this._getIndex( index );
+ var that = this,
+ tab = this.tabs.eq( index ),
+ anchor = tab.find( ".ui-tabs-anchor" ),
+ panel = this._getPanelForTab( tab ),
+ eventData = {
+ tab: tab,
+ panel: panel
+ },
+ complete = function( jqXHR, status ) {
+ if ( status === "abort" ) {
+ that.panels.stop( false, true );
+ }
+
+ tab.removeClass( "ui-tabs-loading" );
+ panel.removeAttr( "aria-busy" );
+
+ if ( jqXHR === that.xhr ) {
+ delete that.xhr;
+ }
+ };
+
+ // not remote
+ if ( this._isLocal( anchor[ 0 ] ) ) {
+ return;
+ }
+
+ this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
+
+ // support: jQuery <1.8
+ // jQuery <1.8 returns false if the request is canceled in beforeSend,
+ // but as of 1.8, $.ajax() always returns a jqXHR object.
+ if ( this.xhr && this.xhr.statusText !== "canceled" ) {
+ tab.addClass( "ui-tabs-loading" );
+ panel.attr( "aria-busy", "true" );
+
+ this.xhr
+ .done(function( response, status, jqXHR ) {
+ // support: jQuery <1.8
+ // http://bugs.jquery.com/ticket/11778
+ setTimeout(function() {
+ panel.html( response );
+ that._trigger( "load", event, eventData );
+
+ complete( jqXHR, status );
+ }, 1 );
+ })
+ .fail(function( jqXHR, status ) {
+ // support: jQuery <1.8
+ // http://bugs.jquery.com/ticket/11778
+ setTimeout(function() {
+ complete( jqXHR, status );
+ }, 1 );
+ });
+ }
+ },
+
+ _ajaxSettings: function( anchor, event, eventData ) {
+ var that = this;
+ return {
+ url: anchor.attr( "href" ),
+ beforeSend: function( jqXHR, settings ) {
+ return that._trigger( "beforeLoad", event,
+ $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
+ }
+ };
+ },
+
+ _getPanelForTab: function( tab ) {
+ var id = $( tab ).attr( "aria-controls" );
+ return this.element.find( this._sanitizeSelector( "#" + id ) );
+ }
+});
+
+
+/*!
+ * jQuery UI Tooltip 1.11.4
+ * http://jqueryui.com
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://api.jqueryui.com/tooltip/
+ */
+
+
+var tooltip = $.widget( "ui.tooltip", {
+ version: "1.11.4",
+ options: {
+ content: function() {
+ // support: IE<9, Opera in jQuery <1.7
+ // .text() can't accept undefined, so coerce to a string
+ var title = $( this ).attr( "title" ) || "";
+ // Escape title, since we're going from an attribute to raw HTML
+ return $( "<a>" ).text( title ).html();
+ },
+ hide: true,
+ // Disabled elements have inconsistent behavior across browsers (#8661)
+ items: "[title]:not([disabled])",
+ position: {
+ my: "left top+15",
+ at: "left bottom",
+ collision: "flipfit flip"
+ },
+ show: true,
+ tooltipClass: null,
+ track: false,
+
+ // callbacks
+ close: null,
+ open: null
+ },
+
+ _addDescribedBy: function( elem, id ) {
+ var describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ );
+ describedby.push( id );
+ elem
+ .data( "ui-tooltip-id", id )
+ .attr( "aria-describedby", $.trim( describedby.join( " " ) ) );
+ },
+
+ _removeDescribedBy: function( elem ) {
+ var id = elem.data( "ui-tooltip-id" ),
+ describedby = (elem.attr( "aria-describedby" ) || "").split( /\s+/ ),
+ index = $.inArray( id, describedby );
+
+ if ( index !== -1 ) {
+ describedby.splice( index, 1 );
+ }
+
+ elem.removeData( "ui-tooltip-id" );
+ describedby = $.trim( describedby.join( " " ) );
+ if ( describedby ) {
+ elem.attr( "aria-describedby", describedby );
+ } else {
+ elem.removeAttr( "aria-describedby" );
+ }
+ },
+
+ _create: function() {
+ this._on({
+ mouseover: "open",
+ focusin: "open"
+ });
+
+ // IDs of generated tooltips, needed for destroy
+ this.tooltips = {};
+
+ // IDs of parent tooltips where we removed the title attribute
+ this.parents = {};
+
+ if ( this.options.disabled ) {
+ this._disable();
+ }
+
+ // Append the aria-live region so tooltips announce correctly
+ this.liveRegion = $( "<div>" )
+ .attr({
+ role: "log",
+ "aria-live": "assertive",
+ "aria-relevant": "additions"
+ })
+ .addClass( "ui-helper-hidden-accessible" )
+ .appendTo( this.document[ 0 ].body );
+ },
+
+ _setOption: function( key, value ) {
+ var that = this;
+
+ if ( key === "disabled" ) {
+ this[ value ? "_disable" : "_enable" ]();
+ this.options[ key ] = value;
+ // disable element style changes
+ return;
+ }
+
+ this._super( key, value );
+
+ if ( key === "content" ) {
+ $.each( this.tooltips, function( id, tooltipData ) {
+ that._updateContent( tooltipData.element );
+ });
+ }
+ },
+
+ _disable: function() {
+ var that = this;
+
+ // close open tooltips
+ $.each( this.tooltips, function( id, tooltipData ) {
+ var event = $.Event( "blur" );
+ event.target = event.currentTarget = tooltipData.element[ 0 ];
+ that.close( event, true );
+ });
+
+ // remove title attributes to prevent native tooltips
+ this.element.find( this.options.items ).addBack().each(function() {
+ var element = $( this );
+ if ( element.is( "[title]" ) ) {
+ element
+ .data( "ui-tooltip-title", element.attr( "title" ) )
+ .removeAttr( "title" );
+ }
+ });
+ },
+
+ _enable: function() {
+ // restore title attributes
+ this.element.find( this.options.items ).addBack().each(function() {
+ var element = $( this );
+ if ( element.data( "ui-tooltip-title" ) ) {
+ element.attr( "title", element.data( "ui-tooltip-title" ) );
+ }
+ });
+ },
+
+ open: function( event ) {
+ var that = this,
+ target = $( event ? event.target : this.element )
+ // we need closest here due to mouseover bubbling,
+ // but always pointing at the same event target
+ .closest( this.options.items );
+
+ // No element to show a tooltip for or the tooltip is already open
+ if ( !target.length || target.data( "ui-tooltip-id" ) ) {
+ return;
+ }
+
+ if ( target.attr( "title" ) ) {
+ target.data( "ui-tooltip-title", target.attr( "title" ) );
+ }
+
+ target.data( "ui-tooltip-open", true );
+
+ // kill parent tooltips, custom or native, for hover
+ if ( event && event.type === "mouseover" ) {
+ target.parents().each(function() {
+ var parent = $( this ),
+ blurEvent;
+ if ( parent.data( "ui-tooltip-open" ) ) {
+ blurEvent = $.Event( "blur" );
+ blurEvent.target = blurEvent.currentTarget = this;
+ that.close( blurEvent, true );
+ }
+ if ( parent.attr( "title" ) ) {
+ parent.uniqueId();
+ that.parents[ this.id ] = {
+ element: this,
+ title: parent.attr( "title" )
+ };
+ parent.attr( "title", "" );
+ }
+ });
+ }
+
+ this._registerCloseHandlers( event, target );
+ this._updateContent( target, event );
+ },
+
+ _updateContent: function( target, event ) {
+ var content,
+ contentOption = this.options.content,
+ that = this,
+ eventType = event ? event.type : null;
+
+ if ( typeof contentOption === "string" ) {
+ return this._open( event, target, contentOption );
+ }
+
+ content = contentOption.call( target[0], function( response ) {
+
+ // IE may instantly serve a cached response for ajax requests
+ // delay this call to _open so the other call to _open runs first
+ that._delay(function() {
+
+ // Ignore async response if tooltip was closed already
+ if ( !target.data( "ui-tooltip-open" ) ) {
+ return;
+ }
+
+ // jQuery creates a special event for focusin when it doesn't
+ // exist natively. To improve performance, the native event
+ // object is reused and the type is changed. Therefore, we can't
+ // rely on the type being correct after the event finished
+ // bubbling, so we set it back to the previous value. (#8740)
+ if ( event ) {
+ event.type = eventType;
+ }
+ this._open( event, target, response );
+ });
+ });
+ if ( content ) {
+ this._open( event, target, content );
+ }
+ },
+
+ _open: function( event, target, content ) {
+ var tooltipData, tooltip, delayedShow, a11yContent,
+ positionOption = $.extend( {}, this.options.position );
+
+ if ( !content ) {
+ return;
+ }
+
+ // Content can be updated multiple times. If the tooltip already
+ // exists, then just update the content and bail.
+ tooltipData = this._find( target );
+ if ( tooltipData ) {
+ tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
+ return;
+ }
+
+ // if we have a title, clear it to prevent the native tooltip
+ // we have to check first to avoid defining a title if none exists
+ // (we don't want to cause an element to start matching [title])
+ //
+ // We use removeAttr only for key events, to allow IE to export the correct
+ // accessible attributes. For mouse events, set to empty string to avoid
+ // native tooltip showing up (happens only when removing inside mouseover).
+ if ( target.is( "[title]" ) ) {
+ if ( event && event.type === "mouseover" ) {
+ target.attr( "title", "" );
+ } else {
+ target.removeAttr( "title" );
+ }
+ }
+
+ tooltipData = this._tooltip( target );
+ tooltip = tooltipData.tooltip;
+ this._addDescribedBy( target, tooltip.attr( "id" ) );
+ tooltip.find( ".ui-tooltip-content" ).html( content );
+
+ // Support: Voiceover on OS X, JAWS on IE <= 9
+ // JAWS announces deletions even when aria-relevant="additions"
+ // Voiceover will sometimes re-read the entire log region's contents from the beginning
+ this.liveRegion.children().hide();
+ if ( content.clone ) {
+ a11yContent = content.clone();
+ a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
+ } else {
+ a11yContent = content;
+ }
+ $( "<div>" ).html( a11yContent ).appendTo( this.liveRegion );
+
+ function position( event ) {
+ positionOption.of = event;
+ if ( tooltip.is( ":hidden" ) ) {
+ return;
+ }
+ tooltip.position( positionOption );
+ }
+ if ( this.options.track && event && /^mouse/.test( event.type ) ) {
+ this._on( this.document, {
+ mousemove: position
+ });
+ // trigger once to override element-relative positioning
+ position( event );
+ } else {
+ tooltip.position( $.extend({
+ of: target
+ }, this.options.position ) );
+ }
+
+ tooltip.hide();
+
+ this._show( tooltip, this.options.show );
+ // Handle tracking tooltips that are shown with a delay (#8644). As soon
+ // as the tooltip is visible, position the tooltip using the most recent
+ // event.
+ if ( this.options.show && this.options.show.delay ) {
+ delayedShow = this.delayedShow = setInterval(function() {
+ if ( tooltip.is( ":visible" ) ) {
+ position( positionOption.of );
+ clearInterval( delayedShow );
+ }
+ }, $.fx.interval );
+ }
+
+ this._trigger( "open", event, { tooltip: tooltip } );
+ },
+
+ _registerCloseHandlers: function( event, target ) {
+ var events = {
+ keyup: function( event ) {
+ if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
+ var fakeEvent = $.Event(event);
+ fakeEvent.currentTarget = target[0];
+ this.close( fakeEvent, true );
+ }
+ }
+ };
+
+ // Only bind remove handler for delegated targets. Non-delegated
+ // tooltips will handle this in destroy.
+ if ( target[ 0 ] !== this.element[ 0 ] ) {
+ events.remove = function() {
+ this._removeTooltip( this._find( target ).tooltip );
+ };
+ }
+
+ if ( !event || event.type === "mouseover" ) {
+ events.mouseleave = "close";
+ }
+ if ( !event || event.type === "focusin" ) {
+ events.focusout = "close";
+ }
+ this._on( true, target, events );
+ },
+
+ close: function( event ) {
+ var tooltip,
+ that = this,
+ target = $( event ? event.currentTarget : this.element ),
+ tooltipData = this._find( target );
+
+ // The tooltip may already be closed
+ if ( !tooltipData ) {
+
+ // We set ui-tooltip-open immediately upon open (in open()), but only set the
+ // additional data once there's actually content to show (in _open()). So even if the
+ // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
+ // the period between open() and _open().
+ target.removeData( "ui-tooltip-open" );
+ return;
+ }
+
+ tooltip = tooltipData.tooltip;
+
+ // disabling closes the tooltip, so we need to track when we're closing
+ // to avoid an infinite loop in case the tooltip becomes disabled on close
+ if ( tooltipData.closing ) {
+ return;
+ }
+
+ // Clear the interval for delayed tracking tooltips
+ clearInterval( this.delayedShow );
+
+ // only set title if we had one before (see comment in _open())
+ // If the title attribute has changed since open(), don't restore
+ if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
+ target.attr( "title", target.data( "ui-tooltip-title" ) );
+ }
+
+ this._removeDescribedBy( target );
+
+ tooltipData.hiding = true;
+ tooltip.stop( true );
+ this._hide( tooltip, this.options.hide, function() {
+ that._removeTooltip( $( this ) );
+ });
+
+ target.removeData( "ui-tooltip-open" );
+ this._off( target, "mouseleave focusout keyup" );
+
+ // Remove 'remove' binding only on delegated targets
+ if ( target[ 0 ] !== this.element[ 0 ] ) {
+ this._off( target, "remove" );
+ }
+ this._off( this.document, "mousemove" );
+
+ if ( event && event.type === "mouseleave" ) {
+ $.each( this.parents, function( id, parent ) {
+ $( parent.element ).attr( "title", parent.title );
+ delete that.parents[ id ];
+ });
+ }
+
+ tooltipData.closing = true;
+ this._trigger( "close", event, { tooltip: tooltip } );
+ if ( !tooltipData.hiding ) {
+ tooltipData.closing = false;
+ }
+ },
+
+ _tooltip: function( element ) {
+ var tooltip = $( "<div>" )
+ .attr( "role", "tooltip" )
+ .addClass( "ui-tooltip ui-widget ui-corner-all ui-widget-content " +
+ ( this.options.tooltipClass || "" ) ),
+ id = tooltip.uniqueId().attr( "id" );
+
+ $( "<div>" )
+ .addClass( "ui-tooltip-content" )
+ .appendTo( tooltip );
+
+ tooltip.appendTo( this.document[0].body );
+
+ return this.tooltips[ id ] = {
+ element: element,
+ tooltip: tooltip
+ };
+ },
+
+ _find: function( target ) {
+ var id = target.data( "ui-tooltip-id" );
+ return id ? this.tooltips[ id ] : null;
+ },
+
+ _removeTooltip: function( tooltip ) {
+ tooltip.remove();
+ delete this.tooltips[ tooltip.attr( "id" ) ];
+ },
+
+ _destroy: function() {
+ var that = this;
+
+ // close open tooltips
+ $.each( this.tooltips, function( id, tooltipData ) {
+ // Delegate to close method to handle common cleanup
+ var event = $.Event( "blur" ),
+ element = tooltipData.element;
+ event.target = event.currentTarget = element[ 0 ];
+ that.close( event, true );
+
+ // Remove immediately; destroying an open tooltip doesn't use the
+ // hide animation
+ $( "#" + id ).remove();
+
+ // Restore the title
+ if ( element.data( "ui-tooltip-title" ) ) {
+ // If the title attribute has changed since open(), don't restore
+ if ( !element.attr( "title" ) ) {
+ element.attr( "title", element.data( "ui-tooltip-title" ) );
+ }
+ element.removeData( "ui-tooltip-title" );
+ }
+ });
+ this.liveRegion.remove();
+ }
+});
+
+
+
+})); \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.min.js b/public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.min.js
new file mode 100644
index 0000000..5824d12
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/jQueryUI/jquery-ui.min.js
@@ -0,0 +1,13 @@
+/*! jQuery UI - v1.11.4 - 2015-03-11
+* http://jqueryui.com
+* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
+* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
+
+(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),C=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=C[0],M.top+=C[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+C[0],p[1]+C[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget);
+i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);
+return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",C=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+u)%7,C+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[N]+"'>"+p[N]+"</span></th>";for(M+=C+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(j?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(j&&!v?"":" "+O[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(j&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(j&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(j?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)
+},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;
+if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};
+f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.val(),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this));
+return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels;
+this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}); \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.css b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.css
new file mode 100644
index 0000000..c601ab3
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.css
@@ -0,0 +1,40 @@
+.jvectormap-label {
+ position: absolute;
+ display: none;
+ border: solid 1px #CDCDCD;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ background: #292929;
+ color: white;
+ font-size: 10px!important;
+ padding: 3px;
+ z-index: 9999;
+}
+
+.jvectormap-zoomin, .jvectormap-zoomout {
+ position: absolute;
+ top: 100%;
+ margin-top: -25px;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ border-radius: 2px;
+ background: #d2d6de;/*rgba(0,0,0,0.4)*/;
+ padding: 5px;
+ color: #444;
+ cursor: pointer;
+ line-height: 10px;
+ text-align: center;
+ font-weight: bold;
+ box-shadow: 0 1px 2px rgba(0,0,0,0.2);
+}
+
+.jvectormap-zoomin {
+ left: 100%;
+ margin-left: -50px;
+}
+
+.jvectormap-zoomout {
+ left: 100%;
+ margin-left: -30px;
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js
new file mode 100644
index 0000000..ea54476
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js
@@ -0,0 +1,8 @@
+/**
+ * jVectorMap version 1.2.2
+ *
+ * Copyright 2011-2013, Kirill Lebedev
+ * Licensed under the MIT license.
+ *
+ */(function(e){var t={set:{colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,focus:1},get:{selectedRegions:1,selectedMarkers:1,mapObject:1,regionName:1}};e.fn.vectorMap=function(e){var n,r,i,n=this.children(".jvectormap-container").data("mapObject");if(e==="addMap")jvm.WorldMap.maps[arguments[1]]=arguments[2];else{if(!(e!=="set"&&e!=="get"||!t[e][arguments[1]]))return r=arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1),n[e+r].apply(n,Array.prototype.slice.call(arguments,2));e=e||{},e.container=this,n=new jvm.WorldMap(e)}return this}})(jQuery),function(e){function r(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=!0,o=0,u=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta/120),n.detail&&(i=-n.detail/3),u=i,n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS&&(u=0,o=-1*i),n.wheelDeltaY!==undefined&&(u=n.wheelDeltaY/120),n.wheelDeltaX!==undefined&&(o=-1*n.wheelDeltaX/120),r.unshift(t,i,o,u),(e.event.dispatch||e.event.handle).apply(this,r)}var t=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var n=t.length;n;)e.event.fixHooks[t[--n]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],r,!1);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],r,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery);var jvm={inherits:function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.parentClass=t},mixin:function(e,t){var n;for(n in t.prototype)t.prototype.hasOwnProperty(n)&&(e.prototype[n]=t.prototype[n])},min:function(e){var t=Number.MAX_VALUE,n;if(e instanceof Array)for(n=0;n<e.length;n++)e[n]<t&&(t=e[n]);else for(n in e)e[n]<t&&(t=e[n]);return t},max:function(e){var t=Number.MIN_VALUE,n;if(e instanceof Array)for(n=0;n<e.length;n++)e[n]>t&&(t=e[n]);else for(n in e)e[n]>t&&(t=e[n]);return t},keys:function(e){var t=[],n;for(n in e)t.push(n);return t},values:function(e){var t=[],n,r;for(r=0;r<arguments.length;r++){e=arguments[r];for(n in e)t.push(e[n])}return t}};jvm.$=jQuery,jvm.AbstractElement=function(e,t){this.node=this.createElement(e),this.name=e,this.properties={},t&&this.set(t)},jvm.AbstractElement.prototype.set=function(e,t){var n;if(typeof e=="object")for(n in e)this.properties[n]=e[n],this.applyAttr(n,e[n]);else this.properties[e]=t,this.applyAttr(e,t)},jvm.AbstractElement.prototype.get=function(e){return this.properties[e]},jvm.AbstractElement.prototype.applyAttr=function(e,t){this.node.setAttribute(e,t)},jvm.AbstractElement.prototype.remove=function(){jvm.$(this.node).remove()},jvm.AbstractCanvasElement=function(e,t,n){this.container=e,this.setSize(t,n),this.rootElement=new jvm[this.classPrefix+"GroupElement"],this.node.appendChild(this.rootElement.node),this.container.appendChild(this.node)},jvm.AbstractCanvasElement.prototype.add=function(e,t){t=t||this.rootElement,t.add(e),e.canvas=this},jvm.AbstractCanvasElement.prototype.addPath=function(e,t,n){var r=new jvm[this.classPrefix+"PathElement"](e,t);return this.add(r,n),r},jvm.AbstractCanvasElement.prototype.addCircle=function(e,t,n){var r=new jvm[this.classPrefix+"CircleElement"](e,t);return this.add(r,n),r},jvm.AbstractCanvasElement.prototype.addGroup=function(e){var t=new jvm[this.classPrefix+"GroupElement"];return e?e.node.appendChild(t.node):this.node.appendChild(t.node),t.canvas=this,t},jvm.AbstractShapeElement=function(e,t,n){this.style=n||{},this.style.current={},this.isHovered=!1,this.isSelected=!1,this.updateStyle()},jvm.AbstractShapeElement.prototype.setHovered=function(e){this.isHovered!==e&&(this.isHovered=e,this.updateStyle())},jvm.AbstractShapeElement.prototype.setSelected=function(e){this.isSelected!==e&&(this.isSelected=e,this.updateStyle(),jvm.$(this.node).trigger("selected",[e]))},jvm.AbstractShapeElement.prototype.setStyle=function(e,t){var n={};typeof e=="object"?n=e:n[e]=t,jvm.$.extend(this.style.current,n),this.updateStyle()},jvm.AbstractShapeElement.prototype.updateStyle=function(){var e={};jvm.AbstractShapeElement.mergeStyles(e,this.style.initial),jvm.AbstractShapeElement.mergeStyles(e,this.style.current),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(e,this.style.hover),this.isSelected&&(jvm.AbstractShapeElement.mergeStyles(e,this.style.selected),this.isHovered&&jvm.AbstractShapeElement.mergeStyles(e,this.style.selectedHover)),this.set(e)},jvm.AbstractShapeElement.mergeStyles=function(e,t){var n;t=t||{};for(n in t)t[n]===null?delete e[n]:e[n]=t[n]},jvm.SVGElement=function(e,t){jvm.SVGElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.SVGElement,jvm.AbstractElement),jvm.SVGElement.svgns="http://www.w3.org/2000/svg",jvm.SVGElement.prototype.createElement=function(e){return document.createElementNS(jvm.SVGElement.svgns,e)},jvm.SVGElement.prototype.addClass=function(e){this.node.setAttribute("class",e)},jvm.SVGElement.prototype.getElementCtr=function(e){return jvm["SVG"+e]},jvm.SVGElement.prototype.getBBox=function(){return this.node.getBBox()},jvm.SVGGroupElement=function(){jvm.SVGGroupElement.parentClass.call(this,"g")},jvm.inherits(jvm.SVGGroupElement,jvm.SVGElement),jvm.SVGGroupElement.prototype.add=function(e){this.node.appendChild(e.node)},jvm.SVGCanvasElement=function(e,t,n){this.classPrefix="SVG",jvm.SVGCanvasElement.parentClass.call(this,"svg"),jvm.AbstractCanvasElement.apply(this,arguments)},jvm.inherits(jvm.SVGCanvasElement,jvm.SVGElement),jvm.mixin(jvm.SVGCanvasElement,jvm.AbstractCanvasElement),jvm.SVGCanvasElement.prototype.setSize=function(e,t){this.width=e,this.height=t,this.node.setAttribute("width",e),this.node.setAttribute("height",t)},jvm.SVGCanvasElement.prototype.applyTransformParams=function(e,t,n){this.scale=e,this.transX=t,this.transY=n,this.rootElement.node.setAttribute("transform","scale("+e+") translate("+t+", "+n+")")},jvm.SVGShapeElement=function(e,t,n){jvm.SVGShapeElement.parentClass.call(this,e,t),jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.SVGShapeElement,jvm.SVGElement),jvm.mixin(jvm.SVGShapeElement,jvm.AbstractShapeElement),jvm.SVGPathElement=function(e,t){jvm.SVGPathElement.parentClass.call(this,"path",e,t),this.node.setAttribute("fill-rule","evenodd")},jvm.inherits(jvm.SVGPathElement,jvm.SVGShapeElement),jvm.SVGCircleElement=function(e,t){jvm.SVGCircleElement.parentClass.call(this,"circle",e,t)},jvm.inherits(jvm.SVGCircleElement,jvm.SVGShapeElement),jvm.VMLElement=function(e,t){jvm.VMLElement.VMLInitialized||jvm.VMLElement.initializeVML(),jvm.VMLElement.parentClass.apply(this,arguments)},jvm.inherits(jvm.VMLElement,jvm.AbstractElement),jvm.VMLElement.VMLInitialized=!1,jvm.VMLElement.initializeVML=function(){try{document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),jvm.VMLElement.prototype.createElement=function(e){return document.createElement("<rvml:"+e+' class="rvml">')}}catch(e){jvm.VMLElement.prototype.createElement=function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"),jvm.VMLElement.VMLInitialized=!0},jvm.VMLElement.prototype.getElementCtr=function(e){return jvm["VML"+e]},jvm.VMLElement.prototype.addClass=function(e){jvm.$(this.node).addClass(e)},jvm.VMLElement.prototype.applyAttr=function(e,t){this.node[e]=t},jvm.VMLElement.prototype.getBBox=function(){var e=jvm.$(this.node);return{x:e.position().left/this.canvas.scale,y:e.position().top/this.canvas.scale,width:e.width()/this.canvas.scale,height:e.height()/this.canvas.scale}},jvm.VMLGroupElement=function(){jvm.VMLGroupElement.parentClass.call(this,"group"),this.node.style.left="0px",this.node.style.top="0px",this.node.coordorigin="0 0"},jvm.inherits(jvm.VMLGroupElement,jvm.VMLElement),jvm.VMLGroupElement.prototype.add=function(e){this.node.appendChild(e.node)},jvm.VMLCanvasElement=function(e,t,n){this.classPrefix="VML",jvm.VMLCanvasElement.parentClass.call(this,"group"),jvm.AbstractCanvasElement.apply(this,arguments),this.node.style.position="absolute"},jvm.inherits(jvm.VMLCanvasElement,jvm.VMLElement),jvm.mixin(jvm.VMLCanvasElement,jvm.AbstractCanvasElement),jvm.VMLCanvasElement.prototype.setSize=function(e,t){var n,r,i,s;this.width=e,this.height=t,this.node.style.width=e+"px",this.node.style.height=t+"px",this.node.coordsize=e+" "+t,this.node.coordorigin="0 0";if(this.rootElement){n=this.rootElement.node.getElementsByTagName("shape");for(i=0,s=n.length;i<s;i++)n[i].coordsize=e+" "+t,n[i].style.width=e+"px",n[i].style.height=t+"px";r=this.node.getElementsByTagName("group");for(i=0,s=r.length;i<s;i++)r[i].coordsize=e+" "+t,r[i].style.width=e+"px",r[i].style.height=t+"px"}},jvm.VMLCanvasElement.prototype.applyTransformParams=function(e,t,n){this.scale=e,this.transX=t,this.transY=n,this.rootElement.node.coordorigin=this.width-t-this.width/100+","+(this.height-n-this.height/100),this.rootElement.node.coordsize=this.width/e+","+this.height/e},jvm.VMLShapeElement=function(e,t){jvm.VMLShapeElement.parentClass.call(this,e,t),this.fillElement=new jvm.VMLElement("fill"),this.strokeElement=new jvm.VMLElement("stroke"),this.node.appendChild(this.fillElement.node),this.node.appendChild(this.strokeElement.node),this.node.stroked=!1,jvm.AbstractShapeElement.apply(this,arguments)},jvm.inherits(jvm.VMLShapeElement,jvm.VMLElement),jvm.mixin(jvm.VMLShapeElement,jvm.AbstractShapeElement),jvm.VMLShapeElement.prototype.applyAttr=function(e,t){switch(e){case"fill":this.node.fillcolor=t;break;case"fill-opacity":this.fillElement.node.opacity=Math.round(t*100)+"%";break;case"stroke":t==="none"?this.node.stroked=!1:this.node.stroked=!0,this.node.strokecolor=t;break;case"stroke-opacity":this.strokeElement.node.opacity=Math.round(t*100)+"%";break;case"stroke-width":parseInt(t,10)===0?this.node.stroked=!1:this.node.stroked=!0,this.node.strokeweight=t;break;case"d":this.node.path=jvm.VMLPathElement.pathSvgToVml(t);break;default:jvm.VMLShapeElement.parentClass.prototype.applyAttr.apply(this,arguments)}},jvm.VMLPathElement=function(e,t){var n=new jvm.VMLElement("skew");jvm.VMLPathElement.parentClass.call(this,"shape",e,t),this.node.coordorigin="0 0",n.node.on=!0,n.node.matrix="0.01,0,0,0.01,0,0",n.node.offset="0,0",this.node.appendChild(n.node)},jvm.inherits(jvm.VMLPathElement,jvm.VMLShapeElement),jvm.VMLPathElement.prototype.applyAttr=function(e,t){e==="d"?this.node.path=jvm.VMLPathElement.pathSvgToVml(t):jvm.VMLShapeElement.prototype.applyAttr.call(this,e,t)},jvm.VMLPathElement.pathSvgToVml=function(e){var t="",n=0,r=0,i,s;return e=e.replace(/(-?\d+)e(-?\d+)/g,"0"),e.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g,function(e,t,o,u){o=o.replace(/(\d)-/g,"$1,-").replace(/^\s+/g,"").replace(/\s+$/g,"").replace(/\s+/g,",").split(","),o[0]||o.shift();for(var a=0,f=o.length;a<f;a++)o[a]=Math.round(100*o[a]);switch(t){case"m":return n+=o[0],r+=o[1],"t"+o.join(",");case"M":return n=o[0],r=o[1],"m"+o.join(",");case"l":return n+=o[0],r+=o[1],"r"+o.join(",");case"L":return n=o[0],r=o[1],"l"+o.join(",");case"h":return n+=o[0],"r"+o[0]+",0";case"H":return n=o[0],"l"+n+","+r;case"v":return r+=o[0],"r0,"+o[0];case"V":return r=o[0],"l"+n+","+r;case"c":return i=n+o[o.length-4],s=r+o[o.length-3],n+=o[o.length-2],r+=o[o.length-1],"v"+o.join(",");case"C":return i=o[o.length-4],s=o[o.length-3],n=o[o.length-2],r=o[o.length-1],"c"+o.join(",");case"s":return o.unshift(r-s),o.unshift(n-i),i=n+o[o.length-4],s=r+o[o.length-3],n+=o[o.length-2],r+=o[o.length-1],"v"+o.join(",");case"S":return o.unshift(r+r-s),o.unshift(n+n-i),i=o[o.length-4],s=o[o.length-3],n=o[o.length-2],r=o[o.length-1],"c"+o.join(",")}return""}).replace(/z/g,"e")},jvm.VMLCircleElement=function(e,t){jvm.VMLCircleElement.parentClass.call(this,"oval",e,t)},jvm.inherits(jvm.VMLCircleElement,jvm.VMLShapeElement),jvm.VMLCircleElement.prototype.applyAttr=function(e,t){switch(e){case"r":this.node.style.width=t*2+"px",this.node.style.height=t*2+"px",this.applyAttr("cx",this.get("cx")||0),this.applyAttr("cy",this.get("cy")||0);break;case"cx":if(!t)return;this.node.style.left=t-(this.get("r")||0)+"px";break;case"cy":if(!t)return;this.node.style.top=t-(this.get("r")||0)+"px";break;default:jvm.VMLCircleElement.parentClass.prototype.applyAttr.call(this,e,t)}},jvm.VectorCanvas=function(e,t,n){return this.mode=window.SVGAngle?"svg":"vml",this.mode=="svg"?this.impl=new jvm.SVGCanvasElement(e,t,n):this.impl=new jvm.VMLCanvasElement(e,t,n),this.impl},jvm.SimpleScale=function(e){this.scale=e},jvm.SimpleScale.prototype.getValue=function(e){return e},jvm.OrdinalScale=function(e){this.scale=e},jvm.OrdinalScale.prototype.getValue=function(e){return this.scale[e]},jvm.NumericScale=function(e,t,n,r){this.scale=[],t=t||"linear",e&&this.setScale(e),t&&this.setNormalizeFunction(t),n&&this.setMin(n),r&&this.setMax(r)},jvm.NumericScale.prototype={setMin:function(e){this.clearMinValue=e,typeof this.normalize=="function"?this.minValue=this.normalize(e):this.minValue=e},setMax:function(e){this.clearMaxValue=e,typeof this.normalize=="function"?this.maxValue=this.normalize(e):this.maxValue=e},setScale:function(e){var t;for(t=0;t<e.length;t++)this.scale[t]=[e[t]]},setNormalizeFunction:function(e){e==="polynomial"?this.normalize=function(e){return Math.pow(e,.2)}:e==="linear"?delete this.normalize:this.normalize=e,this.setMin(this.clearMinValue),this.setMax(this.clearMaxValue)},getValue:function(e){var t=[],n=0,r,i=0,s;typeof this.normalize=="function"&&(e=this.normalize(e));for(i=0;i<this.scale.length-1;i++)r=this.vectorLength(this.vectorSubtract(this.scale[i+1],this.scale[i])),t.push(r),n+=r;s=(this.maxValue-this.minValue)/n;for(i=0;i<t.length;i++)t[i]*=s;i=0,e-=this.minValue;while(e-t[i]>=0)e-=t[i],i++;return i==this.scale.length-1?e=this.vectorToNum(this.scale[i]):e=this.vectorToNum(this.vectorAdd(this.scale[i],this.vectorMult(this.vectorSubtract(this.scale[i+1],this.scale[i]),e/t[i]))),e},vectorToNum:function(e){var t=0,n;for(n=0;n<e.length;n++)t+=Math.round(e[n])*Math.pow(256,e.length-n-1);return t},vectorSubtract:function(e,t){var n=[],r;for(r=0;r<e.length;r++)n[r]=e[r]-t[r];return n},vectorAdd:function(e,t){var n=[],r;for(r=0;r<e.length;r++)n[r]=e[r]+t[r];return n},vectorMult:function(e,t){var n=[],r;for(r=0;r<e.length;r++)n[r]=e[r]*t;return n},vectorLength:function(e){var t=0,n;for(n=0;n<e.length;n++)t+=e[n]*e[n];return Math.sqrt(t)}},jvm.ColorScale=function(e,t,n,r){jvm.ColorScale.parentClass.apply(this,arguments)},jvm.inherits(jvm.ColorScale,jvm.NumericScale),jvm.ColorScale.prototype.setScale=function(e){var t;for(t=0;t<e.length;t++)this.scale[t]=jvm.ColorScale.rgbToArray(e[t])},jvm.ColorScale.prototype.getValue=function(e){return jvm.ColorScale.numToRgb(jvm.ColorScale.parentClass.prototype.getValue.call(this,e))},jvm.ColorScale.arrayToRgb=function(e){var t="#",n,r;for(r=0;r<e.length;r++)n=e[r].toString(16),t+=n.length==1?"0"+n:n;return t},jvm.ColorScale.numToRgb=function(e){e=e.toString(16);while(e.length<6)e="0"+e;return"#"+e},jvm.ColorScale.rgbToArray=function(e){return e=e.substr(1),[parseInt(e.substr(0,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(4,2),16)]},jvm.DataSeries=function(e,t){var n;e=e||{},e.attribute=e.attribute||"fill",this.elements=t,this.params=e,e.attributes&&this.setAttributes(e.attributes),jvm.$.isArray(e.scale)?(n=e.attribute==="fill"||e.attribute==="stroke"?jvm.ColorScale:jvm.NumericScale,this.scale=new n(e.scale,e.normalizeFunction,e.min,e.max)):e.scale?this.scale=new jvm.OrdinalScale(e.scale):this.scale=new jvm.SimpleScale(e.scale),this.values=e.values||{},this.setValues(this.values)},jvm.DataSeries.prototype={setAttributes:function(e,t){var n=e,r;if(typeof e=="string")this.elements[e]&&this.elements[e].setStyle(this.params.attribute,t);else for(r in n)this.elements[r]&&this.elements[r].element.setStyle(this.params.attribute,n[r])},setValues:function(e){var t=Number.MIN_VALUE,n=Number.MAX_VALUE,r,i,s={};if(this.scale instanceof jvm.OrdinalScale||this.scale instanceof jvm.SimpleScale)for(i in e)e[i]?s[i]=this.scale.getValue(e[i]):s[i]=this.elements[i].element.style.initial[this.params.attribute];else{if(!this.params.min||!this.params.max){for(i in e)r=parseFloat(e[i]),r>t&&(t=e[i]),r<n&&(n=r);this.params.min||this.scale.setMin(n),this.params.max||this.scale.setMax(t),this.params.min=n,this.params.max=t}for(i in e)r=parseFloat(e[i]),isNaN(r)?s[i]=this.elements[i].element.style.initial[this.params.attribute]:s[i]=this.scale.getValue(r)}this.setAttributes(s),jvm.$.extend(this.values,e)},clear:function(){var e,t={};for(e in this.values)this.elements[e]&&(t[e]=this.elements[e].element.style.initial[this.params.attribute]);this.setAttributes(t),this.values={}},setScale:function(e){this.scale.setScale(e),this.values&&this.setValues(this.values)},setNormalizeFunction:function(e){this.scale.setNormalizeFunction(e),this.values&&this.setValues(this.values)}},jvm.Proj={degRad:180/Math.PI,radDeg:Math.PI/180,radius:6381372,sgn:function(e){return e>0?1:e<0?-1:e},mill:function(e,t,n){return{x:this.radius*(t-n)*this.radDeg,y:-this.radius*Math.log(Math.tan((45+.4*e)*this.radDeg))/.8}},mill_inv:function(e,t,n){return{lat:(2.5*Math.atan(Math.exp(.8*t/this.radius))-5*Math.PI/8)*this.degRad,lng:(n*this.radDeg+e/this.radius)*this.degRad}},merc:function(e,t,n){return{x:this.radius*(t-n)*this.radDeg,y:-this.radius*Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}},merc_inv:function(e,t,n){return{lat:(2*Math.atan(Math.exp(t/this.radius))-Math.PI/2)*this.degRad,lng:(n*this.radDeg+e/this.radius)*this.degRad}},aea:function(e,t,n){var r=0,i=n*this.radDeg,s=29.5*this.radDeg,o=45.5*this.radDeg,u=e*this.radDeg,a=t*this.radDeg,f=(Math.sin(s)+Math.sin(o))/2,l=Math.cos(s)*Math.cos(s)+2*f*Math.sin(s),c=f*(a-i),h=Math.sqrt(l-2*f*Math.sin(u))/f,p=Math.sqrt(l-2*f*Math.sin(r))/f;return{x:h*Math.sin(c)*this.radius,y:-(p-h*Math.cos(c))*this.radius}},aea_inv:function(e,t,n){var r=e/this.radius,i=t/this.radius,s=0,o=n*this.radDeg,u=29.5*this.radDeg,a=45.5*this.radDeg,f=(Math.sin(u)+Math.sin(a))/2,l=Math.cos(u)*Math.cos(u)+2*f*Math.sin(u),c=Math.sqrt(l-2*f*Math.sin(s))/f,h=Math.sqrt(r*r+(c-i)*(c-i)),p=Math.atan(r/(c-i));return{lat:Math.asin((l-h*h*f*f)/(2*f))*this.degRad,lng:(o+p/f)*this.degRad}},lcc:function(e,t,n){var r=0,i=n*this.radDeg,s=t*this.radDeg,o=33*this.radDeg,u=45*this.radDeg,a=e*this.radDeg,f=Math.log(Math.cos(o)*(1/Math.cos(u)))/Math.log(Math.tan(Math.PI/4+u/2)*(1/Math.tan(Math.PI/4+o/2))),l=Math.cos(o)*Math.pow(Math.tan(Math.PI/4+o/2),f)/f,c=l*Math.pow(1/Math.tan(Math.PI/4+a/2),f),h=l*Math.pow(1/Math.tan(Math.PI/4+r/2),f);return{x:c*Math.sin(f*(s-i))*this.radius,y:-(h-c*Math.cos(f*(s-i)))*this.radius}},lcc_inv:function(e,t,n){var r=e/this.radius,i=t/this.radius,s=0,o=n*this.radDeg,u=33*this.radDeg,a=45*this.radDeg,f=Math.log(Math.cos(u)*(1/Math.cos(a)))/Math.log(Math.tan(Math.PI/4+a/2)*(1/Math.tan(Math.PI/4+u/2))),l=Math.cos(u)*Math.pow(Math.tan(Math.PI/4+u/2),f)/f,c=l*Math.pow(1/Math.tan(Math.PI/4+s/2),f),h=this.sgn(f)*Math.sqrt(r*r+(c-i)*(c-i)),p=Math.atan(r/(c-i));return{lat:(2*Math.atan(Math.pow(l/h,1/f))-Math.PI/2)*this.degRad,lng:(o+p/f)*this.degRad}}},jvm.WorldMap=function(e){var t=this,n;this.params=jvm.$.extend(!0,{},jvm.WorldMap.defaultParams,e);if(!jvm.WorldMap.maps[this.params.map])throw new Error("Attempt to use map which was not loaded: "+this.params.map);this.mapData=jvm.WorldMap.maps[this.params.map],this.markers={},this.regions={},this.regionsColors={},this.regionsData={},this.container=jvm.$("<div>").css({width:"100%",height:"100%"}).addClass("jvectormap-container"),this.params.container.append(this.container),this.container.data("mapObject",this),this.container.css({position:"relative",overflow:"hidden"}),this.defaultWidth=this.mapData.width,this.defaultHeight=this.mapData.height,this.setBackgroundColor(this.params.backgroundColor),this.onResize=function(){t.setSize()},jvm.$(window).resize(this.onResize);for(n in jvm.WorldMap.apiEvents)this.params[n]&&this.container.bind(jvm.WorldMap.apiEvents[n]+".jvectormap",this.params[n]);this.canvas=new jvm.VectorCanvas(this.container[0],this.width,this.height),"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch?this.params.bindTouchEvents&&this.bindContainerTouchEvents():this.bindContainerEvents(),this.bindElementEvents(),this.createLabel(),this.params.zoomButtons&&this.bindZoomButtons(),this.createRegions(),this.createMarkers(this.params.markers||{}),this.setSize(),this.params.focusOn&&(typeof this.params.focusOn=="object"?this.setFocus.call(this,this.params.focusOn.scale,this.params.focusOn.x,this.params.focusOn.y):this.setFocus.call(this,this.params.focusOn)),this.params.selectedRegions&&this.setSelectedRegions(this.params.selectedRegions),this.params.selectedMarkers&&this.setSelectedMarkers(this.params.selectedMarkers),this.params.series&&this.createSeries()},jvm.WorldMap.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,setBackgroundColor:function(e){this.container.css("background-color",e)},resize:function(){var e=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/e,this.transX*=this.baseScale/e,this.transY*=this.baseScale/e},setSize:function(){this.width=this.container.width(),this.height=this.container.height(),this.resize(),this.canvas.setSize(this.width,this.height),this.applyTransform()},reset:function(){var e,t;for(e in this.series)for(t=0;t<this.series[e].length;t++)this.series[e][t].clear();this.scale=this.baseScale,this.transX=this.baseTransX,this.transY=this.baseTransY,this.applyTransform()},applyTransform:function(){var e,t,n,r;this.defaultWidth*this.scale<=this.width?(e=(this.width-this.defaultWidth*this.scale)/(2*this.scale),n=(this.width-this.defaultWidth*this.scale)/(2*this.scale)):(e=0,n=(this.width-this.defaultWidth*this.scale)/this.scale),this.defaultHeight*this.scale<=this.height?(t=(this.height-this.defaultHeight*this.scale)/(2*this.scale),r=(this.height-this.defaultHeight*this.scale)/(2*this.scale)):(t=0,r=(this.height-this.defaultHeight*this.scale)/this.scale),this.transY>t?this.transY=t:this.transY<r&&(this.transY=r),this.transX>e?this.transX=e:this.transX<n&&(this.transX=n),this.canvas.applyTransformParams(this.scale,this.transX,this.transY),this.markers&&this.repositionMarkers(),this.container.trigger("viewportChange",[this.scale/this.baseScale,this.transX,this.transY])},bindContainerEvents:function(){var e=!1,t,n,r=this;this.container.mousemove(function(i){return e&&(r.transX-=(t-i.pageX)/r.scale,r.transY-=(n-i.pageY)/r.scale,r.applyTransform(),t=i.pageX,n=i.pageY),!1}).mousedown(function(r){return e=!0,t=r.pageX,n=r.pageY,!1}),jvm.$("body").mouseup(function(){e=!1}),this.params.zoomOnScroll&&this.container.mousewheel(function(e,t,n,i){var s=jvm.$(r.container).offset(),o=e.pageX-s.left,u=e.pageY-s.top,a=Math.pow(1.3,i);r.label.hide(),r.setScale(r.scale*a,o,u),e.preventDefault()})},bindContainerTouchEvents:function(){var e,t,n=this,r,i,s,o,u,a=function(a){var f=a.originalEvent.touches,l,c,h,p;a.type=="touchstart"&&(u=0),f.length==1?(u==1&&(h=n.transX,p=n.transY,n.transX-=(r-f[0].pageX)/n.scale,n.transY-=(i-f[0].pageY)/n.scale,n.applyTransform(),n.label.hide(),(h!=n.transX||p!=n.transY)&&a.preventDefault()),r=f[0].pageX,i=f[0].pageY):f.length==2&&(u==2?(c=Math.sqrt(Math.pow(f[0].pageX-f[1].pageX,2)+Math.pow(f[0].pageY-f[1].pageY,2))/t,n.setScale(e*c,s,o),n.label.hide(),a.preventDefault()):(l=jvm.$(n.container).offset(),f[0].pageX>f[1].pageX?s=f[1].pageX+(f[0].pageX-f[1].pageX)/2:s=f[0].pageX+(f[1].pageX-f[0].pageX)/2,f[0].pageY>f[1].pageY?o=f[1].pageY+(f[0].pageY-f[1].pageY)/2:o=f[0].pageY+(f[1].pageY-f[0].pageY)/2,s-=l.left,o-=l.top,e=n.scale,t=Math.sqrt(Math.pow(f[0].pageX-f[1].pageX,2)+Math.pow(f[0].pageY-f[1].pageY,2)))),u=f.length};jvm.$(this.container).bind("touchstart",a),jvm.$(this.container).bind("touchmove",a)},bindElementEvents:function(){var e=this,t;this.container.mousemove(function(){t=!0}),this.container.delegate("[class~='jvectormap-element']","mouseover mouseout",function(t){var n=this,r=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),i=r.indexOf("jvectormap-region")===-1?"marker":"region",s=i=="region"?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),o=i=="region"?e.regions[s].element:e.markers[s].element,u=i=="region"?e.mapData.paths[s].name:e.markers[s].config.name||"",a=jvm.$.Event(i+"LabelShow.jvectormap"),f=jvm.$.Event(i+"Over.jvectormap");t.type=="mouseover"?(e.container.trigger(f,[s]),f.isDefaultPrevented()||o.setHovered(!0),e.label.text(u),e.container.trigger(a,[e.label,s]),a.isDefaultPrevented()||(e.label.show(),e.labelWidth=e.label.width(),e.labelHeight=e.label.height())):(o.setHovered(!1),e.label.hide(),e.container.trigger(i+"Out.jvectormap",[s]))}),this.container.delegate("[class~='jvectormap-element']","mousedown",function(e){t=!1}),this.container.delegate("[class~='jvectormap-element']","mouseup",function(n){var r=this,i=jvm.$(this).attr("class").baseVal?jvm.$(this).attr("class").baseVal:jvm.$(this).attr("class"),s=i.indexOf("jvectormap-region")===-1?"marker":"region",o=s=="region"?jvm.$(this).attr("data-code"):jvm.$(this).attr("data-index"),u=jvm.$.Event(s+"Click.jvectormap"),a=s=="region"?e.regions[o].element:e.markers[o].element;if(!t){e.container.trigger(u,[o]);if(s==="region"&&e.params.regionsSelectable||s==="marker"&&e.params.markersSelectable)u.isDefaultPrevented()||(e.params[s+"sSelectableOne"]&&e.clearSelected(s+"s"),a.setSelected(!a.isSelected))}})},bindZoomButtons:function(){var e=this;jvm.$("<div/>").addClass("jvectormap-zoomin").text("+").appendTo(this.container),jvm.$("<div/>").addClass("jvectormap-zoomout").html("&#x2212;").appendTo(this.container),this.container.find(".jvectormap-zoomin").click(function(){e.setScale(e.scale*e.params.zoomStep,e.width/2,e.height/2)}),this.container.find(".jvectormap-zoomout").click(function(){e.setScale(e.scale/e.params.zoomStep,e.width/2,e.height/2)})},createLabel:function(){var e=this;this.label=jvm.$("<div/>").addClass("jvectormap-label").appendTo(jvm.$("body")),this.container.mousemove(function(t){var n=t.pageX-15-e.labelWidth,r=t.pageY-15-e.labelHeight;n<5&&(n=t.pageX+15),r<5&&(r=t.pageY+15),e.label.is(":visible")&&e.label.css({left:n,top:r})})},setScale:function(e,t,n,r){var i,s=jvm.$.Event("zoom.jvectormap");e>this.params.zoomMax*this.baseScale?e=this.params.zoomMax*this.baseScale:e<this.params.zoomMin*this.baseScale&&(e=this.params.zoomMin*this.baseScale),typeof t!="undefined"&&typeof n!="undefined"&&(i=e/this.scale,r?(this.transX=t+this.defaultWidth*(this.width/(this.defaultWidth*e))/2,this.transY=n+this.defaultHeight*(this.height/(this.defaultHeight*e))/2):(this.transX-=(i-1)/e*t,this.transY-=(i-1)/e*n)),this.scale=e,this.applyTransform(),this.container.trigger(s,[e/this.baseScale])},setFocus:function(e,t,n){var r,i,s,o,u;if(jvm.$.isArray(e)||this.regions[e]){jvm.$.isArray(e)?o=e:o=[e];for(u=0;u<o.length;u++)this.regions[o[u]]&&(i=this.regions[o[u]].element.getBBox(),i&&(typeof r=="undefined"?r=i:(s={x:Math.min(r.x,i.x),y:Math.min(r.y,i.y),width:Math.max(r.x+r.width,i.x+i.width)-Math.min(r.x,i.x),height:Math.max(r.y+r.height,i.y+i.height)-Math.min(r.y,i.y)},r=s)));this.setScale(Math.min(this.width/r.width,this.height/r.height),-(r.x+r.width/2),-(r.y+r.height/2),!0)}else e*=this.baseScale,this.setScale(e,-t*this.defaultWidth,-n*this.defaultHeight,!0)},getSelected:function(e){var t,n=[];for(t in this[e])this[e][t].element.isSelected&&n.push(t);return n},getSelectedRegions:function(){return this.getSelected("regions")},getSelectedMarkers:function(){return this.getSelected("markers")},setSelected:function(e,t){var n;typeof t!="object"&&(t=[t]);if(jvm.$.isArray(t))for(n=0;n<t.length;n++)this[e][t[n]].element.setSelected(!0);else for(n in t)this[e][n].element.setSelected(!!t[n])},setSelectedRegions:function(e){this.setSelected("regions",e)},setSelectedMarkers:function(e){this.setSelected("markers",e)},clearSelected:function(e){var t={},n=this.getSelected(e),r;for(r=0;r<n.length;r++)t[n[r]]=!1;this.setSelected(e,t)},clearSelectedRegions:function(){this.clearSelected("regions")},clearSelectedMarkers:function(){this.clearSelected("markers")},getMapObject:function(){return this},getRegionName:function(e){return this.mapData.paths[e].name},createRegions:function(){var e,t,n=this;for(e in this.mapData.paths)t=this.canvas.addPath({d:this.mapData.paths[e].path,"data-code":e},jvm.$.extend(!0,{},this.params.regionStyle)),jvm.$(t.node).bind("selected",function(e,t){n.container.trigger("regionSelected.jvectormap",[jvm.$(this).attr("data-code"),t,n.getSelectedRegions()])}),t.addClass("jvectormap-region jvectormap-element"),this.regions[e]={element:t,config:this.mapData.paths[e]}},createMarkers:function(e){var t,n,r,i,s,o=this;this.markersGroup=this.markersGroup||this.canvas.addGroup();if(jvm.$.isArray(e)){s=e.slice(),e={};for(t=0;t<s.length;t++)e[t]=s[t]}for(t in e)i=e[t]instanceof Array?{latLng:e[t]}:e[t],r=this.getMarkerPosition(i),r!==!1&&(n=this.canvas.addCircle({"data-index":t,cx:r.x,cy:r.y},jvm.$.extend(!0,{},this.params.markerStyle,{initial:i.style||{}}),this.markersGroup),n.addClass("jvectormap-marker jvectormap-element"),jvm.$(n.node).bind("selected",function(e,t){o.container.trigger("markerSelected.jvectormap",[jvm.$(this).attr("data-index"),t,o.getSelectedMarkers()])}),this.markers[t]&&this.removeMarkers([t]),this.markers[t]={element:n,config:i})},repositionMarkers:function(){var e,t;for(e in this.markers)t=this.getMarkerPosition(this.markers[e].config),t!==!1&&this.markers[e].element.setStyle({cx:t.x,cy:t.y})},getMarkerPosition:function(e){return jvm.WorldMap.maps[this.params.map].projection?this.latLngToPoint.apply(this,e.latLng||[0,0]):{x:e.coords[0]*this.scale+this.transX*this.scale,y:e.coords[1]*this.scale+this.transY*this.scale}},addMarker:function(e,t,n){var r={},i=[],s,o,n=n||[];r[e]=t;for(o=0;o<n.length;o++)s={},s[e]=n[o],i.push(s);this.addMarkers(r,i)},addMarkers:function(e,t){var n;t=t||[],this.createMarkers(e);for(n=0;n<t.length;n++)this.series.markers[n].setValues(t[n]||{})},removeMarkers:function(e){var t;for(t=0;t<e.length;t++)this.markers[e[t]].element.remove(),delete this.markers[e[t]]},removeAllMarkers:function(){var e,t=[];for(e in this.markers)t.push(e);this.removeMarkers(t)},latLngToPoint:function(e,t){var n,r=jvm.WorldMap.maps[this.params.map].projection,i=r.centralMeridian,s=this.width-this.baseTransX*2*this.baseScale,o=this.height-this.baseTransY*2*this.baseScale,u,a,f=this.scale/this.baseScale;return t<-180+i&&(t+=360),n=jvm.Proj[r.type](e,t,i),u=this.getInsetForPoint(n.x,n.y),u?(a=u.bbox,n.x=(n.x-a[0].x)/(a[1].x-a[0].x)*u.width*this.scale,n.y=(n.y-a[0].y)/(a[1].y-a[0].y)*u.height*this.scale,{x:n.x+this.transX*this.scale+u.left*this.scale,y:n.y+this.transY*this.scale+u.top*this.scale}):!1},pointToLatLng:function(e,t){var n=jvm.WorldMap.maps[this.params.map].projection,r=n.centralMeridian,i=jvm.WorldMap.maps[this.params.map].insets,s,o,u,a,f;for(s=0;s<i.length;s++){o=i[s],u=o.bbox,a=e-(this.transX*this.scale+o.left*this.scale),f=t-(this.transY*this.scale+o.top*this.scale),a=a/(o.width*this.scale)*(u[1].x-u[0].x)+u[0].x,f=f/(o.height*this.scale)*(u[1].y-u[0].y)+u[0].y;if(a>u[0].x&&a<u[1].x&&f>u[0].y&&f<u[1].y)return jvm.Proj[n.type+"_inv"](a,-f,r)}return!1},getInsetForPoint:function(e,t){var n=jvm.WorldMap.maps[this.params.map].insets,r,i;for(r=0;r<n.length;r++){i=n[r].bbox;if(e>i[0].x&&e<i[1].x&&t>i[0].y&&t<i[1].y)return n[r]}},createSeries:function(){var e,t;this.series={markers:[],regions:[]};for(t in this.params.series)for(e=0;e<this.params.series[t].length;e++)this.series[t][e]=new jvm.DataSeries(this.params.series[t][e],this[t])},remove:function(){this.label.remove(),this.container.remove(),jvm.$(window).unbind("resize",this.onResize)}},jvm.WorldMap.maps={},jvm.WorldMap.defaultParams={map:"world_mill_en",backgroundColor:"#505050",zoomButtons:!0,zoomOnScroll:!0,zoomMax:8,zoomMin:1,zoomStep:1.6,regionsSelectable:!1,markersSelectable:!1,bindTouchEvents:!0,regionStyle:{initial:{fill:"white","fill-opacity":1,stroke:"none","stroke-width":0,"stroke-opacity":1},hover:{"fill-opacity":.8},selected:{fill:"yellow"},selectedHover
+:{}},markerStyle:{initial:{fill:"grey",stroke:"#505050","fill-opacity":1,"stroke-width":1,"stroke-opacity":1,r:5},hover:{stroke:"black","stroke-width":2},selected:{fill:"blue"},selectedHover:{}}},jvm.WorldMap.apiEvents={onRegionLabelShow:"regionLabelShow",onRegionOver:"regionOver",onRegionOut:"regionOut",onRegionClick:"regionClick",onRegionSelected:"regionSelected",onMarkerLabelShow:"markerLabelShow",onMarkerOver:"markerOver",onMarkerOut:"markerOut",onMarkerClick:"markerClick",onMarkerSelected:"markerSelected",onViewportChange:"viewportChange"}; \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-usa-en.js b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-usa-en.js
new file mode 100644
index 0000000..34b08e2
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-usa-en.js
@@ -0,0 +1 @@
+jQuery.fn.vectorMap('addMap', 'us_aea',{"insets": [{"width": 220, "top": 440, "height": 172.3954126857679, "bbox": [{"y": -8441276.54251503, "x": -4774054.664881943}, {"y": -6227982.667213126, "x": -1949590.5739843722}], "left": 0}, {"width": 80, "top": 460, "height": 151.48337407091987, "bbox": [{"y": -4196208.652471859, "x": -5906305.806252358}, {"y": -3657293.3059425415, "x": -5621698.812337889}], "left": 245}, {"width": 900, "top": 0, "height": 550.1122047105795, "bbox": [{"y": -5490816.561605522, "x": -2029882.6485830692}, {"y": -2690009.0242363815, "x": 2552322.14899711}], "left": 0}], "paths": {"US-VA": {"path": "M682.42,289.98l1.61,-0.93l1.65,-0.48l1.12,-0.95l3.57,-1.69l0.74,-2.33l0.82,-0.19l2.32,-1.53l0.05,-1.81l2.04,-1.86l-0.13,-1.58l0.26,-0.41l5.0,-4.09l4.76,-6.0l0.09,0.63l0.96,0.54l0.33,1.37l1.32,0.74l0.71,0.81l1.46,0.09l2.09,1.13l1.41,-0.09l0.79,-0.41l0.76,-1.22l1.17,-0.57l0.53,-1.38l2.72,1.49l1.42,-1.1l2.25,-0.99l0.76,0.06l1.08,-0.97l0.33,-0.82l-0.48,-0.96l0.23,-0.42l1.9,0.58l3.26,-2.62l0.3,-0.1l0.51,0.73l0.66,-0.07l2.38,-2.34l0.17,-0.85l-0.49,-0.51l0.99,-1.12l0.1,-0.6l-0.28,-0.51l-1.0,-0.46l0.71,-3.03l2.6,-4.8l0.55,-2.15l-0.01,-1.91l1.61,-2.55l-0.22,-0.94l0.24,-0.84l0.5,-0.48l0.39,-1.7l-0.0,-3.18l1.22,0.19l1.18,1.73l3.8,0.43l0.59,-0.28l1.05,-2.52l0.2,-2.36l0.71,-1.05l-0.04,-1.61l0.76,-2.3l1.78,0.75l0.65,-0.17l1.3,-3.3l0.57,0.05l0.59,-0.39l0.52,-1.2l0.81,-0.68l0.44,-1.8l1.38,-2.43l-0.35,-2.57l0.54,-1.76l-0.3,-2.01l9.18,4.57l0.59,-0.29l0.63,-4.0l2.6,-0.07l0.63,0.57l1.05,0.23l-0.5,1.74l0.6,0.88l1.61,0.85l2.52,-0.04l1.03,1.18l1.49,0.13l2.24,1.73l-0.0,1.31l0.44,1.27l-1.67,0.96l-0.12,0.65l-0.64,0.14l-0.27,0.45l-0.47,5.03l-0.36,0.13l-0.04,0.48l1.17,0.97l-0.29,0.11l-0.04,0.76l2.03,-0.01l2.41,-1.45l0.49,-0.72l0.34,0.74l-0.52,0.63l1.21,0.88l0.69,0.13l0.42,1.11l1.62,0.52l1.94,-0.2l0.84,0.43l0.82,-0.65l0.89,0.02l0.23,0.6l1.33,0.48l0.46,1.1l1.12,-0.05l0.02,0.3l1.18,0.42l2.84,0.65l0.4,1.01l-0.85,-0.41l-0.57,0.45l0.89,1.74l-0.35,0.57l0.62,0.79l-0.43,0.89l0.24,0.59l-1.36,-0.36l-0.59,-0.72l-0.67,0.18l-0.1,0.43l-2.44,-2.29l-0.56,0.05l-0.37,-0.56l-0.52,0.32l-1.47,-1.32l-1.19,-0.38l-0.43,-0.64l-0.9,-0.39l-0.7,-1.29l-0.77,-0.64l-1.34,-0.12l-1.11,-0.81l-1.17,0.05l-0.39,0.52l0.47,0.71l1.1,-0.01l0.63,0.68l1.33,0.07l0.59,0.42l0.38,1.52l2.73,1.56l1.86,1.88l1.95,0.61l1.59,2.1l0.98,0.24l1.35,-0.45l1.28,0.47l-0.61,0.7l0.3,0.49l2.03,0.34l0.26,0.72l0.47,0.12l0.31,1.96l-0.57,-0.83l-0.52,-0.22l-0.39,0.21l-1.13,-1.0l-0.58,0.3l0.1,0.82l-0.31,0.68l0.7,0.7l-0.18,0.59l0.51,0.28l0.43,-0.14l0.28,0.35l-1.39,0.72l-6.15,-4.74l-0.58,0.11l-0.19,0.81l0.24,0.54l2.28,1.53l2.09,2.14l2.77,1.18l1.26,-0.68l0.45,1.05l1.27,0.26l-0.44,0.67l0.29,0.56l0.93,-0.19l-0.0,1.24l-0.92,0.41l-0.57,0.73l-0.64,-0.88l-3.14,-1.26l-0.42,-1.53l-0.59,-0.59l-0.87,-0.12l-1.2,0.67l-1.71,-0.44l-0.36,-1.15l-0.71,-0.05l-0.05,1.31l-0.33,0.41l-1.42,-1.32l-0.51,0.09l-0.49,0.57l-0.64,-0.4l-0.99,0.45l-2.23,-0.1l-0.37,0.94l0.34,0.46l1.9,0.22l1.4,-0.31l0.85,0.24l0.56,-0.69l0.63,0.88l1.34,0.43l1.95,-0.31l0.82,0.72l0.84,0.12l0.51,-0.55l0.77,2.44l1.35,0.13l0.23,0.43l1.68,0.71l0.45,0.68l-0.57,1.03l0.56,0.44l1.72,-1.32l0.88,-0.02l0.83,0.65l0.8,-0.26l-0.61,-0.9l0.0,-0.82l-0.46,-0.34l3.99,0.08l0.93,-0.73l2.07,3.53l-0.4,0.7l0.65,3.09l-1.19,-0.58l-0.02,0.88l-30.94,7.83l-37.18,8.41l-19.51,3.35l-11.78,1.24l-0.82,0.62l-28.2,5.01ZM781.17,223.48l0.11,0.08l-0.08,0.06l0.0,-0.03l-0.03,-0.11ZM808.02,244.55l0.53,-1.15l-0.62,-0.62l0.58,-0.97l-0.39,-0.71l-0.03,-0.49l0.44,-0.35l-0.17,-0.73l0.62,-0.3l0.23,-0.6l0.14,-2.33l1.01,-0.39l-0.12,-0.9l0.48,-0.14l-0.26,-1.53l-0.79,-0.4l0.87,-0.57l0.1,-0.96l2.64,-1.01l0.31,2.47l-0.97,2.12l-2.32,7.36l-0.58,1.0l0.17,1.12l-0.48,0.31l-0.33,1.09l0.25,4.27l-1.1,-1.81l0.23,-0.94l-0.33,-1.57l0.28,-0.97l-0.38,-0.29Z", "name": "Virginia"}, "US-PA": {"path": "M716.45,159.95l0.63,-0.19l4.3,-3.73l1.12,5.19l0.48,0.31l34.84,-7.93l34.27,-8.64l1.42,0.58l0.71,1.39l0.63,0.13l0.77,-0.33l1.24,0.59l0.14,0.85l0.81,0.41l-0.16,0.58l0.89,2.69l1.9,2.07l2.12,0.75l2.2,-0.2l0.72,0.79l-0.89,0.87l-0.73,1.48l-0.17,2.25l-1.41,3.35l-1.37,1.58l0.04,0.79l1.79,1.72l-0.31,1.65l-0.84,0.43l-0.22,0.66l0.14,1.48l1.04,2.87l0.52,0.25l1.2,-0.18l1.18,2.39l0.95,0.58l0.66,-0.26l0.6,0.9l4.23,2.75l0.12,0.41l-1.29,0.93l-3.71,4.22l-0.23,0.75l0.17,0.9l-1.36,1.13l-0.84,0.15l-1.33,1.08l-0.31,0.66l-1.72,-0.12l-2.03,0.84l-1.15,1.37l-0.41,1.39l-37.22,9.21l-39.1,8.66l-10.03,-48.2l1.92,-1.22l3.07,-3.04Z", "name": "Pennsylvania"}, "US-TN": {"path": "M571.74,341.02l0.86,-0.84l0.29,-1.37l1.0,0.04l0.65,-0.79l-0.99,-4.89l1.41,-1.93l0.06,-1.32l1.18,-0.46l0.36,-0.48l-0.63,-1.31l0.57,-1.21l-0.89,-1.33l2.55,-1.57l1.09,-1.13l-0.14,-0.84l-0.85,-0.53l0.14,-0.19l0.34,-0.16l0.85,0.37l0.46,-0.33l-0.27,-1.31l-0.85,-0.9l0.06,-0.71l0.51,-1.43l1.0,-1.11l-1.35,-2.06l1.37,-0.21l0.61,-0.55l-0.13,-0.64l-1.17,-0.82l0.82,-0.15l0.58,-0.54l0.13,-0.69l-0.58,-1.38l0.02,-0.36l0.37,0.53l0.47,0.08l1.18,-1.15l23.66,-2.81l0.35,-0.41l-0.1,-1.34l-0.84,-2.39l2.98,-0.08l0.82,0.58l22.78,-3.54l7.64,-0.46l7.5,-0.86l8.82,-1.42l24.01,-3.09l1.11,-0.6l29.29,-5.2l0.73,-0.6l3.56,-0.54l-0.4,1.44l0.43,0.85l-0.4,2.0l0.36,0.82l-1.15,-0.03l-1.71,1.79l-1.21,3.89l-0.55,0.7l-0.56,0.08l-0.63,-0.74l-1.44,-0.02l-2.66,1.73l-1.42,2.73l-0.96,0.89l-0.34,-0.34l-0.13,-1.05l-0.73,-0.54l-0.53,0.15l-2.3,1.81l-0.29,1.32l-0.93,-0.24l-0.9,0.48l-0.16,0.77l0.32,0.73l-0.85,2.18l-1.28,0.06l-1.75,1.14l-1.89,2.3l-0.78,0.27l-2.28,2.46l-4.04,0.78l-2.58,1.7l-0.49,1.09l-0.88,0.55l-0.55,0.81l-0.18,2.88l-0.35,0.6l-1.65,0.52l-0.89,-0.16l-1.06,1.14l0.21,5.24l-20.21,3.32l-21.61,3.04l-25.56,2.95l-0.34,0.31l-7.39,0.9l-28.72,3.17Z", "name": "Tennessee"}, "US-WV": {"path": "M693.03,248.37l3.95,-1.54l0.35,-0.71l0.12,-2.77l1.15,-0.22l0.4,-0.61l-0.57,-2.49l-0.61,-1.24l0.49,-0.64l0.36,-2.77l0.68,-1.66l0.45,-0.39l1.24,0.55l0.41,0.71l-0.14,1.13l0.71,0.46l0.78,-0.44l0.48,-1.42l0.49,0.21l0.57,-0.2l0.2,-0.44l-0.63,-2.09l-0.75,-0.55l0.81,-0.79l-0.26,-1.71l0.74,-2.0l1.65,-0.51l0.17,-1.6l1.02,-1.42l0.43,-0.08l0.65,0.79l0.67,0.19l2.28,-1.59l1.5,-1.64l0.79,-1.83l2.45,-2.67l0.37,-2.41l-0.73,-1.0l0.71,-2.33l-0.25,-0.76l0.59,-0.58l-0.27,-3.43l0.47,-3.93l0.53,-0.8l0.08,-1.11l-0.38,-1.21l-0.39,-0.33l-0.04,-2.0l-1.57,-1.9l0.44,-0.54l0.85,-0.1l0.3,-0.33l4.03,19.33l0.47,0.31l16.59,-3.55l2.17,10.68l0.5,0.37l2.06,-2.5l0.97,-0.56l0.34,-1.03l1.63,-1.99l0.25,-1.05l0.52,-0.4l1.19,0.45l0.74,-0.32l1.32,-2.6l0.6,-0.46l-0.04,-0.85l0.42,0.59l1.81,0.52l3.2,-0.57l0.78,-0.86l0.08,-1.46l2.0,-0.74l1.02,-1.69l0.67,-0.1l3.16,1.5l1.8,-0.71l-0.45,1.02l0.56,0.92l1.27,0.42l0.09,0.96l1.13,0.43l0.09,1.2l0.33,0.42l-0.58,3.64l-9.0,-4.48l-0.64,0.24l-0.31,1.14l0.38,1.61l-0.52,1.62l0.41,2.28l-1.36,2.4l-0.42,1.76l-0.72,0.53l-0.42,1.11l-0.27,0.21l-0.61,-0.23l-0.37,0.33l-1.25,3.28l-1.84,-0.78l-0.64,0.25l-0.94,2.77l0.08,1.46l-0.73,1.14l-0.19,2.33l-0.89,2.2l-3.25,-0.36l-1.44,-1.76l-1.71,-0.24l-0.5,0.41l-0.26,2.17l0.19,1.3l-0.32,1.45l-0.49,0.45l-0.31,1.04l0.23,0.92l-1.58,2.44l-0.04,2.1l-0.52,2.0l-2.58,4.73l-0.75,3.16l0.14,0.76l1.13,0.55l-1.08,1.38l0.06,0.6l0.45,0.4l-2.16,2.13l-0.55,-0.7l-0.84,0.15l-3.12,2.53l-1.03,-0.56l-1.32,0.26l-0.44,0.91l0.45,1.17l-0.91,0.91l-0.73,-0.05l-2.27,1.0l-1.21,0.96l-2.18,-1.36l-0.73,-0.01l-0.82,1.58l-1.1,0.49l-1.22,1.46l-1.08,0.08l-1.98,-1.09l-1.3,-0.01l-0.61,-0.74l-1.19,-0.6l-0.31,-1.33l-0.89,-0.55l0.36,-0.67l-0.3,-0.81l-0.85,-0.37l-0.84,0.25l-1.33,-0.17l-1.26,-1.19l-2.06,-0.79l-0.76,-1.43l-1.58,-1.24l-0.7,-1.49l-1.0,-0.6l-0.12,-1.09l-1.38,-0.95l-2.0,-2.27l0.71,-2.03l-0.25,-1.62l-0.66,-1.46Z", "name": "West Virginia"}, "US-NV": {"path": "M139.46,329.14l-12.69,-16.93l-36.58,-51.09l-25.34,-34.51l13.7,-64.18l46.88,9.24l46.98,7.74l-18.71,125.81l-0.9,1.16l-0.99,2.19l-0.44,0.17l-1.34,-0.22l-0.98,-2.24l-0.7,-0.63l-1.41,0.22l-1.95,-1.02l-1.6,0.23l-1.78,0.96l-0.76,2.48l0.88,2.59l-0.6,0.97l-0.24,1.3l0.38,3.12l-0.76,2.54l0.77,3.71l-0.13,3.07l-0.3,1.07l-1.04,0.31l0.2,1.31l-0.52,0.62Z", "name": "Nevada"}, "US-TX": {"path": "M276.24,412.51l33.07,1.98l32.79,1.35l0.41,-0.39l3.6,-98.69l25.86,0.61l26.29,0.22l0.05,42.08l0.44,0.4l1.02,-0.13l0.78,0.28l3.74,3.82l1.66,0.21l0.88,-0.58l2.49,0.64l0.6,-0.68l0.11,-1.05l0.6,0.76l0.92,0.22l0.38,0.93l0.77,0.78l-0.01,1.64l0.52,0.83l2.85,0.42l1.25,-0.2l1.38,0.89l2.78,0.69l1.82,-0.56l0.62,0.1l1.89,1.8l1.4,-0.11l1.25,-1.43l2.43,0.26l1.67,-0.46l0.1,2.28l0.91,0.67l1.62,0.4l-0.04,2.08l1.56,0.79l1.82,-0.66l1.57,-1.67l1.02,-0.65l0.41,0.19l0.45,1.64l2.01,0.2l0.24,1.05l0.72,0.48l1.47,-0.21l0.88,-0.93l0.39,0.33l0.59,-0.08l0.61,-0.99l0.26,0.41l-0.45,1.23l0.14,0.76l0.67,1.14l0.78,0.42l0.57,-0.04l0.6,-0.5l0.68,-2.36l0.91,-0.65l0.35,-1.54l0.57,-0.14l0.4,0.14l0.29,0.99l0.57,0.64l1.21,0.02l0.83,0.5l1.25,-0.2l0.68,-1.34l0.48,0.15l-0.13,0.7l0.49,0.69l1.21,0.45l0.49,0.72l1.52,-0.05l1.49,1.74l0.52,0.02l0.63,-0.62l0.08,-0.71l1.49,-0.1l0.93,-1.43l1.88,-0.41l1.66,-1.13l1.52,0.83l1.51,-0.22l0.29,-0.83l2.29,-0.73l0.52,-0.55l0.5,0.32l0.38,0.88l1.82,0.42l1.69,-0.06l1.86,-1.14l0.41,-1.05l1.06,0.31l2.24,1.56l1.16,0.17l1.79,2.08l2.14,0.41l1.04,0.92l0.76,-0.11l2.48,0.85l1.04,0.04l0.37,0.79l1.38,0.97l1.45,-0.12l0.39,-0.72l0.8,0.36l0.88,-0.4l0.92,0.35l0.76,-0.15l0.64,0.36l2.22,34.02l1.51,1.67l1.3,0.82l1.25,1.87l0.57,1.63l-0.1,2.64l1.0,1.21l0.85,0.4l-0.12,0.85l0.75,0.54l0.28,0.87l0.65,0.7l-0.19,1.17l1.0,1.02l0.59,1.63l0.5,0.34l0.55,-0.1l-0.16,1.71l0.81,1.22l-0.64,0.25l-0.35,0.68l0.77,1.27l-0.55,0.89l0.19,1.39l-0.75,2.69l-0.74,0.85l-0.36,1.54l-0.79,1.13l0.64,2.0l-0.83,2.28l0.17,1.07l0.83,1.2l-0.19,1.01l0.49,1.6l-0.24,1.41l-1.18,1.78l-1.18,0.4l-1.16,2.72l-0.03,2.1l1.39,1.67l-3.43,0.08l-7.37,3.78l-0.02,-0.43l-0.69,-0.24l-0.23,0.23l-0.78,-0.43l-3.38,1.13l0.65,-1.31l0.35,-2.04l-0.34,-1.36l-0.8,-0.78l-1.79,0.16l-1.18,2.58l-0.42,0.15l-0.36,-0.65l-2.38,-1.23l-0.4,0.31l-0.18,0.82l0.23,0.45l1.07,0.38l-0.3,0.82l0.54,0.81l-0.47,0.64l0.04,0.99l1.48,0.76l-0.44,0.47l0.5,1.12l0.91,0.23l0.28,0.37l-0.4,1.25l-0.45,-0.12l-0.97,0.81l-1.72,2.25l-1.18,-0.4l-0.49,0.12l0.32,1.0l0.08,2.54l-1.85,1.49l-1.91,2.11l-0.96,0.37l-4.1,2.9l-3.3,0.44l-2.54,1.07l-0.2,1.12l-0.75,-0.34l-2.04,0.89l-0.33,-0.34l-1.11,0.18l0.43,-0.87l-0.52,-0.6l-1.43,0.22l-1.22,1.08l-0.6,-0.62l-0.11,-1.2l-1.38,-0.81l-0.5,0.44l0.65,1.44l0.01,1.12l-0.71,0.09l-0.54,-0.44l-0.75,-0.0l-0.55,-1.34l-1.46,-0.37l-0.58,0.39l0.04,0.54l0.94,1.7l0.03,1.23l0.58,0.37l0.37,-0.16l1.13,0.78l-0.75,0.37l-0.12,0.9l0.7,0.23l1.08,-0.55l0.96,0.6l-4.27,2.42l-0.57,-0.13l-0.37,-1.44l-0.5,-0.19l-1.13,-1.47l-0.48,-0.03l-1.05,1.99l1.19,1.61l-0.31,1.04l0.33,0.85l-1.66,1.79l-0.37,0.2l0.37,-0.63l-0.18,-0.72l0.25,-0.73l-0.46,-0.67l-0.52,0.17l-0.71,1.1l0.26,0.72l-0.39,0.95l-0.07,-1.13l-0.52,-0.55l-1.95,1.29l-0.78,-0.33l-0.69,0.51l0.07,0.75l-0.81,0.99l0.02,0.49l1.25,0.63l0.03,0.56l0.78,0.29l0.7,-1.41l0.86,-0.41l0.01,0.62l-2.82,4.36l-1.23,-1.0l-1.36,0.39l-0.32,-0.34l-2.4,0.39l-0.46,-0.31l-0.65,0.16l-0.18,0.58l0.41,0.61l0.55,0.38l1.53,0.03l0.54,1.55l2.07,1.03l-2.7,7.63l-0.2,0.1l-0.39,-0.54l-0.33,0.1l0.18,-0.75l-0.57,-0.43l-2.35,1.95l-1.67,-2.31l-1.23,-0.97l-0.61,0.4l0.09,0.52l1.44,2.0l-0.24,0.46l0.36,0.47l-1.17,-0.21l-0.33,0.63l0.5,0.56l0.89,0.23l1.12,-0.16l0.66,0.62l1.37,0.18l1.0,-0.03l0.99,-0.62l-0.34,1.59l0.24,0.77l-0.98,0.7l0.37,1.59l-1.12,0.14l-0.43,0.41l0.4,2.11l-0.33,1.6l0.45,0.64l0.84,0.24l0.87,2.86l0.71,2.8l-0.91,0.82l0.62,0.49l-0.08,1.28l0.71,0.3l0.18,0.61l0.58,0.29l0.4,1.79l0.68,0.31l0.45,3.21l1.46,0.62l-0.52,1.1l0.31,1.08l-0.62,0.77l-0.84,-0.05l-0.54,0.44l0.09,1.3l-0.49,-0.33l-0.49,0.25l-0.39,-0.67l-1.49,-0.45l-2.92,-2.53l-2.2,-0.18l-0.81,-0.51l-4.2,0.09l-0.9,0.42l-0.79,-0.62l-1.64,0.24l-2.12,-0.89l-0.73,-0.97l-0.6,-0.14l-0.21,-0.72l-1.17,-0.49l-0.99,-0.02l-1.98,-0.87l-1.45,0.39l-0.83,-1.09l-0.6,-0.21l-1.43,-1.38l-1.96,0.01l-1.47,-0.64l-0.86,0.11l-1.62,-0.41l0.35,-0.9l-0.3,-0.97l-1.11,-0.7l0.3,-0.29l-0.26,-1.44l0.56,-1.21l-0.35,-0.67l0.88,-0.38l0.12,-0.54l-1.04,-0.54l-0.91,0.67l-0.32,-0.31l0.03,-1.09l-0.59,-0.83l0.31,-0.09l0.53,-1.43l-0.22,-0.71l-0.71,0.09l-1.03,0.96l-0.57,-0.89l-0.85,-0.28l-0.26,-1.34l-1.51,-0.77l0.29,-0.65l-0.24,-0.76l0.34,-2.18l-0.45,-0.96l-1.04,-1.01l0.65,-1.99l0.05,-1.19l-0.18,-0.7l-0.54,-0.33l-0.15,-1.81l-1.85,-1.44l-0.86,0.21l-0.3,-0.41l-0.81,-0.11l-0.74,-1.31l-2.22,-1.71l0.01,-0.69l-0.51,-0.58l0.12,-0.87l-0.97,-0.92l-0.08,-0.75l-1.12,-0.61l-1.3,-2.88l-2.66,-1.48l-0.38,-0.91l-1.13,-0.59l-0.06,-1.16l-0.82,-1.19l-0.59,-1.95l0.41,-0.22l-0.04,-0.72l-1.03,-0.49l-0.26,-1.29l-0.82,-0.58l-0.94,-1.73l-0.61,-2.38l-1.85,-2.36l-0.87,-4.24l-1.81,-1.34l0.05,-0.7l-0.75,-1.21l-4.07,-2.82l-0.29,-1.39l1.68,-0.02l0.79,-0.84l-0.29,-0.39l-0.65,-0.06l-0.09,-0.72l0.08,-0.89l0.64,-0.7l-0.11,-0.74l-0.48,0.05l-0.77,0.72l-0.45,0.69l0.01,0.66l-0.88,0.15l-0.39,1.07l-0.54,-0.04l-1.81,-1.75l0.06,-0.67l-0.41,-0.68l-0.77,-0.2l-0.64,0.29l-0.33,-0.53l-0.73,-0.13l-0.89,-2.16l-1.49,-0.8l-0.85,0.27l-0.44,-0.87l-0.61,0.1l-0.25,0.61l-1.05,0.16l-2.88,-0.47l-0.39,-0.38l-1.48,-0.03l-0.79,0.29l-0.77,-0.44l-2.66,0.27l-2.42,-1.08l-1.14,-0.89l-0.68,-0.07l-1.03,0.82l-0.64,1.61l-1.99,-0.17l-0.51,0.44l-0.49,-0.17l-2.52,0.78l-3.07,6.25l-0.18,1.77l-0.76,0.67l-0.38,1.8l0.35,0.59l-1.97,0.98l-0.75,1.32l-1.07,0.61l-0.62,0.83l-0.29,1.09l-2.91,-0.34l-1.04,-0.87l-0.54,0.3l-1.69,-1.21l-1.31,-1.63l-2.9,-0.85l-1.15,-0.95l-0.02,-0.67l-0.42,-0.4l-2.75,-0.51l-2.28,-1.03l-1.89,-1.75l-0.91,-1.53l-0.96,-0.91l-1.53,-0.29l-1.76,-1.26l-0.22,-0.56l-1.14,-0.97l-0.83,-2.9l-0.86,-1.01l-0.24,-1.1l-0.76,-1.27l-0.26,-2.34l0.52,-3.04l-3.0,-5.07l-0.06,-1.94l-1.26,-2.51l-0.99,-0.44l-0.43,-1.24l-1.43,-0.81l-2.15,-2.17l-1.02,-0.1l-2.01,-1.25l-3.18,-3.35l-0.59,-1.55l-3.13,-2.55l-1.59,-2.45l-1.19,-0.95l-0.61,-1.05l-4.42,-2.6l-2.4,-5.42l-1.37,-1.08l-1.12,-0.08l-1.76,-1.68l-0.79,-3.05ZM502.12,468.09l-0.33,0.17l0.18,-0.16l0.15,-0.02ZM498.72,470.76l-0.09,0.12l-0.04,0.02l0.13,-0.14ZM467.58,489.09l0.03,0.02l-0.02,0.02l-0.0,-0.03ZM453.97,547.08l0.76,-0.5l0.25,-0.68l0.11,1.08l-1.11,0.1Z", "name": "Texas"}, "US-NH": {"path": "M829.91,105.39l0.2,-1.33l-1.43,-5.38l0.53,-1.45l-0.28,-2.22l1.0,-1.86l-0.13,-2.3l0.64,-2.28l-0.44,-0.62l0.29,-2.3l-0.93,-3.8l0.08,-0.7l0.3,-0.45l1.83,-0.8l0.7,-1.39l1.43,-1.62l0.74,-1.8l-0.25,-1.13l0.52,-0.62l-2.34,-3.49l0.87,-3.26l-0.11,-0.78l-0.81,-1.29l0.28,-0.59l-0.23,-0.7l0.48,-3.2l-0.36,-0.82l0.91,-1.49l2.44,0.33l0.65,-0.86l12.99,34.86l0.84,3.65l2.6,2.21l0.88,0.34l0.36,1.6l1.71,1.31l0.0,0.35l0.77,0.23l-0.06,0.58l-0.46,3.09l-1.57,0.24l-1.32,1.19l-0.51,0.94l-0.96,0.37l-0.5,1.68l-1.1,1.44l-17.61,4.74l-1.7,-1.43l-0.41,-0.89l-0.1,-2.0l0.54,-0.59l0.03,-0.52l-1.02,-5.18Z", "name": "New Hampshire"}, "US-NY": {"path": "M821.95,168.59l-0.84,-0.72l0.83,-3.23l1.03,-0.3l0.37,-0.48l0.74,0.21l0.64,-0.32l-0.06,-0.58l0.43,-0.05l0.28,-0.66l0.72,-0.32l-0.21,-1.42l0.73,-0.47l0.35,0.56l1.04,-0.16l0.49,-0.33l0.01,-0.54l1.46,-0.18l0.24,-0.74l1.66,0.02l0.91,-0.54l0.45,-1.21l0.62,0.24l0.43,-0.5l4.32,-1.28l2.35,-1.12l2.36,-2.84l0.18,0.17l-2.53,3.41l-0.01,0.46l0.56,0.38l1.59,-0.33l0.28,0.61l-1.3,1.19l-2.05,0.53l-0.37,0.58l-1.16,0.41l0.23,0.43l-0.24,0.3l-0.68,-0.16l-0.74,0.7l-1.04,0.17l-0.37,0.55l-1.42,0.45l-0.26,0.67l-1.34,0.19l-0.44,0.7l-1.35,0.96l-2.77,1.33l-1.02,0.88l-1.04,0.09l-0.32,0.93l-0.28,0.03l-0.26,-0.68l-1.45,-0.25l-0.88,0.74l0.07,0.96l-0.94,0.56ZM844.29,155.03l0.88,-2.14l1.18,-0.48l0.6,-0.93l0.81,0.34l0.13,-0.83l0.75,0.63l-3.84,3.68l-0.51,-0.28ZM845.16,149.15l0.06,-0.06l0.18,-0.06l-0.11,0.19l-0.13,-0.07ZM722.08,155.52l3.76,-3.85l1.27,-2.19l1.75,-1.86l1.16,-0.78l1.28,-3.35l2.09,-2.13l-0.21,-1.84l-1.61,-2.42l0.42,-1.13l-0.17,-0.78l-0.83,-0.53l-2.09,-0.0l0.04,-0.99l-0.58,-2.23l4.98,-2.94l4.48,-1.79l2.38,-0.2l1.84,-0.74l5.64,-0.24l3.12,1.25l3.16,-1.68l5.49,-1.06l0.59,0.45l0.68,-0.2l0.12,-0.99l3.23,-1.85l0.69,-2.05l1.87,-1.76l0.78,-1.26l1.12,0.03l1.13,-0.52l1.07,-1.63l-0.46,-0.69l0.36,-1.2l-0.25,-0.51l-0.64,0.02l-0.17,-1.18l-0.94,-1.58l-1.01,-0.62l0.12,-0.18l0.59,0.39l0.53,-0.27l0.75,-1.43l-0.01,-0.92l0.81,-0.64l-0.01,-0.98l-0.93,-0.19l-0.6,0.7l-0.28,0.12l0.56,-1.3l-0.81,-0.63l-1.26,0.05l-0.87,0.77l-0.98,-0.7l2.05,-2.51l1.78,-1.47l1.67,-2.63l0.7,-0.56l0.89,-1.54l0.07,-0.56l-0.49,-0.94l0.78,-1.9l4.82,-7.61l4.76,-4.5l2.84,-0.51l19.65,-5.66l0.4,0.87l-0.08,2.01l1.02,1.22l0.43,3.79l2.29,3.25l-0.09,1.89l0.85,2.41l-0.59,1.07l-0.0,3.41l0.71,0.89l1.32,2.76l0.19,1.09l0.62,0.84l0.12,3.92l0.55,0.85l0.54,0.07l0.53,-0.61l0.06,-0.87l0.33,-0.07l1.05,1.12l3.87,14.48l0.11,1.59l0.62,1.09l0.33,14.92l0.6,0.62l3.57,16.23l1.26,1.34l-2.82,3.18l0.03,0.54l1.74,1.62l-1.86,3.37l0.21,1.06l-1.03,0.45l-0.24,-4.26l-0.56,-2.23l-0.74,-1.62l-1.46,-1.1l-0.17,-1.13l-0.7,-0.09l-0.42,1.33l0.8,1.45l0.94,0.69l0.95,2.79l-13.74,-4.06l-1.28,-1.47l-2.39,0.24l-0.63,-0.43l-1.06,-0.15l-1.74,-1.91l-0.75,-2.33l0.12,-0.72l-0.36,-0.63l-0.56,-0.21l0.09,-0.46l-0.35,-0.42l-1.64,-0.68l-1.08,0.32l-0.53,-1.22l-1.92,-0.93l-34.6,8.73l-34.43,7.84l-1.11,-5.15Z", "name": "New York"}, "US-HI": {"path": "M293.44,610.32l-0.16,-1.33l-1.79,-3.5l-1.21,-1.37l0.23,-0.95l-0.21,-0.49l0.64,-1.68l4.55,-5.05l0.88,-5.09l0.45,-0.65l0.48,-2.22l-0.34,-2.5l0.41,-1.79l1.19,-0.79l1.55,-0.08l1.27,-0.5l1.51,0.3l2.68,-1.18l1.51,-0.07l1.15,-1.13l-0.03,-3.17l0.35,-1.25l0.99,-1.6l1.21,-0.53l2.67,2.45l-0.1,1.68l1.07,1.67l0.81,2.19l1.64,1.05l2.04,2.64l3.96,7.75l0.59,3.31l-2.1,3.31l0.14,0.54l0.73,0.44l1.2,0.23l0.29,0.68l-0.01,0.53l-0.8,1.13l-0.09,1.86l0.56,2.06l1.01,1.51l0.17,1.18l-0.37,0.44l-2.35,0.67l-1.45,-0.32l-2.49,0.4l-1.2,-0.39l-2.49,-0.11l-3.15,-1.01l-0.9,-0.94l-1.39,-0.68l-2.87,0.15l-4.73,-0.64l-1.91,0.32l-1.08,1.21l-1.89,0.33l-1.22,0.8l-1.62,0.21ZM302.97,554.35l1.47,-2.4l0.62,-1.93l-0.3,-0.8l-0.55,-0.42l-1.1,0.04l-1.49,-2.22l-0.31,-2.64l0.31,-0.99l0.92,-0.89l0.88,-0.53l1.05,-0.12l0.9,0.44l0.73,1.4l0.05,3.78l1.07,0.23l1.89,1.04l1.66,0.12l1.88,1.67l0.65,3.28l0.56,0.34l0.11,1.09l2.18,2.69l-0.14,1.17l-1.45,1.15l-0.84,-0.19l-0.81,0.3l-0.68,-0.4l-1.7,-0.23l-1.91,-1.3l-3.1,-0.5l-0.96,-1.02l-1.42,-0.79l-0.16,-1.4ZM273.53,509.24l-0.16,-0.35l0.54,-1.85l-0.3,-1.63l0.39,-1.12l-0.31,-1.61l0.83,-1.4l-0.26,-1.26l3.14,2.06l2.55,-0.17l1.08,-0.64l1.25,-0.12l0.77,0.28l0.39,1.22l-0.11,1.03l-0.4,0.54l0.01,2.42l0.41,1.21l-0.78,0.43l-0.61,1.27l0.64,2.46l0.61,0.41l0.56,-0.16l-0.24,0.78l0.3,0.88l-0.35,0.37l-0.14,1.04l0.56,1.3l-1.15,0.14l-0.29,-0.77l-2.67,-0.85l-0.05,-0.86l-0.79,-1.25l0.15,-0.76l-0.26,-0.63l-1.05,0.24l-0.45,-0.78l0.16,-0.27l1.0,0.06l0.45,-0.62l-0.42,-0.96l-0.64,-0.2l-0.35,-0.61l-0.47,0.25l-0.47,-0.55l-0.38,0.32l0.14,1.95l-2.85,-1.22ZM284.15,511.85l0.1,-0.21l-0.0,-0.01l0.1,0.09l-0.19,0.14ZM246.14,461.52l2.01,-0.42l1.12,-0.67l1.33,0.51l3.66,0.37l0.71,1.4l1.04,-0.06l1.12,1.14l0.89,0.21l0.72,0.89l0.28,1.56l-0.23,1.15l-0.51,0.62l-2.05,0.87l-1.37,1.99l-0.6,-0.19l-0.46,0.49l-2.84,0.16l-3.61,-3.83l-0.24,-1.91l-1.68,-2.24l0.05,-1.26l0.66,-0.81Z", "name": "Hawaii"}, "US-VT": {"path": "M805.54,72.68l26.02,-7.96l0.89,1.85l-0.74,2.37l-0.03,1.54l2.22,2.75l-0.51,0.58l0.26,1.13l-0.67,1.6l-1.35,1.49l-0.64,1.32l-1.72,0.7l-0.62,0.92l-0.1,0.98l0.93,3.74l-0.29,2.44l0.4,0.54l-0.6,2.11l0.15,2.19l-1.0,1.87l0.27,2.36l-0.53,1.54l1.43,5.44l-0.22,1.22l1.05,5.3l-0.58,0.85l0.11,2.31l0.6,1.26l1.51,1.1l-11.72,3.08l-4.31,-16.79l-1.72,-1.59l-0.91,0.25l-0.3,1.19l-0.12,-0.26l-0.11,-3.91l-0.68,-1.0l-0.14,-0.98l-1.37,-2.85l-0.63,-0.68l0.01,-3.15l0.6,-1.15l-0.86,-2.57l0.08,-1.93l-0.39,-0.91l-1.55,-1.63l-0.38,-0.81l-0.41,-3.71l-1.03,-1.27l0.11,-1.87l-0.42,-1.0Z", "name": "Vermont"}, "US-NM": {"path": "M230.94,422.8l11.82,-123.64l25.66,2.24l26.09,1.86l26.12,1.45l25.74,1.02l-0.31,10.24l-0.74,0.39l-3.59,98.67l-32.38,-1.34l-33.52,-2.02l-0.44,0.76l0.54,2.31l0.44,1.26l1.0,0.77l-30.53,-2.46l-0.43,0.36l-0.81,9.46l-14.64,-1.33Z", "name": "New Mexico"}, "US-NC": {"path": "M676.72,321.71l0.92,0.17l1.52,-0.39l0.42,-0.39l0.52,-0.97l0.13,-2.7l1.34,-1.19l0.47,-1.05l2.24,-1.47l2.12,-0.52l0.76,0.18l1.32,-0.52l2.36,-2.52l0.78,-0.25l1.84,-2.29l1.48,-1.0l1.55,-0.19l1.15,-2.65l-0.28,-1.22l1.65,0.06l0.51,-1.65l0.93,-0.77l1.08,-0.77l0.51,1.52l1.07,0.33l1.34,-1.17l1.35,-2.64l2.49,-1.59l0.79,0.08l0.82,0.8l1.06,-0.21l0.84,-1.07l1.47,-4.18l1.08,-1.1l1.47,0.09l0.44,-0.31l-0.69,-1.26l0.4,-2.0l-0.42,-0.9l0.38,-1.25l7.42,-0.86l19.54,-3.36l37.21,-8.42l31.11,-7.87l0.4,1.21l3.54,3.24l1.0,1.53l-1.2,-1.0l-0.16,-0.63l-0.92,-0.41l-0.52,0.05l-0.24,0.65l0.66,0.54l0.59,1.56l-0.53,0.01l-0.91,-0.75l-2.31,-0.8l-0.4,-0.48l-0.55,0.13l-0.31,0.69l0.14,0.64l1.37,0.44l1.69,1.38l-1.1,0.66l-2.49,-1.2l-0.35,0.5l0.14,0.42l1.6,1.18l-1.84,-0.33l-2.23,-0.87l-0.46,0.14l0.01,0.48l0.6,0.7l1.7,0.83l-0.97,0.58l0.0,0.6l-0.43,0.53l-1.48,0.75l-0.89,-0.77l-0.61,0.22l-0.1,0.35l-0.2,-0.13l-1.31,-2.32l0.21,-2.63l-0.42,-0.48l-0.89,-0.22l-0.37,0.64l0.62,0.71l-0.43,0.99l-0.02,1.03l0.49,1.73l1.6,2.2l-0.31,1.28l0.48,0.29l2.97,-0.59l2.1,-1.49l0.27,0.01l0.37,0.79l0.76,-0.34l1.56,0.05l0.16,-0.72l-0.57,-0.32l1.29,-0.76l2.04,-0.46l-0.1,1.19l0.64,0.29l-0.6,0.88l0.88,1.19l-0.84,0.1l-0.19,0.66l1.38,0.46l0.26,0.94l-1.21,0.05l-0.19,0.66l0.66,0.59l1.25,-0.16l0.52,0.26l0.41,-0.38l0.18,-1.95l-0.75,-3.33l0.41,-0.48l0.56,0.43l0.94,0.06l0.28,-0.58l-0.29,-0.44l0.48,-0.57l1.71,1.84l-0.01,1.4l0.62,0.9l-0.78,0.65l0.9,1.14l-0.08,0.37l-0.42,0.55l-0.78,0.09l-0.91,-0.86l-0.32,0.34l0.13,1.26l-1.08,1.62l0.2,0.57l-0.33,0.22l-0.15,0.98l-0.74,0.55l0.1,0.91l-0.9,0.97l-1.06,0.21l-0.6,-0.37l-0.52,0.52l-0.93,-0.81l-0.86,0.1l-0.4,-0.82l-0.59,-0.21l-0.52,0.38l0.08,0.94l-0.52,0.22l-1.42,-1.24l1.31,-0.4l0.23,-0.88l-0.57,-0.42l-2.02,0.31l-1.14,1.01l0.29,0.67l0.44,0.16l-0.06,0.39l0.15,0.43l0.35,0.25l-0.03,0.12l-0.57,-0.34l-1.69,0.83l-1.12,-0.43l-1.45,0.06l-3.32,-0.7l0.42,1.08l0.97,0.45l0.36,0.64l1.51,-0.21l4.03,1.02l3.51,0.11l0.47,0.42l-0.06,0.52l-0.99,0.05l-0.25,0.72l-1.62,1.44l0.32,0.58l1.85,0.01l-2.56,3.5l-1.67,0.04l-1.6,-0.98l-0.9,-0.19l-1.21,-1.02l-1.12,0.07l0.07,0.47l1.04,1.14l2.32,2.09l2.68,0.26l1.31,0.49l1.7,-2.16l0.51,0.47l1.17,0.33l0.4,-0.57l-0.55,-0.9l0.87,0.16l0.19,0.57l0.66,0.23l1.63,-1.2l-0.18,0.61l0.29,0.57l-0.29,0.38l-0.43,-0.21l-0.41,0.37l0.03,0.9l-0.97,1.72l0.01,0.78l-0.71,-0.07l-0.06,-0.74l-1.12,-0.61l-0.42,0.47l0.27,1.45l-0.52,-1.1l-0.65,-0.15l-1.22,1.08l-0.21,0.53l0.25,0.27l-2.03,0.32l-2.75,1.84l-0.67,-1.03l-0.75,-0.3l-0.37,0.49l0.43,1.26l-0.57,-0.01l-0.09,0.82l-0.94,1.73l-0.91,0.84l-0.59,-0.26l0.49,-0.69l-0.02,-0.77l-1.06,-0.93l-0.08,-0.52l-1.69,-0.41l-0.16,0.47l0.43,1.16l0.2,0.33l0.58,0.07l0.3,0.61l-0.88,0.37l-0.08,0.71l0.65,0.64l0.77,0.18l-0.01,0.37l-2.12,1.67l-1.91,2.65l-2.0,4.31l-0.34,2.13l0.12,1.33l-0.15,-1.03l-1.0,-1.6l-0.55,-0.17l-0.3,0.48l1.17,3.95l-0.63,2.27l-3.9,0.19l-1.43,0.65l-0.35,-0.52l-0.58,-0.18l-0.54,1.07l-1.9,1.14l-0.61,-0.02l-23.25,-15.36l-1.05,-0.02l-18.68,3.49l-0.65,-2.77l-3.25,-2.84l-0.47,0.08l-1.23,1.31l-0.01,-1.29l-0.82,-0.54l-22.82,3.35l-0.64,-0.27l-0.62,0.46l-0.25,0.65l-3.98,1.92l-0.89,1.23l-1.01,0.08l-4.78,2.66l-20.95,3.93l-0.34,-4.55l0.7,-0.95ZM816.97,271.42l0.19,0.35l0.24,0.38l-0.45,-0.41l0.02,-0.32ZM807.5,290.22l0.2,0.32l-0.16,-0.09l-0.04,-0.24ZM815.28,299.09l0.16,-0.36l0.16,0.07l-0.13,0.29l-0.19,0.01ZM812.72,299.05l-0.06,-0.29l-0.03,-0.11l0.3,0.26l-0.21,0.13Z", "name": "North Carolina"}, "US-ND": {"path": "M438.58,42.78l2.06,6.89l-0.73,2.53l0.57,2.36l-0.27,1.17l0.47,1.99l0.01,3.26l1.42,3.95l0.45,0.54l-0.08,0.97l0.39,1.52l0.62,0.74l1.48,3.74l-0.06,3.9l0.42,0.7l0.5,8.35l0.51,1.54l0.51,0.25l-0.47,2.64l0.36,1.63l-0.14,1.75l0.69,1.1l0.2,2.16l0.49,1.13l1.8,2.56l0.15,2.2l0.51,1.08l0.17,1.39l-0.24,1.36l0.28,1.74l-27.89,0.73l-28.38,0.19l-28.38,-0.37l-28.48,-0.93l2.75,-65.45l23.09,0.78l25.56,0.42l25.56,-0.06l24.09,-0.49Z", "name": "North Dakota"}, "US-NE": {"path": "M422.62,173.98l3.92,2.71l3.93,1.9l1.33,-0.22l0.51,-0.47l0.36,-1.08l0.48,-0.2l2.49,0.34l1.32,-0.47l1.58,0.25l3.45,-0.65l2.37,1.98l1.4,0.14l1.55,0.77l1.45,0.08l0.88,1.1l1.49,0.17l-0.06,0.98l1.68,2.08l3.32,0.6l-0.02,2.55l1.13,1.94l0.01,2.29l1.15,1.07l0.34,1.72l1.73,1.46l0.07,1.88l1.5,2.11l-0.49,2.33l0.44,3.09l0.52,0.54l0.93,-0.2l-0.04,1.25l1.21,0.5l-0.41,2.36l0.21,0.44l1.12,0.4l-0.6,0.77l-0.09,1.01l0.13,0.59l0.82,0.5l0.16,1.45l-0.26,0.92l0.26,1.27l0.55,0.61l0.3,1.93l-0.22,1.33l0.23,0.72l-0.57,0.92l0.02,0.79l0.45,0.88l1.23,0.63l0.25,2.5l1.1,0.51l0.03,0.79l1.18,2.75l-0.23,0.96l1.16,0.21l0.8,0.99l1.1,0.24l-0.15,0.96l1.31,1.68l-0.21,1.12l0.51,0.91l-26.14,1.05l-27.83,0.63l-27.84,0.14l-27.88,-0.35l0.46,-21.65l-0.39,-0.41l-32.35,-1.04l1.85,-43.23l43.35,1.22l44.66,-0.04Z", "name": "Nebraska"}, "US-LA": {"path": "M509.0,412.88l-1.33,-21.76l51.43,-4.07l0.34,0.83l1.48,0.65l-0.92,1.35l-0.25,2.13l0.49,0.72l1.18,0.31l-1.21,0.47l-0.45,0.78l0.45,1.36l1.04,0.84l0.08,2.15l0.46,0.54l1.51,0.74l0.45,1.05l1.42,0.44l-0.87,1.22l-0.85,2.34l-0.75,0.04l-0.52,0.51l-0.02,0.73l0.63,0.72l-0.22,1.16l-1.34,0.96l-1.08,1.89l-1.37,0.67l-0.68,0.83l-0.79,2.42l-0.25,3.52l-1.55,1.74l0.13,1.2l0.62,0.96l-0.35,2.38l-1.61,0.29l-0.6,0.57l0.28,0.97l0.64,0.59l-0.26,1.41l0.98,1.51l-1.18,1.18l-0.08,0.45l0.4,0.23l6.18,-0.55l29.23,-2.92l-0.68,3.47l-0.52,1.02l-0.2,2.24l0.69,0.98l-0.09,0.66l0.6,1.0l1.31,0.7l1.22,1.42l0.14,0.88l0.89,1.39l0.14,1.05l1.11,1.84l-1.85,0.39l-0.38,-0.08l-0.01,-0.56l-0.53,-0.57l-1.28,0.27l-1.18,-0.59l-1.51,0.17l-0.61,-0.98l-1.24,-0.86l-2.84,-0.47l-1.24,0.63l-1.39,2.3l-1.3,1.42l-0.42,0.91l0.07,1.2l0.55,0.89l0.82,0.57l4.25,0.82l3.35,-1.0l1.32,-1.19l0.68,-1.2l0.34,0.59l1.08,0.43l0.59,-0.4l0.81,0.03l0.51,-0.46l-0.76,1.21l-1.12,-0.12l-0.57,0.32l-0.38,0.62l0.0,0.83l0.76,1.22l1.48,-0.02l0.65,0.89l1.1,0.48l1.44,-0.66l0.46,-1.11l-0.02,-1.37l0.93,-0.57l0.42,-0.99l0.23,0.05l0.1,1.16l-0.24,0.25l0.19,0.57l0.42,0.15l-0.07,0.75l1.34,1.08l0.35,-0.16l-0.48,0.59l0.18,0.63l-0.24,0.17l-0.84,-0.72l-0.71,-0.08l-1.0,1.89l-0.84,0.14l-0.46,0.53l0.16,1.19l-1.59,-0.6l-0.43,0.19l0.04,0.46l1.14,1.06l-1.17,-0.14l-0.92,0.6l0.68,0.43l1.26,2.04l2.74,0.97l-0.08,1.2l0.33,0.4l2.07,-0.31l0.77,0.17l0.17,0.53l0.73,0.32l1.35,-0.34l0.53,0.78l1.08,-0.46l1.13,0.73l0.14,0.3l-0.41,0.63l1.54,0.86l-0.39,0.65l0.39,0.58l-0.18,0.62l-0.95,1.49l-1.3,-1.56l-0.68,0.34l0.1,0.66l-0.38,0.12l0.41,-1.88l-1.32,-0.76l-0.51,0.5l0.2,1.17l-0.54,0.45l-0.27,-1.02l-0.57,-0.25l-0.89,-1.27l0.03,-0.77l-0.96,-0.14l-0.47,0.5l-1.41,-0.17l-0.74,-0.77l-2.31,-0.09l0.38,-0.86l-0.13,-0.66l-0.64,-0.69l-0.91,0.04l0.1,-0.96l-0.37,-0.36l-0.91,-0.03l-0.22,0.59l-0.85,-0.38l-0.48,0.27l-2.61,-1.26l-1.24,-0.02l-0.67,-0.64l-0.61,0.18l-0.3,0.56l-0.05,1.25l1.72,0.94l1.67,0.35l-0.16,0.92l0.28,0.4l-0.34,0.34l0.23,0.68l-0.76,0.94l-0.03,0.66l0.81,0.97l-0.95,1.43l-1.33,0.94l-0.76,-1.15l0.22,-1.5l-0.35,-0.92l-0.49,-0.18l-0.4,0.36l-1.15,-1.08l-0.6,0.42l-0.76,-1.05l-0.62,-0.2l-0.64,1.33l-0.85,0.26l-0.89,-0.53l-0.85,0.53l-0.1,0.62l0.48,0.41l-0.67,0.56l-0.13,1.44l-0.46,0.13l-0.4,0.84l-0.92,0.08l-0.11,-0.68l-1.6,-0.4l-0.76,0.97l-1.92,-0.93l-0.3,-0.54l-0.99,0.01l-0.35,0.6l-1.15,-0.51l0.42,-0.4l0.0,-1.46l-0.38,-0.57l-1.9,-1.19l-0.08,-0.54l-0.83,-0.71l-0.09,-0.91l0.73,-1.15l-0.34,-1.14l-0.88,-0.19l-0.34,0.57l0.16,0.43l-0.58,0.81l0.04,0.91l-1.8,-0.4l0.07,-0.39l-0.47,-0.54l-1.97,0.76l-0.7,-2.22l-1.32,0.23l-0.18,-2.12l-1.31,-0.35l-1.89,0.3l-1.08,0.66l-0.21,-0.71l0.84,-0.26l-0.05,-0.8l-0.6,-0.58l-1.03,-0.1l-0.85,0.42l-0.94,-0.15l-0.4,0.8l-2.0,1.11l-0.63,-0.31l-1.29,0.71l0.54,1.37l0.81,0.31l1.04,1.55l-1.27,0.36l-1.82,1.06l-7.63,-0.92l-6.7,-2.31l-3.46,-0.65l-6.85,0.69l-3.41,0.8l-1.57,0.73l-0.91,-1.41l1.2,-0.46l0.79,-0.98l0.27,-2.3l-0.59,-0.84l1.15,-1.62l0.23,-1.59l-0.5,-1.83l0.07,-1.46l-0.66,-0.7l-0.21,-1.04l0.83,-2.21l-0.64,-1.95l0.76,-0.84l0.3,-1.49l0.78,-0.94l0.79,-2.83l-0.18,-1.42l0.58,-0.97l-0.75,-1.33l0.84,-0.39l0.2,-0.44l-0.89,-1.36l0.03,-2.13l-1.07,-0.23l-0.57,-1.57l-0.92,-0.84l0.28,-1.27l-0.81,-0.76l-0.33,-0.95l-0.64,-0.34l0.22,-0.98l-1.16,-0.58l-0.81,-0.93l0.16,-2.46l-0.68,-1.93l-1.33,-1.98l-2.63,-2.21ZM548.97,462.65l0.0,-0.0l0.0,0.0l-0.0,0.0ZM607.49,467.36l-0.03,-0.03l-0.08,-0.04l0.13,-0.01l-0.03,0.08ZM607.51,465.75l-0.02,-0.01l0.03,-0.01l-0.02,0.02ZM567.05,468.89l-2.0,-0.42l-0.66,-0.5l0.73,-0.43l0.35,-0.75l0.39,0.49l0.83,0.21l-0.14,0.6l0.5,0.81Z", "name": "Louisiana"}, "US-SD": {"path": "M336.43,128.81l0.3,-0.53l0.75,-19.92l28.49,0.93l28.39,0.37l28.39,-0.19l27.77,-0.73l-0.18,1.71l-0.73,1.71l-2.9,2.46l-0.42,1.27l1.59,2.13l1.06,2.06l0.55,0.36l1.74,0.24l1.01,0.84l0.57,1.02l1.45,38.83l-1.84,0.09l-0.42,0.56l0.24,1.44l0.88,1.14l0.01,1.45l-0.65,0.36l0.17,1.48l0.48,0.43l1.09,0.04l0.34,1.68l-0.16,0.91l-0.62,0.83l0.02,1.73l-0.68,2.45l-0.49,0.44l-0.67,1.88l0.5,1.1l1.33,1.08l-0.16,0.62l0.64,0.66l0.35,1.15l-1.65,-0.28l-0.34,-0.94l-0.85,-0.73l0.19,-0.61l-0.28,-0.59l-1.58,-0.23l-1.03,-1.18l-1.57,-0.11l-1.51,-0.75l-1.34,-0.12l-2.38,-1.99l-3.78,0.6l-1.65,-0.25l-1.19,0.46l-2.62,-0.33l-0.98,0.48l-0.76,1.45l-0.72,0.05l-3.66,-1.82l-4.13,-2.8l-44.82,0.05l-43.33,-1.22l1.79,-43.19Z", "name": "South Dakota"}, "US-DC": {"path": "M783.1,218.48l-0.45,-0.64l-1.55,-0.67l0.58,-1.01l2.03,1.26l-0.61,1.06Z", "name": "District of Columbia"}, "US-DE": {"path": "M798.42,195.12l0.48,-1.56l0.92,-1.11l1.72,-0.71l1.12,0.06l-0.33,0.56l-0.08,1.38l-0.46,1.09l-0.6,0.54l-0.09,0.77l0.13,0.61l1.03,0.85l0.11,2.31l3.98,3.32l1.13,3.99l1.96,1.68l0.47,1.26l3.17,2.27l1.35,-0.08l0.48,1.21l-0.58,0.27l-0.31,0.67l0.03,0.76l0.36,0.19l-0.82,0.57l-0.08,1.21l0.66,0.21l0.85,-0.73l0.72,0.34l0.3,-0.21l0.59,1.55l-9.84,2.64l-8.37,-25.89Z", "name": "Delaware"}, "US-FL": {"path": "M630.29,423.61l47.18,-6.86l1.52,1.91l0.86,2.72l1.47,1.0l48.78,-5.11l1.03,1.38l0.03,1.09l0.55,1.05l1.04,0.48l1.64,-0.28l0.85,-0.75l-0.14,-4.57l-0.98,-1.49l-0.22,-1.77l0.28,-0.74l0.62,-0.3l0.12,-0.7l5.59,0.96l4.03,-0.16l0.14,1.24l-0.75,-0.12l-0.32,0.43l0.25,1.54l2.11,1.81l0.22,1.01l0.42,0.38l0.3,1.92l5.3,11.5l1.81,3.07l7.14,10.22l0.63,0.36l6.82,7.53l-0.48,-0.02l-0.27,0.61l-1.35,-0.02l-0.34,-0.65l0.38,-1.38l-0.16,-0.56l-2.3,-0.92l-0.46,0.53l1.0,2.8l0.78,0.97l2.14,4.77l9.92,13.71l1.37,3.11l3.66,5.34l-1.38,-0.35l-0.43,0.74l0.8,0.65l0.85,0.24l0.56,-0.22l1.46,0.94l2.05,3.05l-0.5,0.34l-0.12,0.53l1.16,0.53l0.89,1.83l-0.08,1.06l0.59,0.95l0.61,2.64l-0.27,0.75l0.93,8.98l-0.31,1.07l0.46,0.67l0.5,3.1l-0.78,1.26l0.03,2.43l-0.84,0.74l-0.22,1.8l-0.48,0.85l0.21,1.47l-0.31,1.74l0.54,1.74l0.45,0.23l-1.15,1.8l-0.39,1.28l-0.94,0.24l-0.53,-0.22l-1.37,0.45l-0.35,1.06l-0.89,0.3l-0.18,0.58l-0.85,0.67l-1.44,0.14l-0.27,-0.32l-1.23,-0.1l-0.9,1.05l-3.17,1.13l-1.06,-0.59l-0.7,-1.04l0.06,-1.8l1.0,0.84l1.64,0.47l0.26,0.63l0.52,0.07l1.35,-0.72l0.2,-0.69l-0.26,-0.64l-1.58,-1.11l-2.4,-0.26l-0.91,-0.46l-0.85,-1.67l-0.89,-0.72l0.22,-0.98l-0.48,-0.28l-0.53,0.15l-1.38,-2.51l-0.44,-0.3l-0.64,0.07l-0.44,-0.61l0.22,-0.89l-0.7,-0.65l-1.21,-0.6l-1.06,-0.08l-0.75,-0.54l-0.57,0.18l-2.8,-0.59l-0.5,0.64l0.25,-0.91l-0.46,-0.42l-0.87,0.12l-0.26,-0.72l-0.88,-0.65l-0.61,-1.41l-0.55,-0.11l-0.73,-2.95l-0.77,-0.98l-0.16,-1.52l-0.44,-0.83l-0.71,-0.89l-0.49,-0.15l-0.12,0.93l-1.29,-0.26l1.07,-1.3l0.18,-1.37l0.86,-1.46l0.65,-0.34l0.28,-0.83l-0.61,-0.38l-1.42,0.93l-1.03,1.67l-0.28,1.79l-1.37,0.35l-0.2,-1.33l-0.79,-1.33l-0.27,-4.04l-0.86,-0.6l1.63,-1.33l0.22,-0.97l-0.58,-0.42l-3.05,1.92l-0.75,-0.66l-0.4,0.26l-1.27,-0.89l-0.37,0.74l1.13,1.09l0.52,0.1l1.26,2.0l-1.04,0.24l-1.43,-0.38l-0.84,-1.6l-1.13,-0.6l-1.94,-2.54l-1.04,-2.28l-1.28,-0.87l0.1,-0.87l-0.97,-1.8l-1.77,-0.98l0.09,-0.67l0.99,-0.41l-0.35,-0.49l0.44,-0.73l-0.39,-0.35l0.4,-1.21l2.47,-4.47l-1.05,-2.41l-0.68,-0.46l-0.92,0.42l-0.28,0.93l0.29,1.19l-0.24,0.03l-0.73,-2.44l-0.99,-0.28l-1.18,-0.87l-1.52,-0.31l0.29,1.94l-0.48,0.61l0.27,0.59l2.21,0.56l0.24,0.97l-0.37,2.46l-0.31,-0.58l-0.8,-0.21l-2.13,-1.53l-0.41,0.2l-0.29,-0.62l0.59,-2.11l0.07,-2.97l-0.66,-1.97l0.42,-0.51l0.48,-1.91l-0.24,-0.54l0.66,-3.04l-0.37,-5.41l-0.69,-1.56l0.35,-0.47l-0.47,-2.18l-2.1,-1.33l-0.05,-0.53l-0.55,-0.43l-0.1,-1.01l-0.92,-0.73l-0.55,-1.51l-0.64,-0.25l-1.44,0.32l-1.02,-0.2l-1.57,0.54l-1.15,-1.74l-1.5,-0.47l-0.19,-0.6l-1.35,-1.51l-3.81,-1.88l-0.51,-2.75l-3.06,-1.14l-0.65,-0.59l-0.52,-1.23l-2.15,-1.93l-2.19,-1.09l-1.45,-0.12l-3.44,-1.68l-2.85,0.98l-1.01,-0.4l-1.04,0.42l-0.36,0.68l-1.33,0.68l-0.5,0.71l0.03,0.64l-0.73,-0.22l-0.59,0.6l0.67,0.94l1.51,0.08l0.41,0.21l-3.03,0.23l-1.58,1.51l-0.91,0.45l-1.3,1.56l-1.56,1.03l-0.32,0.13l0.2,-0.48l-0.26,-0.54l-0.67,-0.04l-2.07,2.24l-2.2,0.23l-2.11,1.06l-0.78,0.03l-0.27,-2.03l-1.71,-2.23l-2.21,-1.0l-0.18,-0.41l-2.51,-1.5l2.8,1.33l1.21,-0.74l-0.0,-0.74l-1.32,-0.34l-0.35,0.55l-0.21,-1.01l-0.34,-0.1l0.12,-0.52l-0.49,-0.33l-1.4,0.61l-2.3,-0.76l0.65,-1.08l0.83,-0.1l1.03,-1.45l-0.91,-0.96l-0.46,0.13l-0.49,1.02l-0.44,-0.04l-0.81,0.56l-0.72,-0.9l-0.7,0.09l-0.17,0.38l-1.34,0.73l-0.14,0.68l0.28,0.46l-3.95,-1.35l-5.05,-0.71l0.11,-0.24l1.27,0.29l0.61,-0.53l2.1,0.39l0.23,-0.78l-0.94,-1.02l0.09,-0.69l-0.62,-0.29l-0.5,0.32l-0.28,-0.47l-1.9,0.19l-2.25,1.1l0.3,-0.64l-0.41,-0.58l-0.96,0.35l-0.58,-0.25l-0.23,0.44l0.2,0.71l-1.45,0.79l-0.4,0.64l-5.17,0.97l0.32,-0.52l-0.4,-0.52l-1.35,-0.28l-0.72,-0.53l0.69,-0.53l0.01,-0.78l-0.68,-0.13l-0.81,-0.66l-0.46,0.11l0.14,0.76l-0.42,1.77l-1.05,-1.39l-0.69,-0.45l-0.55,0.07l-0.3,0.71l0.82,1.77l-0.25,0.79l-1.39,0.99l-0.05,1.04l-0.6,0.22l-0.17,0.57l-1.48,0.55l0.28,-0.66l-0.22,-0.45l1.14,-1.03l0.07,-0.74l-0.4,-0.58l-1.18,-0.24l-0.42,-0.84l0.3,-1.7l-0.18,-1.61l-2.17,-1.12l-2.39,-2.46l0.32,-1.44l-0.15,-1.04ZM644.36,434.04l-0.94,0.26l0.4,-0.44l0.53,0.18ZM665.13,435.61l0.98,-0.28l0.35,0.31l0.08,0.72l-1.42,-0.75ZM770.53,454.92l0.42,0.56l-0.43,0.75l0.0,-1.31Z", "name": "Florida"}, "US-CT": {"path": "M823.41,156.51l2.83,-3.23l-0.07,-0.54l-1.31,-1.25l-3.5,-15.89l9.81,-2.41l0.6,0.46l0.65,-0.26l0.23,-0.58l14.16,-4.0l3.2,10.18l0.47,1.96l-0.04,1.69l-1.66,0.32l-0.92,0.81l-0.69,-0.36l-0.5,0.1l-0.18,0.91l-1.14,0.07l-1.27,1.27l-0.62,-0.14l-0.56,-1.02l-0.89,-0.09l-0.21,0.67l0.75,0.64l0.08,0.54l-0.89,-0.02l-1.02,0.87l-1.65,0.07l-1.15,0.94l-1.44,0.13l-1.21,0.93l-0.65,-1.0l-0.61,0.11l-1.01,2.46l-1.06,0.61l-0.25,1.02l-0.77,-0.26l-0.96,0.56l-0.09,0.85l-1.72,0.98l-1.94,2.27l-1.19,0.46l-0.24,0.38l-1.4,-1.23Z", "name": "Connecticut"}, "US-WA": {"path": "M38.51,55.06l0.37,-1.08l0.93,0.65l0.55,-0.14l0.54,-0.65l0.49,0.67l0.71,-0.01l0.17,-0.77l-0.98,-1.47l0.85,-0.83l-0.09,-1.36l0.49,-0.39l-0.1,-1.03l0.81,-0.27l0.05,0.5l0.48,0.41l0.95,-0.31l-0.09,-0.68l-1.44,-1.82l-1.84,-0.1l-0.15,0.32l-0.78,-0.82l0.26,-1.62l0.66,0.53l0.52,-0.07l0.29,-0.56l-0.17,-0.68l3.33,-0.52l0.25,-0.68l-2.59,-1.29l-0.05,-0.79l-0.67,-0.57l-1.3,-0.31l0.37,-4.73l-0.5,-1.29l0.25,-0.72l-0.52,-0.48l0.55,-3.93l0.04,-4.38l-0.56,-1.02l-0.04,-0.98l-1.56,-2.34l0.33,-4.24l-0.21,-1.29l0.78,-0.79l0.04,-0.71l0.97,-1.44l-0.6,-1.43l1.04,0.8l0.44,0.0l3.35,3.31l0.99,0.35l2.18,2.41l3.73,1.49l1.21,0.07l0.79,0.71l0.67,0.31l0.6,-0.15l1.57,1.07l1.49,0.47l1.28,0.28l1.22,-0.61l0.53,0.31l0.46,0.71l-0.05,1.24l0.55,0.74l0.8,-0.24l0.07,-0.75l0.44,0.03l0.63,1.39l-0.4,0.58l0.34,0.49l0.56,-0.04l0.73,-0.84l-0.38,-1.7l1.03,-0.24l-0.44,0.23l-0.22,0.69l1.27,4.41l-0.46,0.1l-1.67,1.72l0.22,-1.29l-0.22,-0.41l-1.31,0.31l-0.38,0.81l0.09,0.95l-1.37,1.7l-1.98,1.38l-1.06,1.41l-0.96,0.69l-1.1,1.67l-0.06,0.71l0.62,0.6l0.96,0.12l2.77,-0.48l1.22,-0.58l-0.03,-0.7l-0.64,-0.23l-2.94,0.79l-0.35,-0.3l3.23,-3.42l3.06,-0.88l0.89,-1.51l1.73,-1.54l0.53,0.57l0.54,-0.19l0.22,-1.81l-0.06,2.25l0.26,0.91l-0.98,-0.21l-0.64,0.77l-0.41,-0.73l-0.53,-0.19l-0.39,0.64l0.32,2.34l-0.21,-1.07l-0.67,-0.21l-0.46,0.69l-0.07,0.75l0.46,0.66l-0.63,0.58l-0.0,0.45l0.42,0.17l1.67,-0.57l0.25,1.09l-1.08,1.79l-0.08,1.05l-0.83,0.7l0.13,1.0l-0.85,-0.68l1.12,-1.44l-0.23,-0.96l-1.96,1.08l-0.38,0.64l-0.05,-2.11l-0.52,0.02l-1.03,1.59l-1.26,0.53l-1.14,1.87l-1.51,0.3l-0.46,0.44l-0.21,1.18l1.11,-0.03l-0.25,0.36l0.27,0.37l0.93,0.02l0.06,0.68l0.53,0.47l0.52,-0.27l0.35,-1.76l0.15,0.42l0.83,-0.15l1.11,1.48l1.31,-0.61l1.64,-1.48l0.98,-1.56l0.63,0.78l0.73,0.14l0.44,-0.23l-0.06,-0.86l1.56,-0.55l0.35,-0.94l-0.33,-1.26l0.22,-1.19l-0.18,-1.35l0.83,0.2l0.3,-0.92l-0.19,-0.75l-0.72,-0.63l0.89,-1.13l0.07,-1.75l1.24,-1.24l0.61,-1.37l1.61,-0.49l0.78,-1.15l-0.45,-0.66l-0.51,-0.02l-0.86,-1.3l0.16,-2.09l-0.26,-0.87l0.49,-0.79l0.06,-0.84l-1.15,-1.73l-0.63,-0.4l-0.17,-0.64l0.18,-0.5l0.59,0.24l0.53,-0.33l0.24,-1.8l0.79,-0.24l0.3,-1.0l-0.61,-2.32l0.44,-0.53l-0.03,-0.86l-0.96,-0.88l-0.95,0.3l-1.09,-2.65l0.93,-1.82l41.31,9.4l38.95,7.65l-10.13,55.39l1.04,3.0l0.13,2.0l-1.0,1.3l0.73,1.88l-31.18,-5.92l-1.67,0.79l-7.24,-1.02l-1.68,0.92l-4.19,-0.12l-3.18,0.45l-1.64,0.75l-0.88,-0.26l-1.2,0.3l-1.51,-0.23l-2.43,-0.94l-0.91,0.46l-3.45,0.51l-2.11,-0.71l-1.65,0.3l-0.31,-1.36l-1.09,-0.88l-4.34,-1.46l-2.32,-0.11l-1.15,-0.51l-1.27,0.21l-1.89,0.86l-4.49,0.58l-2.26,-1.01l-1.61,-1.15l-1.84,-0.51l-0.63,-0.81l0.64,-6.82l-0.46,-0.95l-0.22,-1.9l-0.98,-1.35l-1.96,-1.67l-1.59,-0.23l-1.31,0.28l-1.95,-3.24l-2.07,-0.23l-0.56,-0.3l-0.1,-0.52l-0.55,-0.47l-1.22,0.28l-0.81,-0.15l-1.0,0.52l-1.03,-1.77l-0.93,-0.23ZM61.97,39.77l0.16,0.74l-0.42,0.48l0.0,-0.91l0.26,-0.31ZM71.38,20.37l-0.61,0.87l-0.15,0.52l0.18,-1.38l0.58,-0.01ZM71.25,15.62l-0.09,-0.05l0.05,-0.04l0.04,0.1ZM70.48,15.47l-0.77,0.39l0.37,-0.68l-0.07,-0.6l0.22,-0.07l0.25,0.97ZM57.68,42.43l0.04,-0.02l-0.01,0.0l-0.03,0.01Z", "name": "Washington"}, "US-KS": {"path": "M477.93,239.62l0.44,0.63l0.76,0.18l1.04,0.8l2.19,-1.08l-0.0,0.75l1.08,0.79l0.23,1.44l-0.95,-0.15l-0.6,0.31l-0.17,0.97l-1.14,1.37l-0.06,1.14l-0.79,0.5l0.04,0.64l1.56,2.1l2.0,1.49l0.2,1.13l0.42,0.86l0.74,0.56l0.32,1.11l1.89,0.91l1.54,0.26l2.67,46.81l-31.54,1.48l-31.97,0.88l-31.98,0.26l-32.04,-0.37l1.21,-65.46l27.89,0.35l27.85,-0.14l27.84,-0.64l27.67,-1.12l1.65,1.23Z", "name": "Kansas"}, "US-WI": {"path": "M510.09,124.06l0.41,-0.27l0.28,-0.9l-0.45,-1.48l0.04,-1.91l0.7,-1.16l0.53,-2.25l-1.61,-2.91l-0.83,-0.36l-1.28,-0.01l-0.21,-2.31l1.67,-2.26l-0.05,-0.77l0.77,-1.55l1.95,-1.09l0.48,-0.75l0.97,-0.25l0.45,-0.75l1.16,-0.14l1.04,-1.56l-0.97,-12.11l1.03,-0.35l0.22,-1.1l0.73,-0.97l0.78,0.7l1.68,0.64l2.61,-0.56l3.27,-1.57l2.65,-0.82l2.22,-2.12l0.31,0.29l1.39,-0.11l1.25,-1.48l0.79,-0.58l1.04,-0.1l0.4,-0.52l1.07,0.99l-0.48,1.68l-0.67,1.01l0.23,1.61l-1.21,2.21l0.64,0.66l2.5,-1.09l0.72,-0.87l2.15,1.22l2.34,0.47l0.44,0.53l0.86,-0.13l1.6,0.7l2.23,3.54l15.47,2.52l4.65,1.96l1.67,-0.16l1.63,0.42l1.33,-0.59l3.17,0.71l2.18,0.09l0.85,0.41l0.56,0.89l-0.42,1.09l0.41,0.77l3.4,0.63l1.4,1.13l-0.16,0.71l0.59,1.11l-0.36,0.81l0.43,1.25l-0.78,1.25l-0.03,1.76l0.91,0.63l1.38,-0.26l1.02,-0.72l0.2,0.26l-0.79,2.44l0.04,1.31l1.32,1.46l0.84,0.35l-0.24,2.02l-2.42,1.2l-0.51,0.78l0.04,1.26l-1.61,3.49l-0.4,3.5l1.11,0.83l0.91,-0.04l0.5,-0.37l0.49,-1.37l1.82,-1.47l0.66,-2.54l1.06,-1.7l0.59,0.18l0.58,-0.71l0.87,-0.4l1.12,1.12l0.59,0.2l-0.28,2.18l-1.19,2.85l-0.57,5.58l0.23,1.11l0.8,0.93l0.07,0.52l-0.51,0.98l-1.3,1.34l-0.86,3.88l0.15,2.57l0.72,1.2l0.06,1.24l-1.07,3.23l0.12,2.11l-0.73,2.11l-0.28,2.46l0.59,2.02l-0.04,1.32l0.49,0.53l-0.21,1.7l0.92,0.78l0.54,2.44l1.2,1.54l0.08,1.69l-0.33,1.45l0.48,2.95l-44.2,4.6l-0.19,-0.79l-1.56,-2.19l-4.94,-0.84l-1.06,-1.35l-0.36,-1.68l-0.9,-1.21l-0.86,-4.89l1.04,-2.61l-0.09,-0.99l-0.71,-0.79l-1.44,-0.48l-0.71,-1.76l-0.47,-6.02l-0.7,-1.4l-0.52,-2.56l-1.15,-0.6l-1.1,-1.56l-0.93,-0.11l-1.17,-0.75l-1.71,0.09l-2.67,-1.79l-2.3,-3.5l-2.64,-2.1l-2.94,-0.53l-0.73,-1.24l-1.12,-1.0l-3.12,-0.45l-3.53,-2.74l0.45,-1.24l-0.12,-1.61l0.25,-0.81l-0.88,-3.11Z", "name": "Wisconsin"}, "US-OR": {"path": "M10.81,140.09l0.63,-3.94l1.32,-2.52l0.23,-1.22l-0.01,-1.26l-0.46,-0.66l-0.14,-1.12l-0.42,-0.32l-0.11,-1.85l2.73,-3.63l2.2,-4.73l0.1,-1.09l0.42,-0.27l0.01,0.79l0.73,0.1l0.42,-1.11l0.88,-0.84l0.23,0.94l1.39,0.27l-0.51,-2.64l-0.92,0.08l2.09,-3.81l1.11,-0.76l0.8,0.4l0.55,-0.33l-0.66,-1.35l-0.6,-0.3l1.71,-4.39l0.41,-0.38l0.04,-0.96l1.74,-5.49l0.97,-1.98l0.4,0.33l0.67,-0.29l-0.12,-0.97l-0.56,-0.32l0.96,-2.74l0.81,0.17l0.23,-0.45l-0.16,-0.52l-0.52,-0.28l0.54,-2.86l1.58,-2.7l0.83,-3.02l1.14,-1.76l0.97,-3.1l-0.08,-1.04l1.21,-1.1l0.04,-0.6l-0.46,-0.65l0.14,-0.52l0.51,0.64l0.45,0.05l0.39,-0.63l0.17,-1.39l-0.74,-0.72l0.5,-1.2l1.28,-0.78l0.05,-0.46l-0.86,-0.5l-0.26,-1.11l0.86,-2.17l-0.06,-1.44l0.92,-0.59l0.4,-0.85l0.07,-3.75l0.49,0.86l0.9,0.41l-0.04,0.91l0.55,0.53l0.43,-0.82l0.39,-0.14l-0.27,-0.98l1.12,0.84l1.53,0.0l1.45,-0.68l1.44,2.36l1.99,0.78l1.39,-0.67l0.91,0.06l1.72,1.51l0.77,1.04l0.21,1.9l0.43,0.78l-0.03,2.05l-0.39,1.24l0.19,0.93l-0.43,1.74l0.26,1.45l0.79,0.85l1.94,0.56l1.44,1.05l2.4,1.1l4.98,-0.53l2.9,-1.06l1.14,0.51l2.23,0.09l4.24,1.43l0.69,0.54l0.19,1.15l0.57,0.58l1.86,-0.27l2.11,0.71l3.79,-0.55l0.69,-0.42l2.19,0.93l1.64,0.24l1.19,-0.3l0.88,0.26l1.89,-0.78l3.07,-0.43l4.16,0.13l1.61,-0.91l7.16,1.02l0.96,-0.19l0.79,-0.58l31.27,5.93l0.23,1.81l0.93,1.82l1.16,0.63l1.96,1.86l0.57,2.45l-0.16,1.0l-3.69,4.54l-0.4,1.41l-1.39,2.63l-2.21,2.42l-0.65,2.68l-1.49,1.84l-2.23,1.5l-1.92,3.35l-1.49,1.27l-0.62,2.02l-0.12,1.87l0.28,0.92l0.56,0.61l0.54,0.04l0.39,-0.35l0.63,0.76l0.89,-0.05l0.07,0.88l0.8,0.95l-0.46,1.0l-0.65,0.06l-0.33,0.4l0.21,1.8l-1.03,2.56l-1.22,1.41l-6.86,39.15l-26.21,-4.99l-28.89,-6.05l-28.8,-6.61l-28.87,-7.22l-1.54,-2.51l0.26,-2.47l-0.29,-0.87Z", "name": "Oregon"}, "US-KY": {"path": "M583.03,306.53l0.35,-2.18l1.13,0.96l0.72,0.2l0.75,-0.36l0.46,-0.88l0.87,-3.55l-0.54,-1.75l0.38,-0.86l-0.1,-1.87l-1.27,-2.04l1.79,-3.21l1.24,-0.51l0.73,0.06l7.03,2.56l0.81,-0.2l0.65,-0.72l0.24,-1.93l-1.48,-2.14l-0.24,-1.44l0.2,-0.87l0.4,-0.52l1.1,-0.18l1.24,-0.83l3.0,-0.95l0.64,-0.51l0.15,-1.13l-1.53,-2.05l-0.08,-0.68l1.33,-1.97l0.14,-1.16l1.25,0.42l1.12,-1.33l-0.68,-2.0l1.92,0.9l1.72,-0.84l0.03,1.18l1.0,0.46l0.99,-0.94l0.02,-1.36l0.51,0.16l1.9,-0.96l4.41,1.52l0.64,0.94l0.86,0.18l0.59,-0.59l0.73,-2.53l1.38,-0.55l1.39,-1.34l0.86,1.29l0.77,0.42l1.16,-0.13l0.11,0.75l0.95,0.19l0.67,-0.62l0.03,-1.0l0.84,-0.38l0.26,-0.48l-0.25,-2.09l0.84,-0.4l0.34,-0.56l-0.06,-0.69l1.25,-0.56l0.34,-0.72l0.38,1.47l0.61,0.6l1.46,0.64l1.25,-0.0l1.11,0.81l0.53,-0.11l0.26,-0.55l1.1,-0.46l0.53,-0.69l0.04,-3.47l0.85,-2.18l1.02,0.18l1.55,-1.19l0.75,-3.46l1.04,-0.37l1.65,-2.23l0.0,-0.81l-1.18,-2.88l2.78,-0.59l1.54,0.81l3.85,-2.82l2.23,-0.46l-0.18,-1.07l0.36,-1.47l-0.32,-0.36l-1.22,-0.04l0.58,-1.39l-1.09,-1.54l1.65,-1.83l1.81,1.18l0.92,-0.11l1.93,-1.01l0.78,0.88l1.75,0.54l0.57,1.28l0.94,0.92l0.79,1.84l2.6,0.67l1.87,-0.57l1.63,0.27l2.18,1.85l0.96,0.43l1.28,-0.18l0.61,-1.31l0.99,-0.54l1.35,0.5l1.34,0.04l1.33,1.09l1.26,-0.69l1.41,-0.15l1.81,-2.55l1.72,-1.03l0.92,2.35l0.7,0.83l2.45,0.81l1.35,0.97l0.75,1.05l0.93,3.35l-0.37,0.45l0.09,0.72l-0.44,0.61l0.02,0.53l2.24,2.62l1.35,0.92l-0.08,0.89l1.34,0.97l0.58,1.35l1.55,1.2l0.98,1.62l2.14,0.84l1.09,1.12l2.14,0.25l-4.86,6.13l-5.06,4.15l-0.42,0.86l0.22,1.25l-2.07,1.93l0.04,1.64l-3.06,1.63l-0.8,2.38l-1.71,0.6l-2.7,1.83l-1.66,0.48l-3.39,2.42l-23.95,3.09l-8.8,1.42l-7.47,0.86l-7.68,0.46l-22.71,3.52l-0.64,-0.56l-3.63,0.09l-0.41,0.6l1.03,3.57l-22.99,2.73Z", "name": "Kentucky"}, "US-ME": {"path": "M837.01,56.27l0.87,-1.15l1.42,1.7l0.84,0.04l0.39,-2.12l-0.46,-2.19l1.7,0.36l0.73,-0.42l0.21,-0.52l-0.32,-0.7l-1.18,-0.47l-0.44,-0.62l0.19,-1.42l0.86,-2.02l2.08,-2.25l0.01,-0.98l-0.52,-0.93l1.02,-1.64l0.39,-1.51l-0.22,-0.92l-1.02,-0.35l-0.07,-1.42l-0.4,-0.43l0.55,-0.96l-0.04,-0.63l-1.0,-1.26l0.13,-1.73l0.37,-0.63l-0.15,-0.97l1.22,-1.93l-0.96,-6.17l5.58,-18.87l2.25,-0.23l1.14,3.18l0.55,0.43l2.54,0.56l1.83,-1.73l1.68,-0.83l1.24,-1.72l1.25,-0.12l0.64,-0.47l0.25,-1.43l0.42,-0.3l1.36,0.04l3.68,1.41l1.14,0.96l2.36,1.05l8.38,22.7l0.64,0.65l-0.19,1.26l0.64,0.86l-0.1,1.52l-0.33,0.05l-0.24,0.66l1.72,1.13l1.79,0.22l0.82,0.41l1.88,-0.19l1.25,-0.64l0.34,0.86l-0.59,1.43l1.69,1.86l0.28,2.69l2.72,1.68l0.98,-0.1l0.47,-0.74l-0.06,-0.5l0.36,0.08l0.25,0.49l0.64,0.07l1.41,1.11l0.27,0.75l1.27,0.94l0.04,0.47l-0.52,-0.14l-0.39,0.41l0.18,0.77l-0.76,-0.15l-0.35,0.4l0.16,0.63l0.81,0.53l0.55,0.92l0.48,0.17l0.16,-0.88l0.39,-0.17l0.8,0.32l0.25,-0.83l0.34,0.41l-0.31,0.85l-0.53,0.19l-1.21,3.24l-0.63,-0.04l-0.31,0.44l-0.55,-1.05l-0.72,0.03l-0.3,0.5l-0.56,0.06l-0.02,0.49l0.58,0.85l-0.9,-0.45l-0.33,0.63l0.26,0.52l-1.2,-0.28l-0.36,0.3l-0.37,0.78l0.07,0.45l0.44,0.08l0.07,1.21l-0.37,-0.57l-0.55,-0.06l-0.39,0.45l-0.2,1.09l-0.48,-1.53l-1.14,0.01l-0.68,0.75l-0.36,1.48l0.59,0.63l-0.83,0.63l-0.69,-0.46l-0.73,1.04l0.1,0.64l0.99,0.63l-0.35,0.21l-0.1,0.82l-0.46,-0.21l-0.85,-1.82l-1.03,-0.46l-0.39,0.22l-0.45,-0.41l-0.57,0.63l-1.24,-0.19l-0.26,0.85l0.78,0.4l0.01,0.37l-0.51,-0.05l-0.56,0.4l-0.09,0.7l-0.49,-1.02l-1.17,-0.02l-0.16,0.64l0.52,0.88l-1.44,0.96l0.84,1.11l0.08,1.06l0.53,0.65l-0.97,-0.41l-0.96,0.22l-1.2,-0.42l-0.17,-0.91l0.74,-0.28l-0.08,-0.56l-0.42,-0.49l-0.67,-0.12l-0.3,0.33l-0.23,-2.37l-0.37,-0.22l-1.1,0.27l0.04,1.96l-1.85,1.92l0.02,0.49l1.25,1.47l-0.64,0.96l-0.19,3.87l0.77,1.41l-1.08,1.72l-0.8,-0.19l-0.45,0.93l-0.62,-0.06l-0.41,-1.15l-0.73,-0.21l-0.52,1.03l0.11,0.69l-0.45,0.59l0.12,2.41l-0.95,-1.01l0.14,-1.28l-0.24,-0.59l-0.82,0.29l-0.08,2.01l-0.44,-0.25l0.15,-1.54l-0.47,-0.4l-0.68,0.49l-0.76,3.04l-0.77,-1.97l0.17,-1.21l-0.4,-0.27l-0.46,0.21l-1.05,2.59l0.35,0.53l0.85,-0.15l0.95,2.08l-0.28,-0.59l-0.51,-0.23l-0.66,0.3l-0.07,0.64l-1.38,-0.1l-2.16,3.17l-0.53,1.86l0.29,0.6l-0.68,0.65l0.51,0.43l0.91,-0.21l0.37,0.92l-0.77,0.3l-0.2,0.39l-0.4,-0.04l-0.51,0.57l-0.14,1.03l0.67,1.37l-0.08,0.68l-0.79,1.29l-0.94,0.61l-0.54,1.29l0.44,1.56l-0.4,2.81l-0.8,-0.33l-0.42,0.59l-1.02,-0.76l-0.57,-1.85l-0.93,-0.37l-2.36,-1.99l-0.76,-3.45l-13.24,-35.53ZM863.91,81.24l0.08,0.26l-0.08,0.23l0.03,-0.29l-0.04,-0.2ZM865.32,81.46l0.47,0.7l-0.04,0.47l-0.32,-0.25l-0.1,-0.93ZM867.66,78.32l0.42,0.82l-0.16,0.14l-0.42,-0.19l0.16,-0.77ZM877.03,64.89l-0.14,0.2l-0.03,-0.24l0.17,0.04ZM873.08,75.23l0.01,0.02l-0.03,0.03l0.01,-0.06Z", "name": "Maine"}, "US-OH": {"path": "M665.07,178.88l1.66,0.36l0.97,-0.31l1.75,1.07l2.07,0.26l1.47,1.17l1.7,0.24l-2.17,1.18l-0.12,0.47l0.42,0.24l2.45,0.19l1.39,-1.1l1.76,-0.25l3.39,0.96l0.92,-0.08l1.48,-1.3l1.73,-0.59l1.15,-0.97l1.91,-0.97l2.61,-0.03l1.09,-0.62l1.24,-0.06l1.07,-0.8l4.24,-5.46l4.53,-3.47l6.92,-4.36l5.83,28.04l-0.51,0.54l-1.28,0.43l-0.41,0.95l1.65,2.23l0.02,2.11l0.41,0.26l0.31,0.94l-0.04,0.76l-0.54,0.83l-0.5,4.08l0.18,3.21l-0.58,0.41l0.34,1.11l-0.35,1.74l-0.39,0.54l0.76,1.23l-0.25,1.87l-2.41,2.65l-0.82,1.86l-1.37,1.5l-1.24,0.67l-0.6,0.7l-0.87,-0.92l-1.18,0.14l-1.32,1.74l-0.09,1.32l-1.78,0.85l-0.78,2.25l0.28,1.58l-0.94,0.85l0.3,0.67l0.63,0.41l0.27,1.3l-0.8,0.17l-0.5,1.6l0.06,-0.93l-0.91,-1.26l-1.53,-0.55l-1.07,0.71l-0.82,1.98l-0.34,2.69l-0.53,0.82l1.22,3.58l-1.27,0.39l-0.28,0.42l-0.25,3.12l-2.66,1.2l-1.0,0.05l-0.76,-1.06l-1.51,-1.1l-2.34,-0.73l-1.16,-1.92l-0.31,-1.14l-0.42,-0.33l-0.73,0.13l-1.84,1.17l-1.1,1.28l-0.4,1.05l-1.43,0.15l-0.87,0.61l-1.11,-1.0l-3.14,-0.59l-1.37,0.72l-0.53,1.25l-0.71,0.05l-3.04,-2.26l-1.93,-0.29l-1.77,0.56l-2.14,-0.52l-0.55,-1.54l-0.96,-0.97l-0.63,-1.38l-2.03,-0.76l-1.14,-1.01l-0.97,0.26l-1.31,0.89l-0.46,0.03l-1.79,-1.23l-0.61,0.2l-0.6,0.7l-8.67,-55.57l20.65,-4.25ZM675.61,181.3l0.53,-0.79l0.67,0.41l-0.48,0.35l-0.72,0.03Z", "name": "Ohio"}, "US-OK": {"path": "M399.11,359.23l-0.05,-42.02l-0.39,-0.4l-51.81,-0.82l0.31,-10.23l36.69,0.74l35.99,-0.07l35.98,-0.86l35.56,-1.62l0.6,10.68l4.55,24.34l1.41,37.87l-1.2,-0.22l-0.29,-0.36l-2.13,-0.21l-0.82,-0.79l-2.11,-0.39l-1.77,-2.05l-1.23,-0.22l-2.25,-1.56l-1.5,-0.4l-0.8,0.46l-0.23,0.88l-0.82,0.24l-0.46,0.62l-2.47,-0.14l-1.79,-1.48l-2.3,1.29l-1.16,0.2l-0.19,0.56l-0.63,0.28l-2.12,-0.77l-1.7,1.18l-2.06,0.51l-0.83,1.37l-1.48,0.06l-0.57,1.25l-1.26,-1.55l-1.7,-0.1l-0.32,-0.58l-1.21,-0.46l-0.02,-0.96l-0.44,-0.5l-1.24,-0.18l-0.73,1.38l-0.66,0.11l-0.84,-0.5l-0.97,0.07l-0.71,-1.51l-1.09,-0.35l-1.17,0.57l-0.45,1.7l-0.7,-0.08l-0.49,0.43l0.29,0.73l-0.51,1.68l-0.43,0.19l-0.86,-1.45l0.39,-1.65l-0.75,-0.86l-0.8,0.18l-0.49,0.76l-0.84,-0.18l-0.92,0.98l-1.07,0.13l-0.53,-1.36l-1.99,-0.19l-0.3,-1.48l-1.19,-0.53l-0.82,0.33l-2.12,2.15l-1.21,0.51l-0.97,-0.38l0.19,-1.25l-0.28,-1.13l-2.33,-0.67l-0.07,-2.18l-0.43,-0.55l-2.11,0.39l-2.52,-0.25l-0.64,0.26l-0.81,1.21l-0.95,0.06l-1.76,-1.77l-0.97,-0.12l-1.5,0.56l-2.68,-0.63l-1.86,-1.0l-1.05,0.25l-2.46,-0.3l-0.17,-2.12l-0.85,-0.87l-0.43,-1.02l-1.16,-0.41l-0.7,-0.83l-0.83,0.08l-0.44,1.64l-2.22,-0.68l-1.07,0.6l-0.96,-0.09l-3.79,-3.78l-1.12,-0.43l-0.8,0.08Z", "name": "Oklahoma"}, "US-ID": {"path": "M132.48,121.36l-0.34,-0.44l0.08,-1.99l0.53,-1.74l1.42,-1.22l2.11,-3.59l1.68,-0.92l1.39,-1.52l1.08,-2.15l0.05,-1.22l2.21,-2.41l1.43,-2.7l0.37,-1.37l2.04,-2.26l1.89,-2.81l0.03,-1.01l-0.79,-2.95l-2.13,-1.94l-0.87,-0.36l-0.85,-1.61l-0.41,-3.02l-0.59,-1.19l0.94,-1.19l-0.12,-2.35l-1.04,-2.69l10.12,-55.42l13.39,2.35l-3.54,20.71l1.29,2.89l1.0,1.27l0.27,1.55l1.17,1.76l-0.12,0.83l0.39,1.14l-0.99,0.95l0.83,1.76l-0.83,0.11l-0.28,0.71l1.93,1.68l1.03,2.04l2.24,1.22l0.54,1.58l1.09,1.33l1.49,2.79l0.08,0.68l1.64,1.81l0.01,1.88l1.79,1.71l-0.07,1.35l0.74,0.19l0.9,-0.58l0.36,0.46l-0.36,0.55l0.07,0.54l1.11,0.96l1.61,0.15l1.81,-0.36l-0.63,2.61l-0.99,0.54l0.25,1.14l-1.83,3.73l0.06,1.72l-0.81,0.07l-0.37,0.54l0.6,1.33l-0.62,0.9l-0.03,1.16l0.96,0.93l-0.37,0.81l0.28,1.01l-1.57,0.43l-1.21,1.41l0.1,1.11l0.46,0.77l-0.13,0.73l-0.83,0.77l-0.2,1.52l1.48,0.63l1.38,1.79l0.78,0.27l1.08,-0.35l0.56,-0.8l1.85,-0.41l1.21,-1.28l0.81,-0.29l0.15,-0.76l0.78,0.81l0.23,0.71l1.05,0.64l-0.42,1.23l0.73,0.95l-0.34,1.38l0.57,1.34l-0.21,1.61l1.54,2.64l0.31,1.73l0.82,0.37l0.67,2.08l-0.18,0.98l-0.76,0.64l0.51,1.89l1.24,1.16l0.3,0.79l0.81,0.08l0.86,-0.37l1.04,0.93l1.06,2.79l-0.5,0.81l0.89,1.83l-0.28,0.6l0.11,0.98l2.29,2.41l0.97,-0.14l-0.01,-1.14l1.07,-0.89l0.93,-0.22l4.53,1.62l0.69,-0.32l0.67,-1.35l1.19,-0.39l2.25,0.93l3.3,-0.1l0.96,0.88l2.29,-0.58l3.23,0.78l0.45,-0.49l-0.67,-0.76l0.26,-1.06l0.74,-0.48l-0.07,-0.96l1.23,-0.51l0.48,0.37l1.07,2.11l0.12,1.11l1.36,1.95l0.73,0.45l-6.27,53.85l-47.47,-6.31l-46.96,-7.72l6.88,-39.16l1.12,-1.18l1.07,-2.67l-0.21,-1.74l0.74,-0.15l0.77,-1.62l-0.9,-1.27l-0.18,-1.2l-1.24,-0.08l-0.64,-0.81l-0.88,0.29Z", "name": "Idaho"}, "US-WY": {"path": "M218.62,206.98l10.1,-86.59l25.45,2.74l26.79,2.4l26.83,1.91l27.84,1.46l-3.67,87.1l-27.31,-1.41l-28.2,-1.97l-29.69,-2.63l-28.14,-3.02Z", "name": "Wyoming"}, "US-UT": {"path": "M220.28,185.78l-2.51,21.5l0.35,0.45l32.23,3.42l-8.32,87.13l-42.53,-4.67l-42.4,-5.77l16.08,-108.32l47.1,6.26Z", "name": "Utah"}, "US-IN": {"path": "M600.87,189.59l1.42,0.87l2.1,0.15l1.52,-0.38l2.63,-1.39l2.73,-2.1l32.14,-4.8l8.96,57.41l-0.66,1.15l0.3,0.92l0.81,0.79l-0.66,1.14l0.49,0.8l1.12,0.04l-0.36,1.14l0.18,0.51l-1.81,0.29l-3.18,2.55l-0.43,0.17l-1.4,-0.81l-3.46,0.91l-0.09,0.78l1.19,3.1l-1.4,1.88l-1.18,0.49l-0.45,0.89l-0.31,2.6l-1.11,0.88l-1.06,-0.24l-0.47,0.47l-0.85,1.95l0.05,3.13l-0.39,1.0l-1.38,0.85l-0.93,-0.68l-1.24,0.01l-1.47,-0.69l-0.62,-1.84l-1.89,-0.73l-0.44,0.3l-0.04,0.5l0.83,0.68l-0.62,0.31l-0.89,-0.35l-0.36,0.29l0.5,1.42l-1.08,0.68l0.14,2.37l-1.06,0.65l-0.0,0.83l-0.16,0.37l-0.25,-1.01l-1.6,0.18l-1.4,-1.69l-0.5,-0.08l-1.67,1.5l-1.57,0.69l-1.07,2.89l-0.81,-1.07l-2.79,-0.77l-1.11,-0.61l-1.08,-0.18l-1.76,0.92l-0.64,-1.02l-0.58,-0.18l-0.53,0.56l0.64,1.86l-0.34,0.84l-0.28,0.09l-0.02,-1.18l-0.42,-0.4l-0.58,0.01l-1.46,0.79l-1.41,-0.84l-0.85,0.0l-0.48,0.95l0.71,1.55l-0.49,0.74l-1.15,-0.39l-0.07,-0.54l-0.53,-0.44l0.55,-0.63l-0.35,-3.09l0.96,-0.78l-0.07,-0.58l-0.44,-0.23l0.69,-0.46l0.25,-0.61l-1.17,-1.47l0.46,-1.16l0.32,0.19l1.39,-0.55l0.33,-1.8l0.55,-0.4l0.44,-0.92l-0.06,-0.83l1.52,-1.07l0.06,-0.69l-0.41,-0.93l0.57,-0.86l0.14,-1.29l0.87,-0.51l0.4,-1.91l-1.08,-2.54l0.06,-1.91l-0.93,-0.91l-0.61,-1.5l-1.05,-0.78l-0.04,-0.58l0.92,-1.39l-0.63,-2.25l1.27,-1.31l-6.5,-50.67Z", "name": "Indiana"}, "US-IL": {"path": "M540.1,225.5l0.86,-0.35l0.37,-0.67l-0.23,-2.33l-0.73,-0.93l0.15,-0.41l0.72,-0.69l2.42,-0.98l0.71,-0.65l0.63,-1.68l0.17,-2.11l1.65,-2.47l0.27,-0.94l-0.03,-1.22l-0.59,-1.95l-2.23,-1.88l-0.11,-1.77l0.67,-2.38l0.45,-0.37l4.6,-0.85l0.81,-0.41l0.82,-1.12l2.55,-1.0l1.43,-1.56l0.39,-3.28l1.42,-1.46l0.29,-0.74l0.33,-4.37l-0.76,-2.14l-4.02,-2.47l-0.28,-1.5l-0.48,-0.82l-3.64,-2.48l44.57,-4.64l-0.01,2.65l0.57,2.59l1.38,2.49l1.3,0.95l0.76,2.6l1.26,2.71l1.42,1.85l6.6,51.47l-1.22,1.13l-0.1,0.69l0.67,1.76l-0.84,1.09l-0.03,1.11l1.19,1.09l0.56,1.41l0.89,0.82l-0.1,1.8l1.06,2.31l-0.28,1.49l-0.87,0.56l-0.21,1.47l-0.59,0.93l0.34,1.2l-1.48,1.13l-0.23,0.41l0.28,0.7l-0.93,1.17l-0.31,1.19l-1.64,0.67l-0.63,1.67l0.15,0.8l0.97,0.83l-1.27,1.15l0.42,0.76l-0.49,0.23l-0.13,0.54l0.43,2.94l-1.15,0.19l0.08,0.45l0.91,0.78l-0.48,0.17l-0.03,0.64l0.83,0.29l0.04,0.42l-1.31,1.97l-0.25,1.19l0.59,1.22l0.7,0.64l0.37,1.08l-3.31,1.22l-1.19,0.82l-1.24,0.24l-0.77,1.01l-0.18,2.04l1.7,2.81l0.07,0.54l-0.53,1.19l-0.96,0.03l-6.3,-2.43l-1.08,-0.08l-1.57,0.64l-0.68,0.72l-1.44,2.95l0.06,0.66l-1.18,-1.2l-0.79,0.14l-0.35,0.47l0.59,1.13l-1.24,-0.79l-0.01,-0.68l-1.6,-2.21l-0.4,-1.12l-0.75,-0.37l-0.05,-0.49l0.94,-1.35l0.2,-1.03l-0.32,-1.01l-1.44,-2.02l-0.47,-3.18l-2.26,-0.99l-1.55,-2.14l-1.95,-0.82l-1.72,-1.34l-1.56,-0.14l-1.82,-0.96l-2.32,-1.78l-2.34,-2.44l-0.36,-1.95l2.37,-6.85l-0.25,-2.32l0.98,-2.06l-0.38,-0.84l-2.66,-1.45l-2.59,-0.67l-1.29,0.45l-0.86,1.45l-0.9,0.15l-1.3,-1.9l-0.43,-1.52l0.16,-0.87l-0.54,-0.91l-0.29,-1.65l-0.83,-1.36l-0.94,-0.9l-4.11,-2.52l-1.01,-1.64l-4.53,-3.53l-0.73,-1.9l-1.04,-1.21l-0.04,-1.6l-0.96,-1.48l-0.75,-3.54l0.1,-2.94l0.6,-1.28ZM585.53,295.46l0.05,0.05l0.04,0.04l-0.05,-0.0l-0.04,-0.09Z", "name": "Illinois"}, "US-AK": {"path": "M64.88,530.75l0.06,-0.04l0.04,0.06l-0.06,-0.01l-0.05,-0.0ZM66.64,530.24l1.13,0.16l0.11,0.52l-1.21,0.78l-0.23,-0.24l0.3,-0.47l-0.09,-0.76ZM69.51,530.52l0.7,-0.13l0.3,-0.66l2.1,-0.44l2.68,0.09l1.86,0.74l0.99,0.81l0.04,2.23l0.65,0.89l0.77,-0.37l-0.07,-0.76l0.56,0.36l-0.1,0.53l1.05,1.08l-1.24,-0.51l-0.68,0.56l-0.08,-0.76l-1.26,-0.01l-0.76,-0.43l-0.82,0.28l-1.12,-0.26l-0.44,-0.54l0.4,-0.34l0.95,0.84l0.47,-0.03l0.2,-0.5l-0.7,-1.62l-1.11,-0.6l-1.17,0.32l-0.66,0.82l-1.29,0.37l-0.52,-0.37l-0.59,0.38l-0.74,-0.26l-0.58,0.37l0.21,-2.07ZM81.1,534.87l0.81,-0.72l-0.68,-1.59l0.14,-0.29l1.83,-1.05l3.86,-0.11l2.68,0.81l0.57,-0.32l1.04,0.3l0.88,1.1l0.7,-0.06l0.9,-1.66l2.68,-0.78l1.06,0.33l1.28,-0.46l0.86,0.05l-0.14,0.54l0.5,0.59l1.15,0.33l0.6,-0.91l-0.56,-0.35l-0.31,0.15l0.28,-0.7l-0.2,-0.46l2.24,-2.37l1.05,0.07l0.63,0.82l0.66,-0.29l-0.11,-0.63l-1.04,-0.94l0.19,-0.63l0.96,-0.57l3.31,-0.22l-0.15,-0.63l0.81,-0.73l0.76,-0.04l1.14,-1.23l-0.94,-0.25l-0.69,0.62l-0.61,-0.12l-0.59,0.33l-5.45,-1.21l0.08,-1.16l-0.36,-0.69l0.61,-0.46l0.52,-0.18l0.49,0.51l-0.04,1.27l0.91,-0.05l0.15,-0.75l-0.06,-0.85l-0.98,-1.22l0.01,-0.82l-0.67,-0.19l-0.29,0.86l-0.73,0.37l-0.19,0.06l0.24,-0.27l-0.27,-0.52l-0.4,-0.11l-0.76,0.98l-0.97,0.24l-0.67,2.38l-0.33,0.05l-0.36,-0.33l0.03,-4.92l-0.66,-0.64l-1.23,0.46l0.07,-0.72l-0.68,-0.92l0.27,-0.42l-0.12,-1.01l-2.89,-0.21l-0.54,-0.39l-1.37,-0.13l-0.43,-0.56l-1.2,0.69l-0.99,-0.27l-0.29,-0.65l1.23,-0.02l-0.05,-0.92l0.46,-0.72l1.47,-0.11l-0.03,-0.81l-1.33,-0.74l0.14,-0.43l0.85,-0.72l1.34,-0.01l0.43,-0.43l0.58,-4.63l1.27,-1.41l-0.84,-0.73l1.97,-1.03l1.58,0.21l0.44,-0.55l-0.81,-0.46l-0.34,-0.75l-0.6,0.5l-0.57,-0.1l-1.3,0.72l-2.17,0.25l-0.12,0.5l0.5,0.82l-0.72,0.78l-0.48,-0.47l-2.21,-0.3l-2.19,-1.17l-1.56,-1.56l0.03,-0.37l0.7,-0.05l0.04,-0.67l-0.61,-1.28l-0.09,-1.54l0.39,-0.61l-0.72,-0.34l-0.58,-1.19l0.93,-0.28l0.14,-0.6l-1.09,-0.61l1.52,0.14l0.51,-0.46l0.88,0.03l0.05,0.6l1.07,1.2l-1.21,0.44l-0.39,0.39l0.31,0.47l1.11,-0.1l0.47,0.28l1.12,-0.22l0.18,0.15l-0.72,1.13l0.74,0.73l1.63,0.09l0.68,-0.64l-0.26,-0.92l0.44,-0.39l-0.14,-1.27l-0.59,-0.28l-1.31,0.1l-1.81,-1.44l0.01,-0.63l-0.97,-1.12l0.81,0.16l0.53,-0.4l-1.18,-1.08l0.63,-0.51l-0.14,-0.67l1.25,-0.21l0.53,0.32l0.83,-0.05l0.73,-0.46l-0.08,-0.52l-3.03,-0.29l-1.91,0.63l-0.4,0.68l-0.19,-0.22l0.72,-1.02l-0.63,-1.4l0.68,0.09l0.47,-0.54l-0.48,-1.21l0.96,0.46l0.42,-0.51l-0.63,-0.98l1.73,1.01l0.42,-1.53l0.59,-0.35l3.77,-0.6l0.5,0.35l0.25,0.85l-0.36,0.21l0.14,0.47l1.2,0.19l0.3,-0.42l-0.18,-1.0l1.6,-0.11l0.29,-0.63l-1.51,-0.29l0.59,-0.27l0.16,-0.74l0.9,-0.32l1.37,1.16l0.47,-0.57l-0.32,-0.84l0.37,-0.03l1.02,0.42l1.03,1.2l-0.04,0.6l-0.87,-0.06l-0.35,0.64l1.72,0.3l0.1,0.67l1.21,0.8l3.02,0.17l1.92,-0.37l0.11,0.59l2.89,1.88l2.0,0.37l1.83,-0.33l0.67,-0.63l0.41,-1.78l0.72,-1.29l-0.14,-1.81l0.74,0.39l1.24,-0.12l0.86,-0.71l-0.17,-1.62l0.3,-0.04l0.11,-0.44l-0.25,-0.34l-0.83,-0.45l-1.45,0.34l-0.98,-1.22l-1.22,0.1l-0.5,-0.38l-2.79,-0.15l-0.75,0.51l0.35,-0.85l-0.56,-1.94l-1.57,-0.24l-3.01,-2.71l-1.14,-0.28l-0.95,-0.93l-0.77,0.17l-3.27,-3.98l-0.31,-1.07l0.73,-0.34l0.39,-0.82l-0.53,-1.14l0.14,-0.32l0.52,0.26l1.05,-0.26l1.2,1.12l0.36,-0.78l-2.39,-3.21l-1.44,-1.39l-1.03,-2.33l0.73,0.11l1.02,0.72l1.24,-0.42l0.31,0.63l0.57,0.29l1.08,0.2l0.98,-0.22l1.81,0.53l1.37,1.81l1.19,0.53l0.56,-0.47l-0.6,-1.16l1.94,0.62l0.58,0.79l2.66,0.53l1.79,1.18l0.34,0.64l-0.69,0.11l-0.63,0.77l-1.35,-0.42l-0.12,0.69l0.75,0.66l0.19,1.01l2.13,1.87l1.3,0.71l-0.16,0.68l2.13,1.1l0.66,1.36l0.45,0.21l2.16,-0.88l0.7,1.0l-0.4,0.08l0.01,0.51l0.87,0.33l0.96,-0.71l-0.06,-1.11l-0.58,-0.85l0.4,0.0l1.01,2.11l1.88,1.12l0.85,-0.28l0.74,-1.61l-0.17,-0.25l-1.34,-0.47l-0.61,-1.11l-1.03,-0.61l-1.16,0.14l-0.44,-0.38l-0.48,-1.61l1.18,-0.54l0.78,0.4l0.37,-0.59l-0.87,-1.38l-1.35,-0.8l0.0,-1.23l-0.47,-0.25l-1.01,0.43l-3.2,-3.27l0.71,-1.39l0.04,-2.41l-2.35,-5.81l-1.25,-1.7l-0.54,-1.91l1.29,-0.66l1.24,-1.29l3.37,2.86l2.53,1.62l1.6,0.63l4.17,0.25l2.43,-1.65l1.96,0.17l1.51,-0.27l4.46,2.3l3.16,0.43l0.14,0.68l-0.34,0.08l-0.14,0.66l0.53,0.23l0.34,1.4l0.55,-0.29l0.38,-1.21l1.25,0.75l0.88,0.14l0.29,-0.35l-0.22,-0.39l-1.5,-1.03l0.05,-0.38l0.97,-0.06l0.34,0.13l0.34,1.14l0.55,0.33l0.18,-0.22l0.76,0.21l3.84,2.25l2.9,0.43l2.71,-0.19l0.31,0.85l0.85,0.61l0.02,0.66l1.47,0.88l-0.91,-0.04l-0.91,-0.49l-0.93,0.25l0.42,0.83l-0.26,0.43l0.18,0.59l0.73,-0.04l1.12,0.51l1.03,-0.39l1.07,0.65l0.92,-0.02l0.21,0.47l-0.71,0.01l-0.29,0.34l1.75,2.14l1.64,0.18l2.21,1.14l1.47,1.72l0.67,-0.07l0.41,0.37l-1.57,0.55l-0.18,0.63l2.16,1.28l-0.22,0.75l1.74,1.13l0.58,0.79l0.82,-0.05l1.56,0.52l0.51,0.45l0.14,0.61l2.14,0.56l1.96,1.16l1.82,1.63l0.39,0.96l1.19,0.37l1.05,0.92l-0.12,0.41l0.45,0.47l1.93,1.39l4.48,2.43l1.5,1.94l1.21,0.76l1.38,0.67l0.93,0.04l0.77,0.37l0.03,0.38l1.6,0.03l1.23,0.61l0.47,0.58l0.29,-0.26l1.69,1.44l1.68,2.36l1.24,0.84l0.65,1.11l1.25,0.49l-27.91,60.77l0.17,0.48l1.69,1.44l0.83,-0.19l1.44,1.5l2.05,-0.3l2.16,0.82l-0.98,1.08l-0.15,0.61l0.53,1.11l1.01,1.05l0.05,1.28l2.81,5.56l-0.47,2.71l0.54,0.33l1.98,-0.35l0.06,0.23l-1.19,0.71l0.29,0.54l0.84,-0.22l1.03,0.71l0.36,1.46l-0.28,0.03l-0.1,0.51l0.26,0.36l1.11,0.26l-0.24,0.59l0.49,0.49l-0.11,0.51l-0.36,-0.03l-0.12,-0.59l-0.85,-0.8l-0.47,-0.03l-1.0,0.68l-0.32,-0.86l-1.11,-0.57l-1.15,-1.83l0.58,-0.48l-0.09,-0.3l-0.99,-0.27l-0.56,-1.13l-0.02,-1.29l-1.34,-2.12l0.09,-0.76l-1.17,-0.46l-1.47,-1.72l-0.33,-0.8l-1.65,-1.66l1.58,-0.72l-0.4,0.98l0.71,0.53l0.48,-0.34l0.48,-1.49l0.98,0.8l0.73,-0.31l-0.53,-0.92l-0.81,-0.46l-0.73,-1.81l-0.41,-0.17l-2.16,1.02l-2.27,-0.06l-1.73,-1.01l-1.8,-1.85l0.52,-0.4l0.26,-0.96l-0.45,-1.04l-0.92,0.09l-0.12,0.64l-0.81,-0.05l-1.0,-1.05l-3.3,-2.31l-5.2,-1.56l-0.48,-1.29l0.16,-0.55l-1.83,-0.99l-0.64,-1.23l0.85,-0.63l0.26,-0.77l1.16,-0.21l0.15,-0.7l-0.98,-0.3l-2.56,1.0l-1.03,-0.01l-0.22,-0.7l-0.85,-0.75l1.1,-0.51l0.19,-0.4l-0.31,-0.45l-0.64,-0.02l-0.47,-0.8l0.14,-0.59l-0.49,-1.17l-0.45,-0.22l-0.62,0.19l-0.57,-0.49l0.25,-0.73l0.46,-0.09l1.22,0.53l0.42,-0.5l-0.16,-0.48l-1.49,-0.88l-1.82,0.34l-0.6,-0.61l-1.17,-0.28l-0.22,-0.32l0.32,-1.1l-0.72,-0.3l0.35,-0.97l-0.33,-0.29l-2.04,0.78l-0.28,-0.64l-1.38,-0.22l-0.75,0.57l0.31,0.89l-1.75,-0.34l-0.8,0.99l0.26,0.62l0.9,-0.03l-0.2,0.34l-1.52,0.34l-0.23,0.63l0.38,0.29l1.02,-0.16l0.49,0.83l-0.47,0.61l-0.59,-0.24l-0.7,0.58l0.05,0.63l-0.31,0.35l-0.27,-0.15l-0.68,0.39l-1.38,-1.05l0.03,-0.72l-1.08,-0.12l0.11,-0.8l-0.55,-0.46l-1.0,1.06l-1.09,-0.68l-0.44,0.5l-0.48,-0.1l-0.2,0.41l-0.8,-0.43l-0.29,0.55l-0.7,-0.52l-1.3,0.56l-0.16,-0.45l-0.91,-0.04l-0.56,0.81l-1.73,0.25l-1.02,-0.92l-0.6,0.32l-0.44,-0.36l-1.29,0.01l-0.44,-1.08l0.64,0.17l0.17,-0.48l0.68,0.04l0.89,0.91l0.56,-0.11l0.11,-0.54l0.9,0.16l1.67,-0.74l0.32,-0.52l-0.22,-0.4l-2.72,-0.16l-0.79,-1.25l1.54,-1.19l1.91,-0.52l0.81,-0.85l0.52,-0.09l0.76,-1.03l0.15,-1.27l1.37,0.34l3.53,-0.14l0.24,1.07l0.66,0.57l1.41,0.31l2.69,2.59l0.5,-0.37l-0.13,-0.93l-0.99,-0.67l-1.76,-2.54l1.94,-0.66l2.25,0.33l0.05,-0.75l-1.75,-0.86l-1.62,0.15l-0.71,0.63l-1.07,-0.92l-0.7,-0.18l0.17,-0.32l-0.28,-0.7l-1.24,0.32l-1.57,-0.23l-0.99,0.48l-1.49,-0.52l-1.37,0.05l-0.78,0.4l-0.2,0.55l-1.24,-0.08l-1.92,0.49l-0.59,0.81l-0.62,0.26l-0.75,-0.02l-0.97,-1.32l-1.1,-0.29l-0.3,0.28l0.16,0.51l0.44,0.07l0.66,2.11l-0.91,0.44l-2.4,-0.95l-0.46,0.21l0.03,0.68l0.78,0.42l-0.2,0.15l-0.56,0.01l-0.54,-1.57l-0.76,0.74l-0.24,-0.5l-0.88,0.16l-0.13,0.57l-0.85,-0.44l-0.36,0.28l0.3,0.67l-1.93,-0.49l-0.81,1.18l-0.83,0.28l-0.17,1.22l0.33,0.36l0.71,-0.05l1.13,0.82l0.76,1.64l-0.81,0.65l-1.11,0.16l-1.09,-0.54l-0.98,0.53l-0.75,-0.18l-0.37,0.73l-1.4,-0.13l-0.46,0.82l-0.5,-0.62l-0.4,0.44l-1.47,0.04l-1.12,-0.71l-1.09,0.61l-0.67,-0.22l-0.91,0.37l-0.64,-0.78l-0.94,0.73l-0.49,-0.21l-0.32,0.36l-0.62,-0.1l-0.41,-0.5l-0.83,0.37l-2.51,-0.14l-0.57,0.44l0.28,1.17l-0.59,0.14l-1.31,-0.59l-0.58,0.52l-0.3,-0.46l-2.04,0.38l-0.15,-0.68l-0.48,-0.37l-0.79,0.47l-0.83,0.0l-0.29,0.61l-0.03,-0.62l-0.42,-0.3l-1.95,-0.18l-0.77,0.39l-0.34,-0.37l-0.72,-0.1l-1.8,0.43l-0.28,0.75l-0.4,-0.03l-0.82,0.77l-2.9,-0.76l-0.87,-0.79l-0.66,0.16l-0.84,-0.82l-1.36,-0.26l-0.93,0.26ZM89.01,536.65l-0.02,0.01l-0.0,0.03l0.02,-0.04ZM89.06,536.61l0.02,-0.01l-0.01,0.01l-0.0,0.01ZM91.61,484.22l-0.0,0.01l-0.0,-0.01l0.01,0.0ZM87.17,484.0l-0.0,-0.0l0.01,-0.0l-0.0,0.01l-0.01,-0.0ZM186.66,475.29l-0.0,0.02l-0.01,-0.01l0.01,-0.0ZM156.69,531.75l-0.95,1.06l-0.87,0.02l-0.13,-0.28l0.69,-0.51l1.26,-0.28ZM151.45,532.97l-0.11,0.02l0.12,-0.04l-0.01,0.02ZM152.06,535.54l-0.09,-0.14l0.41,-0.11l-0.1,0.3l-0.22,-0.05ZM116.92,535.18l-0.13,0.11l-0.06,-0.02l0.04,-0.19l0.16,0.1ZM90.72,536.66l0.27,-0.19l0.07,0.3l-0.17,0.07l-0.17,-0.19ZM121.46,528.8l-0.0,-0.02l0.04,0.01l-0.03,0.01ZM186.96,558.95l-0.09,-1.09l0.4,-0.11l0.13,0.57l-0.44,0.62ZM196.09,568.76l2.06,0.17l0.88,-0.72l0.4,-0.93l0.62,0.05l0.66,-0.45l0.12,-0.56l3.59,0.11l1.22,2.1l-0.59,0.6l0.11,1.69l1.05,0.86l0.25,0.97l0.46,0.34l0.11,1.76l1.72,2.25l0.24,1.0l-1.26,-0.23l-0.94,0.69l-0.72,1.06l-0.71,-1.34l-1.02,-0.73l0.15,-0.58l-0.32,-1.25l0.48,-1.41l-0.8,-0.55l0.41,-2.32l-0.18,-1.24l0.62,-1.53l-0.66,-0.25l-0.62,0.87l-0.78,-0.09l0.03,0.58l-0.38,0.41l0.37,1.24l-0.41,0.99l0.15,1.56l-0.41,1.27l0.03,2.19l-0.37,0.45l-0.41,-0.46l0.02,-1.59l-0.29,-0.45l-0.66,0.28l-1.11,-0.29l0.47,-0.38l0.24,-0.99l-0.35,-1.47l1.14,0.14l0.45,-0.45l-0.11,-0.36l-0.86,-0.52l-0.27,0.12l-0.01,-1.01l-0.61,-0.4l-0.96,1.15l0.46,0.38l-0.33,0.4l-0.04,-0.54l-0.68,-0.29l0.29,-0.67l-0.28,-0.54l-0.39,-0.02l-0.2,-0.62l-0.47,-0.15l-0.26,0.42l-0.35,-0.7ZM209.19,578.54l0.61,1.19l-0.23,0.77l0.66,1.82l0.05,1.22l1.73,7.29l-0.66,0.56l0.03,0.64l1.0,0.69l-0.59,0.84l0.05,0.52l0.72,0.67l-0.2,1.56l0.37,0.44l1.07,0.31l1.71,2.17l1.4,0.95l0.39,0.88l0.67,0.5l0.09,0.91l1.53,1.02l-0.19,0.84l-1.17,1.01l-0.41,1.68l-0.0,2.19l-2.07,1.87l-1.09,0.57l-0.63,-0.13l-0.02,-1.13l-0.64,0.07l-0.3,1.04l-0.22,0.05l0.16,-1.54l1.09,0.23l2.31,-1.69l-0.23,-0.63l-0.64,0.13l-0.33,-0.61l-0.71,0.13l0.71,-2.09l0.22,-1.84l-0.43,-0.29l-0.4,-1.06l0.62,-0.2l0.58,-0.88l-0.43,-0.27l-1.78,0.52l-0.59,-0.36l-2.75,0.29l-0.13,0.71l0.35,0.37l-0.57,0.72l-0.64,-0.46l-0.2,1.01l-0.3,-0.39l0.1,-0.81l0.89,-0.27l0.51,-0.97l0.54,-0.2l0.43,-1.37l1.49,0.53l1.01,-0.36l-0.17,-0.59l-1.8,-0.6l0.03,-1.02l-0.82,-0.63l0.03,-0.53l-0.51,-0.72l0.35,-0.41l-0.16,-0.68l-0.59,-0.0l0.81,-0.68l0.22,-0.62l-0.41,-0.27l-0.79,0.23l-0.68,-1.21l0.4,-0.26l0.21,-1.19l-0.39,-0.3l-0.8,0.09l-0.48,-1.2l-0.52,-0.26l-0.49,0.27l-0.37,-0.39l0.13,-0.25l1.84,0.29l0.62,-0.37l-0.23,-0.67l-1.19,-0.13l0.23,-0.72l-0.6,-0.28l0.07,-0.27l0.81,-0.01l0.81,1.13l0.62,-0.14l0.04,-0.52l-1.77,-2.58l0.17,-0.56l1.59,1.01l0.37,-0.69l-0.4,-0.48l-1.89,-0.89l0.24,-0.34l-0.2,-0.47l0.54,-0.81l-0.81,-0.3l-0.88,0.87l-0.2,-0.58l0.08,-0.72l0.74,-0.62l0.17,-0.66l0.54,-0.5l0.92,-0.14ZM214.84,608.68l-0.72,0.37l-0.3,-0.26l-0.82,0.1l0.74,-0.58l1.09,0.36ZM207.55,585.56l-0.21,-0.06l0.0,-0.24l0.08,0.17l0.13,0.13ZM124.33,461.82l-0.72,-0.79l0.08,-0.62l0.61,0.33l0.02,1.08ZM96.68,478.86l-0.08,-0.01l0.0,-0.01l0.08,0.02ZM87.61,480.71l-0.14,-0.07l0.02,0.0l0.12,0.07ZM87.75,487.21l-0.01,0.0l-0.04,-0.04l0.05,0.04ZM210.21,605.25l0.95,-0.39l0.15,-0.88l1.01,-0.37l0.59,-1.12l0.76,0.04l0.47,2.53l-1.46,2.49l0.34,-0.93l-0.25,-0.46l0.16,-1.74l-0.39,-0.42l-0.42,0.19l-0.21,0.58l-0.85,0.26l-0.29,1.23l-0.57,-1.01ZM204.53,604.41l0.23,-0.52l-0.58,-0.47l0.16,-0.56l-0.41,-0.26l1.05,-0.38l0.21,-0.67l-2.13,-0.56l1.59,-0.9l0.16,-0.86l-0.36,-0.08l0.35,-1.05l0.21,0.49l1.38,0.95l0.65,1.87l-0.18,0.82l-0.68,0.31l-0.12,0.51l-0.79,0.23l-0.06,0.42l0.07,0.51l0.76,-0.09l-0.11,0.29l0.38,0.45l0.87,0.16l0.31,0.67l-0.54,-0.15l-0.4,0.8l0.23,0.39l0.85,0.22l-1.39,0.74l0.11,0.7l0.57,0.32l-0.22,0.31l0.26,0.63l-0.39,0.4l-0.4,-0.2l0.24,-0.39l-0.45,-1.27l0.19,-0.92l-0.49,-0.5l-0.25,-1.87l-0.67,0.18l-0.2,-0.66ZM204.7,605.12l-0.02,0.03l0.0,-0.0l0.02,-0.03ZM204.91,597.51l-0.15,-0.81l-1.16,-0.79l0.71,0.03l0.44,0.61l0.43,-0.21l0.17,0.98l-0.44,0.18ZM204.03,589.42l1.73,1.0l0.58,0.52l0.11,0.57l0.56,0.15l0.24,-0.39l0.54,0.65l-0.54,1.63l-0.36,-1.55l-0.5,-0.5l-0.56,0.05l-0.21,0.96l0.31,0.54l-0.25,0.39l0.51,0.85l-0.29,0.21l-0.99,-0.68l-0.46,0.33l-0.4,-0.11l0.95,-2.9l-0.98,-1.74ZM204.3,590.82l0.01,0.01l0.01,0.01l-0.01,-0.0l-0.01,-0.01ZM201.28,587.91l0.24,-0.68l0.52,-0.17l-0.03,-0.45l0.42,-0.22l0.35,0.32l0.6,-0.35l-0.0,-0.8l-0.62,-0.4l0.7,-0.07l0.24,-0.65l-1.03,-0.28l-0.02,-1.43l0.48,-2.46l0.45,-0.43l0.87,0.22l0.37,0.4l-0.69,2.23l0.41,0.23l0.08,1.49l0.51,0.53l-0.12,0.39l-0.62,-0.22l-0.31,0.8l-0.69,0.34l0.04,0.32l-0.11,0.42l-0.22,0.32l-1.81,0.61ZM204.42,586.23l0.02,0.16l-0.19,-0.27l0.07,0.06l0.09,0.05ZM203.16,578.77l0.02,-0.02l0.01,0.06l-0.01,0.0l-0.03,-0.05ZM202.08,593.81l-0.03,-0.32l0.05,-0.01l0.09,0.19l-0.11,0.14ZM202.25,593.0l-0.25,-0.54l0.16,-0.07l0.34,0.48l-0.24,0.13ZM201.87,592.45l-0.2,-0.02l-0.02,-0.03l0.04,-0.01l0.17,0.06ZM201.97,591.45l-0.19,-0.44l-0.52,-0.05l0.08,-0.24l1.42,-0.09l-0.01,0.81l-0.39,0.25l-0.38,-0.25ZM195.26,578.67l0.22,-0.17l0.78,1.25l0.56,-0.45l-0.67,-1.58l0.86,0.26l0.05,-1.05l0.36,0.52l1.18,-0.42l0.77,0.97l-0.44,0.2l-0.8,-0.21l-0.17,0.33l-0.79,0.06l0.06,0.48l1.78,2.24l-0.07,0.74l0.9,0.5l1.08,0.01l-0.34,1.59l-0.43,-0.2l-2.75,-3.68l-0.61,0.35l0.09,0.44l-0.28,0.18l0.52,0.86l-0.19,0.56l0.29,0.37l-0.52,0.14l-0.52,-1.4l0.33,-0.19l-0.16,-0.49l-1.1,-2.22ZM197.81,583.65l0.03,-0.01l-0.01,0.04l-0.02,-0.02l-0.0,-0.0ZM197.98,583.86l0.65,0.02l0.94,0.95l0.23,2.78l-0.4,2.69l-0.3,0.89l-0.47,0.37l-0.63,1.95l-0.37,-2.3l1.14,-0.59l-0.06,-0.73l-0.28,-0.06l0.01,-0.56l-0.47,-0.3l-0.19,-0.68l-0.71,-0.04l0.39,-0.63l0.81,-0.06l0.22,-0.32l-0.13,-0.54l-0.66,-0.34l0.68,-0.34l-0.35,-1.27l-0.73,-0.27l0.59,-0.15l0.09,-0.48ZM196.56,583.11l-0.06,-0.04l0.15,-0.08l-0.09,0.12ZM199.05,579.52l1.11,-0.49l0.92,0.47l0.59,0.75l-0.17,0.31l-0.56,-0.63l-0.63,-0.07l-0.13,0.57l0.35,0.67l-1.49,-1.58ZM121.86,538.8l-0.0,-0.01l0.02,0.02l-0.02,-0.01ZM122.16,539.2l0.38,0.41l0.59,-0.1l-0.04,-0.62l0.83,0.53l0.61,-1.11l0.62,0.04l-0.13,0.7l0.46,0.88l-0.67,0.48l-0.23,-0.84l-0.37,-0.03l-0.81,0.68l-0.2,-0.29l-0.67,0.31l-0.36,-1.02ZM125.68,539.91l0.02,-0.0l-0.01,0.0l-0.01,-0.0ZM126.24,540.18l-0.05,-0.09l0.07,0.07l-0.02,0.02ZM126.1,539.97l-0.36,-0.07l0.27,-0.16l0.09,0.23ZM111.97,541.9l0.13,-1.11l-0.41,-0.51l0.57,-0.47l0.58,-0.31l0.5,0.27l1.58,-0.22l0.55,0.47l-0.75,0.07l0.02,0.5l0.56,0.37l-0.31,0.99l0.56,1.75l0.45,0.16l0.28,-0.39l-0.23,-0.7l0.33,-1.09l0.38,0.2l0.37,-0.33l1.06,0.15l0.41,-0.28l0.62,0.17l0.21,0.41l0.91,-0.72l0.49,0.31l-0.22,0.73l0.26,0.4l0.49,-0.02l0.33,-0.47l1.39,0.19l-0.09,0.39l-0.85,0.24l-0.21,0.41l0.21,1.1l0.75,0.33l-0.77,0.3l-2.35,-2.03l-0.88,0.42l-0.02,0.69l-0.56,-0.49l-0.44,0.12l-0.27,0.58l-1.74,-0.5l-0.49,0.58l-0.32,-0.15l-0.13,-0.86l-0.79,-0.03l-1.07,-1.18l-1.1,-0.44ZM119.11,544.38l0.82,0.17l0.33,0.72l-0.52,-0.07l-0.2,-0.66l-0.42,-0.16ZM117.78,540.47l-0.76,-0.83l0.17,-0.28l0.83,0.02l-0.24,1.09ZM121.13,540.99l0.32,0.07l-0.59,0.51l0.31,-0.44l-0.03,-0.14ZM113.0,545.5l-0.71,0.24l-0.07,-0.11l0.36,-0.03l0.42,-0.1ZM111.68,543.33l0.69,-0.15l0.23,0.13l-0.51,0.43l-0.41,-0.41ZM76.93,452.59l0.44,-0.56l0.74,-0.21l0.04,0.98l0.81,0.62l0.81,1.25l1.59,0.48l1.11,0.77l0.29,0.97l-0.62,0.7l1.28,1.78l-0.03,0.76l0.83,0.73l0.06,0.6l-0.76,-0.35l-1.49,0.03l-0.08,-1.15l-0.71,-1.29l0.16,-0.62l-1.2,-2.9l-0.96,-0.77l-1.79,-0.42l-0.51,-1.4ZM84.52,461.74l0.69,0.18l0.56,0.73l-0.43,0.12l-0.82,-1.03ZM75.58,485.5l0.07,-0.44l1.7,1.61l0.78,-0.27l0.53,0.4l0.88,-0.0l-0.06,0.37l0.83,0.24l0.29,0.89l1.02,0.89l-0.67,0.62l-0.55,1.49l-2.66,-1.39l-0.92,-0.99l-0.64,-2.06l-0.55,-0.58l-0.06,-0.77ZM55.82,528.18l0.22,-0.57l1.29,0.26l2.05,-0.81l0.73,0.9l0.76,-0.1l1.99,0.58l0.55,0.5l0.05,0.8l-0.49,1.14l-1.03,0.31l-2.5,-1.87l-2.52,0.16l-1.15,-0.81l0.05,-0.5ZM37.73,525.86l0.44,0.13l0.4,0.44l-0.66,-0.33l-0.17,-0.24ZM43.99,527.71l-0.32,-0.33l-0.55,0.04l0.82,-0.2l0.41,-0.61l-1.11,-1.43l0.35,-0.53l1.55,0.81l-0.4,0.52l0.03,0.83l-0.39,0.13l-0.39,0.76ZM42.84,527.18l-0.0,-0.0l0.0,0.0l0.0,0.0ZM43.98,526.54l0.02,-0.01l0.01,0.01l-0.02,0.0l-0.0,-0.0ZM42.63,527.12l-0.35,0.44l-0.22,-0.21l0.3,-0.36l-0.18,-0.32l0.39,-0.07l0.05,0.51ZM42.72,526.39l-0.0,-0.06l0.01,0.01l-0.01,0.05ZM31.87,524.21l0.91,-0.8l0.8,0.02l0.72,0.69l-1.15,0.35l-1.28,-0.25ZM35.31,524.02l0.44,-0.89l0.8,-0.04l0.97,0.45l0.25,0.65l-0.43,0.37l-2.04,-0.54ZM4.9,508.63l0.28,0.1l-0.04,0.24l-0.12,0.03l-0.12,-0.37ZM6.12,508.53l-0.05,-0.66l0.53,0.07l0.12,0.71l-0.59,-0.13Z", "name": "Alaska"}, "US-NJ": {"path": "M801.65,165.2l1.31,-1.55l0.48,-1.57l0.5,-0.62l0.54,-1.45l0.11,-2.05l0.67,-1.35l0.92,-0.71l14.12,4.16l-0.4,6.03l-0.35,0.55l-0.23,-0.44l-0.7,0.11l-0.26,1.18l-0.76,0.97l0.12,1.42l-0.46,0.6l0.08,1.71l0.58,0.62l1.2,0.29l1.38,-0.43l2.3,0.24l0.9,6.92l-0.56,0.39l0.18,0.66l-0.61,0.95l0.46,0.58l-0.21,0.6l0.53,1.94l-0.47,2.0l0.11,0.61l0.62,0.64l-0.39,1.13l-0.49,0.45l-0.01,0.59l-0.93,1.13l0.02,0.52l-1.07,0.1l0.09,1.21l0.64,0.83l-0.82,0.56l-0.18,1.15l1.05,0.77l-0.31,0.29l-0.17,-0.44l-0.53,-0.18l-0.5,0.22l-0.44,1.51l-1.28,0.61l-0.2,0.45l0.46,0.55l0.8,0.06l-0.66,1.26l-0.26,1.5l-0.68,0.65l0.19,0.48l0.4,0.04l-0.89,1.57l0.07,0.95l-1.65,1.72l-0.12,-1.34l0.36,-2.44l-0.11,-0.87l-0.58,-0.82l-0.89,-0.28l-1.11,0.34l-0.81,-0.35l-1.51,0.88l-0.31,-0.7l-1.62,-0.96l-1.0,0.04l-0.65,-0.71l-0.7,0.07l-3.24,-2.03l-0.06,-1.73l-1.02,-0.94l0.48,-0.68l0.0,-0.87l0.43,-0.83l-0.12,-0.73l0.51,-1.18l1.2,-1.16l2.6,-1.49l0.54,-0.86l-0.38,-0.85l0.5,-0.37l0.47,-1.44l1.24,-1.7l2.52,-2.22l0.18,-0.67l-0.47,-0.82l-4.26,-2.78l-0.75,-1.05l-0.9,0.24l-0.48,-0.33l-1.24,-2.46l-1.62,-0.02l-1.0,-3.44l1.02,-1.03l0.36,-2.23l-1.87,-1.91Z", "name": "New Jersey"}, "US-CO": {"path": "M364.23,239.52l-1.22,65.86l-29.29,-0.9l-29.38,-1.43l-29.35,-1.95l-32.17,-2.75l8.32,-87.13l27.79,2.39l28.22,1.92l29.58,1.46l27.95,0.87l-0.46,21.65Z", "name": "Colorado"}, "US-MD": {"path": "M740.67,219.62l-2.04,-10.06l19.85,-4.49l-0.66,1.29l-0.94,0.08l-1.54,0.81l0.16,0.7l-0.42,0.49l0.23,0.78l-1.76,0.5l-1.48,0.03l-1.14,-0.39l0.21,-0.36l-0.3,-0.49l-1.11,-0.31l-0.47,1.8l-1.63,2.84l-1.37,-0.39l-1.03,0.62l-0.41,1.26l-1.6,1.93l-0.36,1.04l-0.88,0.45l-1.3,1.87ZM760.74,204.54l36.93,-9.13l8.48,26.19l0.45,0.26l1.06,-0.21l8.18,-2.08l-0.9,0.53l0.31,0.64l0.52,0.01l0.37,0.76l0.52,-0.05l-0.38,1.96l-0.12,-0.26l-0.47,0.07l-0.73,0.86l-0.17,2.7l-0.6,0.19l-0.36,0.71l-0.02,1.66l-3.62,1.37l-0.45,0.7l-2.2,0.43l-0.56,0.65l-0.3,-1.09l0.5,-0.31l0.86,-1.84l-0.4,-0.51l-0.45,0.12l0.08,-0.5l-0.44,-0.42l-2.29,0.63l0.3,-0.6l1.15,-0.83l-0.17,-0.69l-1.36,-0.18l0.38,-2.24l-0.18,-1.02l-0.91,0.16l-0.53,1.76l-0.34,-0.68l-0.62,-0.07l-0.44,0.47l-0.5,1.39l0.53,1.02l-2.87,-2.14l-0.43,-0.19l-0.61,0.36l-0.73,-0.76l0.33,-1.67l0.76,-0.6l-0.08,-1.35l2.55,0.23l0.78,-1.5l-0.32,-1.42l-0.72,0.27l-0.28,1.29l-0.98,-0.25l-0.38,-1.07l-0.52,-0.28l-0.55,0.23l-0.22,-0.68l-0.63,0.08l1.0,-0.82l0.22,-1.04l-0.54,-0.55l-0.75,0.83l-0.21,-0.61l1.06,-0.92l-0.25,-0.65l-0.54,-0.08l-0.51,-0.75l-0.42,0.22l-0.53,-0.37l0.83,-1.03l-0.24,-1.02l0.84,-1.95l-0.07,-0.86l-0.46,0.02l-0.66,0.66l-0.56,-0.16l-0.48,0.45l-0.19,0.97l-0.95,-1.2l0.75,-3.46l0.59,-0.51l0.07,-0.74l3.89,-0.78l0.49,-0.41l-0.23,-0.67l-0.45,-0.07l-2.38,0.56l0.88,-1.55l1.42,-0.05l0.35,-0.5l-0.99,-0.67l0.44,-1.9l-0.63,-0.32l-0.48,0.39l-0.87,1.96l0.21,-2.02l-0.59,-0.34l-0.88,1.43l-1.42,0.34l-0.31,1.65l0.39,0.53l0.65,0.12l-1.45,1.92l-0.2,-1.64l-0.64,-0.42l-0.61,0.73l0.07,1.45l-0.85,-0.29l-1.16,0.64l0.02,0.71l1.01,0.27l-0.37,0.54l-0.83,0.22l-0.05,0.34l-0.44,-0.04l-0.35,0.64l1.2,1.22l-0.29,0.17l-1.52,-0.76l-1.33,0.48l0.16,0.69l0.82,0.1l1.26,1.21l1.49,0.58l0.1,0.28l-0.44,0.33l-1.37,0.5l-0.12,1.19l1.83,1.04l0.47,0.63l-0.66,-0.43l-1.05,0.29l0.2,0.64l0.92,0.48l-0.34,0.47l0.4,1.15l0.6,0.09l-0.63,1.26l0.13,0.43l0.63,0.65l1.28,4.18l2.83,2.58l-0.01,0.35l-0.38,0.54l-0.67,-1.23l-1.21,-0.22l-1.69,-0.87l-1.51,-3.64l-0.74,-0.68l-0.28,0.69l1.17,3.94l0.65,0.92l1.45,0.81l1.3,0.31l1.49,1.39l0.89,-0.33l0.37,1.32l1.47,1.47l0.1,1.07l-1.08,-0.68l-0.33,-1.23l-0.63,-0.45l-0.45,0.04l-0.13,0.44l0.27,0.78l-0.74,0.13l-0.62,-0.73l-1.16,-0.38l-1.53,0.0l-0.92,0.43l-0.55,-0.2l-1.0,-2.19l-1.26,-0.71l-0.46,0.14l0.01,0.48l1.19,2.0l-0.67,-0.12l-0.28,-0.5l-0.89,-0.4l-1.61,-2.6l-0.48,-0.14l-0.43,1.47l-0.25,-0.74l-0.62,-0.04l-0.4,0.46l0.33,0.72l-0.18,0.69l-0.64,0.59l-0.57,-0.26l-0.63,-1.86l0.25,-1.14l0.71,-0.37l0.2,-0.51l-0.37,-0.52l0.83,-0.52l0.21,-1.61l1.06,-0.35l0.07,-0.66l-0.33,-0.42l0.23,-0.42l-0.38,-0.38l-0.04,-0.7l1.27,-2.2l-0.14,-0.54l-2.72,-1.68l-0.56,0.14l-0.69,1.19l-1.81,-0.37l-1.09,-1.19l-2.96,-0.09l-1.25,-0.91l0.61,-1.35l-0.4,-0.97l-1.19,-0.3l-0.89,-0.66l-2.69,0.07l-0.36,-0.23l-0.11,-1.26l-1.04,-0.6l0.09,-1.2l-0.51,-0.29l-0.49,0.19l-0.23,-0.64l-0.52,-0.13l0.26,-0.83l-0.45,-0.58l-0.69,-0.12l-1.81,0.67l-2.24,-1.27ZM790.07,212.25l0.29,-0.0l0.93,0.21l-0.44,0.4l-0.78,-0.61ZM796.79,218.15l0.0,0.16l-0.13,-0.11l0.13,-0.06ZM803.02,225.62l-0.02,0.33l-0.21,-0.15l0.23,-0.19ZM806.99,229.08l-0.16,0.3l-0.12,0.07l0.02,-0.25l0.26,-0.12ZM797.54,220.57l-0.06,0.01l-0.09,0.03l0.12,-0.06l0.03,0.02ZM797.21,220.69l-0.26,0.57l-0.18,0.12l0.15,-0.61l0.29,-0.07ZM796.09,217.04l-0.61,0.32l-0.58,-0.42l0.02,-0.53l0.16,-0.23l0.68,0.3l0.32,0.56ZM794.46,213.09l-0.25,0.5l-0.8,0.39l0.15,-1.17l0.9,0.27Z", "name": "Maryland"}, "US-MA": {"path": "M820.4,120.02l30.04,-8.0l1.53,-1.8l0.34,-1.48l0.95,-0.35l0.61,-1.04l1.17,-1.05l1.35,-0.1l-0.44,1.05l1.03,0.32l0.21,1.55l1.17,0.55l-0.06,0.32l0.39,0.28l1.31,0.19l-0.17,0.56l-2.29,1.79l-0.05,1.07l0.45,0.16l-1.11,1.41l0.23,1.08l-1.01,0.96l0.58,1.41l1.4,0.45l0.5,0.63l1.36,-0.57l0.33,-0.59l1.2,0.09l0.79,0.47l0.23,0.68l1.79,1.37l-0.07,1.25l-0.56,0.55l0.12,0.6l1.23,0.66l1.73,-0.23l0.68,1.2l0.21,1.14l0.89,0.68l1.33,0.41l1.48,-0.12l0.43,0.38l1.05,-0.23l2.92,-2.34l0.82,-1.11l0.54,0.02l0.56,1.86l-3.32,1.52l-0.94,0.82l-2.75,0.98l-0.49,1.64l-1.93,1.37l-0.82,-2.64l0.11,-1.34l-0.55,-0.31l-0.5,0.39l-0.93,-0.1l-0.3,0.51l0.25,0.92l-0.26,0.79l-0.4,0.06l-0.63,1.1l-0.6,-0.2l-0.5,0.48l0.22,1.86l-0.9,0.87l-0.63,-0.8l-0.47,0.01l-0.11,0.55l-0.26,0.03l-0.71,-2.03l-1.02,-0.35l0.44,-2.5l-0.21,-0.4l-0.78,0.4l-0.29,1.47l-0.69,0.2l-1.4,-0.64l-0.78,-2.12l-0.8,-0.22l-0.78,-2.15l-0.49,-0.24l-6.13,2.0l-0.3,-0.15l-14.84,4.19l-0.28,0.5l-0.46,-0.28l-0.86,0.17l-9.54,2.36l-0.25,-0.18l-0.32,-14.66ZM860.63,110.12l-0.02,-0.37l-0.14,-0.48l0.51,0.23l-0.35,0.62ZM876.24,122.86l-0.12,-0.42l0.25,0.35l-0.13,0.06ZM875.23,121.15l-0.78,0.0l-0.55,-1.2l0.56,0.44l0.77,0.76ZM871.43,119.57l-0.08,0.14l-0.09,-0.07l0.0,-0.0l0.17,-0.07Z", "name": "Massachusetts"}, "US-AL": {"path": "M608.67,337.4l25.17,-2.91l19.4,-2.75l14.04,43.29l1.01,2.45l1.17,1.59l0.59,1.87l2.24,2.5l0.92,1.8l-0.11,2.13l1.8,1.13l-0.17,0.74l-0.63,0.1l-0.16,0.7l-0.98,0.84l-0.22,2.29l0.25,1.48l-0.76,2.3l-0.14,1.84l1.1,2.94l1.21,1.52l0.53,1.6l-0.08,5.02l-0.25,0.81l0.48,2.03l1.35,1.16l1.14,2.07l-47.64,6.92l-0.42,0.61l-0.08,2.99l2.64,2.75l2.0,0.96l-0.34,2.7l0.56,1.61l0.43,0.39l-0.94,1.69l-1.24,1.0l-1.13,-0.75l-0.34,0.49l0.66,1.46l-2.81,1.05l0.29,-0.63l-0.45,-0.86l-0.99,-0.76l-0.1,-1.11l-0.57,-0.22l-0.52,0.61l-0.32,-0.1l-0.89,-1.53l0.41,-1.67l-0.97,-2.21l-1.32,-0.65l-0.3,-0.89l-0.56,-0.17l-0.37,0.61l0.15,0.35l-0.77,3.1l-0.01,5.08l-0.59,0.0l-0.24,-0.71l-2.22,-0.44l-1.64,0.31l-5.46,-31.98l-0.99,-66.48l-0.02,-0.37l-1.07,-0.63l-0.69,-1.02Z", "name": "Alabama"}, "US-MO": {"path": "M468.72,225.49l24.71,-0.73l18.94,-1.42l22.1,-2.58l0.42,0.35l0.39,0.91l2.43,1.65l0.29,0.74l1.21,0.87l-0.51,1.36l-0.1,3.21l0.78,3.65l0.95,1.44l0.03,1.59l1.11,1.37l0.46,1.55l4.96,4.1l1.06,1.69l4.93,3.31l0.7,1.15l0.27,1.62l0.5,0.82l-0.18,0.69l0.47,1.8l0.97,1.63l0.77,0.73l1.04,0.16l0.83,-0.56l0.84,-1.4l0.57,-0.19l2.41,0.61l1.68,0.76l0.84,0.77l-0.97,1.95l0.26,2.28l-2.37,6.86l0.01,1.02l0.7,1.92l4.67,4.05l1.99,1.05l1.46,0.09l1.66,1.3l1.92,0.8l1.5,2.11l2.04,0.83l0.42,2.96l1.72,2.9l-1.1,1.94l0.18,1.38l0.75,0.33l2.31,4.25l1.94,0.92l0.55,-0.32l0.0,-0.65l0.87,1.1l1.07,-0.08l0.14,1.85l-0.37,1.07l0.53,1.59l-1.07,3.86l-0.51,0.07l-1.37,-1.13l-0.65,0.13l-0.78,3.34l-0.52,0.74l0.13,-1.06l-0.56,-1.09l-0.97,-0.2l-0.74,0.63l0.02,1.05l0.53,0.66l-0.04,0.7l0.58,1.34l-0.2,0.4l-1.2,0.39l-0.17,0.41l0.15,0.55l0.86,0.84l-1.71,0.37l-0.14,0.62l1.53,1.97l-0.89,0.75l-0.63,2.13l-10.61,1.42l1.06,-2.28l0.87,-0.61l0.18,-0.87l1.43,-0.96l0.25,-0.96l0.63,-0.37l0.29,-0.59l-0.22,-2.28l-1.05,-0.75l-0.2,-0.77l-1.09,-1.18l-39.24,3.6l-37.71,2.58l-3.21,-58.18l-1.03,-0.63l-1.2,-0.02l-1.52,-0.73l-0.19,-0.93l-1.11,-1.3l-0.36,-1.55l-0.55,-0.09l-0.3,-0.56l-1.13,-0.66l-1.4,-1.84l0.73,-0.51l0.09,-1.24l1.12,-1.27l0.09,-0.79l1.01,0.16l0.56,-0.43l-0.2,-2.24l-1.02,-0.74l-0.32,-1.1l-1.17,-0.01l-1.31,0.96l-0.81,-0.7l-0.73,-0.17l-2.67,-2.35l-1.05,-0.28l0.13,-1.6l-1.32,-1.72l0.1,-1.01l-0.37,-0.36l-1.01,-0.18l-0.59,-0.85l-0.84,-0.26l0.07,-0.52l-1.24,-2.88l-0.0,-0.74l-0.4,-0.49l-0.85,-0.29l-0.05,-0.54ZM583.78,294.53l-0.1,-0.1l-0.08,-0.15l0.11,-0.01l0.07,0.26Z", "name": "Missouri"}, "US-MN": {"path": "M443.67,67.68l-0.4,-1.37l0.05,-1.19l-0.48,-0.53l-1.36,-3.77l0.0,-3.22l-0.47,-1.97l0.27,-1.12l-0.57,-2.32l0.73,-2.56l-2.06,-6.89l29.55,-1.22l0.47,-0.81l-0.38,-7.12l2.84,0.15l1.24,0.82l0.38,2.69l1.73,5.31l0.13,2.3l0.52,0.86l1.46,1.05l1.3,0.49l3.23,-0.36l0.39,0.85l0.54,0.38l5.25,0.04l0.38,0.24l0.54,1.58l0.72,0.61l4.27,-0.78l0.77,-0.65l0.07,-0.69l0.69,-0.35l1.74,-0.44l3.97,-0.02l1.42,0.7l3.38,0.66l-1.01,0.79l0.0,0.82l0.51,0.45l2.91,-0.06l0.52,2.08l1.58,2.29l0.71,0.05l1.03,-0.78l-0.04,-1.73l2.67,-0.46l1.43,2.16l2.01,0.79l1.54,0.18l0.54,0.57l-0.03,0.83l0.58,0.35l1.32,0.06l0.19,0.75l0.41,0.1l1.2,-0.22l1.12,0.22l2.21,-0.85l2.78,-2.55l2.49,-1.54l1.24,2.52l0.96,0.51l2.23,-0.66l0.87,0.36l5.98,-1.3l0.56,0.18l1.32,1.64l1.24,0.59l0.62,-0.01l1.61,-0.83l1.3,0.1l-0.89,1.0l-4.69,3.07l-6.35,2.82l-3.68,2.47l-2.15,2.49l-0.96,0.57l-6.62,8.67l-0.95,0.61l-1.07,1.56l-1.96,1.97l-4.18,3.55l-0.86,1.78l-0.55,0.44l-0.14,0.96l-0.78,-0.01l-0.46,0.51l0.98,12.22l-0.79,1.2l-1.04,0.08l-0.52,0.82l-0.83,0.15l-0.61,0.83l-2.06,1.19l-0.94,1.86l0.06,0.72l-1.69,2.39l-0.01,2.06l0.38,0.91l2.15,0.39l1.42,2.49l-0.52,1.92l-0.71,1.25l-0.05,2.12l0.45,1.32l-0.71,1.23l0.91,3.14l-0.51,4.08l3.95,3.03l3.02,0.4l1.89,2.25l2.87,0.5l2.45,1.93l2.39,3.59l2.63,1.8l2.09,0.09l1.07,0.71l0.88,0.1l0.82,1.36l1.26,0.84l0.28,2.03l0.68,1.3l0.39,4.82l-40.62,3.2l-40.63,2.09l-1.46,-38.98l-1.52,-2.05l-2.57,-0.79l-0.94,-1.91l-1.46,-1.79l0.21,-0.68l2.82,-2.34l0.93,-2.03l0.43,-2.53l-0.35,-1.58l0.23,-1.86l-0.18,-1.51l-0.5,-1.03l-0.18,-2.33l-1.81,-2.59l-0.47,-1.13l-0.21,-2.16l-0.66,-0.98l0.15,-1.66l-0.35,-1.52l0.53,-2.69l-1.08,-1.85l-0.49,-8.32l-0.42,-0.79l0.06,-3.92l-1.58,-3.95l-0.53,-0.65Z", "name": "Minnesota"}, "US-CA": {"path": "M3.07,175.36l0.87,-1.1l0.96,0.24l1.21,-2.15l0.92,0.12l0.64,-0.23l0.41,-0.57l-0.27,-0.82l-0.71,-0.36l1.52,-2.68l0.12,-0.78l-0.43,-0.48l0.1,-1.34l0.85,-0.88l1.17,-2.25l1.26,-3.01l0.39,-2.1l-0.28,-1.0l0.05,-3.89l-1.25,-1.24l0.92,-1.24l0.94,-2.81l32.73,8.13l32.57,7.34l-13.67,64.67l25.44,34.66l36.59,51.09l13.3,17.72l-0.19,2.73l0.73,0.94l0.21,1.71l0.85,0.63l0.81,2.56l-0.07,0.91l0.63,1.46l-0.16,1.36l3.8,3.82l0.01,0.5l-1.95,1.53l-3.11,1.26l-1.2,1.99l-1.72,1.14l-0.33,0.81l0.38,1.03l-0.51,0.51l-0.1,0.9l0.08,2.29l-0.6,0.72l-0.64,2.44l-2.02,2.47l-1.6,0.14l-0.42,0.51l0.33,0.89l-0.59,1.34l0.54,1.11l-0.01,1.19l-0.78,2.68l0.57,1.02l2.74,1.13l0.34,0.83l-0.19,2.4l-1.18,0.78l-0.42,1.37l-2.27,-0.62l-1.26,0.61l-43.36,-3.35l0.04,-0.76l0.39,-0.07l0.3,-0.56l-0.12,-1.38l-1.1,-1.65l-1.08,0.02l0.16,-1.13l-0.24,-1.11l0.35,-0.13l0.36,-0.93l0.05,-2.47l-0.39,-2.64l-2.46,-5.66l-3.47,-4.07l-1.29,-1.98l-2.42,-2.12l-2.07,-2.86l-2.01,-1.04l-1.23,0.18l-0.29,0.88l-1.56,-0.95l-0.11,-0.38l0.63,-0.52l0.22,-0.95l-0.46,-2.65l-1.0,-1.95l-0.7,-0.58l-2.17,-0.43l-1.45,-0.13l-1.11,0.3l-0.49,-0.59l-1.66,-0.65l-3.05,-1.95l-1.24,-1.35l-0.54,-2.64l-0.89,-0.66l-1.77,-2.24l-1.66,-1.3l-1.92,-0.51l-1.09,0.24l-1.1,-0.72l-1.51,-0.14l-2.0,-1.52l-2.34,-0.84l-5.72,-0.67l-0.4,-1.69l-1.01,-0.93l-0.92,-0.35l1.28,-2.62l-0.33,-1.38l0.84,-2.21l-0.65,-1.27l1.18,-2.39l0.32,-2.41l-0.99,-1.24l-1.32,-0.26l-1.34,-1.39l-0.08,-0.75l1.44,-1.4l-0.5,-2.3l-0.34,-0.54l-1.68,-0.76l-1.88,-4.27l-1.79,-1.16l-0.32,-2.63l-1.62,-2.61l-0.22,-2.75l-1.01,-0.76l-1.13,-3.38l-2.16,-2.3l-0.75,-1.6l0.04,-3.93l0.55,-1.46l-0.54,-0.6l0.52,-0.53l0.56,0.71l0.58,-0.1l0.8,-0.59l0.9,-1.64l0.83,0.01l0.08,-0.52l-0.51,-0.5l0.4,-0.88l-0.05,-0.93l-0.49,-2.22l-0.61,-1.2l-0.6,-0.44l-0.92,0.25l-2.02,-0.43l-1.45,-1.81l-0.86,-2.15l-0.53,-0.38l-0.32,-1.18l-0.46,-0.5l0.04,-1.12l0.85,-2.26l-0.21,-2.94l-0.89,-1.29l1.1,-2.74l0.21,-2.34l1.33,-0.2l0.23,1.52l-0.62,0.31l-0.1,2.71l1.73,1.17l0.7,1.42l1.0,0.72l0.4,1.01l0.89,0.41l0.85,-0.4l-0.19,-1.18l-0.68,-0.51l-0.37,-1.53l0.13,-1.99l-0.54,-1.26l-0.37,-0.02l-0.11,-0.14l0.62,-0.35l-0.0,-0.34l-1.62,-1.2l0.69,-0.67l-0.17,-1.88l-0.94,-0.36l-0.3,-0.61l1.07,-0.66l0.99,-0.01l0.96,-0.71l1.25,1.03l2.63,-0.1l5.01,2.23l0.53,-0.22l0.04,-0.59l0.61,-0.67l-0.3,0.75l0.39,0.76l0.81,-0.06l0.35,-0.49l1.35,1.6l0.7,-0.16l0.02,-0.38l-0.53,-1.14l-0.97,-0.74l-0.27,-0.8l-0.66,-0.38l-1.09,-0.07l0.27,-0.58l-0.25,-0.54l-2.48,1.29l-0.7,-0.34l-0.75,0.18l-0.18,-0.55l-1.09,-0.25l0.28,-0.66l-0.36,-0.69l-1.09,-0.17l-1.86,1.57l-0.34,-0.46l-1.36,-0.54l-0.36,-0.88l-1.36,-1.35l-2.59,0.52l0.1,0.92l-0.7,1.21l0.53,0.72l-0.88,0.92l-0.07,2.28l-0.37,-0.09l-1.52,-2.07l-1.18,-0.34l-1.16,-2.44l-1.41,-1.2l0.09,-0.69l-0.68,-0.18l0.73,-1.18l0.93,2.05l0.44,0.25l0.33,-0.38l-1.77,-5.65l-0.41,-0.59l-0.57,-0.2l0.2,-0.84l-0.53,-2.28l-2.72,-3.32l-1.0,-2.99l-3.45,-6.17l-0.03,-0.38l1.14,-1.43l0.12,-0.85l-0.51,-6.75l0.61,-1.87l1.33,-2.02l0.4,-3.04l-0.36,-1.21l0.19,-2.39l-0.7,-1.04l-1.24,-3.68l-0.57,-0.53l0.1,-0.93l-0.32,-0.88l-1.04,-0.88l-2.01,-3.32l0.52,-1.23l-0.26,-2.71l2.38,-3.44ZM33.36,240.61l0.01,-0.01l0.01,0.01l-0.02,-0.01ZM45.67,326.22l-0.02,0.03l0.02,-0.03l0.01,0.01ZM31.63,240.38l-0.09,0.14l-0.63,0.23l-0.2,-0.07l0.92,-0.3Z", "name": "California"}, "US-IA": {"path": "M452.94,162.22l42.82,-2.19l40.55,-3.19l0.96,2.52l2.0,1.0l0.08,0.59l-0.9,1.8l-0.16,1.04l0.9,5.09l0.92,1.26l0.39,1.75l1.46,1.72l4.94,0.85l1.27,2.03l-0.3,1.03l0.29,0.66l3.61,2.37l0.85,2.41l3.84,2.31l0.62,1.68l-0.31,4.21l-1.64,1.98l-0.5,1.94l0.13,1.28l-1.26,1.36l-2.51,0.97l-0.89,1.18l-0.55,0.25l-4.56,0.83l-0.89,0.73l-0.61,1.71l-0.15,2.55l0.4,1.08l2.01,1.47l0.54,2.65l-1.87,3.25l-0.22,2.24l-0.52,1.42l-2.88,1.39l-1.02,1.02l-0.2,0.99l0.72,0.87l0.2,2.15l-0.58,0.23l-1.34,-0.82l-0.31,-0.76l-1.29,-0.82l-0.29,-0.51l-0.88,-0.36l-0.3,-0.82l-0.95,-0.68l-22.3,2.61l-15.12,1.17l-7.59,0.51l-20.78,0.47l-0.22,-1.06l-1.3,-0.73l-0.33,-0.67l0.58,-1.16l-0.21,-0.95l0.22,-1.39l-0.36,-2.19l-0.6,-0.73l0.07,-3.65l-1.05,-0.5l0.05,-0.91l0.71,-1.02l-0.05,-0.44l-1.31,-0.56l0.33,-2.54l-0.41,-0.45l-0.89,-0.16l0.23,-0.8l-0.3,-0.58l-0.51,-0.25l-0.74,0.23l-0.42,-2.81l0.5,-2.36l-0.2,-0.67l-1.36,-1.71l-0.08,-1.92l-1.78,-1.54l-0.36,-1.74l-1.09,-0.94l0.03,-2.18l-1.1,-1.87l0.21,-1.7l-0.27,-1.08l-1.38,-0.67l-0.87,-2.17l0.05,-0.63l-1.81,-1.82l0.56,-1.61l0.54,-0.47l0.73,-2.68l0.0,-1.68l0.55,-0.69l0.21,-1.19l-0.51,-2.24l-1.33,-0.29l-0.05,-0.73l0.45,-0.56l-0.0,-1.71l-0.95,-1.42l-0.05,-0.87Z", "name": "Iowa"}, "US-MI": {"path": "M612.25,185.8l1.83,-2.17l0.7,-1.59l1.18,-4.4l1.43,-3.05l1.01,-5.05l0.09,-5.37l-0.86,-5.54l-2.4,-5.17l0.6,-0.5l0.3,-0.79l-0.57,-0.42l-1.08,0.55l-3.82,-7.03l-0.21,-1.1l1.13,-2.68l-0.01,-0.97l-0.74,-3.13l-1.29,-1.65l-0.05,-0.62l1.73,-2.73l1.22,-4.14l-0.21,-5.35l-0.77,-1.59l1.09,-1.15l0.81,-0.02l0.56,-0.47l-0.27,-3.49l1.08,-0.11l0.67,-1.43l1.18,0.47l0.66,-0.33l0.76,-2.59l0.82,-1.2l0.56,-1.68l0.55,-0.18l-0.58,0.87l0.6,1.65l-0.71,1.8l0.71,0.42l-0.48,2.61l0.88,1.43l0.73,-0.05l0.52,0.56l0.64,-0.24l0.89,-2.26l0.67,-3.51l-0.08,-2.07l-0.76,-3.42l0.58,-1.02l2.13,-1.64l2.74,-0.55l0.98,-0.63l0.28,-0.64l-0.25,-0.54l-1.76,-0.11l-0.96,-0.86l-0.52,-1.98l1.85,-2.98l-0.1,-0.73l1.72,-0.23l0.74,-0.94l4.16,2.0l0.83,0.12l1.98,-0.4l1.37,0.4l1.19,1.04l0.53,1.15l0.77,0.49l2.41,-0.29l1.7,1.01l1.92,0.09l0.8,0.64l3.27,0.45l1.1,0.77l-0.01,1.12l1.04,1.31l0.64,0.21l0.37,0.91l-0.14,0.55l-0.67,-0.25l-0.94,0.57l-0.23,1.83l0.81,1.29l1.6,0.98l0.69,1.37l0.65,2.26l-0.12,1.73l0.77,5.57l-0.14,0.59l-0.58,0.21l-0.48,0.96l-0.74,0.07l-0.8,0.81l-0.17,4.47l-1.12,0.49l-0.18,0.82l-1.86,0.43l-0.72,0.6l-0.58,2.61l0.26,0.45l-0.21,0.52l0.25,2.57l1.38,1.31l2.89,0.84l0.91,-0.08l1.08,-1.23l0.6,-1.44l0.62,0.19l0.39,-0.24l1.01,-3.59l0.6,-1.06l-0.08,-0.51l0.97,-1.45l1.39,-0.39l1.07,-0.69l0.83,-1.1l0.87,-0.44l2.06,0.59l1.13,0.7l1.0,1.09l1.21,2.16l2.01,5.91l0.82,1.6l1.03,3.71l1.49,3.63l1.29,1.74l-0.34,3.92l0.45,2.48l-0.48,2.79l-0.36,0.45l-0.57,-1.21l0.03,-0.85l-1.46,-0.52l-0.47,0.08l-1.48,1.36l-0.06,0.83l0.55,0.67l-0.82,0.57l-0.29,0.79l0.28,2.94l-0.48,0.75l-1.62,0.92l-1.06,1.85l-0.43,3.73l0.27,1.56l-0.33,0.93l-0.42,0.19l0.02,0.91l-0.64,0.3l-0.89,1.6l-0.5,1.29l-0.02,1.05l-0.52,0.91l-20.5,4.22l-0.15,-0.92l-0.45,-0.33l-31.44,4.71ZM621.47,115.84l0.0,-0.07l0.11,-0.12l-0.01,0.03l-0.11,0.16ZM621.73,114.93l-0.07,-0.16l0.07,-0.14l-0.0,0.3ZM543.5,88.02l4.87,-2.38l3.55,-3.62l5.77,-1.36l1.39,-0.84l2.36,-2.71l0.98,0.04l1.52,-0.73l1.0,-2.24l2.82,-2.85l0.23,1.72l1.85,0.59l0.05,1.44l0.67,0.14l0.51,0.6l-0.17,3.14l0.44,0.95l-0.34,0.47l0.2,0.47l0.74,-0.02l1.08,-2.21l1.08,-0.89l-0.42,1.15l0.58,0.45l0.83,-0.67l0.52,-1.22l1.0,-0.43l3.09,-0.25l1.5,0.21l1.18,0.93l1.54,0.44l0.47,1.05l2.31,2.58l1.17,0.55l0.53,1.55l0.73,0.34l1.87,0.07l0.73,-0.4l1.06,-0.06l1.4,-1.09l1.0,1.11l1.1,0.64l1.01,-0.25l0.68,-0.82l1.87,1.06l0.64,-0.34l1.65,-2.58l2.81,-1.89l1.7,-1.65l0.92,0.11l3.27,-1.21l5.17,-0.25l3.25,-2.09l2.28,-0.88l1.52,-0.11l-0.01,3.24l0.29,0.71l-0.36,1.1l0.46,0.7l0.68,0.28l0.91,-0.41l2.2,0.7l1.14,-0.43l1.03,-0.87l0.66,0.48l0.21,0.7l0.85,0.22l1.22,-0.76l0.79,-1.57l0.69,-0.28l1.06,0.23l1.35,-1.15l0.53,-0.01l0.22,0.08l-0.3,2.02l0.75,1.32l-1.11,-0.04l-0.36,0.5l0.84,1.83l-0.87,1.04l0.12,0.45l0.83,0.79l1.37,-0.42l0.6,0.47l0.62,0.04l0.18,1.19l0.98,0.87l1.53,0.51l-1.17,0.68l-4.96,-0.15l-0.53,0.3l-1.35,-0.17l-0.88,0.41l-0.66,-0.75l-1.63,-0.07l-0.59,0.47l-0.07,1.22l-0.49,0.76l0.38,2.05l-0.92,-0.22l-0.89,-0.92l-0.77,-0.13l-1.96,-1.65l-2.41,-0.6l-1.6,0.04l-1.04,-0.5l-2.89,0.47l-0.61,0.45l-1.18,2.52l-3.47,0.73l-0.57,0.77l-2.06,-0.33l-2.82,0.93l-0.68,0.83l-0.56,2.51l-0.78,0.28l-0.81,0.87l-0.65,0.28l0.16,-1.95l-0.74,-0.91l-1.02,0.34l-0.77,0.92l-0.97,-0.39l-0.68,0.17l-0.37,0.4l0.1,0.82l-0.73,2.01l-1.2,0.59l-0.1,-1.37l-0.46,-1.06l0.34,-1.69l-0.17,-0.37l-0.66,-0.17l-0.45,0.57l-0.6,2.13l-0.22,2.57l-1.12,0.91l-1.26,3.03l-0.62,2.65l-2.55,5.33l-0.69,0.73l0.12,0.91l-1.4,-1.28l0.18,-1.74l0.63,-1.69l-0.41,-0.81l-0.62,-0.31l-1.36,0.85l-1.16,0.1l0.04,-1.29l0.81,-1.45l-0.41,-1.34l0.3,-1.09l-0.58,-0.98l0.15,-0.83l-1.9,-1.55l-1.1,-0.06l-0.59,-0.44l-1.48,-0.0l0.3,-1.36l-0.94,-1.45l-1.13,-0.51l-2.23,-0.1l-3.2,-0.71l-1.55,0.59l-1.43,-0.42l-1.62,0.17l-4.56,-1.94l-15.37,-2.5l-1.99,-3.39l-1.88,-0.96l-0.76,0.26l-0.1,-0.29ZM603.39,98.63l-0.0,0.52l-0.46,0.32l-0.7,1.39l0.08,0.57l-0.65,-0.58l0.91,-2.15l0.83,-0.06ZM570.53,72.73l-0.51,-0.27l-1.16,0.06l-0.04,-1.56l1.0,-1.02l1.18,-2.09l1.83,-1.5l0.63,-0.0l0.53,-0.58l2.08,-0.89l3.34,-0.42l1.1,0.66l-0.54,0.38l-1.32,-0.12l-2.26,0.78l0.15,0.87l0.71,0.13l-1.19,0.98l-1.4,1.89l-0.69,0.28l-0.36,1.45l-1.15,1.36l-0.66,2.04l-0.67,-0.87l0.75,-0.97l0.14,-1.95l-0.84,-0.23l-0.6,0.92l-0.05,0.67Z", "name": "Michigan"}, "US-GA": {"path": "M654.05,331.64l22.02,-3.57l20.65,-3.86l-0.07,0.58l-2.59,3.35l-0.41,1.73l0.11,1.23l0.82,0.78l1.84,0.8l1.03,0.12l2.7,2.03l0.84,0.24l1.9,-0.37l0.6,0.25l0.8,1.64l1.51,1.6l1.04,2.5l1.33,0.82l0.84,1.16l0.56,0.26l1.0,1.77l1.07,0.3l1.17,0.99l3.81,1.85l2.41,3.16l2.25,0.58l2.53,1.67l0.5,2.34l1.25,1.01l0.47,-0.16l0.31,0.49l-0.1,0.62l0.79,0.73l0.79,0.09l0.56,1.2l4.99,1.88l0.4,1.78l1.54,1.73l1.02,2.01l-0.07,0.8l0.48,0.69l0.11,1.24l1.04,0.79l1.16,0.17l1.25,0.62l0.28,0.53l0.57,0.23l1.12,2.56l0.76,0.57l0.08,2.68l0.77,1.48l1.38,0.9l1.52,-0.27l1.44,0.76l1.45,0.12l-0.59,0.78l-0.55,-0.35l-0.47,0.28l-0.4,0.99l0.62,0.91l-0.38,0.48l-1.38,-0.16l-0.77,-0.55l-0.65,0.44l0.26,0.71l-0.49,0.52l0.36,0.6l1.44,0.25l-0.58,1.35l-1.43,0.27l-1.08,-0.44l-0.6,0.21l0.03,0.82l1.45,0.6l-1.76,3.73l0.36,1.73l-0.48,0.97l0.85,1.48l-2.29,-0.19l-0.46,0.29l0.06,0.63l0.55,0.34l2.76,0.24l1.07,0.66l-0.02,0.34l-0.56,0.22l-0.88,1.95l-0.5,-1.41l-0.45,-0.13l-0.6,0.33l-0.15,0.84l0.34,0.96l-0.6,0.12l-0.03,0.84l-0.3,0.16l0.07,0.46l1.34,1.15l-1.09,1.03l0.32,0.47l0.77,0.08l-0.39,0.92l0.06,0.88l-0.46,0.51l1.1,1.66l0.03,0.76l-0.79,0.33l-2.64,-0.17l-4.06,-0.96l-1.31,0.35l-0.18,0.74l-0.68,0.26l-0.35,1.25l0.28,2.08l0.95,1.36l0.13,4.25l-1.97,0.4l-0.54,-0.92l-0.12,-1.3l-1.33,-1.82l-49.21,5.14l-0.72,-0.56l-0.86,-2.7l-0.94,-1.51l-0.56,-0.38l0.16,-0.68l-0.73,-1.51l-1.82,-1.81l-0.43,-1.75l0.25,-0.8l0.06,-5.18l-0.6,-1.81l-1.19,-1.47l-1.03,-2.65l0.12,-1.65l0.78,-2.36l-0.25,-1.53l0.19,-2.11l1.62,-1.33l0.46,-1.47l-0.55,-0.61l-1.42,-0.69l0.09,-2.15l-0.97,-1.87l-2.18,-2.42l-1.03,-2.81l-0.75,-0.68l-0.17,-0.96l-0.77,-1.37l-13.99,-43.11Z", "name": "Georgia"}, "US-AZ": {"path": "M128.51,384.14l0.44,-1.81l1.29,-1.29l0.53,-1.12l0.48,-0.25l1.66,0.62l0.96,-0.03l0.52,-0.46l0.28,-1.17l1.31,-1.0l0.24,-2.73l-0.46,-1.24l-0.84,-0.66l-2.07,-0.66l-0.3,-0.61l0.8,-2.4l0.0,-1.39l-0.52,-1.19l0.57,-0.86l-0.2,-0.87l1.57,-0.27l2.29,-2.81l0.65,-2.43l0.65,-0.81l0.02,-3.17l0.55,-0.62l-0.29,-1.43l1.71,-1.14l1.03,-1.85l3.16,-1.29l2.03,-1.58l0.26,-0.53l-0.13,-1.04l-3.25,-3.49l-0.51,-0.22l0.22,-1.26l-0.66,-1.46l0.07,-0.91l-0.88,-2.76l-0.84,-0.56l-0.19,-1.65l-0.69,-0.8l0.19,-3.54l0.58,-0.87l-0.3,-0.86l1.03,-0.4l0.4,-1.42l0.14,-3.2l-0.76,-3.66l0.76,-2.55l-0.4,-3.0l0.85,-2.56l-0.8,-1.87l-0.03,-0.92l0.78,-1.88l2.54,-0.63l1.75,0.99l1.43,-0.19l0.96,2.24l0.79,0.71l1.54,0.14l1.01,-0.5l1.02,-2.27l0.94,-1.19l2.57,-16.94l42.42,5.78l42.56,4.67l-11.82,123.64l-36.87,-4.05l-36.33,-18.97l-28.43,-15.56Z", "name": "Arizona"}, "US-MT": {"path": "M166.39,57.3l0.69,-0.1l0.33,-0.38l-0.9,-1.99l0.83,-0.96l-0.39,-1.3l0.09,-0.96l-1.24,-1.93l-0.24,-1.49l-1.03,-1.33l-1.19,-2.44l3.53,-20.64l43.67,6.71l43.04,5.23l42.75,3.84l43.13,2.53l-3.53,86.04l-28.1,-1.47l-26.82,-1.91l-26.78,-2.4l-25.83,-2.79l-0.44,0.35l-1.22,10.41l-1.51,-2.01l-0.03,-0.91l-1.18,-2.35l-1.25,-0.74l-1.8,0.92l0.03,1.05l-0.72,0.42l-0.34,1.56l-2.42,-0.41l-1.91,0.57l-0.92,-0.85l-3.36,0.09l-2.38,-0.96l-1.68,0.58l-0.84,1.49l-4.66,-1.6l-1.3,0.37l-1.12,0.9l-0.31,0.67l-1.65,-1.4l0.22,-1.43l-0.9,-1.71l0.4,-0.36l0.07,-0.62l-1.17,-3.08l-1.45,-1.25l-1.44,0.36l-0.21,-0.64l-1.08,-0.9l-0.41,-1.37l0.68,-0.61l0.2,-1.41l-0.77,-2.38l-0.77,-0.35l-0.31,-1.58l-1.51,-2.54l0.23,-1.51l-0.56,-1.26l0.34,-1.4l-0.73,-0.86l0.48,-0.98l-0.21,-0.74l-1.14,-0.75l-0.13,-0.59l-0.85,-0.91l-0.8,-0.4l-0.51,0.37l-0.07,0.74l-0.7,0.27l-1.13,1.22l-1.75,0.37l-1.21,1.07l-1.08,-0.85l-0.64,-1.01l-1.06,-0.44l0.02,-0.86l0.74,-0.63l0.24,-1.06l-0.61,-1.6l0.9,-1.09l1.07,-0.08l0.83,-0.8l-0.26,-1.14l0.38,-1.07l-0.95,-0.81l-0.04,-0.81l0.66,-1.28l-0.59,-1.07l0.74,-0.07l0.38,-0.42l-0.04,-1.77l1.83,-3.73l-0.14,-1.05l0.89,-0.62l0.6,-3.16l-0.78,-0.5l-1.8,0.37l-1.33,-0.11l-0.64,-0.55l0.37,-0.83l-0.62,-0.97l-0.66,-0.23l-0.72,0.35l-0.07,-0.95l-1.74,-1.62l0.04,-1.84l-1.68,-1.82l-0.08,-0.69l-1.55,-2.88l-1.07,-1.29l-0.57,-1.63l-2.35,-1.34l-0.95,-1.95l-1.43,-1.19Z", "name": "Montana"}, "US-MS": {"path": "M555.51,431.02l0.67,-0.97l-1.05,-1.76l0.18,-1.63l-0.81,-0.87l1.69,-0.25l0.47,-0.54l0.4,-2.74l-0.77,-1.82l1.56,-1.79l0.25,-3.58l0.74,-2.26l1.89,-1.25l1.15,-1.97l1.4,-1.04l0.34,-0.78l-0.04,-0.99l-0.63,-0.96l1.14,-0.28l0.96,-2.58l0.91,-1.31l-0.16,-0.86l-1.54,-0.43l-0.35,-0.96l-1.83,-1.04l-0.07,-2.14l-0.93,-0.74l-0.45,-0.84l-0.02,-0.37l1.14,-0.29l0.46,-0.69l-0.26,-0.89l-1.41,-0.49l0.23,-1.77l0.98,-1.54l-0.77,-1.06l-1.08,-0.31l-0.15,-2.82l0.9,-0.54l0.23,-0.8l-0.62,-2.52l-1.25,-0.66l0.7,-1.33l-0.07,-2.22l-2.02,-1.52l1.13,-0.47l0.12,-1.41l-1.34,-0.89l1.58,-2.04l0.93,-0.31l0.36,-0.69l-0.52,-1.56l0.42,-1.35l-0.9,-0.89l2.84,-1.1l0.59,-0.76l-0.09,-1.07l-1.41,-0.95l1.39,-1.08l0.62,-1.77l0.94,-0.17l0.34,-0.97l-0.2,-0.77l1.48,-0.43l1.22,-1.21l0.07,-3.53l-0.46,-1.53l0.36,-1.78l0.73,0.09l0.68,-0.33l0.42,-0.87l-0.41,-1.06l2.72,-1.71l0.58,-1.06l-0.29,-1.28l36.44,-4.1l0.86,1.26l0.85,0.45l0.99,66.49l5.52,32.95l-0.73,0.69l-1.53,-0.3l-0.9,-0.94l-1.32,1.06l-1.23,0.17l-2.17,-1.26l-1.85,-0.19l-0.83,0.36l-0.34,0.44l0.32,0.41l-0.56,0.36l-3.96,1.66l-0.05,-0.5l-0.96,-0.52l-1.0,0.05l-0.58,1.0l0.76,0.61l-1.59,1.21l-0.33,1.28l-0.69,0.3l-1.33,-0.06l-1.16,-1.86l-0.08,-0.89l-0.92,-1.47l-0.21,-1.0l-1.4,-1.63l-1.16,-0.54l-0.47,-0.77l0.1,-0.62l-0.69,-0.92l0.21,-1.99l0.5,-0.93l0.66,-2.98l-0.06,-1.22l-0.43,-0.29l-34.66,3.41Z", "name": "Mississippi"}, "US-SC": {"path": "M697.55,324.05l4.86,-2.69l1.02,-0.05l1.11,-1.38l3.93,-1.9l0.45,-0.88l0.63,0.22l22.71,-3.36l0.07,1.22l0.42,0.57l0.71,0.01l1.21,-1.3l2.82,2.54l0.46,2.48l0.55,0.52l19.74,-3.49l22.74,15.07l0.02,0.55l-2.48,2.18l-2.44,3.67l-2.41,5.72l-0.09,2.74l-1.08,-0.21l0.85,-2.72l-0.63,-0.23l-0.76,0.87l-0.56,1.38l-0.11,1.55l0.83,0.95l1.05,0.23l0.44,0.91l-0.75,0.08l-0.41,0.56l-0.87,0.02l-0.24,0.68l0.94,0.45l-1.1,1.13l-0.07,1.02l-1.34,0.63l-0.5,-0.61l-0.5,-0.08l-1.06,0.87l-0.56,1.77l0.43,0.87l-1.19,1.23l-0.61,1.44l-1.2,1.01l-0.9,-0.4l0.27,-0.6l-0.53,-0.74l-1.37,0.31l0.25,1.2l-0.52,0.03l0.05,0.76l2.02,1.01l-0.12,0.39l-0.88,0.94l-1.22,0.23l-0.24,0.51l0.33,0.45l-2.29,1.34l-1.42,-0.84l-0.56,0.11l-0.1,0.67l1.19,0.78l-1.54,1.57l-0.72,-0.75l-0.5,0.52l-0.0,0.74l-1.54,-0.37l-1.34,-0.84l-0.44,0.5l0.16,0.53l-1.73,0.17l-0.44,0.37l-0.06,0.78l2.07,0.05l-0.26,0.55l0.42,0.25l1.91,-0.15l0.11,0.22l-0.97,0.86l-0.32,0.78l0.57,0.49l0.94,-0.53l0.03,0.21l-1.12,1.09l-0.99,0.43l-0.21,-2.04l-0.69,-0.27l-0.22,-1.54l-0.88,-0.15l-0.3,0.58l0.86,2.69l-1.12,-0.66l-0.63,-1.0l-0.39,-1.76l-0.65,-0.21l-0.52,-0.63l-0.69,0.0l-0.27,0.6l0.84,1.02l0.01,0.68l1.11,1.83l-0.02,0.86l1.22,1.17l-0.62,0.35l0.03,0.98l-1.2,3.56l-1.51,-0.78l-1.52,0.26l-0.97,-0.68l-0.54,-1.03l-0.17,-2.93l-0.86,-0.75l-1.06,-2.47l-1.04,-0.95l-3.23,-1.33l-0.49,-2.65l-1.12,-2.17l-1.43,-1.58l-0.06,-1.07l-0.76,-1.21l-4.81,-1.69l-0.58,-1.27l-1.21,-0.37l0.02,-0.7l-0.53,-0.87l-0.87,0.0l-0.73,-0.61l0.03,-1.21l-0.66,-1.26l-2.7,-1.78l-2.16,-0.52l-2.36,-3.12l-3.93,-1.93l-1.22,-1.03l-0.83,-0.12l-1.04,-1.81l-0.51,-0.22l-0.91,-1.21l-1.18,-0.68l-0.99,-2.42l-1.54,-1.65l-1.02,-1.87l-1.06,-0.37l-1.93,0.37l-0.46,-0.16l-2.75,-2.19l-1.06,0.02l-2.23,-1.27l0.36,-2.22l2.6,-3.31l0.15,-1.07ZM750.36,375.19l0.73,-0.08l0.51,0.45l-1.23,1.9l0.28,-1.22l-0.3,-1.06Z", "name": "South Carolina"}, "US-RI": {"path": "M851.1,141.46l0.22,-0.46l-0.53,-2.22l-3.14,-10.0l5.61,-1.84l0.76,2.06l0.8,0.25l0.19,0.73l0.08,0.42l-0.77,0.25l0.03,0.29l0.51,1.45l0.59,0.5l-0.75,0.28l-0.3,0.6l0.87,0.97l-0.14,1.23l0.89,1.9l0.03,1.67l-0.27,0.71l-0.9,0.16l-3.59,2.35l-0.18,-1.31ZM855.89,131.53l0.26,0.1l0.01,0.1l-0.17,-0.08l-0.1,-0.12ZM857.28,132.21l0.25,0.54l-0.05,0.32l-0.15,0.01l-0.05,-0.87Z", "name": "Rhode Island"}, "US-AR": {"path": "M498.76,376.91l-1.42,-38.01l-4.48,-23.98l37.68,-2.58l39.02,-3.58l0.8,1.6l1.01,0.7l0.11,1.77l-0.77,0.57l-0.22,0.94l-1.42,0.93l-0.29,1.04l-0.83,0.54l-1.19,2.59l0.02,0.7l0.53,0.26l10.94,-1.46l0.86,0.93l-1.18,0.37l-0.52,0.96l0.25,0.49l0.84,0.41l-3.6,2.7l0.02,0.84l0.83,1.04l-0.6,1.15l0.62,0.97l-1.42,0.74l-0.11,1.44l-1.45,2.09l0.12,1.64l0.91,3.1l-0.15,0.27l-1.08,-0.01l-0.33,0.26l-0.51,1.73l-1.52,0.95l-0.04,0.51l0.79,0.91l0.05,0.65l-1.11,1.21l-2.02,1.13l-0.21,0.62l0.43,1.0l-0.19,0.27l-1.23,0.03l-0.42,0.67l-0.32,1.89l0.47,1.57l0.02,3.08l-1.27,1.09l-1.54,0.13l0.23,1.49l-0.21,0.48l-0.93,0.25l-0.59,1.77l-1.49,1.19l-0.02,0.93l1.39,0.76l-0.03,0.7l-1.23,0.3l-2.24,1.23l0.03,0.67l0.99,0.82l-0.45,1.14l0.53,1.38l-1.09,0.62l-1.9,2.57l0.52,0.7l1.0,0.49l0.01,0.58l-0.98,0.29l-0.42,0.64l0.51,0.84l1.63,1.01l0.06,1.77l-0.59,0.98l-0.09,0.84l1.34,0.79l0.5,2.17l-1.09,1.01l0.06,2.11l-51.45,4.07l-0.83,-11.53l-1.18,-0.85l-0.9,0.16l-0.83,-0.35l-0.93,0.39l-1.22,-0.33l-0.57,0.72l-0.47,0.01l-0.49,-0.48l-0.82,-0.15l-0.63,-1.0Z", "name": "Arkansas"}}, "height": 612.395412685768, "projection": {"type": "aea", "centralMeridian": -100.0}, "width": 900.0}); \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js
new file mode 100644
index 0000000..89f7783
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/jvectormap/jquery-jvectormap-world-mill-en.js
@@ -0,0 +1 @@
+$.fn.vectorMap('addMap', 'world_mill_en',{"insets": [{"width": 900.0, "top": 0, "height": 440.7063107441331, "bbox": [{"y": -12671671.123330014, "x": -20004297.151525836}, {"y": 6930392.02513512, "x": 20026572.394749384}], "left": 0}], "paths": {"BD": {"path": "M652.71,228.85l-0.04,1.38l-0.46,-0.21l-0.42,0.3l0.05,0.65l-0.17,-1.37l-0.48,-1.26l-1.08,-1.6l-0.23,-0.13l-2.31,-0.11l-0.31,0.36l0.21,0.98l-0.6,1.11l-0.8,-0.4l-0.37,0.09l-0.23,0.3l-0.54,-0.21l-0.78,-0.19l-0.38,-2.04l-0.83,-1.89l0.4,-1.5l-0.16,-0.35l-1.24,-0.57l0.36,-0.62l1.5,-0.95l0.02,-0.49l-1.62,-1.26l0.64,-1.31l1.7,1.0l0.12,0.04l0.96,0.11l0.19,1.62l0.25,0.26l2.38,0.37l2.32,-0.04l1.06,0.33l-0.92,1.79l-0.97,0.13l-0.23,0.16l-0.77,1.51l0.05,0.35l1.37,1.37l0.5,-0.14l0.35,-1.46l0.24,-0.0l1.24,3.92Z", "name": "Bangladesh"}, "BE": {"path": "M429.28,143.95l1.76,0.25l0.13,-0.01l2.16,-0.64l1.46,1.34l1.26,0.71l-0.23,1.8l-0.44,0.08l-0.24,0.25l-0.2,1.36l-1.8,-1.22l-0.23,-0.05l-1.14,0.23l-1.62,-1.43l-1.15,-1.31l-0.21,-0.1l-0.95,-0.04l-0.21,-0.68l1.66,-0.54Z", "name": "Belgium"}, "BF": {"path": "M413.48,260.21l-1.22,-0.46l-0.13,-0.02l-1.17,0.1l-0.15,0.06l-0.73,0.53l-0.87,-0.41l-0.39,-0.75l-0.13,-0.13l-0.98,-0.48l-0.14,-1.2l0.63,-0.99l0.05,-0.18l-0.05,-0.73l1.9,-2.01l0.08,-0.14l0.35,-1.65l0.49,-0.44l1.05,0.3l0.21,-0.02l1.05,-0.52l0.13,-0.13l0.3,-0.58l1.87,-1.1l0.11,-0.1l0.43,-0.72l2.23,-1.01l1.21,-0.32l0.51,0.4l0.19,0.06l1.25,-0.01l-0.14,0.89l0.01,0.13l0.34,1.16l0.06,0.11l1.35,1.59l0.07,1.13l0.24,0.28l2.64,0.53l-0.05,1.39l-0.42,0.59l-1.11,0.21l-0.22,0.17l-0.46,0.99l-0.69,0.23l-2.12,-0.05l-1.14,-0.2l-0.19,0.03l-0.72,0.36l-1.07,-0.17l-4.35,0.12l-0.29,0.29l-0.06,1.44l0.25,1.45Z", "name": "Burkina Faso"}, "BG": {"path": "M477.63,166.84l0.51,0.9l0.33,0.14l0.9,-0.21l1.91,0.47l3.68,0.16l0.17,-0.05l1.2,-0.75l2.78,-0.67l1.72,1.05l1.02,0.24l-0.97,0.97l-0.91,2.17l0.0,0.24l0.56,1.19l-1.58,-0.3l-0.16,0.01l-2.55,0.95l-0.2,0.28l-0.02,1.23l-1.92,0.24l-1.68,-0.99l-0.27,-0.02l-1.94,0.8l-1.52,-0.07l-0.15,-1.72l-0.12,-0.21l-0.99,-0.76l0.18,-0.18l0.02,-0.39l-0.17,-0.22l0.33,-0.75l0.91,-0.91l0.01,-0.42l-1.16,-1.25l-0.18,-0.89l0.24,-0.27Z", "name": "Bulgaria"}, "BA": {"path": "M468.39,164.66l0.16,0.04l0.43,-0.0l-0.43,0.93l0.06,0.34l1.08,1.06l-0.28,1.09l-0.5,0.13l-0.47,0.28l-0.86,0.74l-0.1,0.16l-0.28,1.29l-1.81,-0.94l-0.9,-1.22l-1.0,-0.73l-1.1,-1.1l-0.55,-0.96l-1.11,-1.3l0.3,-0.75l0.59,0.46l0.42,-0.04l0.46,-0.54l1.0,-0.06l2.11,0.5l1.72,-0.03l1.06,0.64Z", "name": "Bosnia and Herzegovina"}, "BN": {"path": "M707.34,273.57l0.76,-0.72l1.59,-1.03l-0.18,1.93l-0.9,-0.06l-0.28,0.14l-0.31,0.51l-0.68,-0.78Z", "name": "Brunei"}, "BO": {"path": "M263.83,340.79l-0.23,-0.12l-2.86,-0.11l-0.28,0.17l-0.77,1.67l-1.17,-1.51l-0.18,-0.11l-3.28,-0.64l-0.28,0.1l-2.02,2.3l-1.43,0.29l-0.91,-3.35l-1.31,-2.88l0.75,-2.41l-0.09,-0.32l-1.23,-1.03l-0.31,-1.76l-0.05,-0.12l-1.12,-1.6l1.49,-2.62l0.01,-0.28l-1.0,-2.0l0.48,-0.72l0.02,-0.29l-0.37,-0.78l0.87,-1.13l0.06,-0.18l0.05,-2.17l0.12,-1.71l0.5,-0.8l0.01,-0.3l-1.9,-3.58l1.3,0.15l1.34,-0.05l0.23,-0.12l0.51,-0.7l2.12,-0.99l1.31,-0.93l2.81,-0.37l-0.21,1.51l0.01,0.13l0.29,0.91l-0.19,1.64l0.11,0.27l2.72,2.27l0.15,0.07l2.71,0.41l0.92,0.88l0.12,0.07l1.64,0.49l1.0,0.71l0.18,0.06l1.5,-0.02l1.24,0.64l0.1,1.31l0.05,0.14l0.44,0.68l0.02,0.73l-0.44,0.03l-0.27,0.39l0.96,2.99l0.28,0.21l4.43,0.1l-0.28,1.12l0.0,0.15l0.27,1.02l0.15,0.19l1.27,0.67l0.52,1.42l-0.42,1.91l-0.66,1.1l-0.04,0.2l0.21,1.3l-0.19,0.13l-0.01,-0.27l-0.15,-0.24l-2.33,-1.33l-0.14,-0.04l-2.38,-0.03l-4.36,0.76l-0.21,0.16l-1.2,2.29l-0.03,0.13l-0.06,1.37l-0.79,2.53l-0.05,-0.08Z", "name": "Bolivia"}, "JP": {"path": "M781.17,166.78l1.8,0.67l0.28,-0.04l1.38,-1.01l0.43,2.67l-3.44,0.77l-0.18,0.12l-2.04,2.79l-3.71,-1.94l-0.42,0.15l-1.29,3.11l-2.32,0.04l-0.3,-2.63l1.12,-2.1l2.51,-0.16l0.28,-0.25l0.73,-4.22l0.58,-1.9l2.59,2.84l2.0,1.1ZM773.66,187.36l-0.92,2.24l-0.01,0.2l0.4,1.3l-1.18,1.81l-3.06,1.28l-4.35,0.17l-0.19,0.08l-3.4,3.06l-1.36,-0.87l-0.1,-1.95l-0.34,-0.28l-4.35,0.62l-2.99,1.33l-2.87,0.05l-0.28,0.2l0.09,0.33l2.37,1.93l-1.57,4.44l-1.35,0.97l-0.9,-0.79l0.57,-2.32l-0.15,-0.34l-1.5,-0.77l-0.81,-1.53l2.04,-0.75l0.14,-0.1l1.28,-1.72l2.47,-1.43l1.84,-1.92l4.83,-0.82l2.62,0.57l0.33,-0.16l2.45,-4.77l1.38,1.14l0.38,0.0l5.1,-4.02l0.09,-0.11l1.57,-3.57l0.02,-0.16l-0.42,-3.22l0.94,-1.67l2.27,-0.47l1.26,3.82l-0.07,2.23l-2.26,2.86l-0.06,0.19l0.04,2.93ZM757.85,196.18l0.22,0.66l-1.11,1.33l-0.8,-0.7l-0.33,-0.04l-1.28,0.65l-0.14,0.15l-0.54,1.34l-1.17,-0.57l0.02,-1.03l1.2,-1.45l1.24,0.28l0.29,-0.1l0.9,-1.03l1.51,0.5Z", "name": "Japan"}, "BI": {"path": "M494.7,295.83l-0.14,-2.71l-0.04,-0.13l-0.34,-0.62l0.93,0.12l0.3,-0.16l0.67,-1.25l0.9,0.11l0.11,0.76l0.08,0.16l0.46,0.48l0.02,0.56l-0.55,0.48l-0.96,1.29l-0.82,0.82l-0.61,0.07Z", "name": "Burundi"}, "BJ": {"path": "M427.4,268.94l-1.58,0.22l-0.52,-1.45l0.11,-5.73l-0.08,-0.21l-0.43,-0.44l-0.09,-1.13l-0.09,-0.19l-1.52,-1.52l0.24,-1.01l0.7,-0.23l0.18,-0.16l0.45,-0.97l1.07,-0.21l0.19,-0.12l0.53,-0.73l0.73,-0.65l0.68,-0.0l1.69,1.3l-0.08,0.67l0.02,0.14l0.52,1.38l-0.44,0.9l-0.01,0.24l0.2,0.52l-1.1,1.42l-0.76,0.76l-0.08,0.13l-0.47,1.59l0.05,1.69l-0.13,3.79Z", "name": "Benin"}, "BT": {"path": "M650.38,213.78l0.88,0.75l-0.13,1.24l-1.77,0.07l-2.1,-0.18l-1.57,0.4l-2.02,-0.91l-0.02,-0.24l1.54,-1.87l1.18,-0.6l1.67,0.59l1.32,0.08l1.01,0.67Z", "name": "Bhutan"}, "JM": {"path": "M226.67,238.37l1.64,0.23l1.2,0.56l0.11,0.19l-1.25,0.03l-0.14,0.04l-0.65,0.37l-1.24,-0.37l-1.17,-0.77l0.11,-0.22l0.86,-0.15l0.52,0.08Z", "name": "Jamaica"}, "BW": {"path": "M484.91,331.96l0.53,0.52l0.82,1.53l2.83,2.86l0.14,0.08l0.85,0.22l0.03,0.81l0.74,1.66l0.21,0.17l1.87,0.39l1.17,0.87l-3.13,1.71l-2.3,2.01l-0.07,0.1l-0.82,1.74l-0.66,0.88l-1.24,0.19l-0.24,0.2l-0.65,1.98l-1.4,0.55l-1.9,-0.12l-1.2,-0.74l-1.06,-0.32l-0.22,0.02l-1.22,0.62l-0.14,0.14l-0.58,1.21l-1.16,0.79l-1.18,1.13l-1.5,0.23l-0.4,-0.68l0.22,-1.53l-0.04,-0.19l-1.48,-2.54l-0.11,-0.11l-0.53,-0.31l-0.0,-7.25l2.18,-0.08l0.29,-0.3l0.07,-9.0l1.63,-0.08l3.69,-0.86l0.84,0.93l0.38,0.05l1.53,-0.97l0.79,-0.03l1.3,-0.53l0.23,0.1l0.92,1.96Z", "name": "Botswana"}, "BR": {"path": "M259.49,274.87l1.42,0.25l1.97,0.62l0.28,-0.05l0.67,-0.55l1.76,-0.38l2.8,-0.94l0.12,-0.08l0.92,-0.96l0.05,-0.33l-0.15,-0.32l0.73,-0.06l0.36,0.35l-0.27,0.93l0.17,0.36l0.76,0.34l0.44,0.9l-0.58,0.73l-0.06,0.13l-0.4,2.13l0.03,0.19l0.62,1.22l0.17,1.11l0.11,0.19l1.54,1.18l0.15,0.06l1.23,0.12l0.29,-0.15l0.2,-0.36l0.71,-0.11l1.13,-0.44l0.79,-0.63l1.25,0.19l0.65,-0.08l1.32,0.2l0.32,-0.18l0.23,-0.51l-0.05,-0.31l-0.31,-0.37l0.11,-0.31l0.75,0.17l0.13,0.0l1.1,-0.24l1.34,0.5l1.08,0.51l0.33,-0.05l0.67,-0.58l0.27,0.05l0.28,0.57l0.31,0.17l1.2,-0.18l0.17,-0.08l1.03,-1.05l0.76,-1.82l1.39,-2.16l0.49,-0.07l0.52,1.17l1.4,4.37l0.2,0.2l1.14,0.35l0.05,1.39l-1.8,1.97l0.01,0.42l0.78,0.75l0.18,0.08l4.16,0.37l0.08,2.25l0.5,0.22l1.78,-1.54l2.98,0.85l4.07,1.5l1.07,1.28l-0.37,1.23l0.36,0.38l2.83,-0.75l4.8,1.3l3.75,-0.09l3.6,2.02l3.27,2.84l1.93,0.72l2.13,0.11l0.76,0.66l1.22,4.56l-0.96,4.03l-1.22,1.58l-3.52,3.51l-1.63,2.91l-1.75,2.09l-0.5,0.04l-0.26,0.19l-0.72,1.99l0.18,4.76l-0.95,5.56l-0.74,0.96l-0.06,0.15l-0.43,3.39l-2.49,3.34l-0.06,0.13l-0.4,2.56l-1.9,1.07l-0.13,0.16l-0.51,1.38l-2.59,0.0l-3.94,1.01l-1.82,1.19l-2.85,0.81l-3.01,2.17l-2.12,2.65l-0.06,0.13l-0.36,2.0l0.01,0.13l0.4,1.42l-0.45,2.63l-0.53,1.23l-1.76,1.53l-2.76,4.79l-2.16,2.15l-1.69,1.29l-0.09,0.12l-1.12,2.6l-1.3,1.26l-0.45,-1.02l0.99,-1.18l0.01,-0.37l-1.5,-1.95l-1.98,-1.54l-2.58,-1.77l-0.2,-0.05l-0.81,0.07l-2.42,-2.05l-0.25,-0.07l-0.77,0.14l2.75,-3.07l2.8,-2.61l1.67,-1.09l2.11,-1.49l0.13,-0.24l0.05,-2.15l-0.07,-0.2l-1.26,-1.54l-0.35,-0.09l-0.64,0.27l0.3,-0.95l0.34,-1.57l0.01,-1.52l-0.16,-0.26l-0.9,-0.48l-0.27,-0.01l-0.86,0.39l-0.65,-0.08l-0.23,-0.8l-0.23,-2.39l-0.04,-0.12l-0.47,-0.79l-0.14,-0.12l-1.69,-0.71l-0.25,0.01l-0.93,0.47l-2.29,-0.44l0.15,-3.3l-0.03,-0.15l-0.62,-1.22l0.57,-0.39l0.13,-0.3l-0.22,-1.37l0.67,-1.13l0.44,-2.04l-0.01,-0.17l-0.59,-1.61l-0.14,-0.16l-1.25,-0.66l-0.22,-0.82l0.35,-1.41l-0.28,-0.37l-4.59,-0.1l-0.78,-2.41l0.34,-0.02l0.28,-0.31l-0.03,-1.1l-0.05,-0.16l-0.45,-0.68l-0.1,-1.4l-0.16,-0.24l-1.45,-0.76l-0.14,-0.03l-1.48,0.02l-1.04,-0.73l-1.62,-0.48l-0.93,-0.9l-0.16,-0.08l-2.72,-0.41l-2.53,-2.12l0.18,-1.54l-0.01,-0.13l-0.29,-0.91l0.26,-1.83l-0.34,-0.34l-3.28,0.43l-0.14,0.05l-1.3,0.93l-2.16,1.01l-0.12,0.09l-0.47,0.65l-1.12,0.05l-1.84,-0.21l-0.12,0.01l-1.33,0.41l-0.82,-0.21l0.16,-3.6l-0.48,-0.26l-1.97,1.43l-1.96,-0.06l-0.86,-1.23l-0.22,-0.13l-1.23,-0.11l0.34,-0.69l-0.05,-0.33l-1.36,-1.5l-0.92,-2.0l0.45,-0.32l0.13,-0.25l-0.0,-0.87l1.34,-0.64l0.17,-0.32l-0.23,-1.23l0.56,-0.77l0.05,-0.13l0.16,-1.03l2.7,-1.61l2.01,-0.47l0.16,-0.09l0.24,-0.27l2.11,0.11l0.31,-0.25l1.13,-6.87l0.06,-1.12l-0.4,-1.53l-0.1,-0.15l-1.0,-0.82l0.01,-1.45l1.08,-0.32l0.39,0.2l0.44,-0.24l0.08,-0.96l-0.25,-0.32l-1.22,-0.22l-0.02,-1.01l4.57,0.05l0.22,-0.09l0.6,-0.63l0.44,0.5l0.47,1.42l0.45,0.16l0.27,-0.18l1.21,1.16l0.23,0.08l1.95,-0.16l0.23,-0.14l0.43,-0.67l1.76,-0.55l1.05,-0.42l0.18,-0.2l0.25,-0.92l1.65,-0.66l0.18,-0.35l-0.14,-0.53l-0.26,-0.22l-1.91,-0.19l-0.29,-1.33l0.1,-1.64l-0.15,-0.28l-0.44,-0.25Z", "name": "Brazil"}, "BS": {"path": "M227.51,216.69l0.3,0.18l-0.24,1.07l0.03,-1.04l-0.09,-0.21ZM226.5,224.03l-0.13,0.03l-0.54,-1.3l-0.09,-0.12l-0.78,-0.64l0.4,-1.26l0.33,0.05l0.79,2.0l0.01,1.24ZM225.76,216.5l-2.16,0.34l-0.07,-0.41l0.85,-0.16l1.36,0.07l0.02,0.16Z", "name": "The Bahamas"}, "BY": {"path": "M480.08,135.28l2.09,0.02l0.13,-0.03l2.72,-1.3l0.16,-0.19l0.55,-1.83l1.94,-1.06l0.15,-0.31l-0.2,-1.33l1.33,-0.52l2.58,-1.3l2.39,0.8l0.3,0.75l0.37,0.17l1.22,-0.39l2.18,0.75l0.2,1.36l-0.48,0.85l0.01,0.32l1.57,2.26l0.92,0.6l-0.1,0.41l0.19,0.35l1.61,0.57l0.48,0.6l-0.64,0.49l-1.91,-0.11l-0.18,0.05l-0.48,0.32l-0.1,0.39l0.57,1.1l0.51,1.78l-1.79,0.17l-0.18,0.08l-0.77,0.73l-0.09,0.19l-0.13,1.31l-0.75,-0.22l-2.11,0.15l-0.56,-0.66l-0.39,-0.06l-0.8,0.49l-0.79,-0.4l-0.13,-0.03l-1.94,-0.07l-2.76,-0.79l-2.58,-0.27l-1.98,0.07l-0.15,0.05l-1.31,0.86l-0.8,0.09l-0.04,-1.16l-0.03,-0.12l-0.63,-1.28l1.22,-0.56l0.17,-0.27l0.01,-1.35l-0.04,-0.15l-0.66,-1.24l-0.08,-1.12Z", "name": "Belarus"}, "BZ": {"path": "M198.03,239.7l0.28,0.19l0.43,-0.1l0.82,-1.42l0.0,0.07l0.29,0.29l0.16,0.0l-0.02,0.35l-0.39,1.08l0.02,0.25l0.16,0.29l-0.23,0.8l0.04,0.24l0.09,0.14l-0.25,1.12l-0.38,0.53l-0.33,0.06l-0.21,0.15l-0.41,0.74l-0.25,0.0l0.17,-2.58l0.01,-2.2Z", "name": "Belize"}, "RU": {"path": "M688.57,38.85l0.63,2.39l0.44,0.19l2.22,-1.23l7.18,0.07l5.54,2.49l1.85,1.77l-0.55,2.34l-2.64,1.42l-6.57,2.76l-1.95,1.5l0.12,0.53l3.09,0.68l3.69,1.23l0.21,-0.01l1.98,-0.81l1.16,2.84l0.5,0.08l1.03,-1.18l3.86,-0.74l7.79,0.78l0.56,2.05l0.27,0.22l10.47,0.71l0.32,-0.29l0.13,-3.34l4.98,0.8l3.96,-0.02l3.88,2.43l1.06,2.79l-1.38,1.83l0.01,0.38l3.15,3.64l0.1,0.08l3.94,1.86l0.4,-0.14l2.28,-4.56l3.75,1.94l0.22,0.02l4.18,-1.22l4.76,1.4l0.26,-0.04l1.74,-1.23l3.98,0.63l0.32,-0.41l-1.71,-4.1l3.0,-1.86l22.39,3.04l2.06,2.67l0.1,0.08l6.55,3.51l0.17,0.03l10.08,-0.86l4.86,0.73l1.91,1.72l-0.29,3.13l0.18,0.31l3.08,1.26l0.19,0.01l3.32,-0.9l4.37,-0.11l4.78,0.87l4.61,-0.48l4.26,3.82l0.32,0.05l3.1,-1.4l0.12,-0.45l-1.91,-2.67l0.92,-1.64l7.78,1.22l5.22,-0.26l7.12,2.1l9.6,5.22l6.4,4.15l-0.2,2.44l0.14,0.28l1.69,1.04l0.45,-0.31l-0.51,-2.66l6.31,0.58l4.52,3.61l-2.1,1.52l-4.02,0.42l-0.27,0.29l-0.06,3.83l-0.81,0.67l-2.14,-0.11l-1.91,-1.39l-3.19,-1.13l-0.51,-1.63l-0.21,-0.2l-2.54,-0.67l-0.13,-0.0l-2.69,0.5l-1.12,-1.19l0.48,-1.36l-0.38,-0.39l-3.0,0.98l-0.17,0.44l1.02,1.76l-1.27,1.55l-3.09,1.71l-3.15,-0.29l-0.3,0.18l0.07,0.34l2.22,2.1l1.47,3.22l1.15,1.09l0.25,1.41l-0.48,0.76l-4.47,-0.81l-0.17,0.02l-6.97,2.9l-2.2,0.44l-0.11,0.05l-3.83,2.68l-3.63,2.32l-0.1,0.11l-0.76,1.4l-3.3,-2.4l-0.3,-0.03l-6.31,2.85l-0.99,-1.21l-0.4,-0.06l-2.32,1.54l-3.23,-0.49l-0.33,0.2l-0.79,2.39l-2.97,3.51l-0.07,0.21l0.09,1.47l0.22,0.27l2.62,0.74l-0.3,4.7l-2.06,0.12l-0.26,0.2l-1.07,2.94l0.04,0.27l0.83,1.19l-4.03,1.63l-0.18,0.21l-0.83,3.72l-3.55,0.79l-0.23,0.23l-0.73,3.32l-3.22,2.76l-0.76,-1.88l-1.07,-4.88l-1.39,-7.59l1.17,-4.76l2.05,-2.08l0.09,-0.19l0.11,-1.46l3.67,-0.77l0.15,-0.08l4.47,-4.61l4.29,-3.82l4.48,-3.01l0.11,-0.14l2.01,-5.43l-0.31,-0.4l-3.04,0.33l-0.24,0.17l-1.47,3.11l-5.98,3.94l-1.91,-4.36l-0.33,-0.17l-6.46,1.3l-0.15,0.08l-6.27,6.33l-0.01,0.41l1.7,1.87l-5.04,0.87l-3.51,0.34l0.16,-2.32l-0.26,-0.32l-3.89,-0.56l-0.19,0.04l-3.02,1.77l-7.63,-0.63l-8.24,1.1l-0.16,0.07l-8.11,7.09l-9.6,8.31l0.16,0.52l3.79,0.42l1.16,2.03l0.17,0.14l2.43,0.76l0.31,-0.08l1.5,-1.61l2.49,0.2l3.46,3.6l0.08,2.67l-1.91,3.26l-0.04,0.14l-0.21,3.91l-1.11,5.09l-3.73,4.55l-0.87,2.21l-6.73,7.14l-1.59,1.77l-3.23,1.72l-1.38,0.03l-1.48,-1.39l-0.37,-0.03l-3.36,2.22l-0.11,0.14l-0.16,0.42l-0.01,-1.09l1.0,-0.06l0.28,-0.27l0.36,-3.6l-0.61,-2.51l1.85,-0.94l2.94,0.53l0.32,-0.15l1.71,-3.1l0.84,-3.38l0.97,-1.18l1.32,-2.88l-0.34,-0.42l-4.14,0.95l-2.18,1.25l-3.51,-0.0l-0.95,-2.81l-0.1,-0.14l-2.97,-2.3l-0.11,-0.05l-4.19,-1.0l-0.89,-3.08l-0.87,-2.03l-0.95,-1.46l-1.54,-3.37l-0.12,-0.14l-2.27,-1.28l-3.83,-1.02l-3.37,0.1l-3.11,0.61l-0.13,0.06l-2.07,1.69l0.04,0.49l1.23,0.72l0.03,1.53l-1.34,1.05l-2.26,3.51l-0.05,0.17l0.02,1.27l-3.25,1.9l-2.87,-1.17l-0.14,-0.02l-2.86,0.26l-1.22,-1.02l-0.12,-0.06l-1.5,-0.35l-0.23,0.04l-3.62,2.27l-3.24,0.53l-2.28,0.79l-3.08,-0.51l-2.24,0.03l-1.49,-1.61l-2.45,-1.57l-0.11,-0.04l-2.6,-0.43l-3.17,0.43l-2.31,0.59l-3.31,-1.28l-0.45,-2.31l-0.21,-0.23l-2.94,-0.85l-2.26,-0.39l-2.77,-1.36l-0.37,0.09l-2.59,3.45l-0.03,0.32l0.91,1.74l-2.15,2.01l-3.47,-0.79l-2.44,-0.12l-1.59,-1.46l-0.2,-0.08l-2.55,-0.05l-2.12,-0.98l-0.24,-0.01l-3.85,1.57l-4.74,2.79l-2.59,0.55l-0.79,0.21l-1.21,-1.81l-0.29,-0.13l-3.05,0.41l-0.96,-1.25l-0.14,-0.1l-1.65,-0.6l-1.15,-1.82l-0.13,-0.12l-1.38,-0.6l-0.19,-0.02l-3.49,0.82l-3.35,-1.85l-0.38,0.08l-1.08,1.4l-5.36,-8.17l-3.02,-2.52l0.72,-0.85l0.01,-0.38l-0.37,-0.08l-6.22,3.21l-1.98,0.16l0.17,-1.51l-0.2,-0.31l-3.22,-1.17l-0.19,-0.0l-2.3,0.74l-0.72,-3.27l-0.24,-0.23l-4.5,-0.75l-0.21,0.04l-2.2,1.42l-6.21,1.27l-0.11,0.05l-1.16,0.81l-9.3,1.19l-0.18,0.09l-1.15,1.17l-0.02,0.39l1.56,2.01l-2.02,0.74l-0.16,0.42l0.35,0.68l-2.18,1.49l0.02,0.51l3.83,2.16l-0.45,1.13l-3.31,-0.13l-0.25,0.12l-0.57,0.77l-2.97,-1.59l-0.15,-0.04l-3.97,0.07l-0.13,0.03l-2.53,1.32l-2.84,-1.28l-5.52,-2.3l-0.12,-0.02l-3.91,0.09l-0.16,0.05l-5.17,3.6l-0.13,0.21l-0.25,1.89l-2.17,-1.6l-0.44,0.1l-2.0,3.59l0.06,0.37l0.55,0.5l-1.32,2.23l0.04,0.36l2.13,2.17l0.23,0.09l1.7,-0.08l1.42,1.89l-0.23,1.5l0.19,0.32l0.94,0.38l-0.89,1.44l-2.3,0.49l-0.17,0.11l-2.49,3.2l0.0,0.37l2.2,2.81l-0.23,1.93l0.06,0.22l2.56,3.32l-1.27,1.02l-0.4,0.66l-0.8,-0.15l-1.65,-1.75l-0.18,-0.09l-0.66,-0.09l-1.45,-0.64l-0.72,-1.16l-0.18,-0.13l-2.34,-0.63l-0.17,0.0l-1.32,0.41l-0.31,-0.4l-0.12,-0.09l-3.49,-1.48l-3.67,-0.49l-2.1,-0.52l-0.3,0.1l-0.12,0.14l-2.96,-2.4l-2.89,-1.19l-1.69,-1.42l1.27,-0.35l0.16,-0.1l2.08,-2.61l-0.04,-0.41l-1.02,-0.9l3.21,-1.12l0.2,-0.31l-0.07,-0.69l-0.37,-0.26l-1.86,0.42l0.05,-0.86l1.11,-0.76l2.35,-0.23l0.25,-0.19l0.39,-1.07l0.0,-0.19l-0.51,-1.64l0.95,-1.58l0.04,-0.16l-0.03,-0.95l-0.22,-0.28l-3.69,-1.06l-1.43,0.02l-1.45,-1.44l-0.29,-0.08l-1.83,0.49l-2.88,-1.04l0.04,-0.42l-0.04,-0.18l-0.89,-1.43l-0.23,-0.14l-1.77,-0.14l-0.13,-0.66l0.52,-0.56l0.01,-0.4l-1.6,-1.9l-0.27,-0.1l-2.55,0.32l-0.71,-0.16l-0.3,0.1l-0.53,0.63l-0.58,-0.08l-0.56,-1.97l-0.48,-0.94l0.17,-0.11l1.92,0.11l0.2,-0.06l0.97,-0.74l0.05,-0.42l-0.72,-0.91l-0.13,-0.1l-1.43,-0.51l0.09,-0.36l-0.13,-0.33l-0.97,-0.59l-1.43,-2.06l0.44,-0.77l0.04,-0.19l-0.25,-1.64l-0.2,-0.24l-2.45,-0.84l-0.19,-0.0l-1.05,0.34l-0.25,-0.62l-0.18,-0.17l-2.5,-0.84l-0.74,-1.93l-0.21,-1.7l-0.13,-0.21l-0.92,-0.63l0.83,-0.89l0.07,-0.27l-0.71,-3.26l1.69,-2.01l0.03,-0.34l-0.24,-0.41l2.63,-1.9l-0.01,-0.49l-2.31,-1.57l5.08,-4.61l2.33,-2.24l1.01,-2.08l-0.09,-0.37l-3.52,-2.56l0.94,-2.38l-0.04,-0.29l-2.14,-2.86l1.61,-3.35l-0.01,-0.29l-2.81,-4.58l2.19,-3.04l-0.06,-0.42l-3.7,-2.76l0.32,-2.67l1.87,-0.38l4.26,-1.77l2.46,-1.47l3.96,2.58l0.12,0.05l6.81,1.04l9.37,4.87l1.81,1.92l0.15,2.55l-2.61,2.06l-3.95,1.07l-11.1,-3.15l-0.17,0.0l-1.84,0.53l-0.1,0.53l3.97,2.97l0.15,1.77l0.16,4.14l0.19,0.27l3.21,1.22l1.94,1.03l0.44,-0.22l0.32,-1.94l-0.07,-0.25l-1.32,-1.52l1.25,-1.2l5.87,2.45l0.24,-0.01l2.11,-0.98l0.13,-0.42l-1.55,-2.75l5.52,-3.84l2.13,0.22l2.28,1.42l0.43,-0.12l1.46,-2.87l-0.04,-0.33l-1.97,-2.37l1.14,-2.38l-0.02,-0.3l-1.42,-2.07l6.15,1.22l1.14,1.92l-2.74,0.46l-0.25,0.3l0.02,2.36l0.12,0.24l1.97,1.44l0.25,0.05l3.87,-0.91l0.22,-0.23l0.58,-2.55l5.09,-1.98l8.67,-3.69l1.22,0.14l-2.06,2.2l0.18,0.5l3.11,0.45l0.23,-0.07l1.71,-1.41l4.59,-0.12l0.12,-0.03l3.53,-1.72l2.7,2.48l0.42,-0.01l2.85,-2.88l-0.0,-0.43l-2.42,-2.35l1.0,-1.13l7.2,1.31l3.42,1.36l9.06,4.97l0.39,-0.08l1.67,-2.27l-0.04,-0.4l-2.46,-2.23l-0.06,-0.82l-0.26,-0.27l-2.64,-0.38l0.69,-1.76l0.0,-0.22l-1.32,-3.47l-0.07,-1.27l4.52,-4.09l0.08,-0.11l1.6,-4.18l1.67,-0.84l6.33,1.2l0.46,2.31l-2.31,3.67l0.05,0.38l1.49,1.41l0.77,3.04l-0.56,6.05l0.09,0.24l2.62,2.54l-0.99,2.65l-4.87,5.96l0.17,0.48l2.86,0.61l0.31,-0.13l0.94,-1.42l2.67,-1.04l0.18,-0.19l0.64,-2.01l2.11,-1.98l0.05,-0.37l-1.38,-2.32l1.11,-2.74l-0.24,-0.41l-2.53,-0.33l-0.53,-2.16l1.96,-4.42l-0.05,-0.32l-3.03,-3.48l4.21,-2.94l0.12,-0.3l-0.52,-3.04l0.72,-0.06l1.18,2.35l-0.97,4.39l0.2,0.35l2.68,0.84l0.37,-0.38l-1.05,-3.07l3.89,-1.71l5.05,-0.24l4.55,2.62l0.36,-0.05l0.05,-0.36l-2.19,-3.84l-0.23,-4.78l4.07,-0.92l5.98,0.21l5.47,-0.64l0.2,-0.48l-1.88,-2.37l2.65,-2.99l2.75,-0.13l0.12,-0.03l4.82,-2.48l6.56,-0.67l0.23,-0.14l0.76,-1.27l6.33,-0.46l1.97,1.11l0.28,0.01l5.55,-2.71l4.53,0.08l0.29,-0.21l0.67,-2.18l2.29,-2.15l5.75,-2.13l3.48,1.4l-2.7,1.03l-0.19,0.31l0.26,0.26l5.47,0.78ZM871.83,65.73l0.25,-0.15l1.99,0.01l3.3,1.2l-0.08,0.22l-2.41,1.03l-5.73,0.49l-0.31,-1.0l2.99,-1.8ZM797.64,48.44l-2.22,1.51l-3.85,-0.43l-4.35,-1.85l0.42,-1.13l4.42,0.72l5.59,1.17ZM783.82,46.06l-1.71,3.25l-9.05,-0.14l-4.11,1.15l-4.64,-3.04l1.21,-3.13l3.11,-0.91l6.53,0.22l8.66,2.59ZM780.37,145.71l2.28,5.23l-3.09,-0.89l-0.37,0.19l-1.54,4.65l0.04,0.27l2.38,3.17l-0.05,1.4l-1.41,-1.41l-0.46,0.04l-1.23,1.81l-0.33,-1.86l0.28,-3.1l-0.28,-3.41l0.58,-2.46l0.11,-4.39l-0.03,-0.13l-1.44,-3.2l0.21,-4.39l2.19,-1.49l0.09,-0.41l-0.81,-1.3l0.48,-0.21l0.56,1.94l0.86,3.23l-0.05,3.36l1.03,3.35ZM780.16,57.18l-3.4,0.03l-5.06,-0.53l1.97,-1.59l2.95,-0.42l3.35,1.75l0.18,0.77ZM683.84,31.18l-13.29,1.97l4.16,-6.56l1.88,-0.58l1.77,0.34l6.08,3.02l-0.6,1.8ZM670.94,28.02l-5.18,0.65l-6.89,-1.58l-4.03,-2.07l-1.88,-3.98l-0.18,-0.16l-2.8,-0.93l5.91,-3.62l5.25,-1.29l4.73,2.88l5.63,5.44l-0.57,4.66ZM564.37,68.98l-0.85,0.23l-7.93,-0.57l-0.6,-1.84l-0.21,-0.2l-4.34,-1.18l-0.3,-2.08l2.34,-0.92l0.19,-0.29l-0.08,-2.43l4.85,-4.0l-0.12,-0.52l-1.68,-0.43l5.47,-3.94l0.11,-0.33l-0.6,-2.02l5.36,-2.55l8.22,-3.27l8.29,-0.96l4.34,-1.94l4.67,-0.65l1.45,1.72l-1.43,1.37l-8.8,2.52l-7.65,2.42l-7.92,4.84l-3.73,4.75l-3.92,4.58l-0.07,0.23l0.51,3.88l0.11,0.2l4.32,3.39ZM548.86,18.57l-3.28,0.75l-2.25,0.44l-0.22,0.19l-0.3,0.81l-2.67,0.86l-2.27,-1.14l1.2,-1.51l-0.23,-0.49l-3.14,-0.1l2.48,-0.54l3.55,-0.07l0.44,1.36l0.49,0.12l1.4,-1.35l2.2,-0.9l3.13,1.08l-0.54,0.49ZM477.5,133.25l-4.21,0.05l-2.69,-0.34l0.39,-1.03l3.24,-1.06l2.51,0.58l0.85,0.43l-0.2,0.71l-0.0,0.15l0.12,0.52Z", "name": "Russia"}, "RW": {"path": "M497.03,288.12l0.78,1.11l-0.12,1.19l-0.49,0.21l-1.25,-0.15l-0.3,0.16l-0.67,1.24l-1.01,-0.13l0.16,-0.92l0.22,-0.12l0.15,-0.24l0.09,-1.37l0.49,-0.48l0.42,0.18l0.25,-0.01l1.26,-0.65Z", "name": "Rwanda"}, "RS": {"path": "M469.75,168.65l0.21,-0.21l0.36,-1.44l-0.08,-0.29l-1.06,-1.03l0.54,-1.16l-0.28,-0.43l-0.26,0.0l0.55,-0.67l-0.01,-0.39l-0.77,-0.86l-0.45,-0.89l1.56,-0.67l1.39,0.12l1.22,1.1l0.26,0.91l0.16,0.19l1.38,0.66l0.17,1.12l0.14,0.21l1.46,0.9l0.35,-0.03l0.62,-0.54l0.09,0.06l-0.28,0.25l-0.03,0.42l0.29,0.34l-0.44,0.5l-0.07,0.26l0.22,1.12l0.07,0.14l1.02,1.1l-0.81,0.84l-0.42,0.96l0.04,0.3l0.12,0.15l-0.15,0.16l-1.04,0.04l-0.39,0.08l0.33,-0.81l-0.29,-0.41l-0.21,0.01l-0.39,-0.45l-0.13,-0.09l-0.32,-0.11l-0.27,-0.4l-0.14,-0.11l-0.4,-0.16l-0.31,-0.37l-0.34,-0.09l-0.45,0.17l-0.18,0.18l-0.29,0.84l-0.96,-0.65l-0.81,-0.33l-0.32,-0.37l-0.22,-0.18Z", "name": "Republic of Serbia"}, "LT": {"path": "M478.13,133.31l-0.14,-0.63l0.25,-0.88l-0.15,-0.35l-1.17,-0.58l-2.43,-0.57l-0.45,-2.51l2.58,-0.97l4.14,0.22l2.3,-0.32l0.26,0.54l0.22,0.17l1.26,0.22l2.25,1.6l0.19,1.23l-1.87,1.01l-0.14,0.18l-0.54,1.83l-2.54,1.21l-2.18,-0.02l-0.52,-0.91l-0.18,-0.14l-1.11,-0.32Z", "name": "Lithuania"}, "LU": {"path": "M435.95,147.99l0.33,0.49l-0.11,1.07l-0.39,0.04l-0.29,-0.15l0.21,-1.4l0.25,-0.05Z", "name": "Luxembourg"}, "LR": {"path": "M401.37,273.67l-0.32,0.01l-2.48,-1.15l-2.24,-1.89l-2.14,-1.38l-1.47,-1.42l0.44,-0.59l0.05,-0.13l0.12,-0.65l1.07,-1.3l1.08,-1.09l0.52,-0.07l0.43,-0.18l0.84,1.24l-0.15,0.89l0.07,0.25l0.49,0.54l0.22,0.1l0.71,0.01l0.27,-0.16l0.42,-0.83l0.19,0.02l-0.06,0.52l0.23,1.12l-0.5,1.03l0.06,0.35l0.73,0.69l0.14,0.08l0.71,0.15l0.92,0.91l0.06,0.76l-0.17,0.22l-0.06,0.15l-0.17,1.8Z", "name": "Liberia"}, "RO": {"path": "M477.94,155.19l1.02,-0.64l1.49,0.33l1.52,0.01l1.09,0.73l0.32,0.01l0.81,-0.46l1.8,-0.3l0.18,-0.1l0.54,-0.64l0.86,0.0l0.64,0.26l0.71,0.87l0.8,1.35l1.39,1.81l0.07,1.25l-0.26,1.3l0.01,0.15l0.45,1.42l0.15,0.18l1.12,0.57l0.25,0.01l1.05,-0.45l0.86,0.4l0.03,0.43l-0.92,0.51l-0.63,-0.24l-0.4,0.22l-0.64,3.41l-1.12,-0.24l-1.78,-1.09l-0.23,-0.04l-2.95,0.71l-1.25,0.77l-3.55,-0.16l-1.89,-0.47l-0.14,-0.0l-0.75,0.17l-0.61,-1.07l-0.3,-0.36l0.36,-0.32l-0.04,-0.48l-0.62,-0.38l-0.36,0.03l-0.62,0.54l-1.15,-0.71l-0.18,-1.14l-0.17,-0.22l-1.4,-0.67l-0.24,-0.86l-0.09,-0.14l-0.96,-0.87l1.49,-0.44l0.16,-0.11l1.51,-2.14l1.15,-2.09l1.44,-0.63Z", "name": "Romania"}, "GW": {"path": "M383.03,256.73l-1.12,-0.88l-0.14,-0.06l-0.94,-0.15l-0.43,-0.54l0.01,-0.27l-0.13,-0.26l-0.68,-0.48l-0.05,-0.16l0.99,-0.31l0.77,0.08l0.15,-0.02l0.61,-0.26l4.25,0.1l-0.02,0.44l-0.19,0.18l-0.08,0.29l0.17,0.66l-0.17,0.14l-0.44,0.0l-0.16,0.05l-0.57,0.37l-0.66,-0.04l-0.24,0.1l-0.92,1.03Z", "name": "Guinea Bissau"}, "GT": {"path": "M195.13,249.89l-1.05,-0.35l-1.5,-0.04l-1.06,-0.47l-1.19,-0.93l0.04,-0.53l0.27,-0.55l-0.03,-0.31l-0.24,-0.32l1.02,-1.77l3.04,-0.01l0.3,-0.28l0.06,-0.88l-0.19,-0.3l-0.3,-0.11l-0.23,-0.45l-0.11,-0.12l-0.9,-0.58l-0.35,-0.33l0.37,-0.0l0.3,-0.3l0.0,-1.15l4.05,0.02l-0.02,1.74l-0.2,2.89l0.3,0.32l0.67,-0.0l0.75,0.42l0.4,-0.11l-0.62,0.53l-1.17,0.7l-0.13,0.16l-0.18,0.49l0.0,0.21l0.14,0.34l-0.35,0.44l-0.49,0.13l-0.2,0.41l0.03,0.06l-0.27,0.16l-0.86,0.64l-0.12,0.22ZM199.35,245.38l0.07,-0.13l0.05,0.02l-0.13,0.11Z", "name": "Guatemala"}, "GR": {"path": "M487.2,174.55l-0.64,1.54l-0.43,0.24l-1.41,-0.08l-1.28,-0.28l-0.14,0.0l-3.03,0.77l-0.13,0.51l1.39,1.34l-0.78,0.29l-1.2,0.0l-1.23,-1.42l-0.47,0.02l-0.47,0.65l-0.04,0.27l0.56,1.76l0.06,0.11l1.02,1.12l-0.66,0.45l-0.04,0.46l1.39,1.35l1.15,0.79l0.02,1.06l-1.91,-0.63l-0.36,0.42l0.56,1.12l-1.2,0.23l-0.22,0.4l0.8,2.14l-1.15,0.02l-1.89,-1.15l-0.89,-2.19l-0.43,-1.91l-0.05,-0.11l-0.98,-1.35l-1.24,-1.62l-0.13,-0.63l1.07,-1.32l0.06,-0.14l0.13,-0.81l0.68,-0.36l0.16,-0.25l0.03,-0.54l1.4,-0.23l0.12,-0.05l0.87,-0.6l1.26,0.05l0.25,-0.11l0.34,-0.43l0.33,-0.07l1.81,0.08l0.13,-0.02l1.87,-0.77l1.64,0.97l0.19,0.04l2.28,-0.28l0.26,-0.29l0.02,-0.95l0.56,0.36ZM480.44,192.0l1.05,0.74l0.01,0.0l-1.26,-0.23l0.2,-0.51ZM481.76,192.79l1.86,-0.15l1.53,0.17l-0.02,0.19l0.34,0.3l-2.28,0.15l0.01,-0.13l-0.25,-0.31l-1.19,-0.22ZM485.65,193.28l0.65,-0.16l-0.05,0.12l-0.6,0.04Z", "name": "Greece"}, "GQ": {"path": "M444.81,282.04l-0.21,-0.17l0.74,-2.4l3.56,0.05l0.02,2.42l-3.34,-0.02l-0.76,0.13Z", "name": "Equatorial Guinea"}, "GY": {"path": "M271.34,264.25l1.43,0.81l1.44,1.53l0.06,1.19l0.28,0.28l0.84,0.05l2.13,1.92l-0.34,1.93l-1.37,0.59l-0.17,0.34l0.12,0.51l-0.43,1.21l0.03,0.26l1.11,1.82l0.26,0.14l0.56,0.0l0.32,1.29l1.25,1.78l-0.08,0.01l-1.34,-0.21l-0.24,0.06l-0.78,0.64l-1.06,0.41l-0.76,0.1l-0.22,0.15l-0.18,0.32l-0.95,-0.1l-1.38,-1.05l-0.19,-1.13l-0.6,-1.18l0.37,-1.96l0.65,-0.83l0.03,-0.32l-0.57,-1.17l-0.15,-0.14l-0.62,-0.27l0.25,-0.85l-0.08,-0.3l-0.58,-0.58l-0.24,-0.09l-1.15,0.1l-1.41,-1.58l0.48,-0.49l0.09,-0.22l-0.04,-0.92l1.31,-0.34l0.73,-0.52l0.04,-0.44l-0.75,-0.82l0.16,-0.66l1.74,-1.3Z", "name": "Guyana"}, "GE": {"path": "M525.41,174.19l0.26,-0.88l-0.0,-0.17l-0.63,-2.06l-0.1,-0.15l-1.45,-1.12l-0.11,-0.05l-1.31,-0.33l-0.66,-0.69l1.97,0.48l3.65,0.49l3.3,1.41l0.39,0.5l0.33,0.1l1.43,-0.45l2.14,0.58l0.7,1.14l0.13,0.12l1.06,0.47l-0.18,0.11l-0.08,0.43l1.08,1.41l-0.06,0.06l-1.16,-0.15l-1.82,-0.84l-0.31,0.04l-0.55,0.44l-3.29,0.44l-2.32,-1.41l-0.17,-0.04l-2.25,0.12Z", "name": "Georgia"}, "GB": {"path": "M412.82,118.6l-2.31,3.4l-0.0,0.33l0.31,0.13l2.52,-0.49l2.34,0.02l-0.56,2.51l-2.22,3.13l0.22,0.47l2.43,0.21l2.35,4.35l0.17,0.14l1.58,0.51l1.49,3.78l0.73,1.37l0.2,0.15l2.76,0.59l-0.25,1.75l-1.18,0.91l-0.08,0.39l0.87,1.49l-1.96,1.51l-3.31,-0.02l-4.15,0.88l-1.07,-0.59l-0.35,0.04l-1.55,1.44l-2.17,-0.35l-0.22,0.05l-1.61,1.15l-0.78,-0.38l3.31,-3.12l2.18,-0.7l0.21,-0.31l-0.26,-0.27l-3.78,-0.54l-0.48,-0.9l2.3,-0.92l0.13,-0.46l-1.29,-1.71l0.39,-1.83l3.46,0.29l0.32,-0.24l0.37,-1.99l-0.06,-0.24l-1.71,-2.17l-0.18,-0.11l-2.91,-0.58l-0.43,-0.68l0.82,-1.4l-0.03,-0.35l-0.82,-0.97l-0.46,0.01l-0.85,1.05l-0.11,-2.6l-0.05,-0.16l-1.19,-1.7l0.86,-3.53l1.81,-2.75l1.88,0.26l2.38,-0.24ZM406.39,132.84l-1.09,1.92l-1.65,-0.62l-1.26,0.02l0.41,-1.46l0.0,-0.16l-0.42,-1.51l1.62,-0.11l2.39,1.92Z", "name": "United Kingdom"}, "GA": {"path": "M448.76,294.47l-2.38,-2.34l-1.63,-2.04l-1.46,-2.48l0.06,-0.66l0.54,-0.81l0.61,-1.82l0.46,-1.69l0.63,-0.11l3.62,0.03l0.3,-0.3l-0.02,-2.75l0.88,-0.12l1.47,0.32l0.13,0.0l1.39,-0.3l-0.13,0.87l0.03,0.19l0.7,1.29l0.3,0.16l1.74,-0.19l0.36,0.29l-1.01,2.7l0.05,0.29l1.13,1.42l0.25,1.82l-0.3,1.56l-0.64,0.99l-1.93,-0.09l-1.26,-1.13l-0.5,0.17l-0.16,0.91l-1.48,0.27l-0.12,0.05l-0.86,0.63l-0.08,0.39l0.81,1.42l-1.48,1.08Z", "name": "Gabon"}, "GN": {"path": "M399.83,265.31l-0.69,-0.06l-0.3,0.16l-0.43,0.85l-0.39,-0.01l-0.3,-0.33l0.14,-0.87l-0.05,-0.22l-1.05,-1.54l-0.37,-0.11l-0.61,0.27l-0.84,0.12l0.02,-0.54l-0.04,-0.17l-0.35,-0.57l0.07,-0.63l-0.03,-0.17l-0.57,-1.11l-0.7,-0.9l-0.24,-0.12l-2.0,-0.0l-0.19,0.07l-0.51,0.42l-0.6,0.05l-0.21,0.11l-0.43,0.55l-0.3,0.7l-1.04,0.86l-0.91,-1.24l-1.0,-1.02l-0.69,-0.37l-0.52,-0.42l-0.3,-1.11l-0.37,-0.56l-0.1,-0.1l-0.4,-0.23l0.77,-0.85l0.62,0.04l0.18,-0.05l0.58,-0.38l0.46,-0.0l0.19,-0.07l0.39,-0.34l0.1,-0.3l-0.17,-0.67l0.15,-0.14l0.09,-0.2l0.03,-0.57l0.87,0.02l1.76,0.6l0.13,0.01l0.55,-0.06l0.22,-0.13l0.08,-0.12l1.18,0.17l0.17,-0.02l0.09,0.56l0.3,0.25l0.4,-0.0l0.14,-0.03l0.56,-0.29l0.23,0.05l0.63,0.59l0.15,0.07l1.07,0.2l0.24,-0.06l0.65,-0.52l0.77,-0.32l0.55,-0.32l0.3,0.04l0.44,0.45l0.34,0.74l0.84,0.87l-0.35,0.45l-0.06,0.15l-0.1,0.82l0.42,0.31l0.35,-0.16l0.05,0.04l-0.1,0.59l0.09,0.27l0.42,0.4l-0.06,0.02l-0.18,0.21l-0.2,0.86l0.03,0.21l0.56,1.02l0.52,1.71l-0.65,0.21l-0.15,0.12l-0.24,0.35l-0.03,0.28l0.16,0.41l-0.1,0.76l-0.12,0.0Z", "name": "Guinea"}, "GM": {"path": "M379.18,251.48l0.15,-0.55l2.51,-0.07l0.21,-0.09l0.48,-0.52l0.58,-0.03l0.91,0.58l0.16,0.05l0.78,0.01l0.14,-0.03l0.59,-0.31l0.16,0.24l-0.71,0.38l-0.94,-0.04l-1.02,-0.51l-0.3,0.01l-0.86,0.55l-0.37,0.02l-0.14,0.04l-0.53,0.31l-1.81,-0.04Z", "name": "Gambia"}, "GL": {"path": "M304.13,6.6l8.19,-3.63l8.72,0.28l0.19,-0.06l3.12,-2.28l8.75,-0.61l19.94,0.8l14.93,4.75l-3.92,2.01l-9.52,0.27l-13.48,0.6l-0.27,0.2l0.09,0.33l1.26,1.09l0.22,0.07l8.81,-0.67l7.49,2.07l0.19,-0.01l4.68,-1.78l1.76,1.84l-2.59,3.26l-0.01,0.36l0.34,0.11l6.35,-2.2l12.09,-2.32l7.31,1.14l1.17,2.13l-9.9,4.05l-1.43,1.32l-7.91,0.98l-0.26,0.31l0.29,0.29l5.25,0.25l-2.63,3.72l-2.02,3.61l-0.04,0.15l0.08,6.05l0.07,0.19l2.61,3.0l-3.4,0.2l-4.12,1.66l-0.04,0.54l4.5,2.67l0.53,3.9l-2.39,0.42l-0.19,0.48l2.91,3.83l-5.0,0.32l-0.27,0.22l0.12,0.33l2.69,1.84l-0.65,1.35l-3.36,0.71l-3.46,0.01l-0.21,0.51l3.05,3.15l0.02,1.53l-4.54,-1.79l-0.32,0.06l-1.29,1.26l0.11,0.5l3.33,1.15l3.17,2.74l0.85,3.29l-4.0,0.78l-1.83,-1.66l-3.1,-2.64l-0.36,-0.02l-0.13,0.33l0.8,2.92l-2.76,2.26l-0.09,0.33l0.28,0.2l6.59,0.19l2.47,0.18l-5.86,3.38l-6.76,3.43l-7.26,1.48l-2.73,0.02l-0.16,0.05l-2.67,1.72l-3.44,4.42l-5.28,2.86l-1.73,0.18l-3.33,1.01l-3.59,0.96l-0.15,0.1l-2.15,2.52l-0.07,0.19l-0.03,2.76l-1.21,2.49l-4.03,3.1l-0.1,0.33l0.98,2.94l-2.31,6.57l-3.21,0.21l-3.6,-3.0l-0.19,-0.07l-4.9,-0.02l-2.29,-1.97l-1.69,-3.78l-4.31,-4.86l-1.23,-2.52l-0.34,-3.58l-0.08,-0.17l-3.35,-3.67l0.85,-2.92l-0.09,-0.31l-1.5,-1.34l2.33,-4.7l3.67,-1.57l0.15,-0.13l1.02,-1.93l0.52,-3.47l-0.44,-0.31l-2.85,1.57l-1.33,0.64l-2.12,0.59l-2.81,-1.32l-0.15,-2.79l0.88,-2.17l2.09,-0.06l5.07,1.2l0.34,-0.17l-0.11,-0.37l-4.3,-2.9l-2.24,-1.58l-0.25,-0.05l-2.38,0.62l-1.7,-0.93l2.62,-4.1l-0.03,-0.36l-1.51,-1.75l-1.97,-3.3l-3.01,-5.21l-0.1,-0.11l-3.04,-1.85l0.03,-1.94l-0.18,-0.28l-6.82,-3.01l-5.35,-0.38l-6.69,0.21l-6.03,0.37l-2.81,-1.59l-3.84,-2.9l5.94,-1.5l5.01,-0.28l0.28,-0.29l-0.26,-0.31l-10.68,-1.38l-5.38,-2.1l0.27,-1.68l9.3,-2.6l9.18,-2.68l0.19,-0.16l0.97,-2.05l-0.18,-0.42l-6.29,-1.91l1.81,-1.9l8.58,-4.05l3.6,-0.63l0.23,-0.4l-0.92,-2.37l5.59,-1.5l7.66,-0.95l7.58,-0.05l2.65,1.84l0.31,0.02l6.52,-3.29l5.85,2.24l3.55,0.49l5.17,1.95l0.38,-0.16l-0.13,-0.39l-5.77,-3.16l0.29,-2.26Z", "name": "Greenland"}, "KW": {"path": "M540.87,207.81l0.41,0.94l-0.18,0.51l0.0,0.21l0.65,1.66l-1.15,0.05l-0.54,-1.12l-0.24,-0.17l-1.73,-0.2l1.44,-2.06l1.33,0.18Z", "name": "Kuwait"}, "GH": {"path": "M423.16,269.88l-3.58,1.34l-1.41,0.87l-2.13,0.69l-1.91,-0.61l0.09,-0.75l-0.03,-0.17l-1.04,-2.07l0.62,-2.7l1.04,-2.08l0.03,-0.19l-1.0,-5.46l0.05,-1.12l4.04,-0.11l1.08,0.18l0.18,-0.03l0.72,-0.36l0.75,0.13l-0.11,0.48l0.06,0.26l0.98,1.22l-0.0,1.77l0.24,1.99l0.05,0.13l0.55,0.81l-0.52,2.14l0.19,1.37l0.69,1.66l0.38,0.62Z", "name": "Ghana"}, "OM": {"path": "M568.16,231.0l-0.08,0.1l-0.84,1.61l-0.93,-0.11l-0.27,0.11l-0.58,0.73l-0.4,1.32l-0.01,0.14l0.29,1.61l-0.07,0.09l-1.0,-0.01l-0.16,0.04l-1.56,0.97l-0.14,0.2l-0.23,1.17l-0.41,0.4l-1.44,-0.02l-0.17,0.05l-0.98,0.65l-0.13,0.25l0.01,0.87l-0.97,0.57l-1.27,-0.22l-0.19,0.03l-1.63,0.84l-0.88,0.11l-2.55,-5.57l7.2,-2.49l0.19,-0.19l1.67,-5.23l-0.03,-0.25l-1.1,-1.78l0.05,-0.89l0.68,-1.03l0.05,-0.16l0.01,-0.89l0.96,-0.44l0.07,-0.5l-0.32,-0.26l0.16,-1.31l0.85,-0.01l1.03,1.67l0.09,0.09l1.4,0.96l0.11,0.05l1.82,0.34l1.37,0.45l1.75,2.32l0.13,0.1l0.7,0.26l-0.0,0.3l-1.25,2.19l-1.01,0.8ZM561.88,218.47l-0.01,0.02l-0.15,-0.29l0.3,-0.38l-0.14,0.65Z", "name": "Oman"}, "_3": {"path": "M543.2,261.06l-1.07,1.46l-1.65,1.99l-1.91,0.01l-8.08,-2.95l-0.89,-0.84l-0.9,-1.19l-0.81,-1.23l0.44,-0.73l0.76,-1.12l0.49,0.28l0.52,1.05l1.13,1.06l0.2,0.08l1.24,0.01l2.42,-0.65l2.77,-0.31l2.17,-0.78l1.31,-0.19l0.84,-0.43l1.03,-0.06l-0.01,4.54Z", "name": "Somaliland"}, "_2": {"path": "M384.23,230.37l0.07,-0.06l0.28,-0.89l0.99,-1.13l0.07,-0.13l0.8,-3.54l3.4,-2.8l0.09,-0.13l0.76,-2.17l0.07,5.5l-2.07,0.21l-0.24,0.17l-0.61,1.36l-0.02,0.16l0.43,3.46l-4.01,-0.01ZM391.82,218.2l0.07,-0.06l0.75,-1.93l1.86,-0.25l0.94,0.34l1.14,0.0l0.18,-0.06l0.73,-0.56l1.41,-0.08l-0.0,2.72l-7.08,-0.12Z", "name": "Western Sahara"}, "_1": {"path": "M472.71,172.84l-0.07,-0.43l-0.16,-0.22l-0.53,-0.27l-0.38,-0.58l0.3,-0.43l0.51,-0.19l0.18,-0.18l0.3,-0.87l0.12,-0.04l0.22,0.26l0.12,0.09l0.38,0.15l0.28,0.41l0.15,0.12l0.34,0.12l0.43,0.5l0.15,0.07l-0.12,0.3l-0.27,0.32l-0.03,0.18l-0.31,0.06l-1.48,0.47l-0.15,0.17Z", "name": "Kosovo"}, "_0": {"path": "M503.54,192.92l0.09,-0.17l0.41,0.01l-0.08,0.01l-0.42,0.15ZM504.23,192.76l1.02,0.02l0.4,-0.13l-0.09,0.29l0.03,0.08l-0.35,0.16l-0.24,-0.04l-0.06,-0.1l-0.18,-0.17l-0.19,-0.08l-0.33,-0.02Z", "name": "Northern Cyprus"}, "JO": {"path": "M510.26,200.93l0.28,-0.57l2.53,1.0l0.27,-0.02l4.57,-2.77l0.84,2.84l-0.28,0.25l-4.95,1.37l-0.14,0.49l2.24,2.48l-0.5,0.28l-0.13,0.14l-0.35,0.78l-1.76,0.35l-0.2,0.14l-0.57,0.94l-0.94,0.73l-2.45,-0.38l-0.03,-0.12l1.23,-4.32l-0.04,-1.1l0.34,-0.75l0.03,-0.12l0.0,-1.63Z", "name": "Jordan"}, "HR": {"path": "M455.49,162.73l1.53,0.09l0.24,-0.1l0.29,-0.34l0.64,0.38l0.14,0.04l0.98,0.06l0.32,-0.3l-0.01,-0.66l0.67,-0.25l0.19,-0.22l0.21,-1.11l1.72,-0.72l0.65,0.32l1.94,1.37l2.07,0.6l0.22,-0.02l0.67,-0.33l0.47,0.94l0.67,0.76l-0.63,0.77l-0.91,-0.55l-0.16,-0.04l-1.69,0.04l-2.2,-0.51l-1.17,0.07l-0.21,0.11l-0.36,0.42l-0.67,-0.53l-0.46,0.12l-0.52,1.29l0.05,0.31l1.21,1.42l0.58,0.99l1.15,1.14l0.95,0.68l0.92,1.23l0.1,0.09l1.75,0.91l-1.87,-0.89l-1.5,-1.11l-2.23,-0.88l-1.77,-1.9l0.12,-0.06l0.1,-0.47l-1.07,-1.22l-0.04,-0.94l-0.21,-0.27l-1.61,-0.49l-0.35,0.14l-0.53,0.93l-0.41,-0.57l0.04,-0.73Z", "name": "Croatia"}, "HT": {"path": "M237.82,234.68l1.35,0.1l1.95,0.37l0.18,1.15l-0.16,0.83l-0.51,0.37l-0.06,0.44l0.57,0.68l-0.02,0.22l-1.31,-0.35l-1.26,0.17l-1.49,-0.18l-0.15,0.02l-1.03,0.43l-1.02,-0.61l0.09,-0.36l2.04,0.32l1.9,0.21l0.19,-0.05l0.9,-0.58l0.05,-0.47l-1.05,-1.03l0.02,-0.86l-0.23,-0.3l-1.13,-0.29l0.18,-0.23Z", "name": "Haiti"}, "HU": {"path": "M461.96,157.92l0.68,-1.66l-0.03,-0.29l-0.15,-0.22l0.84,-0.0l0.3,-0.26l0.12,-0.84l0.88,0.57l0.98,0.38l0.16,0.01l2.1,-0.39l0.23,-0.21l0.14,-0.45l0.88,-0.1l1.06,-0.43l0.13,0.1l0.28,0.04l1.18,-0.4l0.14,-0.1l0.52,-0.67l0.63,-0.15l2.6,0.95l0.26,-0.03l0.38,-0.23l1.12,0.7l0.1,0.49l-1.31,0.57l-0.14,0.13l-1.18,2.14l-1.44,2.04l-1.85,0.55l-1.51,-0.13l-0.14,0.02l-1.92,0.82l-0.85,0.42l-1.91,-0.55l-1.83,-1.31l-0.74,-0.37l-0.44,-0.97l-0.26,-0.18Z", "name": "Hungary"}, "HN": {"path": "M202.48,251.87l-0.33,-0.62l-0.18,-0.14l-0.5,-0.15l0.13,-0.76l-0.11,-0.28l-0.34,-0.28l-0.6,-0.23l-0.18,-0.01l-0.81,0.22l-0.16,-0.24l-0.72,-0.39l-0.51,-0.48l-0.12,-0.07l-0.31,-0.09l0.24,-0.3l0.04,-0.3l-0.16,-0.4l0.1,-0.28l1.14,-0.69l1.0,-0.86l0.09,0.04l0.3,-0.05l0.47,-0.39l0.49,-0.03l0.14,0.13l0.29,0.06l0.31,-0.1l1.16,0.22l1.24,-0.08l0.81,-0.28l0.29,-0.25l0.63,0.1l0.69,0.18l0.65,-0.06l0.49,-0.2l1.04,0.32l0.38,0.06l0.7,0.44l0.71,0.56l0.92,0.41l0.1,0.11l-0.11,-0.01l-0.23,0.09l-0.3,0.3l-0.76,0.29l-0.58,0.0l-0.15,0.04l-0.45,0.26l-0.31,-0.07l-0.37,-0.34l-0.28,-0.07l-0.26,0.07l-0.18,0.15l-0.23,0.43l-0.04,-0.0l-0.33,0.28l-0.03,0.4l-0.76,0.61l-0.45,0.3l-0.15,0.16l-0.51,-0.36l-0.41,0.06l-0.45,0.56l-0.41,-0.01l-0.59,0.06l-0.27,0.31l0.04,0.96l-0.07,0.0l-0.25,0.16l-0.24,0.45l-0.42,0.06Z", "name": "Honduras"}, "PR": {"path": "M254.95,238.31l1.15,0.21l0.2,0.23l-0.36,0.36l-1.76,-0.01l-1.2,0.07l-0.09,-0.69l0.17,-0.18l1.89,0.01Z", "name": "Puerto Rico"}, "PS": {"path": "M509.66,201.06l-0.0,1.44l-0.29,0.63l-0.59,0.19l0.02,-0.11l0.52,-0.31l-0.02,-0.53l-0.41,-0.2l0.36,-1.28l0.41,0.17Z", "name": "West Bank"}, "PT": {"path": "M398.65,173.6l0.75,-0.63l0.7,-0.3l0.51,1.2l0.28,0.18l1.48,-0.0l0.2,-0.08l0.33,-0.3l1.16,0.08l0.52,1.11l-0.95,0.66l-0.13,0.24l-0.03,2.2l-0.33,0.35l-0.08,0.18l-0.08,1.17l-0.86,0.19l-0.2,0.44l0.93,1.64l-0.64,1.79l0.07,0.31l0.72,0.72l-0.24,0.56l-0.9,1.05l-0.07,0.26l0.17,0.77l-0.73,0.54l-1.18,-0.36l-0.16,-0.0l-0.85,0.21l0.31,-1.81l-0.23,-1.87l-0.23,-0.25l-0.99,-0.24l-0.49,-0.91l0.18,-1.72l0.93,-0.99l0.08,-0.16l0.17,-1.17l0.52,-1.76l-0.04,-1.36l-0.51,-1.14l-0.09,-0.8Z", "name": "Portugal"}, "PY": {"path": "M264.33,341.43l0.93,-2.96l0.07,-1.42l1.1,-2.1l4.19,-0.73l2.22,0.04l2.12,1.21l0.07,0.76l0.7,1.38l-0.16,3.48l0.24,0.31l2.64,0.5l0.19,-0.03l0.9,-0.45l1.47,0.62l0.38,0.64l0.23,2.35l0.3,1.07l0.25,0.21l0.93,0.12l0.16,-0.02l0.8,-0.37l0.61,0.33l-0.0,1.25l-0.33,1.53l-0.5,1.57l-0.39,2.26l-2.14,1.94l-1.85,0.4l-2.74,-0.4l-2.13,-0.62l2.26,-3.75l0.03,-0.24l-0.36,-1.18l-0.17,-0.19l-2.55,-1.03l-3.04,-1.95l-2.07,-0.43l-4.4,-4.12Z", "name": "Paraguay"}, "PA": {"path": "M213.65,263.79l0.18,-0.43l0.02,-0.18l-0.06,-0.28l0.23,-0.18l-0.01,-0.48l-0.4,-0.29l-0.01,-0.62l0.57,-0.13l0.68,0.69l-0.04,0.39l0.26,0.33l1.0,0.11l0.27,-0.1l0.49,0.44l0.24,0.07l1.34,-0.22l1.04,-0.62l1.49,-0.5l0.86,-0.73l0.99,0.11l0.18,0.28l1.35,0.08l1.02,0.4l0.78,0.72l0.71,0.53l-0.1,0.12l-0.05,0.3l0.53,1.34l-0.28,0.44l-0.6,-0.13l-0.36,0.22l-0.2,0.76l-0.41,-0.36l-0.44,-1.12l0.49,-0.53l-0.14,-0.49l-0.51,-0.14l-0.41,-0.72l-0.11,-0.11l-1.25,-0.7l-0.19,-0.04l-1.1,0.16l-0.22,0.15l-0.47,0.81l-0.9,0.56l-0.49,0.08l-0.22,0.17l-0.25,0.52l0.05,0.32l0.93,1.07l-0.41,0.21l-0.29,0.3l-0.81,0.09l-0.36,-1.26l-0.53,-0.1l-0.21,0.28l-0.5,-0.09l-0.44,-0.88l-0.22,-0.16l-0.99,-0.16l-0.61,-0.28l-0.13,-0.03l-1.0,0.0Z", "name": "Panama"}, "PG": {"path": "M808.4,298.6l0.62,0.46l1.19,1.56l1.04,0.77l-0.18,0.37l-0.42,0.15l-0.92,-0.82l-1.05,-1.53l-0.27,-0.96ZM804.09,296.06l-0.3,0.26l-0.36,-1.11l-0.66,-1.06l-2.55,-1.89l-1.42,-0.59l0.17,-0.15l1.16,0.6l0.85,0.55l1.01,0.58l0.97,1.02l0.9,0.76l0.24,1.03ZM796.71,297.99l0.15,0.82l0.34,0.24l1.43,-0.19l0.19,-0.11l0.68,-0.82l1.36,-0.87l0.13,-0.31l-0.21,-1.13l1.04,-0.03l0.3,0.25l-0.04,1.17l-0.74,1.34l-1.17,0.18l-0.22,0.15l-0.35,0.62l-2.51,1.13l-1.21,-0.0l-1.99,-0.71l-1.19,-0.58l0.07,-0.28l1.98,0.32l1.46,-0.2l0.24,-0.21l0.25,-0.79ZM789.24,303.52l0.11,0.15l2.19,1.62l1.6,2.62l0.27,0.14l1.09,-0.06l-0.07,0.77l0.23,0.32l1.23,0.27l-0.14,0.09l0.05,0.53l2.39,0.95l-0.11,0.28l-1.33,0.14l-0.51,-0.55l-0.18,-0.09l-4.59,-0.65l-1.87,-1.55l-1.38,-1.35l-1.28,-2.17l-0.16,-0.13l-3.27,-1.1l-0.19,0.0l-2.12,0.72l-1.58,0.85l-0.15,0.31l0.28,1.63l-1.65,0.73l-1.37,-0.4l-2.3,-0.09l-0.08,-15.65l3.95,1.57l4.58,1.42l1.67,1.25l1.32,1.19l0.36,1.39l0.19,0.21l4.06,1.51l0.39,0.85l-1.9,0.22l-0.25,0.39l0.55,1.68Z", "name": "Papua New Guinea"}, "PE": {"path": "M246.44,329.21l-0.63,1.25l-1.05,0.54l-2.25,-1.33l-0.19,-0.93l-0.16,-0.21l-4.95,-2.58l-4.46,-2.79l-1.87,-1.52l-0.94,-1.91l0.33,-0.6l-0.01,-0.31l-2.11,-3.33l-2.46,-4.66l-2.36,-5.02l-1.04,-1.18l-0.77,-1.81l-0.08,-0.11l-1.95,-1.64l-1.54,-0.88l0.61,-0.85l0.02,-0.31l-1.15,-2.27l0.69,-1.56l1.59,-1.26l0.12,0.42l-0.56,0.47l-0.11,0.25l0.07,0.92l0.36,0.27l0.97,-0.19l0.85,0.23l0.99,1.19l0.41,0.05l1.42,-1.03l0.11,-0.16l0.46,-1.64l1.45,-2.06l2.92,-0.96l0.11,-0.07l2.73,-2.62l0.84,-1.72l0.02,-0.18l-0.3,-1.65l0.28,-0.1l1.49,1.06l0.77,1.14l0.1,0.09l1.08,0.6l1.43,2.55l0.21,0.15l1.86,0.31l0.18,-0.03l1.25,-0.6l0.77,0.37l0.17,0.03l1.4,-0.2l1.57,0.96l-1.45,2.29l0.23,0.46l0.63,0.05l0.66,0.7l-1.51,-0.08l-0.24,0.1l-0.27,0.31l-1.96,0.46l-2.95,1.74l-0.14,0.21l-0.17,1.1l-0.6,0.82l-0.05,0.23l0.21,1.13l-1.31,0.63l-0.17,0.27l0.0,0.91l-0.53,0.37l-0.1,0.37l1.04,2.27l1.31,1.46l-0.44,0.9l0.24,0.43l1.52,0.13l0.87,1.23l0.24,0.13l2.21,0.07l0.18,-0.06l1.55,-1.13l-0.14,3.22l0.23,0.3l1.14,0.29l0.16,-0.0l1.18,-0.36l1.97,3.71l-0.45,0.71l-0.04,0.14l-0.12,1.8l-0.05,2.07l-0.92,1.2l-0.03,0.31l0.38,0.8l-0.48,0.72l-0.02,0.3l1.01,2.02l-1.5,2.64Z", "name": "Peru"}, "PK": {"path": "M609.08,187.76l1.66,1.21l0.71,2.11l0.2,0.19l3.62,1.01l-1.98,1.95l-2.65,0.4l-3.75,-0.68l-0.26,0.08l-1.23,1.22l-0.07,0.31l0.89,2.46l0.88,1.92l0.1,0.12l1.67,1.14l-1.8,1.35l-0.12,0.25l0.04,1.85l-2.35,2.67l-1.59,2.79l-2.5,2.72l-2.76,-0.2l-0.24,0.09l-2.76,2.83l0.04,0.45l1.54,1.13l0.27,1.94l0.09,0.17l1.34,1.29l0.4,1.83l-5.14,-0.01l-0.22,0.09l-1.53,1.63l-1.52,-0.56l-0.76,-1.88l-1.93,-2.03l-0.25,-0.09l-4.6,0.5l-4.05,0.05l-3.1,0.33l0.77,-2.53l3.48,-1.33l0.19,-0.33l-0.21,-1.24l-0.19,-0.23l-1.01,-0.37l-0.06,-2.18l-0.17,-0.26l-2.32,-1.16l-0.96,-1.57l-0.56,-0.65l3.16,1.05l0.14,0.01l2.45,-0.4l1.44,0.33l0.3,-0.1l0.4,-0.47l1.58,0.22l0.14,-0.01l3.25,-1.14l0.2,-0.27l0.08,-2.23l1.23,-1.38l1.73,0.0l0.28,-0.2l0.22,-0.61l1.68,-0.32l0.86,0.24l0.27,-0.05l0.98,-0.78l0.11,-0.26l-0.13,-1.57l0.96,-1.52l1.51,-0.67l0.14,-0.41l-0.74,-1.4l1.86,0.07l0.26,-0.13l0.69,-1.01l0.05,-0.2l-0.09,-0.94l1.14,-1.09l0.09,-0.28l-0.29,-1.41l-0.51,-1.07l1.23,-1.05l2.6,-0.58l2.86,-0.33l1.33,-0.54l1.3,-0.29Z", "name": "Pakistan"}, "PH": {"path": "M737.11,263.82l0.25,1.66l0.14,1.34l-0.54,1.46l-0.64,-1.79l-0.5,-0.1l-1.17,1.28l-0.05,0.32l0.74,1.71l-0.49,0.81l-2.6,-1.28l-0.61,-1.57l0.68,-1.07l-0.07,-0.4l-1.59,-1.19l-0.42,0.06l-0.69,0.91l-1.01,-0.08l-0.21,0.06l-1.58,1.2l-0.17,-0.3l0.87,-1.88l1.48,-0.66l1.18,-0.81l0.71,0.92l0.34,0.1l1.9,-0.69l0.18,-0.18l0.34,-0.94l1.57,-0.06l0.29,-0.32l-0.1,-1.38l1.41,0.83l0.36,2.06ZM734.94,254.42l0.56,2.24l-1.41,-0.49l-0.4,0.3l0.07,0.94l0.51,1.3l-0.54,0.26l-0.08,-1.34l-0.25,-0.28l-0.56,-0.1l-0.23,-0.91l1.03,0.14l0.34,-0.31l-0.03,-0.96l-0.06,-0.18l-1.14,-1.44l1.62,0.04l0.57,0.78ZM724.68,238.33l1.48,0.71l0.33,-0.04l0.44,-0.38l0.05,0.13l-0.37,0.97l0.01,0.23l0.81,1.75l-0.59,1.92l-1.37,0.79l-0.14,0.2l-0.39,2.07l0.01,0.14l0.56,2.04l0.23,0.21l1.33,0.28l0.14,-0.0l1.0,-0.27l2.82,1.28l-0.2,1.16l0.12,0.29l0.66,0.5l-0.13,0.56l-1.54,-0.99l-0.89,-1.29l-0.49,0.0l-0.44,0.65l-1.34,-1.28l-0.26,-0.08l-2.18,0.36l-0.96,-0.44l0.09,-0.72l0.69,-0.57l-0.01,-0.47l-0.75,-0.59l-0.47,0.14l-0.15,0.43l-0.86,-1.02l-0.34,-1.02l-0.07,-1.74l0.49,0.41l0.49,-0.21l0.26,-3.99l0.73,-2.1l1.23,0.0ZM731.12,258.92l-0.82,0.75l-0.83,1.64l-0.52,0.5l-1.17,-1.33l0.36,-0.47l0.62,-0.7l0.07,-0.15l0.24,-1.35l0.73,-0.08l-0.31,1.29l0.16,0.34l0.37,-0.09l1.21,-1.6l-0.12,1.24ZM726.66,255.58l0.85,0.45l0.14,0.03l1.28,-0.0l-0.03,0.62l-1.04,0.96l-1.15,0.55l-0.05,-0.71l0.17,-1.26l-0.01,-0.13l-0.16,-0.51ZM724.92,252.06l-0.45,1.5l-0.7,-0.83l-0.95,-1.43l1.44,0.06l0.67,0.7ZM717.48,261.28l-1.87,1.35l0.21,-0.3l1.81,-1.57l1.5,-1.75l0.97,-1.84l0.23,1.08l-1.56,1.33l-1.29,1.7Z", "name": "Philippines"}, "PL": {"path": "M458.8,144.25l-0.96,-1.98l0.18,-1.06l-0.01,-0.15l-0.62,-1.8l-0.82,-1.11l0.56,-0.73l0.05,-0.28l-0.51,-1.51l1.48,-0.87l3.88,-1.58l3.06,-1.14l2.23,0.52l0.15,0.66l0.29,0.23l2.4,0.04l3.11,0.39l4.56,-0.05l1.12,0.32l0.51,0.89l0.1,1.45l0.03,0.12l0.66,1.23l-0.01,1.08l-1.33,0.61l-0.14,0.41l0.74,1.5l0.07,1.53l1.22,2.79l-0.19,0.66l-1.09,0.33l-0.14,0.09l-2.27,2.72l-0.04,0.31l0.35,0.8l-2.22,-1.16l-0.21,-0.02l-1.72,0.44l-1.1,-0.31l-0.21,0.02l-1.3,0.61l-1.11,-1.02l-0.32,-0.05l-0.81,0.35l-1.15,-1.61l-0.21,-0.12l-1.65,-0.17l-0.19,-0.82l-0.23,-0.23l-1.72,-0.37l-0.34,0.17l-0.25,0.56l-0.88,-0.44l0.12,-0.69l-0.25,-0.35l-1.78,-0.27l-1.08,-0.97Z", "name": "Poland"}, "ZM": {"path": "M502.81,308.32l1.09,1.04l0.58,1.94l-0.39,0.66l-0.5,2.05l-0.0,0.14l0.45,1.95l-0.69,0.77l-0.06,0.11l-0.76,2.37l0.15,0.36l0.62,0.31l-6.85,1.9l-0.22,0.33l0.2,1.54l-1.62,0.3l-0.12,0.05l-1.43,1.02l-0.11,0.15l-0.25,0.73l-0.73,0.17l-0.14,0.08l-2.18,2.12l-1.33,1.6l-0.65,0.05l-0.83,-0.29l-2.75,-0.28l-0.24,-0.1l-0.15,-0.27l-0.99,-0.58l-0.12,-0.04l-1.73,-0.14l-1.88,0.54l-1.5,-1.48l-1.61,-2.01l0.11,-7.73l4.92,0.03l0.29,-0.37l-0.19,-0.79l0.34,-0.86l0.0,-0.21l-0.41,-1.11l0.26,-1.14l-0.01,-0.16l-0.12,-0.36l0.18,0.01l0.1,0.56l0.31,0.25l1.14,-0.06l1.44,0.21l0.76,1.05l0.19,0.12l2.01,0.35l0.19,-0.03l1.24,-0.65l0.44,1.03l0.22,0.18l1.81,0.34l0.85,0.99l1.02,1.39l0.24,0.12l1.92,0.02l0.3,-0.32l-0.21,-2.74l-0.47,-0.23l-0.53,0.36l-1.58,-0.89l-0.51,-0.34l0.29,-2.36l0.44,-2.99l-0.03,-0.18l-0.5,-0.99l0.61,-1.38l0.53,-0.24l3.26,-0.41l0.89,0.23l1.01,0.62l1.04,0.44l1.6,0.43l1.35,0.72Z", "name": "Zambia"}, "EE": {"path": "M482.19,120.88l0.23,-1.68l-0.43,-0.31l-0.75,0.37l-1.34,-1.1l-0.18,-1.75l2.92,-0.95l3.07,-0.53l2.66,0.6l2.48,-0.1l0.18,0.31l-1.65,1.96l-0.06,0.26l0.71,3.25l-0.88,0.94l-1.85,-0.01l-2.08,-1.3l-1.14,-0.47l-0.2,-0.01l-1.69,0.51Z", "name": "Estonia"}, "EG": {"path": "M508.07,208.8l-0.66,1.06l-0.53,2.03l-0.64,1.32l-0.32,0.26l-1.74,-1.85l-1.77,-3.86l-0.48,-0.09l-0.26,0.25l-0.07,0.32l1.04,2.88l1.55,2.76l1.89,4.18l0.94,1.48l0.83,1.54l2.08,2.73l-0.3,0.28l-0.1,0.23l0.08,1.72l0.11,0.22l2.91,2.37l-28.78,0.0l0.0,-19.06l-0.73,-2.2l0.61,-1.59l0.0,-0.2l-0.34,-1.04l0.73,-1.08l3.13,-0.04l2.36,0.72l2.48,0.81l1.15,0.43l0.23,-0.01l1.93,-0.87l1.02,-0.78l2.08,-0.21l1.59,0.31l0.62,1.24l0.52,0.03l0.46,-0.71l1.86,0.59l1.95,0.16l0.17,-0.04l0.92,-0.52l1.48,4.24Z", "name": "Egypt"}, "ZA": {"path": "M467.06,373.27l-0.13,-0.29l0.01,-1.58l-0.02,-0.12l-0.71,-1.64l0.59,-0.37l0.14,-0.26l-0.07,-2.13l-0.05,-0.15l-1.63,-2.58l-1.25,-2.31l-1.71,-3.37l0.88,-0.98l0.7,0.52l0.39,1.08l0.23,0.19l1.1,0.19l1.55,0.51l0.14,0.01l1.35,-0.2l0.11,-0.04l2.24,-1.39l0.14,-0.25l0.0,-9.4l0.16,0.09l1.39,2.38l-0.22,1.53l0.04,0.19l0.56,0.94l0.3,0.14l1.79,-0.27l0.16,-0.08l1.23,-1.18l1.17,-0.79l0.1,-0.12l0.57,-1.19l1.02,-0.52l0.9,0.28l1.16,0.73l0.14,0.05l2.04,0.13l0.13,-0.02l1.6,-0.62l0.18,-0.19l0.63,-1.93l1.18,-0.19l0.19,-0.12l0.78,-1.05l0.81,-1.71l2.18,-1.91l3.44,-1.88l0.89,0.02l1.17,0.43l0.21,-0.0l0.76,-0.29l1.07,0.21l1.15,3.55l0.63,1.82l-0.44,2.9l0.1,0.52l-0.74,-0.29l-0.18,-0.01l-0.72,0.19l-0.21,0.2l-0.22,0.74l-0.66,0.97l-0.05,0.18l0.02,0.93l0.09,0.21l1.49,1.46l0.27,0.08l1.47,-0.29l0.22,-0.18l0.43,-1.01l1.29,0.02l-0.51,1.63l-0.29,2.2l-0.59,1.12l-2.2,1.78l-1.06,1.39l-0.72,1.44l-1.39,1.93l-2.81,2.84l-1.75,1.65l-1.85,1.24l-2.55,1.06l-1.23,0.14l-0.24,0.18l-0.22,0.54l-1.27,-0.35l-0.2,0.01l-1.15,0.5l-2.62,-0.52l-0.12,0.0l-1.46,0.33l-0.98,-0.14l-0.16,0.02l-2.55,1.1l-2.11,0.44l-1.59,1.07l-0.93,0.06l-0.97,-0.92l-0.19,-0.08l-0.72,-0.04l-1.0,-1.16l-0.25,0.05ZM493.72,359.24l-1.12,-0.86l-0.31,-0.03l-1.23,0.59l-1.36,1.07l-1.39,1.78l0.01,0.38l1.88,2.11l0.31,0.09l0.9,-0.27l0.18,-0.15l0.4,-0.77l1.28,-0.39l0.18,-0.16l0.42,-0.88l0.76,-1.32l-0.05,-0.37l-0.87,-0.82Z", "name": "South Africa"}, "EC": {"path": "M220.2,293.48l1.25,-1.76l0.02,-0.31l-0.54,-1.09l-0.5,-0.06l-0.78,0.94l-1.03,-0.75l0.33,-0.46l0.05,-0.23l-0.38,-2.04l0.66,-0.28l0.17,-0.19l0.45,-1.52l0.93,-1.58l0.04,-0.2l-0.13,-0.78l1.19,-0.47l1.57,-0.91l2.35,1.34l0.17,0.04l0.28,-0.02l0.52,0.91l0.21,0.15l2.12,0.35l0.2,-0.03l0.55,-0.31l1.08,0.73l0.97,0.54l0.31,1.67l-0.71,1.49l-2.64,2.54l-2.95,0.97l-0.15,0.11l-1.53,2.18l-0.49,1.68l-1.1,0.8l-0.87,-1.05l-0.15,-0.1l-1.01,-0.27l-0.13,-0.0l-0.7,0.14l-0.03,-0.43l0.6,-0.5l0.1,-0.31l-0.26,-0.91Z", "name": "Ecuador"}, "AL": {"path": "M470.27,171.7l0.38,0.19l0.45,-0.18l0.4,0.61l0.11,0.1l0.46,0.24l0.13,0.87l-0.3,0.95l-0.0,0.17l0.36,1.28l0.12,0.17l0.9,0.63l-0.03,0.44l-0.67,0.35l-0.16,0.22l-0.14,0.88l-0.96,1.18l-0.06,-0.03l-0.04,-0.48l-0.12,-0.22l-1.28,-0.92l-0.19,-1.25l0.2,-1.96l0.33,-0.89l-0.06,-0.3l-0.36,-0.41l-0.13,-0.75l0.66,-0.9Z", "name": "Albania"}, "AO": {"path": "M461.62,299.93l0.55,1.67l0.73,1.54l1.56,2.18l0.28,0.12l1.66,-0.2l0.81,-0.34l1.28,0.33l0.33,-0.14l0.39,-0.67l0.56,-1.3l1.37,-0.09l0.27,-0.21l0.07,-0.23l0.67,-0.01l-0.13,0.53l0.29,0.37l2.74,-0.02l0.04,1.29l0.03,0.13l0.46,0.87l-0.35,1.52l0.18,1.55l0.07,0.16l0.75,0.85l-0.13,2.89l0.41,0.29l0.56,-0.21l1.11,0.05l1.5,-0.37l0.9,0.12l0.18,0.53l-0.27,1.15l0.01,0.17l0.4,1.08l-0.33,0.85l-0.01,0.18l0.12,0.51l-4.83,-0.03l-0.3,0.3l-0.12,8.13l0.07,0.19l1.69,2.1l1.27,1.25l-4.03,0.92l-5.93,-0.36l-1.66,-1.19l-0.18,-0.06l-10.15,0.11l-0.34,0.13l-1.35,-1.05l-0.17,-0.06l-1.62,-0.08l-1.6,0.45l-0.88,0.36l-0.17,-1.2l0.34,-2.19l0.85,-2.32l0.14,-1.13l0.79,-2.24l0.57,-1.0l1.42,-1.64l0.82,-1.15l0.05,-0.13l0.26,-1.88l-0.13,-1.51l-0.07,-0.16l-0.72,-0.87l-1.23,-2.91l0.09,-0.37l0.73,-0.95l0.05,-0.27l-1.27,-4.12l-1.19,-1.54l0.1,-0.2l0.86,-0.28l0.78,0.03l0.83,-0.29l7.12,0.03ZM451.81,298.94l-0.17,0.07l-0.5,-1.42l0.85,-0.92l0.53,-0.29l0.48,0.44l-0.56,0.32l-0.1,0.1l-0.41,0.65l-0.05,0.14l-0.07,0.91Z", "name": "Angola"}, "KZ": {"path": "M598.42,172.08l-1.37,0.54l-3.3,2.09l-0.11,0.12l-1.01,1.97l-0.56,0.01l-0.6,-1.24l-0.26,-0.17l-2.95,-0.09l-0.46,-2.22l-0.29,-0.24l-0.91,-0.02l0.17,-2.72l-0.12,-0.26l-3.0,-2.22l-0.2,-0.06l-4.29,0.24l-2.8,0.42l-2.36,-2.7l-6.4,-3.65l-0.23,-0.03l-6.45,1.83l-0.22,0.29l0.1,10.94l-0.84,0.1l-1.65,-2.21l-0.11,-0.09l-1.69,-0.84l-0.2,-0.02l-2.84,0.63l-0.14,0.07l-0.71,0.64l-0.02,-0.11l0.57,-1.17l0.0,-0.26l-0.48,-1.05l-0.17,-0.16l-2.78,-0.99l-1.08,-2.62l-0.13,-0.15l-1.24,-0.7l-0.04,-0.48l2.07,0.25l0.34,-0.29l0.09,-2.03l1.84,-0.44l2.12,0.45l0.36,-0.25l0.45,-3.04l-0.45,-2.06l-0.31,-0.23l-2.44,0.15l-2.07,-0.75l-0.23,0.01l-2.88,1.38l-2.21,0.62l-0.96,-0.38l0.22,-1.39l-0.06,-0.23l-1.6,-2.12l-0.25,-0.12l-1.72,0.08l-1.87,-1.91l1.33,-2.24l-0.06,-0.38l-0.55,-0.5l1.72,-3.08l2.3,1.7l0.48,-0.2l0.29,-2.26l4.99,-3.48l3.76,-0.08l5.46,2.27l2.96,1.33l0.26,-0.01l2.59,-1.36l3.82,-0.06l3.13,1.67l0.38,-0.09l0.63,-0.85l3.36,0.14l0.29,-0.19l0.63,-1.57l-0.13,-0.37l-3.64,-2.05l2.0,-1.36l0.1,-0.38l-0.32,-0.62l2.09,-0.76l0.13,-0.47l-1.65,-2.13l0.89,-0.91l9.27,-1.18l0.13,-0.05l1.17,-0.82l6.2,-1.27l2.26,-1.43l4.19,0.7l0.74,3.39l0.38,0.22l2.52,-0.81l2.9,1.06l-0.18,1.63l0.32,0.33l2.52,-0.23l5.0,-2.58l0.03,0.39l3.16,2.62l5.57,8.48l0.49,0.02l1.18,-1.53l3.22,1.78l0.21,0.03l3.5,-0.83l1.21,0.52l1.16,1.82l0.15,0.12l1.67,0.61l1.01,1.32l0.28,0.11l3.04,-0.41l1.1,1.64l-1.68,1.89l-1.97,0.28l-0.26,0.29l-0.12,3.09l-1.2,1.23l-4.81,-1.01l-0.35,0.2l-1.77,5.51l-1.14,0.62l-4.92,1.23l-0.2,0.41l2.14,5.06l-1.45,0.67l-0.17,0.31l0.15,1.28l-1.05,-0.3l-1.21,-1.04l-0.17,-0.07l-3.73,-0.32l-4.15,-0.08l-0.92,0.31l-3.46,-1.24l-0.22,0.01l-1.42,0.63l-0.17,0.21l-0.32,1.49l-3.82,-0.97l-0.15,0.0l-1.65,0.43l-0.2,0.17l-0.51,1.21Z", "name": "Kazakhstan"}, "ET": {"path": "M516.0,247.63l1.21,0.92l0.3,0.04l1.3,-0.53l0.46,0.41l0.19,0.08l1.65,0.03l2.05,0.96l0.67,0.88l1.07,0.79l1.0,1.45l0.7,0.68l-0.72,0.92l-0.85,1.19l-0.04,0.25l0.19,0.67l0.04,0.74l0.29,0.28l1.4,0.04l0.55,-0.15l0.23,0.19l-0.41,0.67l0.01,0.32l0.92,1.39l0.93,1.23l0.99,0.94l0.1,0.06l8.19,2.99l1.51,0.01l-6.51,6.95l-3.14,0.11l-0.18,0.06l-2.15,1.71l-1.51,0.04l-0.22,0.1l-0.6,0.69l-1.46,-0.0l-0.93,-0.78l-0.32,-0.04l-2.29,1.05l-0.12,0.1l-0.64,0.9l-1.44,-0.17l-0.51,-0.26l-0.17,-0.03l-0.56,0.07l-0.68,-0.02l-3.1,-2.08l-0.17,-0.05l-1.62,0.0l-0.68,-0.65l0.0,-1.28l-0.21,-0.29l-1.19,-0.38l-1.42,-2.63l-0.13,-0.12l-1.05,-0.53l-0.46,-1.0l-1.27,-1.23l-0.17,-0.08l-1.08,-0.13l0.53,-0.9l1.17,-0.05l0.26,-0.17l0.37,-0.77l0.03,-0.14l-0.03,-2.23l0.7,-2.49l1.08,-0.65l0.14,-0.19l0.24,-1.0l1.03,-1.85l1.47,-1.22l0.09,-0.12l1.02,-2.51l0.36,-1.96l2.62,0.48l0.33,-0.18l0.63,-1.55Z", "name": "Ethiopia"}, "ZW": {"path": "M498.95,341.2l-1.16,-0.23l-0.16,0.01l-0.74,0.28l-1.11,-0.41l-1.02,-0.04l-1.52,-1.13l-0.12,-0.05l-1.79,-0.37l-0.65,-1.46l-0.01,-0.86l-0.22,-0.29l-0.99,-0.26l-2.74,-2.77l-0.77,-1.46l-0.52,-0.5l-0.72,-1.54l2.24,0.23l0.78,0.28l0.12,0.02l0.85,-0.06l0.21,-0.11l1.38,-1.66l2.11,-2.05l0.81,-0.18l0.22,-0.2l0.27,-0.8l1.29,-0.93l1.53,-0.28l0.11,0.66l0.3,0.25l2.02,-0.05l1.04,0.48l0.5,0.59l0.18,0.1l1.13,0.18l1.11,0.7l0.01,3.06l-0.49,1.82l-0.11,1.94l0.03,0.16l0.35,0.68l-0.24,1.3l-0.27,0.17l-0.12,0.15l-0.64,1.83l-2.49,2.8Z", "name": "Zimbabwe"}, "ES": {"path": "M398.67,172.8l0.09,-1.45l-0.06,-0.2l-0.82,-1.05l3.16,-1.96l3.01,0.54l3.33,-0.02l2.64,0.52l2.14,-0.15l3.9,0.1l0.91,1.08l0.14,0.09l4.61,1.38l0.26,-0.04l0.77,-0.55l2.66,1.29l0.17,0.03l2.59,-0.35l0.1,1.28l-2.2,1.85l-3.13,0.62l-0.23,0.23l-0.21,0.92l-1.54,1.68l-0.97,2.4l0.02,0.26l0.85,1.46l-1.27,1.14l-0.09,0.14l-0.5,1.73l-1.73,0.53l-0.15,0.1l-1.68,2.1l-3.03,0.04l-2.38,-0.05l-0.17,0.05l-1.57,1.01l-0.9,1.01l-0.96,-0.19l-0.82,-0.86l-0.69,-1.6l-0.22,-0.18l-2.14,-0.41l-0.13,-0.62l0.83,-0.97l0.39,-0.86l-0.06,-0.33l-0.73,-0.73l0.63,-1.74l-0.02,-0.25l-0.8,-1.41l0.69,-0.15l0.23,-0.27l0.09,-1.29l0.33,-0.36l0.08,-0.2l0.03,-2.16l1.03,-0.72l0.1,-0.37l-0.7,-1.5l-0.25,-0.17l-1.46,-0.11l-0.22,0.07l-0.34,0.3l-1.17,0.0l-0.55,-1.29l-0.39,-0.16l-1.02,0.44l-0.45,0.36Z", "name": "Spain"}, "ER": {"path": "M527.15,253.05l-0.77,-0.74l-1.01,-1.47l-1.14,-0.86l-0.62,-0.84l-0.11,-0.09l-2.18,-1.02l-0.12,-0.03l-1.61,-0.03l-0.52,-0.46l-0.31,-0.05l-1.31,0.54l-1.38,-1.06l-0.46,0.12l-0.69,1.68l-2.49,-0.46l-0.2,-0.76l1.06,-3.69l0.24,-1.65l0.66,-0.66l1.76,-0.4l0.16,-0.1l0.97,-1.13l1.24,2.55l0.68,2.34l0.09,0.14l1.4,1.27l3.39,2.4l1.37,1.43l2.14,2.34l0.94,0.6l-0.32,0.26l-0.85,-0.17Z", "name": "Eritrea"}, "ME": {"path": "M469.05,172.9l-0.57,-0.8l-0.1,-0.09l-0.82,-0.46l0.16,-0.33l0.35,-1.57l0.72,-0.62l0.27,-0.16l0.48,0.38l0.35,0.4l0.12,0.08l0.79,0.32l0.66,0.43l-0.43,0.62l-0.28,0.11l-0.07,-0.25l-0.53,-0.1l-1.09,1.49l-0.05,0.23l0.06,0.32Z", "name": "Montenegro"}, "MD": {"path": "M488.2,153.75l0.14,-0.11l1.49,-0.28l1.75,0.95l1.06,0.14l0.92,0.7l-0.15,0.9l0.15,0.31l0.8,0.46l0.33,1.2l0.09,0.14l0.72,0.66l-0.11,0.28l0.1,0.33l-0.06,0.02l-1.25,-0.08l-0.17,-0.29l-0.39,-0.12l-0.52,0.25l-0.16,0.36l0.13,0.42l-0.6,0.88l-0.43,1.03l-0.22,0.12l-0.32,-1.0l0.25,-1.34l-0.08,-1.38l-0.06,-0.17l-1.43,-1.87l-0.81,-1.36l-0.78,-0.95l-0.12,-0.09l-0.29,-0.12Z", "name": "Moldova"}, "MG": {"path": "M544.77,316.45l0.64,1.04l0.6,1.62l0.4,3.04l0.63,1.21l-0.22,1.07l-0.15,0.26l-0.59,-1.05l-0.52,-0.01l-0.47,0.76l-0.04,0.23l0.46,1.84l-0.19,0.92l-0.61,0.53l-0.1,0.21l-0.16,2.15l-0.97,2.98l-1.24,3.59l-1.55,4.97l-0.96,3.67l-1.08,2.93l-1.94,0.61l-2.05,1.06l-3.2,-1.53l-0.62,-1.26l-0.18,-2.39l-0.87,-2.07l-0.22,-1.8l0.4,-1.69l1.01,-0.4l0.19,-0.28l0.01,-0.79l1.15,-1.91l0.04,-0.11l0.23,-1.66l-0.03,-0.17l-0.57,-1.21l-0.46,-1.58l-0.19,-2.25l0.82,-1.36l0.33,-1.51l1.11,-0.1l1.4,-0.53l0.9,-0.45l1.03,-0.03l0.21,-0.09l1.41,-1.45l2.12,-1.65l0.75,-1.29l0.03,-0.24l-0.17,-0.56l0.53,0.15l0.32,-0.1l1.38,-1.77l0.06,-0.18l0.04,-1.44l0.54,-0.74l0.62,0.77Z", "name": "Madagascar"}, "MA": {"path": "M378.66,230.13l0.07,-0.75l0.93,-0.72l0.82,-1.37l0.04,-0.21l-0.14,-0.8l0.8,-1.74l1.33,-1.61l0.79,-0.4l0.14,-0.15l0.66,-1.55l0.08,-1.46l0.83,-1.52l1.6,-0.94l0.11,-0.11l1.56,-2.71l1.2,-0.99l2.24,-0.29l0.17,-0.08l1.95,-1.83l1.3,-0.77l2.09,-2.28l0.07,-0.26l-0.61,-3.34l0.92,-2.3l0.33,-1.44l1.52,-1.79l2.48,-1.27l1.86,-1.16l0.1,-0.11l1.67,-2.93l0.72,-1.59l1.54,0.01l1.43,1.14l0.21,0.06l2.33,-0.19l2.55,0.62l0.97,0.03l0.83,1.6l0.15,1.71l0.86,2.96l0.09,0.14l0.5,0.45l-0.31,0.73l-3.11,0.44l-0.16,0.07l-1.07,0.97l-1.36,0.23l-0.25,0.28l-0.1,1.85l-2.74,1.02l-0.14,0.11l-0.9,1.3l-1.93,0.69l-2.56,0.44l-4.04,2.01l-0.17,0.27l0.02,2.91l-0.08,0.0l-0.3,0.31l0.05,1.15l-1.25,0.07l-0.16,0.06l-0.73,0.55l-0.98,0.0l-0.85,-0.33l-0.15,-0.02l-2.11,0.29l-0.24,0.19l-0.76,1.95l-0.63,0.16l-0.21,0.19l-1.15,3.29l-3.42,2.81l-0.1,0.17l-0.81,3.57l-0.98,1.12l-0.3,0.85l-5.13,0.19Z", "name": "Morocco"}, "UZ": {"path": "M587.83,186.48l0.06,-1.46l-0.19,-0.29l-3.31,-1.24l-2.57,-1.4l-1.63,-1.38l-2.79,-1.98l-1.2,-2.98l-0.12,-0.14l-0.84,-0.54l-0.18,-0.05l-2.61,0.13l-0.76,-0.48l-0.25,-2.25l-0.17,-0.24l-3.37,-1.6l-0.32,0.04l-2.08,1.73l-2.11,1.02l-0.16,0.35l0.31,1.14l-2.14,0.03l-0.09,-10.68l6.1,-1.74l6.25,3.57l2.36,2.72l0.27,0.1l2.92,-0.44l4.17,-0.23l2.78,2.06l-0.18,2.87l0.29,0.32l0.98,0.02l0.46,2.22l0.28,0.24l3.0,0.09l0.61,1.25l0.28,0.17l0.93,-0.02l0.26,-0.16l1.06,-2.06l3.21,-2.03l1.3,-0.5l0.19,0.08l-1.75,1.62l0.05,0.48l1.85,1.12l0.27,0.02l1.65,-0.69l2.4,1.27l-2.69,1.79l-1.79,-0.27l-0.89,0.06l-0.22,-0.52l0.48,-1.26l-0.34,-0.4l-3.35,0.69l-0.22,0.18l-0.78,1.87l-1.07,1.47l-1.93,-0.13l-0.29,0.16l-0.65,1.29l0.16,0.42l1.69,0.64l0.48,1.91l-1.25,2.6l-1.64,-0.53l-1.18,-0.03Z", "name": "Uzbekistan"}, "MM": {"path": "M670.1,233.39l-1.46,1.11l-1.68,0.11l-0.26,0.19l-1.1,2.7l-0.95,0.42l-0.14,0.42l1.21,2.27l1.61,1.92l0.94,1.55l-0.82,1.99l-0.77,0.42l-0.13,0.39l0.64,1.35l1.62,1.97l0.26,1.32l-0.04,1.15l0.02,0.13l0.92,2.18l-1.3,2.23l-0.79,1.69l-0.1,-0.77l0.74,-1.87l-0.02,-0.26l-0.8,-1.42l0.2,-2.68l-0.06,-0.2l-0.98,-1.27l-0.8,-2.98l-0.45,-3.22l-1.11,-2.22l-0.45,-0.1l-1.64,1.28l-2.74,1.76l-1.26,-0.2l-1.27,-0.49l0.79,-2.93l0.0,-0.14l-0.52,-2.42l-1.93,-2.97l0.26,-0.8l-0.22,-0.39l-1.37,-0.31l-1.65,-1.98l-0.12,-1.5l0.41,0.19l0.42,-0.26l0.05,-1.7l1.08,-0.54l0.16,-0.34l-0.24,-1.0l0.5,-0.79l0.05,-0.15l0.08,-2.35l1.58,0.49l0.36,-0.15l1.12,-2.19l0.15,-1.34l1.35,-2.18l0.04,-0.17l-0.07,-1.35l2.97,-1.71l1.67,0.45l0.38,-0.33l-0.18,-1.46l0.7,-0.4l0.15,-0.32l-0.13,-0.72l0.94,-0.13l0.74,1.41l0.11,0.12l0.95,0.56l0.07,1.89l-0.09,2.08l-2.28,2.15l-0.09,0.19l-0.3,3.15l0.35,0.32l2.37,-0.39l0.53,2.17l0.2,0.21l1.3,0.42l-0.63,1.9l0.14,0.36l1.86,0.99l1.1,0.49l0.24,0.0l1.45,-0.6l0.04,0.51l-2.01,1.6l-0.56,0.96l-1.34,0.56Z", "name": "Myanmar"}, "ML": {"path": "M390.79,248.2l0.67,-0.37l0.14,-0.18l0.36,-1.31l0.51,-0.04l1.68,0.69l0.21,0.0l1.34,-0.48l0.89,0.16l0.3,-0.13l0.29,-0.44l9.89,-0.04l0.29,-0.21l0.56,-1.8l-0.11,-0.33l-0.33,-0.24l-2.37,-22.1l3.41,-0.04l8.37,5.73l8.38,5.68l0.56,1.15l0.14,0.14l1.56,0.75l0.99,0.36l0.03,1.45l0.33,0.29l2.45,-0.22l0.01,5.52l-1.3,1.64l-0.06,0.15l-0.18,1.37l-1.99,0.36l-3.4,0.22l-0.19,0.09l-0.85,0.83l-1.48,0.09l-1.49,0.01l-0.54,-0.43l-0.26,-0.05l-1.38,0.36l-2.39,1.08l-0.13,0.12l-0.44,0.73l-1.88,1.11l-0.11,0.12l-0.3,0.57l-0.86,0.42l-1.1,-0.31l-0.28,0.07l-0.69,0.62l-0.09,0.16l-0.35,1.66l-1.93,2.04l-0.08,0.23l0.05,0.76l-0.63,0.99l-0.04,0.19l0.14,1.23l-0.81,0.29l-0.32,0.17l-0.27,-0.75l-0.39,-0.18l-0.65,0.26l-0.36,-0.04l-0.29,0.14l-0.37,0.6l-1.69,-0.02l-0.63,-0.34l-0.32,0.02l-0.12,0.09l-0.47,-0.45l0.1,-0.6l-0.09,-0.27l-0.31,-0.3l-0.33,-0.05l-0.05,0.02l0.02,-0.21l0.46,-0.59l-0.02,-0.39l-0.99,-1.02l-0.34,-0.74l-0.56,-0.56l-0.17,-0.09l-0.5,-0.07l-0.19,0.04l-0.58,0.35l-0.79,0.33l-0.65,0.51l-0.85,-0.16l-0.63,-0.59l-0.14,-0.07l-0.41,-0.08l-0.2,0.03l-0.59,0.31l-0.07,0.0l-0.1,-0.63l0.11,-0.85l-0.21,-0.98l-0.11,-0.17l-0.86,-0.66l-0.45,-1.34l-0.1,-1.36Z", "name": "Mali"}, "MN": {"path": "M641.06,150.59l2.41,-0.53l4.76,-2.8l3.67,-1.49l2.06,0.96l0.12,0.03l2.5,0.05l1.59,1.45l0.19,0.08l2.47,0.12l3.59,0.81l0.27,-0.07l2.43,-2.28l0.06,-0.36l-0.93,-1.77l2.33,-3.1l2.66,1.3l2.26,0.39l2.75,0.8l0.44,2.3l0.19,0.22l3.56,1.38l0.18,0.01l2.35,-0.6l3.1,-0.42l2.4,0.41l2.37,1.52l1.49,1.63l0.23,0.1l2.29,-0.03l3.13,0.52l0.15,-0.01l2.28,-0.79l3.27,-0.53l0.11,-0.04l3.56,-2.23l1.31,0.31l1.26,1.05l0.22,0.07l2.45,-0.22l-0.98,1.96l-1.77,3.21l-0.01,0.28l0.64,1.31l0.35,0.16l1.35,-0.38l2.4,0.48l0.22,-0.04l1.78,-1.09l1.82,0.92l2.11,2.07l-0.17,0.68l-1.79,-0.31l-3.74,0.45l-1.85,0.96l-1.78,2.01l-3.74,1.18l-2.46,1.61l-2.45,-0.6l-1.42,-0.28l-0.31,0.13l-1.31,1.99l0.0,0.33l0.78,1.15l0.3,0.74l-1.58,0.93l-1.75,1.59l-2.83,1.03l-3.77,0.12l-4.05,1.05l-2.81,1.54l-0.95,-0.8l-0.19,-0.07l-2.96,0.0l-3.64,-1.8l-2.55,-0.48l-3.38,0.41l-5.13,-0.67l-2.66,0.06l-1.35,-1.65l-1.12,-2.78l-0.21,-0.18l-1.5,-0.33l-2.98,-1.89l-0.12,-0.04l-3.37,-0.43l-2.84,-0.51l-0.75,-1.13l0.93,-3.54l-0.04,-0.24l-1.73,-2.55l-0.15,-0.12l-3.52,-1.18l-1.99,-1.61l-0.54,-1.85Z", "name": "Mongolia"}, "MK": {"path": "M472.73,173.87l0.08,0.01l0.32,-0.25l0.08,-0.44l1.29,-0.41l1.37,-0.28l1.03,-0.04l1.06,0.82l0.14,1.59l-0.22,0.04l-0.17,0.11l-0.32,0.4l-1.2,-0.05l-0.18,0.05l-0.9,0.61l-1.45,0.23l-0.85,-0.59l-0.3,-1.09l0.22,-0.71Z", "name": "Macedonia"}, "MW": {"path": "M507.18,313.84l-0.67,1.85l-0.01,0.16l0.7,3.31l0.31,0.24l0.75,-0.03l0.78,0.71l0.99,1.75l0.2,3.03l-0.91,0.45l-0.14,0.15l-0.59,1.38l-1.24,-1.21l-0.17,-1.62l0.49,-1.12l0.02,-0.16l-0.15,-1.03l-0.13,-0.21l-0.99,-0.65l-0.26,-0.03l-0.53,0.18l-1.31,-1.12l-1.15,-0.59l0.66,-2.06l0.75,-0.84l0.07,-0.27l-0.47,-2.04l0.48,-1.94l0.4,-0.65l0.03,-0.24l-0.64,-2.15l-0.08,-0.13l-0.44,-0.42l1.34,0.26l1.25,1.73l0.67,3.3Z", "name": "Malawi"}, "MR": {"path": "M390.54,247.66l-1.48,-1.58l-1.51,-1.88l-0.12,-0.09l-1.64,-0.67l-1.17,-0.74l-0.17,-0.05l-1.4,0.03l-0.12,0.03l-1.14,0.52l-1.15,-0.21l-0.26,0.08l-0.44,0.43l-0.11,-0.72l0.68,-1.29l0.31,-2.43l-0.28,-2.63l-0.29,-1.27l0.24,-1.24l-0.03,-0.2l-0.65,-1.24l-1.19,-1.05l0.32,-0.51l9.64,0.02l0.3,-0.34l-0.46,-3.71l0.51,-1.12l2.17,-0.22l0.27,-0.3l-0.08,-6.5l7.91,0.13l0.31,-0.3l0.01,-3.5l8.17,5.63l-2.89,0.04l-0.29,0.33l2.42,22.56l0.12,0.21l0.26,0.19l-0.43,1.38l-9.83,0.04l-0.25,0.13l-0.27,0.41l-0.77,-0.14l-0.15,0.01l-1.3,0.47l-1.64,-0.67l-0.14,-0.02l-0.79,0.06l-0.27,0.22l-0.39,1.39l-0.53,0.29Z", "name": "Mauritania"}, "UG": {"path": "M500.74,287.17l-2.84,-0.02l-0.92,0.32l-1.37,0.71l-0.29,-0.12l0.02,-1.6l0.54,-0.89l0.04,-0.13l0.14,-1.96l0.49,-1.09l0.91,-1.24l0.97,-0.68l0.8,-0.89l-0.13,-0.49l-0.79,-0.27l0.13,-2.55l0.78,-0.52l1.45,0.51l0.18,0.01l1.97,-0.57l1.72,0.01l0.18,-0.06l1.29,-0.97l0.98,1.44l0.29,1.24l1.05,2.75l-0.84,1.68l-1.94,2.66l-0.06,0.18l0.02,2.36l-4.8,0.18Z", "name": "Uganda"}, "MY": {"path": "M717.6,273.52l-1.51,0.7l-2.13,-0.41l-2.88,-0.0l-0.29,0.21l-0.84,2.77l-0.9,0.82l-0.08,0.12l-1.23,3.34l-1.81,0.47l-2.29,-0.68l-0.14,-0.01l-1.2,0.22l-0.14,0.07l-1.36,1.18l-1.47,-0.17l-0.12,0.01l-1.46,0.46l-1.51,-1.25l-0.24,-0.97l1.26,0.59l0.2,0.02l1.93,-0.47l0.22,-0.22l0.47,-1.98l0.9,-0.4l2.97,-0.54l0.17,-0.09l1.8,-1.98l1.02,-1.32l0.9,1.03l0.48,-0.04l0.43,-0.7l1.02,0.07l0.32,-0.27l0.25,-2.72l1.84,-1.67l1.23,-1.89l0.73,-0.01l1.12,1.11l0.1,0.99l0.18,0.24l1.66,0.71l1.85,0.67l-0.09,0.51l-1.45,0.11l-0.26,0.4l0.35,0.97ZM673.78,269.53l0.17,1.14l0.35,0.25l1.65,-0.3l0.18,-0.11l0.68,-0.86l0.31,0.13l1.41,1.45l0.99,1.59l0.13,1.57l-0.26,1.09l0.0,0.15l0.24,0.84l0.18,1.46l0.11,0.2l0.82,0.64l0.92,2.08l-0.03,0.52l-1.4,0.13l-2.29,-1.79l-2.86,-1.92l-0.27,-1.16l-0.07,-0.13l-1.39,-1.61l-0.33,-1.99l-0.05,-0.12l-0.84,-1.27l0.26,-1.72l-0.03,-0.18l-0.45,-0.87l0.13,-0.13l1.71,0.92Z", "name": "Malaysia"}, "MX": {"path": "M133.41,213.83l0.61,0.09l0.27,-0.09l0.93,-1.01l0.08,-0.18l0.09,-1.22l-0.09,-0.23l-1.93,-1.94l-1.46,-0.77l-2.96,-5.62l-0.86,-2.1l2.44,-0.18l2.68,-0.25l-0.03,0.08l0.17,0.4l3.79,1.35l5.81,1.97l6.96,-0.02l0.3,-0.3l0.0,-0.84l3.91,0.0l0.87,0.93l1.27,0.87l1.44,1.17l0.79,1.37l0.62,1.49l0.12,0.14l1.35,0.85l2.08,0.82l0.35,-0.1l1.49,-2.04l1.81,-0.05l1.63,1.01l1.21,1.8l0.86,1.58l1.47,1.55l0.53,1.82l0.73,1.32l0.14,0.13l1.98,0.84l1.78,0.59l0.61,-0.03l-0.78,1.89l-0.45,1.96l-0.19,3.58l-0.24,1.27l0.01,0.14l0.43,1.43l0.78,1.31l0.49,1.98l0.06,0.12l1.63,1.9l0.61,1.51l0.98,1.28l0.16,0.11l2.58,0.67l0.98,1.02l0.31,0.08l2.17,-0.71l1.91,-0.26l1.87,-0.47l1.67,-0.49l1.59,-1.06l0.11,-0.14l0.6,-1.52l0.22,-2.21l0.35,-0.62l1.58,-0.64l2.59,-0.59l2.18,0.09l1.43,-0.2l0.39,0.36l-0.07,1.02l-1.28,1.48l-0.65,1.68l0.07,0.32l0.33,0.32l-0.79,2.49l-0.28,-0.3l-0.24,-0.09l-1.0,0.08l-0.24,0.15l-0.74,1.28l-0.19,-0.13l-0.28,-0.03l-0.3,0.12l-0.19,0.29l0.0,0.06l-4.34,-0.02l-0.3,0.3l-0.0,1.16l-0.83,0.0l-0.28,0.19l0.08,0.33l0.93,0.86l0.9,0.58l0.24,0.48l0.16,0.15l0.2,0.08l-0.03,0.38l-2.94,0.01l-0.26,0.15l-1.21,2.09l0.02,0.33l0.25,0.33l-0.21,0.44l-0.04,0.22l-2.42,-2.35l-1.36,-0.87l-2.04,-0.67l-0.13,-0.01l-1.4,0.19l-2.07,0.98l-1.14,0.23l-1.72,-0.66l-1.85,-0.48l-2.31,-1.16l-1.92,-0.38l-2.79,-1.18l-2.04,-1.2l-0.6,-0.66l-0.19,-0.1l-1.37,-0.15l-2.45,-0.78l-1.07,-1.18l-2.63,-1.44l-1.2,-1.56l-0.44,-0.93l0.5,-0.15l0.2,-0.39l-0.2,-0.58l0.46,-0.55l0.07,-0.19l0.01,-0.91l-0.06,-0.18l-0.81,-1.13l-0.25,-1.08l-0.86,-1.36l-2.21,-2.63l-2.53,-2.09l-1.2,-1.63l-0.11,-0.09l-2.08,-1.06l-0.34,-0.48l0.35,-1.53l-0.16,-0.34l-1.24,-0.61l-1.39,-1.23l-0.6,-1.81l-0.24,-0.2l-1.25,-0.2l-1.38,-1.35l-1.11,-1.25l-0.1,-0.76l-0.05,-0.13l-1.33,-2.04l-0.85,-2.02l0.04,-0.99l-0.14,-0.27l-1.81,-1.1l-0.2,-0.04l-0.74,0.11l-1.34,-0.72l-0.42,0.16l-0.4,1.12l-0.0,0.19l0.41,1.3l0.24,2.04l0.06,0.15l0.88,1.16l1.84,1.86l0.4,0.61l0.12,0.1l0.27,0.14l0.29,0.82l0.31,0.2l0.2,-0.02l0.43,1.51l0.09,0.14l0.72,0.65l0.51,0.91l1.58,1.4l0.8,2.42l0.77,1.23l0.66,1.19l0.13,1.34l0.28,0.27l1.08,0.08l0.92,1.1l0.83,1.08l-0.03,0.24l-0.88,0.81l-0.13,-0.0l-0.59,-1.42l-0.07,-0.11l-1.67,-1.53l-1.81,-1.28l-1.15,-0.61l0.07,-1.85l-0.38,-1.45l-0.12,-0.17l-2.91,-2.03l-0.39,0.04l-0.11,0.11l-0.42,-0.46l-0.11,-0.08l-1.49,-0.63l-1.09,-1.16Z", "name": "Mexico"}, "VU": {"path": "M839.92,325.66l0.78,0.73l-0.18,0.07l-0.6,-0.8ZM839.13,322.74l0.27,1.36l-0.13,-0.06l-0.21,-0.02l-0.29,0.08l-0.22,-0.43l-0.03,-1.32l0.61,0.4Z", "name": "Vanuatu"}, "FR": {"path": "M444.58,172.63l-0.68,1.92l-0.72,-0.38l-0.51,-1.79l0.43,-0.95l1.15,-0.83l0.33,2.04ZM429.71,147.03l1.77,1.57l0.26,0.07l1.16,-0.23l2.12,1.44l0.56,0.28l0.16,0.03l0.61,-0.06l1.09,0.78l0.13,0.05l3.18,0.53l-1.09,1.94l-0.3,2.16l-0.48,0.38l-1.0,-0.26l-0.37,0.32l0.07,0.66l-1.73,1.68l-0.09,0.21l-0.04,1.42l0.41,0.29l0.96,-0.4l0.67,1.07l-0.09,0.78l0.04,0.19l0.61,0.97l-0.71,0.78l-0.07,0.28l0.65,2.39l0.21,0.21l1.09,0.31l-0.2,0.95l-2.08,1.58l-4.81,-0.8l-0.13,0.01l-3.65,0.99l-0.22,0.24l-0.25,1.6l-2.59,0.35l-2.74,-1.33l-0.31,0.03l-0.79,0.57l-4.38,-1.31l-0.79,-0.94l1.16,-1.64l0.05,-0.15l0.48,-6.17l-0.06,-0.21l-2.58,-3.3l-1.89,-1.65l-0.11,-0.06l-3.64,-1.17l-0.2,-1.88l2.92,-0.63l4.14,0.82l0.35,-0.36l-0.65,-3.0l1.77,1.05l0.27,0.02l5.83,-2.54l0.17,-0.19l0.71,-2.54l1.75,-0.53l0.27,0.88l0.27,0.21l1.04,0.05l1.08,1.23ZM289.1,278.45l-0.85,0.84l-0.88,0.13l-0.25,-0.51l-0.21,-0.16l-0.56,-0.1l-0.25,0.07l-0.63,0.55l-0.62,-0.29l0.5,-0.88l0.21,-1.11l0.42,-1.05l-0.03,-0.28l-0.93,-1.42l-0.18,-1.54l1.13,-1.87l2.42,0.78l2.55,2.04l0.33,0.81l-1.4,2.16l-0.77,1.84Z", "name": "France"}, "FI": {"path": "M492.26,76.42l-0.38,3.12l0.12,0.28l3.6,2.69l-2.14,2.96l-0.01,0.33l2.83,4.61l-1.61,3.36l0.03,0.31l2.15,2.87l-0.96,2.44l0.1,0.35l3.51,2.55l-0.81,1.72l-2.28,2.19l-5.28,4.79l-4.51,0.31l-4.39,1.37l-3.87,0.75l-1.34,-1.89l-0.11,-0.09l-2.23,-1.14l0.53,-3.54l-0.01,-0.14l-1.17,-3.37l1.12,-2.13l2.23,-2.44l5.69,-4.33l1.65,-0.84l0.16,-0.31l-0.26,-1.73l-0.15,-0.22l-3.4,-1.91l-0.77,-1.47l-0.07,-6.45l-0.12,-0.24l-3.91,-2.94l-3.0,-1.92l0.97,-0.76l2.6,2.17l0.21,0.07l3.2,-0.21l2.63,1.03l0.3,-0.05l2.39,-1.94l0.09,-0.13l1.18,-3.12l3.63,-1.42l2.87,1.59l-0.98,2.87Z", "name": "Finland"}, "FJ": {"path": "M869.98,327.07l-1.31,0.44l-0.14,-0.41l0.96,-0.41l0.85,-0.17l1.43,-0.78l-0.16,0.65l-1.64,0.67ZM867.58,329.12l0.54,0.47l-0.31,1.0l-1.32,0.3l-1.13,-0.26l-0.17,-0.78l0.72,-0.66l0.98,0.27l0.25,-0.04l0.43,-0.29Z", "name": "Fiji"}, "FK": {"path": "M268.15,427.89l2.6,-1.73l1.98,0.77l0.31,-0.05l1.32,-1.17l1.58,1.18l-0.54,0.84l-3.1,0.92l-1.0,-1.04l-0.39,-0.04l-1.9,1.35l-0.86,-1.04Z", "name": "Falkland Islands"}, "NI": {"path": "M202.1,252.6l0.23,-0.0l0.12,-0.11l0.68,-0.09l0.22,-0.15l0.23,-0.43l0.2,-0.01l0.28,-0.31l-0.04,-0.97l0.29,-0.03l0.5,0.02l0.25,-0.11l0.37,-0.46l0.51,0.35l0.4,-0.06l0.23,-0.28l0.45,-0.29l0.87,-0.7l0.11,-0.21l0.02,-0.26l0.23,-0.12l0.25,-0.48l0.29,0.27l0.14,0.07l0.5,0.12l0.22,-0.03l0.48,-0.28l0.66,-0.02l0.87,-0.33l0.36,-0.32l0.21,0.01l-0.11,0.48l0.0,0.14l0.22,0.8l-0.54,0.85l-0.27,1.03l-0.09,1.18l0.14,0.72l0.05,0.95l-0.24,0.15l-0.13,0.19l-0.23,1.09l0.0,0.14l0.14,0.53l-0.42,0.53l-0.06,0.24l0.12,0.69l0.08,0.15l0.18,0.19l-0.26,0.23l-0.49,-0.11l-0.35,-0.44l-0.16,-0.1l-0.79,-0.21l-0.23,0.03l-0.45,0.26l-1.51,-0.62l-0.31,0.05l-0.17,0.15l-1.81,-1.62l-0.6,-0.9l-1.04,-0.79l-0.77,-0.71Z", "name": "Nicaragua"}, "NL": {"path": "M436.22,136.65l1.82,0.08l0.36,0.89l-0.6,2.96l-0.53,1.06l-1.32,0.0l-0.3,0.34l0.35,2.89l-0.83,-0.47l-1.56,-1.43l-0.29,-0.07l-2.26,0.67l-1.02,-0.15l0.68,-0.48l0.1,-0.12l2.14,-4.84l3.25,-1.35Z", "name": "Netherlands"}, "NO": {"path": "M491.45,67.31l7.06,3.0l-2.52,0.94l-0.11,0.49l2.43,2.49l-3.82,1.59l-1.48,0.3l0.89,-2.61l-0.14,-0.36l-3.21,-1.78l-0.25,-0.02l-3.89,1.52l-0.17,0.17l-1.2,3.17l-2.19,1.78l-2.53,-0.99l-0.13,-0.02l-3.15,0.21l-2.69,-2.25l-0.38,-0.01l-1.43,1.11l-1.47,0.17l-0.26,0.26l-0.33,2.57l-4.42,-0.65l-0.33,0.22l-0.6,2.19l-2.17,-0.01l-0.27,0.16l-4.15,7.68l-3.88,5.76l-0.0,0.33l0.81,1.23l-0.7,1.27l-2.3,-0.06l-0.28,0.18l-1.63,3.72l-0.02,0.13l0.15,5.17l0.07,0.18l1.51,1.84l-0.79,4.24l-2.04,2.5l-0.92,1.75l-1.39,-1.88l-0.44,-0.05l-4.89,4.21l-3.16,0.81l-3.24,-1.74l-0.86,-3.82l-0.78,-8.6l2.18,-2.36l6.56,-3.28l5.0,-4.16l4.63,-5.74l5.99,-8.09l4.17,-3.23l6.84,-5.49l5.39,-1.92l4.06,0.24l0.23,-0.09l3.72,-3.67l4.51,0.19l4.4,-0.89ZM484.58,19.95l4.42,1.82l-3.25,2.68l-7.14,0.65l-7.16,-0.91l-0.39,-1.37l-0.28,-0.22l-3.48,-0.1l-2.25,-2.15l7.09,-1.48l3.55,1.36l0.28,-0.03l2.42,-1.66l6.18,1.41ZM481.99,33.92l-4.73,1.85l-3.76,-1.06l1.27,-1.02l0.04,-0.43l-1.18,-1.35l4.46,-0.94l0.89,1.83l0.17,0.15l2.83,0.96ZM466.5,23.95l7.64,3.87l-5.63,1.94l-0.19,0.19l-1.35,3.88l-2.08,0.96l-0.16,0.19l-1.14,4.18l-2.71,0.18l-4.94,-2.95l1.95,-1.63l-0.08,-0.51l-3.7,-1.54l-4.79,-4.54l-1.78,-4.01l6.29,-1.88l1.25,1.81l0.25,0.13l3.57,-0.08l0.26,-0.17l0.87,-1.79l3.41,-0.18l3.08,1.94Z", "name": "Norway"}, "NA": {"path": "M461.88,357.98l-1.61,-1.77l-0.94,-1.9l-0.54,-2.58l-0.62,-1.95l-0.83,-4.05l-0.06,-3.13l-0.33,-1.5l-0.07,-0.14l-0.95,-1.06l-1.27,-2.12l-1.3,-3.1l-0.59,-1.71l-1.98,-2.46l-0.13,-1.67l0.99,-0.4l1.44,-0.42l1.48,0.07l1.42,1.11l0.31,0.03l0.32,-0.15l9.99,-0.11l1.66,1.18l0.16,0.06l6.06,0.37l4.69,-1.06l2.01,-0.57l1.5,0.14l0.63,0.37l-1.0,0.41l-0.7,0.01l-0.16,0.05l-1.38,0.88l-0.79,-0.88l-0.29,-0.09l-3.83,0.9l-1.84,0.08l-0.29,0.3l-0.07,8.99l-2.18,0.08l-0.29,0.3l-0.0,17.47l-2.04,1.27l-1.21,0.18l-1.51,-0.49l-0.99,-0.18l-0.36,-1.0l-0.1,-0.14l-0.99,-0.74l-0.4,0.04l-0.98,1.09Z", "name": "Namibia"}, "NC": {"path": "M835.87,338.68l2.06,1.63l1.01,0.94l-0.49,0.32l-1.21,-0.62l-1.76,-1.16l-1.58,-1.36l-1.61,-1.79l-0.16,-0.41l0.54,0.02l1.32,0.83l1.08,0.87l0.79,0.73Z", "name": "New Caledonia"}, "NE": {"path": "M426.67,254.17l0.03,-1.04l-0.24,-0.3l-2.66,-0.53l-0.06,-1.0l-0.07,-0.17l-1.37,-1.62l-0.3,-1.04l0.15,-0.94l1.37,-0.09l0.19,-0.09l0.85,-0.83l3.34,-0.22l2.22,-0.41l0.24,-0.26l0.2,-1.5l1.32,-1.65l0.07,-0.19l-0.01,-5.74l3.4,-1.13l7.24,-5.12l8.46,-4.95l3.76,1.08l1.35,1.39l0.36,0.05l1.39,-0.77l0.55,3.66l0.12,0.2l0.82,0.6l0.03,0.69l0.1,0.21l0.87,0.74l-0.47,0.99l-0.96,5.26l-0.13,3.25l-3.08,2.34l-0.1,0.15l-1.08,3.37l0.08,0.31l0.94,0.86l-0.01,1.51l0.29,0.3l1.25,0.05l-0.14,0.66l-0.51,0.11l-0.24,0.26l-0.06,0.57l-0.04,0.0l-1.59,-2.62l-0.21,-0.14l-0.59,-0.1l-0.23,0.05l-1.83,1.33l-1.79,-0.68l-1.42,-0.17l-0.17,0.03l-0.65,0.32l-1.39,-0.07l-0.19,0.06l-1.4,1.03l-1.12,0.05l-2.97,-1.29l-0.26,0.01l-1.12,0.59l-1.08,-0.04l-0.85,-0.88l-0.11,-0.07l-2.51,-0.95l-0.14,-0.02l-2.69,0.3l-0.16,0.07l-0.65,0.55l-0.1,0.16l-0.34,1.41l-0.69,0.98l-0.05,0.15l-0.13,1.72l-1.47,-1.13l-0.18,-0.06l-0.9,0.01l-0.2,0.08l-0.32,0.28Z", "name": "Niger"}, "NG": {"path": "M442.0,272.7l-2.4,0.83l-0.88,-0.12l-0.19,0.04l-0.89,0.52l-1.78,-0.05l-1.23,-1.44l-0.88,-1.87l-1.77,-1.66l-0.21,-0.08l-3.78,0.03l0.13,-3.75l-0.06,-1.58l0.44,-1.47l0.74,-0.75l1.21,-1.56l0.04,-0.29l-0.22,-0.56l0.44,-0.9l0.01,-0.24l-0.54,-1.44l0.26,-2.97l0.72,-1.06l0.33,-1.37l0.51,-0.43l2.53,-0.28l2.38,0.9l0.89,0.91l0.2,0.09l1.28,0.04l0.15,-0.03l1.06,-0.56l2.9,1.26l0.13,0.02l1.28,-0.06l0.16,-0.06l1.39,-1.02l1.36,0.07l0.15,-0.03l0.64,-0.32l1.22,0.13l1.9,0.73l0.28,-0.04l1.86,-1.35l0.33,0.06l1.62,2.67l0.29,0.14l0.32,-0.04l0.73,0.74l-0.19,0.37l-0.12,0.74l-2.03,1.89l-0.07,0.11l-0.66,1.62l-0.35,1.28l-0.48,0.51l-0.07,0.12l-0.48,1.67l-1.26,0.98l-0.1,0.15l-0.38,1.24l-0.58,1.07l-0.2,0.91l-1.43,0.7l-1.26,-0.93l-0.19,-0.06l-0.95,0.04l-0.2,0.09l-1.41,1.39l-0.61,0.02l-0.26,0.17l-1.19,2.42l-0.61,1.67Z", "name": "Nigeria"}, "NZ": {"path": "M857.9,379.62l1.85,3.1l0.33,0.14l0.22,-0.28l0.04,-1.41l0.57,0.4l0.35,2.06l0.17,0.22l2.02,0.94l1.78,0.26l0.22,-0.06l1.31,-1.01l0.84,0.22l-0.53,2.27l-0.67,1.5l-1.71,-0.05l-0.25,0.12l-0.67,0.89l-0.05,0.23l0.21,1.15l-0.31,0.46l-2.15,3.57l-1.6,0.99l-0.28,-0.51l-0.15,-0.13l-0.72,-0.3l1.27,-2.15l0.01,-0.29l-0.82,-1.63l-0.15,-0.14l-2.5,-1.09l0.05,-0.69l1.67,-0.94l0.15,-0.21l0.42,-2.24l-0.11,-1.95l-0.03,-0.12l-0.97,-1.85l0.05,-0.41l-0.09,-0.25l-1.18,-1.17l-1.94,-2.49l-0.86,-1.64l0.38,-0.09l1.24,1.43l0.12,0.08l1.81,0.68l0.67,2.39ZM853.93,393.55l0.57,1.24l0.44,0.12l1.51,-1.03l0.52,0.91l0.0,1.09l-0.88,1.31l-1.62,2.2l-1.26,1.2l-0.05,0.38l0.64,1.02l-1.4,0.03l-0.14,0.04l-2.14,1.16l-0.14,0.17l-0.67,2.0l-1.38,3.06l-3.07,2.19l-2.12,-0.06l-1.55,-0.99l-0.14,-0.05l-2.53,-0.2l-0.31,-0.84l1.25,-2.15l3.07,-2.97l1.62,-0.59l1.81,-1.17l2.18,-1.63l1.55,-1.65l1.08,-2.18l0.9,-0.72l0.11,-0.17l0.35,-1.56l1.37,-1.07l0.4,0.91Z", "name": "New Zealand"}, "NP": {"path": "M641.26,213.53l-0.14,0.95l0.32,1.64l-0.21,0.78l-1.83,0.04l-2.98,-0.62l-1.86,-0.25l-1.37,-1.3l-0.18,-0.08l-3.38,-0.34l-3.21,-1.49l-2.38,-1.34l-2.16,-0.92l0.84,-2.2l1.51,-1.18l0.89,-0.57l1.83,0.77l2.5,1.76l1.39,0.41l0.78,1.21l0.17,0.13l1.91,0.53l2.0,1.17l2.92,0.66l2.63,0.24Z", "name": "Nepal"}, "CI": {"path": "M413.53,272.08l-0.83,0.02l-1.79,-0.49l-1.64,0.03l-3.04,0.46l-1.73,0.72l-2.4,0.89l-0.12,-0.02l0.16,-1.7l0.19,-0.25l0.06,-0.2l-0.08,-0.99l-0.09,-0.19l-1.06,-1.05l-0.15,-0.08l-0.71,-0.15l-0.51,-0.48l0.45,-0.92l0.02,-0.19l-0.24,-1.16l0.07,-0.43l0.14,-0.0l0.3,-0.26l0.15,-1.1l-0.02,-0.15l-0.13,-0.34l0.09,-0.13l0.83,-0.27l0.19,-0.37l-0.62,-2.02l-0.55,-1.0l0.14,-0.59l0.35,-0.14l0.24,-0.16l0.53,0.29l0.14,0.04l1.93,0.02l0.26,-0.14l0.36,-0.58l0.39,0.01l0.43,-0.17l0.28,0.79l0.43,0.16l0.56,-0.31l0.89,-0.32l0.92,0.45l0.39,0.75l0.14,0.13l1.13,0.53l0.3,-0.03l0.81,-0.59l1.02,-0.08l1.49,0.57l0.62,3.33l-1.03,2.09l-0.65,2.84l0.02,0.2l1.05,2.08l-0.07,0.64Z", "name": "Ivory Coast"}, "CH": {"path": "M444.71,156.27l0.05,0.3l-0.34,0.69l0.13,0.4l1.13,0.58l1.07,0.1l-0.12,0.81l-0.87,0.42l-1.75,-0.37l-0.34,0.18l-0.47,1.1l-0.86,0.07l-0.33,-0.38l-0.41,-0.04l-1.34,1.01l-1.02,0.13l-0.93,-0.58l-0.82,-1.32l-0.37,-0.12l-0.77,0.32l0.02,-0.84l1.74,-1.69l0.09,-0.25l-0.04,-0.38l0.73,0.19l0.26,-0.06l0.6,-0.48l2.02,0.02l0.24,-0.12l0.38,-0.51l2.31,0.84Z", "name": "Switzerland"}, "CO": {"path": "M232.24,284.95l-0.94,-0.52l-1.22,-0.82l-0.31,-0.01l-0.62,0.35l-1.88,-0.31l-0.54,-0.95l-0.29,-0.15l-0.37,0.03l-2.34,-1.33l-0.15,-0.35l0.57,-0.11l0.24,-0.32l-0.1,-1.15l0.46,-0.71l1.11,-0.15l0.21,-0.13l1.05,-1.57l0.95,-1.31l-0.08,-0.43l-0.73,-0.47l0.4,-1.24l0.01,-0.16l-0.53,-2.15l0.44,-0.54l0.06,-0.24l-0.4,-2.13l-0.06,-0.13l-0.93,-1.22l0.21,-0.8l0.52,0.12l0.32,-0.13l0.47,-0.75l0.03,-0.27l-0.52,-1.32l0.09,-0.11l1.14,0.07l0.22,-0.08l1.82,-1.71l0.96,-0.25l0.22,-0.28l0.02,-0.81l0.43,-2.01l1.28,-1.04l1.48,-0.05l0.27,-0.19l0.12,-0.31l1.73,0.19l0.2,-0.05l1.96,-1.28l0.97,-0.56l1.16,-1.16l0.64,0.11l0.43,0.44l-0.31,0.55l-1.49,0.39l-0.19,0.16l-0.6,1.2l-0.97,0.74l-0.73,0.94l-0.06,0.13l-0.3,1.76l-0.68,1.44l0.23,0.43l1.1,0.14l0.27,0.97l0.08,0.13l0.49,0.49l0.17,0.85l-0.27,0.86l-0.01,0.14l0.09,0.53l0.2,0.23l0.52,0.18l0.54,0.79l0.27,0.13l3.18,-0.24l1.31,0.29l1.7,2.08l0.31,0.1l0.96,-0.26l1.75,0.13l1.41,-0.27l0.56,0.27l-0.36,1.07l-0.54,0.81l-0.05,0.13l-0.2,1.8l0.51,1.79l0.07,0.12l0.65,0.68l0.05,0.32l-1.16,1.14l0.05,0.47l0.86,0.52l0.6,0.79l0.31,1.01l-0.7,-0.81l-0.44,-0.01l-0.74,0.77l-4.75,-0.05l-0.3,0.31l0.03,1.57l0.25,0.29l1.2,0.21l-0.02,0.24l-0.1,-0.05l-0.22,-0.02l-1.41,0.41l-0.22,0.29l-0.01,1.82l0.11,0.23l1.04,0.85l0.35,1.3l-0.06,1.02l-1.02,6.26l-0.84,-0.89l-0.19,-0.09l-0.25,-0.02l1.35,-2.13l-0.1,-0.42l-1.92,-1.17l-0.2,-0.04l-1.41,0.2l-0.82,-0.39l-0.26,0.0l-1.29,0.62l-1.63,-0.27l-1.4,-2.5l-0.12,-0.12l-1.1,-0.61l-0.83,-1.2l-1.67,-1.19l-0.27,-0.04l-0.54,0.19Z", "name": "Colombia"}, "CN": {"path": "M740.32,148.94l0.22,0.21l4.3,1.03l2.84,2.2l0.99,2.92l0.28,0.2l3.8,0.0l0.15,-0.04l2.13,-1.24l3.5,-0.8l-1.05,2.29l-0.95,1.13l-0.06,0.12l-0.85,3.41l-1.56,2.81l-2.83,-0.51l-0.19,0.03l-2.15,1.09l-0.15,0.34l0.65,2.59l-0.33,3.3l-1.03,0.07l-0.28,0.3l0.01,0.75l-1.09,-1.2l-0.48,0.05l-0.94,1.6l-3.76,1.26l-0.2,0.36l0.29,1.19l-1.67,-0.08l-1.11,-0.88l-0.42,0.05l-1.69,2.08l-2.71,1.57l-2.04,1.88l-3.42,0.84l-0.11,0.05l-1.8,1.34l-1.54,0.46l0.52,-0.53l0.06,-0.33l-0.44,-0.96l1.84,-1.84l0.02,-0.41l-1.32,-1.56l-0.36,-0.08l-2.23,1.08l-2.83,2.06l-1.52,1.85l-2.32,0.13l-0.2,0.09l-1.28,1.37l-0.03,0.37l1.32,1.97l0.18,0.13l1.83,0.43l0.07,1.08l0.18,0.26l1.98,0.84l0.3,-0.03l2.66,-1.96l2.06,1.04l0.12,0.03l1.4,0.07l0.27,1.0l-3.24,0.73l-0.17,0.11l-1.13,1.5l-2.38,1.4l-0.1,0.1l-1.29,1.99l0.1,0.42l2.6,1.5l0.97,2.72l1.52,2.56l1.66,2.08l-0.03,1.76l-1.4,0.67l-0.15,0.38l0.6,1.47l0.13,0.15l1.29,0.75l-0.35,2.0l-0.58,1.96l-1.22,0.21l-0.2,0.14l-1.83,2.93l-2.02,3.51l-2.29,3.13l-3.4,2.42l-3.42,2.18l-2.75,0.3l-0.15,0.06l-1.32,1.01l-0.68,-0.67l-0.41,-0.01l-1.37,1.27l-3.42,1.28l-2.62,0.4l-0.24,0.21l-0.8,2.57l-0.95,0.11l-0.53,-1.54l0.52,-0.89l-0.19,-0.44l-3.36,-0.84l-0.17,0.01l-1.09,0.4l-2.36,-0.64l-1.0,-0.9l0.35,-1.34l-0.23,-0.37l-2.22,-0.47l-1.15,-0.94l-0.36,-0.02l-2.08,1.37l-2.35,0.29l-1.98,-0.01l-0.13,0.03l-1.32,0.63l-1.28,0.38l-0.21,0.33l0.33,2.65l-0.78,-0.04l-0.14,-0.39l-0.07,-1.04l-0.41,-0.26l-1.72,0.71l-0.96,-0.43l-1.63,-0.86l0.65,-1.95l-0.19,-0.38l-1.43,-0.46l-0.56,-2.27l-0.34,-0.22l-2.26,0.38l0.25,-2.65l2.29,-2.15l0.09,-0.2l0.1,-2.21l-0.07,-2.09l-0.15,-0.25l-1.02,-0.6l-0.8,-1.52l-0.31,-0.16l-1.42,0.2l-2.16,-0.32l0.55,-0.74l0.01,-0.35l-1.17,-1.7l-0.41,-0.08l-1.67,1.07l-1.97,-0.63l-0.25,0.03l-2.89,1.73l-2.26,1.99l-1.82,0.3l-1.0,-0.66l-0.15,-0.05l-1.28,-0.06l-1.75,-0.61l-0.24,0.02l-1.35,0.69l-0.1,0.08l-1.2,1.45l-0.14,-1.41l-0.4,-0.25l-1.46,0.55l-2.83,-0.26l-2.77,-0.61l-1.99,-1.17l-1.91,-0.54l-0.78,-1.21l-0.17,-0.13l-1.36,-0.38l-2.54,-1.79l-2.01,-0.84l-0.28,0.02l-0.89,0.56l-3.31,-1.83l-2.35,-1.67l-0.57,-2.49l1.34,0.28l0.36,-0.28l0.08,-1.42l-0.05,-0.19l-0.93,-1.34l0.24,-2.18l-0.07,-0.22l-2.69,-3.32l-0.15,-0.1l-3.97,-1.11l-0.69,-2.05l-0.11,-0.15l-1.79,-1.3l-0.39,-0.73l-0.36,-1.57l0.08,-1.09l-0.18,-0.3l-1.52,-0.66l-0.22,-0.01l-0.51,0.18l-0.52,-2.21l0.59,-0.55l0.06,-0.35l-0.22,-0.44l2.12,-1.24l1.63,-0.55l2.58,0.39l0.31,-0.16l0.87,-1.75l3.05,-0.34l0.21,-0.12l0.84,-1.12l3.87,-1.59l0.15,-0.14l0.35,-0.68l0.03,-0.17l-0.17,-1.51l1.52,-0.7l0.15,-0.39l-2.12,-5.0l4.62,-1.15l1.35,-0.72l0.14,-0.17l1.72,-5.37l4.7,0.99l0.28,-0.08l1.39,-1.43l0.08,-0.2l0.11,-2.95l1.83,-0.26l0.18,-0.1l1.85,-2.08l0.61,-0.17l0.57,1.97l0.1,0.15l2.2,1.75l3.48,1.17l1.59,2.36l-0.93,3.53l0.04,0.24l0.9,1.35l0.2,0.13l2.98,0.53l3.32,0.43l2.97,1.89l1.49,0.35l1.08,2.67l1.52,1.88l0.24,0.11l2.74,-0.07l5.15,0.67l3.36,-0.41l2.39,0.43l3.67,1.81l0.13,0.03l2.92,-0.0l1.02,0.86l0.34,0.03l2.88,-1.59l3.98,-1.03l3.81,-0.13l3.02,-1.12l1.77,-1.61l1.73,-1.01l0.13,-0.37l-0.41,-1.01l-0.72,-1.07l1.09,-1.66l1.21,0.24l2.57,0.63l0.24,-0.04l2.46,-1.62l3.78,-1.19l0.13,-0.09l1.8,-2.03l1.66,-0.84l3.54,-0.41l1.93,0.35l0.34,-0.22l0.27,-1.12l-0.08,-0.29l-2.27,-2.22l-2.08,-1.07l-0.29,0.01l-1.82,1.12l-2.36,-0.47l-0.14,0.01l-1.18,0.34l-0.46,-0.94l1.69,-3.08l1.1,-2.21l2.75,1.12l0.26,-0.02l3.53,-2.06l0.15,-0.26l-0.02,-1.35l2.18,-3.39l1.35,-1.04l0.12,-0.24l-0.03,-1.85l-0.15,-0.25l-1.0,-0.58l1.68,-1.37l3.01,-0.59l3.25,-0.09l3.67,0.99l2.08,1.18l1.51,3.3l0.95,1.45l0.85,1.99l0.92,3.19ZM697.0,237.37l-1.95,1.12l-1.74,-0.68l-0.06,-1.9l1.08,-1.03l2.62,-0.7l1.23,0.05l0.37,0.65l-1.01,1.08l-0.54,1.4Z", "name": "China"}, "CM": {"path": "M453.76,278.92l-0.26,-0.11l-0.18,-0.02l-1.42,0.31l-1.56,-0.33l-1.17,0.16l-3.7,-0.05l0.3,-1.63l-0.04,-0.21l-0.98,-1.66l-0.15,-0.13l-1.03,-0.38l-0.46,-1.01l-0.13,-0.14l-0.48,-0.27l0.02,-0.46l0.62,-1.72l1.1,-2.25l0.54,-0.02l0.2,-0.09l1.41,-1.39l0.73,-0.03l1.32,0.97l0.31,0.03l1.72,-0.85l0.16,-0.2l0.22,-1.0l0.57,-1.03l0.36,-1.18l1.26,-0.98l0.1,-0.15l0.49,-1.7l0.48,-0.51l0.07,-0.13l0.35,-1.3l0.63,-1.54l2.06,-1.92l0.09,-0.17l0.12,-0.79l0.24,-0.41l-0.04,-0.36l-0.89,-0.91l0.04,-0.45l0.28,-0.06l0.85,1.39l0.16,1.59l-0.09,1.66l0.04,0.17l1.09,1.84l-0.86,-0.02l-0.72,0.17l-1.07,-0.24l-0.34,0.17l-0.54,1.19l0.06,0.34l1.48,1.47l1.06,0.44l0.32,0.94l0.73,1.6l-0.32,0.57l-1.23,2.49l-0.54,0.41l-0.12,0.21l-0.19,1.95l0.24,1.08l-0.18,0.67l0.07,0.28l1.13,1.25l0.24,0.93l0.92,1.29l1.1,0.8l0.1,1.01l0.26,0.73l-0.12,0.93l-1.65,-0.49l-2.02,-0.66l-3.19,-0.11Z", "name": "Cameroon"}, "CL": {"path": "M246.8,429.1l-1.14,0.78l-2.25,1.21l-0.16,0.23l-0.37,2.94l-0.75,0.06l-2.72,-1.07l-2.83,-2.34l-3.06,-1.9l-0.71,-1.92l0.67,-1.84l-0.02,-0.25l-1.22,-2.13l-0.31,-5.41l1.02,-2.95l2.59,-2.4l-0.13,-0.51l-3.32,-0.8l2.06,-2.4l0.07,-0.15l0.79,-4.77l2.44,0.95l0.4,-0.22l1.31,-6.31l-0.16,-0.33l-1.68,-0.8l-0.42,0.21l-0.72,3.47l-1.01,-0.27l0.74,-4.06l0.85,-5.46l1.12,-1.96l0.03,-0.22l-0.71,-2.82l-0.19,-2.94l0.76,-0.07l0.26,-0.2l1.53,-4.62l1.73,-4.52l1.07,-4.2l-0.56,-4.2l0.73,-2.2l0.01,-0.12l-0.29,-3.3l1.46,-3.34l0.45,-5.19l0.8,-5.52l0.78,-5.89l-0.18,-4.33l-0.49,-3.47l1.1,-0.56l0.13,-0.13l0.44,-0.88l0.9,1.29l0.32,1.8l0.1,0.18l1.16,0.97l-0.73,2.33l0.01,0.21l1.33,2.91l0.97,3.6l0.35,0.22l1.57,-0.31l0.16,0.34l-0.79,2.51l-2.61,1.25l-0.17,0.28l0.08,4.36l-0.48,0.79l0.01,0.33l0.6,0.84l-1.62,1.55l-1.67,2.6l-0.89,2.47l-0.02,0.13l0.23,2.56l-1.5,2.76l-0.03,0.21l1.15,4.8l0.11,0.17l0.54,0.42l-0.01,2.37l-1.4,2.7l-0.03,0.15l0.06,2.25l-1.8,1.78l-0.09,0.21l0.02,2.73l0.71,2.63l-1.33,0.94l-0.12,0.17l-0.67,2.64l-0.59,3.03l0.4,3.55l-0.84,0.51l-0.14,0.31l0.58,3.5l0.08,0.16l0.96,0.99l-0.7,1.08l0.11,0.43l1.04,0.55l0.19,0.8l-0.89,0.48l-0.16,0.31l0.26,1.77l-0.89,4.06l-1.31,2.67l-0.03,0.19l0.28,1.53l-0.73,1.88l-1.85,1.37l-0.12,0.26l0.22,3.46l0.06,0.16l0.88,1.19l0.28,0.12l1.32,-0.17l-0.04,2.13l0.04,0.15l1.04,1.95l0.24,0.16l5.94,0.44ZM248.79,430.71l0.0,7.41l0.3,0.3l2.67,0.0l1.01,0.06l-0.54,0.91l-1.99,1.01l-1.13,-0.1l-1.42,-0.27l-1.87,-1.06l-2.57,-0.49l-3.09,-1.9l-2.52,-1.83l-2.65,-2.93l0.93,0.32l3.54,2.29l3.32,1.23l0.34,-0.09l1.29,-1.57l0.83,-2.32l2.11,-1.28l1.43,0.32Z", "name": "Chile"}, "CA": {"path": "M280.14,145.66l-1.66,2.88l0.06,0.37l0.37,0.03l1.5,-1.01l1.17,0.49l-0.64,0.83l0.13,0.46l2.22,0.89l0.28,-0.03l1.02,-0.7l2.09,0.83l-0.69,2.1l0.37,0.38l1.43,-0.45l0.27,1.43l0.74,1.88l-0.95,2.5l-0.88,0.09l-1.34,-0.48l0.49,-2.34l-0.14,-0.32l-0.7,-0.4l-0.36,0.04l-2.81,2.66l-0.63,-0.05l1.2,-1.01l-0.1,-0.52l-2.4,-0.77l-2.79,0.18l-4.65,-0.09l-0.22,-0.54l1.37,-0.99l0.01,-0.48l-0.82,-0.65l1.91,-1.79l2.57,-5.17l1.49,-1.81l2.04,-1.07l0.63,0.08l-0.27,0.51l-1.33,2.07ZM193.92,74.85l-0.01,4.24l0.19,0.28l0.33,-0.07l3.14,-3.22l2.65,2.5l-0.71,3.04l0.06,0.26l2.42,2.88l0.46,0.0l2.66,-3.14l1.83,-3.74l0.03,-0.12l0.13,-4.53l3.23,0.31l3.63,0.64l3.18,2.08l0.13,1.91l-1.79,2.22l-0.0,0.37l1.69,2.2l-0.28,1.8l-4.74,2.84l-3.33,0.62l-2.5,-1.21l-0.41,0.17l-0.73,2.05l-2.39,3.44l-0.74,1.78l-2.78,2.61l-3.48,0.26l-0.17,0.07l-1.98,1.68l-0.1,0.21l-0.15,2.33l-2.68,0.45l-0.17,0.09l-3.1,3.2l-2.75,4.38l-0.99,3.06l-0.14,4.31l0.25,0.31l3.5,0.58l1.07,3.24l1.18,2.76l0.34,0.18l3.43,-0.69l4.55,1.52l2.45,1.32l1.76,1.65l0.12,0.07l3.11,0.96l2.63,1.46l0.13,0.04l4.12,0.2l2.41,0.3l-0.36,2.81l0.8,3.51l1.81,3.78l0.08,0.1l3.73,3.17l0.34,0.03l1.93,-1.08l0.13,-0.15l1.35,-3.44l0.01,-0.18l-1.31,-5.38l-0.08,-0.14l-1.46,-1.5l3.68,-1.51l2.84,-2.46l1.45,-2.55l0.04,-0.17l-0.2,-2.39l-0.04,-0.12l-1.7,-3.07l-2.9,-2.64l2.79,-3.66l0.05,-0.27l-1.08,-3.38l-0.8,-5.75l1.45,-0.75l4.18,1.03l2.6,0.38l0.18,-0.03l1.93,-0.95l2.18,1.23l3.01,2.18l0.73,1.42l0.25,0.16l4.18,0.27l-0.06,2.95l0.83,4.7l0.22,0.24l2.19,0.55l1.75,2.08l0.38,0.07l3.63,-2.03l0.11,-0.11l2.38,-4.06l1.36,-1.43l1.76,3.01l3.26,4.68l2.68,4.19l-0.94,2.09l0.12,0.38l3.31,1.98l2.23,1.98l0.13,0.07l3.94,0.89l1.48,1.02l0.96,2.82l0.22,0.2l1.85,0.43l0.88,1.13l0.17,3.53l-1.68,1.16l-1.76,1.14l-4.08,1.17l-0.11,0.06l-3.08,2.65l-4.11,0.52l-5.35,-0.69l-3.76,-0.02l-2.62,0.23l-0.2,0.1l-2.05,2.29l-3.13,1.41l-0.11,0.08l-3.6,4.24l-2.87,2.92l-0.05,0.36l0.33,0.14l2.13,-0.52l0.15,-0.08l3.98,-4.15l5.16,-2.63l3.58,-0.31l1.82,1.3l-2.09,1.91l-0.09,0.29l0.8,3.46l0.82,2.37l0.15,0.17l3.25,1.56l0.16,0.03l4.14,-0.45l0.21,-0.12l2.03,-2.86l0.11,1.46l0.13,0.22l1.26,0.88l-2.7,1.78l-5.51,1.83l-2.52,1.26l-2.75,2.16l-1.52,-0.18l-0.08,-2.16l4.19,-2.47l0.14,-0.34l-0.3,-0.22l-4.01,0.1l-2.66,0.36l-1.45,-1.56l0.0,-4.16l-0.11,-0.23l-1.11,-0.91l-0.28,-0.05l-1.5,0.48l-0.7,-0.7l-0.45,0.02l-1.91,2.39l-0.8,2.5l-0.82,1.31l-0.95,0.43l-0.77,0.15l-0.23,0.2l-0.18,0.56l-8.2,0.02l-0.13,0.03l-1.19,0.61l-2.95,2.45l-0.78,1.13l-4.6,0.01l-0.12,0.02l-1.13,0.48l-0.13,0.44l0.37,0.55l0.2,0.82l-0.01,0.09l-3.1,1.42l-2.63,0.5l-2.84,1.57l-0.47,0.0l-0.72,-0.4l-0.18,-0.27l0.03,-0.15l0.52,-1.0l1.2,-1.71l0.73,-1.8l0.02,-0.17l-1.03,-5.47l-0.15,-0.21l-2.35,-1.32l0.16,-0.29l-0.05,-0.35l-0.37,-0.38l-0.22,-0.09l-0.56,0.0l-0.35,-0.34l-0.11,-0.65l-0.46,-0.2l-0.39,0.26l-0.2,-0.03l-0.11,-0.33l-0.48,-0.25l-0.21,-0.71l-0.15,-0.18l-3.97,-2.07l-4.8,-2.39l-0.25,-0.01l-2.19,0.89l-0.72,0.03l-3.04,-0.82l-0.14,-0.0l-1.94,0.4l-2.4,-0.98l-2.56,-0.51l-1.7,-0.19l-0.62,-0.44l-0.42,-1.67l-0.3,-0.23l-0.85,0.02l-0.29,0.3l-0.01,0.95l-69.26,-0.01l-4.77,-3.14l-1.78,-1.41l-4.51,-1.38l-1.3,-2.73l0.34,-1.96l-0.17,-0.33l-3.06,-1.37l-0.41,-2.58l-0.11,-0.18l-2.92,-2.4l-0.05,-1.53l1.32,-1.59l0.07,-0.2l-0.07,-2.21l-0.16,-0.26l-4.19,-2.22l-2.52,-4.02l-1.56,-2.6l-0.08,-0.09l-2.28,-1.64l-1.65,-1.48l-1.31,-1.89l-0.38,-0.1l-2.51,1.21l-2.28,1.92l-2.03,-2.22l-1.85,-1.71l-2.44,-1.04l-2.28,-0.12l0.03,-37.72l4.27,0.98l4.0,2.13l2.61,0.4l0.24,-0.07l2.17,-1.81l2.92,-1.33l3.63,0.53l0.18,-0.03l3.72,-1.94l3.89,-1.06l1.6,1.72l0.37,0.06l1.87,-1.04l0.14,-0.19l0.48,-1.83l1.37,0.38l4.18,3.96l0.41,0.0l2.89,-2.62l0.28,2.79l0.37,0.26l3.08,-0.73l0.17,-0.12l0.85,-1.16l2.81,0.24l3.83,1.86l5.86,1.61l3.46,0.75l2.44,-0.26l2.89,1.89l-3.12,1.89l-0.14,0.31l0.24,0.24l4.53,0.92l6.84,-0.5l2.04,-0.71l2.54,2.44l0.39,0.02l2.72,-2.16l-0.01,-0.48l-2.26,-1.61l1.27,-1.16l2.94,-0.19l1.94,-0.42l1.89,0.97l2.49,2.32l0.24,0.08l2.71,-0.33l4.35,1.9l0.17,0.02l3.86,-0.67l3.62,0.1l0.31,-0.33l-0.26,-2.44l1.9,-0.65l3.58,1.36l-0.01,3.84l0.23,0.29l0.34,-0.17l1.51,-3.23l1.81,0.1l0.31,-0.22l1.13,-4.37l-0.08,-0.29l-2.68,-2.73l-2.83,-1.76l0.19,-4.73l2.77,-3.15l3.06,0.69l2.44,1.97l3.24,4.88l-2.05,2.02l0.15,0.51l4.41,0.85ZM265.85,150.7l-0.84,0.04l-3.15,-0.99l-1.77,-1.17l0.19,-0.06l3.17,0.79l2.39,1.27l0.01,0.12ZM249.41,3.71l6.68,0.49l5.34,0.79l4.34,1.6l-0.08,1.24l-5.91,2.56l-6.03,1.21l-2.36,1.38l-0.14,0.34l0.29,0.22l4.37,-0.02l-4.96,3.01l-4.06,1.64l-0.11,0.08l-4.21,4.62l-5.07,0.92l-0.12,0.05l-1.53,1.1l-7.5,0.59l-0.28,0.28l0.24,0.31l2.67,0.54l-1.04,0.6l-0.09,0.44l1.89,2.49l-2.11,1.66l-3.83,1.52l-0.15,0.13l-1.14,2.01l-3.41,1.55l-0.16,0.36l0.35,1.19l0.3,0.22l3.98,-0.19l0.03,0.78l-6.42,2.99l-6.44,-1.41l-7.41,0.79l-3.72,-0.62l-4.48,-0.26l-0.25,-2.0l4.37,-1.13l0.21,-0.38l-1.14,-3.55l1.13,-0.28l6.61,2.29l0.35,-0.12l-0.04,-0.37l-3.41,-3.45l-0.14,-0.08l-3.57,-0.92l1.62,-1.7l4.36,-1.3l0.2,-0.18l0.71,-1.94l-0.12,-0.36l-3.45,-2.15l-0.88,-2.43l6.36,0.23l1.94,0.61l0.23,-0.02l3.91,-2.1l0.15,-0.32l-0.26,-0.24l-5.69,-0.67l-8.69,0.37l-4.3,-1.92l-2.12,-2.39l-2.82,-1.68l-0.44,-1.65l3.41,-1.06l2.93,-0.2l4.91,-0.99l3.69,-2.28l2.93,0.31l2.64,1.68l0.42,-0.1l1.84,-3.23l3.17,-0.96l4.45,-0.69l7.56,-0.26l1.26,0.64l0.18,0.03l7.2,-1.06l10.81,0.8ZM203.94,57.59l0.01,0.32l1.97,2.97l0.51,-0.01l2.26,-3.75l6.05,-1.89l4.08,4.72l-0.36,2.95l0.38,0.33l4.95,-1.36l0.11,-0.05l2.23,-1.77l5.37,2.31l3.32,2.14l0.3,1.89l0.36,0.25l4.48,-1.01l2.49,2.8l0.14,0.09l5.99,1.78l2.09,1.74l2.18,3.83l-4.29,1.91l-0.01,0.54l5.9,2.83l3.95,0.94l3.54,3.84l0.2,0.1l3.58,0.25l-0.67,2.51l-4.18,4.54l-2.84,-1.61l-3.91,-3.95l-0.26,-0.09l-3.24,0.52l-0.25,0.26l-0.32,2.37l0.1,0.26l2.63,2.38l3.42,1.89l0.96,1.0l1.57,3.8l-0.74,2.43l-2.85,-0.96l-6.26,-3.15l-0.38,0.09l0.04,0.39l3.54,3.4l2.55,2.31l0.23,0.78l-6.26,-1.43l-5.33,-2.25l-2.73,-1.73l0.67,-0.86l-0.09,-0.45l-7.38,-4.01l-0.44,0.27l0.03,0.89l-6.85,0.61l-1.8,-1.17l1.43,-2.6l4.56,-0.07l5.15,-0.52l0.23,-0.45l-0.76,-1.34l0.8,-1.89l3.21,-4.06l0.05,-0.29l-0.72,-1.95l-0.97,-1.47l-0.11,-0.1l-3.84,-2.1l-4.53,-1.33l1.09,-0.75l0.05,-0.45l-2.65,-2.75l-0.18,-0.09l-2.12,-0.24l-1.91,-1.47l-0.39,0.02l-1.27,1.25l-4.4,0.56l-9.06,-0.99l-5.28,-1.31l-4.01,-0.67l-1.72,-1.31l2.32,-1.85l0.1,-0.33l-0.28,-0.2l-3.3,-0.02l-0.74,-4.36l1.86,-4.09l2.46,-1.88l5.74,-1.15l-1.5,2.55ZM261.28,159.28l0.19,0.14l1.82,0.42l1.66,-0.05l-0.66,0.68l-0.75,0.16l-3.0,-1.25l-0.46,-0.77l0.51,-0.52l0.68,1.19ZM230.87,84.48l-2.48,0.19l-0.52,-1.74l0.96,-2.17l2.03,-0.53l1.71,1.04l0.02,1.6l-0.22,0.46l-1.5,1.16ZM229.52,58.19l0.14,0.82l-4.99,-0.22l-2.73,0.63l-0.59,-0.23l-2.61,-2.4l0.08,-1.38l0.94,-0.25l5.61,0.51l4.14,2.54ZM222.12,105.0l-0.79,1.63l-0.75,-0.22l-0.52,-0.91l0.04,-0.09l0.84,-1.01l0.74,0.06l0.44,0.55ZM183.77,38.22l2.72,1.65l0.16,0.04l4.83,-0.01l1.92,1.52l-0.51,1.75l0.18,0.36l2.84,1.14l1.56,1.19l0.16,0.06l3.37,0.22l3.65,0.42l4.07,-1.1l5.05,-0.43l3.96,0.35l2.53,1.8l0.48,1.79l-1.37,1.16l-3.6,1.03l-3.22,-0.59l-7.17,0.76l-5.1,0.09l-4.0,-0.6l-6.48,-1.56l-0.81,-2.57l-0.3,-2.49l-0.1,-0.19l-2.51,-2.25l-0.16,-0.07l-5.12,-0.63l-2.61,-1.45l0.75,-1.71l4.88,0.32ZM207.46,91.26l0.42,1.62l0.42,0.19l1.12,-0.55l1.35,0.99l2.74,1.39l2.73,1.2l0.2,1.74l0.35,0.26l1.72,-0.29l1.31,0.97l-1.72,0.96l-3.68,-0.9l-1.34,-1.71l-0.43,-0.04l-2.46,2.1l-3.23,1.85l-0.74,-1.98l-0.31,-0.19l-2.47,0.28l1.49,-1.34l0.1,-0.19l0.32,-3.15l0.79,-3.45l1.34,0.25ZM215.59,102.66l-2.73,2.0l-1.49,-0.08l-0.37,-0.7l1.61,-1.56l3.0,0.03l-0.02,0.3ZM202.79,24.07l0.11,0.12l2.54,1.53l-3.01,1.47l-4.55,4.07l-4.3,0.38l-5.07,-0.68l-2.51,-2.09l0.03,-1.72l1.86,-1.4l0.1,-0.34l-0.29,-0.2l-4.49,0.04l-2.63,-1.79l-1.45,-2.36l1.61,-2.38l1.65,-1.69l2.47,-0.4l0.19,-0.48l-0.72,-0.89l5.1,-0.26l3.1,3.05l0.13,0.07l4.21,1.25l3.99,1.06l1.92,3.65ZM187.5,59.3l-0.15,0.1l-2.59,3.4l-2.5,-0.15l-1.47,-3.92l0.04,-2.24l1.22,-1.92l2.34,-1.26l5.11,0.17l4.28,1.06l-3.36,3.86l-2.9,0.9ZM186.19,48.8l-1.15,1.63l-3.42,-0.35l-2.68,-1.15l1.11,-1.88l3.34,-1.27l2.01,1.63l0.79,1.38ZM185.78,35.41l-0.95,0.13l-4.48,-0.33l-0.4,-0.91l4.5,0.07l1.45,0.82l-0.1,0.21ZM180.76,32.56l-3.43,1.03l-1.85,-1.14l-1.01,-1.92l-0.16,-1.87l2.87,0.2l1.39,0.35l2.75,1.75l-0.55,1.6ZM181.03,76.32l-1.21,1.2l-3.19,-1.26l-0.18,-0.01l-1.92,0.45l-2.88,-1.67l1.84,-1.16l1.6,-1.77l2.45,1.17l1.45,0.77l2.05,2.28ZM169.72,54.76l2.83,0.97l0.14,0.01l4.25,-0.58l0.47,1.01l-2.19,2.16l0.07,0.48l3.61,1.95l-0.41,3.84l-3.87,1.68l-2.23,-0.36l-1.73,-1.75l-6.07,-3.53l0.03,-1.01l4.79,0.55l0.3,-0.16l-0.04,-0.34l-2.55,-2.89l2.59,-2.05ZM174.44,40.56l1.49,1.87l0.07,2.48l-1.07,3.52l-3.87,0.48l-2.41,-0.72l0.05,-2.72l-0.33,-0.3l-3.79,0.36l-0.13,-3.31l2.36,0.14l0.15,-0.03l3.7,-1.74l3.44,0.29l0.31,-0.22l0.03,-0.12ZM170.14,31.5l0.75,1.74l-3.52,-0.52l-4.19,-1.77l-4.65,-0.17l1.65,-1.11l-0.05,-0.52l-2.86,-1.26l-0.13,-1.58l4.52,0.7l6.66,1.99l1.84,2.5ZM134.64,58.08l-1.08,1.93l0.34,0.44l5.44,-1.41l3.37,2.32l0.37,-0.02l2.66,-2.28l2.03,1.38l2.01,4.53l0.53,0.04l1.26,-1.93l0.03,-0.27l-1.67,-4.55l1.82,-0.58l2.36,0.73l2.69,1.84l1.53,4.46l0.77,3.24l0.15,0.19l4.22,2.26l4.32,2.04l-0.21,1.51l-3.87,0.34l-0.19,0.5l1.45,1.54l-0.65,1.23l-4.3,-0.65l-4.4,-1.19l-2.97,0.28l-4.67,1.48l-6.31,0.65l-4.27,0.39l-1.26,-1.91l-0.15,-0.12l-3.42,-1.2l-0.16,-0.01l-2.05,0.45l-2.66,-3.02l1.2,-0.34l3.82,-0.76l3.58,0.19l3.27,-0.78l0.23,-0.29l-0.24,-0.29l-4.84,-1.06l-5.42,0.35l-3.4,-0.09l-0.97,-1.22l5.39,-1.7l0.21,-0.33l-0.3,-0.25l-3.82,0.06l-3.95,-1.1l1.88,-3.13l1.68,-1.81l6.54,-2.84l2.11,0.77ZM158.85,56.58l-1.82,2.62l-3.38,-2.9l0.49,-0.39l3.17,-0.18l1.54,0.86ZM149.71,42.7l1.0,1.87l0.37,0.14l2.17,-0.83l2.33,0.2l0.38,2.16l-1.38,2.17l-8.33,0.76l-6.34,2.15l-3.51,0.1l-0.22,-1.13l4.98,-2.12l0.17,-0.34l-0.31,-0.23l-11.27,0.6l-3.04,-0.78l3.14,-4.57l2.2,-1.35l6.87,1.7l4.4,3.0l0.14,0.05l4.37,0.39l0.27,-0.48l-3.41,-4.68l1.96,-1.62l2.28,0.53l0.79,2.32ZM145.44,29.83l-2.18,0.77l-3.79,-0.0l0.02,-0.31l2.34,-1.5l1.2,0.23l2.42,0.83ZM144.83,34.5l-4.44,1.46l-3.18,-1.48l1.6,-1.36l3.51,-0.53l3.1,0.75l-0.6,1.16ZM119.02,65.87l-6.17,2.07l-1.19,-1.82l-0.13,-0.11l-5.48,-2.32l0.92,-1.7l1.73,-3.44l2.16,-3.15l-0.02,-0.36l-2.09,-2.56l7.84,-0.71l3.59,1.02l6.32,0.27l2.35,1.37l2.25,1.71l-2.68,1.04l-6.21,3.41l-3.1,3.28l-0.08,0.21l0.0,1.81ZM129.66,35.4l-0.3,3.55l-1.77,1.67l-2.34,0.27l-4.62,2.2l-3.89,0.76l-2.83,-0.93l3.85,-3.52l5.04,-3.36l3.75,0.07l3.11,-0.7ZM111.24,152.74l-0.82,0.29l-3.92,-1.39l-0.7,-1.06l-0.12,-0.1l-2.15,-1.09l-0.41,-0.84l-0.2,-0.16l-2.44,-0.56l-0.84,-1.56l0.1,-0.36l2.34,0.64l1.53,0.5l2.28,0.34l0.78,1.04l1.24,1.55l0.09,0.08l2.42,1.3l0.81,1.39ZM88.54,134.82l0.14,0.02l2.0,-0.23l-0.67,3.48l0.06,0.24l1.78,2.22l-0.24,-0.0l-1.4,-1.42l-0.91,-1.53l-1.26,-1.08l-0.42,-1.35l0.09,-0.66l0.82,0.31Z", "name": "Canada"}, "CG": {"path": "M453.66,296.61l-0.9,-0.82l-0.35,-0.04l-0.83,0.48l-0.77,0.83l-1.65,-2.13l1.66,-1.2l0.08,-0.39l-0.81,-1.43l0.59,-0.43l1.62,-0.29l0.24,-0.24l0.1,-0.58l0.94,0.84l0.19,0.08l2.21,0.11l0.27,-0.14l0.81,-1.29l0.32,-1.76l-0.27,-1.96l-0.06,-0.15l-1.08,-1.35l1.02,-2.74l-0.09,-0.34l-0.62,-0.5l-0.22,-0.06l-1.66,0.18l-0.55,-1.03l0.12,-0.73l2.85,0.09l1.98,0.65l2.0,0.59l0.38,-0.25l0.17,-1.3l1.26,-2.24l1.34,-1.19l1.54,0.38l1.35,0.12l-0.11,1.15l-0.74,1.34l-0.5,1.61l-0.31,2.22l0.12,1.41l-0.4,0.9l-0.06,0.88l-0.24,0.67l-1.57,1.15l-1.24,1.41l-1.09,2.43l-0.03,0.13l0.08,1.95l-0.55,0.69l-1.46,1.23l-1.32,1.41l-0.61,-0.29l-0.13,-0.57l-0.29,-0.23l-1.36,-0.02l-0.23,0.1l-0.72,0.81l-0.41,-0.16Z", "name": "Republic of the Congo"}, "CF": {"path": "M459.41,266.56l1.9,-0.17l0.22,-0.12l0.36,-0.5l0.14,0.02l0.55,0.51l0.29,0.07l3.15,-0.96l0.12,-0.07l1.05,-0.97l1.29,-0.87l0.12,-0.33l-0.17,-0.61l0.38,-0.12l2.36,0.15l0.15,-0.03l2.36,-1.17l0.12,-0.1l1.78,-2.72l1.18,-0.96l1.23,-0.34l0.21,0.79l0.07,0.13l1.37,1.5l0.01,0.86l-0.39,1.0l-0.01,0.17l0.16,0.78l0.1,0.17l0.91,0.76l1.89,1.09l1.24,0.92l0.02,0.67l0.12,0.23l1.67,1.3l0.99,1.03l0.61,1.46l0.14,0.15l1.79,0.95l0.2,0.4l-0.44,0.14l-1.54,-0.06l-1.98,-0.26l-0.93,0.22l-0.19,0.14l-0.3,0.48l-0.57,0.05l-0.91,-0.49l-0.26,-0.01l-2.7,1.21l-1.04,-0.23l-0.21,0.03l-0.34,0.19l-0.12,0.13l-0.64,1.3l-1.67,-0.43l-1.77,-0.24l-1.58,-0.91l-2.06,-0.85l-0.27,0.02l-1.42,0.88l-0.97,1.27l-0.06,0.14l-0.19,1.46l-1.3,-0.11l-1.67,-0.42l-0.27,0.07l-1.55,1.41l-0.99,1.76l-0.14,-1.18l-0.13,-0.22l-1.1,-0.78l-0.86,-1.2l-0.2,-0.84l-0.07,-0.13l-1.07,-1.19l0.16,-0.59l0.0,-0.15l-0.24,-1.01l0.18,-1.77l0.5,-0.38l0.09,-0.11l1.18,-2.4Z", "name": "Central African Republic"}, "CD": {"path": "M497.85,276.25l-0.14,2.77l0.2,0.3l0.57,0.19l-0.47,0.52l-1.0,0.71l-0.96,1.31l-0.56,1.22l-0.16,2.04l-0.54,0.89l-0.04,0.15l-0.02,1.76l-0.63,0.61l-0.09,0.2l-0.08,1.33l-0.2,0.11l-0.15,0.21l-0.23,1.37l0.03,0.2l0.6,1.08l0.16,2.96l0.44,2.29l-0.24,1.25l0.01,0.15l0.5,1.46l0.07,0.12l1.41,1.37l1.09,2.56l-0.51,-0.11l-3.45,0.45l-0.67,0.3l-0.15,0.15l-0.71,1.61l0.01,0.26l0.52,1.03l-0.43,2.9l-0.31,2.55l0.13,0.29l0.7,0.46l1.75,0.99l0.31,-0.01l0.26,-0.17l0.15,1.9l-1.44,-0.02l-0.94,-1.28l-0.94,-1.1l-0.17,-0.1l-1.76,-0.33l-0.5,-1.18l-0.42,-0.15l-1.44,0.75l-1.79,-0.32l-0.77,-1.05l-0.2,-0.12l-1.59,-0.23l-0.97,0.04l-0.1,-0.53l-0.27,-0.25l-0.86,-0.06l-1.13,-0.15l-1.62,0.37l-1.04,-0.06l-0.32,0.09l0.11,-2.56l-0.08,-0.21l-0.77,-0.87l-0.17,-1.41l0.36,-1.47l-0.03,-0.21l-0.48,-0.91l-0.04,-1.52l-0.3,-0.29l-2.65,0.02l0.13,-0.53l-0.29,-0.37l-1.28,0.01l-0.28,0.21l-0.07,0.24l-1.35,0.09l-0.26,0.18l-0.62,1.45l-0.25,0.42l-1.17,-0.3l-0.19,0.01l-0.79,0.34l-1.44,0.18l-1.41,-1.96l-0.7,-1.47l-0.61,-1.86l-0.28,-0.21l-7.39,-0.03l-0.92,0.3l-0.78,-0.03l-0.78,0.25l-0.11,-0.25l0.35,-0.15l0.18,-0.26l0.07,-1.02l0.33,-0.52l0.72,-0.42l0.52,0.2l0.33,-0.08l0.76,-0.86l0.99,0.02l0.11,0.48l0.16,0.2l0.94,0.44l0.35,-0.07l1.46,-1.56l1.44,-1.21l0.68,-0.85l0.06,-0.2l-0.08,-1.99l1.04,-2.33l1.1,-1.23l1.62,-1.19l0.11,-0.14l0.29,-0.8l0.08,-0.94l0.38,-0.82l0.03,-0.16l-0.13,-1.38l0.3,-2.16l0.47,-1.51l0.73,-1.31l0.04,-0.12l0.15,-1.51l0.21,-1.66l0.89,-1.16l1.16,-0.7l1.9,0.79l1.69,0.95l1.81,0.24l1.85,0.48l0.35,-0.16l0.71,-1.43l0.16,-0.09l1.03,0.23l0.19,-0.02l2.65,-1.19l0.86,0.46l0.17,0.03l0.81,-0.08l0.23,-0.14l0.31,-0.5l0.75,-0.17l1.83,0.26l1.64,0.06l0.72,-0.21l1.39,1.9l0.16,0.11l1.12,0.3l0.24,-0.04l0.58,-0.36l1.05,0.15l0.15,-0.02l1.15,-0.44l0.47,0.84l0.08,0.09l2.08,1.57Z", "name": "Democratic Republic of the Congo"}, "CZ": {"path": "M463.29,152.22l-0.88,-0.47l-0.18,-0.03l-1.08,0.15l-1.86,-0.94l-0.21,-0.02l-0.88,0.24l-0.13,0.07l-1.25,1.17l-1.63,-0.91l-1.38,-1.36l-1.22,-0.75l-0.24,-1.24l-0.33,-0.75l1.53,-0.6l0.98,-0.84l1.74,-0.62l0.11,-0.07l0.47,-0.47l0.46,0.27l0.24,0.03l0.96,-0.3l1.06,0.95l0.15,0.07l1.57,0.24l-0.1,0.6l0.16,0.32l1.36,0.68l0.41,-0.15l0.28,-0.62l1.29,0.28l0.19,0.84l0.26,0.23l1.73,0.18l0.74,1.02l-0.17,0.0l-0.25,0.13l-0.32,0.49l-0.46,0.11l-0.22,0.23l-0.13,0.57l-0.32,0.1l-0.2,0.22l-0.03,0.14l-0.65,0.25l-1.05,-0.05l-0.28,0.17l-0.22,0.43Z", "name": "Czech Republic"}, "CY": {"path": "M505.03,193.75l-1.51,0.68l-1.0,-0.3l-0.32,-0.63l0.69,-0.06l0.41,0.13l0.19,-0.0l0.62,-0.22l0.31,0.02l0.06,0.22l0.49,0.17l0.06,-0.01Z", "name": "Cyprus"}, "CR": {"path": "M213.0,263.84l-0.98,-0.4l-0.3,-0.31l0.16,-0.24l0.05,-0.21l-0.09,-0.56l-0.1,-0.18l-0.76,-0.65l-0.99,-0.5l-0.74,-0.28l-0.13,-0.58l-0.12,-0.18l-0.66,-0.45l-0.34,-0.0l-0.13,0.31l0.13,0.59l-0.17,0.21l-0.34,-0.42l-0.14,-0.1l-0.7,-0.22l-0.23,-0.34l0.01,-0.62l0.31,-0.74l-0.14,-0.38l-0.3,-0.15l0.47,-0.4l1.48,0.6l0.26,-0.02l0.47,-0.27l0.58,0.15l0.35,0.44l0.17,0.11l0.74,0.17l0.27,-0.07l0.3,-0.27l0.52,1.09l0.97,1.02l0.77,0.71l-0.41,0.1l-0.23,0.3l0.01,1.02l0.12,0.24l0.2,0.14l-0.07,0.05l-0.11,0.3l0.08,0.37l-0.23,0.63Z", "name": "Costa Rica"}, "CU": {"path": "M215.01,226.09l2.08,0.18l1.94,0.03l2.24,0.86l0.95,0.92l0.25,0.08l2.22,-0.28l0.79,0.55l3.68,2.81l0.19,0.06l0.77,-0.03l1.18,0.42l-0.12,0.47l0.27,0.37l1.78,0.1l1.59,0.9l-0.11,0.22l-1.5,0.3l-1.64,0.13l-1.75,-0.2l-2.69,0.19l1.0,-0.86l-0.03,-0.48l-1.02,-0.68l-0.13,-0.05l-1.52,-0.16l-0.74,-0.64l-0.57,-1.42l-0.3,-0.19l-1.36,0.1l-2.23,-0.67l-0.71,-0.52l-0.14,-0.06l-3.2,-0.4l-0.42,-0.25l0.56,-0.39l0.12,-0.33l-0.27,-0.22l-2.46,-0.13l-0.2,0.06l-1.72,1.31l-0.94,0.03l-0.25,0.15l-0.29,0.53l-1.04,0.24l-0.29,-0.07l0.7,-0.43l0.1,-0.11l0.5,-0.87l1.04,-0.54l1.23,-0.49l1.86,-0.25l0.62,-0.28Z", "name": "Cuba"}, "SZ": {"path": "M500.95,353.41l-0.41,0.97l-1.16,0.23l-1.29,-1.26l-0.02,-0.71l0.63,-0.93l0.23,-0.7l0.47,-0.12l1.04,0.4l0.32,1.05l0.2,1.08Z", "name": "Swaziland"}, "SY": {"path": "M510.84,199.83l0.09,-0.11l0.07,-0.2l-0.04,-1.08l0.56,-1.4l1.3,-1.01l0.1,-0.34l-0.41,-1.11l-0.24,-0.19l-0.89,-0.11l-0.2,-1.84l0.55,-1.05l1.3,-1.22l0.09,-0.19l0.09,-1.09l0.39,0.27l0.25,0.04l2.66,-0.77l1.35,0.52l2.06,-0.01l2.93,-1.08l1.35,0.04l2.14,-0.34l-0.83,1.16l-1.31,0.68l-0.16,0.3l0.23,2.03l-0.9,3.25l-5.43,2.87l-4.79,2.91l-2.32,-0.92Z", "name": "Syria"}, "KG": {"path": "M599.04,172.15l0.38,-0.9l1.43,-0.37l4.04,1.02l0.37,-0.23l0.36,-1.64l1.17,-0.52l3.45,1.24l0.2,-0.0l0.86,-0.31l4.09,0.08l3.61,0.31l1.18,1.02l0.11,0.06l1.19,0.34l-0.13,0.26l-3.84,1.58l-0.13,0.1l-0.81,1.08l-3.08,0.34l-0.24,0.16l-0.85,1.7l-2.43,-0.37l-0.14,0.01l-1.79,0.61l-2.39,1.4l-0.12,0.39l0.25,0.49l-0.48,0.45l-4.57,0.43l-3.04,-0.94l-2.45,0.18l0.14,-1.02l2.42,0.44l0.27,-0.08l0.81,-0.81l1.76,0.27l0.21,-0.05l3.21,-2.14l-0.03,-0.51l-2.97,-1.57l-0.26,-0.01l-1.64,0.69l-1.38,-0.84l1.81,-1.67l-0.09,-0.5l-0.46,-0.18Z", "name": "Kyrgyzstan"}, "KE": {"path": "M523.3,287.04l0.06,0.17l1.29,1.8l-1.46,0.84l-0.11,0.11l-0.55,0.93l-0.81,0.16l-0.24,0.24l-0.34,1.69l-0.81,1.06l-0.46,1.58l-0.76,0.63l-3.3,-2.3l-0.16,-1.32l-0.15,-0.23l-9.35,-5.28l-0.02,-2.4l1.92,-2.63l0.91,-1.83l0.01,-0.24l-1.09,-2.86l-0.29,-1.24l-1.09,-1.63l2.93,-2.85l0.92,0.3l0.0,1.19l0.09,0.22l0.86,0.83l0.21,0.08l1.65,0.0l3.09,2.08l0.16,0.05l0.79,0.03l0.54,-0.06l0.58,0.28l1.67,0.2l0.28,-0.12l0.69,-0.98l2.04,-0.94l0.86,0.73l0.19,0.07l1.1,0.0l-1.82,2.36l-0.06,0.18l0.03,9.12Z", "name": "Kenya"}, "SS": {"path": "M505.7,261.39l0.02,1.64l-0.27,0.55l-1.15,0.05l-0.24,0.15l-0.85,1.44l0.22,0.45l1.44,0.17l1.15,1.12l0.42,0.95l0.14,0.15l1.06,0.54l1.33,2.45l-3.06,2.98l-1.44,1.08l-1.75,0.01l-1.92,0.56l-1.5,-0.53l-0.27,0.03l-0.85,0.57l-1.98,-1.5l-0.56,-1.02l-0.37,-0.13l-1.32,0.5l-1.08,-0.15l-0.2,0.04l-0.56,0.35l-0.9,-0.24l-1.44,-1.97l-0.39,-0.77l-0.13,-0.13l-1.78,-0.94l-0.65,-1.5l-1.08,-1.12l-1.57,-1.22l-0.02,-0.68l-0.12,-0.23l-1.37,-1.02l-1.17,-0.68l0.2,-0.08l0.86,-0.48l0.14,-0.18l0.63,-2.22l0.6,-1.02l1.47,-0.28l0.35,0.56l1.29,1.48l0.14,0.09l0.69,0.22l0.22,-0.02l0.83,-0.4l1.58,0.08l0.26,0.39l0.25,0.13l2.49,0.0l0.3,-0.25l0.06,-0.35l1.13,-0.42l0.18,-0.18l0.22,-0.63l0.68,-0.38l1.95,1.37l0.23,0.05l1.29,-0.26l0.19,-0.12l1.23,-1.8l1.36,-1.37l0.08,-0.25l-0.21,-1.52l-0.06,-0.15l-0.25,-0.3l0.94,-0.08l0.26,-0.21l0.1,-0.32l0.6,0.09l-0.25,1.67l0.3,1.83l0.11,0.19l1.22,0.94l0.25,0.73l-0.04,1.2l0.26,0.31l0.09,0.01Z", "name": "South Sudan"}, "SR": {"path": "M278.1,270.26l2.71,0.45l0.31,-0.14l0.19,-0.32l1.82,-0.16l2.25,0.56l-1.09,1.81l-0.04,0.19l0.2,1.72l0.05,0.13l0.9,1.35l-0.39,0.99l-0.21,1.09l-0.48,0.8l-1.2,-0.44l-0.17,-0.01l-1.12,0.24l-0.95,-0.21l-0.35,0.2l-0.25,0.73l0.05,0.29l0.3,0.35l-0.06,0.13l-1.01,-0.15l-1.42,-2.03l-0.32,-1.36l-0.29,-0.23l-0.63,-0.0l-0.95,-1.56l0.41,-1.16l0.01,-0.17l-0.08,-0.35l1.29,-0.56l0.18,-0.22l0.35,-1.97Z", "name": "Suriname"}, "KH": {"path": "M680.28,257.89l-0.93,-1.2l-1.24,-2.56l-0.56,-2.9l1.45,-1.92l3.07,-0.46l2.26,0.35l2.03,0.98l0.38,-0.11l1.0,-1.55l1.86,0.79l0.52,1.51l-0.28,2.82l-4.05,1.88l-0.12,0.45l0.79,1.1l-2.2,0.17l-2.08,0.98l-1.89,-0.33Z", "name": "Cambodia"}, "SV": {"path": "M197.02,248.89l0.18,-0.05l0.59,0.17l0.55,0.51l0.64,0.35l0.06,0.22l0.37,0.21l1.01,-0.28l0.38,0.13l0.16,0.13l-0.14,0.81l-0.18,0.38l-1.22,-0.03l-0.84,-0.23l-1.11,-0.52l-1.31,-0.15l-0.49,-0.38l0.02,-0.08l0.76,-0.57l0.46,-0.27l0.11,-0.35Z", "name": "El Salvador"}, "SK": {"path": "M468.01,150.02l0.05,0.07l0.36,0.1l0.85,-0.37l1.12,1.02l0.33,0.05l1.38,-0.65l1.07,0.3l0.16,0.0l1.69,-0.43l1.95,1.02l-0.51,0.64l-0.45,1.2l-0.32,0.2l-2.55,-0.93l-0.17,-0.01l-0.82,0.2l-0.17,0.11l-0.53,0.68l-0.94,0.32l-0.14,-0.11l-0.29,-0.04l-1.18,0.48l-0.95,0.09l-0.26,0.21l-0.15,0.47l-1.84,0.34l-0.82,-0.31l-1.14,-0.73l-0.2,-0.89l0.42,-0.84l0.91,0.05l0.12,-0.02l0.86,-0.33l0.18,-0.21l0.03,-0.13l0.32,-0.1l0.2,-0.22l0.12,-0.55l0.39,-0.1l0.18,-0.13l0.3,-0.45l0.43,-0.0Z", "name": "Slovakia"}, "KR": {"path": "M737.31,185.72l0.84,0.08l0.27,-0.12l0.89,-1.2l1.63,-0.13l1.1,-0.2l0.21,-0.16l0.12,-0.24l1.86,2.95l0.59,1.79l0.02,3.17l-0.84,1.38l-2.23,0.55l-1.95,1.14l-1.91,0.21l-0.22,-1.21l0.45,-2.07l-0.01,-0.17l-0.99,-2.67l1.54,-0.4l0.17,-0.46l-1.55,-2.24Z", "name": "South Korea"}, "SI": {"path": "M455.77,159.59l1.79,0.21l0.18,-0.04l1.2,-0.68l2.12,-0.08l0.21,-0.1l0.38,-0.42l0.1,0.01l0.28,0.62l-1.71,0.71l-0.18,0.22l-0.21,1.1l-0.71,0.26l-0.2,0.28l0.01,0.55l-0.59,-0.04l-0.79,-0.47l-0.38,0.06l-0.36,0.41l-0.84,-0.05l0.05,-0.15l-0.56,-1.24l0.21,-1.17Z", "name": "Slovenia"}, "KP": {"path": "M747.76,172.02l-0.23,-0.04l-0.26,0.08l-1.09,1.02l-0.78,1.06l-0.06,0.19l0.09,1.95l-1.12,0.57l-0.53,0.58l-0.88,0.82l-1.69,0.51l-1.09,0.79l-0.12,0.22l-0.07,1.17l-0.22,0.25l0.09,0.47l0.96,0.46l1.22,1.1l-0.19,0.37l-0.91,0.16l-1.75,0.14l-0.22,0.12l-0.87,1.18l-0.95,-0.09l-0.3,0.18l-0.97,-0.44l-0.39,0.13l-0.25,0.44l-0.29,0.09l-0.03,-0.2l-0.18,-0.23l-0.62,-0.25l-0.43,-0.29l0.52,-0.97l0.52,-0.3l0.13,-0.38l-0.18,-0.42l0.59,-1.47l0.01,-0.21l-0.16,-0.48l-0.22,-0.2l-1.41,-0.31l-0.82,-0.55l1.74,-1.62l2.73,-1.58l1.62,-1.96l0.96,0.76l0.17,0.06l2.17,0.11l0.31,-0.37l-0.32,-1.31l3.61,-1.21l0.16,-0.13l0.79,-1.34l1.25,1.38Z", "name": "North Korea"}, "SO": {"path": "M543.8,256.48l0.61,-0.05l1.14,-0.37l1.31,-0.25l0.12,-0.05l1.11,-0.81l0.57,-0.0l0.03,0.39l-0.23,1.49l0.01,1.25l-0.52,0.92l-0.7,2.71l-1.19,2.79l-1.54,3.2l-2.13,3.66l-2.12,2.79l-2.92,3.39l-2.47,2.0l-3.76,2.5l-2.33,1.9l-2.77,3.06l-0.61,1.35l-0.28,0.29l-1.22,-1.69l-0.03,-8.92l2.12,-2.76l0.59,-0.68l1.47,-0.04l0.18,-0.06l2.15,-1.71l3.16,-0.11l0.21,-0.09l7.08,-7.55l1.76,-2.12l1.14,-1.57l0.06,-0.18l0.01,-4.67Z", "name": "Somalia"}, "SN": {"path": "M379.28,250.34l-0.95,-1.82l-0.09,-0.1l-0.83,-0.6l0.62,-0.28l0.13,-0.11l1.21,-1.8l0.6,-1.31l0.71,-0.68l1.09,0.2l0.18,-0.02l1.17,-0.53l1.25,-0.03l1.17,0.73l1.59,0.65l1.47,1.83l1.59,1.7l0.12,1.56l0.49,1.46l0.1,0.14l0.85,0.65l0.18,0.82l-0.08,0.57l-0.13,0.05l-1.29,-0.19l-0.29,0.13l-0.11,0.16l-0.35,0.04l-1.83,-0.61l-5.84,-0.13l-0.12,0.02l-0.6,0.26l-0.87,-0.06l-1.01,0.32l-0.26,-1.26l1.9,0.04l0.16,-0.04l0.54,-0.32l0.37,-0.02l0.15,-0.05l0.78,-0.5l0.92,0.46l0.12,0.03l1.09,0.04l0.15,-0.03l1.08,-0.57l0.11,-0.44l-0.51,-0.74l-0.39,-0.1l-0.76,0.39l-0.62,-0.01l-0.92,-0.58l-0.18,-0.05l-0.79,0.04l-0.2,0.09l-0.48,0.51l-2.41,0.06Z", "name": "Senegal"}, "SL": {"path": "M392.19,267.53l-0.44,-0.12l-1.73,-0.97l-1.24,-1.28l-0.4,-0.84l-0.27,-1.65l1.21,-1.0l0.09,-0.12l0.27,-0.66l0.32,-0.41l0.56,-0.05l0.16,-0.07l0.5,-0.41l1.75,0.0l0.59,0.77l0.49,0.96l-0.07,0.64l0.04,0.19l0.36,0.58l-0.03,0.84l0.24,0.2l-0.64,0.65l-1.13,1.37l-0.06,0.14l-0.12,0.66l-0.43,0.58Z", "name": "Sierra Leone"}, "SB": {"path": "M826.74,311.51l0.23,0.29l-0.95,-0.01l-0.39,-0.63l0.65,0.27l0.45,0.09ZM825.01,308.52l-1.18,-1.39l-0.37,-1.06l0.24,0.0l0.82,1.84l0.49,0.6ZM823.21,309.42l-0.44,0.03l-1.43,-0.24l-0.32,-0.24l0.08,-0.5l1.29,0.31l0.72,0.47l0.11,0.18ZM817.9,303.81l2.59,1.44l0.3,0.41l-1.21,-0.66l-1.34,-0.89l-0.34,-0.3ZM813.77,302.4l0.48,0.34l0.1,0.08l-0.33,-0.17l-0.25,-0.25Z", "name": "Solomon Islands"}, "SA": {"path": "M528.24,243.1l-0.2,-0.69l-0.07,-0.12l-0.69,-0.71l-0.18,-0.94l-0.12,-0.19l-1.24,-0.89l-1.28,-2.09l-0.7,-2.08l-0.07,-0.11l-1.73,-1.79l-0.11,-0.07l-1.03,-0.39l-1.57,-2.36l-0.27,-1.72l0.1,-1.53l-0.03,-0.15l-1.44,-2.93l-1.25,-1.13l-1.34,-0.56l-0.72,-1.33l0.11,-0.49l-0.02,-0.2l-0.7,-1.38l-0.08,-0.1l-0.68,-0.56l-0.97,-1.98l-2.8,-4.03l-0.25,-0.13l-0.85,0.01l0.29,-1.11l0.12,-0.97l0.23,-0.81l2.52,0.39l0.23,-0.06l1.08,-0.84l0.6,-0.95l1.78,-0.35l0.22,-0.17l0.37,-0.83l0.74,-0.42l0.08,-0.46l-2.17,-2.4l4.55,-1.26l0.12,-0.06l0.36,-0.32l2.83,0.71l3.67,1.91l7.04,5.5l0.17,0.06l4.64,0.22l2.06,0.24l0.55,1.15l0.28,0.17l1.56,-0.06l0.9,2.15l0.14,0.15l1.14,0.57l0.39,0.85l0.11,0.13l1.59,1.06l0.12,0.91l-0.23,0.83l0.01,0.18l0.32,0.9l0.07,0.11l0.68,0.7l0.33,0.86l0.37,0.65l0.09,0.1l0.76,0.53l0.25,0.04l0.45,-0.12l0.35,0.75l0.1,0.63l0.96,2.68l0.23,0.19l7.53,1.33l0.27,-0.09l0.24,-0.26l0.87,1.41l-1.58,4.96l-7.34,2.54l-7.28,1.02l-2.34,1.17l-0.12,0.1l-1.74,2.63l-0.86,0.32l-0.49,-0.68l-0.28,-0.12l-0.92,0.12l-2.32,-0.25l-0.41,-0.23l-0.15,-0.04l-2.89,0.06l-0.63,0.2l-0.91,-0.59l-0.43,0.11l-0.66,1.27l-0.03,0.21l0.21,0.89l-0.6,0.45Z", "name": "Saudi Arabia"}, "SE": {"path": "M476.42,90.44l-0.15,0.1l-2.43,2.86l-0.07,0.24l0.36,2.31l-3.84,3.1l-4.83,3.38l-0.11,0.15l-1.82,5.45l0.03,0.26l1.78,2.68l2.27,1.99l-2.13,3.88l-2.49,0.82l-0.2,0.24l-0.95,6.05l-1.32,3.09l-2.82,-0.32l-0.3,0.16l-1.34,2.64l-2.48,0.14l-0.76,-3.15l-2.09,-4.04l-1.85,-5.01l1.03,-1.98l2.06,-2.53l0.06,-0.13l0.83,-4.45l-0.06,-0.25l-1.54,-1.86l-0.15,-5.0l1.52,-3.48l2.28,0.06l0.27,-0.16l0.87,-1.59l-0.01,-0.31l-0.8,-1.21l3.79,-5.63l4.07,-7.54l2.23,0.01l0.29,-0.22l0.59,-2.15l4.46,0.66l0.34,-0.26l0.34,-2.64l1.21,-0.14l3.24,2.08l3.78,2.85l0.06,6.37l0.03,0.14l0.67,1.29l-3.95,1.07Z", "name": "Sweden"}, "SD": {"path": "M505.98,259.75l-0.31,-0.9l-0.1,-0.14l-1.2,-0.93l-0.27,-1.66l0.29,-1.83l-0.25,-0.34l-1.16,-0.17l-0.33,0.21l-0.11,0.37l-1.3,0.11l-0.21,0.49l0.55,0.68l0.18,1.29l-1.31,1.33l-1.18,1.72l-1.04,0.21l-2.0,-1.4l-0.32,-0.02l-0.95,0.52l-0.14,0.16l-0.21,0.6l-1.16,0.43l-0.19,0.23l-0.04,0.27l-2.08,0.0l-0.25,-0.39l-0.24,-0.13l-1.81,-0.09l-0.14,0.03l-0.8,0.38l-0.49,-0.16l-1.22,-1.39l-0.42,-0.67l-0.31,-0.14l-1.81,0.35l-0.2,0.14l-0.72,1.24l-0.61,2.14l-0.73,0.4l-0.62,0.22l-0.83,-0.68l-0.12,-0.6l0.38,-0.97l0.01,-1.14l-0.08,-0.2l-1.39,-1.53l-0.25,-0.97l0.03,-0.57l-0.11,-0.25l-0.81,-0.66l-0.03,-1.34l-0.04,-0.14l-0.52,-0.98l-0.31,-0.15l-0.42,0.07l0.12,-0.44l0.63,-1.03l0.03,-0.23l-0.24,-0.88l0.69,-0.66l0.02,-0.41l-0.4,-0.46l0.58,-1.39l1.04,-1.71l1.97,0.16l0.32,-0.3l-0.12,-10.24l0.02,-0.8l2.59,-0.01l0.3,-0.3l0.0,-4.92l29.19,0.0l0.68,2.17l-0.4,0.35l-0.1,0.27l0.36,2.69l0.93,3.15l0.12,0.16l2.05,1.4l-0.99,1.15l-1.75,0.4l-0.15,0.08l-0.79,0.79l-0.08,0.17l-0.24,1.69l-1.07,3.75l-0.0,0.16l0.25,0.96l-0.38,2.1l-0.98,2.41l-1.52,1.3l-1.07,1.94l-0.25,0.99l-1.08,0.64l-0.13,0.18l-0.46,1.65Z", "name": "Sudan"}, "DO": {"path": "M241.7,234.97l0.15,-0.22l1.73,0.01l1.43,0.64l0.15,0.03l0.45,-0.04l0.36,0.74l0.28,0.17l1.02,-0.04l-0.04,0.43l0.27,0.33l1.03,0.09l0.91,0.7l-0.57,0.64l-0.99,-0.47l-0.16,-0.03l-1.11,0.11l-0.79,-0.12l-0.26,0.09l-0.38,0.4l-0.66,0.11l-0.28,-0.45l-0.38,-0.12l-0.83,0.37l-0.14,0.13l-0.85,1.49l-0.27,-0.17l-0.1,-0.58l0.05,-0.67l-0.07,-0.21l-0.44,-0.53l0.35,-0.25l0.12,-0.19l0.19,-1.0l-0.2,-1.4Z", "name": "Dominican Republic"}, "DJ": {"path": "M528.78,253.36l0.34,0.45l-0.06,0.76l-1.26,0.54l-0.05,0.53l0.82,0.53l-0.57,0.83l-0.3,-0.25l-0.27,-0.05l-0.56,0.17l-1.07,-0.03l-0.04,-0.56l-0.16,-0.56l0.76,-1.07l0.76,-0.97l0.89,0.18l0.25,-0.06l0.51,-0.42Z", "name": "Djibouti"}, "DK": {"path": "M452.4,129.07l-1.27,2.39l-2.25,-1.69l-0.26,-1.08l3.15,-1.0l0.63,1.39ZM447.87,126.25l-0.35,0.76l-0.47,-0.24l-0.38,0.09l-1.8,2.53l-0.03,0.29l0.56,1.4l-1.22,0.4l-1.68,-0.41l-0.92,-1.76l-0.07,-3.47l0.38,-0.88l0.62,-0.93l2.07,-0.21l0.19,-0.1l0.84,-0.95l1.5,-0.76l-0.06,1.26l-0.7,1.1l-0.03,0.25l0.3,1.0l0.18,0.19l1.06,0.42Z", "name": "Denmark"}, "DE": {"path": "M445.51,131.69l0.03,0.94l0.21,0.28l2.32,0.74l-0.02,1.0l0.37,0.3l2.55,-0.65l1.36,-0.89l2.63,1.27l1.09,1.01l0.51,1.51l-0.6,0.78l-0.0,0.36l0.88,1.17l0.58,1.68l-0.18,1.08l0.03,0.18l0.87,1.81l-0.66,0.2l-0.55,-0.32l-0.36,0.05l-0.58,0.58l-1.73,0.62l-0.99,0.84l-1.77,0.7l-0.16,0.4l0.42,0.94l0.26,1.34l0.14,0.2l1.25,0.76l1.22,1.2l-0.71,1.2l-0.81,0.37l-0.17,0.32l0.34,1.99l-0.04,0.09l-0.47,-0.39l-0.17,-0.07l-1.2,-0.1l-1.85,0.57l-2.15,-0.13l-0.29,0.18l-0.21,0.5l-0.96,-0.67l-0.24,-0.05l-0.67,0.16l-2.6,-0.94l-0.34,0.1l-0.42,0.57l-1.64,-0.02l0.26,-1.88l1.24,-2.15l-0.21,-0.45l-3.54,-0.58l-0.98,-0.71l0.12,-1.26l-0.05,-0.2l-0.44,-0.64l0.27,-2.18l-0.38,-3.14l1.17,-0.0l0.27,-0.17l0.63,-1.26l0.65,-3.17l-0.02,-0.17l-0.41,-1.0l0.32,-0.47l1.77,-0.16l0.37,0.6l0.47,0.06l1.7,-1.69l0.06,-0.33l-0.55,-1.24l-0.09,-1.51l1.5,0.36l0.16,-0.01l1.22,-0.4Z", "name": "Germany"}, "YE": {"path": "M553.53,242.65l-1.51,0.58l-0.17,0.16l-0.48,1.14l-0.07,0.79l-2.31,1.0l-3.98,1.19l-2.28,1.8l-0.97,0.12l-0.7,-0.14l-0.23,0.05l-1.42,1.03l-1.51,0.47l-2.07,0.13l-0.68,0.15l-0.17,0.1l-0.49,0.6l-0.57,0.16l-0.18,0.13l-0.3,0.49l-1.06,-0.05l-0.13,0.02l-0.73,0.32l-1.48,-0.11l-0.55,-1.26l0.07,-1.32l-0.04,-0.16l-0.39,-0.72l-0.48,-1.85l-0.52,-0.79l0.08,-0.02l0.22,-0.36l-0.23,-1.05l0.24,-0.39l0.04,-0.19l-0.09,-0.95l0.96,-0.72l0.11,-0.31l-0.23,-0.98l0.46,-0.88l0.75,0.49l0.26,0.03l0.63,-0.22l2.76,-0.06l0.5,0.25l2.42,0.26l0.85,-0.11l0.52,0.71l0.35,0.1l1.17,-0.43l0.15,-0.12l1.75,-2.64l2.22,-1.11l6.95,-0.96l2.55,5.58Z", "name": "Yemen"}, "AT": {"path": "M463.17,154.15l-0.14,0.99l-1.15,0.01l-0.24,0.47l0.39,0.56l-0.75,1.84l-0.36,0.4l-2.06,0.07l-0.14,0.04l-1.18,0.67l-1.96,-0.23l-3.43,-0.78l-0.5,-0.97l-0.33,-0.16l-2.47,0.55l-0.2,0.16l-0.18,0.37l-1.27,-0.38l-1.28,-0.09l-0.81,-0.41l0.25,-0.51l0.03,-0.18l-0.05,-0.28l0.35,-0.08l1.16,0.81l0.45,-0.13l0.27,-0.64l2.0,0.12l1.84,-0.57l1.05,0.09l0.71,0.59l0.47,-0.11l0.23,-0.54l0.02,-0.17l-0.32,-1.85l0.69,-0.31l0.13,-0.12l0.73,-1.23l1.61,0.89l0.35,-0.04l1.35,-1.27l0.7,-0.19l1.84,0.93l0.18,0.03l1.08,-0.15l0.81,0.43l-0.07,0.15l-0.02,0.2l0.24,1.06Z", "name": "Austria"}, "DZ": {"path": "M450.58,224.94l-8.31,4.86l-7.23,5.12l-3.46,1.13l-2.42,0.22l-0.02,-1.33l-0.2,-0.28l-1.15,-0.42l-1.45,-0.69l-0.55,-1.13l-0.1,-0.12l-8.45,-5.72l-17.72,-12.17l0.03,-0.38l-0.02,-3.21l3.84,-1.91l2.46,-0.41l2.1,-0.75l0.14,-0.11l0.9,-1.3l2.84,-1.06l0.19,-0.27l0.09,-1.81l1.21,-0.2l0.15,-0.07l1.06,-0.96l3.19,-0.46l0.23,-0.18l0.46,-1.08l-0.08,-0.34l-0.6,-0.54l-0.83,-2.85l-0.18,-1.8l-0.82,-1.57l2.13,-1.37l2.65,-0.49l0.13,-0.05l1.55,-1.15l2.34,-0.85l4.2,-0.51l4.07,-0.23l1.21,0.41l0.23,-0.01l2.3,-1.11l2.52,-0.02l0.94,0.62l0.2,0.05l1.25,-0.13l-0.36,1.03l-0.01,0.14l0.39,2.66l-0.56,2.2l-1.49,1.52l-0.08,0.24l0.22,2.12l0.11,0.2l1.94,1.58l0.02,0.54l0.12,0.23l1.45,1.06l1.04,4.85l0.81,2.42l0.13,1.19l-0.43,2.17l0.17,1.28l-0.31,1.53l0.2,1.56l-0.9,1.02l-0.01,0.38l1.43,1.88l0.09,1.06l0.04,0.13l0.89,1.48l0.37,0.12l1.03,-0.43l1.79,1.12l0.89,1.34Z", "name": "Algeria"}, "US": {"path": "M892.64,99.05l1.16,0.57l0.21,0.02l1.45,-0.38l1.92,0.99l2.17,0.47l-1.65,0.72l-1.75,-0.79l-0.93,-0.7l-0.21,-0.06l-2.11,0.22l-0.35,-0.2l0.09,-0.87ZM183.29,150.37l0.39,1.54l0.12,0.17l0.78,0.55l0.14,0.05l1.74,0.2l2.52,0.5l2.4,0.98l0.17,0.02l1.96,-0.4l3.01,0.81l0.91,-0.02l2.22,-0.88l4.67,2.33l3.86,2.01l0.21,0.71l0.15,0.18l0.33,0.17l-0.02,0.05l0.23,0.43l0.67,0.1l0.21,-0.05l0.1,-0.07l0.05,0.29l0.09,0.16l0.5,0.5l0.21,0.09l0.56,0.0l0.13,0.13l-0.2,0.36l0.12,0.41l2.49,1.39l0.99,5.24l-0.69,1.68l-1.16,1.64l-0.6,1.18l-0.06,0.31l0.04,0.22l0.28,0.43l0.11,0.1l0.85,0.47l0.15,0.04l0.63,0.0l0.14,-0.04l2.87,-1.58l2.6,-0.49l3.28,-1.5l0.17,-0.23l0.04,-0.43l-0.23,-0.93l-0.24,-0.39l0.74,-0.32l4.7,-0.01l0.25,-0.13l0.77,-1.15l2.9,-2.41l1.04,-0.52l8.35,-0.02l0.28,-0.21l0.2,-0.6l0.7,-0.14l1.06,-0.48l0.13,-0.11l0.92,-1.49l0.75,-2.39l1.67,-2.08l0.59,0.6l0.3,0.07l1.52,-0.49l0.88,0.72l-0.0,4.14l0.08,0.2l1.6,1.72l0.31,0.72l-2.42,1.35l-2.55,1.05l-2.64,0.9l-0.14,0.11l-1.33,1.81l-0.44,0.7l-0.05,0.15l-0.03,1.6l0.03,0.14l0.83,1.59l0.24,0.16l0.78,0.06l-1.15,0.33l-1.25,-0.04l-1.83,0.52l-2.51,0.29l-2.17,0.88l-0.17,0.36l0.33,0.22l3.55,-0.54l0.15,0.11l-2.87,0.73l-1.19,0.0l-0.16,-0.33l-0.36,0.06l-0.76,0.82l0.17,0.5l0.42,0.08l-0.45,1.75l-1.4,1.74l-0.04,-0.17l-0.21,-0.22l-0.48,-0.13l-0.77,-0.69l-0.36,-0.03l-0.12,0.34l0.52,1.58l0.09,0.14l0.52,0.43l0.03,0.87l-0.74,1.05l-0.39,0.63l0.05,-0.12l-0.08,-0.34l-1.19,-1.03l-0.28,-2.31l-0.26,-0.26l-0.32,0.19l-0.48,1.27l-0.01,0.19l0.39,1.33l-1.14,-0.31l-0.36,0.18l0.14,0.38l1.57,0.85l0.1,2.58l0.22,0.28l0.55,0.15l0.21,0.81l0.33,2.72l-1.46,1.94l-2.5,0.81l-0.12,0.07l-1.58,1.58l-1.15,0.17l-0.15,0.06l-1.27,1.03l-0.09,0.13l-0.32,0.85l-2.71,1.79l-1.45,1.37l-1.18,1.64l-0.05,0.12l-0.39,1.96l0.0,0.13l0.44,1.91l0.85,2.37l1.1,1.91l0.03,1.2l1.16,3.07l-0.08,1.74l-0.1,0.99l-0.57,1.48l-0.54,0.24l-0.97,-0.26l-0.34,-1.02l-0.12,-0.16l-0.89,-0.58l-2.44,-4.28l-0.34,-0.94l0.49,-1.71l-0.02,-0.21l-0.7,-1.5l-2.0,-2.35l-0.11,-0.08l-0.98,-0.42l-0.25,0.01l-2.42,1.19l-0.26,-0.08l-1.26,-1.29l-1.57,-0.68l-0.16,-0.02l-2.79,0.34l-2.18,-0.3l-1.98,0.19l-1.12,0.45l-0.14,0.44l0.4,0.65l-0.04,1.02l0.09,0.22l0.29,0.3l-0.06,0.05l-0.77,-0.33l-0.26,0.01l-0.87,0.48l-1.64,-0.08l-1.79,-1.39l-0.23,-0.06l-2.11,0.33l-1.75,-0.61l-0.14,-0.01l-1.61,0.2l-2.11,0.64l-0.11,0.06l-2.25,1.99l-2.53,1.21l-1.43,1.38l-0.58,1.22l-0.03,0.12l-0.03,1.86l0.13,1.32l0.3,0.62l-0.46,0.04l-1.71,-0.57l-1.85,-0.79l-0.63,-1.14l-0.54,-1.85l-0.07,-0.12l-1.45,-1.51l-0.86,-1.58l-1.26,-1.87l-0.09,-0.09l-1.76,-1.09l-0.17,-0.04l-2.05,0.05l-0.23,0.12l-1.44,1.97l-1.84,-0.72l-1.19,-0.76l-0.6,-1.45l-0.9,-1.52l-1.49,-1.21l-1.27,-0.87l-0.89,-0.96l-0.22,-0.1l-4.34,-0.0l-0.3,0.3l-0.0,0.84l-6.62,0.02l-5.66,-1.93l-3.48,-1.24l0.11,-0.25l-0.3,-0.42l-3.18,0.3l-2.6,0.2l-0.35,-1.19l-0.08,-0.13l-1.62,-1.61l-0.13,-0.08l-1.02,-0.29l-0.22,-0.66l-0.25,-0.2l-1.31,-0.13l-0.82,-0.7l-0.16,-0.07l-2.25,-0.27l-0.48,-0.34l-0.28,-1.44l-0.07,-0.14l-2.41,-2.84l-2.03,-3.89l0.08,-0.58l-0.1,-0.27l-1.08,-0.94l-1.87,-2.36l-0.33,-2.31l-0.07,-0.15l-1.24,-1.5l0.52,-2.4l-0.09,-2.57l-0.78,-2.3l0.96,-2.83l0.61,-5.66l-0.46,-4.26l-0.79,-2.71l-0.68,-1.4l0.13,-0.26l3.24,0.97l1.28,2.88l0.52,0.06l0.62,-0.84l0.06,-0.22l-0.4,-2.61l-0.74,-2.29l68.9,-0.0l0.3,-0.3l0.01,-0.95l0.32,-0.01ZM32.5,67.43l1.75,1.99l0.41,0.04l1.02,-0.81l3.79,0.25l-0.1,0.72l0.24,0.34l3.83,0.77l2.6,-0.44l5.21,1.41l4.84,0.43l1.9,0.57l0.15,0.01l3.25,-0.71l3.72,1.32l2.52,0.58l-0.03,38.14l0.29,0.3l2.41,0.11l2.34,1.0l1.7,1.59l2.22,2.42l0.42,0.03l2.41,-2.04l2.25,-1.08l1.23,1.76l1.71,1.53l2.24,1.62l1.54,2.56l2.56,4.09l0.11,0.11l4.1,2.17l0.06,1.93l-1.12,1.35l-1.22,-1.14l-2.08,-1.05l-0.68,-2.94l-0.09,-0.16l-3.18,-2.84l-1.32,-3.35l-0.25,-0.19l-2.43,-0.24l-3.93,-0.09l-2.85,-1.02l-5.24,-3.85l-6.77,-2.04l-3.52,0.3l-4.84,-1.7l-2.96,-1.6l-0.23,-0.02l-2.78,0.8l-0.21,0.35l0.46,2.31l-1.11,0.19l-2.9,0.78l-2.24,1.26l-2.42,0.68l-0.29,-1.79l1.07,-3.49l2.54,-1.11l0.12,-0.45l-0.69,-0.96l-0.41,-0.07l-3.19,2.12l-1.76,2.54l-3.57,2.62l-0.03,0.46l1.63,1.59l-2.14,2.38l-2.64,1.49l-2.49,1.09l-0.16,0.17l-0.58,1.48l-3.8,1.79l-0.14,0.14l-0.75,1.57l-2.75,1.41l-1.62,-0.25l-0.16,0.02l-2.35,0.98l-2.54,1.19l-2.06,1.15l-4.05,0.93l-0.1,-0.15l2.45,-1.45l2.49,-1.1l2.61,-1.88l3.03,-0.39l0.19,-0.1l1.2,-1.41l3.43,-2.11l0.61,-0.75l1.81,-1.24l0.13,-0.2l0.42,-2.7l1.24,-2.12l-0.03,-0.35l-0.34,-0.09l-2.73,1.05l-0.67,-0.53l-0.39,0.02l-1.13,1.11l-1.43,-1.62l-0.49,0.06l-0.41,0.8l-0.67,-1.31l-0.42,-0.12l-2.43,1.43l-1.18,-0.0l-0.18,-1.86l0.43,-1.3l-0.09,-0.33l-1.61,-1.33l-0.26,-0.06l-3.11,0.68l-2.0,-1.66l-1.61,-0.85l-0.01,-1.97l-0.11,-0.23l-1.76,-1.48l0.86,-1.96l2.01,-2.13l0.88,-1.94l1.79,-0.25l1.65,0.6l0.31,-0.06l1.91,-1.8l1.67,0.31l0.22,-0.04l1.91,-1.23l0.13,-0.33l-0.47,-1.82l-0.15,-0.19l-1.0,-0.52l1.51,-1.27l0.09,-0.34l-0.29,-0.19l-1.62,0.06l-2.66,0.88l-0.13,0.09l-0.62,0.72l-1.77,-0.8l-0.16,-0.02l-3.48,0.44l-3.5,-0.92l-1.06,-1.61l-2.78,-2.09l3.07,-1.51l5.52,-2.01l1.65,0.0l-0.28,1.73l0.31,0.35l5.29,-0.16l0.23,-0.49l-2.03,-2.59l-0.1,-0.08l-3.03,-1.58l-1.79,-2.12l-2.4,-1.83l-3.18,-1.27l1.13,-1.84l4.28,-0.14l0.15,-0.05l3.16,-2.0l0.13,-0.17l0.57,-2.07l2.43,-2.02l2.42,-0.52l4.67,-1.98l2.22,0.29l0.2,-0.04l3.74,-2.37l3.57,0.91ZM37.66,123.49l-2.31,1.26l-1.04,-0.75l-0.31,-1.35l2.06,-1.16l1.24,-0.51l1.48,0.22l0.76,0.81l-1.89,1.49ZM30.89,233.84l1.2,0.57l0.35,0.3l0.48,0.69l-1.6,0.86l-0.3,0.31l-0.24,-0.14l0.05,-0.54l-0.02,-0.15l-0.36,-0.83l0.05,-0.12l0.39,-0.38l0.07,-0.31l-0.09,-0.27ZM29.06,231.89l0.5,0.14l0.31,0.19l-0.46,0.1l-0.34,-0.43ZM25.02,230.13l0.2,-0.11l0.4,0.47l-0.43,-0.05l-0.17,-0.31ZM21.29,228.68l0.1,-0.07l0.22,0.02l0.02,0.21l-0.02,0.02l-0.32,-0.18ZM6.0,113.33l-1.19,0.45l-1.5,-0.64l-0.94,-0.63l1.76,-0.46l1.71,0.29l0.16,0.98Z", "name": "United States of America"}, "LV": {"path": "M473.99,127.16l0.07,-2.15l1.15,-2.11l2.05,-1.07l1.84,2.48l0.25,0.12l2.01,-0.07l0.29,-0.25l0.45,-2.58l1.85,-0.56l0.98,0.4l2.13,1.33l0.16,0.05l1.97,0.01l1.02,0.7l0.21,1.67l0.71,1.84l-2.44,1.23l-1.36,0.53l-2.28,-1.62l-0.12,-0.05l-1.18,-0.2l-0.28,-0.6l-0.31,-0.17l-2.43,0.35l-4.17,-0.23l-0.12,0.02l-2.45,0.93Z", "name": "Latvia"}, "UY": {"path": "M276.9,363.17l1.3,-0.23l2.4,2.04l0.22,0.07l0.82,-0.07l2.48,1.7l1.93,1.5l1.28,1.67l-0.95,1.14l-0.04,0.31l0.63,1.45l-0.96,1.57l-2.65,1.47l-1.73,-0.53l-0.15,-0.01l-1.25,0.28l-2.22,-1.16l-0.16,-0.03l-1.56,0.08l-1.33,-1.36l0.17,-1.58l0.48,-0.55l0.07,-0.2l-0.02,-2.74l0.66,-2.8l0.57,-2.02Z", "name": "Uruguay"}, "LB": {"path": "M510.44,198.11l-0.48,0.03l-0.26,0.17l-0.15,0.32l-0.21,-0.0l0.72,-1.85l1.19,-1.9l0.74,0.09l0.27,0.73l-1.19,0.93l-0.09,0.13l-0.54,1.36Z", "name": "Lebanon"}, "LA": {"path": "M684.87,248.8l0.61,-0.86l0.05,-0.16l0.11,-2.17l-0.08,-0.22l-1.96,-2.16l-0.15,-2.44l-0.08,-0.18l-1.9,-2.1l-0.19,-0.1l-1.89,-0.18l-0.29,0.15l-0.42,0.76l-1.21,0.06l-0.67,-0.41l-0.31,-0.0l-2.2,1.29l-0.05,-1.77l0.61,-2.7l-0.27,-0.37l-1.44,-0.1l-0.12,-1.31l-0.12,-0.21l-0.87,-0.65l0.38,-0.68l1.76,-1.41l0.08,0.22l0.27,0.2l1.33,0.07l0.31,-0.34l-0.35,-2.75l0.85,-0.25l1.32,1.88l1.11,2.36l0.27,0.17l2.89,0.02l0.78,1.82l-1.32,0.56l-0.12,0.09l-0.72,0.93l0.1,0.45l2.93,1.52l3.62,5.27l1.88,1.78l0.58,1.67l-0.38,2.11l-1.87,-0.79l-0.37,0.11l-0.99,1.54l-1.51,-0.73Z", "name": "Laos"}, "TW": {"path": "M725.6,222.5l-1.5,4.22l-0.82,1.65l-1.01,-1.7l-0.26,-1.8l1.4,-2.48l1.8,-1.81l0.76,0.53l-0.38,1.39Z", "name": "Taiwan"}, "TT": {"path": "M266.35,259.46l0.41,-0.39l0.09,-0.23l-0.04,-0.75l1.14,-0.26l0.2,0.03l-0.07,1.37l-1.73,0.23Z", "name": "Trinidad and Tobago"}, "TR": {"path": "M513.25,175.38l3.63,1.17l0.14,0.01l2.88,-0.45l2.11,0.26l0.18,-0.03l2.9,-1.53l2.51,-0.13l2.25,1.37l0.36,0.88l-0.23,1.36l0.19,0.33l1.81,0.72l0.61,0.53l-1.31,0.64l-0.16,0.34l0.76,3.24l-0.44,0.8l0.01,0.3l1.19,2.02l-0.71,0.29l-0.74,-0.62l-0.15,-0.07l-2.91,-0.37l-0.15,0.02l-1.04,0.43l-2.78,0.44l-1.44,-0.03l-2.83,1.06l-1.95,0.01l-1.28,-0.52l-0.2,-0.01l-2.62,0.76l-0.7,-0.48l-0.47,0.22l-0.13,1.49l-1.01,0.94l-0.58,-0.82l0.79,-0.9l0.04,-0.34l-0.31,-0.15l-1.46,0.23l-2.03,-0.64l-0.3,0.07l-1.65,1.58l-3.58,0.3l-1.94,-1.47l-0.17,-0.06l-2.7,-0.1l-0.28,0.17l-0.51,1.06l-1.47,0.29l-2.32,-1.46l-0.17,-0.05l-2.55,0.05l-1.4,-2.7l-1.72,-1.54l1.11,-2.06l-0.07,-0.37l-1.35,-1.19l2.47,-2.51l3.74,-0.11l0.26,-0.17l0.96,-2.07l4.56,0.38l0.19,-0.05l2.97,-1.92l2.84,-0.83l4.03,-0.06l4.31,2.08ZM488.85,176.8l-1.81,1.38l-0.57,-1.01l0.02,-0.36l0.45,-0.25l0.13,-0.15l0.78,-1.87l-0.11,-0.37l-0.72,-0.47l1.91,-0.71l1.89,0.35l0.25,0.97l0.17,0.2l1.87,0.83l-0.19,0.31l-2.82,0.16l-0.18,0.07l-1.06,0.91Z", "name": "Turkey"}, "LK": {"path": "M625.44,266.07l-0.35,2.4l-0.9,0.61l-1.91,0.5l-1.04,-1.75l-0.43,-3.5l1.0,-3.6l1.34,1.09l1.13,1.72l1.16,2.52Z", "name": "Sri Lanka"}, "TN": {"path": "M444.91,206.18l-0.99,-4.57l-0.12,-0.18l-1.43,-1.04l-0.02,-0.53l-0.11,-0.22l-1.95,-1.59l-0.19,-1.85l1.44,-1.47l0.08,-0.14l0.59,-2.34l-0.38,-2.77l0.44,-1.28l2.52,-1.08l1.41,0.28l-0.06,1.2l0.43,0.28l1.81,-0.9l0.02,0.06l-1.14,1.28l-0.08,0.2l-0.02,1.32l0.11,0.24l0.74,0.6l-0.29,2.18l-1.56,1.35l-0.09,0.32l0.48,1.54l0.28,0.21l1.11,0.04l0.55,1.17l0.15,0.14l0.76,0.35l-0.12,1.79l-1.1,0.72l-0.8,0.91l-1.68,1.04l-0.13,0.32l0.25,1.08l-0.18,0.96l-0.74,0.39Z", "name": "Tunisia"}, "TL": {"path": "M734.21,307.22l0.17,-0.34l1.99,-0.52l1.72,-0.08l0.78,-0.3l0.29,0.1l-0.43,0.32l-2.57,1.09l-1.71,0.59l-0.05,-0.49l-0.19,-0.36Z", "name": "East Timor"}, "TM": {"path": "M553.16,173.51l-0.12,1.0l-0.26,-0.65l0.38,-0.34ZM553.54,173.16l0.13,-0.12l0.43,-0.09l-0.56,0.21ZM555.68,172.6l0.65,-0.14l1.53,0.76l1.71,2.29l0.27,0.12l1.27,-0.14l2.81,-0.04l0.29,-0.38l-0.35,-1.27l1.98,-0.97l1.96,-1.63l3.05,1.44l0.25,2.23l0.14,0.22l0.96,0.61l0.18,0.05l2.61,-0.13l0.68,0.44l1.2,2.97l0.1,0.13l2.85,2.03l1.67,1.41l2.66,1.45l3.13,1.17l-0.05,1.23l-0.36,-0.04l-1.12,-0.73l-0.44,0.14l-0.34,0.89l-1.96,0.52l-0.22,0.23l-0.47,2.17l-1.26,0.78l-1.93,0.42l-0.21,0.18l-0.46,1.14l-1.64,0.33l-2.3,-0.97l-0.2,-2.23l-0.28,-0.27l-1.76,-0.1l-2.78,-2.48l-0.15,-0.07l-1.95,-0.31l-2.82,-1.48l-1.78,-0.27l-0.18,0.03l-1.03,0.51l-1.6,-0.08l-0.22,0.08l-1.72,1.6l-1.83,0.46l-0.39,-1.7l0.36,-3.0l-0.16,-0.3l-1.73,-0.88l0.57,-1.77l-0.25,-0.39l-1.33,-0.14l0.41,-1.85l2.05,0.63l0.21,-0.01l2.2,-0.95l0.09,-0.49l-1.78,-1.75l-0.69,-1.66l-0.07,-0.03Z", "name": "Turkmenistan"}, "TJ": {"path": "M597.99,178.71l-0.23,0.23l-2.57,-0.47l-0.35,0.25l-0.24,1.7l0.32,0.34l2.66,-0.22l3.15,0.95l4.47,-0.42l0.58,2.45l0.39,0.21l0.71,-0.25l1.22,0.53l-0.06,1.01l0.29,1.28l-2.19,-0.0l-1.71,-0.21l-0.23,0.07l-1.51,1.25l-1.05,0.27l-0.77,0.51l-0.71,-0.67l0.22,-2.28l-0.24,-0.32l-0.43,-0.08l0.17,-0.57l-0.16,-0.36l-1.36,-0.66l-0.34,0.05l-1.08,1.01l-0.09,0.15l-0.25,1.09l-0.24,0.26l-1.36,-0.05l-0.27,0.14l-0.65,1.06l-0.58,-0.39l-0.3,-0.02l-1.68,0.86l-0.36,-0.16l1.28,-2.65l0.02,-0.2l-0.54,-2.17l-0.18,-0.21l-1.53,-0.58l0.41,-0.82l1.89,0.13l0.26,-0.12l1.19,-1.63l0.77,-1.82l2.66,-0.55l-0.33,0.87l0.01,0.23l0.36,0.82l0.3,0.18l0.23,-0.02Z", "name": "Tajikistan"}, "LS": {"path": "M493.32,359.69l0.69,0.65l-0.65,1.12l-0.38,0.8l-1.27,0.39l-0.18,0.15l-0.4,0.77l-0.59,0.18l-1.59,-1.78l1.16,-1.5l1.3,-1.02l0.97,-0.46l0.94,0.72Z", "name": "Lesotho"}, "TH": {"path": "M677.42,253.68l-1.7,-0.88l-0.14,-0.03l-1.77,0.04l0.3,-1.64l-0.3,-0.35l-2.21,0.01l-0.3,0.28l-0.2,2.76l-2.15,5.9l-0.02,0.13l0.17,1.83l0.28,0.27l1.45,0.07l0.93,2.1l0.44,2.15l0.08,0.15l1.4,1.44l0.16,0.09l1.43,0.27l1.04,1.05l-0.58,0.73l-1.24,0.22l-0.15,-0.99l-0.15,-0.22l-2.04,-1.1l-0.36,0.06l-0.23,0.23l-0.72,-0.71l-0.41,-1.18l-0.06,-0.11l-1.33,-1.42l-1.22,-1.2l-0.5,0.13l-0.15,0.54l-0.14,-0.41l0.26,-1.48l0.73,-2.38l1.2,-2.57l1.37,-2.35l0.02,-0.27l-0.95,-2.26l0.03,-1.19l-0.29,-1.42l-0.06,-0.13l-1.65,-2.0l-0.46,-0.99l0.62,-0.34l0.13,-0.15l0.92,-2.23l-0.02,-0.27l-1.05,-1.74l-1.57,-1.86l-1.04,-1.96l0.76,-0.34l0.16,-0.16l1.07,-2.63l1.58,-0.1l0.16,-0.06l1.43,-1.11l1.24,-0.52l0.84,0.62l0.13,1.43l0.28,0.27l1.34,0.09l-0.54,2.39l0.05,2.39l0.45,0.25l2.48,-1.45l0.6,0.36l0.17,0.04l1.47,-0.07l0.25,-0.15l0.41,-0.73l1.58,0.15l1.76,1.93l0.15,2.44l0.08,0.18l1.94,2.15l-0.1,1.96l-0.66,0.93l-2.25,-0.34l-3.24,0.49l-0.19,0.12l-1.6,2.12l-0.06,0.24l0.48,2.46Z", "name": "Thailand"}, "TF": {"path": "M593.76,417.73l1.38,0.84l2.15,0.37l0.04,0.31l-0.59,1.24l-3.36,0.19l-0.05,-1.38l0.43,-1.56Z", "name": "French Southern and Antarctic Lands"}, "TG": {"path": "M425.23,269.29l-1.49,0.4l-0.43,-0.68l-0.64,-1.54l-0.18,-1.16l0.54,-2.21l-0.04,-0.24l-0.59,-0.86l-0.23,-1.9l0.0,-1.82l-0.07,-0.19l-0.95,-1.19l0.1,-0.41l1.58,0.04l-0.23,0.97l0.08,0.28l1.55,1.55l0.09,1.13l0.08,0.19l0.42,0.43l-0.11,5.66l0.52,1.53Z", "name": "Togo"}, "TD": {"path": "M457.57,252.46l0.23,-1.08l-0.28,-0.36l-1.32,-0.05l0.0,-1.35l-0.1,-0.22l-0.9,-0.82l0.99,-3.1l3.12,-2.37l0.12,-0.23l0.13,-3.33l0.95,-5.2l0.53,-1.09l-0.07,-0.36l-0.94,-0.81l-0.03,-0.7l-0.12,-0.23l-0.84,-0.61l-0.57,-3.76l2.21,-1.26l19.67,9.88l0.12,9.74l-1.83,-0.15l-0.28,0.14l-1.14,1.89l-0.68,1.62l0.05,0.31l0.33,0.38l-0.61,0.58l-0.08,0.3l0.25,0.93l-0.58,0.95l-0.29,1.01l0.34,0.37l0.67,-0.11l0.39,0.73l0.03,1.4l0.11,0.23l0.8,0.65l-0.01,0.24l-1.38,0.37l-0.11,0.06l-1.27,1.03l-1.83,2.76l-2.21,1.1l-2.34,-0.15l-0.82,0.25l-0.2,0.37l0.19,0.68l-1.16,0.79l-1.01,0.94l-2.92,0.89l-0.5,-0.46l-0.17,-0.08l-0.41,-0.05l-0.28,0.12l-0.38,0.54l-1.36,0.12l0.1,-0.18l0.01,-0.27l-0.78,-1.72l-0.35,-1.03l-0.17,-0.18l-1.03,-0.41l-1.29,-1.28l0.36,-0.78l0.9,0.2l0.14,-0.0l0.67,-0.17l1.36,0.02l0.26,-0.45l-1.32,-2.22l0.09,-1.64l-0.17,-1.68l-0.04,-0.13l-0.93,-1.53Z", "name": "Chad"}, "LY": {"path": "M457.99,226.38l-1.57,0.87l-1.25,-1.28l-0.13,-0.08l-3.85,-1.11l-1.04,-1.57l-0.09,-0.09l-1.98,-1.23l-0.27,-0.02l-0.93,0.39l-0.72,-1.2l-0.09,-1.07l-0.06,-0.16l-1.33,-1.75l0.83,-0.94l0.07,-0.24l-0.21,-1.64l0.31,-1.43l-0.17,-1.29l0.43,-2.26l-0.15,-1.33l-0.73,-2.18l0.99,-0.52l0.16,-0.21l0.22,-1.16l-0.22,-1.06l1.54,-0.95l0.81,-0.92l1.19,-0.78l0.14,-0.23l0.12,-1.76l2.57,0.84l0.16,0.01l0.99,-0.23l2.01,0.45l3.19,1.2l1.12,2.36l0.2,0.16l2.24,0.53l3.5,1.14l2.65,1.36l0.29,-0.01l1.22,-0.71l1.27,-1.32l0.07,-0.29l-0.55,-2.0l0.69,-1.19l1.7,-1.23l1.61,-0.35l3.2,0.54l0.78,1.14l0.24,0.13l0.85,0.01l0.84,0.47l2.35,0.31l0.42,0.63l-0.79,1.16l-0.04,0.26l0.35,1.08l-0.61,1.6l-0.0,0.2l0.73,2.16l0.0,24.24l-2.58,0.01l-0.3,0.29l-0.02,0.62l-19.55,-9.83l-0.28,0.01l-2.53,1.44Z", "name": "Libya"}, "AE": {"path": "M550.59,223.8l0.12,0.08l1.92,-0.41l3.54,0.15l0.23,-0.09l1.71,-1.79l1.86,-1.7l1.31,-1.36l0.26,0.5l0.28,1.72l-0.93,0.01l-0.3,0.26l-0.21,1.73l0.11,0.27l0.08,0.06l-0.7,0.32l-0.17,0.27l-0.01,0.99l-0.68,1.02l-0.05,0.15l-0.06,0.96l-0.32,0.36l-7.19,-1.27l-0.79,-2.22Z", "name": "United Arab Emirates"}, "VE": {"path": "M240.66,256.5l0.65,0.91l-0.03,1.13l-1.05,1.39l-0.03,0.31l0.95,2.0l0.32,0.17l1.08,-0.16l0.24,-0.21l0.56,-1.83l-0.06,-0.29l-0.71,-0.81l-0.1,-1.58l2.9,-0.96l0.19,-0.37l-0.29,-1.02l0.45,-0.41l0.72,1.43l0.26,0.16l1.65,0.04l1.46,1.27l0.08,0.72l0.3,0.27l2.28,0.02l2.55,-0.25l1.34,1.06l0.14,0.06l1.92,0.31l0.2,-0.03l1.4,-0.79l0.15,-0.25l0.02,-0.36l2.82,-0.14l1.17,-0.01l-0.41,0.14l-0.14,0.46l0.86,1.19l0.22,0.12l1.93,0.18l1.73,1.13l0.37,1.9l0.31,0.24l1.21,-0.05l0.52,0.32l-1.63,1.21l-0.11,0.17l-0.22,0.92l0.07,0.27l0.63,0.69l-0.31,0.24l-1.48,0.39l-0.22,0.3l0.04,1.03l-0.59,0.6l-0.01,0.41l1.67,1.87l0.23,0.48l-0.72,0.76l-2.71,0.91l-1.78,0.39l-0.13,0.06l-0.6,0.49l-1.84,-0.58l-1.89,-0.33l-0.18,0.03l-0.47,0.23l-0.02,0.53l0.96,0.56l-0.08,1.58l0.35,1.58l0.26,0.23l1.91,0.19l0.02,0.07l-1.54,0.62l-0.18,0.2l-0.25,0.92l-0.88,0.35l-1.85,0.58l-0.16,0.13l-0.4,0.64l-1.66,0.14l-1.22,-1.18l-0.79,-2.52l-0.67,-0.88l-0.66,-0.43l0.99,-0.98l0.09,-0.26l-0.09,-0.56l-0.08,-0.16l-0.66,-0.69l-0.47,-1.54l0.18,-1.67l0.55,-0.85l0.45,-1.35l-0.15,-0.36l-0.89,-0.43l-0.19,-0.02l-1.39,0.28l-1.76,-0.13l-0.92,0.23l-1.64,-2.01l-0.17,-0.1l-1.54,-0.33l-3.05,0.23l-0.5,-0.73l-0.15,-0.12l-0.45,-0.15l-0.05,-0.28l0.28,-0.86l0.01,-0.15l-0.2,-1.01l-0.08,-0.15l-0.5,-0.5l-0.3,-1.08l-0.25,-0.22l-0.89,-0.12l0.54,-1.18l0.29,-1.73l0.66,-0.85l0.94,-0.7l0.09,-0.11l0.3,-0.6Z", "name": "Venezuela"}, "AF": {"path": "M574.42,192.1l2.24,0.95l0.18,0.02l1.89,-0.38l0.22,-0.18l0.46,-1.14l1.82,-0.4l1.5,-0.91l0.14,-0.19l0.46,-2.12l1.93,-0.51l0.2,-0.18l0.26,-0.68l0.87,0.57l0.13,0.05l0.79,0.09l1.35,0.02l1.83,0.59l0.75,0.34l0.26,-0.01l1.66,-0.85l0.7,0.46l0.42,-0.09l0.72,-1.17l1.32,0.05l0.23,-0.1l0.39,-0.43l0.07,-0.14l0.24,-1.08l0.86,-0.81l0.94,0.46l-0.2,0.64l0.23,0.38l0.49,0.09l-0.21,2.15l0.09,0.25l0.99,0.94l0.38,0.03l0.83,-0.57l1.06,-0.27l0.12,-0.06l1.46,-1.21l1.63,0.2l2.4,0.0l0.17,0.32l-1.12,0.25l-1.23,0.52l-2.86,0.33l-2.69,0.6l-0.13,0.06l-1.46,1.25l-0.07,0.36l0.58,1.18l0.25,1.21l-1.13,1.08l-0.09,0.25l0.09,0.98l-0.53,0.79l-2.22,-0.08l-0.28,0.44l0.83,1.57l-1.3,0.58l-0.13,0.11l-1.06,1.69l-0.05,0.18l0.13,1.51l-0.73,0.58l-0.78,-0.22l-0.14,-0.01l-1.91,0.36l-0.23,0.19l-0.2,0.57l-1.65,-0.0l-0.22,0.1l-1.4,1.56l-0.08,0.19l-0.08,2.13l-2.99,1.05l-1.67,-0.23l-0.27,0.1l-0.39,0.46l-1.43,-0.31l-2.43,0.4l-3.69,-1.23l1.96,-2.15l0.08,-0.24l-0.21,-1.78l-0.23,-0.26l-1.69,-0.42l-0.19,-1.62l-0.77,-2.08l0.98,-1.41l-0.14,-0.45l-0.82,-0.31l0.6,-1.79l0.93,-3.21Z", "name": "Afghanistan"}, "IQ": {"path": "M534.42,190.89l0.13,0.14l1.5,0.78l0.15,1.34l-1.13,0.87l-0.11,0.16l-0.58,2.2l0.04,0.24l1.73,2.67l0.12,0.1l2.99,1.49l1.18,1.94l-0.39,1.89l0.29,0.36l0.5,-0.0l0.02,1.17l0.08,0.2l0.83,0.86l-2.36,-0.29l-0.29,0.13l-1.74,2.49l-4.4,-0.21l-7.03,-5.49l-3.73,-1.94l-2.92,-0.74l-0.89,-3.0l5.33,-2.81l0.15,-0.19l0.95,-3.43l-0.2,-2.0l1.19,-0.61l0.11,-0.09l1.23,-1.73l0.92,-0.38l2.75,0.35l0.81,0.68l0.31,0.05l0.94,-0.38l1.5,3.17Z", "name": "Iraq"}, "IS": {"path": "M384.26,87.96l-0.51,2.35l0.08,0.28l2.61,2.58l-2.99,2.83l-7.16,2.72l-2.08,0.7l-9.51,-1.71l1.89,-1.36l-0.07,-0.53l-4.4,-1.59l3.33,-0.59l0.25,-0.32l-0.11,-1.2l-0.25,-0.27l-4.82,-0.88l1.38,-2.2l3.54,-0.57l3.8,2.74l0.33,0.01l3.68,-2.18l3.02,1.12l0.25,-0.02l4.01,-2.18l3.72,0.27Z", "name": "Iceland"}, "IR": {"path": "M556.2,187.5l2.05,-0.52l0.13,-0.07l1.69,-1.57l1.55,0.08l0.15,-0.03l1.02,-0.5l1.64,0.25l2.82,1.48l1.91,0.3l2.8,2.49l0.18,0.08l1.61,0.09l0.19,2.09l-1.0,3.47l-0.69,2.04l0.18,0.38l0.73,0.28l-0.85,1.22l-0.04,0.28l0.81,2.19l0.19,1.72l0.23,0.26l1.69,0.42l0.17,1.43l-2.18,2.39l-0.01,0.4l1.22,1.42l1.0,1.62l0.12,0.11l2.23,1.11l0.06,2.2l0.2,0.27l1.03,0.38l0.14,0.83l-3.38,1.3l-0.18,0.19l-0.87,2.85l-4.44,-0.76l-2.75,-0.62l-2.64,-0.32l-1.01,-3.11l-0.17,-0.19l-1.2,-0.48l-0.18,-0.01l-1.99,0.51l-2.42,1.25l-2.89,-0.84l-2.48,-2.03l-2.41,-0.79l-1.61,-2.47l-1.84,-3.63l-0.36,-0.15l-1.22,0.4l-1.48,-0.84l-0.37,0.06l-0.72,0.82l-1.08,-1.12l-0.02,-1.35l-0.3,-0.29l-0.43,0.0l0.34,-1.64l-0.04,-0.22l-1.29,-2.11l-0.12,-0.11l-3.0,-1.49l-1.62,-2.49l0.52,-1.98l1.18,-0.92l0.11,-0.27l-0.19,-1.66l-0.16,-0.23l-1.55,-0.81l-1.58,-3.33l-1.3,-2.2l0.41,-0.75l0.03,-0.21l-0.73,-3.12l1.2,-0.59l0.35,0.9l1.26,1.35l0.15,0.09l1.81,0.39l0.91,-0.09l0.15,-0.06l2.9,-2.13l0.7,-0.16l0.48,0.56l-0.75,1.26l0.05,0.37l1.56,1.53l0.28,0.08l0.37,-0.09l0.7,1.89l0.21,0.19l2.31,0.59l1.69,1.4l0.15,0.07l3.66,0.49l3.91,-0.76l0.23,-0.19l0.19,-0.52Z", "name": "Iran"}, "AM": {"path": "M530.51,176.08l2.91,-0.39l0.41,0.63l0.11,0.1l0.66,0.36l-0.32,0.47l0.07,0.41l1.1,0.84l-0.53,0.7l0.06,0.42l1.06,0.8l1.01,0.44l0.04,1.56l-0.44,0.04l-0.88,-1.46l0.01,-0.37l-0.3,-0.31l-0.98,0.01l-0.65,-0.69l-0.26,-0.09l-0.38,0.06l-0.97,-0.82l-1.64,-0.65l0.2,-1.2l-0.02,-0.16l-0.28,-0.69Z", "name": "Armenia"}, "IT": {"path": "M451.68,158.58l0.2,0.16l3.3,0.75l-0.22,1.26l0.02,0.18l0.35,0.78l-1.4,-0.32l-0.21,0.03l-2.04,1.1l-0.16,0.29l0.13,1.47l-0.29,0.82l0.02,0.24l0.82,1.57l0.1,0.11l2.28,1.5l1.29,2.53l2.79,2.43l0.2,0.07l1.83,-0.02l0.31,0.34l-0.46,0.39l0.06,0.5l4.06,1.97l2.06,1.49l0.17,0.36l-0.24,0.53l-1.08,-1.07l-0.15,-0.08l-2.18,-0.49l-0.33,0.15l-1.05,1.91l0.11,0.4l1.63,0.98l-0.22,1.12l-0.84,0.14l-0.22,0.15l-1.27,2.38l-0.54,0.12l0.01,-0.47l0.48,-1.46l0.5,-0.58l0.03,-0.35l-0.97,-1.69l-0.76,-1.48l-0.17,-0.15l-0.94,-0.33l-0.68,-1.18l-0.16,-0.13l-1.53,-0.52l-1.03,-1.14l-0.19,-0.1l-1.78,-0.19l-1.88,-1.3l-2.27,-1.94l-1.64,-1.68l-0.76,-2.94l-0.21,-0.21l-1.22,-0.35l-2.01,-1.0l-0.24,-0.01l-1.15,0.42l-0.11,0.07l-1.38,1.36l-0.5,0.11l0.19,-0.87l-0.21,-0.35l-1.19,-0.34l-0.56,-2.06l0.76,-0.82l0.03,-0.36l-0.68,-1.08l0.04,-0.31l0.68,0.42l0.19,0.04l1.21,-0.15l0.14,-0.06l1.18,-0.89l0.25,0.29l0.25,0.1l1.19,-0.1l0.25,-0.18l0.45,-1.04l1.61,0.34l0.19,-0.02l1.1,-0.53l0.17,-0.22l0.15,-0.95l1.19,0.35l0.35,-0.16l0.23,-0.47l2.11,-0.47l0.45,0.89ZM459.35,184.63l-0.71,1.81l0.0,0.23l0.33,0.79l-0.37,1.03l-1.6,-0.91l-1.33,-0.34l-3.24,-1.36l0.23,-0.99l2.73,0.24l3.95,-0.5ZM443.95,175.91l1.26,1.77l-0.31,3.47l-0.82,-0.13l-0.26,0.08l-0.83,0.79l-0.64,-0.52l-0.1,-3.42l-0.44,-1.34l0.91,0.1l0.21,-0.06l1.01,-0.74Z", "name": "Italy"}, "VN": {"path": "M690.8,230.21l-2.86,1.93l-2.09,2.46l-0.06,0.11l-0.55,1.8l0.04,0.26l4.26,6.1l2.31,1.63l1.46,1.97l1.12,4.62l-0.32,4.3l-1.97,1.57l-2.85,1.62l-2.09,2.14l-2.83,2.13l-0.67,-1.19l0.65,-1.58l-0.09,-0.35l-1.47,-1.14l1.67,-0.79l2.57,-0.18l0.22,-0.47l-0.89,-1.24l3.88,-1.8l0.17,-0.24l0.31,-3.05l-0.01,-0.13l-0.56,-1.63l0.44,-2.48l-0.01,-0.15l-0.63,-1.81l-0.08,-0.12l-1.87,-1.77l-3.64,-5.3l-0.11,-0.1l-2.68,-1.39l0.45,-0.59l1.53,-0.65l0.16,-0.39l-0.97,-2.27l-0.27,-0.18l-2.89,-0.02l-1.04,-2.21l-1.28,-1.83l0.96,-0.46l1.97,0.01l2.43,-0.3l0.13,-0.05l1.95,-1.29l1.04,0.85l0.13,0.06l1.98,0.42l-0.32,1.21l0.09,0.3l1.19,1.07l0.12,0.07l1.88,0.51Z", "name": "Vietnam"}, "AR": {"path": "M258.11,341.34l1.4,1.81l0.51,-0.06l0.89,-1.94l2.51,0.1l0.36,0.49l4.6,4.31l0.15,0.08l1.99,0.39l3.01,1.93l2.5,1.01l0.28,0.91l-2.4,3.97l0.17,0.44l2.57,0.74l2.81,0.41l2.09,-0.44l0.14,-0.07l2.27,-2.06l0.09,-0.17l0.38,-2.2l0.88,-0.36l1.05,1.29l-0.04,1.88l-1.98,1.4l-1.72,1.13l-2.84,2.65l-3.34,3.73l-0.07,0.12l-0.63,2.22l-0.67,2.85l0.02,2.73l-0.47,0.54l-0.07,0.17l-0.36,3.28l0.12,0.27l3.03,2.32l-0.31,1.78l0.11,0.29l1.44,1.15l-0.11,1.17l-2.32,3.57l-3.59,1.51l-4.95,0.6l-2.72,-0.29l-0.32,0.38l0.5,1.67l-0.49,2.13l0.01,0.16l0.4,1.29l-1.27,0.88l-2.41,0.39l-2.33,-1.05l-0.31,0.04l-0.97,0.78l-0.11,0.27l0.35,2.98l0.16,0.23l1.69,0.91l0.31,-0.02l1.08,-0.75l0.46,0.96l-2.1,0.88l-2.01,1.89l-0.09,0.18l-0.36,3.05l-0.51,1.42l-2.16,0.01l-0.19,0.07l-1.96,1.59l-0.1,0.15l-0.72,2.34l0.08,0.31l2.46,2.31l0.13,0.07l2.09,0.56l-0.74,2.45l-2.86,1.75l-0.12,0.14l-1.59,3.71l-2.2,1.24l-0.1,0.09l-1.03,1.54l-0.04,0.23l0.81,3.45l0.06,0.13l1.13,1.32l-2.59,-0.57l-5.89,-0.44l-0.92,-1.73l0.05,-2.4l-0.34,-0.3l-1.49,0.19l-0.72,-0.98l-0.2,-3.21l1.79,-1.33l0.1,-0.13l0.79,-2.04l0.02,-0.16l-0.27,-1.52l1.31,-2.69l0.91,-4.15l-0.23,-1.72l0.91,-0.49l0.15,-0.33l-0.27,-1.16l-0.15,-0.2l-0.87,-0.46l0.65,-1.01l-0.04,-0.37l-1.06,-1.09l-0.54,-3.2l0.83,-0.51l0.14,-0.29l-0.42,-3.6l0.58,-2.98l0.64,-2.5l1.41,-1.0l0.12,-0.32l-0.75,-2.8l-0.01,-2.48l1.81,-1.78l0.09,-0.22l-0.06,-2.3l1.39,-2.69l0.03,-0.14l0.01,-2.58l-0.11,-0.24l-0.57,-0.45l-1.1,-4.59l1.49,-2.73l0.04,-0.17l-0.23,-2.59l0.86,-2.38l1.6,-2.48l1.74,-1.65l0.04,-0.39l-0.64,-0.89l0.42,-0.7l0.04,-0.16l-0.08,-4.26l2.55,-1.23l0.16,-0.18l0.86,-2.75l-0.01,-0.22l-0.22,-0.48l1.84,-2.1l3.0,0.59ZM256.77,438.98l-2.1,0.15l-1.18,-1.14l-0.19,-0.08l-1.53,-0.09l-2.38,-0.0l-0.0,-6.28l0.4,0.65l1.25,2.55l0.11,0.12l3.26,2.07l3.19,0.8l-0.82,1.26Z", "name": "Argentina"}, "AU": {"path": "M705.55,353.06l0.09,0.09l0.37,0.05l0.13,-0.35l-0.57,-1.69l0.48,0.3l0.71,0.99l0.34,0.11l0.2,-0.29l-0.04,-1.37l-0.04,-0.14l-1.22,-2.07l-0.28,-0.9l-0.51,-0.69l0.24,-1.33l0.52,-0.7l0.34,-1.32l0.01,-0.13l-0.25,-1.44l0.51,-0.94l0.1,1.03l0.23,0.26l0.32,-0.14l1.01,-1.72l1.94,-0.84l1.27,-1.14l1.84,-0.92l1.0,-0.18l0.6,0.28l0.26,-0.0l1.94,-0.96l1.48,-0.28l0.19,-0.13l0.32,-0.49l0.51,-0.18l1.42,0.05l2.63,-0.76l0.11,-0.06l1.36,-1.15l0.08,-0.1l0.61,-1.33l1.42,-1.27l0.1,-0.19l0.11,-1.03l0.06,-1.32l1.39,-1.74l0.85,1.79l0.4,0.14l1.07,-0.51l0.11,-0.45l-0.77,-1.05l0.53,-0.84l0.86,0.43l0.43,-0.22l0.29,-1.85l1.29,-1.19l0.6,-0.98l1.16,-0.4l0.2,-0.27l0.02,-0.34l0.74,0.2l0.38,-0.27l0.03,-0.44l1.98,-0.61l1.7,1.08l1.36,1.48l0.22,0.1l1.55,0.02l1.57,0.24l0.33,-0.4l-0.48,-1.27l1.09,-1.86l1.06,-0.63l0.1,-0.42l-0.28,-0.46l0.93,-1.24l1.36,-0.8l1.16,0.27l0.14,0.0l2.1,-0.48l0.23,-0.3l-0.05,-1.3l-0.18,-0.26l-1.08,-0.49l0.44,-0.12l1.52,0.58l1.39,1.06l2.11,0.65l0.19,-0.0l0.59,-0.21l1.44,0.72l0.27,0.0l1.37,-0.68l0.84,0.2l0.26,-0.06l0.37,-0.3l0.82,0.89l-0.56,1.14l-0.84,0.91l-0.75,0.07l-0.26,0.38l0.26,0.9l-0.67,1.15l-0.88,1.24l-0.05,0.25l0.18,0.72l0.12,0.17l1.99,1.42l1.96,0.84l1.25,0.86l1.8,1.51l0.19,0.07l0.63,-0.0l1.15,0.58l0.34,0.7l0.17,0.15l2.39,0.88l0.24,-0.02l1.65,-0.88l0.14,-0.16l0.49,-1.37l0.52,-1.19l0.31,-1.39l0.75,-2.02l0.01,-0.19l-0.33,-1.16l0.16,-0.67l0.0,-0.13l-0.28,-1.41l0.3,-1.78l0.42,-0.45l0.05,-0.33l-0.33,-0.73l0.56,-1.25l0.48,-1.39l0.07,-0.69l0.58,-0.59l0.48,0.84l0.17,1.53l0.17,0.24l0.47,0.23l0.09,0.9l0.05,0.14l0.87,1.23l0.17,1.33l-0.09,0.89l0.03,0.15l0.9,2.0l0.43,0.13l1.38,-0.83l0.71,0.92l1.06,0.88l-0.22,0.96l0.0,0.14l0.53,2.2l0.38,1.3l0.15,0.18l0.52,0.26l0.62,2.01l-0.23,1.27l0.02,0.18l0.81,1.76l0.14,0.14l2.69,1.35l3.21,2.21l-0.2,0.4l0.04,0.34l1.39,1.6l0.95,2.78l0.43,0.16l0.79,-0.46l0.85,0.96l0.39,0.05l0.22,-0.15l0.36,2.33l0.09,0.18l1.78,1.63l1.16,1.01l1.9,2.1l0.67,2.05l0.06,1.47l-0.17,1.64l0.03,0.17l1.16,2.22l-0.14,2.28l-0.43,1.24l-0.68,2.44l0.04,1.63l-0.48,1.92l-1.06,2.43l-1.79,1.32l-0.1,0.12l-0.91,2.15l-0.82,1.37l-0.76,2.47l-0.98,1.46l-0.63,2.14l-0.33,2.02l0.1,0.82l-1.21,0.85l-2.71,0.1l-0.13,0.03l-2.31,1.19l-1.21,1.17l-1.34,1.11l-1.89,-1.18l-1.33,-0.46l0.32,-1.24l-0.4,-0.35l-1.46,0.61l-2.06,1.98l-1.99,-0.73l-1.43,-0.46l-1.45,-0.22l-2.32,-0.81l-1.51,-1.67l-0.45,-2.11l-0.6,-1.5l-0.07,-0.11l-1.23,-1.16l-0.16,-0.08l-1.96,-0.28l0.59,-0.99l0.03,-0.24l-0.61,-2.1l-0.54,-0.08l-1.16,1.85l-1.23,0.29l0.73,-0.88l0.06,-0.12l0.37,-1.57l0.93,-1.33l0.05,-0.2l-0.2,-2.07l-0.53,-0.17l-2.01,2.35l-1.52,0.94l-0.12,0.14l-0.82,1.93l-1.5,-0.9l0.07,-1.32l-0.06,-0.2l-1.57,-2.04l-1.15,-0.92l0.3,-0.41l-0.1,-0.44l-3.21,-1.69l-0.13,-0.03l-1.69,-0.08l-2.35,-1.31l-0.16,-0.04l-4.55,0.27l-3.24,0.99l-2.8,0.91l-2.33,-0.18l-0.17,0.03l-2.63,1.41l-2.14,0.64l-0.2,0.19l-0.47,1.42l-0.8,0.99l-1.99,0.06l-1.55,0.24l-2.27,-0.5l-1.79,0.3l-1.71,0.13l-0.19,0.09l-1.38,1.39l-0.58,-0.1l-0.21,0.04l-1.26,0.8l-1.13,0.85l-1.72,-0.1l-1.6,-0.0l-2.58,-1.76l-1.21,-0.49l0.04,-1.19l1.04,-0.32l0.16,-0.12l0.42,-0.64l0.05,-0.19l-0.09,-0.97l0.3,-2.0l-0.28,-1.64l-1.34,-2.84l-0.39,-1.49l0.1,-1.51l-0.04,-0.17l-0.96,-1.72l-0.06,-0.73l-0.09,-0.19l-1.04,-1.01l-0.3,-2.02l-0.05,-0.12l-1.23,-1.83ZM784.95,393.35l2.39,1.01l0.2,0.01l3.26,-0.96l1.19,0.16l0.16,3.19l-0.78,0.95l-0.07,0.16l-0.19,1.83l-0.43,-0.41l-0.44,0.03l-1.61,1.96l-0.4,-0.12l-1.38,-0.09l-1.43,-2.42l-0.37,-2.03l-1.4,-2.53l0.04,-0.94l1.27,0.2Z", "name": "Australia"}, "IL": {"path": "M509.04,199.22l0.71,0.0l0.27,-0.17l0.15,-0.33l0.19,-0.01l0.02,0.73l-0.27,0.34l0.02,0.08l-0.32,0.62l-0.65,-0.27l-0.41,0.19l-0.52,1.85l0.16,0.35l0.14,0.07l-0.17,0.1l-0.14,0.21l-0.11,0.73l0.39,0.33l0.81,-0.26l0.03,0.64l-0.97,3.43l-1.28,-3.67l0.62,-0.78l-0.03,-0.41l0.58,-1.16l0.5,-2.07l0.27,-0.54Z", "name": "Israel"}, "IN": {"path": "M615.84,192.58l2.4,2.97l-0.24,2.17l0.05,0.2l0.94,1.35l-0.06,0.97l-1.46,-0.3l-0.35,0.36l0.7,3.06l0.12,0.18l2.46,1.75l3.11,1.72l-1.23,0.96l-0.1,0.13l-0.97,2.55l0.16,0.38l2.41,1.02l2.37,1.33l3.27,1.52l3.43,0.37l1.37,1.3l0.17,0.08l1.92,0.25l3.0,0.62l2.15,-0.04l0.28,-0.22l0.29,-1.06l0.0,-0.13l-0.32,-1.66l0.16,-0.94l1.0,-0.37l0.23,2.28l0.18,0.24l2.28,1.02l0.2,0.02l1.52,-0.41l2.06,0.18l2.08,-0.08l0.29,-0.27l0.18,-1.66l-0.1,-0.26l-0.53,-0.44l1.38,-0.23l0.15,-0.07l2.26,-2.0l2.75,-1.65l1.97,0.63l0.25,-0.03l1.54,-0.99l0.89,1.28l-0.72,0.97l0.2,0.48l2.49,0.37l0.11,0.61l-0.69,0.39l-0.15,0.3l0.15,1.22l-1.36,-0.37l-0.23,0.03l-3.24,1.86l-0.15,0.28l0.07,1.44l-1.33,2.16l-0.04,0.13l-0.12,1.24l-0.98,1.91l-1.72,-0.53l-0.39,0.28l-0.09,2.66l-0.52,0.83l-0.04,0.23l0.21,0.89l-0.71,0.36l-1.21,-3.85l-0.29,-0.21l-0.69,0.01l-0.29,0.23l-0.28,1.17l-0.84,-0.84l0.6,-1.17l0.97,-0.13l0.23,-0.16l1.15,-2.25l-0.18,-0.42l-1.54,-0.47l-2.3,0.04l-2.13,-0.33l-0.19,-1.63l-0.26,-0.26l-1.13,-0.13l-1.93,-1.13l-0.42,0.13l-0.88,1.82l0.08,0.37l1.47,1.15l-1.21,0.77l-0.1,0.1l-0.56,0.97l0.13,0.42l1.31,0.61l-0.36,1.35l0.01,0.2l0.85,1.95l0.37,2.05l-0.26,0.68l-1.55,-0.02l-3.09,0.54l-0.25,0.32l0.13,1.84l-1.21,1.4l-3.64,1.79l-2.79,3.04l-1.86,1.61l-2.48,1.68l-0.13,0.25l-0.0,1.0l-1.07,0.55l-2.21,0.9l-1.13,0.13l-0.25,0.19l-0.75,1.96l-0.02,0.15l0.52,3.31l0.13,2.03l-1.03,2.35l-0.03,0.12l-0.01,4.03l-1.02,0.1l-0.23,0.15l-1.14,1.93l0.04,0.36l0.44,0.48l-1.83,0.57l-0.18,0.15l-0.81,1.65l-0.74,0.53l-2.14,-2.12l-1.14,-3.47l-0.96,-2.57l-0.9,-1.26l-1.3,-2.38l-0.61,-3.14l-0.44,-1.62l-2.29,-3.56l-1.03,-4.94l-0.74,-3.29l0.01,-3.12l-0.49,-2.51l-0.41,-0.22l-3.56,1.53l-1.59,-0.28l-2.96,-2.87l0.94,-0.74l0.06,-0.41l-0.74,-1.03l-2.73,-2.1l1.35,-1.43l5.38,0.01l0.29,-0.36l-0.5,-2.29l-0.09,-0.15l-1.33,-1.28l-0.27,-1.96l-0.12,-0.2l-1.36,-1.0l2.42,-2.48l2.77,0.2l0.24,-0.1l2.62,-2.85l1.59,-2.8l2.41,-2.74l0.07,-0.2l-0.04,-1.82l2.01,-1.51l-0.01,-0.49l-1.95,-1.33l-0.83,-1.81l-0.82,-2.27l0.98,-0.97l3.64,0.66l2.89,-0.42l0.17,-0.08l2.18,-2.15Z", "name": "India"}, "TZ": {"path": "M505.77,287.58l0.36,0.23l8.95,5.03l0.15,1.3l0.13,0.21l3.4,2.37l-1.07,2.88l-0.02,0.14l0.15,1.42l0.15,0.23l1.47,0.84l0.05,0.42l-0.66,1.44l-0.02,0.18l0.13,0.72l-0.16,1.16l0.03,0.19l0.87,1.57l1.03,2.48l0.12,0.14l0.53,0.32l-1.59,1.18l-2.64,0.95l-1.45,-0.04l-0.2,0.07l-0.81,0.69l-1.64,0.06l-0.68,0.3l-2.9,-0.69l-1.71,0.17l-0.65,-3.18l-0.05,-0.12l-1.35,-1.88l-0.19,-0.12l-2.41,-0.46l-1.38,-0.74l-1.63,-0.44l-0.96,-0.41l-0.95,-0.58l-1.31,-3.09l-1.47,-1.46l-0.45,-1.31l0.24,-1.34l-0.39,-1.99l0.71,-0.08l0.18,-0.09l0.91,-0.91l0.98,-1.31l0.59,-0.5l0.11,-0.24l-0.02,-0.81l-0.08,-0.2l-0.47,-0.5l-0.1,-0.67l0.51,-0.23l0.18,-0.25l0.14,-1.47l-0.05,-0.2l-0.76,-1.09l0.45,-0.15l2.71,0.03l5.01,-0.19Z", "name": "Tanzania"}, "AZ": {"path": "M539.36,175.66l0.16,0.09l1.11,0.2l0.32,-0.15l0.4,-0.71l1.22,-0.99l1.11,1.33l1.26,2.09l0.22,0.14l1.06,0.13l0.28,0.29l-1.46,0.17l-0.26,0.24l-0.43,2.26l-0.39,0.92l-0.85,0.63l-0.12,0.25l0.06,1.2l-0.22,0.05l-1.28,-1.25l0.74,-1.25l-0.03,-0.35l-0.74,-0.86l-0.3,-0.1l-1.05,0.27l-2.49,1.82l-0.04,-1.46l-0.18,-0.27l-1.09,-0.47l-0.8,-0.6l0.53,-0.7l-0.06,-0.42l-1.11,-0.84l0.34,-0.51l-0.11,-0.43l-0.89,-0.48l-0.33,-0.49l0.25,-0.2l1.78,0.81l1.35,0.18l0.25,-0.09l0.34,-0.35l0.02,-0.39l-1.04,-1.36l0.28,-0.18l0.49,0.07l1.65,1.74ZM533.53,180.16l0.63,0.67l0.22,0.09l0.8,-0.0l0.04,0.31l0.66,1.09l-0.94,-0.21l-1.16,-1.24l-0.25,-0.71Z", "name": "Azerbaijan"}, "IE": {"path": "M405.17,135.35l0.36,2.16l-1.78,2.84l-4.28,1.91l-3.02,-0.43l1.81,-3.13l0.02,-0.26l-1.23,-3.26l3.24,-2.56l1.54,-1.32l0.37,1.33l-0.49,1.77l0.3,0.38l1.49,-0.05l1.68,0.63Z", "name": "Ireland"}, "ID": {"path": "M756.56,287.86l0.69,4.02l0.15,0.21l2.59,1.5l0.39,-0.07l2.05,-2.61l2.75,-1.45l2.09,-0.0l2.08,0.85l1.85,0.89l2.52,0.46l0.08,15.44l-1.72,-1.6l-0.15,-0.07l-2.54,-0.51l-0.29,0.1l-0.53,0.62l-2.53,0.06l0.78,-1.51l1.48,-0.66l0.17,-0.34l-0.65,-2.74l-1.23,-2.19l-0.14,-0.13l-4.85,-2.13l-2.09,-0.23l-3.7,-2.28l-0.41,0.1l-0.67,1.11l-0.63,0.14l-0.41,-0.67l-0.01,-1.01l-0.14,-0.25l-1.39,-0.89l2.05,-0.69l1.73,0.05l0.29,-0.39l-0.21,-0.66l-0.29,-0.21l-3.5,-0.0l-0.9,-1.36l-0.19,-0.13l-2.14,-0.44l-0.65,-0.76l2.86,-0.51l1.28,-0.79l3.75,0.96l0.32,0.76ZM758.01,300.37l-0.79,1.04l-0.14,-1.07l0.4,-0.81l0.29,-0.47l0.24,0.31l-0.0,1.0ZM747.45,292.9l0.48,1.02l-1.45,-0.69l-2.09,-0.21l-1.45,0.16l-1.28,-0.07l0.35,-0.81l2.86,-0.1l2.58,0.68ZM741.15,285.69l-0.16,-0.25l-0.72,-3.08l0.47,-1.86l0.35,-0.38l0.1,0.73l0.25,0.26l1.28,0.19l0.18,0.78l-0.11,1.8l-0.96,-0.18l-0.35,0.22l-0.38,1.52l0.05,0.24ZM741.19,285.75l0.76,0.97l-0.11,0.05l-0.65,-1.02ZM739.18,293.52l-0.61,0.54l-1.44,-0.38l-0.25,-0.55l1.93,-0.09l0.36,0.48ZM728.4,295.87l-0.27,-0.07l-2.26,0.89l-0.37,-0.41l0.27,-0.8l-0.09,-0.33l-1.68,-1.37l0.17,-2.29l-0.42,-0.3l-1.67,0.76l-0.17,0.29l0.21,2.92l0.09,3.34l-1.22,0.28l-0.78,-0.54l0.65,-2.1l0.01,-0.14l-0.39,-2.42l-0.29,-0.25l-0.86,-0.02l-0.63,-1.4l0.99,-1.61l0.35,-1.97l1.24,-3.73l0.49,-0.96l1.95,-1.7l1.86,0.69l3.16,0.35l2.92,-0.1l0.17,-0.06l2.24,-1.65l0.11,0.14l-1.8,2.22l-1.72,0.44l-2.41,-0.48l-4.21,0.13l-2.19,0.36l-0.25,0.24l-0.36,1.9l0.08,0.27l2.24,2.23l0.4,0.02l1.29,-1.08l3.19,-0.58l-0.19,0.06l-1.04,1.4l-2.13,0.94l-0.12,0.45l2.26,3.06l-0.37,0.69l0.03,0.32l1.51,1.95ZM728.48,295.97l0.59,0.76l-0.02,1.37l-1.0,0.55l-0.64,-0.58l1.09,-1.84l-0.02,-0.26ZM728.64,286.95l0.79,-0.14l-0.07,0.39l-0.72,-0.24ZM732.38,310.1l-1.89,0.49l-0.06,-0.06l0.17,-0.64l1.0,-1.42l2.14,-0.87l0.1,0.2l0.04,0.58l-1.49,1.72ZM728.26,305.71l-0.17,0.63l-3.53,0.67l-3.02,-0.28l-0.0,-0.42l1.66,-0.44l1.47,0.71l0.16,0.03l1.75,-0.21l1.69,-0.69ZM722.98,310.33l-0.74,0.03l-2.52,-1.35l1.42,-0.3l1.19,0.7l0.72,0.63l-0.06,0.28ZM716.24,305.63l0.66,0.49l0.22,0.06l1.35,-0.18l0.31,0.53l-4.18,0.77l-0.8,-0.01l0.51,-0.86l1.2,-0.02l0.24,-0.12l0.49,-0.65ZM715.84,280.21l0.09,0.34l2.25,1.86l-2.25,0.22l-0.24,0.17l-0.84,1.71l-0.03,0.15l0.1,2.11l-2.27,1.62l-0.13,0.24l-0.06,2.46l-0.74,2.92l-0.02,-0.05l-0.39,-0.16l-2.62,1.04l-0.86,-1.33l-0.23,-0.14l-1.71,-0.14l-1.19,-0.76l-0.25,-0.03l-2.78,0.84l-0.79,-1.05l-0.26,-0.12l-1.61,0.13l-1.8,-0.25l-0.36,-3.13l-0.15,-0.23l-1.18,-0.65l-1.13,-2.02l-0.33,-2.1l0.27,-2.19l1.05,-1.17l0.28,1.12l0.1,0.16l1.71,1.41l0.28,0.05l1.55,-0.49l1.54,0.17l0.23,-0.07l1.4,-1.21l1.05,-0.19l2.3,0.68l0.16,0.0l2.04,-0.53l0.21,-0.19l1.26,-3.41l0.91,-0.82l0.09,-0.14l0.8,-2.64l2.63,0.0l1.71,0.33l-1.19,1.89l0.02,0.34l1.74,2.24l-0.37,1.0ZM692.67,302.0l0.26,0.19l4.8,0.25l0.28,-0.16l0.44,-0.83l4.29,1.12l0.85,1.52l0.23,0.15l3.71,0.45l2.37,1.15l-2.06,0.69l-2.77,-1.0l-2.25,0.07l-2.57,-0.18l-2.31,-0.45l-2.94,-0.97l-1.84,-0.25l-0.13,0.01l-0.97,0.29l-4.34,-0.98l-0.38,-0.94l-0.25,-0.19l-1.76,-0.14l1.31,-1.84l2.81,0.14l1.97,0.96l0.95,0.19l0.28,0.74ZM685.63,299.27l-2.36,0.04l-2.07,-2.05l-3.17,-2.02l-1.06,-1.5l-1.88,-2.02l-1.22,-1.85l-1.9,-3.49l-2.2,-2.11l-0.71,-2.08l-0.94,-1.99l-0.1,-0.12l-2.21,-1.54l-1.35,-2.17l-1.86,-1.39l-2.53,-2.68l-0.14,-0.81l1.22,0.08l3.76,0.47l2.16,2.4l1.94,1.7l1.37,1.04l2.35,2.67l0.22,0.1l2.44,0.04l1.99,1.62l1.42,2.06l0.09,0.09l1.67,1.0l-0.88,1.8l0.11,0.39l1.44,0.87l0.13,0.04l0.68,0.05l0.41,1.62l0.87,1.4l0.22,0.14l1.71,0.21l1.06,1.38l-0.61,3.04l-0.09,3.6Z", "name": "Indonesia"}, "UA": {"path": "M500.54,141.42l0.9,0.13l0.27,-0.11l0.52,-0.62l0.68,0.13l2.43,-0.3l1.32,1.57l-0.45,0.48l-0.07,0.26l0.21,1.03l0.27,0.24l1.85,0.15l0.76,1.22l-0.05,0.55l0.2,0.31l3.18,1.15l0.18,0.01l1.75,-0.47l1.42,1.41l0.22,0.09l1.42,-0.03l3.44,0.99l0.02,0.65l-0.97,1.62l-0.03,0.24l0.52,1.67l-0.29,0.79l-2.24,0.22l-0.14,0.05l-1.29,0.89l-0.13,0.23l-0.07,1.16l-1.75,0.22l-0.12,0.04l-1.6,0.98l-2.27,0.16l-0.12,0.04l-2.16,1.17l-0.16,0.29l0.15,1.94l0.14,0.23l1.23,0.75l0.18,0.04l2.06,-0.15l-0.22,0.51l-2.67,0.54l-3.27,1.72l-1.0,-0.45l0.45,-1.19l-0.19,-0.39l-2.34,-0.78l0.15,-0.2l2.32,-1.0l0.09,-0.49l-0.73,-0.72l-0.15,-0.08l-3.69,-0.75l-0.14,-0.96l-0.35,-0.25l-2.32,0.39l-0.21,0.15l-0.91,1.7l-1.77,2.1l-0.93,-0.44l-0.24,-0.0l-1.05,0.45l-0.48,-0.25l0.13,-0.07l0.14,-0.15l0.43,-1.04l0.67,-0.97l0.04,-0.26l-0.1,-0.31l0.04,-0.02l0.11,0.19l0.24,0.15l1.48,0.09l0.78,-0.25l0.07,-0.53l-0.27,-0.19l0.09,-0.25l-0.08,-0.33l-0.81,-0.74l-0.34,-1.24l-0.14,-0.18l-0.73,-0.42l0.15,-0.87l-0.11,-0.29l-1.13,-0.86l-0.15,-0.06l-0.97,-0.11l-1.79,-0.97l-0.2,-0.03l-1.66,0.32l-0.13,0.06l-0.52,0.41l-0.95,-0.0l-0.23,0.11l-0.56,0.66l-1.74,0.29l-0.79,0.43l-1.01,-0.68l-0.16,-0.05l-1.57,-0.01l-1.52,-0.35l-0.23,0.04l-0.71,0.45l-0.09,-0.43l-0.13,-0.19l-1.18,-0.74l0.38,-1.02l0.53,-0.64l0.35,0.12l0.37,-0.41l-0.57,-1.29l2.1,-2.5l1.16,-0.36l0.2,-0.2l0.27,-0.92l-0.01,-0.2l-1.1,-2.52l0.79,-0.09l0.13,-0.05l1.3,-0.86l1.83,-0.07l2.48,0.26l2.84,0.8l1.91,0.06l0.88,0.45l0.29,-0.01l0.72,-0.44l0.49,0.58l0.25,0.11l2.2,-0.16l0.94,0.3l0.39,-0.26l0.15,-1.57l0.61,-0.59l2.01,-0.19Z", "name": "Ukraine"}, "QA": {"path": "M548.47,221.47l-0.15,-1.72l0.59,-1.23l0.38,-0.16l0.54,0.6l0.04,1.4l-0.47,1.37l-0.41,0.11l-0.53,-0.37Z", "name": "Qatar"}, "MZ": {"path": "M507.71,314.14l1.65,-0.18l2.96,0.7l0.2,-0.02l0.6,-0.29l1.68,-0.06l0.18,-0.07l0.8,-0.69l1.5,0.02l2.74,-0.98l1.74,-1.27l0.25,0.7l-0.1,2.47l0.31,2.27l0.1,3.97l0.42,1.24l-0.7,1.71l-0.94,1.73l-1.52,1.52l-5.06,2.21l-2.88,2.8l-1.01,0.51l-1.72,1.81l-0.99,0.58l-0.15,0.23l-0.21,1.86l0.04,0.19l1.17,1.95l0.47,1.47l0.03,0.74l0.39,0.28l0.05,-0.01l-0.06,2.13l-0.39,1.19l0.1,0.33l0.42,0.32l-0.28,0.83l-0.95,0.86l-2.03,0.88l-3.08,1.49l-1.1,0.99l-0.09,0.28l0.21,1.13l0.21,0.23l0.38,0.11l-0.14,0.89l-1.39,-0.02l-0.17,-0.94l-0.38,-1.23l-0.2,-0.89l0.44,-2.91l-0.01,-0.14l-0.65,-1.88l-1.15,-3.55l2.52,-2.85l0.68,-1.89l0.29,-0.18l0.14,-0.2l0.28,-1.53l-0.03,-0.19l-0.36,-0.7l0.1,-1.83l0.49,-1.84l-0.01,-3.26l-0.14,-0.25l-1.3,-0.83l-0.11,-0.04l-1.08,-0.17l-0.47,-0.55l-0.1,-0.08l-1.16,-0.54l-0.13,-0.03l-1.83,0.04l-0.32,-2.25l7.19,-1.99l1.32,1.12l0.29,0.06l0.55,-0.19l0.75,0.49l0.11,0.81l-0.49,1.11l-0.02,0.15l0.19,1.81l0.09,0.18l1.63,1.59l0.48,-0.1l0.72,-1.68l0.99,-0.49l0.17,-0.29l-0.21,-3.29l-0.04,-0.13l-1.11,-1.92l-0.9,-0.82l-0.21,-0.08l-0.62,0.03l-0.63,-2.98l0.61,-1.67Z", "name": "Mozambique"}}, "height": 440.7063107441331, "projection": {"type": "mill", "centralMeridian": 11.5}, "width": 900.0}); \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/pace/pace.css b/public/bower_components/admin-lte/plugins/pace/pace.css
new file mode 100755
index 0000000..2f196bb
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/pace/pace.css
@@ -0,0 +1,85 @@
+.pace {
+ -webkit-pointer-events: none;
+ pointer-events: none;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+}
+
+.pace-inactive {
+ display: none;
+}
+
+.pace .pace-progress {
+ background: #fff;
+ position: fixed;
+ z-index: 2000;
+ top: 0;
+ right: 100%;
+ width: 100%;
+ height: 2px;
+}
+
+.pace .pace-progress-inner {
+ display: block;
+ position: absolute;
+ right: 0px;
+ width: 100px;
+ height: 100%;
+ box-shadow: 0 0 10px #fff, 0 0 5px #fff;
+ opacity: 1.0;
+ -webkit-transform: rotate(3deg) translate(0px, -4px);
+ -moz-transform: rotate(3deg) translate(0px, -4px);
+ -ms-transform: rotate(3deg) translate(0px, -4px);
+ -o-transform: rotate(3deg) translate(0px, -4px);
+ transform: rotate(3deg) translate(0px, -4px);
+}
+
+.pace .pace-activity {
+ display: block;
+ position: fixed;
+ z-index: 2000;
+ top: 15px;
+ right: 50%;
+ width: 14px;
+ height: 14px;
+ border: solid 2px transparent;
+ border-top-color: #fff;
+ border-left-color: #fff;
+ border-radius: 10px;
+ -webkit-animation: pace-spinner 400ms linear infinite;
+ -moz-animation: pace-spinner 400ms linear infinite;
+ -ms-animation: pace-spinner 400ms linear infinite;
+ -o-animation: pace-spinner 400ms linear infinite;
+ animation: pace-spinner 400ms linear infinite;
+}
+
+@media (max-width: 767px) {
+ .pace .pace-activity {
+ top: 15px;
+ right: 15px;
+ width: 14px;
+ height: 14px;
+ }
+}
+
+@-webkit-keyframes pace-spinner {
+ 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
+ 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
+}
+@-moz-keyframes pace-spinner {
+ 0% { -moz-transform: rotate(0deg); transform: rotate(0deg); }
+ 100% { -moz-transform: rotate(360deg); transform: rotate(360deg); }
+}
+@-o-keyframes pace-spinner {
+ 0% { -o-transform: rotate(0deg); transform: rotate(0deg); }
+ 100% { -o-transform: rotate(360deg); transform: rotate(360deg); }
+}
+@-ms-keyframes pace-spinner {
+ 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); }
+ 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
+}
+@keyframes pace-spinner {
+ 0% { transform: rotate(0deg); transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); transform: rotate(360deg); }
+} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/pace/pace.js b/public/bower_components/admin-lte/plugins/pace/pace.js
new file mode 100755
index 0000000..c7efc2f
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/pace/pace.js
@@ -0,0 +1,935 @@
+(function() {
+ var AjaxMonitor, Bar, DocumentMonitor, ElementMonitor, ElementTracker, EventLagMonitor, Evented, Events, NoTargetError, Pace, RequestIntercept, SOURCE_KEYS, Scaler, SocketRequestTracker, XHRRequestTracker, animation, avgAmplitude, bar, cancelAnimation, cancelAnimationFrame, defaultOptions, extend, extendNative, getFromDOM, getIntercept, handlePushState, ignoreStack, init, now, options, requestAnimationFrame, result, runAnimation, scalers, shouldIgnoreURL, shouldTrack, source, sources, uniScaler, _WebSocket, _XDomainRequest, _XMLHttpRequest, _i, _intercept, _len, _pushState, _ref, _ref1, _replaceState,
+ __slice = [].slice,
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+
+ defaultOptions = {
+ catchupTime: 100,
+ initialRate: .03,
+ minTime: 250,
+ ghostTime: 100,
+ maxProgressPerFrame: 20,
+ easeFactor: 1.25,
+ startOnPageLoad: true,
+ restartOnPushState: true,
+ restartOnRequestAfter: 500,
+ target: 'body',
+ elements: {
+ checkInterval: 100,
+ selectors: ['body']
+ },
+ eventLag: {
+ minSamples: 10,
+ sampleCount: 3,
+ lagThreshold: 3
+ },
+ ajax: {
+ trackMethods: ['GET'],
+ trackWebSockets: true,
+ ignoreURLs: []
+ }
+ };
+
+ now = function() {
+ var _ref;
+ return (_ref = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void 0 : void 0) != null ? _ref : +(new Date);
+ };
+
+ requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
+
+ cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame;
+
+ if (requestAnimationFrame == null) {
+ requestAnimationFrame = function(fn) {
+ return setTimeout(fn, 50);
+ };
+ cancelAnimationFrame = function(id) {
+ return clearTimeout(id);
+ };
+ }
+
+ runAnimation = function(fn) {
+ var last, tick;
+ last = now();
+ tick = function() {
+ var diff;
+ diff = now() - last;
+ if (diff >= 33) {
+ last = now();
+ return fn(diff, function() {
+ return requestAnimationFrame(tick);
+ });
+ } else {
+ return setTimeout(tick, 33 - diff);
+ }
+ };
+ return tick();
+ };
+
+ result = function() {
+ var args, key, obj;
+ obj = arguments[0], key = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
+ if (typeof obj[key] === 'function') {
+ return obj[key].apply(obj, args);
+ } else {
+ return obj[key];
+ }
+ };
+
+ extend = function() {
+ var key, out, source, sources, val, _i, _len;
+ out = arguments[0], sources = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ for (_i = 0, _len = sources.length; _i < _len; _i++) {
+ source = sources[_i];
+ if (source) {
+ for (key in source) {
+ if (!__hasProp.call(source, key)) continue;
+ val = source[key];
+ if ((out[key] != null) && typeof out[key] === 'object' && (val != null) && typeof val === 'object') {
+ extend(out[key], val);
+ } else {
+ out[key] = val;
+ }
+ }
+ }
+ }
+ return out;
+ };
+
+ avgAmplitude = function(arr) {
+ var count, sum, v, _i, _len;
+ sum = count = 0;
+ for (_i = 0, _len = arr.length; _i < _len; _i++) {
+ v = arr[_i];
+ sum += Math.abs(v);
+ count++;
+ }
+ return sum / count;
+ };
+
+ getFromDOM = function(key, json) {
+ var data, e, el;
+ if (key == null) {
+ key = 'options';
+ }
+ if (json == null) {
+ json = true;
+ }
+ el = document.querySelector("[data-pace-" + key + "]");
+ if (!el) {
+ return;
+ }
+ data = el.getAttribute("data-pace-" + key);
+ if (!json) {
+ return data;
+ }
+ try {
+ return JSON.parse(data);
+ } catch (_error) {
+ e = _error;
+ return typeof console !== "undefined" && console !== null ? console.error("Error parsing inline pace options", e) : void 0;
+ }
+ };
+
+ Evented = (function() {
+ function Evented() {}
+
+ Evented.prototype.on = function(event, handler, ctx, once) {
+ var _base;
+ if (once == null) {
+ once = false;
+ }
+ if (this.bindings == null) {
+ this.bindings = {};
+ }
+ if ((_base = this.bindings)[event] == null) {
+ _base[event] = [];
+ }
+ return this.bindings[event].push({
+ handler: handler,
+ ctx: ctx,
+ once: once
+ });
+ };
+
+ Evented.prototype.once = function(event, handler, ctx) {
+ return this.on(event, handler, ctx, true);
+ };
+
+ Evented.prototype.off = function(event, handler) {
+ var i, _ref, _results;
+ if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {
+ return;
+ }
+ if (handler == null) {
+ return delete this.bindings[event];
+ } else {
+ i = 0;
+ _results = [];
+ while (i < this.bindings[event].length) {
+ if (this.bindings[event][i].handler === handler) {
+ _results.push(this.bindings[event].splice(i, 1));
+ } else {
+ _results.push(i++);
+ }
+ }
+ return _results;
+ }
+ };
+
+ Evented.prototype.trigger = function() {
+ var args, ctx, event, handler, i, once, _ref, _ref1, _results;
+ event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ if ((_ref = this.bindings) != null ? _ref[event] : void 0) {
+ i = 0;
+ _results = [];
+ while (i < this.bindings[event].length) {
+ _ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;
+ handler.apply(ctx != null ? ctx : this, args);
+ if (once) {
+ _results.push(this.bindings[event].splice(i, 1));
+ } else {
+ _results.push(i++);
+ }
+ }
+ return _results;
+ }
+ };
+
+ return Evented;
+
+ })();
+
+ Pace = window.Pace || {};
+
+ window.Pace = Pace;
+
+ extend(Pace, Evented.prototype);
+
+ options = Pace.options = extend({}, defaultOptions, window.paceOptions, getFromDOM());
+
+ _ref = ['ajax', 'document', 'eventLag', 'elements'];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ source = _ref[_i];
+ if (options[source] === true) {
+ options[source] = defaultOptions[source];
+ }
+ }
+
+ NoTargetError = (function(_super) {
+ __extends(NoTargetError, _super);
+
+ function NoTargetError() {
+ _ref1 = NoTargetError.__super__.constructor.apply(this, arguments);
+ return _ref1;
+ }
+
+ return NoTargetError;
+
+ })(Error);
+
+ Bar = (function() {
+ function Bar() {
+ this.progress = 0;
+ }
+
+ Bar.prototype.getElement = function() {
+ var targetElement;
+ if (this.el == null) {
+ targetElement = document.querySelector(options.target);
+ if (!targetElement) {
+ throw new NoTargetError;
+ }
+ this.el = document.createElement('div');
+ this.el.className = "pace pace-active";
+ document.body.className = document.body.className.replace(/pace-done/g, '');
+ document.body.className += ' pace-running';
+ this.el.innerHTML = '<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>';
+ if (targetElement.firstChild != null) {
+ targetElement.insertBefore(this.el, targetElement.firstChild);
+ } else {
+ targetElement.appendChild(this.el);
+ }
+ }
+ return this.el;
+ };
+
+ Bar.prototype.finish = function() {
+ var el;
+ el = this.getElement();
+ el.className = el.className.replace('pace-active', '');
+ el.className += ' pace-inactive';
+ document.body.className = document.body.className.replace('pace-running', '');
+ return document.body.className += ' pace-done';
+ };
+
+ Bar.prototype.update = function(prog) {
+ this.progress = prog;
+ return this.render();
+ };
+
+ Bar.prototype.destroy = function() {
+ try {
+ this.getElement().parentNode.removeChild(this.getElement());
+ } catch (_error) {
+ NoTargetError = _error;
+ }
+ return this.el = void 0;
+ };
+
+ Bar.prototype.render = function() {
+ var el, key, progressStr, transform, _j, _len1, _ref2;
+ if (document.querySelector(options.target) == null) {
+ return false;
+ }
+ el = this.getElement();
+ transform = "translate3d(" + this.progress + "%, 0, 0)";
+ _ref2 = ['webkitTransform', 'msTransform', 'transform'];
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ key = _ref2[_j];
+ el.children[0].style[key] = transform;
+ }
+ if (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) {
+ el.children[0].setAttribute('data-progress-text', "" + (this.progress | 0) + "%");
+ if (this.progress >= 100) {
+ progressStr = '99';
+ } else {
+ progressStr = this.progress < 10 ? "0" : "";
+ progressStr += this.progress | 0;
+ }
+ el.children[0].setAttribute('data-progress', "" + progressStr);
+ }
+ return this.lastRenderedProgress = this.progress;
+ };
+
+ Bar.prototype.done = function() {
+ return this.progress >= 100;
+ };
+
+ return Bar;
+
+ })();
+
+ Events = (function() {
+ function Events() {
+ this.bindings = {};
+ }
+
+ Events.prototype.trigger = function(name, val) {
+ var binding, _j, _len1, _ref2, _results;
+ if (this.bindings[name] != null) {
+ _ref2 = this.bindings[name];
+ _results = [];
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ binding = _ref2[_j];
+ _results.push(binding.call(this, val));
+ }
+ return _results;
+ }
+ };
+
+ Events.prototype.on = function(name, fn) {
+ var _base;
+ if ((_base = this.bindings)[name] == null) {
+ _base[name] = [];
+ }
+ return this.bindings[name].push(fn);
+ };
+
+ return Events;
+
+ })();
+
+ _XMLHttpRequest = window.XMLHttpRequest;
+
+ _XDomainRequest = window.XDomainRequest;
+
+ _WebSocket = window.WebSocket;
+
+ extendNative = function(to, from) {
+ var e, key, _results;
+ _results = [];
+ for (key in from.prototype) {
+ try {
+ if ((to[key] == null) && typeof from[key] !== 'function') {
+ if (typeof Object.defineProperty === 'function') {
+ _results.push(Object.defineProperty(to, key, {
+ get: function() {
+ return from.prototype[key];
+ },
+ configurable: true,
+ enumerable: true
+ }));
+ } else {
+ _results.push(to[key] = from.prototype[key]);
+ }
+ } else {
+ _results.push(void 0);
+ }
+ } catch (_error) {
+ e = _error;
+ }
+ }
+ return _results;
+ };
+
+ ignoreStack = [];
+
+ Pace.ignore = function() {
+ var args, fn, ret;
+ fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ ignoreStack.unshift('ignore');
+ ret = fn.apply(null, args);
+ ignoreStack.shift();
+ return ret;
+ };
+
+ Pace.track = function() {
+ var args, fn, ret;
+ fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ ignoreStack.unshift('track');
+ ret = fn.apply(null, args);
+ ignoreStack.shift();
+ return ret;
+ };
+
+ shouldTrack = function(method) {
+ var _ref2;
+ if (method == null) {
+ method = 'GET';
+ }
+ if (ignoreStack[0] === 'track') {
+ return 'force';
+ }
+ if (!ignoreStack.length && options.ajax) {
+ if (method === 'socket' && options.ajax.trackWebSockets) {
+ return true;
+ } else if (_ref2 = method.toUpperCase(), __indexOf.call(options.ajax.trackMethods, _ref2) >= 0) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ RequestIntercept = (function(_super) {
+ __extends(RequestIntercept, _super);
+
+ function RequestIntercept() {
+ var monitorXHR,
+ _this = this;
+ RequestIntercept.__super__.constructor.apply(this, arguments);
+ monitorXHR = function(req) {
+ var _open;
+ _open = req.open;
+ return req.open = function(type, url, async) {
+ if (shouldTrack(type)) {
+ _this.trigger('request', {
+ type: type,
+ url: url,
+ request: req
+ });
+ }
+ return _open.apply(req, arguments);
+ };
+ };
+ window.XMLHttpRequest = function(flags) {
+ var req;
+ req = new _XMLHttpRequest(flags);
+ monitorXHR(req);
+ return req;
+ };
+ try {
+ extendNative(window.XMLHttpRequest, _XMLHttpRequest);
+ } catch (_error) {}
+ if (_XDomainRequest != null) {
+ window.XDomainRequest = function() {
+ var req;
+ req = new _XDomainRequest;
+ monitorXHR(req);
+ return req;
+ };
+ try {
+ extendNative(window.XDomainRequest, _XDomainRequest);
+ } catch (_error) {}
+ }
+ if ((_WebSocket != null) && options.ajax.trackWebSockets) {
+ window.WebSocket = function(url, protocols) {
+ var req;
+ if (protocols != null) {
+ req = new _WebSocket(url, protocols);
+ } else {
+ req = new _WebSocket(url);
+ }
+ if (shouldTrack('socket')) {
+ _this.trigger('request', {
+ type: 'socket',
+ url: url,
+ protocols: protocols,
+ request: req
+ });
+ }
+ return req;
+ };
+ try {
+ extendNative(window.WebSocket, _WebSocket);
+ } catch (_error) {}
+ }
+ }
+
+ return RequestIntercept;
+
+ })(Events);
+
+ _intercept = null;
+
+ getIntercept = function() {
+ if (_intercept == null) {
+ _intercept = new RequestIntercept;
+ }
+ return _intercept;
+ };
+
+ shouldIgnoreURL = function(url) {
+ var pattern, _j, _len1, _ref2;
+ _ref2 = options.ajax.ignoreURLs;
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ pattern = _ref2[_j];
+ if (typeof pattern === 'string') {
+ if (url.indexOf(pattern) !== -1) {
+ return true;
+ }
+ } else {
+ if (pattern.test(url)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ getIntercept().on('request', function(_arg) {
+ var after, args, request, type, url;
+ type = _arg.type, request = _arg.request, url = _arg.url;
+ if (shouldIgnoreURL(url)) {
+ return;
+ }
+ if (!Pace.running && (options.restartOnRequestAfter !== false || shouldTrack(type) === 'force')) {
+ args = arguments;
+ after = options.restartOnRequestAfter || 0;
+ if (typeof after === 'boolean') {
+ after = 0;
+ }
+ return setTimeout(function() {
+ var stillActive, _j, _len1, _ref2, _ref3, _results;
+ if (type === 'socket') {
+ stillActive = request.readyState < 2;
+ } else {
+ stillActive = (0 < (_ref2 = request.readyState) && _ref2 < 4);
+ }
+ if (stillActive) {
+ Pace.restart();
+ _ref3 = Pace.sources;
+ _results = [];
+ for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
+ source = _ref3[_j];
+ if (source instanceof AjaxMonitor) {
+ source.watch.apply(source, args);
+ break;
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ }
+ }, after);
+ }
+ });
+
+ AjaxMonitor = (function() {
+ function AjaxMonitor() {
+ var _this = this;
+ this.elements = [];
+ getIntercept().on('request', function() {
+ return _this.watch.apply(_this, arguments);
+ });
+ }
+
+ AjaxMonitor.prototype.watch = function(_arg) {
+ var request, tracker, type, url;
+ type = _arg.type, request = _arg.request, url = _arg.url;
+ if (shouldIgnoreURL(url)) {
+ return;
+ }
+ if (type === 'socket') {
+ tracker = new SocketRequestTracker(request);
+ } else {
+ tracker = new XHRRequestTracker(request);
+ }
+ return this.elements.push(tracker);
+ };
+
+ return AjaxMonitor;
+
+ })();
+
+ XHRRequestTracker = (function() {
+ function XHRRequestTracker(request) {
+ var event, size, _j, _len1, _onreadystatechange, _ref2,
+ _this = this;
+ this.progress = 0;
+ if (window.ProgressEvent != null) {
+ size = null;
+ request.addEventListener('progress', function(evt) {
+ if (evt.lengthComputable) {
+ return _this.progress = 100 * evt.loaded / evt.total;
+ } else {
+ return _this.progress = _this.progress + (100 - _this.progress) / 2;
+ }
+ }, false);
+ _ref2 = ['load', 'abort', 'timeout', 'error'];
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ event = _ref2[_j];
+ request.addEventListener(event, function() {
+ return _this.progress = 100;
+ }, false);
+ }
+ } else {
+ _onreadystatechange = request.onreadystatechange;
+ request.onreadystatechange = function() {
+ var _ref3;
+ if ((_ref3 = request.readyState) === 0 || _ref3 === 4) {
+ _this.progress = 100;
+ } else if (request.readyState === 3) {
+ _this.progress = 50;
+ }
+ return typeof _onreadystatechange === "function" ? _onreadystatechange.apply(null, arguments) : void 0;
+ };
+ }
+ }
+
+ return XHRRequestTracker;
+
+ })();
+
+ SocketRequestTracker = (function() {
+ function SocketRequestTracker(request) {
+ var event, _j, _len1, _ref2,
+ _this = this;
+ this.progress = 0;
+ _ref2 = ['error', 'open'];
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ event = _ref2[_j];
+ request.addEventListener(event, function() {
+ return _this.progress = 100;
+ }, false);
+ }
+ }
+
+ return SocketRequestTracker;
+
+ })();
+
+ ElementMonitor = (function() {
+ function ElementMonitor(options) {
+ var selector, _j, _len1, _ref2;
+ if (options == null) {
+ options = {};
+ }
+ this.elements = [];
+ if (options.selectors == null) {
+ options.selectors = [];
+ }
+ _ref2 = options.selectors;
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ selector = _ref2[_j];
+ this.elements.push(new ElementTracker(selector));
+ }
+ }
+
+ return ElementMonitor;
+
+ })();
+
+ ElementTracker = (function() {
+ function ElementTracker(selector) {
+ this.selector = selector;
+ this.progress = 0;
+ this.check();
+ }
+
+ ElementTracker.prototype.check = function() {
+ var _this = this;
+ if (document.querySelector(this.selector)) {
+ return this.done();
+ } else {
+ return setTimeout((function() {
+ return _this.check();
+ }), options.elements.checkInterval);
+ }
+ };
+
+ ElementTracker.prototype.done = function() {
+ return this.progress = 100;
+ };
+
+ return ElementTracker;
+
+ })();
+
+ DocumentMonitor = (function() {
+ DocumentMonitor.prototype.states = {
+ loading: 0,
+ interactive: 50,
+ complete: 100
+ };
+
+ function DocumentMonitor() {
+ var _onreadystatechange, _ref2,
+ _this = this;
+ this.progress = (_ref2 = this.states[document.readyState]) != null ? _ref2 : 100;
+ _onreadystatechange = document.onreadystatechange;
+ document.onreadystatechange = function() {
+ if (_this.states[document.readyState] != null) {
+ _this.progress = _this.states[document.readyState];
+ }
+ return typeof _onreadystatechange === "function" ? _onreadystatechange.apply(null, arguments) : void 0;
+ };
+ }
+
+ return DocumentMonitor;
+
+ })();
+
+ EventLagMonitor = (function() {
+ function EventLagMonitor() {
+ var avg, interval, last, points, samples,
+ _this = this;
+ this.progress = 0;
+ avg = 0;
+ samples = [];
+ points = 0;
+ last = now();
+ interval = setInterval(function() {
+ var diff;
+ diff = now() - last - 50;
+ last = now();
+ samples.push(diff);
+ if (samples.length > options.eventLag.sampleCount) {
+ samples.shift();
+ }
+ avg = avgAmplitude(samples);
+ if (++points >= options.eventLag.minSamples && avg < options.eventLag.lagThreshold) {
+ _this.progress = 100;
+ return clearInterval(interval);
+ } else {
+ return _this.progress = 100 * (3 / (avg + 3));
+ }
+ }, 50);
+ }
+
+ return EventLagMonitor;
+
+ })();
+
+ Scaler = (function() {
+ function Scaler(source) {
+ this.source = source;
+ this.last = this.sinceLastUpdate = 0;
+ this.rate = options.initialRate;
+ this.catchup = 0;
+ this.progress = this.lastProgress = 0;
+ if (this.source != null) {
+ this.progress = result(this.source, 'progress');
+ }
+ }
+
+ Scaler.prototype.tick = function(frameTime, val) {
+ var scaling;
+ if (val == null) {
+ val = result(this.source, 'progress');
+ }
+ if (val >= 100) {
+ this.done = true;
+ }
+ if (val === this.last) {
+ this.sinceLastUpdate += frameTime;
+ } else {
+ if (this.sinceLastUpdate) {
+ this.rate = (val - this.last) / this.sinceLastUpdate;
+ }
+ this.catchup = (val - this.progress) / options.catchupTime;
+ this.sinceLastUpdate = 0;
+ this.last = val;
+ }
+ if (val > this.progress) {
+ this.progress += this.catchup * frameTime;
+ }
+ scaling = 1 - Math.pow(this.progress / 100, options.easeFactor);
+ this.progress += scaling * this.rate * frameTime;
+ this.progress = Math.min(this.lastProgress + options.maxProgressPerFrame, this.progress);
+ this.progress = Math.max(0, this.progress);
+ this.progress = Math.min(100, this.progress);
+ this.lastProgress = this.progress;
+ return this.progress;
+ };
+
+ return Scaler;
+
+ })();
+
+ sources = null;
+
+ scalers = null;
+
+ bar = null;
+
+ uniScaler = null;
+
+ animation = null;
+
+ cancelAnimation = null;
+
+ Pace.running = false;
+
+ handlePushState = function() {
+ if (options.restartOnPushState) {
+ return Pace.restart();
+ }
+ };
+
+ if (window.history.pushState != null) {
+ _pushState = window.history.pushState;
+ window.history.pushState = function() {
+ handlePushState();
+ return _pushState.apply(window.history, arguments);
+ };
+ }
+
+ if (window.history.replaceState != null) {
+ _replaceState = window.history.replaceState;
+ window.history.replaceState = function() {
+ handlePushState();
+ return _replaceState.apply(window.history, arguments);
+ };
+ }
+
+ SOURCE_KEYS = {
+ ajax: AjaxMonitor,
+ elements: ElementMonitor,
+ document: DocumentMonitor,
+ eventLag: EventLagMonitor
+ };
+
+ (init = function() {
+ var type, _j, _k, _len1, _len2, _ref2, _ref3, _ref4;
+ Pace.sources = sources = [];
+ _ref2 = ['ajax', 'elements', 'document', 'eventLag'];
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ type = _ref2[_j];
+ if (options[type] !== false) {
+ sources.push(new SOURCE_KEYS[type](options[type]));
+ }
+ }
+ _ref4 = (_ref3 = options.extraSources) != null ? _ref3 : [];
+ for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
+ source = _ref4[_k];
+ sources.push(new source(options));
+ }
+ Pace.bar = bar = new Bar;
+ scalers = [];
+ return uniScaler = new Scaler;
+ })();
+
+ Pace.stop = function() {
+ Pace.trigger('stop');
+ Pace.running = false;
+ bar.destroy();
+ cancelAnimation = true;
+ if (animation != null) {
+ if (typeof cancelAnimationFrame === "function") {
+ cancelAnimationFrame(animation);
+ }
+ animation = null;
+ }
+ return init();
+ };
+
+ Pace.restart = function() {
+ Pace.trigger('restart');
+ Pace.stop();
+ return Pace.start();
+ };
+
+ Pace.go = function() {
+ var start;
+ Pace.running = true;
+ bar.render();
+ start = now();
+ cancelAnimation = false;
+ return animation = runAnimation(function(frameTime, enqueueNextFrame) {
+ var avg, count, done, element, elements, i, j, remaining, scaler, scalerList, sum, _j, _k, _len1, _len2, _ref2;
+ remaining = 100 - bar.progress;
+ count = sum = 0;
+ done = true;
+ for (i = _j = 0, _len1 = sources.length; _j < _len1; i = ++_j) {
+ source = sources[i];
+ scalerList = scalers[i] != null ? scalers[i] : scalers[i] = [];
+ elements = (_ref2 = source.elements) != null ? _ref2 : [source];
+ for (j = _k = 0, _len2 = elements.length; _k < _len2; j = ++_k) {
+ element = elements[j];
+ scaler = scalerList[j] != null ? scalerList[j] : scalerList[j] = new Scaler(element);
+ done &= scaler.done;
+ if (scaler.done) {
+ continue;
+ }
+ count++;
+ sum += scaler.tick(frameTime);
+ }
+ }
+ avg = sum / count;
+ bar.update(uniScaler.tick(frameTime, avg));
+ if (bar.done() || done || cancelAnimation) {
+ bar.update(100);
+ Pace.trigger('done');
+ return setTimeout(function() {
+ bar.finish();
+ Pace.running = false;
+ return Pace.trigger('hide');
+ }, Math.max(options.ghostTime, Math.max(options.minTime - (now() - start), 0)));
+ } else {
+ return enqueueNextFrame();
+ }
+ });
+ };
+
+ Pace.start = function(_options) {
+ extend(options, _options);
+ Pace.running = true;
+ try {
+ bar.render();
+ } catch (_error) {
+ NoTargetError = _error;
+ }
+ if (!document.querySelector('.pace')) {
+ return setTimeout(Pace.start, 50);
+ } else {
+ Pace.trigger('start');
+ return Pace.go();
+ }
+ };
+
+ if (typeof define === 'function' && define.amd) {
+ define(['pace'], function() {
+ return Pace;
+ });
+ } else if (typeof exports === 'object') {
+ module.exports = Pace;
+ } else {
+ if (options.startOnPageLoad) {
+ Pace.start();
+ }
+ }
+
+}).call(this);
diff --git a/public/bower_components/admin-lte/plugins/pace/pace.min.css b/public/bower_components/admin-lte/plugins/pace/pace.min.css
new file mode 100755
index 0000000..48cd432
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/pace/pace.min.css
@@ -0,0 +1 @@
+.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#fff;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px}.pace .pace-progress-inner{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #fff,0 0 5px #fff;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-moz-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);-o-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translate(0px,-4px)}.pace .pace-activity{display:block;position:fixed;z-index:2000;top:15px;right:50%;width:14px;height:14px;border:solid 2px transparent;border-top-color:#fff;border-left-color:#fff;border-radius:10px;-webkit-animation:pace-spinner 400ms linear infinite;-moz-animation:pace-spinner 400ms linear infinite;-ms-animation:pace-spinner 400ms linear infinite;-o-animation:pace-spinner 400ms linear infinite;animation:pace-spinner 400ms linear infinite}@media (max-width: 767px){.pace .pace-activity{top:15px;right:15px;width:14px;height:14px}}@-webkit-keyframes pace-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes pace-spinner{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes pace-spinner{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes pace-spinner{0%{-ms-transform:rotate(0deg);transform:rotate(0deg)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pace-spinner{0%{transform:rotate(0deg);transform:rotate(0deg)}100%{transform:rotate(360deg);transform:rotate(360deg)}} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/pace/pace.min.js b/public/bower_components/admin-lte/plugins/pace/pace.min.js
new file mode 100755
index 0000000..234f9b3
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/pace/pace.min.js
@@ -0,0 +1,2 @@
+/*! pace 1.0.2 */
+(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X=[].slice,Y={}.hasOwnProperty,Z=function(a,b){function c(){this.constructor=a}for(var d in b)Y.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},$=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};for(u={catchupTime:100,initialRate:.03,minTime:250,ghostTime:100,maxProgressPerFrame:20,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!0,ignoreURLs:[]}},C=function(){var a;return null!=(a="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?a:+new Date},E=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,t=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==E&&(E=function(a){return setTimeout(a,50)},t=function(a){return clearTimeout(a)}),G=function(a){var b,c;return b=C(),(c=function(){var d;return d=C()-b,d>=33?(b=C(),a(d,function(){return E(c)})):setTimeout(c,33-d)})()},F=function(){var a,b,c;return c=arguments[0],b=arguments[1],a=3<=arguments.length?X.call(arguments,2):[],"function"==typeof c[b]?c[b].apply(c,a):c[b]},v=function(){var a,b,c,d,e,f,g;for(b=arguments[0],d=2<=arguments.length?X.call(arguments,1):[],f=0,g=d.length;g>f;f++)if(c=d[f])for(a in c)Y.call(c,a)&&(e=c[a],null!=b[a]&&"object"==typeof b[a]&&null!=e&&"object"==typeof e?v(b[a],e):b[a]=e);return b},q=function(a){var b,c,d,e,f;for(c=b=0,e=0,f=a.length;f>e;e++)d=a[e],c+=Math.abs(d),b++;return c/b},x=function(a,b){var c,d,e;if(null==a&&(a="options"),null==b&&(b=!0),e=document.querySelector("[data-pace-"+a+"]")){if(c=e.getAttribute("data-pace-"+a),!b)return c;try{return JSON.parse(c)}catch(f){return d=f,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",d):void 0}}},g=function(){function a(){}return a.prototype.on=function(a,b,c,d){var e;return null==d&&(d=!1),null==this.bindings&&(this.bindings={}),null==(e=this.bindings)[a]&&(e[a]=[]),this.bindings[a].push({handler:b,ctx:c,once:d})},a.prototype.once=function(a,b,c){return this.on(a,b,c,!0)},a.prototype.off=function(a,b){var c,d,e;if(null!=(null!=(d=this.bindings)?d[a]:void 0)){if(null==b)return delete this.bindings[a];for(c=0,e=[];c<this.bindings[a].length;)e.push(this.bindings[a][c].handler===b?this.bindings[a].splice(c,1):c++);return e}},a.prototype.trigger=function(){var a,b,c,d,e,f,g,h,i;if(c=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],null!=(g=this.bindings)?g[c]:void 0){for(e=0,i=[];e<this.bindings[c].length;)h=this.bindings[c][e],d=h.handler,b=h.ctx,f=h.once,d.apply(null!=b?b:this,a),i.push(f?this.bindings[c].splice(e,1):e++);return i}},a}(),j=window.Pace||{},window.Pace=j,v(j,g.prototype),D=j.options=v({},u,window.paceOptions,x()),U=["ajax","document","eventLag","elements"],Q=0,S=U.length;S>Q;Q++)K=U[Q],D[K]===!0&&(D[K]=u[K]);i=function(a){function b(){return V=b.__super__.constructor.apply(this,arguments)}return Z(b,a),b}(Error),b=function(){function a(){this.progress=0}return a.prototype.getElement=function(){var a;if(null==this.el){if(a=document.querySelector(D.target),!a)throw new i;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),document.body.className+=" pace-running",this.el.innerHTML='<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>',null!=a.firstChild?a.insertBefore(this.el,a.firstChild):a.appendChild(this.el)}return this.el},a.prototype.finish=function(){var a;return a=this.getElement(),a.className=a.className.replace("pace-active",""),a.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},a.prototype.update=function(a){return this.progress=a,this.render()},a.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(a){i=a}return this.el=void 0},a.prototype.render=function(){var a,b,c,d,e,f,g;if(null==document.querySelector(D.target))return!1;for(a=this.getElement(),d="translate3d("+this.progress+"%, 0, 0)",g=["webkitTransform","msTransform","transform"],e=0,f=g.length;f>e;e++)b=g[e],a.children[0].style[b]=d;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(a.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?c="99":(c=this.progress<10?"0":"",c+=0|this.progress),a.children[0].setAttribute("data-progress",""+c)),this.lastRenderedProgress=this.progress},a.prototype.done=function(){return this.progress>=100},a}(),h=function(){function a(){this.bindings={}}return a.prototype.trigger=function(a,b){var c,d,e,f,g;if(null!=this.bindings[a]){for(f=this.bindings[a],g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.call(this,b));return g}},a.prototype.on=function(a,b){var c;return null==(c=this.bindings)[a]&&(c[a]=[]),this.bindings[a].push(b)},a}(),P=window.XMLHttpRequest,O=window.XDomainRequest,N=window.WebSocket,w=function(a,b){var c,d,e;e=[];for(d in b.prototype)try{e.push(null==a[d]&&"function"!=typeof b[d]?"function"==typeof Object.defineProperty?Object.defineProperty(a,d,{get:function(){return b.prototype[d]},configurable:!0,enumerable:!0}):a[d]=b.prototype[d]:void 0)}catch(f){c=f}return e},A=[],j.ignore=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("ignore"),c=b.apply(null,a),A.shift(),c},j.track=function(){var a,b,c;return b=arguments[0],a=2<=arguments.length?X.call(arguments,1):[],A.unshift("track"),c=b.apply(null,a),A.shift(),c},J=function(a){var b;if(null==a&&(a="GET"),"track"===A[0])return"force";if(!A.length&&D.ajax){if("socket"===a&&D.ajax.trackWebSockets)return!0;if(b=a.toUpperCase(),$.call(D.ajax.trackMethods,b)>=0)return!0}return!1},k=function(a){function b(){var a,c=this;b.__super__.constructor.apply(this,arguments),a=function(a){var b;return b=a.open,a.open=function(d,e){return J(d)&&c.trigger("request",{type:d,url:e,request:a}),b.apply(a,arguments)}},window.XMLHttpRequest=function(b){var c;return c=new P(b),a(c),c};try{w(window.XMLHttpRequest,P)}catch(d){}if(null!=O){window.XDomainRequest=function(){var b;return b=new O,a(b),b};try{w(window.XDomainRequest,O)}catch(d){}}if(null!=N&&D.ajax.trackWebSockets){window.WebSocket=function(a,b){var d;return d=null!=b?new N(a,b):new N(a),J("socket")&&c.trigger("request",{type:"socket",url:a,protocols:b,request:d}),d};try{w(window.WebSocket,N)}catch(d){}}}return Z(b,a),b}(h),R=null,y=function(){return null==R&&(R=new k),R},I=function(a){var b,c,d,e;for(e=D.ajax.ignoreURLs,c=0,d=e.length;d>c;c++)if(b=e[c],"string"==typeof b){if(-1!==a.indexOf(b))return!0}else if(b.test(a))return!0;return!1},y().on("request",function(b){var c,d,e,f,g;return f=b.type,e=b.request,g=b.url,I(g)?void 0:j.running||D.restartOnRequestAfter===!1&&"force"!==J(f)?void 0:(d=arguments,c=D.restartOnRequestAfter||0,"boolean"==typeof c&&(c=0),setTimeout(function(){var b,c,g,h,i,k;if(b="socket"===f?e.readyState<2:0<(h=e.readyState)&&4>h){for(j.restart(),i=j.sources,k=[],c=0,g=i.length;g>c;c++){if(K=i[c],K instanceof a){K.watch.apply(K,d);break}k.push(void 0)}return k}},c))}),a=function(){function a(){var a=this;this.elements=[],y().on("request",function(){return a.watch.apply(a,arguments)})}return a.prototype.watch=function(a){var b,c,d,e;return d=a.type,b=a.request,e=a.url,I(e)?void 0:(c="socket"===d?new n(b):new o(b),this.elements.push(c))},a}(),o=function(){function a(a){var b,c,d,e,f,g,h=this;if(this.progress=0,null!=window.ProgressEvent)for(c=null,a.addEventListener("progress",function(a){return h.progress=a.lengthComputable?100*a.loaded/a.total:h.progress+(100-h.progress)/2},!1),g=["load","abort","timeout","error"],d=0,e=g.length;e>d;d++)b=g[d],a.addEventListener(b,function(){return h.progress=100},!1);else f=a.onreadystatechange,a.onreadystatechange=function(){var b;return 0===(b=a.readyState)||4===b?h.progress=100:3===a.readyState&&(h.progress=50),"function"==typeof f?f.apply(null,arguments):void 0}}return a}(),n=function(){function a(a){var b,c,d,e,f=this;for(this.progress=0,e=["error","open"],c=0,d=e.length;d>c;c++)b=e[c],a.addEventListener(b,function(){return f.progress=100},!1)}return a}(),d=function(){function a(a){var b,c,d,f;for(null==a&&(a={}),this.elements=[],null==a.selectors&&(a.selectors=[]),f=a.selectors,c=0,d=f.length;d>c;c++)b=f[c],this.elements.push(new e(b))}return a}(),e=function(){function a(a){this.selector=a,this.progress=0,this.check()}return a.prototype.check=function(){var a=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return a.check()},D.elements.checkInterval)},a.prototype.done=function(){return this.progress=100},a}(),c=function(){function a(){var a,b,c=this;this.progress=null!=(b=this.states[document.readyState])?b:100,a=document.onreadystatechange,document.onreadystatechange=function(){return null!=c.states[document.readyState]&&(c.progress=c.states[document.readyState]),"function"==typeof a?a.apply(null,arguments):void 0}}return a.prototype.states={loading:0,interactive:50,complete:100},a}(),f=function(){function a(){var a,b,c,d,e,f=this;this.progress=0,a=0,e=[],d=0,c=C(),b=setInterval(function(){var g;return g=C()-c-50,c=C(),e.push(g),e.length>D.eventLag.sampleCount&&e.shift(),a=q(e),++d>=D.eventLag.minSamples&&a<D.eventLag.lagThreshold?(f.progress=100,clearInterval(b)):f.progress=100*(3/(a+3))},50)}return a}(),m=function(){function a(a){this.source=a,this.last=this.sinceLastUpdate=0,this.rate=D.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=F(this.source,"progress"))}return a.prototype.tick=function(a,b){var c;return null==b&&(b=F(this.source,"progress")),b>=100&&(this.done=!0),b===this.last?this.sinceLastUpdate+=a:(this.sinceLastUpdate&&(this.rate=(b-this.last)/this.sinceLastUpdate),this.catchup=(b-this.progress)/D.catchupTime,this.sinceLastUpdate=0,this.last=b),b>this.progress&&(this.progress+=this.catchup*a),c=1-Math.pow(this.progress/100,D.easeFactor),this.progress+=c*this.rate*a,this.progress=Math.min(this.lastProgress+D.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},a}(),L=null,H=null,r=null,M=null,p=null,s=null,j.running=!1,z=function(){return D.restartOnPushState?j.restart():void 0},null!=window.history.pushState&&(T=window.history.pushState,window.history.pushState=function(){return z(),T.apply(window.history,arguments)}),null!=window.history.replaceState&&(W=window.history.replaceState,window.history.replaceState=function(){return z(),W.apply(window.history,arguments)}),l={ajax:a,elements:d,document:c,eventLag:f},(B=function(){var a,c,d,e,f,g,h,i;for(j.sources=L=[],g=["ajax","elements","document","eventLag"],c=0,e=g.length;e>c;c++)a=g[c],D[a]!==!1&&L.push(new l[a](D[a]));for(i=null!=(h=D.extraSources)?h:[],d=0,f=i.length;f>d;d++)K=i[d],L.push(new K(D));return j.bar=r=new b,H=[],M=new m})(),j.stop=function(){return j.trigger("stop"),j.running=!1,r.destroy(),s=!0,null!=p&&("function"==typeof t&&t(p),p=null),B()},j.restart=function(){return j.trigger("restart"),j.stop(),j.start()},j.go=function(){var a;return j.running=!0,r.render(),a=C(),s=!1,p=G(function(b,c){var d,e,f,g,h,i,k,l,n,o,p,q,t,u,v,w;for(l=100-r.progress,e=p=0,f=!0,i=q=0,u=L.length;u>q;i=++q)for(K=L[i],o=null!=H[i]?H[i]:H[i]=[],h=null!=(w=K.elements)?w:[K],k=t=0,v=h.length;v>t;k=++t)g=h[k],n=null!=o[k]?o[k]:o[k]=new m(g),f&=n.done,n.done||(e++,p+=n.tick(b));return d=p/e,r.update(M.tick(b,d)),r.done()||f||s?(r.update(100),j.trigger("done"),setTimeout(function(){return r.finish(),j.running=!1,j.trigger("hide")},Math.max(D.ghostTime,Math.max(D.minTime-(C()-a),0)))):c()})},j.start=function(a){v(D,a),j.running=!0;try{r.render()}catch(b){i=b}return document.querySelector(".pace")?(j.trigger("start"),j.go()):setTimeout(j.start,50)},"function"==typeof define&&define.amd?define(["pace"],function(){return j}):"object"==typeof exports?module.exports=j:D.startOnPageLoad&&j.start()}).call(this); \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.css b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.css
new file mode 100644
index 0000000..873e0c7
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.css
@@ -0,0 +1,121 @@
+/*!
+ * Timepicker Component for Twitter Bootstrap
+ *
+ * Copyright 2013 Joris de Wit
+ *
+ * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+.bootstrap-timepicker {
+ position: relative;
+}
+.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu {
+ left: auto;
+ right: 0;
+}
+.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:before {
+ left: auto;
+ right: 12px;
+}
+.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:after {
+ left: auto;
+ right: 13px;
+}
+.bootstrap-timepicker .add-on {
+ cursor: pointer;
+}
+.bootstrap-timepicker .add-on i {
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+}
+.bootstrap-timepicker-widget.dropdown-menu {
+ padding: 2px 3px 2px 2px;
+}
+.bootstrap-timepicker-widget.dropdown-menu.open {
+ display: inline-block;
+}
+.bootstrap-timepicker-widget.dropdown-menu:before {
+ border-bottom: 7px solid rgba(0, 0, 0, 0.2);
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ content: "";
+ display: inline-block;
+ left: 9px;
+ position: absolute;
+ top: -7px;
+}
+.bootstrap-timepicker-widget.dropdown-menu:after {
+ border-bottom: 6px solid #FFFFFF;
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ content: "";
+ display: inline-block;
+ left: 10px;
+ position: absolute;
+ top: -6px;
+}
+.bootstrap-timepicker-widget a.btn,
+.bootstrap-timepicker-widget input {
+ border-radius: 4px;
+}
+.bootstrap-timepicker-widget table {
+ width: 100%;
+ margin: 0;
+}
+.bootstrap-timepicker-widget table td {
+ text-align: center;
+ height: 30px;
+ margin: 0;
+ padding: 2px;
+}
+.bootstrap-timepicker-widget table td:not(.separator) {
+ min-width: 30px;
+}
+.bootstrap-timepicker-widget table td span {
+ width: 100%;
+}
+.bootstrap-timepicker-widget table td a {
+ border: 1px transparent solid;
+ width: 100%;
+ display: inline-block;
+ margin: 0;
+ padding: 8px 0;
+ outline: 0;
+ color: #333;
+}
+.bootstrap-timepicker-widget table td a:hover {
+ text-decoration: none;
+ background-color: #eee;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ border-color: #ddd;
+}
+.bootstrap-timepicker-widget table td a i {
+ margin-top: 2px;
+}
+.bootstrap-timepicker-widget table td input {
+ width: 25px;
+ margin: 0;
+ text-align: center;
+}
+.bootstrap-timepicker-widget .modal-content {
+ padding: 4px;
+}
+@media (min-width: 767px) {
+ .bootstrap-timepicker-widget.modal {
+ width: 200px;
+ margin-left: -100px;
+ }
+}
+@media (max-width: 767px) {
+ .bootstrap-timepicker {
+ width: 100%;
+ }
+ .bootstrap-timepicker .dropdown-menu {
+ width: 100%;
+ }
+}
diff --git a/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.js b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.js
new file mode 100644
index 0000000..3068c94
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.js
@@ -0,0 +1,903 @@
+//TODO: move arrow styles and button click code into configurable items, with defaults matching the existing code
+
+/*!
+* Timepicker Component for Twitter Bootstrap
+*
+* Copyright 2013 Joris de Wit
+*
+* Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors
+*
+* For the full copyright and license information, please view the LICENSE
+* file that was distributed with this source code.
+*/
+(function($, window, document, undefined) {
+ 'use strict';
+
+ // TIMEPICKER PUBLIC CLASS DEFINITION
+ var Timepicker = function(element, options) {
+ this.widget = '';
+ this.$element = $(element);
+ this.defaultTime = options.defaultTime;
+ this.disableFocus = options.disableFocus;
+ this.isOpen = options.isOpen;
+ this.minuteStep = options.minuteStep;
+ this.modalBackdrop = options.modalBackdrop;
+ this.secondStep = options.secondStep;
+ this.showInputs = options.showInputs;
+ this.showMeridian = options.showMeridian;
+ this.showSeconds = options.showSeconds;
+ this.template = options.template;
+ this.appendWidgetTo = options.appendWidgetTo;
+ this.upArrowStyle = options.upArrowStyle;
+ this.downArrowStyle = options.downArrowStyle;
+ this.containerClass = options.containerClass;
+
+ this._init();
+ };
+
+ Timepicker.prototype = {
+
+ constructor: Timepicker,
+
+ _init: function() {
+ var self = this;
+
+ if (this.$element.parent().hasClass('input-append') || this.$element.parent().hasClass('input-prepend')) {
+ if (this.$element.parent('.input-append, .input-prepend').find('.add-on').length) {
+ this.$element.parent('.input-append, .input-prepend').find('.add-on').on({
+ 'click.timepicker': $.proxy(this.showWidget, this)
+ });
+ } else {
+ this.$element.closest(this.containerClass).find('.add-on').on({
+ 'click.timepicker': $.proxy(this.showWidget, this)
+ });
+ }
+
+ this.$element.on({
+ 'focus.timepicker': $.proxy(this.highlightUnit, this),
+ 'click.timepicker': $.proxy(this.highlightUnit, this),
+ 'keydown.timepicker': $.proxy(this.elementKeydown, this),
+ 'blur.timepicker': $.proxy(this.blurElement, this)
+ });
+ } else {
+ if (this.template) {
+ this.$element.on({
+ 'focus.timepicker': $.proxy(this.showWidget, this),
+ 'click.timepicker': $.proxy(this.showWidget, this),
+ 'blur.timepicker': $.proxy(this.blurElement, this)
+ });
+ } else {
+ this.$element.on({
+ 'focus.timepicker': $.proxy(this.highlightUnit, this),
+ 'click.timepicker': $.proxy(this.highlightUnit, this),
+ 'keydown.timepicker': $.proxy(this.elementKeydown, this),
+ 'blur.timepicker': $.proxy(this.blurElement, this)
+ });
+ }
+ }
+
+ if (this.template !== false) {
+ this.$widget = $(this.getTemplate()).prependTo(this.$element.parents(this.appendWidgetTo)).on('click', $.proxy(this.widgetClick, this));
+ } else {
+ this.$widget = false;
+ }
+
+ if (this.showInputs && this.$widget !== false) {
+ this.$widget.find('input').each(function() {
+ $(this).on({
+ 'click.timepicker': function() { $(this).select(); },
+ 'keydown.timepicker': $.proxy(self.widgetKeydown, self)
+ });
+ });
+ }
+
+ this.setDefaultTime(this.defaultTime);
+ },
+
+ blurElement: function() {
+ this.highlightedUnit = undefined;
+ this.updateFromElementVal();
+ },
+
+ decrementHour: function() {
+ if (this.showMeridian) {
+ if (this.hour === 1) {
+ this.hour = 12;
+ } else if (this.hour === 12) {
+ this.hour--;
+
+ return this.toggleMeridian();
+ } else if (this.hour === 0) {
+ this.hour = 11;
+
+ return this.toggleMeridian();
+ } else {
+ this.hour--;
+ }
+ } else {
+ if (this.hour === 0) {
+ this.hour = 23;
+ } else {
+ this.hour--;
+ }
+ }
+ this.update();
+ },
+
+ decrementMinute: function(step) {
+ var newVal;
+
+ if (step) {
+ newVal = this.minute - step;
+ } else {
+ newVal = this.minute - this.minuteStep;
+ }
+
+ if (newVal < 0) {
+ this.decrementHour();
+ this.minute = newVal + 60;
+ } else {
+ this.minute = newVal;
+ }
+ this.update();
+ },
+
+ decrementSecond: function() {
+ var newVal = this.second - this.secondStep;
+
+ if (newVal < 0) {
+ this.decrementMinute(true);
+ this.second = newVal + 60;
+ } else {
+ this.second = newVal;
+ }
+ this.update();
+ },
+
+ elementKeydown: function(e) {
+ switch (e.keyCode) {
+ case 9: //tab
+ this.updateFromElementVal();
+
+ switch (this.highlightedUnit) {
+ case 'hour':
+ e.preventDefault();
+ this.highlightNextUnit();
+ break;
+ case 'minute':
+ if (this.showMeridian || this.showSeconds) {
+ e.preventDefault();
+ this.highlightNextUnit();
+ }
+ break;
+ case 'second':
+ if (this.showMeridian) {
+ e.preventDefault();
+ this.highlightNextUnit();
+ }
+ break;
+ }
+ break;
+ case 27: // escape
+ this.updateFromElementVal();
+ break;
+ case 37: // left arrow
+ e.preventDefault();
+ this.highlightPrevUnit();
+ this.updateFromElementVal();
+ break;
+ case 38: // up arrow
+ e.preventDefault();
+ switch (this.highlightedUnit) {
+ case 'hour':
+ this.incrementHour();
+ this.highlightHour();
+ break;
+ case 'minute':
+ this.incrementMinute();
+ this.highlightMinute();
+ break;
+ case 'second':
+ this.incrementSecond();
+ this.highlightSecond();
+ break;
+ case 'meridian':
+ this.toggleMeridian();
+ this.highlightMeridian();
+ break;
+ }
+ break;
+ case 39: // right arrow
+ e.preventDefault();
+ this.updateFromElementVal();
+ this.highlightNextUnit();
+ break;
+ case 40: // down arrow
+ e.preventDefault();
+ switch (this.highlightedUnit) {
+ case 'hour':
+ this.decrementHour();
+ this.highlightHour();
+ break;
+ case 'minute':
+ this.decrementMinute();
+ this.highlightMinute();
+ break;
+ case 'second':
+ this.decrementSecond();
+ this.highlightSecond();
+ break;
+ case 'meridian':
+ this.toggleMeridian();
+ this.highlightMeridian();
+ break;
+ }
+ break;
+ }
+ },
+
+ formatTime: function(hour, minute, second, meridian) {
+ hour = hour < 10 ? '0' + hour : hour;
+ minute = minute < 10 ? '0' + minute : minute;
+ second = second < 10 ? '0' + second : second;
+
+ return hour + ':' + minute + (this.showSeconds ? ':' + second : '') + (this.showMeridian ? ' ' + meridian : '');
+ },
+
+ getCursorPosition: function() {
+ var input = this.$element.get(0);
+
+ if ('selectionStart' in input) {// Standard-compliant browsers
+
+ return input.selectionStart;
+ } else if (document.selection) {// IE fix
+ input.focus();
+ var sel = document.selection.createRange(),
+ selLen = document.selection.createRange().text.length;
+
+ sel.moveStart('character', - input.value.length);
+
+ return sel.text.length - selLen;
+ }
+ },
+
+ getTemplate: function() {
+ var template,
+ hourTemplate,
+ minuteTemplate,
+ secondTemplate,
+ meridianTemplate,
+ templateContent;
+
+ if (this.showInputs) {
+ hourTemplate = '<input type="text" name="hour" class="bootstrap-timepicker-hour form-control" maxlength="2"/>';
+ minuteTemplate = '<input type="text" name="minute" class="bootstrap-timepicker-minute form-control" maxlength="2"/>';
+ secondTemplate = '<input type="text" name="second" class="bootstrap-timepicker-second form-control" maxlength="2"/>';
+ meridianTemplate = '<input type="text" name="meridian" class="bootstrap-timepicker-meridian form-control" maxlength="2"/>';
+ } else {
+ hourTemplate = '<span class="bootstrap-timepicker-hour"></span>';
+ minuteTemplate = '<span class="bootstrap-timepicker-minute"></span>';
+ secondTemplate = '<span class="bootstrap-timepicker-second"></span>';
+ meridianTemplate = '<span class="bootstrap-timepicker-meridian"></span>';
+ }
+
+ templateContent = '<table>'+
+ '<tr>'+
+ '<td><a href="#" data-action="incrementHour"><i class="' + this.upArrowStyle + '"></i></a></td>'+
+ '<td class="separator">&nbsp;</td>'+
+ '<td><a href="#" data-action="incrementMinute"><i class="' + this.upArrowStyle + '"></i></a></td>'+
+ (this.showSeconds ?
+ '<td class="separator">&nbsp;</td>'+
+ '<td><a href="#" data-action="incrementSecond"><i class="' + this.upArrowStyle + '"></i></a></td>'
+ : '') +
+ (this.showMeridian ?
+ '<td class="separator">&nbsp;</td>'+
+ '<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="' + this.upArrowStyle + '"></i></a></td>'
+ : '') +
+ '</tr>'+
+ '<tr>'+
+ '<td>'+ hourTemplate +'</td> '+
+ '<td class="separator">:</td>'+
+ '<td>'+ minuteTemplate +'</td> '+
+ (this.showSeconds ?
+ '<td class="separator">:</td>'+
+ '<td>'+ secondTemplate +'</td>'
+ : '') +
+ (this.showMeridian ?
+ '<td class="separator">&nbsp;</td>'+
+ '<td>'+ meridianTemplate +'</td>'
+ : '') +
+ '</tr>'+
+ '<tr>'+
+ '<td><a href="#" data-action="decrementHour"><i class="' + this.downArrowStyle + '"></i></a></td>'+
+ '<td class="separator"></td>'+
+ '<td><a href="#" data-action="decrementMinute"><i class="' + this.downArrowStyle + '"></i></a></td>'+
+ (this.showSeconds ?
+ '<td class="separator">&nbsp;</td>'+
+ '<td><a href="#" data-action="decrementSecond"><i class="' + this.downArrowStyle + '"></i></a></td>'
+ : '') +
+ (this.showMeridian ?
+ '<td class="separator">&nbsp;</td>'+
+ '<td><a href="#" data-action="toggleMeridian"><i class="' + this.downArrowStyle + '"></i></a></td>'
+ : '') +
+ '</tr>'+
+ '</table>';
+
+ switch(this.template) {
+ case 'modal':
+ template = '<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+ (this.modalBackdrop ? 'true' : 'false') +'">'+
+ '<div class="modal-header">'+
+ '<a href="#" class="close" data-dismiss="modal">×</a>'+
+ '<h3>Pick a Time</h3>'+
+ '</div>'+
+ '<div class="modal-content">'+
+ templateContent +
+ '</div>'+
+ '<div class="modal-footer">'+
+ '<a href="#" class="btn btn-primary" data-dismiss="modal">OK</a>'+
+ '</div>'+
+ '</div>';
+ break;
+ case 'dropdown':
+ template = '<div class="bootstrap-timepicker-widget dropdown-menu">'+ templateContent +'</div>';
+ break;
+ }
+
+ return template;
+ },
+
+ getTime: function() {
+ return this.formatTime(this.hour, this.minute, this.second, this.meridian);
+ },
+
+ hideWidget: function() {
+ if (this.isOpen === false) {
+ return;
+ }
+
+ if (this.showInputs) {
+ this.updateFromWidgetInputs();
+ }
+
+ this.$element.trigger({
+ 'type': 'hide.timepicker',
+ 'time': {
+ 'value': this.getTime(),
+ 'hours': this.hour,
+ 'minutes': this.minute,
+ 'seconds': this.second,
+ 'meridian': this.meridian
+ }
+ });
+
+ if (this.template === 'modal' && this.$widget.modal) {
+ this.$widget.modal('hide');
+ } else {
+ this.$widget.removeClass('open');
+ }
+
+ $(document).off('mousedown.timepicker');
+
+ this.isOpen = false;
+ },
+
+ highlightUnit: function() {
+ this.position = this.getCursorPosition();
+ if (this.position >= 0 && this.position <= 2) {
+ this.highlightHour();
+ } else if (this.position >= 3 && this.position <= 5) {
+ this.highlightMinute();
+ } else if (this.position >= 6 && this.position <= 8) {
+ if (this.showSeconds) {
+ this.highlightSecond();
+ } else {
+ this.highlightMeridian();
+ }
+ } else if (this.position >= 9 && this.position <= 11) {
+ this.highlightMeridian();
+ }
+ },
+
+ highlightNextUnit: function() {
+ switch (this.highlightedUnit) {
+ case 'hour':
+ this.highlightMinute();
+ break;
+ case 'minute':
+ if (this.showSeconds) {
+ this.highlightSecond();
+ } else if (this.showMeridian){
+ this.highlightMeridian();
+ } else {
+ this.highlightHour();
+ }
+ break;
+ case 'second':
+ if (this.showMeridian) {
+ this.highlightMeridian();
+ } else {
+ this.highlightHour();
+ }
+ break;
+ case 'meridian':
+ this.highlightHour();
+ break;
+ }
+ },
+
+ highlightPrevUnit: function() {
+ switch (this.highlightedUnit) {
+ case 'hour':
+ this.highlightMeridian();
+ break;
+ case 'minute':
+ this.highlightHour();
+ break;
+ case 'second':
+ this.highlightMinute();
+ break;
+ case 'meridian':
+ if (this.showSeconds) {
+ this.highlightSecond();
+ } else {
+ this.highlightMinute();
+ }
+ break;
+ }
+ },
+
+ highlightHour: function() {
+ var $element = this.$element.get(0);
+
+ this.highlightedUnit = 'hour';
+
+ if ($element.setSelectionRange) {
+ setTimeout(function() {
+ $element.setSelectionRange(0,2);
+ }, 0);
+ }
+ },
+
+ highlightMinute: function() {
+ var $element = this.$element.get(0);
+
+ this.highlightedUnit = 'minute';
+
+ if ($element.setSelectionRange) {
+ setTimeout(function() {
+ $element.setSelectionRange(3,5);
+ }, 0);
+ }
+ },
+
+ highlightSecond: function() {
+ var $element = this.$element.get(0);
+
+ this.highlightedUnit = 'second';
+
+ if ($element.setSelectionRange) {
+ setTimeout(function() {
+ $element.setSelectionRange(6,8);
+ }, 0);
+ }
+ },
+
+ highlightMeridian: function() {
+ var $element = this.$element.get(0);
+
+ this.highlightedUnit = 'meridian';
+
+ if ($element.setSelectionRange) {
+ if (this.showSeconds) {
+ setTimeout(function() {
+ $element.setSelectionRange(9,11);
+ }, 0);
+ } else {
+ setTimeout(function() {
+ $element.setSelectionRange(6,8);
+ }, 0);
+ }
+ }
+ },
+
+ incrementHour: function() {
+ if (this.showMeridian) {
+ if (this.hour === 11) {
+ this.hour++;
+ return this.toggleMeridian();
+ } else if (this.hour === 12) {
+ this.hour = 0;
+ }
+ }
+ if (this.hour === 23) {
+ this.hour = 0;
+
+ return;
+ }
+ this.hour++;
+ this.update();
+ },
+
+ incrementMinute: function(step) {
+ var newVal;
+
+ if (step) {
+ newVal = this.minute + step;
+ } else {
+ newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
+ }
+
+ if (newVal > 59) {
+ this.incrementHour();
+ this.minute = newVal - 60;
+ } else {
+ this.minute = newVal;
+ }
+ this.update();
+ },
+
+ incrementSecond: function() {
+ var newVal = this.second + this.secondStep - (this.second % this.secondStep);
+
+ if (newVal > 59) {
+ this.incrementMinute(true);
+ this.second = newVal - 60;
+ } else {
+ this.second = newVal;
+ }
+ this.update();
+ },
+
+ remove: function() {
+ $('document').off('.timepicker');
+ if (this.$widget) {
+ this.$widget.remove();
+ }
+ delete this.$element.data().timepicker;
+ },
+
+ setDefaultTime: function(defaultTime){
+ if (!this.$element.val()) {
+ if (defaultTime === 'current') {
+ var dTime = new Date(),
+ hours = dTime.getHours(),
+ minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep,
+ seconds = Math.floor(dTime.getSeconds() / this.secondStep) * this.secondStep,
+ meridian = 'AM';
+
+ if (this.showMeridian) {
+ if (hours === 0) {
+ hours = 12;
+ } else if (hours >= 12) {
+ if (hours > 12) {
+ hours = hours - 12;
+ }
+ meridian = 'PM';
+ } else {
+ meridian = 'AM';
+ }
+ }
+
+ this.hour = hours;
+ this.minute = minutes;
+ this.second = seconds;
+ this.meridian = meridian;
+
+ this.update();
+
+ } else if (defaultTime === false) {
+ this.hour = 0;
+ this.minute = 0;
+ this.second = 0;
+ this.meridian = 'AM';
+ } else {
+ this.setTime(defaultTime);
+ }
+ } else {
+ this.updateFromElementVal();
+ }
+ },
+
+ setTime: function(time) {
+ var arr,
+ timeArray;
+
+ if (this.showMeridian) {
+ arr = time.split(' ');
+ timeArray = arr[0].split(':');
+ this.meridian = arr[1];
+ } else {
+ timeArray = time.split(':');
+ }
+
+ this.hour = parseInt(timeArray[0], 10);
+ this.minute = parseInt(timeArray[1], 10);
+ this.second = parseInt(timeArray[2], 10);
+
+ if (isNaN(this.hour)) {
+ this.hour = 0;
+ }
+ if (isNaN(this.minute)) {
+ this.minute = 0;
+ }
+
+ if (this.showMeridian) {
+ if (this.hour > 12) {
+ this.hour = 12;
+ } else if (this.hour < 1) {
+ this.hour = 12;
+ }
+
+ if (this.meridian === 'am' || this.meridian === 'a') {
+ this.meridian = 'AM';
+ } else if (this.meridian === 'pm' || this.meridian === 'p') {
+ this.meridian = 'PM';
+ }
+
+ if (this.meridian !== 'AM' && this.meridian !== 'PM') {
+ this.meridian = 'AM';
+ }
+ } else {
+ if (this.hour >= 24) {
+ this.hour = 23;
+ } else if (this.hour < 0) {
+ this.hour = 0;
+ }
+ }
+
+ if (this.minute < 0) {
+ this.minute = 0;
+ } else if (this.minute >= 60) {
+ this.minute = 59;
+ }
+
+ if (this.showSeconds) {
+ if (isNaN(this.second)) {
+ this.second = 0;
+ } else if (this.second < 0) {
+ this.second = 0;
+ } else if (this.second >= 60) {
+ this.second = 59;
+ }
+ }
+
+ this.update();
+ },
+
+ showWidget: function() {
+ if (this.isOpen) {
+ return;
+ }
+
+ if (this.$element.is(':disabled')) {
+ return;
+ }
+
+ var self = this;
+ $(document).on('mousedown.timepicker', function (e) {
+ // Clicked outside the timepicker, hide it
+ if ($(e.target).closest('.bootstrap-timepicker-widget').length === 0) {
+ self.hideWidget();
+ }
+ });
+
+ this.$element.trigger({
+ 'type': 'show.timepicker',
+ 'time': {
+ 'value': this.getTime(),
+ 'hours': this.hour,
+ 'minutes': this.minute,
+ 'seconds': this.second,
+ 'meridian': this.meridian
+ }
+ });
+
+ if (this.disableFocus) {
+ this.$element.blur();
+ }
+
+ this.updateFromElementVal();
+
+ if (this.template === 'modal' && this.$widget.modal) {
+ this.$widget.modal('show').on('hidden', $.proxy(this.hideWidget, this));
+ } else {
+ if (this.isOpen === false) {
+ this.$widget.addClass('open');
+ }
+ }
+
+ this.isOpen = true;
+ },
+
+ toggleMeridian: function() {
+ this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
+ this.update();
+ },
+
+ update: function() {
+ this.$element.trigger({
+ 'type': 'changeTime.timepicker',
+ 'time': {
+ 'value': this.getTime(),
+ 'hours': this.hour,
+ 'minutes': this.minute,
+ 'seconds': this.second,
+ 'meridian': this.meridian
+ }
+ });
+
+ this.updateElement();
+ this.updateWidget();
+ },
+
+ updateElement: function() {
+ this.$element.val(this.getTime()).change();
+ },
+
+ updateFromElementVal: function() {
+ var val = this.$element.val();
+
+ if (val) {
+ this.setTime(val);
+ }
+ },
+
+ updateWidget: function() {
+ if (this.$widget === false) {
+ return;
+ }
+
+ var hour = this.hour < 10 ? '0' + this.hour : this.hour,
+ minute = this.minute < 10 ? '0' + this.minute : this.minute,
+ second = this.second < 10 ? '0' + this.second : this.second;
+
+ if (this.showInputs) {
+ this.$widget.find('input.bootstrap-timepicker-hour').val(hour);
+ this.$widget.find('input.bootstrap-timepicker-minute').val(minute);
+
+ if (this.showSeconds) {
+ this.$widget.find('input.bootstrap-timepicker-second').val(second);
+ }
+ if (this.showMeridian) {
+ this.$widget.find('input.bootstrap-timepicker-meridian').val(this.meridian);
+ }
+ } else {
+ this.$widget.find('span.bootstrap-timepicker-hour').text(hour);
+ this.$widget.find('span.bootstrap-timepicker-minute').text(minute);
+
+ if (this.showSeconds) {
+ this.$widget.find('span.bootstrap-timepicker-second').text(second);
+ }
+ if (this.showMeridian) {
+ this.$widget.find('span.bootstrap-timepicker-meridian').text(this.meridian);
+ }
+ }
+ },
+
+ updateFromWidgetInputs: function() {
+ if (this.$widget === false) {
+ return;
+ }
+ var time = $('input.bootstrap-timepicker-hour', this.$widget).val() + ':' +
+ $('input.bootstrap-timepicker-minute', this.$widget).val() +
+ (this.showSeconds ? ':' + $('input.bootstrap-timepicker-second', this.$widget).val() : '') +
+ (this.showMeridian ? ' ' + $('input.bootstrap-timepicker-meridian', this.$widget).val() : '');
+
+ this.setTime(time);
+ },
+
+ widgetClick: function(e) {
+ e.stopPropagation();
+ e.preventDefault();
+
+ var action = $(e.target).closest('a').data('action');
+ if (action) {
+ this[action]();
+ }
+ },
+
+ widgetKeydown: function(e) {
+ var $input = $(e.target).closest('input'),
+ name = $input.attr('name');
+
+ switch (e.keyCode) {
+ case 9: //tab
+ if (this.showMeridian) {
+ if (name === 'meridian') {
+ return this.hideWidget();
+ }
+ } else {
+ if (this.showSeconds) {
+ if (name === 'second') {
+ return this.hideWidget();
+ }
+ } else {
+ if (name === 'minute') {
+ return this.hideWidget();
+ }
+ }
+ }
+
+ this.updateFromWidgetInputs();
+ break;
+ case 27: // escape
+ this.hideWidget();
+ break;
+ case 38: // up arrow
+ e.preventDefault();
+ switch (name) {
+ case 'hour':
+ this.incrementHour();
+ break;
+ case 'minute':
+ this.incrementMinute();
+ break;
+ case 'second':
+ this.incrementSecond();
+ break;
+ case 'meridian':
+ this.toggleMeridian();
+ break;
+ }
+ break;
+ case 40: // down arrow
+ e.preventDefault();
+ switch (name) {
+ case 'hour':
+ this.decrementHour();
+ break;
+ case 'minute':
+ this.decrementMinute();
+ break;
+ case 'second':
+ this.decrementSecond();
+ break;
+ case 'meridian':
+ this.toggleMeridian();
+ break;
+ }
+ break;
+ }
+ }
+ };
+
+
+ //TIMEPICKER PLUGIN DEFINITION
+ $.fn.timepicker = function(option) {
+ var args = Array.apply(null, arguments);
+ args.shift();
+ return this.each(function() {
+ var $this = $(this),
+ data = $this.data('timepicker'),
+ options = typeof option === 'object' && option;
+
+ if (!data) {
+ $this.data('timepicker', (data = new Timepicker(this, $.extend({}, $.fn.timepicker.defaults, options, $(this).data()))));
+ }
+
+ if (typeof option === 'string') {
+ data[option].apply(data, args);
+ }
+ });
+ };
+
+ $.fn.timepicker.defaults = {
+ defaultTime: 'current',
+ disableFocus: false,
+ isOpen: false,
+ minuteStep: 15,
+ modalBackdrop: false,
+ secondStep: 15,
+ showSeconds: false,
+ showInputs: true,
+ showMeridian: true,
+ template: 'dropdown',
+ appendWidgetTo: '.bootstrap-timepicker',
+ upArrowStyle: 'glyphicon glyphicon-chevron-up',
+ downArrowStyle: 'glyphicon glyphicon-chevron-down',
+ containerClass: 'bootstrap-timepicker'
+ };
+
+ $.fn.timepicker.Constructor = Timepicker;
+
+})(jQuery, window, document);
diff --git a/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.css b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.css
new file mode 100644
index 0000000..b59d6f7
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.css
@@ -0,0 +1,10 @@
+/*!
+ * Timepicker Component for Twitter Bootstrap
+ *
+ * Copyright 2013 Joris de Wit
+ *
+ * Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */.bootstrap-timepicker{position:relative}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu{left:auto;right:0}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:before{left:auto;right:12px}.bootstrap-timepicker.pull-right .bootstrap-timepicker-widget.dropdown-menu:after{left:auto;right:13px}.bootstrap-timepicker .add-on{cursor:pointer}.bootstrap-timepicker .add-on i{display:inline-block;width:16px;height:16px}.bootstrap-timepicker-widget.dropdown-menu{padding:2px 3px 2px 2px}.bootstrap-timepicker-widget.dropdown-menu.open{display:inline-block}.bootstrap-timepicker-widget.dropdown-menu:before{border-bottom:7px solid rgba(0,0,0,0.2);border-left:7px solid transparent;border-right:7px solid transparent;content:"";display:inline-block;left:9px;position:absolute;top:-7px}.bootstrap-timepicker-widget.dropdown-menu:after{border-bottom:6px solid #fff;border-left:6px solid transparent;border-right:6px solid transparent;content:"";display:inline-block;left:10px;position:absolute;top:-6px}.bootstrap-timepicker-widget a.btn,.bootstrap-timepicker-widget input{border-radius:4px}.bootstrap-timepicker-widget table{width:100%;margin:0}.bootstrap-timepicker-widget table td{text-align:center;height:30px;margin:0;padding:2px}.bootstrap-timepicker-widget table td:not(.separator){min-width:30px}.bootstrap-timepicker-widget table td span{width:100%}.bootstrap-timepicker-widget table td a{border:1px transparent solid;width:100%;display:inline-block;margin:0;padding:8px 0;outline:0;color:#333}.bootstrap-timepicker-widget table td a:hover{text-decoration:none;background-color:#eee;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border-color:#ddd}.bootstrap-timepicker-widget table td a i{margin-top:2px}.bootstrap-timepicker-widget table td input{width:25px;margin:0;text-align:center}.bootstrap-timepicker-widget .modal-content{padding:4px}@media(min-width:767px){.bootstrap-timepicker-widget.modal{width:200px;margin-left:-100px}}@media(max-width:767px){.bootstrap-timepicker{width:100%}.bootstrap-timepicker .dropdown-menu{width:100%}} \ No newline at end of file
diff --git a/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.js b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.js
new file mode 100644
index 0000000..3c78d5c
--- /dev/null
+++ b/public/bower_components/admin-lte/plugins/timepicker/bootstrap-timepicker.min.js
@@ -0,0 +1,5 @@
+/*! bootstrap-timepicker v0.2.3
+* http://jdewit.github.com/bootstrap-timepicker
+* Copyright (c) 2013 Joris de Wit
+* MIT License
+*/(function(e,t,n,r){"use strict";var i=function(t,n){this.widget="";this.$element=e(t);this.defaultTime=n.defaultTime;this.disableFocus=n.disableFocus;this.isOpen=n.isOpen;this.minuteStep=n.minuteStep;this.modalBackdrop=n.modalBackdrop;this.secondStep=n.secondStep;this.showInputs=n.showInputs;this.showMeridian=n.showMeridian;this.showSeconds=n.showSeconds;this.template=n.template;this.appendWidgetTo=n.appendWidgetTo;this.upArrowStyle=n.upArrowStyle;this.downArrowStyle=n.downArrowStyle;this.containerClass=n.containerClass;this._init()};i.prototype={constructor:i,_init:function(){var t=this;if(this.$element.parent().hasClass("input-append")||this.$element.parent().hasClass("input-prepend")){if(this.$element.parent(".input-append, .input-prepend").find(".add-on").length){this.$element.parent(".input-append, .input-prepend").find(".add-on").on({"click.timepicker":e.proxy(this.showWidget,this)})}else{this.$element.closest(this.containerClass).find(".add-on").on({"click.timepicker":e.proxy(this.showWidget,this)})}this.$element.on({"focus.timepicker":e.proxy(this.highlightUnit,this),"click.timepicker":e.proxy(this.highlightUnit,this),"keydown.timepicker":e.proxy(this.elementKeydown,this),"blur.timepicker":e.proxy(this.blurElement,this)})}else{if(this.template){this.$element.on({"focus.timepicker":e.proxy(this.showWidget,this),"click.timepicker":e.proxy(this.showWidget,this),"blur.timepicker":e.proxy(this.blurElement,this)})}else{this.$element.on({"focus.timepicker":e.proxy(this.highlightUnit,this),"click.timepicker":e.proxy(this.highlightUnit,this),"keydown.timepicker":e.proxy(this.elementKeydown,this),"blur.timepicker":e.proxy(this.blurElement,this)})}}if(this.template!==false){this.$widget=e(this.getTemplate()).prependTo(this.$element.parents(this.appendWidgetTo)).on("click",e.proxy(this.widgetClick,this))}else{this.$widget=false}if(this.showInputs&&this.$widget!==false){this.$widget.find("input").each(function(){e(this).on({"click.timepicker":function(){e(this).select()},"keydown.timepicker":e.proxy(t.widgetKeydown,t)})})}this.setDefaultTime(this.defaultTime)},blurElement:function(){this.highlightedUnit=r;this.updateFromElementVal()},decrementHour:function(){if(this.showMeridian){if(this.hour===1){this.hour=12}else if(this.hour===12){this.hour--;return this.toggleMeridian()}else if(this.hour===0){this.hour=11;return this.toggleMeridian()}else{this.hour--}}else{if(this.hour===0){this.hour=23}else{this.hour--}}this.update()},decrementMinute:function(e){var t;if(e){t=this.minute-e}else{t=this.minute-this.minuteStep}if(t<0){this.decrementHour();this.minute=t+60}else{this.minute=t}this.update()},decrementSecond:function(){var e=this.second-this.secondStep;if(e<0){this.decrementMinute(true);this.second=e+60}else{this.second=e}this.update()},elementKeydown:function(e){switch(e.keyCode){case 9:this.updateFromElementVal();switch(this.highlightedUnit){case"hour":e.preventDefault();this.highlightNextUnit();break;case"minute":if(this.showMeridian||this.showSeconds){e.preventDefault();this.highlightNextUnit()}break;case"second":if(this.showMeridian){e.preventDefault();this.highlightNextUnit()}break}break;case 27:this.updateFromElementVal();break;case 37:e.preventDefault();this.highlightPrevUnit();this.updateFromElementVal();break;case 38:e.preventDefault();switch(this.highlightedUnit){case"hour":this.incrementHour();this.highlightHour();break;case"minute":this.incrementMinute();this.highlightMinute();break;case"second":this.incrementSecond();this.highlightSecond();break;case"meridian":this.toggleMeridian();this.highlightMeridian();break}break;case 39:e.preventDefault();this.updateFromElementVal();this.highlightNextUnit();break;case 40:e.preventDefault();switch(this.highlightedUnit){case"hour":this.decrementHour();this.highlightHour();break;case"minute":this.decrementMinute();this.highlightMinute();break;case"second":this.decrementSecond();this.highlightSecond();break;case"meridian":this.toggleMeridian();this.highlightMeridian();break}break}},formatTime:function(e,t,n,r){e=e<10?"0"+e:e;t=t<10?"0"+t:t;n=n<10?"0"+n:n;return e+":"+t+(this.showSeconds?":"+n:"")+(this.showMeridian?" "+r:"")},getCursorPosition:function(){var e=this.$element.get(0);if("selectionStart"in e){return e.selectionStart}else if(n.selection){e.focus();var t=n.selection.createRange(),r=n.selection.createRange().text.length;t.moveStart("character",-e.value.length);return t.text.length-r}},getTemplate:function(){var e,t,n,r,i,s;if(this.showInputs){t='<input type="text" name="hour" class="bootstrap-timepicker-hour form-control" maxlength="2"/>';n='<input type="text" name="minute" class="bootstrap-timepicker-minute form-control" maxlength="2"/>';r='<input type="text" name="second" class="bootstrap-timepicker-second form-control" maxlength="2"/>';i='<input type="text" name="meridian" class="bootstrap-timepicker-meridian form-control" maxlength="2"/>'}else{t='<span class="bootstrap-timepicker-hour"></span>';n='<span class="bootstrap-timepicker-minute"></span>';r='<span class="bootstrap-timepicker-second"></span>';i='<span class="bootstrap-timepicker-meridian"></span>'}s="<table>"+"<tr>"+'<td><a href="#" data-action="incrementHour"><i class="'+this.upArrowStyle+'"></i></a></td>'+'<td class="separator">&nbsp;</td>'+'<td><a href="#" data-action="incrementMinute"><i class="'+this.upArrowStyle+'"></i></a></td>'+(this.showSeconds?'<td class="separator">&nbsp;</td>'+'<td><a href="#" data-action="incrementSecond"><i class="'+this.upArrowStyle+'"></i></a></td>':"")+(this.showMeridian?'<td class="separator">&nbsp;</td>'+'<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="'+this.upArrowStyle+'"></i></a></td>':"")+"</tr>"+"<tr>"+"<td>"+t+"</td> "+'<td class="separator">:</td>'+"<td>"+n+"</td> "+(this.showSeconds?'<td class="separator">:</td>'+"<td>"+r+"</td>":"")+(this.showMeridian?'<td class="separator">&nbsp;</td>'+"<td>"+i+"</td>":"")+"</tr>"+"<tr>"+'<td><a href="#" data-action="decrementHour"><i class="'+this.downArrowStyle+'"></i></a></td>'+'<td class="separator"></td>'+'<td><a href="#" data-action="decrementMinute"><i class="'+this.downArrowStyle+'"></i></a></td>'+(this.showSeconds?'<td class="separator">&nbsp;</td>'+'<td><a href="#" data-action="decrementSecond"><i class="'+this.downArrowStyle+'"></i></a></td>':"")+(this.showMeridian?'<td class="separator">&nbsp;</td>'+'<td><a href="#" data-action="toggleMeridian"><i class="'+this.downArrowStyle+'"></i></a></td>':"")+"</tr>"+"</table>";switch(this.template){case"modal":e='<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+(this.modalBackdrop?"true":"false")+'">'+'<div class="modal-header">'+'<a href="#" class="close" data-dismiss="modal">×</a>'+"<h3>Pick a Time</h3>"+"</div>"+'<div class="modal-content">'+s+"</div>"+'<div class="modal-footer">'+'<a href="#" class="btn btn-primary" data-dismiss="modal">OK</a>'+"</div>"+"</div>";break;case"dropdown":e='<div class="bootstrap-timepicker-widget dropdown-menu">'+s+"</div>";break}return e},getTime:function(){return this.formatTime(this.hour,this.minute,this.second,this.meridian)},hideWidget:function(){if(this.isOpen===false){return}if(this.showInputs){this.updateFromWidgetInputs()}this.$element.trigger({type:"hide.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}});if(this.template==="modal"&&this.$widget.modal){this.$widget.modal("hide")}else{this.$widget.removeClass("open")}e(n).off("mousedown.timepicker");this.isOpen=false},highlightUnit:function(){this.position=this.getCursorPosition();if(this.position>=0&&this.position<=2){this.highlightHour()}else if(this.position>=3&&this.position<=5){this.highlightMinute()}else if(this.position>=6&&this.position<=8){if(this.showSeconds){this.highlightSecond()}else{this.highlightMeridian()}}else if(this.position>=9&&this.position<=11){this.highlightMeridian()}},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":if(this.showSeconds){this.highlightSecond()}else if(this.showMeridian){this.highlightMeridian()}else{this.highlightHour()}break;case"second":if(this.showMeridian){this.highlightMeridian()}else{this.highlightHour()}break;case"meridian":this.highlightHour();break}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMeridian();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":if(this.showSeconds){this.highlightSecond()}else{this.highlightMinute()}break}},highlightHour:function(){var e=this.$element.get(0);this.highlightedUnit="hour";if(e.setSelectionRange){setTimeout(function(){e.setSelectionRange(0,2)},0)}},highlightMinute:function(){var e=this.$element.get(0);this.highlightedUnit="minute";if(e.setSelectionRange){setTimeout(function(){e.setSelectionRange(3,5)},0)}},highlightSecond:function(){var e=this.$element.get(0);this.highlightedUnit="second";if(e.setSelectionRange){setTimeout(function(){e.setSelectionRange(6,8)},0)}},highlightMeridian:function(){var e=this.$element.get(0);this.highlightedUnit="meridian";if(e.setSelectionRange){if(this.showSeconds){setTimeout(function(){e.setSelectionRange(9,11)},0)}else{setTimeout(function(){e.setSelectionRange(6,8)},0)}}},incrementHour:function(){if(this.showMeridian){if(this.hour===11){this.hour++;return this.toggleMeridian()}else if(this.hour===12){this.hour=0}}if(this.hour===23){this.hour=0;return}this.hour++;this.update()},incrementMinute:function(e){var t;if(e){t=this.minute+e}else{t=this.minute+this.minuteStep-this.minute%this.minuteStep}if(t>59){this.incrementHour();this.minute=t-60}else{this.minute=t}this.update()},incrementSecond:function(){var e=this.second+this.secondStep-this.second%this.secondStep;if(e>59){this.incrementMinute(true);this.second=e-60}else{this.second=e}this.update()},remove:function(){e("document").off(".timepicker");if(this.$widget){this.$widget.remove()}delete this.$element.data().timepicker},setDefaultTime:function(e){if(!this.$element.val()){if(e==="current"){var t=new Date,n=t.getHours(),r=Math.floor(t.getMinutes()/this.minuteStep)*this.minuteStep,i=Math.floor(t.getSeconds()/this.secondStep)*this.secondStep,s="AM";if(this.showMeridian){if(n===0){n=12}else if(n>=12){if(n>12){n=n-12}s="PM"}else{s="AM"}}this.hour=n;this.minute=r;this.second=i;this.meridian=s;this.update()}else if(e===false){this.hour=0;this.minute=0;this.second=0;this.meridian="AM"}else{this.setTime(e)}}else{this.updateFromElementVal()}},setTime:function(e){var t,n;if(this.showMeridian){t=e.split(" ");n=t[0].split(":");this.meridian=t[1]}else{n=e.split(":")}this.hour=parseInt(n[0],10);this.minute=parseInt(n[1],10);this.second=parseInt(n[2],10);if(isNaN(this.hour)){this.hour=0}if(isNaN(this.minute)){this.minute=0}if(this.showMeridian){if(this.hour>12){this.hour=12}else if(this.hour<1){this.hour=12}if(this.meridian==="am"||this.meridian==="a"){this.meridian="AM"}else if(this.meridian==="pm"||this.meridian==="p"){this.meridian="PM"}if(this.meridian!=="AM"&&this.meridian!=="PM"){this.meridian="AM"}}else{if(this.hour>=24){this.hour=23}else if(this.hour<0){this.hour=0}}if(this.minute<0){this.minute=0}else if(this.minute>=60){this.minute=59}if(this.showSeconds){if(isNaN(this.second)){this.second=0}else if(this.second<0){this.second=0}else if(this.second>=60){this.second=59}}this.update()},showWidget:function(){if(this.isOpen){return}if(this.$element.is(":disabled")){return}var t=this;e(n).on("mousedown.timepicker",function(n){if(e(n.target).closest(".bootstrap-timepicker-widget").length===0){t.hideWidget()}});this.$element.trigger({type:"show.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}});if(this.disableFocus){this.$element.blur()}this.updateFromElementVal();if(this.template==="modal"&&this.$widget.modal){this.$widget.modal("show").on("hidden",e.proxy(this.hideWidget,this))}else{if(this.isOpen===false){this.$widget.addClass("open")}}this.isOpen=true},toggleMeridian:function(){this.meridian=this.meridian==="AM"?"PM":"AM";this.update()},update:function(){this.$element.trigger({type:"changeTime.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}});this.updateElement();this.updateWidget()},updateElement:function(){this.$element.val(this.getTime()).change()},updateFromElementVal:function(){var e=this.$element.val();if(e){this.setTime(e)}},updateWidget:function(){if(this.$widget===false){return}var e=this.hour<10?"0"+this.hour:this.hour,t=this.minute<10?"0"+this.minute:this.minute,n=this.second<10?"0"+this.second:this.second;if(this.showInputs){this.$widget.find("input.bootstrap-timepicker-hour").val(e);this.$widget.find("input.bootstrap-timepicker-minute").val(t);if(this.showSeconds){this.$widget.find("input.bootstrap-timepicker-second").val(n)}if(this.showMeridian){this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)}}else{this.$widget.find("span.bootstrap-timepicker-hour").text(e);this.$widget.find("span.bootstrap-timepicker-minute").text(t);if(this.showSeconds){this.$widget.find("span.bootstrap-timepicker-second").text(n)}if(this.showMeridian){this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian)}}},updateFromWidgetInputs:function(){if(this.$widget===false){return}var t=e("input.bootstrap-timepicker-hour",this.$widget).val()+":"+e("input.bootstrap-timepicker-minute",this.$widget).val()+(this.showSeconds?":"+e("input.bootstrap-timepicker-second",this.$widget).val():"")+(this.showMeridian?" "+e("input.bootstrap-timepicker-meridian",this.$widget).val():"");this.setTime(t)},widgetClick:function(t){t.stopPropagation();t.preventDefault();var n=e(t.target).closest("a").data("action");if(n){this[n]()}},widgetKeydown:function(t){var n=e(t.target).closest("input"),r=n.attr("name");switch(t.keyCode){case 9:if(this.showMeridian){if(r==="meridian"){return this.hideWidget()}}else{if(this.showSeconds){if(r==="second"){return this.hideWidget()}}else{if(r==="minute"){return this.hideWidget()}}}this.updateFromWidgetInputs();break;case 27:this.hideWidget();break;case 38:t.preventDefault();switch(r){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian();break}break;case 40:t.preventDefault();switch(r){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian();break}break}}};e.fn.timepicker=function(t){var n=Array.apply(null,arguments);n.shift();return this.each(function(){var r=e(this),s=r.data("timepicker"),o=typeof t==="object"&&t;if(!s){r.data("timepicker",s=new i(this,e.extend({},e.fn.timepicker.defaults,o,e(this).data())))}if(typeof t==="string"){s[t].apply(s,n)}})};e.fn.timepicker.defaults={defaultTime:"current",disableFocus:false,isOpen:false,minuteStep:15,modalBackdrop:false,secondStep:15,showSeconds:false,showInputs:true,showMeridian:true,template:"dropdown",appendWidgetTo:".bootstrap-timepicker",upArrowStyle:"glyphicon glyphicon-chevron-up",downArrowStyle:"glyphicon glyphicon-chevron-down",containerClass:"bootstrap-timepicker"};e.fn.timepicker.Constructor=i})(jQuery,window,document) \ No newline at end of file