Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gridstack

Package Overview
Dependencies
Maintainers
3
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridstack - npm Package Compare versions

Comparing version 0.6.4 to 1.0.0

dist/gridstack-extra.css.map

2

dist/gridstack-poly.js

@@ -1,2 +0,2 @@

/** gridstack.js 0.6.4 - IE and older browsers Polyfills for this library @preserve*/
/** gridstack.js 1.0.0 - IE and older browsers Polyfills for this library @preserve*/
/**

@@ -3,0 +3,0 @@ * https://gridstackjs.com/

@@ -1,3 +0,3 @@

/** gridstack.js 0.6.4 - IE and older browsers Polyfills for this library @preserve*/
/** gridstack.js 1.0.0 - IE and older browsers Polyfills for this library @preserve*/
Number.isNaN=Number.isNaN||function(r){return"number"==typeof r&&r!=r},Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(r){if(null==this)throw TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw TypeError("predicate must be a function");for(var n=arguments[1],i=0;i<t;){var o=e[i];if(r.call(n,o,i,e))return o;i++}},configurable:!0,writable:!0}),Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(r){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var n=arguments[1],i=0;i<t;){var o=e[i];if(r.call(n,o,i,e))return i;i++}return-1},configurable:!0,writable:!0});
//# sourceMappingURL=gridstack.min.map

@@ -1,2 +0,2 @@

// Type definitions for Gridstack 0.6.4
// Type definitions for Gridstack 1.0.0
// Project: https://gridstackjs.com/

@@ -11,5 +11,4 @@ // Definitions by: Pascal Senn <https://github.com/PascalSenn>

interface JQuery {
gridstack(options: GridstackOptions): JQuery;
data(key: 'gridstack'): GridStack;
interface Window {
GridStack: GridStack;
}

@@ -23,6 +22,43 @@

type GridStackElement = string | HTMLElement | JQuery;
type GridStackElement = string | HTMLElement;
interface GridStackHTMLElement extends HTMLElement {
/** grid's parent DOM element points back to grid class */
gridstack: GridStack;
}
type GridStackEvent = 'added' | 'change' | 'disable' | 'dragstart' | 'dragstop' | 'dropped' |
'enable' | 'removed' | 'resize' | 'resizestart' | 'gsresizestop';
interface GridStack {
/**
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
* simply return the existing instance (ignore any passed options). There is also a version that support
* multiple grids initialization.
* @param options grid options (optional)
* @param el element to convert to a grid (default to '.grid-stack' class selector)
*
* @example
* var grid = window.GridStack.init();
* // Note: the HTMLElement (of type GridStackHTMLElement) will itself store a `gridstack: GridStack` value that can be retrieve later
* var grid = document.querySelector('.grid-stack').gridstack;
*/
init(options?: GridstackOptions, el?: GridStackElement): GridStack;
/**
* Will initialize a list of elements (given a selector) and return an array of grids.
* @param options grid options (optional)
* @param selector element to convert to grids (default to '.grid-stack' class selector)
*
* @example
* var grids = window.GridStack.initAll();
* grids.forEach(...)
*/
initAll(options?: GridstackOptions, selector?: string): GridStack[];
/** the HTML element tied to this grid after it's been initialized */
el: GridStackHTMLElement;
/** engine used to implement non DOM grid functionality */
engine: GridStackEngine;
/**
* Creates new widget and returns it.

@@ -35,4 +71,3 @@ *

* @example
* $('.grid-stack').gridstack();
* var grid = $('.grid-stack').data('gridstack');
* var grid = GridStack.init();
* grid.addWidget(el, {width: 3, autoPosition: true});

@@ -43,3 +78,3 @@ *

*/
addWidget(el: GridStackElement, options ? : GridstackWidget): JQuery;
addWidget(el: GridStackElement, options ? : GridstackWidget): HTMLElement;

@@ -51,4 +86,3 @@ /**

* @example
* $('.grid-stack').gridstack();
* var grid = $('.grid-stack').data('gridstack');
* var grid = GridStack.init();
* grid.addWidget(el, 0, 0, 3, 2, true);

@@ -69,6 +103,6 @@ *

addWidget(el: GridStackElement, x ? : number, y ? : number, width ? : number, height ? : number, autoPosition ? : boolean,
minWidth ? : number, maxWidth ? : number, minHeight ? : number, maxHeight ? : number, id ? : number | string): JQuery;
minWidth ? : number, maxWidth ? : number, minHeight ? : number, maxHeight ? : number, id ? : number | string): HTMLElement;
/**
* Initializes batch updates. You will see no changes until commit method is called.
* Initializes batch updates. You will see no changes until `commit()` method is called.
*/

@@ -111,2 +145,17 @@ batchUpdate(): void;

/**
* set the number of columns in the grid. Will update existing widgets to conform to new number of columns,
* as well as cache the original layout so you can revert back to previous positions without loss.
* Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [1-11],
* else you will need to generate correct CSS (see https://github.com/gridstack/gridstack.js#change-grid-columns)
* @param column - Integer > 0 (default 12).
* @param doNotPropagate if true existing widgets will not be updated (optional)
*/
column(column: number, doNotPropagate ? : boolean): void;
/**
* get the number of columns in the grid (default 12)
*/
column(): number;
/**
* Destroys a grid instance.

@@ -135,5 +184,2 @@ * @param detachGrid if false nodes and grid will not be removed from the DOM (Optional. Default true).

* Enables/disables widget moving.
* This is a shortcut for:
* @example
* grid.movable(this.container.children('.' + this.opts.itemClass), doEnable);
*

@@ -151,6 +197,2 @@ * @param doEnable

* doEnable`s value by changing the disableResize grid option.
*
* This is a shortcut for:
* @example
* grid.resizable(this.container.children('.' + this.opts.itemClass), doEnable);
*/

@@ -170,4 +212,2 @@ enableResize(doEnable: boolean, includeNewWidgets: boolean): void;

/**

@@ -184,2 +224,5 @@ * Get the position of the cell under a pixel on screen.

/** returns the current number of rows */
getRow(): number;
/**

@@ -202,3 +245,3 @@ * Checks if specified area is empty.

/**
* If you add elements to your gridstack container by hand, you have to tell gridstack afterwards to make them widgets.
* If you add elements to your grid by hand, you have to tell gridstack afterwards to make them widgets.
* If you want gridstack to add the elements for you, use addWidget instead.

@@ -209,9 +252,8 @@ * Makes the given element a widget and returns it.

* @example
* $('.grid-stack').gridstack();
* $('.grid-stack').append('<div id="gsi-1" data-gs-x="0" data-gs-y="0" data-gs-width="3" data-gs-height="2"
* var grid = GridStack.init();
* grid.el.appendChild('<div id="gsi-1" data-gs-x="0" data-gs-y="0" data-gs-width="3" data-gs-height="2"
* data-gs-auto-position="true"></div>')
* var grid = $('.grid-stack').data('gridstack');
* grid.makeWidget('gsi-1');
*/
makeWidget(el: GridStackElement): JQuery;
makeWidget(el: GridStackElement): HTMLElement;

@@ -262,2 +304,23 @@ /**

/**
* unsubscribe from the 'on' event below
* @param name of the event (see possible values)
*/
off(name: GridStackEvent): void;
/**
* Event handler that extracts our CustomEvent data out automatically for receiving custom
* notifications (see doc for supported events)
* @param name of the event (see possible values)
* @param callback function called with event and optional second/third param
* (see README documentation for each signature).
*
* @example
* grid.on('added', function(e, items) { log('added ', items)} );
*
* Note: in some cases it is the same as calling native handler and parsing the event.
* grid.el.addEventListener('added', function(event) { log('added ', event.detail)} );
*/
on(name: GridStackEvent, callback: (event: CustomEvent, arg2?: GridStackNode[] | Object, arg3?: Object) => void): void;
/**
* Removes widget from the grid.

@@ -297,12 +360,2 @@ * @param el widget to modify

/**
* Modify number of columns in the grid. Will update existing widgets to conform to new number of columns,
* as well as cache the original layout so you can revert back to previous positions without loss.
* Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [1-11],
* else you will need to generate correct CSS (see https://github.com/gridstack/gridstack.js#change-grid-columns)
* @param column - Integer > 0 (default 12).
* @param doNotPropagate if true existing widgets will not be updated (optional)
*/
setColumn(column: number, doNotPropagate ? : boolean): void;
/**
* Toggle the grid static state. Also toggle the grid-stack-static class.

@@ -357,2 +410,16 @@ * @param staticValue if true the grid become static.

/**
* Defines the GridStack engine that does most no DOM grid manipulation.
* See GridStack methods and vars for descriptions.
*
* NOTE: values should not be modified - call the GridStack API instead
*/
interface GridStackEngine {
column: number;
float: boolean;
maxRow: number;
nodes: GridStackNode[];
getRow(): number;
}
/**
* Defines the coordinates of an object

@@ -384,2 +451,6 @@ */

* @param maxHeight maximum height allowed during resize/creation (default?: undefined = un-constrained)
* @param noResize prevent resizing (default?: undefined = un-constrained)
* @param noMove prevents moving (default?: undefined = un-constrained)
* @param locked prevents moving and resizing (default?: undefined = un-constrained)
* @param resizeHandles widgets can have their own resize handles. For example 'e,w' will make the particular widget only resize east and west.
* @param id value for `data-gs-id` stored on the widget (default?: undefined)

@@ -397,17 +468,27 @@ */

maxHeight ? : number;
noResize ? : boolean;
noMove ? : boolean;
locked ? : boolean;
resizeHandles ?: string;
id ? : number | string;
}
declare namespace GridStackUI {
interface Utils {
/**
* Sorts array of nodes
* @param nodes array to sort
* @param dir 1 for asc, -1 for desc (optional)
* @param width width of the grid. If undefined the width will be calculated automatically (optional).
**/
sort(nodes: HTMLElement[], dir ? : number, width ? : number): void;
}
/**
* internal descriptions describing the items in the grid
*/
interface GridStackNode extends GridstackWidget {
el: HTMLElement;
_grid: GridStack;
}
interface Utils {
/**
* Sorts array of nodes
* @param nodes array to sort
* @param dir 1 for asc, -1 for desc (optional)
* @param width width of the grid. If undefined the width will be calculated automatically (optional).
**/
sort(nodes: GridStackNode[], dir ? : number, width ? : number): void;
}
/**

@@ -451,6 +532,11 @@ * Gridstack Options

/**
* (internal?) unit for cellHeight (default? 'px')
* (internal) unit for cellHeight (default? 'px') which is set when a string cellHeight with a unit is passed (ex: '10rem')
*/
cellHeightUnit ? : string;
/**
* number of columns (default?: 12). Note: IF you change this, CSS also have to change. See https://github.com/gridstack/gridstack.js#change-grid-columns
*/
column ? : number;
/** class that implement drag'n'drop functionality for gridstack. If false grid will be static.

@@ -464,2 +550,5 @@ * (default?: null - first available plugin will be used)

/** disables the onColumnMode when the window width is less than minWidth (default?: false) */
disableOneColumnMode ? : boolean;
/** disallows resizing of widgets (default?: false). */

@@ -469,3 +558,3 @@ disableResize ? : boolean;

/**
* allows to override jQuery UI draggable options. (default?: { handle?: '.grid-stack-item-content', scroll?: true, appendTo?: 'body', containment: null })
* allows to override UI draggable options. (default?: { handle?: '.grid-stack-item-content', scroll?: true, appendTo?: 'body', containment: null })
*/

@@ -480,2 +569,7 @@ draggable ? : {};

/**
* enable floating widgets (default?: false) See example (http://gridstack.github.io/gridstack.js/demo/float.html)
*/
float ? : boolean;
/**
* draggable handle selector (default?: '.grid-stack-item-content')

@@ -489,5 +583,5 @@ */

/**
* number of columns (default?: 12). Note: IF you change this, CSS also have to change. See https://github.com/gridstack/gridstack.js#change-grid-columns
* widget class (default?: 'grid-stack-item')
*/
column ? : number;
itemClass ? : string;

@@ -500,12 +594,2 @@ /**

/**
* enable floating widgets (default?: false) See example (http://gridstack.github.io/gridstack.js/demo/float.html)
*/
float ? : boolean;
/**
* widget class (default?: 'grid-stack-item')
*/
itemClass ? : string;
/**
* minimal width. If window width is less, grid will be shown in one column mode (default?: 768)

@@ -515,5 +599,2 @@ */

/** disables the onColumnMode when the window width is less than minWidth (default?: false) */
disableOneColumnMode ? : boolean;
/**

@@ -534,3 +615,3 @@ * set to true if you want oneColumnMode to use the DOM order and ignore x,y from normal multi column

/**
* allows to override jQuery UI resizable options. (default?: { autoHide?: true, handles?: 'se' })
* allows to override UI resizable options. (default?: { autoHide?: true, handles?: 'se' })
*/

@@ -540,3 +621,3 @@ resizable ? : {};

/**
* if true widgets could be removed by dragging outside of the grid. It could also be a jQuery selector string,
* if true widgets could be removed by dragging outside of the grid. It could also be a selector string,
* in this case widgets will be removed by dropping them there (default?: false)

@@ -559,5 +640,5 @@ * See example (http://gridstack.github.io/gridstack.js/demo/two.html)

/**
* makes grid static (default?: false).If true widgets are not movable/resizable.
* You don't even need jQueryUI draggable/resizable. A CSS class
* 'grid-stack-static' is also added to the container.
* makes grid static (default?: false). If `true` widgets are not movable/resizable.
* You don't even need draggable/resizable. A CSS class
* 'grid-stack-static' is also added to the element.
*/

@@ -574,5 +655,5 @@ staticGrid ? : boolean;

/**
* (internal?) unit for verticalMargin (default? 'px')
* (internal) unit for verticalMargin (default? 'px') set when `verticalMargin` is set as string with unit (ex: 2rem')
*/
verticalMarginUnit ? : string;
}

@@ -1,2 +0,2 @@

/** gridstack.js 0.6.4 - JQuery UI Drag&Drop plugin @preserve */
/** gridstack.js 1.0.0 - JQuery UI Drag&Drop plugin @preserve */
/**

@@ -8,2 +8,3 @@ * https://gridstackjs.com/

(function(factory) {
/* we compile this in so no need for required loading
if (typeof define === 'function' && define.amd) {

@@ -14,7 +15,7 @@ define(['jquery', 'gridstack', 'exports'], factory);

try { gridstack = require('gridstack'); } catch (e) {}
factory(jQuery, gridstack.GridStackUI, exports);
} else {
factory(jQuery, GridStackUI, window);
factory(jQuery, gridstack.GridStack, exports);
} else */{
factory(jQuery, GridStack, window);
}
})(function($, GridStackUI, scope) {
})(function($, GridStack, scope) {
/**

@@ -25,8 +26,8 @@ * @class JQueryUIGridStackDragDropPlugin

function JQueryUIGridStackDragDropPlugin(grid) {
GridStackUI.GridStackDragDropPlugin.call(this, grid);
GridStack.DragDropPlugin.call(this, grid);
}
GridStackUI.GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);
GridStack.DragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);
JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStackUI.GridStackDragDropPlugin.prototype);
JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStack.DragDropPlugin.prototype);
JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin;

@@ -63,3 +64,3 @@

containment: (this.grid.opts.isNested && !this.grid.opts.dragOut) ?
this.grid.container.parent() :
this.grid.$el.parent() :
(this.grid.opts.draggable.containment || null),

@@ -66,0 +67,0 @@ start: opts.start || function() {},

@@ -1,3 +0,3 @@

/** gridstack.js 0.6.4 - JQuery UI Drag&Drop plugin @preserve */
!function(t){if("function"==typeof define&&define.amd)define(["jquery","gridstack","exports"],t);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(t){}try{gridstack=require("gridstack")}catch(t){}t(jQuery,gridstack.GridStackUI,exports)}else t(jQuery,GridStackUI,window)}(function(a,e,t){function r(t){e.GridStackDragDropPlugin.call(this,t)}return e.GridStackDragDropPlugin.registerPlugin(r),((r.prototype=Object.create(e.GridStackDragDropPlugin.prototype)).constructor=r).prototype.resizable=function(t,e){if(t=a(t),"disable"===e||"enable"===e)t.resizable(e);else if("option"===e){var r=arguments[2],i=arguments[3];t.resizable(e,r,i)}else{var n=t.data("gs-resize-handles")?t.data("gs-resize-handles"):this.grid.opts.resizable.handles;t.resizable(a.extend({},this.grid.opts.resizable,{handles:n},{start:e.start||function(){},stop:e.stop||function(){},resize:e.resize||function(){}}))}return this},r.prototype.draggable=function(t,e){return t=a(t),"disable"===e||"enable"===e?t.draggable(e):t.draggable(a.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested&&!this.grid.opts.dragOut?this.grid.container.parent():this.grid.opts.draggable.containment||null,start:e.start||function(){},stop:e.stop||function(){},drag:e.drag||function(){}})),this},r.prototype.droppable=function(t,e){return(t=a(t)).droppable(e),this},r.prototype.isDroppable=function(t,e){return t=a(t),Boolean(t.data("droppable"))},r.prototype.on=function(t,e,r){return a(t).on(e,r),this},t.JQueryUIGridStackDragDropPlugin=r});
/** gridstack.js 1.0.0 - JQuery UI Drag&Drop plugin @preserve */
!function(){function t(t){e.DragDropPlugin.call(this,t)}var a,e,r;a=jQuery,e=GridStack,r=window,e.DragDropPlugin.registerPlugin(t),((t.prototype=Object.create(e.DragDropPlugin.prototype)).constructor=t).prototype.resizable=function(t,e){if(t=a(t),"disable"===e||"enable"===e)t.resizable(e);else if("option"===e){var r=arguments[2],i=arguments[3];t.resizable(e,r,i)}else{var n=t.data("gs-resize-handles")?t.data("gs-resize-handles"):this.grid.opts.resizable.handles;t.resizable(a.extend({},this.grid.opts.resizable,{handles:n},{start:e.start||function(){},stop:e.stop||function(){},resize:e.resize||function(){}}))}return this},t.prototype.draggable=function(t,e){return t=a(t),"disable"===e||"enable"===e?t.draggable(e):t.draggable(a.extend({},this.grid.opts.draggable,{containment:this.grid.opts.isNested&&!this.grid.opts.dragOut?this.grid.$el.parent():this.grid.opts.draggable.containment||null,start:e.start||function(){},stop:e.stop||function(){},drag:e.drag||function(){}})),this},t.prototype.droppable=function(t,e){return(t=a(t)).droppable(e),this},t.prototype.isDroppable=function(t,e){return t=a(t),Boolean(t.data("droppable"))},t.prototype.on=function(t,e,r){return a(t).on(e,r),this},r.JQueryUIGridStackDragDropPlugin=t}();
//# sourceMappingURL=gridstack.min.map
/**
* gridstack.js 0.6.4
* gridstack.js 1.0.0
* https://gridstackjs.com/

@@ -8,3 +8,3 @@ * (c) 2014-2020 Alain Dumesny, Dylan Weiss, Pavel Reznikov

*/
!function(t){if("function"==typeof define&&define.amd)define(["jquery","exports"],t);else if("undefined"!=typeof exports){var e;try{e=require("jquery")}catch(t){}t(e||window.jQuery,exports)}else t(window.jQuery,window)}(function(m,t){function n(t,e,i,o){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))}function d(t,e,i,o){var a=t.attr(e);void 0!==a&&(t.attr(i,a),console.warn("gridstack.js: attribute `"+e+"`="+a+" is deprecated on this object in "+o+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))}var f={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){if(!i){var o=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,o)}return-1===e?f.sortBy(t,function(t){return-(t.x+t.y*i)}):f.sortBy(t,function(t){return t.x+t.y*i})},createStylesheet:function(t,e){var i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("data-gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),(e=e||document.getElementsByTagName("head")[0]).insertBefore(i,e.firstChild),i.sheet},removeStylesheet:function(t){m("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,o){"function"==typeof t.insertRule?t.insertRule(e+"{"+i+"}",o):"function"==typeof t.addRule&&t.addRule(e,i,o)},toBool:function(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)},_collisionNodeCheck:function(t){return t!==this.node&&f.isIntercepted(t,this.nn)},_didCollide:function(t){return f.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return f.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t,i="px";if(e&&"string"==typeof e){var o=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!o)throw new Error("Invalid height");i=o[2]||"px",e=parseFloat(o[1])}return{height:e,unit:i}},without:function(t,e){var i=t.indexOf(e);return-1!==i&&(t=t.slice(0)).splice(i,1),t},sortBy:function(t,a){return t.slice(0).sort(function(t,e){var i=a(t),o=a(e);return o===i?0:o<i?1:-1})},defaults:function(i){return Array.prototype.slice.call(arguments,1).forEach(function(t){for(var e in t)!t.hasOwnProperty(e)||i.hasOwnProperty(e)&&void 0!==i[e]||(i[e]=t[e])}),i},clone:function(t){return m.extend({},t)},throttle:function(t,e){var i=!1;return function(){i||(t.apply(this,arguments),i=!0,setTimeout(function(){i=!1},e))}},removePositioningStyles:function(t){var e=t[0].style;e.position&&e.removeProperty("position"),e.left&&e.removeProperty("left"),e.top&&e.removeProperty("top"),e.width&&e.removeProperty("width"),e.height&&e.removeProperty("height")},getScrollParent:function(t){return null===t?null:t.scrollHeight>t.clientHeight?t:f.getScrollParent(t.parentNode)},updateScrollPosition:function(t,e,i){var o=t.getBoundingClientRect(),a=window.innerHeight||document.documentElement.clientHeight;if(o.top<0||o.bottom>a){var s=o.bottom-a,r=o.top,n=f.getScrollParent(t);if(null!==n){var d=n.scrollTop;o.top<0&&i<0?t.offsetHeight>a?n.scrollTop+=i:n.scrollTop+=Math.abs(r)>Math.abs(i)?i:r:0<i&&(t.offsetHeight>a?n.scrollTop+=i:n.scrollTop+=i<s?i:s),e.position.top+=n.scrollTop-d}}}};function h(t){this.grid=t}h.registeredPlugins=[],h.registerPlugin=function(t){h.registeredPlugins.push(t)},h.prototype.resizable=function(t,e){return this},h.prototype.draggable=function(t,e){return this},h.prototype.droppable=function(t,e){return this},h.prototype.isDroppable=function(t){return!1},h.prototype.on=function(t,e,i){return this};function l(t,e,i,o,a){this.column=t||12,this.float=i||!1,this.maxRow=o||0,this.nodes=a||[],this.onchange=e||function(){},this._addedNodes=[],this._removedNodes=[],this._batchMode=!1}var s=0;l.prototype.batchUpdate=function(){this._batchMode||(this._batchMode=!0,this._prevFloat=this.float,this.float=!0)},l.prototype.commit=function(){this._batchMode&&(this._batchMode=!1,this.float=this._prevFloat,delete this._prevFloat,this._packNodes(),this._notify())},l.prototype.getNodeDataByDOMEl=function(e){return this.nodes.find(function(t){return e.get(0)===t.el.get(0)})},l.prototype._fixCollisions=function(t){this._sortNodes(-1);var e=t,i=Boolean(this.nodes.find(function(t){return t.locked}));for(this.float||i||(e={x:0,y:t.y,width:this.column,height:t.height});;){var o=this.nodes.find(f._collisionNodeCheck,{node:t,nn:e});if(!o)return;this.moveNode(o,o.x,t.y+t.height,o.width,o.height,!0)}},l.prototype.isAreaEmpty=function(t,e,i,o){var a={x:t||0,y:e||0,width:i||1,height:o||1};return!this.nodes.find(function(t){return f.isIntercepted(t,a)})},l.prototype._sortNodes=function(t){this.nodes=f.sort(this.nodes,t,this.column)},l.prototype._packNodes=function(){this._sortNodes(),this.float?this.nodes.forEach(function(t,e){if(!t._updating&&void 0!==t._packY&&t.y!==t._packY)for(var i=t.y;i>=t._packY;){this.nodes.slice(0,e).find(f._didCollide,{n:t,newY:i})||(t._dirty=!0,t.y=i),--i}},this):this.nodes.forEach(function(t,e){if(!t.locked)for(;0<t.y;){var i=t.y-1,o=0===e;if(0<e)o=void 0===this.nodes.slice(0,e).find(f._didCollide,{n:t,newY:i});if(!o)break;t._dirty=t.y!==i,t.y=i}},this)},l.prototype._prepareNode=function(t,e){void 0!==(t=t||{}).x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);var i={width:1,height:1,x:0,y:0};return(t=f.defaults(t,i)).x=parseInt(t.x),t.y=parseInt(t.y),t.width=parseInt(t.width),t.height=parseInt(t.height),t.autoPosition=t.autoPosition||!1,t.noResize=t.noResize||!1,t.noMove=t.noMove||!1,Number.isNaN(t.x)&&(t.x=i.x,t.autoPosition=!0),Number.isNaN(t.y)&&(t.y=i.y,t.autoPosition=!0),Number.isNaN(t.width)&&(t.width=i.width),Number.isNaN(t.height)&&(t.height=i.height),t.width>this.column?t.width=this.column:t.width<1&&(t.width=1),t.height<1&&(t.height=1),t.x<0&&(t.x=0),t.x+t.width>this.column&&(e?t.width=this.column-t.x:t.x=this.column-t.width),t.y<0&&(t.y=0),t},l.prototype._notify=function(){if(!this._batchMode){var t=Array.prototype.slice.call(arguments,0);t[0]=void 0===t[0]?[]:Array.isArray(t[0])?t[0]:[t[0]],t[1]=void 0===t[1]||t[1];var e=t[0].concat(this.getDirtyNodes());this.onchange(e,t[1])}},l.prototype.cleanNodes=function(){this._batchMode||this.nodes.forEach(function(t){delete t._dirty})},l.prototype.getDirtyNodes=function(t){if(t){var e=[];return this.nodes.forEach(function(t){t._dirty&&(t.y===t._origY&&t.x===t._origX&&t.width===t._origW&&t.height===t._origH?delete t._dirty:e.push(t))}),e}return this.nodes.filter(function(t){return t._dirty})},l.prototype.addNode=function(t,e){if(void 0!==(t=this._prepareNode(t)).maxWidth&&(t.width=Math.min(t.width,t.maxWidth)),void 0!==t.maxHeight&&(t.height=Math.min(t.height,t.maxHeight)),void 0!==t.minWidth&&(t.width=Math.max(t.width,t.minWidth)),void 0!==t.minHeight&&(t.height=Math.max(t.height,t.minHeight)),t._id=t._id||++s,t.autoPosition){this._sortNodes();for(var i=0;;++i){var o=i%this.column,a=Math.floor(i/this.column);if(!(o+t.width>this.column)&&!this.nodes.find(f._isAddNodeIntercepted,{x:o,y:a,node:t})){t.x=o,t.y=a,delete t.autoPosition;break}}}return this.nodes.push(t),e&&this._addedNodes.push(t),this._fixCollisions(t),this._packNodes(),this._notify(),t},l.prototype.removeNode=function(t,e){e=void 0===e||e,this._removedNodes.push(t),t._id=null,this.nodes=f.without(this.nodes,t),this._packNodes(),this._notify(t,e)},l.prototype.removeAll=function(t){delete this._layouts,0!==this.nodes.length&&(t=void 0===t||t,this.nodes.forEach(function(t){t._id=null}),this._removedNodes=this.nodes,this.nodes=[],this._notify(this._removedNodes,t))},l.prototype.canMoveNode=function(e,t,i,o,a){if(!this.isNodeChangedPosition(e,t,i,o,a))return!1;var s,r=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!r)return!0;var n=new l(this.column,null,this.float,0,this.nodes.map(function(t){return t===e?s=m.extend({},t):m.extend({},t)}));if(!s)return!0;n.moveNode(s,t,i,o,a);var d=!0;return r&&(d&=!Boolean(n.nodes.find(function(t){return t!==s&&Boolean(t.locked)&&Boolean(t._dirty)}))),this.maxRow&&(d&=n.getGridHeight()<=this.maxRow),d},l.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow)return!0;var e=new l(this.column,null,this.float,0,this.nodes.map(function(t){return m.extend({},t)}));return e.addNode(t),e.getGridHeight()<=this.maxRow},l.prototype.isNodeChangedPosition=function(t,e,i,o,a){return"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof o&&(o=t.width),"number"!=typeof a&&(a=t.height),void 0!==t.maxWidth&&(o=Math.min(o,t.maxWidth)),void 0!==t.maxHeight&&(a=Math.min(a,t.maxHeight)),void 0!==t.minWidth&&(o=Math.max(o,t.minWidth)),void 0!==t.minHeight&&(a=Math.max(a,t.minHeight)),t.x!==e||t.y!==i||t.width!==o||t.height!==a},l.prototype.moveNode=function(t,e,i,o,a,s){if("number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof o&&(o=t.width),"number"!=typeof a&&(a=t.height),void 0!==t.maxWidth&&(o=Math.min(o,t.maxWidth)),void 0!==t.maxHeight&&(a=Math.min(a,t.maxHeight)),void 0!==t.minWidth&&(o=Math.max(o,t.minWidth)),void 0!==t.minHeight&&(a=Math.max(a,t.minHeight)),t.x===e&&t.y===i&&t.width===o&&t.height===a)return t;var r=t.width!==o;return t._dirty=!0,t.x=e,t.y=i,t.width=o,t.height=a,t.lastTriedX=e,t.lastTriedY=i,t.lastTriedWidth=o,t.lastTriedHeight=a,t=this._prepareNode(t,r),this._fixCollisions(t),s||(this._packNodes(),this._notify()),t},l.prototype.getGridHeight=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},l.prototype.beginUpdate=function(t){t._updating||(t._updating=!0,this.nodes.forEach(function(t){t._packY=t.y}))},l.prototype.endUpdate=function(){var t=this.nodes.find(function(t){return t._updating});t&&(t._updating=!1,this.nodes.forEach(function(t){delete t._packY}))};function i(t,e){var i,c=this;e=e||{},this.container=m(t),n(e,"width","column","v0.5.3"),n(e,"height","maxRow","v0.5.3"),function(t,e,i,o){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+o)}(e,"oneColumnModeClass","v0.6.3",". Use class `.grid-stack-1` instead"),d(this.container,"data-gs-width","data-gs-column","v0.5.3"),d(this.container,"data-gs-height","data-gs-max-row","v0.5.3"),e.itemClass=e.itemClass||"grid-stack-item";var o=0<this.container.closest("."+e.itemClass).length;if(this.opts=f.defaults(e,{column:parseInt(this.container.attr("data-gs-column"))||12,maxRow:parseInt(this.container.attr("data-gs-max-row"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,float:!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:f.defaults(e.resizable||{},{autoHide:!e.alwaysShowResizeHandle,handles:"se"}),draggable:f.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:e.disableDrag||!1,disableResize:e.disableResize||!1,rtl:"auto",removable:!1,removableOptions:f.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||!1,oneColumnModeDomSort:e.oneColumnModeDomSort,ddPlugin:null}),!1===this.opts.ddPlugin?this.opts.ddPlugin=h:null===this.opts.ddPlugin&&(this.opts.ddPlugin=h.registeredPlugins[0]||h),this.dd=new this.opts.ddPlugin(this),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.container.css("direction")),this.opts.rtl&&this.container.addClass("grid-stack-rtl"),this.opts.isNested=o,(i="auto"===this.opts.cellHeight)?c.cellHeight(c.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),o&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new l(this.opts.column,function(t,e){e=void 0===e||e;var i=0;this.nodes.forEach(function(t){i=Math.max(i,t.y+t.height)}),t.forEach(function(t){e&&null===t._id?t.el&&t.el.remove():t.el.attr("data-gs-x",t.x).attr("data-gs-y",t.y).attr("data-gs-width",t.width).attr("data-gs-height",t.height)}),c._updateStyles(i+10)},this.opts.float,this.opts.maxRow),this.opts.auto){var a=[],s=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(t,e){e=m(e);var i=parseInt(e.attr("data-gs-x")),o=parseInt(e.attr("data-gs-y"));a.push({el:e,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(o)?1e3:o)*s.opts.column})}),f.sortBy(a,function(t){return t.i}).forEach(function(t){this._prepareElement(t.el)},this)}if(this.grid._saveInitial(),this.setAnimation(this.opts.animate),this.placeholder=m('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'"><div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=f.throttle(function(){c.cellHeight(c.cellWidth(),!1)},100),this.onResizeHandler=function(){if(i&&c._updateHeightsOnResize(),!c.opts.staticGrid)if(!c.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=c.opts.minWidth){if(c.oneColumnMode)return;c.oneColumnMode=!0,c.setColumn(1)}else{if(!c.oneColumnMode)return;c.oneColumnMode=!1,c.setColumn(c._prevColumn)}},m(window).resize(this.onResizeHandler),this.onResizeHandler(),!c.opts.staticGrid&&"string"==typeof c.opts.removable){var r=m(c.opts.removable);this.dd.isDroppable(r)||this.dd.droppable(r,c.opts.removableOptions),this.dd.on(r,"dropover",function(t,e){var i=m(e.draggable),o=i.data("_gridstack_node");o&&o._grid===c&&(i.data("inTrashZone",!0),c._setupRemovingTimeout(i))}).on(r,"dropout",function(t,e){var i=m(e.draggable),o=i.data("_gridstack_node");o&&o._grid===c&&(i.data("inTrashZone",!1),c._clearRemovingTimeout(i))})}if(!c.opts.staticGrid&&c.opts.acceptWidgets){function p(t,e){var i=u,o=i.data("_gridstack_node"),a=c.getCellFromPixel({left:t.pageX,top:t.pageY},!0),s=Math.max(0,a.x),r=Math.max(0,a.y);o._added||(o._added=!0,o.el=i,o.autoPosition=!0,o.x=s,o.y=r,c.grid.cleanNodes(),c.grid.beginUpdate(o),c.grid.addNode(o),c.container.append(c.placeholder),c.placeholder.attr("data-gs-x",o.x).attr("data-gs-y",o.y).attr("data-gs-width",o.width).attr("data-gs-height",o.height).show(),o.el=c.placeholder,o._beforeDragX=o.x,o._beforeDragY=o.y,c._updateContainerHeight()),c.grid.canMoveNode(o,s,r)&&(c.grid.moveNode(o,s,r),c._updateContainerHeight())}var u=null;this.dd.droppable(c.container,{accept:function(t){var e=(t=m(t)).data("_gridstack_node");return(!e||e._grid!==c)&&t.is(!0===c.opts.acceptWidgets?".grid-stack-item":c.opts.acceptWidgets)}}).on(c.container,"dropover",function(t,e){var i,o,a=m(e.draggable),s=a.data("_gridstack_node");if(!s||!s.width||!s.height){var r=parseInt(a.attr("data-gs-width"));0<r&&((s=s||{}).width=r);var n=parseInt(a.attr("data-gs-height"));0<n&&((s=s||{}).height=n)}var d=c.cellWidth(),h=c.cellHeight(),l=c.opts.verticalMargin;i=s&&s.width?s.width:Math.ceil(a.outerWidth()/d),o=s&&s.height?s.height:Math.round((a.outerHeight()+l)/(h+l)),u=a;var g=c.grid._prepareNode({width:i,height:o,_added:!1,_temporary:!0});return g.isOutOfGrid=!0,a.data("_gridstack_node",g),a.data("_gridstack_node_orig",s),a.on("drag",p),!1}).on(c.container,"dropout",function(t,e){var i=m(e.draggable);if(i.data("_gridstack_node")){var o=i.data("_gridstack_node");if(o.isOutOfGrid)return i.unbind("drag",p),o.el=null,c.grid.removeNode(o),c.placeholder.detach(),c._updateContainerHeight(),i.data("_gridstack_node",i.data("_gridstack_node_orig")),!1}}).on(c.container,"drop",function(t,e){c.placeholder.detach();var i=m(e.draggable).data("_gridstack_node");i.isOutOfGrid=!1,i._grid=c;var o=m(e.draggable).clone(!1);o.data("_gridstack_node",i);var a=m(e.draggable).data("_gridstack_node_orig");return void 0!==a&&void 0!==a._grid&&a._grid._triggerRemoveEvent(),m(e.helper).remove(),i.el=o,c.placeholder.hide(),f.removePositioningStyles(o),o.find("div.ui-resizable-handle").remove(),o.attr("data-gs-x",i.x).attr("data-gs-y",i.y).attr("data-gs-width",i.width).attr("data-gs-height",i.height).addClass(c.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",p),c.container.append(o),c._prepareElementsByNode(o,i),c._updateContainerHeight(),c.grid._addedNodes.push(i),c._triggerAddEvent(),c._triggerChangeEvent(),c.grid.endUpdate(),m(e.draggable).unbind("drag",p),m(e.draggable).removeData("_gridstack_node"),m(e.draggable).removeData("_gridstack_node_orig"),c.container.trigger("dropped",[a,i]),!1})}}var e,o,a,r;function g(){return console.warn("gridstack.js: Function `"+o+"` is deprecated in "+r+" and has been replaced with `"+a+"`. It will be **completely** removed in v1.0"),e.apply(this,arguments)}return i.prototype._triggerChangeEvent=function(){if(!this.grid._batchMode){var t=this.grid.getDirtyNodes(!0);t&&t.length&&(this.grid._layoutsNodesChange(t),this.container.trigger("change",[t])),this.grid._saveInitial()}},i.prototype._triggerAddEvent=function(){this.grid._batchMode||this.grid._addedNodes&&0<this.grid._addedNodes.length&&(this.grid._layoutsNodesChange(this.grid._addedNodes),this.grid._addedNodes.forEach(function(t){delete t._dirty}),this.container.trigger("added",[this.grid._addedNodes]),this.grid._addedNodes=[])},i.prototype._triggerRemoveEvent=function(){this.grid._batchMode||this.grid._removedNodes&&0<this.grid._removedNodes.length&&(this.container.trigger("removed",[this.grid._removedNodes]),this.grid._removedNodes=[])},i.prototype._initStyles=function(){this._stylesId&&f.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=f.createStylesheet(this._stylesId,this.container.get(0).parentNode),null!==this._styles&&(this._styles._max=0)},i.prototype._updateStyles=function(t){if(null!==this._styles&&void 0!==this._styles){var e,i="."+this.opts._class+" ."+this.opts.itemClass,o=this;if(void 0===t&&(t=this._styles._max),this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&!(0!==this._styles._max&&t<=this._styles._max)&&(e=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(t,e){return t&&e?"calc("+(o.opts.cellHeight*t+o.opts.cellHeightUnit)+" + "+(o.opts.verticalMargin*e+o.opts.verticalMarginUnit)+")":o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit}:function(t,e){return o.opts.cellHeight*t+o.opts.verticalMargin*e+o.opts.cellHeightUnit},0===this._styles._max&&f.insertCSSRule(this._styles,i,"min-height: "+e(1,0)+";",0),t>this._styles._max)){for(var a=this._styles._max;a<t;++a)f.insertCSSRule(this._styles,i+'[data-gs-height="'+(a+1)+'"]',"height: "+e(a+1,a)+";",a),f.insertCSSRule(this._styles,i+'[data-gs-min-height="'+(a+1)+'"]',"min-height: "+e(a+1,a)+";",a),f.insertCSSRule(this._styles,i+'[data-gs-max-height="'+(a+1)+'"]',"max-height: "+e(a+1,a)+";",a),f.insertCSSRule(this._styles,i+'[data-gs-y="'+a+'"]',"top: "+e(a,a)+";",a);this._styles._max=t}}},i.prototype._updateContainerHeight=function(){if(!this.grid._batchMode){var t=this.grid.getGridHeight(),e=parseInt(this.container.css("min-height"));if(0<e){var i=this.opts.verticalMargin,o=Math.round((e+i)/(this.cellHeight()+i));t<o&&(t=o)}this.container.attr("data-gs-current-height",t),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.container.css("height",t*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.container.css("height","calc("+(t*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(t*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.container.css("height",t*this.opts.cellHeight+this.opts.cellHeightUnit))}},i.prototype._setupRemovingTimeout=function(t){var e=m(t).data("_gridstack_node");!e._removeTimeout&&this.opts.removable&&(e._removeTimeout=setTimeout(function(){t.addClass("grid-stack-item-removing"),e._isAboutToRemove=!0},this.opts.removeTimeout))},i.prototype._clearRemovingTimeout=function(t){var e=m(t).data("_gridstack_node");e._removeTimeout&&(clearTimeout(e._removeTimeout),e._removeTimeout=null,t.removeClass("grid-stack-item-removing"),e._isAboutToRemove=!1)},i.prototype._prepareElementsByNode=function(h,l){function t(t,e){var i,o,a=Math.round(e.position.left/g),s=Math.floor((e.position.top+c/2)/c);if("drag"!==t.type&&(i=Math.round(e.size.width/g),o=Math.round(e.size.height/c)),"drag"===t.type){var r=e.position.top-l._prevYPix;if(l._prevYPix=e.position.top,f.updateScrollPosition(h[0],e,r),h.data("inTrashZone")||a<0||a>=p.grid.column||s<0||!p.grid.float&&s>p.grid.getGridHeight()){if(l._temporaryRemoved)return;!0===p.opts.removable&&p._setupRemovingTimeout(h),a=l._beforeDragX,s=l._beforeDragY,p.placeholder.detach(),p.placeholder.hide(),p.grid.removeNode(l),p._updateContainerHeight(),l._temporaryRemoved=!0}else p._clearRemovingTimeout(h),l._temporaryRemoved&&(p.grid.addNode(l),p.placeholder.attr("data-gs-x",a).attr("data-gs-y",s).attr("data-gs-width",i).attr("data-gs-height",o).show(),p.container.append(p.placeholder),l.el=p.placeholder,l._temporaryRemoved=!1)}else if("resize"===t.type&&a<0)return;var n=void 0!==i?i:l.lastTriedWidth,d=void 0!==o?o:l.lastTriedHeight;!p.grid.canMoveNode(l,a,s,i,o)||l.lastTriedX===a&&l.lastTriedY===s&&l.lastTriedWidth===n&&l.lastTriedHeight===d||(l.lastTriedX=a,l.lastTriedY=s,l.lastTriedWidth=i,l.lastTriedHeight=o,p.grid.moveNode(l,a,s,i,o),p._updateContainerHeight(),"resize"===t.type&&m(t.target).trigger("gsresize",l))}function e(t,e){p.container.append(p.placeholder);var i=m(this);p.grid.cleanNodes(),p.grid.beginUpdate(l),g=p.cellWidth();var o=p.cellHeight();c=p.container.height()/parseInt(p.container.attr("data-gs-current-height")),p.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),l.el=p.placeholder,l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var a=l.minHeight||1,s=p.opts.verticalMargin;p.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),p.dd.resizable(h,"option","minHeight",o*a+(a-1)*s),"resizestart"===t.type&&i.find(".grid-stack-item").trigger("resizestart")}function i(t,e){var i=m(this);if(i.data("_gridstack_node")){if(p.placeholder.detach(),l.el=i,p.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else p._clearRemovingTimeout(h),l._temporaryRemoved?(f.removePositioningStyles(i),i.attr("data-gs-x",l._beforeDragX).attr("data-gs-y",l._beforeDragY).attr("data-gs-width",l.width).attr("data-gs-height",l.height),l.x=l._beforeDragX,l.y=l._beforeDragY,l._temporaryRemoved=!1,p.grid.addNode(l)):(f.removePositioningStyles(i),i.attr("data-gs-x",l.x).attr("data-gs-y",l.y).attr("data-gs-width",l.width).attr("data-gs-height",l.height));p._updateContainerHeight(),p._triggerChangeEvent(),p.grid.endUpdate();var o=i.find(".grid-stack");o.length&&"resizestop"===t.type&&(o.each(function(t,e){m(e).data("gridstack").onResizeHandler()}),i.find(".grid-stack-item").trigger("resizestop"),i.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"===t.type&&p.container.trigger("gsresizestop",i)}}var g,c,p=this;this.dd.draggable(h,{start:e,stop:i,drag:t}).resizable(h,{start:e,stop:i,resize:t}),(l.noMove||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(h,"disable"),(l.noResize||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(h,"disable"),this._writeAttr(h,l)},i.prototype._prepareElement=function(t,e){e=void 0!==e&&e;(t=m(t)).addClass(this.opts.itemClass);var i=this._readAttr(t,{el:t,_grid:this});i=this.grid.addNode(i,e),t.data("_gridstack_node",i),this._prepareElementsByNode(t,i)},i.prototype._writeAttr=function(t,e){t=m(t),void 0!==(e=e||{}).x&&t.attr("data-gs-x",e.x),void 0!==e.y&&t.attr("data-gs-y",e.y),void 0!==e.width&&t.attr("data-gs-width",e.width),void 0!==e.height&&t.attr("data-gs-height",e.height),void 0!==e.autoPosition&&t.attr("data-gs-auto-position",!!e.autoPosition||null),void 0!==e.minWidth&&t.attr("data-gs-min-width",e.minWidth),void 0!==e.maxWidth&&t.attr("data-gs-max-width",e.maxWidth),void 0!==e.minHeight&&t.attr("data-gs-min-height",e.minHeight),void 0!==e.maxHeight&&t.attr("data-gs-max-height",e.maxHeight),void 0!==e.noResize&&t.attr("data-gs-no-resize",!!e.noResize||null),void 0!==e.noMove&&t.attr("data-gs-no-move",!!e.noMove||null),void 0!==e.locked&&t.attr("data-gs-locked",!!e.locked||null),void 0!==e.resizeHandles&&t.attr("data-gs-resize-handles",e.resizeHandles),void 0!==e.id&&t.attr("data-gs-id",e.id)},i.prototype._readAttr=function(t,e){return t=m(t),(e=e||{}).x=t.attr("data-gs-x"),e.y=t.attr("data-gs-y"),e.width=t.attr("data-gs-width"),e.height=t.attr("data-gs-height"),e.autoPosition=f.toBool(t.attr("data-gs-auto-position")),e.maxWidth=t.attr("data-gs-max-width"),e.minWidth=t.attr("data-gs-min-width"),e.maxHeight=t.attr("data-gs-max-height"),e.minHeight=t.attr("data-gs-min-height"),e.noResize=f.toBool(t.attr("data-gs-no-resize")),e.noMove=f.toBool(t.attr("data-gs-no-move")),e.locked=f.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},i.prototype.setAnimation=function(t){t?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},i.prototype.addWidget=function(t,e,i,o,a,s,r,n,d,h,l){return void 0!==e&&"object"!=typeof e?this.addWidget(t,{x:e,y:i,width:o,height:a,autoPosition:s,minWidth:r,maxWidth:n,minHeight:d,maxHeight:h,id:l}):(e=e||{},t=m(t),this._writeAttr(t,e),this.container.append(t),this.makeWidget(t))},i.prototype.makeWidget=function(t){return t=m(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t},i.prototype.willItFit=function(t,e,i,o,a){var s={x:t,y:e,width:i,height:o,autoPosition:a};return this.grid.canBePlacedWithRespectToHeight(s)},i.prototype.removeWidget=function(t,e){e=void 0===e||e;var i=(t=m(t)).data("_gridstack_node");i=i||this.grid.getNodeDataByDOMEl(t),t.removeData("_gridstack_node"),this.grid.removeNode(i,e),this._triggerRemoveEvent(),this._triggerChangeEvent(!0)},i.prototype.removeAll=function(t){!1!==t&&this.grid.nodes.forEach(function(t){t.el.removeData("_gridstack_node")}),this.grid.removeAll(t),this._triggerRemoveEvent()},i.prototype.destroy=function(t){m(window).off("resize",this.onResizeHandler),this.disable(),void 0===t||t?this.container.remove():(this.removeAll(!1),this.container.removeData("gridstack")),f.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},i.prototype.resizable=function(t,o){var a=this;return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.noResize=!o,i.noResize?a.dd.resizable(e,"disable"):a.dd.resizable(e,"enable"))}),this},i.prototype.movable=function(t,o){var a=this;return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.noMove=!o,i.noMove?(a.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(a.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},i.prototype.enableMove=function(t,e){this.movable(this.container.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},i.prototype.enableResize=function(t,e){this.resizable(this.container.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},i.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},i.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},i.prototype.locked=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(i.locked=o||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},i.prototype.maxHeight=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxHeight=o||!1,e.attr("data-gs-max-height",o)))}),this},i.prototype.minHeight=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minHeight=o||!1,e.attr("data-gs-min-height",o)))}),this},i.prototype.maxWidth=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.maxWidth=o||!1,e.attr("data-gs-max-width",o)))}),this},i.prototype.minWidth=function(t,o){return(t=m(t)).each(function(t,e){var i=(e=m(e)).data("_gridstack_node");i&&(isNaN(o)||(i.minWidth=o||!1,e.attr("data-gs-min-width",o)))}),this},i.prototype._updateElement=function(t,e){var i=(t=m(t).first()).data("_gridstack_node");if(i){var o=this;o.grid.cleanNodes(),o.grid.beginUpdate(i),e.call(this,t,i),o._updateContainerHeight(),o._triggerChangeEvent(),o.grid.endUpdate()}},i.prototype.resize=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.width,o=null!=o?o:e.height,this.grid.moveNode(e,e.x,e.y,i,o)})},i.prototype.move=function(t,i,o){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,this.grid.moveNode(e,i,o,e.width,e.height)})},i.prototype.update=function(t,i,o,a,s){this._updateElement(t,function(t,e){i=null!=i?i:e.x,o=null!=o?o:e.y,a=null!=a?a:e.width,s=null!=s?s:e.height,this.grid.moveNode(e,i,o,a,s)})},i.prototype.compact=function(){if(0!==this.grid.nodes.length){this.batchUpdate(),this.grid._sortNodes();var t=this.grid.nodes;this.grid.nodes=[],t.forEach(function(t){t.noMove||t.locked||(t.autoPosition=!0),this.grid.addNode(t,!1),t._dirty=!0},this),this.commit()}},i.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=f.parseHeight(t);this.opts.verticalMarginUnit===i.unit&&this.opts.maxRow===i.height||(this.opts.verticalMarginUnit=i.unit,this.opts.verticalMargin=i.height,e||this._updateStyles())},i.prototype.cellHeight=function(t,e){if(void 0===t){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight)return this.opts.cellHeight;var i=this.container.children("."+this.opts.itemClass).first(),o=i.attr("data-gs-height"),a=this.opts.verticalMargin;return Math.round((i.outerHeight()-(o-1)*a)/o)}var s=f.parseHeight(t);this.opts.cellHeightUnit===s.unit&&this.opts.cellHeight===s.height||(this.opts.cellHeightUnit=s.unit,this.opts.cellHeight=s.height,e||this._updateStyles())},i.prototype.cellWidth=function(){return Math.round(this.container.outerWidth()/this.opts.column)},i.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.container.offset():this.container.position(),o=t.left-i.left,a=t.top-i.top,s=Math.floor(this.container.width()/this.opts.column),r=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(o/s),y:Math.floor(a/r)}},i.prototype.batchUpdate=function(){this.grid.batchUpdate()},i.prototype.commit=function(){this.grid.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},i.prototype.isAreaEmpty=function(t,e,i,o){return this.grid.isAreaEmpty(t,e,i,o)},i.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},i.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.container.addClass(t):this.container.removeClass(t)},l.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(o,a){o&&a!==this.column&&(a<this.column?this._layouts[a]=void 0:t.forEach(function(e){var t=o.find(function(t){return t._id===e._id});if(t){var i=a/this.column;e.y!==e._origY&&(t.y+=e.y-e._origY),e.x!==e._origX&&(t.x=Math.round(e.x*i)),e.width!==e._origW&&(t.width=Math.round(e.width*i))}},this))},this)},l.prototype._updateNodeWidths=function(e,i,o){if(this.nodes.length&&e!==i){var a=[this.nodes.length];if(this.nodes.forEach(function(t,e){a[e]={x:t.x,y:t.y,width:t.width,_id:t._id}}),this._layouts=this._layouts||[],this._layouts[e]=a,1===i&&o&&o.length){var s=0;o.forEach(function(t){t.x=0,t.width=1,t.y=Math.max(t.y,s),s=t.y+t.height})}else o=f.sort(this.nodes,-1,e);var t=this._layouts[i]||[],r=this._layouts.length-1;0===t.length&&e<i&&i<r&&(t=this._layouts[r]||[]).length&&(e=r,t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width)}),t=[]);var n=[];t.forEach(function(e){var t=o.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(o[t].x=e.x,o[t].y=e.y,o[t].width=e.width,n.push(o[t]),o[t]=null)});var d=i/e;o.forEach(function(t){t&&(t.x=1===i?0:Math.round(t.x*d),t.width=1===i||1===e?1:Math.round(t.width*d)||1,n.push(t))}),n=f.sort(n,-1,i),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],n.forEach(function(t){this.addNode(t,!1),t._dirty=!0},this),this.commit(),delete this._ignoreLayoutsNodeChange}},l.prototype._saveInitial=function(){this.nodes.forEach(function(t){t._origX=t.x,t._origY=t.y,t._origW=t.width,t._origH=t.height,delete t._dirty})},i.prototype.setColumn=function(t,e){if(this.opts.column!==t){var o,i=this.opts.column;if(1===t?this._prevColumn=i:delete this._prevColumn,this.container.removeClass("grid-stack-"+i),this.container.addClass("grid-stack-"+t),this.opts.column=this.grid.column=t,!0!==e)this.opts.oneColumnModeDomSort&&1===t&&(o=[],this.container.children("."+this.opts.itemClass).each(function(t,e){var i=m(e).data("_gridstack_node");i&&o.push(i)}),o.length||(o=void 0)),this.grid._updateNodeWidths(i,t,o),this.grid._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this.grid._ignoreLayoutsNodeChange}},i.prototype.float=function(t){if(void 0===t)return this.opts.float||!1;this.opts.float!==t&&(this.opts.float=this.grid.float=t||!1,t||(this.grid._packNodes(),this.grid._notify(),this._triggerChangeEvent()))},i.prototype.setGridWidth=(o="setGridWidth",a="setColumn",r="v0.5.3",g.prototype=(e=i.prototype.setColumn).prototype,g),t.GridStackUI=i,t.GridStackUI.Utils=f,t.GridStackUI.Engine=l,t.GridStackUI.GridStackDragDropPlugin=h,m.fn.gridstack=function(e){return this.each(function(){var t=m(this);t.data("gridstack")||t.data("gridstack",new i(this,e))})},t.GridStackUI});
!function(f,t){var e=function(t,e,i,n){var o=function(){console.warn("gridstack.js: Function `"+e+"` is deprecated in "+n+" and has been replaced "+"with `"+i+"`. It will be **completely** removed in v1.0");return t.apply(this,arguments)};o.prototype=t.prototype;return o},h=function(t,e,i,n){if(t[e]!==undefined){t[i]=t[e];console.warn("gridstack.js: Option `"+e+"` is deprecated in "+n+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},l=function(t,e,i,n){if(t[e]!==undefined){console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+n)}},g=function(t,e,i,n){var o=t.attr(e);if(o!==undefined){t.attr(i,o);console.warn("gridstack.js: attribute `"+e+"`="+o+" is deprecated on this object in "+n+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}},m={isIntercepted:function(t,e){return!(t.x+t.width<=e.x||e.x+e.width<=t.x||t.y+t.height<=e.y||e.y+e.height<=t.y)},sort:function(t,e,i){if(!i){var n=t.map(function(t){return t.x+t.width});i=Math.max.apply(Math,n)}if(e===-1)return m.sortBy(t,function(t){return-(t.x+t.y*i)});else return m.sortBy(t,function(t){return t.x+t.y*i})},createStylesheet:function(t,e){var i=document.createElement("style");i.setAttribute("type","text/css");i.setAttribute("data-gs-style-id",t);if(i.styleSheet){i.styleSheet.cssText=""}else{i.appendChild(document.createTextNode(""))}if(!e){e=document.getElementsByTagName("head")[0]}e.insertBefore(i,e.firstChild);return i.sheet},removeStylesheet:function(t){f("STYLE[data-gs-style-id="+t+"]").remove()},insertCSSRule:function(t,e,i,n){if(typeof t.insertRule==="function"){t.insertRule(e+"{"+i+"}",n)}else if(typeof t.addRule==="function"){t.addRule(e,i,n)}},toBool:function(t){if(typeof t==="boolean"){return t}if(typeof t==="string"){t=t.toLowerCase();return!(t===""||t==="no"||t==="false"||t==="0")}return Boolean(t)},_collisionNodeCheck:function(t){return t!==this.node&&m.isIntercepted(t,this.nn)},_didCollide:function(t){return m.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},t)},_isAddNodeIntercepted:function(t){return m.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},t)},parseHeight:function(t){var e=t;var i="px";if(e&&typeof e==="string"){var n=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!n){throw new Error("Invalid height")}i=n[2]||"px";e=parseFloat(n[1])}return{height:e,unit:i}},without:function(t,e){var i=t.indexOf(e);if(i!==-1){t=t.slice(0);t.splice(i,1)}return t},sortBy:function(t,o){return t.slice(0).sort(function(t,e){var i=o(t);var n=o(e);if(n===i){return 0}return i>n?1:-1})},defaults:function(i){var t=Array.prototype.slice.call(arguments,1);t.forEach(function(t){for(var e in t){if(t.hasOwnProperty(e)&&(!i.hasOwnProperty(e)||i[e]===undefined)){i[e]=t[e]}}});return i},clone:function(t){return f.extend({},t)},throttle:function(t,e){var i=false;return function(){if(!i){t.apply(this,arguments);i=true;setTimeout(function(){i=false},e)}}},removePositioningStyles:function(t){var e=t[0].style;if(e.position){e.removeProperty("position")}if(e.left){e.removeProperty("left")}if(e.top){e.removeProperty("top")}if(e.width){e.removeProperty("width")}if(e.height){e.removeProperty("height")}},getScrollParent:function(t){var e;if(t===null){e=null}else if(t.scrollHeight>t.clientHeight){e=t}else{e=m.getScrollParent(t.parentNode)}return e},updateScrollPosition:function(t,e,i){var n=t.getBoundingClientRect();var o=window.innerHeight||document.documentElement.clientHeight;if(n.top<0||n.bottom>o){var a=n.bottom-o;var s=n.top;var r=m.getScrollParent(t);if(r!==null){var d=r.scrollTop;if(n.top<0&&i<0){if(t.offsetHeight>o){r.scrollTop+=i}else{r.scrollTop+=Math.abs(s)>Math.abs(i)?i:s}}else if(i>0){if(t.offsetHeight>o){r.scrollTop+=i}else{r.scrollTop+=a>i?i:a}}e.position.top+=r.scrollTop-d}}}};function v(t){this.grid=t}v.registeredPlugins=[],v.registerPlugin=function(t){v.registeredPlugins.push(t)},v.prototype.resizable=function(t,e){return this},v.prototype.draggable=function(t,e){return this},v.prototype.droppable=function(t,e){return this},v.prototype.isDroppable=function(t){return false},v.prototype.on=function(t,e,i){return this};var a=0,_=function(t,e,i,n,o){this.column=t||12;this.float=i||false;this.maxRow=n||0;this.nodes=o||[];this.onchange=e||function(){};this._addedNodes=[];this._removedNodes=[];this._batchMode=false};_.prototype.batchUpdate=function(){if(this._batchMode)return;this._batchMode=true;this._prevFloat=this.float;this.float=true},_.prototype.commit=function(){if(!this._batchMode)return;this._batchMode=false;this.float=this._prevFloat;delete this._prevFloat;this._packNodes();this._notify()},_.prototype.getNodeDataByDOMEl=function(e){return this.nodes.find(function(t){return e===t.el})},_.prototype._fixCollisions=function(t){var e=this;this._sortNodes(-1);var i=t;var n=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.float&&!n){i={x:0,y:t.y,width:this.column,height:t.height}}while(true){var o=this.nodes.find(m._collisionNodeCheck,{node:t,nn:i});if(!o){return}this.moveNode(o,o.x,t.y+t.height,o.width,o.height,true)}},_.prototype.isAreaEmpty=function(t,e,i,n){var o={x:t||0,y:e||0,width:i||1,height:n||1};var a=this.nodes.find(function(t){return m.isIntercepted(t,o)});return!a},_.prototype._sortNodes=function(t){this.nodes=m.sort(this.nodes,t,this.column)},_.prototype._packNodes=function(){this._sortNodes();if(this.float){this.nodes.forEach(function(t,e){if(t._updating||t._packY===undefined||t.y===t._packY){return}var i=t.y;while(i>=t._packY){var n=this.nodes.slice(0,e).find(m._didCollide,{n:t,newY:i});if(!n){t._dirty=true;t.y=i}--i}},this)}else{this.nodes.forEach(function(t,e){if(t.locked){return}while(t.y>0){var i=t.y-1;var n=e===0;if(e>0){var o=this.nodes.slice(0,e).find(m._didCollide,{n:t,newY:i});n=o===undefined}if(!n){break}t._dirty=t.y!==i;t.y=i}},this)}},_.prototype._prepareNode=function(t,e){t=t||{};if(t.x===undefined||t.y===undefined||t.x===null||t.y===null){t.autoPosition=true}var i={width:1,height:1,x:0,y:0};t=m.defaults(t,i);t.x=parseInt(t.x);t.y=parseInt(t.y);t.width=parseInt(t.width);t.height=parseInt(t.height);t.autoPosition=t.autoPosition||false;t.noResize=t.noResize||false;t.noMove=t.noMove||false;if(Number.isNaN(t.x)){t.x=i.x;t.autoPosition=true}if(Number.isNaN(t.y)){t.y=i.y;t.autoPosition=true}if(Number.isNaN(t.width)){t.width=i.width}if(Number.isNaN(t.height)){t.height=i.height}if(t.width>this.column){t.width=this.column}else if(t.width<1){t.width=1}if(t.height<1){t.height=1}if(t.x<0){t.x=0}if(t.x+t.width>this.column){if(e){t.width=this.column-t.x}else{t.x=this.column-t.width}}if(t.y<0){t.y=0}return t},_.prototype._notify=function(){if(this._batchMode){return}var t=Array.prototype.slice.call(arguments,0);t[0]=t[0]===undefined?[]:Array.isArray(t[0])?t[0]:[t[0]];t[1]=t[1]===undefined?true:t[1];var e=t[0].concat(this.getDirtyNodes());this.onchange(e,t[1])},_.prototype.cleanNodes=function(){if(this._batchMode){return}this.nodes.forEach(function(t){delete t._dirty})},_.prototype.getDirtyNodes=function(t){if(t){var e=[];this.nodes.forEach(function(t){if(t._dirty){if(t.y===t._origY&&t.x===t._origX&&t.width===t._origW&&t.height===t._origH){delete t._dirty}else{e.push(t)}}});return e}return this.nodes.filter(function(t){return t._dirty})},_.prototype.addNode=function(t,e){t=this._prepareNode(t);if(t.maxWidth!==undefined){t.width=Math.min(t.width,t.maxWidth)}if(t.maxHeight!==undefined){t.height=Math.min(t.height,t.maxHeight)}if(t.minWidth!==undefined){t.width=Math.max(t.width,t.minWidth)}if(t.minHeight!==undefined){t.height=Math.max(t.height,t.minHeight)}t._id=t._id||++a;if(t.autoPosition){this._sortNodes();for(var i=0;;++i){var n=i%this.column;var o=Math.floor(i/this.column);if(n+t.width>this.column){continue}if(!this.nodes.find(m._isAddNodeIntercepted,{x:n,y:o,node:t})){t.x=n;t.y=o;delete t.autoPosition;break}}}this.nodes.push(t);if(e){this._addedNodes.push(t)}this._fixCollisions(t);this._packNodes();this._notify();return t},_.prototype.removeNode=function(t,e){e=e===undefined?true:e;this._removedNodes.push(t);t._id=null;this.nodes=m.without(this.nodes,t);this._packNodes();this._notify(t,e)},_.prototype.removeAll=function(t){delete this._layouts;if(this.nodes.length===0){return}t=t===undefined?true:t;this.nodes.forEach(function(t){t._id=null});this._removedNodes=this.nodes;this.nodes=[];this._notify(this._removedNodes,t)},_.prototype.canMoveNode=function(e,t,i,n,o){if(!this.isNodeChangedPosition(e,t,i,n,o)){return false}var a=Boolean(this.nodes.find(function(t){return t.locked}));if(!this.maxRow&&!a){return true}var s;var r=new _(this.column,null,this.float,0,this.nodes.map(function(t){if(t===e){s=f.extend({},t);return s}return f.extend({},t)}));if(!s){return true}r.moveNode(s,t,i,n,o);var d=true;if(a){d&=!Boolean(r.nodes.find(function(t){return t!==s&&Boolean(t.locked)&&Boolean(t._dirty)}))}if(this.maxRow){d&=r.getRow()<=this.maxRow}return d},_.prototype.canBePlacedWithRespectToHeight=function(t){if(!this.maxRow){return true}var e=new _(this.column,null,this.float,0,this.nodes.map(function(t){return f.extend({},t)}));e.addNode(t);return e.getRow()<=this.maxRow},_.prototype.isNodeChangedPosition=function(t,e,i,n,o){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof n!=="number"){n=t.width}if(typeof o!=="number"){o=t.height}if(t.maxWidth!==undefined){n=Math.min(n,t.maxWidth)}if(t.maxHeight!==undefined){o=Math.min(o,t.maxHeight)}if(t.minWidth!==undefined){n=Math.max(n,t.minWidth)}if(t.minHeight!==undefined){o=Math.max(o,t.minHeight)}if(t.x===e&&t.y===i&&t.width===n&&t.height===o){return false}return true},_.prototype.moveNode=function(t,e,i,n,o,a){if(typeof e!=="number"){e=t.x}if(typeof i!=="number"){i=t.y}if(typeof n!=="number"){n=t.width}if(typeof o!=="number"){o=t.height}if(t.maxWidth!==undefined){n=Math.min(n,t.maxWidth)}if(t.maxHeight!==undefined){o=Math.min(o,t.maxHeight)}if(t.minWidth!==undefined){n=Math.max(n,t.minWidth)}if(t.minHeight!==undefined){o=Math.max(o,t.minHeight)}if(t.x===e&&t.y===i&&t.width===n&&t.height===o){return t}var s=t.width!==n;t._dirty=true;t.x=e;t.y=i;t.width=n;t.height=o;t.lastTriedX=e;t.lastTriedY=i;t.lastTriedWidth=n;t.lastTriedHeight=o;t=this._prepareNode(t,s);this._fixCollisions(t);if(!a){this._packNodes();this._notify()}return t},_.prototype.getRow=function(){return this.nodes.reduce(function(t,e){return Math.max(t,e.y+e.height)},0)},_.prototype.beginUpdate=function(t){if(t._updating)return;t._updating=true;this.nodes.forEach(function(t){t._packY=t.y})},_.prototype.endUpdate=function(){var t=this.nodes.find(function(t){return t._updating});if(t){t._updating=false;this.nodes.forEach(function(t){delete t._packY})}};var o=function(t,e){var u=this;var i,n,o;e=e||{};this.$el=f(t);this.el=this.$el.get(0);h(e,"width","column","v0.5.3");h(e,"height","maxRow","v0.5.3");l(e,"oneColumnModeClass","v0.6.3",". Use class `.grid-stack-1` instead");g(this.$el,"data-gs-width","data-gs-column","v0.5.3");g(this.$el,"data-gs-height","data-gs-max-row","v0.5.3");g(this.$el,"data-gs-current-height","data-gs-current-row","v1.0.0");e.itemClass=e.itemClass||"grid-stack-item";var a=this.$el.closest("."+e.itemClass).length>0;this.opts=m.defaults(e,{column:parseInt(this.$el.attr("data-gs-column"))||12,maxRow:parseInt(this.$el.attr("data-gs-max-row"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:true,minWidth:768,float:false,staticGrid:false,_class:"grid-stack-instance-"+(Math.random()*1e4).toFixed(0),animate:Boolean(this.$el.attr("data-gs-animate"))||false,alwaysShowResizeHandle:e.alwaysShowResizeHandle||false,resizable:m.defaults(e.resizable||{},{autoHide:!(e.alwaysShowResizeHandle||false),handles:"se"}),draggable:m.defaults(e.draggable||{},{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:false,appendTo:"body"}),disableDrag:e.disableDrag||false,disableResize:e.disableResize||false,rtl:"auto",removable:false,removableOptions:m.defaults(e.removableOptions||{},{accept:"."+e.itemClass}),removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:e.disableOneColumnMode||false,oneColumnModeDomSort:e.oneColumnModeDomSort,ddPlugin:null});if(this.opts.ddPlugin===false){this.opts.ddPlugin=v}else if(this.opts.ddPlugin===null){this.opts.ddPlugin=v.registeredPlugins[0]||v}this.dd=new this.opts.ddPlugin(this);if(this.opts.rtl==="auto"){this.opts.rtl=this.$el.css("direction")==="rtl"}if(this.opts.rtl){this.$el.addClass("grid-stack-rtl")}this.opts.isNested=a;o=this.opts.cellHeight==="auto";if(o){u.cellHeight(u.cellWidth(),true)}else{this.cellHeight(this.opts.cellHeight,true)}this.verticalMargin(this.opts.verticalMargin,true);this.$el.addClass(this.opts._class);this._setStaticClass();if(a){this.$el.addClass("grid-stack-nested")}this._initStyles();this.engine=new _(this.opts.column,function(t,e){e=e===undefined?true:e;var i=0;this.nodes.forEach(function(t){i=Math.max(i,t.y+t.height)});t.forEach(function(t){if(e&&t._id===null){if(t.el){f(t.el).remove()}}else{f(t.el).attr("data-gs-x",t.x).attr("data-gs-y",t.y).attr("data-gs-width",t.width).attr("data-gs-height",t.height)}});u._updateStyles(i+10)},this.opts.float,this.opts.maxRow);if(this.opts.auto){var s=[];var r=this;this.$el.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(t,e){e=f(e);var i=parseInt(e.attr("data-gs-x"));var n=parseInt(e.attr("data-gs-y"));s.push({el:e.get(0),i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(n)?1e3:n)*r.opts.column})});m.sortBy(s,function(t){return t.i}).forEach(function(t){this._prepareElement(t.el)},this)}this.engine._saveInitial();this.setAnimation(this.opts.animate);this.placeholder=f('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'">'+'<div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide();this._updateContainerHeight();this._updateHeightsOnResize=m.throttle(function(){u.cellHeight(u.cellWidth(),false)},100);this.onResizeHandler=function(){if(o){u._updateHeightsOnResize()}if(u.opts.staticGrid){return}if(!u.opts.disableOneColumnMode&&(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=u.opts.minWidth){if(u.oneColumnMode){return}u.oneColumnMode=true;u.column(1)}else{if(!u.oneColumnMode){return}u.oneColumnMode=false;u.column(u._prevColumn)}};f(window).resize(this.onResizeHandler);this.onResizeHandler();if(!u.opts.staticGrid&&typeof u.opts.removable==="string"){var d=f(u.opts.removable);if(!this.dd.isDroppable(d)){this.dd.droppable(d,u.opts.removableOptions)}this.dd.on(d,"dropover",function(t,e){var i=f(e.draggable);var n=i.data("_gridstack_node");if(!n||n._grid!==u){return}i.data("inTrashZone",true);u._setupRemovingTimeout(i)}).on(d,"dropout",function(t,e){var i=f(e.draggable);var n=i.data("_gridstack_node");if(!n||n._grid!==u){return}i.data("inTrashZone",false);u._clearRemovingTimeout(i)})}if(!u.opts.staticGrid&&u.opts.acceptWidgets){var c=null;var p=function(t,e){var i=c;var n=i.data("_gridstack_node");var o=u.getCellFromPixel({left:t.pageX,top:t.pageY},true);var a=Math.max(0,o.x);var s=Math.max(0,o.y);if(!n._added){n._added=true;n.el=i.get(0);n.autoPosition=true;n.x=a;n.y=s;u.engine.cleanNodes();u.engine.beginUpdate(n);u.engine.addNode(n);u.$el.append(u.placeholder);u.placeholder.attr("data-gs-x",n.x).attr("data-gs-y",n.y).attr("data-gs-width",n.width).attr("data-gs-height",n.height).show();n.el=u.placeholder.get(0);n._beforeDragX=n.x;n._beforeDragY=n.y;u._updateContainerHeight()}if(!u.engine.canMoveNode(n,a,s)){return}u.engine.moveNode(n,a,s);u._updateContainerHeight()};this.dd.droppable(u.$el,{accept:function(t){t=f(t);var e=t.data("_gridstack_node");if(e&&e._grid===u){return false}return t.is(u.opts.acceptWidgets===true?".grid-stack-item":u.opts.acceptWidgets)}}).on(u.$el,"dropover",function(t,e){var i=f(e.draggable);var n,o;var a=i.data("_gridstack_node");if(!a||!a.width||!a.height){var s=parseInt(i.attr("data-gs-width"));if(s>0){a=a||{};a.width=s}var r=parseInt(i.attr("data-gs-height"));if(r>0){a=a||{};a.height=r}}var d=u.cellWidth();var h=u.cellHeight();var l=u.opts.verticalMargin;n=a&&a.width?a.width:Math.ceil(i.outerWidth()/d);o=a&&a.height?a.height:Math.round((i.outerHeight()+l)/(h+l));c=i;var g=u.engine._prepareNode({width:n,height:o,_added:false,_temporary:true});g.isOutOfGrid=true;i.data("_gridstack_node",g);i.data("_gridstack_node_orig",a);i.on("drag",p);return false}).on(u.$el,"dropout",function(t,e){var i=f(e.draggable);if(!i.data("_gridstack_node")){return}var n=i.data("_gridstack_node");if(!n.isOutOfGrid){return}i.unbind("drag",p);n.el=null;u.engine.removeNode(n);u.placeholder.detach();u._updateContainerHeight();i.data("_gridstack_node",i.data("_gridstack_node_orig"));return false}).on(u.$el,"drop",function(t,e){u.placeholder.detach();var i=f(e.draggable).data("_gridstack_node");i.isOutOfGrid=false;i._grid=u;var n=f(e.draggable).clone(false);n.data("_gridstack_node",i);var o=f(e.draggable).data("_gridstack_node_orig");if(o!==undefined&&o._grid!==undefined){o._grid._triggerRemoveEvent()}f(e.helper).remove();i.el=n.get(0);u.placeholder.hide();m.removePositioningStyles(n);n.find("div.ui-resizable-handle").remove();n.attr("data-gs-x",i.x).attr("data-gs-y",i.y).attr("data-gs-width",i.width).attr("data-gs-height",i.height).addClass(u.opts.itemClass).enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",p);u.$el.append(n);u._prepareElementsByNode(n,i);u._updateContainerHeight();u.engine._addedNodes.push(i);u._triggerAddEvent();u._triggerChangeEvent();u.engine.endUpdate();f(e.draggable).unbind("drag",p);f(e.draggable).removeData("_gridstack_node");f(e.draggable).removeData("_gridstack_node_orig");u.$el.trigger("dropped",[o,i]);return false})}};o.prototype._triggerChangeEvent=function(){if(!this.engine._batchMode){var t=this.engine.getDirtyNodes(!0);t&&t.length&&(this.engine._layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine._saveInitial()}},o.prototype._triggerAddEvent=function(){this.engine._batchMode||this.engine._addedNodes&&0<this.engine._addedNodes.length&&(this.engine._layoutsNodesChange(this.engine._addedNodes),this.engine._addedNodes.forEach(function(t){delete t._dirty}),this._triggerEvent("added",this.engine._addedNodes),this.engine._addedNodes=[])},o.prototype._triggerRemoveEvent=function(){this.engine._batchMode||this.engine._removedNodes&&0<this.engine._removedNodes.length&&(this._triggerEvent("removed",this.engine._removedNodes),this.engine._removedNodes=[])},o.prototype._triggerEvent=function(t,e){var i=new CustomEvent(t,{detail:e});this.el.dispatchEvent(i)},o.prototype._initStyles=function(){this._stylesId&&m.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=m.createStylesheet(this._stylesId,this.el.parentNode),null!==this._styles&&(this._styles._max=0)},o.prototype._updateStyles=function(t){if(null!==this._styles&&void 0!==this._styles){var e,i="."+this.opts._class+" ."+this.opts.itemClass,n=this;if(void 0===t&&(t=this._styles._max),this._initStyles(),this._updateContainerHeight(),this.opts.cellHeight&&!(0!==this._styles._max&&t<=this._styles._max)&&(e=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(t,e){return t&&e?"calc("+(n.opts.cellHeight*t+n.opts.cellHeightUnit)+" + "+(n.opts.verticalMargin*e+n.opts.verticalMarginUnit)+")":n.opts.cellHeight*t+n.opts.verticalMargin*e+n.opts.cellHeightUnit}:function(t,e){return n.opts.cellHeight*t+n.opts.verticalMargin*e+n.opts.cellHeightUnit},0===this._styles._max&&m.insertCSSRule(this._styles,i,"min-height: "+e(1,0)+";",0),t>this._styles._max)){for(var o=this._styles._max;o<t;++o)m.insertCSSRule(this._styles,i+'[data-gs-height="'+(o+1)+'"]',"height: "+e(o+1,o)+";",o),m.insertCSSRule(this._styles,i+'[data-gs-min-height="'+(o+1)+'"]',"min-height: "+e(o+1,o)+";",o),m.insertCSSRule(this._styles,i+'[data-gs-max-height="'+(o+1)+'"]',"max-height: "+e(o+1,o)+";",o),m.insertCSSRule(this._styles,i+'[data-gs-y="'+o+'"]',"top: "+e(o,o)+";",o);this._styles._max=t}}},o.prototype._updateContainerHeight=function(){if(!this.engine._batchMode){var t=this.engine.getRow(),e=parseInt(this.$el.css("min-height"));if(0<e){var i=this.opts.verticalMargin,n=Math.round((e+i)/(this.cellHeight()+i));t<n&&(t=n)}this.$el.attr("data-gs-current-row",t),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.$el.css("height",t*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.$el.css("height","calc("+(t*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(t*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.$el.css("height",t*this.opts.cellHeight+this.opts.cellHeightUnit))}},o.prototype._setupRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");!e._removeTimeout&&this.opts.removable&&(e._removeTimeout=setTimeout(function(){t.addClass("grid-stack-item-removing"),e._isAboutToRemove=!0},this.opts.removeTimeout))},o.prototype._clearRemovingTimeout=function(t){var e=f(t).data("_gridstack_node");e._removeTimeout&&(clearTimeout(e._removeTimeout),e._removeTimeout=null,t.removeClass("grid-stack-item-removing"),e._isAboutToRemove=!1)},o.prototype._prepareElementsByNode=function(h,l){function t(t,e){var i,n,o=Math.round(e.position.left/g),a=Math.floor((e.position.top+u/2)/u);if("drag"!==t.type&&(i=Math.round(e.size.width/g),n=Math.round(e.size.height/u)),"drag"===t.type){var s=e.position.top-l._prevYPix;if(l._prevYPix=e.position.top,m.updateScrollPosition(h[0],e,s),h.data("inTrashZone")||o<0||o>=c.engine.column||a<0||!c.engine.float&&a>c.engine.getRow()){if(l._temporaryRemoved)return;!0===c.opts.removable&&c._setupRemovingTimeout(h),o=l._beforeDragX,a=l._beforeDragY,c.placeholder.detach(),c.placeholder.hide(),c.engine.removeNode(l),c._updateContainerHeight(),l._temporaryRemoved=!0}else c._clearRemovingTimeout(h),l._temporaryRemoved&&(c.engine.addNode(l),c.placeholder.attr("data-gs-x",o).attr("data-gs-y",a).attr("data-gs-width",i).attr("data-gs-height",n).show(),c.$el.append(c.placeholder),l.el=c.placeholder.get(0),l._temporaryRemoved=!1)}else if("resize"===t.type&&o<0)return;var r=void 0!==i?i:l.lastTriedWidth,d=void 0!==n?n:l.lastTriedHeight;!c.engine.canMoveNode(l,o,a,i,n)||l.lastTriedX===o&&l.lastTriedY===a&&l.lastTriedWidth===r&&l.lastTriedHeight===d||(l.lastTriedX=o,l.lastTriedY=a,l.lastTriedWidth=i,l.lastTriedHeight=n,c.engine.moveNode(l,o,a,i,n),c._updateContainerHeight(),"resize"===t.type&&f(t.target).trigger("gsresize",l))}function e(t,e){c.$el.append(c.placeholder);var i=f(this);c.engine.cleanNodes(),c.engine.beginUpdate(l),g=c.cellWidth();var n=c.cellHeight();u=c.$el.height()/parseInt(c.$el.attr("data-gs-current-row")),c.placeholder.attr("data-gs-x",i.attr("data-gs-x")).attr("data-gs-y",i.attr("data-gs-y")).attr("data-gs-width",i.attr("data-gs-width")).attr("data-gs-height",i.attr("data-gs-height")).show(),l.el=c.placeholder.get(0),l._beforeDragX=l.x,l._beforeDragY=l.y,l._prevYPix=e.position.top;var o=l.minHeight||1,a=c.opts.verticalMargin;c.dd.resizable(h,"option","minWidth",g*(l.minWidth||1)),c.dd.resizable(h,"option","minHeight",n*o+(o-1)*a),"resizestart"===t.type&&i.find(".grid-stack-item").trigger("resizestart")}function i(t,e){var i=f(this);if(i.data("_gridstack_node")){if(c.placeholder.detach(),l.el=i.get(0),c.placeholder.hide(),l._isAboutToRemove)h.data("_gridstack_node")._grid._triggerRemoveEvent(),h.removeData("_gridstack_node"),h.remove();else c._clearRemovingTimeout(h),l._temporaryRemoved?(m.removePositioningStyles(i),i.attr("data-gs-x",l._beforeDragX).attr("data-gs-y",l._beforeDragY).attr("data-gs-width",l.width).attr("data-gs-height",l.height),l.x=l._beforeDragX,l.y=l._beforeDragY,l._temporaryRemoved=!1,c.engine.addNode(l)):(m.removePositioningStyles(i),i.attr("data-gs-x",l.x).attr("data-gs-y",l.y).attr("data-gs-width",l.width).attr("data-gs-height",l.height));c._updateContainerHeight(),c._triggerChangeEvent(),c.engine.endUpdate();var n=i.find(".grid-stack");n.length&&"resizestop"===t.type&&(n.each(function(t,e){e.gridstack.onResizeHandler()}),i.find(".grid-stack-item").trigger("resizestop"),i.find(".grid-stack-item").trigger("gsresizestop")),"resizestop"===t.type&&c.$el.trigger("gsresizestop",i)}}var g,u,c=this;this.dd.draggable(h,{start:e,stop:i,drag:t}).resizable(h,{start:e,stop:i,resize:t}),(l.noMove||this.opts.disableDrag||this.opts.staticGrid)&&this.dd.draggable(h,"disable"),(l.noResize||this.opts.disableResize||this.opts.staticGrid)&&this.dd.resizable(h,"disable"),this._writeAttr(h,l)},o.prototype._prepareElement=function(t,e){e=void 0!==e&&e;(t=f(t)).addClass(this.opts.itemClass);var i=this._readAttr(t,{el:t.get(0),_grid:this});i=this.engine.addNode(i,e),t.data("_gridstack_node",i),this._prepareElementsByNode(t,i)},o.prototype._writeAttr=function(t,e){t=f(t),void 0!==(e=e||{}).x&&t.attr("data-gs-x",e.x),void 0!==e.y&&t.attr("data-gs-y",e.y),void 0!==e.width&&t.attr("data-gs-width",e.width),void 0!==e.height&&t.attr("data-gs-height",e.height),void 0!==e.autoPosition&&t.attr("data-gs-auto-position",!!e.autoPosition||null),void 0!==e.minWidth&&t.attr("data-gs-min-width",e.minWidth),void 0!==e.maxWidth&&t.attr("data-gs-max-width",e.maxWidth),void 0!==e.minHeight&&t.attr("data-gs-min-height",e.minHeight),void 0!==e.maxHeight&&t.attr("data-gs-max-height",e.maxHeight),void 0!==e.noResize&&t.attr("data-gs-no-resize",!!e.noResize||null),void 0!==e.noMove&&t.attr("data-gs-no-move",!!e.noMove||null),void 0!==e.locked&&t.attr("data-gs-locked",!!e.locked||null),void 0!==e.resizeHandles&&t.attr("data-gs-resize-handles",e.resizeHandles),void 0!==e.id&&t.attr("data-gs-id",e.id)},o.prototype._readAttr=function(t,e){return t=f(t),(e=e||{}).x=t.attr("data-gs-x"),e.y=t.attr("data-gs-y"),e.width=t.attr("data-gs-width"),e.height=t.attr("data-gs-height"),e.autoPosition=m.toBool(t.attr("data-gs-auto-position")),e.maxWidth=t.attr("data-gs-max-width"),e.minWidth=t.attr("data-gs-min-width"),e.maxHeight=t.attr("data-gs-max-height"),e.minHeight=t.attr("data-gs-min-height"),e.noResize=m.toBool(t.attr("data-gs-no-resize")),e.noMove=m.toBool(t.attr("data-gs-no-move")),e.locked=m.toBool(t.attr("data-gs-locked")),e.resizeHandles=t.attr("data-gs-resize-handles"),e.id=t.attr("data-gs-id"),e},o.prototype.setAnimation=function(t){t?this.$el.addClass("grid-stack-animate"):this.$el.removeClass("grid-stack-animate")},o.prototype.addWidget=function(t,e,i,n,o,a,s,r,d,h,l){return void 0!==e&&"object"!=typeof e?this.addWidget(t,{x:e,y:i,width:n,height:o,autoPosition:a,minWidth:s,maxWidth:r,minHeight:d,maxHeight:h,id:l}):(e=e||{},t=f(t),this._writeAttr(t,e),this.$el.append(t),this.makeWidget(t))},o.prototype.makeWidget=function(t){return t=f(t),this._prepareElement(t,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(!0),t.get(0)},o.prototype.willItFit=function(t,e,i,n,o){var a={x:t,y:e,width:i,height:n,autoPosition:o};return this.engine.canBePlacedWithRespectToHeight(a)},o.prototype.removeWidget=function(t,e){e=void 0===e||e;var i=(t=f(t)).data("_gridstack_node");i=i||this.engine.getNodeDataByDOMEl(t.get(0)),t.removeData("_gridstack_node"),this.engine.removeNode(i,e),this._triggerRemoveEvent(),this._triggerChangeEvent(!0)},o.prototype.removeAll=function(t){!1!==t&&this.engine.nodes.forEach(function(t){f(t.el).removeData("_gridstack_node")}),this.engine.removeAll(t),this._triggerRemoveEvent()},o.prototype.destroy=function(t){f(window).off("resize",this.onResizeHandler),this.disable(),void 0===t||t?this.$el.remove():(this.removeAll(!1),delete this.$el.get(0).gridstack),m.removeStylesheet(this._stylesId),this.engine&&(this.engine=null)},o.prototype.resizable=function(t,n){var o=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noResize=!n,i.noResize?o.dd.resizable(e,"disable"):o.dd.resizable(e,"enable"))}),this},o.prototype.movable=function(t,n){var o=this;return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.noMove=!n,i.noMove?(o.dd.draggable(e,"disable"),e.removeClass("ui-draggable-handle")):(o.dd.draggable(e,"enable"),e.addClass("ui-draggable-handle")))}),this},o.prototype.enableMove=function(t,e){this.movable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableDrag=!t)},o.prototype.enableResize=function(t,e){this.resizable(this.$el.children("."+this.opts.itemClass),t),e&&(this.opts.disableResize=!t)},o.prototype.disable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!1),this.resizable(this.$el.children("."+this.opts.itemClass),!1),this.$el.trigger("disable")},o.prototype.enable=function(){this.movable(this.$el.children("."+this.opts.itemClass),!0),this.resizable(this.$el.children("."+this.opts.itemClass),!0),this.$el.trigger("enable")},o.prototype.locked=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(i.locked=n||!1,e.attr("data-gs-locked",i.locked?"yes":null))}),this},o.prototype.maxHeight=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.maxHeight=n||!1,e.attr("data-gs-max-height",n)))}),this},o.prototype.minHeight=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.minHeight=n||!1,e.attr("data-gs-min-height",n)))}),this},o.prototype.maxWidth=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.maxWidth=n||!1,e.attr("data-gs-max-width",n)))}),this},o.prototype.minWidth=function(t,n){return(t=f(t)).each(function(t,e){var i=(e=f(e)).data("_gridstack_node");i&&(isNaN(n)||(i.minWidth=n||!1,e.attr("data-gs-min-width",n)))}),this},o.prototype._updateElement=function(t,e){var i=(t=f(t).first()).data("_gridstack_node");if(i){var n=this;n.engine.cleanNodes(),n.engine.beginUpdate(i),e.call(this,t,i),n._updateContainerHeight(),n._triggerChangeEvent(),n.engine.endUpdate()}},o.prototype.resize=function(t,i,n){this._updateElement(t,function(t,e){i=null!=i?i:e.width,n=null!=n?n:e.height,this.engine.moveNode(e,e.x,e.y,i,n)})},o.prototype.move=function(t,i,n){this._updateElement(t,function(t,e){i=null!=i?i:e.x,n=null!=n?n:e.y,this.engine.moveNode(e,i,n,e.width,e.height)})},o.prototype.update=function(t,i,n,o,a){this._updateElement(t,function(t,e){i=null!=i?i:e.x,n=null!=n?n:e.y,o=null!=o?o:e.width,a=null!=a?a:e.height,this.engine.moveNode(e,i,n,o,a)})},o.prototype.compact=function(){if(0!==this.engine.nodes.length){this.batchUpdate(),this.engine._sortNodes();var t=this.engine.nodes;this.engine.nodes=[],t.forEach(function(t){t.noMove||t.locked||(t.autoPosition=!0),this.engine.addNode(t,!1),t._dirty=!0},this),this.commit()}},o.prototype.verticalMargin=function(t,e){if(void 0===t)return this.opts.verticalMargin;var i=m.parseHeight(t);this.opts.verticalMarginUnit===i.unit&&this.opts.maxRow===i.height||(this.opts.verticalMarginUnit=i.unit,this.opts.verticalMargin=i.height,e||this._updateStyles())},o.prototype.cellHeight=function(t,e){if(void 0===t){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight)return this.opts.cellHeight;var i=this.$el.children("."+this.opts.itemClass).first(),n=i.attr("data-gs-height"),o=this.opts.verticalMargin;return Math.round((i.outerHeight()-(n-1)*o)/n)}var a=m.parseHeight(t);this.opts.cellHeightUnit===a.unit&&this.opts.cellHeight===a.height||(this.opts.cellHeightUnit=a.unit,this.opts.cellHeight=a.height,e||this._updateStyles())},o.prototype.cellWidth=function(){return Math.round(this.$el.outerWidth()/this.opts.column)},o.prototype.getCellFromPixel=function(t,e){var i=void 0!==e&&e?this.$el.offset():this.$el.position(),n=t.left-i.left,o=t.top-i.top,a=Math.floor(this.$el.width()/this.opts.column),s=Math.floor(this.$el.height()/parseInt(this.$el.attr("data-gs-current-row")));return{x:Math.floor(n/a),y:Math.floor(o/s)}},o.prototype.batchUpdate=function(){this.engine.batchUpdate()},o.prototype.commit=function(){this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()},o.prototype.isAreaEmpty=function(t,e,i,n){return this.engine.isAreaEmpty(t,e,i,n)},o.prototype.setStatic=function(t){this.opts.staticGrid=!0===t,this.enableMove(!t),this.enableResize(!t),this._setStaticClass()},o.prototype._setStaticClass=function(){var t="grid-stack-static";!0===this.opts.staticGrid?this.$el.addClass(t):this.$el.removeClass(t)},_.prototype._layoutsNodesChange=function(t){this._layouts&&!this._ignoreLayoutsNodeChange&&this._layouts.forEach(function(n,o){n&&o!==this.column&&(o<this.column?this._layouts[o]=void 0:t.forEach(function(e){var t=n.find(function(t){return t._id===e._id});if(t){var i=o/this.column;e.y!==e._origY&&(t.y+=e.y-e._origY),e.x!==e._origX&&(t.x=Math.round(e.x*i)),e.width!==e._origW&&(t.width=Math.round(e.width*i))}},this))},this)},_.prototype._updateNodeWidths=function(e,i,n){if(this.nodes.length&&e!==i){var o=[this.nodes.length];if(this.nodes.forEach(function(t,e){o[e]={x:t.x,y:t.y,width:t.width,_id:t._id}}),this._layouts=this._layouts||[],this._layouts[e]=o,1===i&&n&&n.length){var a=0;n.forEach(function(t){t.x=0,t.width=1,t.y=Math.max(t.y,a),a=t.y+t.height})}else n=m.sort(this.nodes,-1,e);var t=this._layouts[i]||[],s=this._layouts.length-1;0===t.length&&e<i&&i<s&&(t=this._layouts[s]||[]).length&&(e=s,t.forEach(function(e){var t=n.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(n[t].x=e.x,n[t].y=e.y,n[t].width=e.width)}),t=[]);var r=[];t.forEach(function(e){var t=n.findIndex(function(t){return t&&t._id===e._id});-1!==t&&(n[t].x=e.x,n[t].y=e.y,n[t].width=e.width,r.push(n[t]),n[t]=null)});var d=i/e;n.forEach(function(t){t&&(t.x=1===i?0:Math.round(t.x*d),t.width=1!==i&&1!==e&&Math.round(t.width*d)||1,r.push(t))}),r=m.sort(r,-1,i),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],r.forEach(function(t){this.addNode(t,!1),t._dirty=!0},this),this.commit(),delete this._ignoreLayoutsNodeChange}},_.prototype._saveInitial=function(){this.nodes.forEach(function(t){t._origX=t.x,t._origY=t.y,t._origW=t.width,t._origH=t.height,delete t._dirty})},o.prototype.column=function(t,e){if(void 0===t)return this.opts.column;if(this.opts.column!==t){var n,i=this.opts.column;if(1===t?this._prevColumn=i:delete this._prevColumn,this.$el.removeClass("grid-stack-"+i),this.$el.addClass("grid-stack-"+t),this.opts.column=this.engine.column=t,!0!==e)this.opts.oneColumnModeDomSort&&1===t&&(n=[],this.$el.children("."+this.opts.itemClass).each(function(t,e){var i=f(e).data("_gridstack_node");i&&n.push(i)}),n.length||(n=void 0)),this.engine._updateNodeWidths(i,t,n),this.engine._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this.engine._ignoreLayoutsNodeChange}},o.prototype.float=function(t){if(void 0===t)return this.opts.float||!1;this.opts.float!==t&&(this.opts.float=this.engine.float=t||!1,t||(this.engine._packNodes(),this.engine._notify(),this._triggerChangeEvent()))},o.prototype.getRow=function(){return this.engine.getRow()},o.prototype.on=function(t,e){"change"===t||"added"===t||"removed"===t?(this._gsEventHandler=this._gsEventHandler||{},this._gsEventHandler[t]=function(t){e(t,t.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):this.$el.on(t,e)},o.prototype.off=function(t){"change"===t||"added"===t||"removed"===t?this._gsEventHandler&&this._gsEventHandler[t]&&(this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t]):this.$el.off(t)},o.prototype.setGridWidth=e(o.prototype.column,"setGridWidth","column","v0.5.3"),o.prototype.setColumn=e(o.prototype.column,"setColumn","column","v0.6.4"),_.prototype.getGridHeight=e(_.prototype.getRow,"getGridHeight","getRow","v1.0.0"),t.GridStack=o,t.GridStack.Utils=m,t.GridStack.Engine=_,t.GridStack.DragDropPlugin=v,o.init=function(t,e){var i=f(e=e||".grid-stack").get(0);if(i)return i.gridstack||(i.gridstack=new o(i,t)),i.gridstack},o.initAll=function(i,t){var n=[];return f(t=t||".grid-stack").each(function(t,e){e.gridstack||(e.gridstack=new o(e,i)),n.push(e.gridstack)}),n},t.GridStack}(window.jQuery,window);
//# sourceMappingURL=gridstack.min.map

@@ -5,3 +5,3 @@ /*! jQuery UI - v1.12.1 - 2019-11-20

* Copyright jQuery Foundation and other contributors; Licensed MIT @preserve*/
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(w){w.ui=w.ui||{};w.ui.version="1.12.1";var o,i=0,a=Array.prototype.slice;w.cleanData=(o=w.cleanData,function(t){var e,i,s;for(s=0;null!=(i=t[s]);s++)try{(e=w._data(i,"events"))&&e.remove&&w(i).triggerHandler("remove")}catch(t){}o(t)}),w.widget=function(t,i,e){var s,o,n,r={},a=t.split(".")[0],h=a+"-"+(t=t.split(".")[1]);return e||(e=i,i=w.Widget),w.isArray(e)&&(e=w.extend.apply(null,[{}].concat(e))),w.expr[":"][h.toLowerCase()]=function(t){return!!w.data(t,h)},w[a]=w[a]||{},s=w[a][t],o=w[a][t]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},w.extend(o,s,{version:e.version,_proto:w.extend({},e),_childConstructors:[]}),(n=new i).options=w.widget.extend({},n.options),w.each(e,function(e,s){function o(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}w.isFunction(s)?r[e]=function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=n,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:r[e]=s}),o.prototype=w.widget.extend(n,{widgetEventPrefix:s&&n.widgetEventPrefix||t},r,{constructor:o,namespace:a,widgetName:t,widgetFullName:h}),s?(w.each(s._childConstructors,function(t,e){var i=e.prototype;w.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete s._childConstructors):i._childConstructors.push(o),w.widget.bridge(t,o),o},w.widget.extend=function(t){for(var e,i,s=a.call(arguments,1),o=0,n=s.length;o<n;o++)for(e in s[o])i=s[o][e],s[o].hasOwnProperty(e)&&void 0!==i&&(w.isPlainObject(i)?t[e]=w.isPlainObject(t[e])?w.widget.extend({},t[e],i):w.widget.extend({},i):t[e]=i);return t},w.widget.bridge=function(n,e){var r=e.prototype.widgetFullName||n;w.fn[n]=function(i){var t="string"==typeof i,s=a.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=w.data(this,r);return"instance"===i?(o=e,!1):e?w.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:w.error("no such method '"+i+"' for "+n+" widget instance"):w.error("cannot call methods on "+n+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(s.length&&(i=w.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=w.data(this,r);t?(t.option(i||{}),t._init&&t._init()):w.data(this,r,new e(i,this))})),o}},w.Widget=function(){},w.Widget._childConstructors=[],w.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=w(e||this.defaultElement||this)[0],this.element=w(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=w(),this.hoverable=w(),this.focusable=w(),this.classesElementLookup={},e!==this&&(w.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=w(e.style?e.ownerDocument:e.document||e),this.window=w(this.document[0].defaultView||this.document[0].parentWindow)),this.options=w.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:w.noop,_create:w.noop,_init:w.noop,destroy:function(){var i=this;this._destroy(),w.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:w.noop,widget:function(){return this.element},option:function(t,e){var i,s,o,n=t;if(0===arguments.length)return w.widget.extend({},this.options);if("string"==typeof t)if(n={},t=(i=t.split(".")).shift(),i.length){for(s=n[t]=w.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)s[i[o]]=s[i[o]]||{},s=s[i[o]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];n[t]=e}return this._setOptions(n),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=w(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var n=[],r=this;function t(t,e){var i,s;for(s=0;s<t.length;s++)i=r.classesElementLookup[t[s]]||w(),i=o.add?w(w.unique(i.get().concat(o.element.get()))):w(i.not(o.element).get()),r.classesElementLookup[t[s]]=i,n.push(t[s]),e&&o.classes[t[s]]&&n.push(o.classes[t[s]])}return o=w.extend({element:this.element,classes:this.options.classes||{}},o),this._on(o.element,{remove:"_untrackClassesElement"}),o.keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(i){var s=this;w.each(s.classesElementLookup,function(t,e){-1!==w.inArray(i.target,e)&&(s.classesElementLookup[t]=w(e.not(i.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var o="string"==typeof t||null===t,n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};return n.element.toggleClass(this._classes(n),s),this},_on:function(r,a,t){var h,l=this;"boolean"!=typeof r&&(t=a,a=r,r=!1),t?(a=h=w(a),this.bindings=this.bindings.add(a)):(t=a,a=this.element,h=this.widget()),w.each(t,function(t,e){function i(){if(r||!0!==l.options.disabled&&!w(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||w.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),o=s[1]+l.eventNamespace,n=s[2];n?h.on(o,n,i):a.on(o,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e).off(e),this.bindings=w(this.bindings.not(t).get()),this.focusable=w(this.focusable.not(t).get()),this.hoverable=w(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(w(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(w(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(w(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,o,n=this.options[t];if(i=i||{},(e=w.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(s in o)s in e||(e[s]=o[s]);return this.element.trigger(e,i),!(w.isFunction(n)&&!1===n.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},w.each({show:"fadeIn",hide:"fadeOut"},function(n,r){w.Widget.prototype["_"+n]=function(e,t,i){var s;"string"==typeof t&&(t={effect:t});var o=t?!0===t||"number"==typeof t?r:t.effect||r:n;"number"==typeof(t=t||{})&&(t={duration:t}),s=!w.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&w.effects&&w.effects.effect[o]?e[n](t):o!==n&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){w(this)[n](),i&&i.call(e[0]),t()})}});w.widget,w.extend(w.expr[":"],{data:w.expr.createPseudo?w.expr.createPseudo(function(e){return function(t){return!!w.data(t,e)}}):function(t,e,i){return!!w.data(t,i[3])}}),w.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),w.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=w(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&o.length?o:w(this[0].ownerDocument||document)},w.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var t,n=!1;w(document).on("mouseup",function(){n=!1});w.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===w.data(t.target,e.widgetName+".preventClickEvent"))return w.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&w(t.target).closest(this.options.cancel).length;return!(i&&!s&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===w.data(t.target,this.widgetName+".preventClickEvent")&&w.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0))}},_mouseMove:function(t){if(this._mouseMoved){if(w.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)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=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&w.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),w.ui.plugin={add:function(t,e,i){var s,o=w.ui[t].prototype;for(s in i)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var o,n=t.plugins[e];if(n&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<n.length;o++)t.options[n[o][0]]&&n[o][1].apply(t.element,i)}},w.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return(i=i||e.body).nodeName||(i=e.body),i},w.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&w(t).trigger("blur")};w.widget("ui.draggable",w.ui.mouse,{version:"1.12.1",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._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<w(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=w(this);return w("<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 e=w.ui.safeActiveElement(this.document[0]);w(t.target).closest(e).length||w.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),w.ui.ddmanager&&(w.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=0<this.helper.parents().filter(function(){return"fixed"===w(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),w.ui.ddmanager&&!e.dropBehaviour&&w.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),w.ui.ddmanager&&w.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){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:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){var i=this._uiHash();if(!1===this._trigger("drag",t,i))return this._mouseUp(new w.Event("mouseup",t)),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",w.ui.ddmanager&&w.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return w.ui.ddmanager&&!this.options.dropBehaviour&&(i=w.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||w.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?w(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),w.ui.ddmanager&&w.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),w.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new w.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!w(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=w.isFunction(e.helper),s=i?w(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&s[0]===this.element[0]&&this._setPositionRelative(),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_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(" ")),w.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(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&w.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 t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?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,e,i,s=this.options,o=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=w(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,w(o).width()-this.helperProportions.width-this.margins.left,(w(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[w(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,w(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,w(window).scrollLeft()+w(window).width()-this.helperProportions.width-this.margins.left,w(window).scrollTop()+(w(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.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:e.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(t,e){var i,s,o,n,r=this.options,a=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(s=this.relativeContainer.offset(),[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),r.grid&&(o=r.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,l=i?o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3]?o:o-this.offset.click.top>=i[1]?o-r.grid[1]:o+r.grid[1]:o,n=r.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,h=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]:n),"y"===r.axis&&(h=this.originalPageX),"x"===r.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:a?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:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),w.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),w.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),w.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=w.extend({},t,{item:i.element});i.sortables=[],w(i.options.connectToSortable).each(function(){var t=w(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=w.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,w.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,o){w.each(o.sortables,function(){var t=!1,e=this;e.positionAbs=o.positionAbs,e.helperProportions=o.helperProportions,e.offset.click=o.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,w.each(o.sortables,function(){return this.positionAbs=o.positionAbs,this.helperProportions=o.helperProportions,this.offset.click=o.offset.click,this!==e&&this._intersectsWith(this.containerCache)&&w.contains(e.element[0],this.element[0])&&(t=!1),t})),t?(e.isOver||(e.isOver=1,o._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=o.offset.click.top,e.offset.click.left=o.offset.click.left,e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top,o._trigger("toSortable",i),o.dropped=e.element,w.each(o.sortables,function(){this.refreshPositions()}),o.currentItem=o.element,e.fromOutside=o),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(o._parent),o._refreshOffsets(i),s.position=o._generatePosition(i,!0),o._trigger("fromSortable",i),o.dropped=!1,w.each(o.sortables,function(){this.refreshPositions()}))})}}),w.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=w("body"),o=i.options;s.css("cursor")&&(o._cursor=s.css("cursor")),s.css("cursor",o.cursor)},stop:function(t,e,i){var s=i.options;s._cursor&&w("body").css("cursor",s._cursor)}}),w.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=w(e.helper),o=i.options;s.css("opacity")&&(o._opacity=s.css("opacity")),s.css("opacity",o.opacity)},stop:function(t,e,i){var s=i.options;s._opacity&&w(e.helper).css("opacity",s._opacity)}}),w.ui.plugin.add("draggable","scroll",{start:function(t,e,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,e,i){var s=i.options,o=!1,n=i.scrollParentNotHidden[0],r=i.document[0];n!==r&&"HTML"!==n.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+n.offsetHeight-t.pageY<s.scrollSensitivity?n.scrollTop=o=n.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(n.scrollTop=o=n.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+n.offsetWidth-t.pageX<s.scrollSensitivity?n.scrollLeft=o=n.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(n.scrollLeft=o=n.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-w(r).scrollTop()<s.scrollSensitivity?o=w(r).scrollTop(w(r).scrollTop()-s.scrollSpeed):w(window).height()-(t.pageY-w(r).scrollTop())<s.scrollSensitivity&&(o=w(r).scrollTop(w(r).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-w(r).scrollLeft()<s.scrollSensitivity?o=w(r).scrollLeft(w(r).scrollLeft()-s.scrollSpeed):w(window).width()-(t.pageX-w(r).scrollLeft())<s.scrollSensitivity&&(o=w(r).scrollLeft(w(r).scrollLeft()+s.scrollSpeed)))),!1!==o&&w.ui.ddmanager&&!s.dropBehaviour&&w.ui.ddmanager.prepareOffsets(i,t)}}),w.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],w(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=w(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){var s,o,n,r,a,h,l,p,c,d,u=i.options,f=u.snapTolerance,g=e.offset.left,m=g+i.helperProportions.width,_=e.offset.top,v=_+i.helperProportions.height;for(c=i.snapElements.length-1;0<=c;c--)h=(a=i.snapElements[c].left-i.margins.left)+i.snapElements[c].width,p=(l=i.snapElements[c].top-i.margins.top)+i.snapElements[c].height,m<a-f||h+f<g||v<l-f||p+f<_||!w.contains(i.snapElements[c].item.ownerDocument,i.snapElements[c].item)?(i.snapElements[c].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,w.extend(i._uiHash(),{snapItem:i.snapElements[c].item})),i.snapElements[c].snapping=!1):("inner"!==u.snapMode&&(s=Math.abs(l-v)<=f,o=Math.abs(p-_)<=f,n=Math.abs(a-m)<=f,r=Math.abs(h-g)<=f,s&&(e.position.top=i._convertPositionTo("relative",{top:l-i.helperProportions.height,left:0}).top),o&&(e.position.top=i._convertPositionTo("relative",{top:p,left:0}).top),n&&(e.position.left=i._convertPositionTo("relative",{top:0,left:a-i.helperProportions.width}).left),r&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h}).left)),d=s||o||n||r,"outer"!==u.snapMode&&(s=Math.abs(l-_)<=f,o=Math.abs(p-v)<=f,n=Math.abs(a-g)<=f,r=Math.abs(h-m)<=f,s&&(e.position.top=i._convertPositionTo("relative",{top:l,left:0}).top),o&&(e.position.top=i._convertPositionTo("relative",{top:p-i.helperProportions.height,left:0}).top),n&&(e.position.left=i._convertPositionTo("relative",{top:0,left:a}).left),r&&(e.position.left=i._convertPositionTo("relative",{top:0,left:h-i.helperProportions.width}).left)),!i.snapElements[c].snapping&&(s||o||n||r||d)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,w.extend(i._uiHash(),{snapItem:i.snapElements[c].item})),i.snapElements[c].snapping=s||o||n||r||d)}}),w.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,o=i.options,n=w.makeArray(w(o.stack)).sort(function(t,e){return(parseInt(w(t).css("zIndex"),10)||0)-(parseInt(w(e).css("zIndex"),10)||0)});n.length&&(s=parseInt(w(n[0]).css("zIndex"),10)||0,w(n).each(function(t){w(this).css("zIndex",s+t)}),this.css("zIndex",s+n.length))}}),w.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){var s=w(e.helper),o=i.options;s.css("zIndex")&&(o._zIndex=s.css("zIndex")),s.css("zIndex",o.zIndex)},stop:function(t,e,i){var s=i.options;s._zIndex&&w(e.helper).css("zIndex",s._zIndex)}});w.ui.draggable;w.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept=w.isFunction(i)?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t||(t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){w.ui.ddmanager.droppables[t]=w.ui.ddmanager.droppables[t]||[],w.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=w.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){if("accept"===t)this.accept=w.isFunction(e)?e:function(t){return t.is(e)};else if("scope"===t){var i=w.ui.ddmanager.droppables[this.options.scope];this._splice(i),this._addToManager(e)}this._super(t,e)},_activate:function(t){var e=w.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=w.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=w.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=w.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||w.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=w(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&h(i,w.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var h=w.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var o=(t.positionAbs||t.position.absolute).left+t.margins.left,n=(t.positionAbs||t.position.absolute).top+t.margins.top,r=o+t.helperProportions.width,a=n+t.helperProportions.height,h=e.offset.left,l=e.offset.top,p=h+e.proportions().width,c=l+e.proportions().height;switch(i){case"fit":return h<=o&&r<=p&&l<=n&&a<=c;case"intersect":return h<o+t.helperProportions.width/2&&r-t.helperProportions.width/2<p&&l<n+t.helperProportions.height/2&&a-t.helperProportions.height/2<c;case"pointer":return d(s.pageY,l,e.proportions().height)&&d(s.pageX,h,e.proportions().width);case"touch":return(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a)&&(h<=o&&o<=p||h<=r&&r<=p||o<h&&p<r);default:return!1}};function d(t,e,i){return e<=t&&t<e+i}!(w.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,o=w.ui.ddmanager.droppables[t.options.scope]||[],n=e?e.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<o.length;i++)if(!(o[i].options.disabled||t&&!o[i].accept.call(o[i].element[0],t.currentItem||t.element))){for(s=0;s<r.length;s++)if(r[s]===o[i].element[0]){o[i].proportions().height=0;continue t}o[i].visible="none"!==o[i].element.css("display"),o[i].visible&&("mousedown"===n&&o[i]._activate.call(o[i],e),o[i].offset=o[i].element.offset(),o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return w.each((w.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&h(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!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,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||w.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,r){n.options.refreshPositions&&w.ui.ddmanager.prepareOffsets(n,r),w.each(w.ui.ddmanager.droppables[n.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var t,e,i,s=h(n,this,this.options.tolerance,r),o=!s&&this.isover?"isout":s&&!this.isover?"isover":null;o&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return w(this).droppable("instance").options.scope===e})).length&&((t=w(i[0]).droppable("instance")).greedyChild="isover"===o)),t&&"isover"===o&&(t.isover=!1,t.isout=!0,t._out.call(t,r)),this[o]=!0,this["isout"===o?"isover":"isout"]=!1,this["isover"===o?"_over":"_out"].call(this,r),t&&"isout"===o&&(t.isout=!1,t.isover=!0,t._over.call(t,r)))}})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||w.ui.ddmanager.prepareOffsets(t,e)}})!==w.uiBackCompat&&w.widget("ui.droppable",w.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});w.ui.droppable;w.widget("ui.resizable",w.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},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(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===w(t).css("overflow"))return!1;var i,s=e&&"left"===e?"scrollLeft":"scrollTop";return 0<t[s]||(t[s]=1,i=0<t[s],t[s]=0,i)},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),w.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(w("<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,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",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(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&w(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();function t(t){w(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var t,e,i,s,o,n=this.options,r=this;if(this.handles=n.handles||(w(".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=w(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=w.trim(i[e])),o=w("<div>"),this._addClass(o,"ui-resizable-handle "+s),o.css({zIndex:n.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(o);this._renderAxis=function(t){var e,i,s,o;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=w(this.handles[e]),this._on(this.handles[e],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=w(this.handles[e],this.element),o=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(s,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),n.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=w(this.handles[e])[0])!==t.target&&!w.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,o=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),o.containment&&(e+=w(o.containment).scrollLeft()||0,i+=w(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=w(".ui-resizable-"+this.axis).css("cursor"),w("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,o=this.axis,n=t.pageX-s.left||0,r=t.pageY-s.top||0,a=this._change[o];return this._updatePrevProperties(),a&&(e=a.apply(this,[t,n,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),i=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),w.isEmptyObject(i)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,o,n,r,a,h=this.options,l=this;return this._helper&&(s=(i=(e=this._proportionallyResizeElements).length&&/textarea/i.test(e[0].nodeName))&&this._hasScroll(e[0],"left")?0:l.sizeDiff.height,o=i?0:l.sizeDiff.width,n={width:l.helper.width()-o,height:l.helper.height()-s},r=parseFloat(l.element.css("left"))+(l.position.left-l.originalPosition.left)||null,a=parseFloat(l.element.css("top"))+(l.position.top-l.originalPosition.top)||null,h.animate||this.element.css(w.extend(n,{top:a,left:r})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!h.animate&&this._proportionallyResize()),w("body").css("cursor","auto"),this._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 t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,o,n,r=this.options;n={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:1/0,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,s=n.minWidth/this.aspectRatio,i=n.maxHeight*this.aspectRatio,o=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),s>n.minHeight&&(n.minHeight=s),i<n.maxWidth&&(n.maxWidth=i),o<n.maxHeight&&(n.maxHeight=o)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,n=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),p=/nw|ne|n/.test(i);return n&&(t.width=e.minWidth),r&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),n&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),r&&p&&(t.top=h-e.minHeight),o&&p&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(o[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||w("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return w.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return w.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return w.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return w.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){w.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,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}}}),w.ui.plugin.add("resizable","animate",{stop:function(e){var i=w(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),n=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,a={width:i.size.width-r,height:i.size.height-n},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,l=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(w.extend(a,l&&h?{top:l,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&w(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),w.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,o,n,r,a=w(this).resizable("instance"),h=a.options,l=a.element,p=h.containment,c=p instanceof w?p.get(0):/parent/.test(p)?l.parent().get(0):p;c&&(a.containerElement=w(c),/document/.test(p)||p===document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:w(document),left:0,top:0,width:w(document).width(),height:w(document).height()||document.body.parentNode.scrollHeight}):(i=w(c),s=[],w(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=a._num(i.css("padding"+e))}),a.containerOffset=i.offset(),a.containerPosition=i.position(),a.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=a.containerOffset,e=a.containerSize.height,o=a.containerSize.width,n=a._hasScroll(c,"left")?c.scrollWidth:o,r=a._hasScroll(c)?c.scrollHeight:e,a.parentData={element:c,left:t.left,top:t.top,width:n,height:r}))},resize:function(t){var e,i,s,o,n=w(this).resizable("instance"),r=n.options,a=n.containerOffset,h=n.position,l=n._aspectRatio||t.shiftKey,p={top:0,left:0},c=n.containerElement,d=!0;c[0]!==document&&/static/.test(c.css("position"))&&(p=a),h.left<(n._helper?a.left:0)&&(n.size.width=n.size.width+(n._helper?n.position.left-a.left:n.position.left-p.left),l&&(n.size.height=n.size.width/n.aspectRatio,d=!1),n.position.left=r.helper?a.left:0),h.top<(n._helper?a.top:0)&&(n.size.height=n.size.height+(n._helper?n.position.top-a.top:n.position.top),l&&(n.size.width=n.size.height*n.aspectRatio,d=!1),n.position.top=n._helper?a.top:0),s=n.containerElement.get(0)===n.element.parent().get(0),o=/relative|absolute/.test(n.containerElement.css("position")),s&&o?(n.offset.left=n.parentData.left+n.position.left,n.offset.top=n.parentData.top+n.position.top):(n.offset.left=n.element.offset().left,n.offset.top=n.element.offset().top),e=Math.abs(n.sizeDiff.width+(n._helper?n.offset.left-p.left:n.offset.left-a.left)),i=Math.abs(n.sizeDiff.height+(n._helper?n.offset.top-p.top:n.offset.top-a.top)),e+n.size.width>=n.parentData.width&&(n.size.width=n.parentData.width-e,l&&(n.size.height=n.size.width/n.aspectRatio,d=!1)),i+n.size.height>=n.parentData.height&&(n.size.height=n.parentData.height-i,l&&(n.size.width=n.size.height*n.aspectRatio,d=!1)),d||(n.position.left=n.prevPosition.left,n.position.top=n.prevPosition.top,n.size.width=n.prevSize.width,n.size.height=n.prevSize.height)},stop:function(){var t=w(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,o=t.containerElement,n=w(t.helper),r=n.offset(),a=n.outerWidth()-t.sizeDiff.width,h=n.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(o.css("position"))&&w(this).css({left:r.left-s.left-i.left,width:a,height:h}),t._helper&&!e.animate&&/static/.test(o.css("position"))&&w(this).css({left:r.left-s.left-i.left,width:a,height:h})}}),w.ui.plugin.add("resizable","alsoResize",{start:function(){var t=w(this).resizable("instance").options;w(t.alsoResize).each(function(){var t=w(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=w(this).resizable("instance"),s=e.options,o=e.originalSize,n=e.originalPosition,r={height:e.size.height-o.height||0,width:e.size.width-o.width||0,top:e.position.top-n.top||0,left:e.position.left-n.left||0};w(s.alsoResize).each(function(){var t=w(this),s=w(this).data("ui-resizable-alsoresize"),o={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];w.each(e,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&0<=i&&(o[e]=i||null)}),t.css(o)})},stop:function(){w(this).removeData("ui-resizable-alsoresize")}}),w.ui.plugin.add("resizable","ghost",{start:function(){var t=w(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==w.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=w(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=w(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),w.ui.plugin.add("resizable","grid",{resize:function(){var t,e=w(this).resizable("instance"),i=e.options,s=e.size,o=e.originalSize,n=e.originalPosition,r=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=a[0]||1,l=a[1]||1,p=Math.round((s.width-o.width)/h)*h,c=Math.round((s.height-o.height)/l)*l,d=o.width+p,u=o.height+c,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<u,m=i.minWidth&&i.minWidth>d,_=i.minHeight&&i.minHeight>u;i.grid=a,m&&(d+=h),_&&(u+=l),f&&(d-=h),g&&(u-=l),/^(se|s|e)$/.test(r)?(e.size.width=d,e.size.height=u):/^(ne)$/.test(r)?(e.size.width=d,e.size.height=u,e.position.top=n.top-c):/^(sw)$/.test(r)?(e.size.width=d,e.size.height=u,e.position.left=n.left-p):((u-l<=0||d-h<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<u-l?(e.size.height=u,e.position.top=n.top-c):(u=l-t.height,e.size.height=u,e.position.top=n.top+o.height-u),0<d-h?(e.size.width=d,e.position.left=n.left-p):(d=h-t.width,e.size.width=d,e.position.left=n.left+o.width-d))}});w.ui.resizable});
!function(b){b.ui=b.ui||{};var t=b.ui.version="1.12.1",i=0,a=Array.prototype.slice;b.cleanData=function(o){return function(t){var e,i,s;for(s=0;(i=t[s])!=null;s++){try{e=b._data(i,"events");if(e&&e.remove){b(i).triggerHandler("remove")}}catch(t){}}o(t)}}(b.cleanData),b.widget=function(t,i,e){var s,o,n;var r={};var a=t.split(".")[0];t=t.split(".")[1];var l=a+"-"+t;if(!e){e=i;i=b.Widget}if(b.isArray(e)){e=b.extend.apply(null,[{}].concat(e))}b.expr[":"][l.toLowerCase()]=function(t){return!!b.data(t,l)};b[a]=b[a]||{};s=b[a][t];o=b[a][t]=function(t,e){if(!this._createWidget){return new o(t,e)}if(arguments.length){this._createWidget(t,e)}};b.extend(o,s,{version:e.version,_proto:b.extend({},e),_childConstructors:[]});n=new i;n.options=b.widget.extend({},n.options);b.each(e,function(e,n){if(!b.isFunction(n)){r[e]=n;return}r[e]=function(){function s(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}return function(){var t=this._super;var e=this._superApply;var i;this._super=s;this._superApply=o;i=n.apply(this,arguments);this._super=t;this._superApply=e;return i}}()});o.prototype=b.widget.extend(n,{widgetEventPrefix:s?n.widgetEventPrefix||t:t},r,{constructor:o,namespace:a,widgetName:t,widgetFullName:l});if(s){b.each(s._childConstructors,function(t,e){var i=e.prototype;b.widget(i.namespace+"."+i.widgetName,o,e._proto)});delete s._childConstructors}else{i._childConstructors.push(o)}b.widget.bridge(t,o);return o},b.widget.extend=function(t){var e=a.call(arguments,1);var i=0;var s=e.length;var o;var n;for(;i<s;i++){for(o in e[i]){n=e[i][o];if(e[i].hasOwnProperty(o)&&n!==undefined){if(b.isPlainObject(n)){t[o]=b.isPlainObject(t[o])?b.widget.extend({},t[o],n):b.widget.extend({},n)}else{t[o]=n}}}}return t},b.widget.bridge=function(n,e){var r=e.prototype.widgetFullName||n;b.fn[n]=function(i){var t=typeof i==="string";var s=a.call(arguments,1);var o=this;if(t){if(!this.length&&i==="instance"){o=undefined}else{this.each(function(){var t;var e=b.data(this,r);if(i==="instance"){o=e;return false}if(!e){return b.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+i+"'")}if(!b.isFunction(e[i])||i.charAt(0)==="_"){return b.error("no such method '"+i+"' for "+n+" widget instance")}t=e[i].apply(e,s);if(t!==e&&t!==undefined){o=t&&t.jquery?o.pushStack(t.get()):t;return false}})}}else{if(s.length){i=b.widget.extend.apply(null,[i].concat(s))}this.each(function(){var t=b.data(this,r);if(t){t.option(i||{});if(t._init){t._init()}}else{b.data(this,r,new e(i,this))}})}return o}},b.Widget=function(){},b.Widget._childConstructors=[],b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(t,e){e=b(e||this.defaultElement||this)[0];this.element=b(e);this.uuid=i++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=b();this.hoverable=b();this.focusable=b();this.classesElementLookup={};if(e!==this){b.data(e,this.widgetFullName,this);this._on(true,this.element,{remove:function(t){if(t.target===e){this.destroy()}}});this.document=b(e.style?e.ownerDocument:e.document||e);this.window=b(this.document[0].defaultView||this.document[0].parentWindow)}this.options=b.widget.extend({},this.options,this._getCreateOptions(),t);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){var i=this;this._destroy();b.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:b.noop,widget:function(){return this.element},option:function(t,e){var i=t;var s;var o;var n;if(arguments.length===0){return b.widget.extend({},this.options)}if(typeof t==="string"){i={};s=t.split(".");t=s.shift();if(s.length){o=i[t]=b.widget.extend({},this.options[t]);for(n=0;n<s.length-1;n++){o[s[n]]=o[s[n]]||{};o=o[s[n]]}t=s.pop();if(arguments.length===1){return o[t]===undefined?null:o[t]}o[t]=e}else{if(arguments.length===1){return this.options[t]===undefined?null:this.options[t]}i[t]=e}}this._setOptions(i);return this},_setOptions:function(t){var e;for(e in t){this._setOption(e,t[e])}return this},_setOption:function(t,e){if(t==="classes"){this._setOptionClasses(e)}this.options[t]=e;if(t==="disabled"){this._setOptionDisabled(e)}return this},_setOptionClasses:function(t){var e,i,s;for(e in t){s=this.classesElementLookup[e];if(t[e]===this.options.classes[e]||!s||!s.length){continue}i=b(s.get());this._removeClass(s,e);i.addClass(this._classes({element:i,keys:e,classes:t,add:true}))}},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t);if(t){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_classes:function(o){var n=[];var r=this;o=b.extend({element:this.element,classes:this.options.classes||{}},o);function t(t,e){var i,s;for(s=0;s<t.length;s++){i=r.classesElementLookup[t[s]]||b();if(o.add){i=b(b.unique(i.get().concat(o.element.get())))}else{i=b(i.not(o.element).get())}r.classesElementLookup[t[s]]=i;n.push(t[s]);if(e&&o.classes[t[s]]){n.push(o.classes[t[s]])}}}this._on(o.element,{remove:"_untrackClassesElement"});if(o.keys){t(o.keys.match(/\S+/g)||[],true)}if(o.extra){t(o.extra.match(/\S+/g)||[])}return n.join(" ")},_untrackClassesElement:function(i){var s=this;b.each(s.classesElementLookup,function(t,e){if(b.inArray(i.target,e)!==-1){s.classesElementLookup[t]=b(e.not(i.target).get())}})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,false)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,true)},_toggleClass:function(t,e,i,s){s=typeof s==="boolean"?s:i;var o=typeof t==="string"||t===null,n={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:s};n.element.toggleClass(this._classes(n),s);return this},_on:function(r,a,t){var l;var h=this;if(typeof r!=="boolean"){t=a;a=r;r=false}if(!t){t=a;a=this.element;l=this.widget()}else{a=l=b(a);this.bindings=this.bindings.add(a)}b.each(t,function(t,e){function i(){if(!r&&(h.options.disabled===true||b(this).hasClass("ui-state-disabled"))){return}return(typeof e==="string"?h[e]:e).apply(h,arguments)}if(typeof e!=="string"){i.guid=e.guid=e.guid||i.guid||b.guid++}var s=t.match(/^([\w:-]*)\s*(.*)$/);var o=s[1]+h.eventNamespace;var n=s[2];if(n){l.on(o,n,i)}else{a.on(o,i)}})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;t.off(e).off(e);this.bindings=b(this.bindings.not(t).get());this.focusable=b(this.focusable.not(t).get());this.hoverable=b(this.hoverable.not(t).get())},_delay:function(t,e){function i(){return(typeof t==="string"?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t);this._on(t,{mouseenter:function(t){this._addClass(b(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t);this._on(t,{focusin:function(t){this._addClass(b(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(b(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,o;var n=this.options[t];i=i||{};e=b.Event(e);e.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase();e.target=this.element[0];o=e.originalEvent;if(o){for(s in o){if(!(s in e)){e[s]=o[s]}}}this.element.trigger(e,i);return!(b.isFunction(n)&&n.apply(this.element[0],[e].concat(i))===false||e.isDefaultPrevented())}},b.each({show:"fadeIn",hide:"fadeOut"},function(n,r){b.Widget.prototype["_"+n]=function(e,t,i){if(typeof t==="string"){t={effect:t}}var s;var o=!t?n:t===true||typeof t==="number"?r:t.effect||r;t=t||{};if(typeof t==="number"){t={duration:t}}s=!b.isEmptyObject(t);t.complete=i;if(t.delay){e.delay(t.delay)}if(s&&b.effects&&b.effects.effect[o]){e[n](t)}else if(o!==n&&e[o]){e[o](t.duration,t.easing,i)}else{e.queue(function(t){b(this)[n]();if(i){i.call(e[0])}t()})}}});var e=b.widget,s=b.extend(b.expr[":"],{data:b.expr.createPseudo?b.expr.createPseudo(function(e){return function(t){return!!b.data(t,e)}}):function(t,e,i){return!!b.data(t,i[3])}}),o=b.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),n=b.fn.scrollParent=function(t){var e=this.css("position"),i=e==="absolute",s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var t=b(this);if(i&&t.css("position")==="static"){return false}return s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return e==="fixed"||!o.length?b(this[0].ownerDocument||document):o},r=b.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),l=false;b(document).on("mouseup",function(){l=false});var h=b.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(true===b.data(t.target,e.widgetName+".preventClickEvent")){b.removeData(t.target,e.widgetName+".preventClickEvent");t.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(t){if(l){return}this._mouseMoved=false;this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var e=this,i=t.which===1,s=typeof this.options.cancel==="string"&&t.target.nodeName?b(t.target).closest(this.options.cancel).length:false;if(!i||s||!this._mouseCapture(t)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==false;if(!this._mouseStarted){t.preventDefault();return true}}if(true===b.data(t.target,this.widgetName+".preventClickEvent")){b.removeData(t.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(t){return e._mouseMove(t)};this._mouseUpDelegate=function(t){return e._mouseUp(t)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);t.preventDefault();l=true;return true},_mouseMove:function(t){if(this._mouseMoved){if(b.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button){return this._mouseUp(t)}else if(!t.which){if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey){this.ignoreMissingWhich=true}else if(!this.ignoreMissingWhich){return this._mouseUp(t)}}}if(t.which||t.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(t);return t.preventDefault()}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==false;this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)}return!this._mouseStarted},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(t.target===this._mouseDownEvent.target){b.data(t.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(t)}if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;l=false;t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}}),f=b.ui.plugin={add:function(t,e,i){var s,o=b.ui[t].prototype;for(s in i){o.plugins[s]=o.plugins[s]||[];o.plugins[s].push([e,i[s]])}},call:function(t,e,i,s){var o,n=t.plugins[e];if(!n){return}if(!s&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11)){return}for(o=0;o<n.length;o++){if(t.options[n[o][0]]){n[o][1].apply(t.element,i)}}}},p=b.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}if(!i){i=e.body}if(!i.nodeName){i=e.body}return i},u=b.ui.safeBlur=function(t){if(t&&t.nodeName.toLowerCase()!=="body"){b(t).trigger("blur")}};b.widget("ui.draggable",b.ui.mouse,{version:"1.12.1",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,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this._addClass("ui-draggable")}this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(t){var e=this.options;if(this.helper||e.disabled||b(t.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(t);if(!this.handle){return false}this._blurActiveElement(t);this._blockFrames(e.iframeFix===true?"iframe":e.iframeFix);return true},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=b(this);return b("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(t){var e=b.ui.safeActiveElement(this.document[0]),i=b(t.target);if(i.closest(e).length){return}b.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;this.helper=this._createHelper(t);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(b.ui.ddmanager){b.ui.ddmanager.current=this}this._cacheMargins();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 b(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(t);this.originalPosition=this.position=this._generatePosition(t,false);this.originalPageX=t.pageX;this.originalPageY=t.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);this._setContainment();if(this._trigger("start",t)===false){this._clear();return false}this._cacheHelperProportions();if(b.ui.ddmanager&&!e.dropBehaviour){b.ui.ddmanager.prepareOffsets(this,t)}this._mouseDrag(t,true);if(b.ui.ddmanager){b.ui.ddmanager.dragStart(this,t)}return true},_refreshOffsets:function(t){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:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(t,true);this.positionAbs=this._convertPositionTo("absolute");if(!e){var i=this._uiHash();if(this._trigger("drag",t,i)===false){this._mouseUp(new b.Event("mouseup",t));return false}this.position=i.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(b.ui.ddmanager){b.ui.ddmanager.drag(this,t)}return false},_mouseStop:function(t){var e=this,i=false;if(b.ui.ddmanager&&!this.options.dropBehaviour){i=b.ui.ddmanager.drop(this,t)}if(this.dropped){i=this.dropped;this.dropped=false}if(this.options.revert==="invalid"&&!i||this.options.revert==="valid"&&i||this.options.revert===true||b.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)){b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(e._trigger("stop",t)!==false){e._clear()}})}else{if(this._trigger("stop",t)!==false){this._clear()}}return false},_mouseUp:function(t){this._unblockFrames();if(b.ui.ddmanager){b.ui.ddmanager.dragStop(this,t)}if(this.handleElement.is(t.target)){this.element.trigger("focus")}return b.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new b.Event("mouseup",{target:this.element[0]}))}else{this._clear()}return this},_getHandle:function(t){return this.options.handle?!!b(t.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._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i=b.isFunction(e.helper),s=i?b(e.helper.apply(this.element[0],[t])):e.helper==="clone"?this.element.clone().removeAttr("id"):this.element;if(!s.parents("body").length){s.appendTo(e.appendTo==="parent"?this.element[0].parentNode:e.appendTo)}if(i&&s[0]===this.element[0]){this._setPositionRelative()}if(s[0]!==this.element[0]&&!/(fixed|absolute)/.test(s.css("position"))){s.css("position","absolute")}return s},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(t){if(typeof t==="string"){t=t.split(" ")}if(b.isArray(t)){t={left:+t[0],top:+t[1]||0}}if("left"in t){this.offset.click.left=t.left+this.margins.left}if("right"in t){this.offset.click.left=this.helperProportions.width-t.right+this.margins.left}if("top"in t){this.offset.click.top=t.top+this.margins.top}if("bottom"in t){this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top}},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==e&&b.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){t={top:0,left:0}}return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?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 t,e,i,s=this.options,o=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return}if(s.containment==="window"){this.containment=[b(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,b(window).scrollLeft()+b(window).width()-this.helperProportions.width-this.margins.left,b(window).scrollTop()+(b(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment==="document"){this.containment=[0,0,b(o).width()-this.helperProportions.width-this.margins.left,(b(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment.constructor===Array){this.containment=s.containment;return}if(s.containment==="parent"){s.containment=this.helper[0].parentNode}e=b(s.containment);i=e[0];if(!i){return}t=/(scroll|auto)/.test(e.css("overflow"));this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=e},_convertPositionTo:function(t,e){if(!e){e=this.position}var i=t==="absolute"?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,o,n,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;if(!a||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(e){if(this.containment){if(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]}else{i=this.containment}if(t.pageX-this.offset.click.left<i[0]){l=i[0]+this.offset.click.left}if(t.pageY-this.offset.click.top<i[1]){h=i[1]+this.offset.click.top}if(t.pageX-this.offset.click.left>i[2]){l=i[2]+this.offset.click.left}if(t.pageY-this.offset.click.top>i[3]){h=i[3]+this.offset.click.top}}if(r.grid){o=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY;h=i?o-this.offset.click.top>=i[1]||o-this.offset.click.top>i[3]?o:o-this.offset.click.top>=i[1]?o-r.grid[1]:o+r.grid[1]:o;n=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX;l=i?n-this.offset.click.left>=i[0]||n-this.offset.click.left>i[2]?n:n-this.offset.click.left>=i[0]?n-r.grid[0]:n+r.grid[0]:n}if(r.axis==="y"){l=this.originalPageX}if(r.axis==="x"){h=this.originalPageY}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"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()}},_trigger:function(t,e,i){i=i||this._uiHash();b.ui.plugin.call(this,t,[e,i,this],true);if(/^(drag|start|stop)/.test(t)){this.positionAbs=this._convertPositionTo("absolute");i.offset=this.positionAbs}return b.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),b.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=b.extend({},t,{item:i.element});i.sortables=[];b(i.options.connectToSortable).each(function(){var t=b(this).sortable("instance");if(t&&!t.options.disabled){i.sortables.push(t);t.refreshPositions();t._trigger("activate",e,s)}})},stop:function(e,t,i){var s=b.extend({},t,{item:i.element});i.cancelHelperRemoval=false;b.each(i.sortables,function(){var t=this;if(t.isOver){t.isOver=0;i.cancelHelperRemoval=true;t.cancelHelperRemoval=false;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper}else{t.cancelHelperRemoval=true;t._trigger("deactivate",e,s)}})},drag:function(i,s,o){b.each(o.sortables,function(){var t=false,e=this;e.positionAbs=o.positionAbs;e.helperProportions=o.helperProportions;e.offset.click=o.offset.click;if(e._intersectsWith(e.containerCache)){t=true;b.each(o.sortables,function(){this.positionAbs=o.positionAbs;this.helperProportions=o.helperProportions;this.offset.click=o.offset.click;if(this!==e&&this._intersectsWith(this.containerCache)&&b.contains(e.element[0],this.element[0])){t=false}return t})}if(t){if(!e.isOver){e.isOver=1;o._parent=s.helper.parent();e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",true);e.options._helper=e.options.helper;e.options.helper=function(){return s.helper[0]};i.target=e.currentItem[0];e._mouseCapture(i,true);e._mouseStart(i,true,true);e.offset.click.top=o.offset.click.top;e.offset.click.left=o.offset.click.left;e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left;e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top;o._trigger("toSortable",i);o.dropped=e.element;b.each(o.sortables,function(){this.refreshPositions()});o.currentItem=o.element;e.fromOutside=o}if(e.currentItem){e._mouseDrag(i);s.position=e.position}}else{if(e.isOver){e.isOver=0;e.cancelHelperRemoval=true;e.options._revert=e.options.revert;e.options.revert=false;e._trigger("out",i,e._uiHash(e));e._mouseStop(i,true);e.options.revert=e.options._revert;e.options.helper=e.options._helper;if(e.placeholder){e.placeholder.remove()}s.helper.appendTo(o._parent);o._refreshOffsets(i);s.position=o._generatePosition(i,true);o._trigger("fromSortable",i);o.dropped=false;b.each(o.sortables,function(){this.refreshPositions()})}}})}}),b.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=b("body"),o=i.options;if(s.css("cursor")){o._cursor=s.css("cursor")}s.css("cursor",o.cursor)},stop:function(t,e,i){var s=i.options;if(s._cursor){b("body").css("cursor",s._cursor)}}}),b.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=b(e.helper),o=i.options;if(s.css("opacity")){o._opacity=s.css("opacity")}s.css("opacity",o.opacity)},stop:function(t,e,i){var s=i.options;if(s._opacity){b(e.helper).css("opacity",s._opacity)}}}),b.ui.plugin.add("draggable","scroll",{start:function(t,e,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(t,e,i){var s=i.options,o=false,n=i.scrollParentNotHidden[0],r=i.document[0];if(n!==r&&n.tagName!=="HTML"){if(!s.axis||s.axis!=="x"){if(i.overflowOffset.top+n.offsetHeight-t.pageY<s.scrollSensitivity){n.scrollTop=o=n.scrollTop+s.scrollSpeed}else if(t.pageY-i.overflowOffset.top<s.scrollSensitivity){n.scrollTop=o=n.scrollTop-s.scrollSpeed}}if(!s.axis||s.axis!=="y"){if(i.overflowOffset.left+n.offsetWidth-t.pageX<s.scrollSensitivity){n.scrollLeft=o=n.scrollLeft+s.scrollSpeed}else if(t.pageX-i.overflowOffset.left<s.scrollSensitivity){n.scrollLeft=o=n.scrollLeft-s.scrollSpeed}}}else{if(!s.axis||s.axis!=="x"){if(t.pageY-b(r).scrollTop()<s.scrollSensitivity){o=b(r).scrollTop(b(r).scrollTop()-s.scrollSpeed)}else if(b(window).height()-(t.pageY-b(r).scrollTop())<s.scrollSensitivity){o=b(r).scrollTop(b(r).scrollTop()+s.scrollSpeed)}}if(!s.axis||s.axis!=="y"){if(t.pageX-b(r).scrollLeft()<s.scrollSensitivity){o=b(r).scrollLeft(b(r).scrollLeft()-s.scrollSpeed)}else if(b(window).width()-(t.pageX-b(r).scrollLeft())<s.scrollSensitivity){o=b(r).scrollLeft(b(r).scrollLeft()+s.scrollSpeed)}}}if(o!==false&&b.ui.ddmanager&&!s.dropBehaviour){b.ui.ddmanager.prepareOffsets(i,t)}}}),b.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[];b(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=b(this),e=t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})}})},drag:function(t,e,i){var s,o,n,r,a,l,h,f,p,u,c=i.options,d=c.snapTolerance,g=e.offset.left,m=g+i.helperProportions.width,v=e.offset.top,_=v+i.helperProportions.height;for(p=i.snapElements.length-1;p>=0;p--){a=i.snapElements[p].left-i.margins.left;l=a+i.snapElements[p].width;h=i.snapElements[p].top-i.margins.top;f=h+i.snapElements[p].height;if(m<a-d||g>l+d||_<h-d||v>f+d||!b.contains(i.snapElements[p].item.ownerDocument,i.snapElements[p].item)){if(i.snapElements[p].snapping){i.options.snap.release&&i.options.snap.release.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[p].item}))}i.snapElements[p].snapping=false;continue}if(c.snapMode!=="inner"){s=Math.abs(h-_)<=d;o=Math.abs(f-v)<=d;n=Math.abs(a-m)<=d;r=Math.abs(l-g)<=d;if(s){e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top}if(o){e.position.top=i._convertPositionTo("relative",{top:f,left:0}).top}if(n){e.position.left=i._convertPositionTo("relative",{top:0,left:a-i.helperProportions.width}).left}if(r){e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left}}u=s||o||n||r;if(c.snapMode!=="outer"){s=Math.abs(h-v)<=d;o=Math.abs(f-_)<=d;n=Math.abs(a-g)<=d;r=Math.abs(l-m)<=d;if(s){e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top}if(o){e.position.top=i._convertPositionTo("relative",{top:f-i.helperProportions.height,left:0}).top}if(n){e.position.left=i._convertPositionTo("relative",{top:0,left:a}).left}if(r){e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left}}if(!i.snapElements[p].snapping&&(s||o||n||r||u)){i.options.snap.snap&&i.options.snap.snap.call(i.element,t,b.extend(i._uiHash(),{snapItem:i.snapElements[p].item}))}i.snapElements[p].snapping=s||o||n||r||u}}}),b.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,o=i.options,n=b.makeArray(b(o.stack)).sort(function(t,e){return(parseInt(b(t).css("zIndex"),10)||0)-(parseInt(b(e).css("zIndex"),10)||0)});if(!n.length){return}s=parseInt(b(n[0]).css("zIndex"),10)||0;b(n).each(function(t){b(this).css("zIndex",s+t)});this.css("zIndex",s+n.length)}}),b.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){var s=b(e.helper),o=i.options;if(s.css("zIndex")){o._zIndex=s.css("zIndex")}s.css("zIndex",o.zIndex)},stop:function(t,e,i){var s=i.options;if(s._zIndex){b(e.helper).css("zIndex",s._zIndex)}}});var c=b.ui.draggable;b.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=false;this.isout=true;this.accept=b.isFunction(i)?i:function(t){return t.is(i)};this.proportions=function(){if(arguments.length){t=arguments[0]}else{return t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(e.scope);e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){b.ui.ddmanager.droppables[t]=b.ui.ddmanager.droppables[t]||[];b.ui.ddmanager.droppables[t].push(this)},_splice:function(t){var e=0;for(;e<t.length;e++){if(t[e]===this){t.splice(e,1)}}},_destroy:function(){var t=b.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){if(t==="accept"){this.accept=b.isFunction(e)?e:function(t){return t.is(e)}}else if(t==="scope"){var i=b.ui.ddmanager.droppables[this.options.scope];this._splice(i);this._addToManager(e)}this._super(t,e)},_activate:function(t){var e=b.ui.ddmanager.current;this._addActiveClass();if(e){this._trigger("activate",t,this.ui(e))}},_deactivate:function(t){var e=b.ui.ddmanager.current;this._removeActiveClass();if(e){this._trigger("deactivate",t,this.ui(e))}},_over:function(t){var e=b.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],e.currentItem||e.element)){this._addHoverClass();this._trigger("over",t,this.ui(e))}},_out:function(t){var e=b.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],e.currentItem||e.element)){this._removeHoverClass();this._trigger("out",t,this.ui(e))}},_drop:function(e,t){var i=t||b.ui.ddmanager.current,s=false;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return false}this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=b(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&d(i,b.extend(t,{offset:t.element.offset()}),t.options.tolerance,e)){s=true;return false}});if(s){return false}if(this.accept.call(this.element[0],i.currentItem||i.element)){this._removeActiveClass();this._removeHoverClass();this._trigger("drop",e,this.ui(i));return this.element}return false},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var d=b.ui.intersect=function(){function u(t,e,i){return t>=e&&t<e+i}return function(t,e,i,s){if(!e.offset){return false}var o=(t.positionAbs||t.position.absolute).left+t.margins.left,n=(t.positionAbs||t.position.absolute).top+t.margins.top,r=o+t.helperProportions.width,a=n+t.helperProportions.height,l=e.offset.left,h=e.offset.top,f=l+e.proportions().width,p=h+e.proportions().height;switch(i){case"fit":return l<=o&&r<=f&&h<=n&&a<=p;case"intersect":return l<o+t.helperProportions.width/2&&r-t.helperProportions.width/2<f&&h<n+t.helperProportions.height/2&&a-t.helperProportions.height/2<p;case"pointer":return u(s.pageY,h,e.proportions().height)&&u(s.pageX,l,e.proportions().width);case"touch":return(n>=h&&n<=p||a>=h&&a<=p||n<h&&a>p)&&(o>=l&&o<=f||r>=l&&r<=f||o<l&&r>f);default:return false}}}();if(b.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,o=b.ui.ddmanager.droppables[t.options.scope]||[],n=e?e.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<o.length;i++){if(o[i].options.disabled||t&&!o[i].accept.call(o[i].element[0],t.currentItem||t.element)){continue}for(s=0;s<r.length;s++){if(r[s]===o[i].element[0]){o[i].proportions().height=0;continue t}}o[i].visible=o[i].element.css("display")!=="none";if(!o[i].visible){continue}if(n==="mousedown"){o[i]._activate.call(o[i],e)}o[i].offset=o[i].element.offset();o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight})}},drop:function(t,e){var i=false;b.each((b.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&d(t,this,this.options.tolerance,e)){i=this._drop.call(this,e)||i}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)){this.isout=true;this.isover=false;this._deactivate.call(this,e)}});return i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){if(!t.options.refreshPositions){b.ui.ddmanager.prepareOffsets(t,e)}})},drag:function(n,r){if(n.options.refreshPositions){b.ui.ddmanager.prepareOffsets(n,r)}b.each(b.ui.ddmanager.droppables[n.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var t,e,i,s=d(n,this,this.options.tolerance,r),o=!s&&this.isover?"isout":s&&!this.isover?"isover":null;if(!o){return}if(this.options.greedy){e=this.options.scope;i=this.element.parents(":data(ui-droppable)").filter(function(){return b(this).droppable("instance").options.scope===e});if(i.length){t=b(i[0]).droppable("instance");t.greedyChild=o==="isover"}}if(t&&o==="isover"){t.isover=false;t.isout=true;t._out.call(t,r)}this[o]=true;this[o==="isout"?"isover":"isout"]=false;this[o==="isover"?"_over":"_out"].call(this,r);if(t&&o==="isout"){t.isout=false;t.isover=true;t._over.call(t,r)}})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable");if(!t.options.refreshPositions){b.ui.ddmanager.prepareOffsets(t,e)}}},b.uiBackCompat!==false){b.widget("ui.droppable",b.ui.droppable,{options:{hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(this.options.activeClass){this.element.addClass(this.options.activeClass)}},_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})}var g=b.ui.droppable;b.widget("ui.resizable",b.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if(b(t).css("overflow")==="hidden"){return false}var i=e&&e==="left"?"scrollLeft":"scrollTop",s=false;if(t[i]>0){return true}t[i]=1;s=t[i]>0;t[i]=0;return s},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable");b.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap(b("<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;t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(t);this.originalElement.css("margin",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(t);this._proportionallyResize()}this._setupHandles();if(e.autoHide){b(this.element).on("mouseenter",function(){if(e.disabled){return}i._removeClass("ui-resizable-autohide");i._handles.show()}).on("mouseleave",function(){if(e.disabled){return}if(!i.resizing){i._addClass("ui-resizable-autohide");i._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,e=function(t){b(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(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);e(this.originalElement);return this},_setOption:function(t,e){this._super(t,e);switch(t){case"handles":this._removeHandles();this._setupHandles();break;default:break}},_setupHandles:function(){var t=this.options,e,i,s,o,n,r=this;this.handles=t.handles||(!b(".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=b();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}s=this.handles.split(",");this.handles={};for(i=0;i<s.length;i++){e=b.trim(s[i]);o="ui-resizable-"+e;n=b("<div>");this._addClass(n,"ui-resizable-handle "+o);n.css({zIndex:t.zIndex});this.handles[e]=".ui-resizable-"+e;this.element.append(n)}}this._renderAxis=function(t){var e,i,s,o;t=t||this.element;for(e in this.handles){if(this.handles[e].constructor===String){this.handles[e]=this.element.children(this.handles[e]).first().show()}else if(this.handles[e].jquery||this.handles[e].nodeType){this.handles[e]=b(this.handles[e]);this._on(this.handles[e],{mousedown:r._mouseDown})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){i=b(this.handles[e],this.element);o=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth();s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join("");t.css(s,o);this._proportionallyResize()}this._handles=this._handles.add(this.handles[e])}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!r.resizing){if(this.className){n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}r.axis=n&&n[1]?n[1]:"se"}});if(t.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=false;for(e in this.handles){i=b(this.handles[e])[0];if(i===t.target||b.contains(i,t.target)){s=true}}return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,o=this.options,n=this.element;this.resizing=true;this._renderProxy();e=this._num(this.helper.css("left"));i=this._num(this.helper.css("top"));if(o.containment){e+=b(o.containment).scrollLeft()||0;i+=b(o.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:e,top:i};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()};this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()};this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()};this.originalPosition={left:e,top:i};this.originalMousePosition={left:t.pageX,top:t.pageY};this.aspectRatio=typeof o.aspectRatio==="number"?o.aspectRatio:this.originalSize.width/this.originalSize.height||1;s=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",s==="auto"?this.axis+"-resize":s);this._addClass("ui-resizable-resizing");this._propagate("start",t);return true},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,o=this.axis,n=t.pageX-s.left||0,r=t.pageY-s.top||0,a=this._change[o];this._updatePrevProperties();if(!a){return false}e=a.apply(this,[t,n,r]);this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey){e=this._updateRatio(e,t)}e=this._respectSize(e,t);this._updateCache(e);this._propagate("resize",t);i=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!b.isEmptyObject(i)){this._updatePrevProperties();this._trigger("resize",t,this.ui());this._applyChanges()}return false},_mouseStop:function(t){this.resizing=false;var e,i,s,o,n,r,a,l=this.options,h=this;if(this._helper){e=this._proportionallyResizeElements;i=e.length&&/textarea/i.test(e[0].nodeName);s=i&&this._hasScroll(e[0],"left")?0:h.sizeDiff.height;o=i?0:h.sizeDiff.width;n={width:h.helper.width()-o,height:h.helper.height()-s};r=parseFloat(h.element.css("left"))+(h.position.left-h.originalPosition.left)||null;a=parseFloat(h.element.css("top"))+(h.position.top-h.originalPosition.top)||null;if(!l.animate){this.element.css(b.extend(n,{top:a,left:r}))}h.helper.height(h.size.height);h.helper.width(h.size.width);if(this._helper&&!l.animate){this._proportionallyResize()}}b("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",t);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 t={};if(this.position.top!==this.prevPosition.top){t.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){t.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){t.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){t.height=this.size.height+"px"}this.helper.css(t);return t},_updateVirtualBoundaries:function(t){var e,i,s,o,n,r=this.options;n={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:Infinity,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:Infinity};if(this._aspectRatio||t){e=n.minHeight*this.aspectRatio;s=n.minWidth/this.aspectRatio;i=n.maxHeight*this.aspectRatio;o=n.maxWidth/this.aspectRatio;if(e>n.minWidth){n.minWidth=e}if(s>n.minHeight){n.minHeight=s}if(i<n.maxWidth){n.maxWidth=i}if(o<n.maxHeight){n.maxHeight=o}}this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset();if(this._isNumber(t.left)){this.position.left=t.left}if(this._isNumber(t.top)){this.position.top=t.top}if(this._isNumber(t.height)){this.size.height=t.height}if(this._isNumber(t.width)){this.size.width=t.width}},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;if(this._isNumber(t.height)){t.width=t.height*this.aspectRatio}else if(this._isNumber(t.width)){t.height=t.width/this.aspectRatio}if(s==="sw"){t.left=e.left+(i.width-t.width);t.top=null}if(s==="nw"){t.top=e.top+(i.height-t.height);t.left=e.left+(i.width-t.width)}return t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,n=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),f=/nw|ne|n/.test(i);if(n){t.width=e.minWidth}if(r){t.height=e.minHeight}if(s){t.width=e.maxWidth}if(o){t.height=e.maxHeight}if(n&&h){t.left=a-e.minWidth}if(s&&h){t.left=a-e.maxWidth}if(r&&f){t.top=l-e.minHeight}if(o&&f){t.top=l-e.maxHeight}if(!t.width&&!t.height&&!t.left&&t.top){t.top=null}else if(!t.width&&!t.height&&!t.top&&t.left){t.left=null}return t},_getPaddingPlusBorderDimensions:function(t){var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],o=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];for(;e<4;e++){i[e]=parseFloat(s[e])||0;i[e]+=parseFloat(o[e])||0}return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var t,e=0,i=this.helper||this.element;for(;e<this._proportionallyResizeElements.length;e++){t=this._proportionallyResizeElements[e];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(t)}t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||b("<div style='overflow:hidden;'></div>");this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,o=this.originalPosition;return{top:o.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){b.ui.plugin.call(this,t,[e,this.ui()]);t!=="resize"&&this._trigger(t,e,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}}}),b.ui.plugin.add("resizable","animate",{stop:function(e){var i=b(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),n=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,a={width:i.size.width-r,height:i.size.height-n},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,h=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(b.extend(a,h&&l?{top:h,left:l}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};if(s&&s.length){b(s[0]).css({width:t.width,height:t.height})}i._updateCache(t);i._propagate("resize",e)}})}}),b.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,o,n,r,a=b(this).resizable("instance"),l=a.options,h=a.element,f=l.containment,p=f instanceof b?f.get(0):/parent/.test(f)?h.parent().get(0):f;if(!p){return}a.containerElement=b(p);if(/document/.test(f)||f===document){a.containerOffset={left:0,top:0};a.containerPosition={left:0,top:0};a.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{i=b(p);s=[];b(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=a._num(i.css("padding"+e))});a.containerOffset=i.offset();a.containerPosition=i.position();a.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]};t=a.containerOffset;e=a.containerSize.height;o=a.containerSize.width;n=a._hasScroll(p,"left")?p.scrollWidth:o;r=a._hasScroll(p)?p.scrollHeight:e;a.parentData={element:p,left:t.left,top:t.top,width:n,height:r}}},resize:function(t){var e,i,s,o,n=b(this).resizable("instance"),r=n.options,a=n.containerOffset,l=n.position,h=n._aspectRatio||t.shiftKey,f={top:0,left:0},p=n.containerElement,u=true;if(p[0]!==document&&/static/.test(p.css("position"))){f=a}if(l.left<(n._helper?a.left:0)){n.size.width=n.size.width+(n._helper?n.position.left-a.left:n.position.left-f.left);if(h){n.size.height=n.size.width/n.aspectRatio;u=false}n.position.left=r.helper?a.left:0}if(l.top<(n._helper?a.top:0)){n.size.height=n.size.height+(n._helper?n.position.top-a.top:n.position.top);if(h){n.size.width=n.size.height*n.aspectRatio;u=false}n.position.top=n._helper?a.top:0}s=n.containerElement.get(0)===n.element.parent().get(0);o=/relative|absolute/.test(n.containerElement.css("position"));if(s&&o){n.offset.left=n.parentData.left+n.position.left;n.offset.top=n.parentData.top+n.position.top}else{n.offset.left=n.element.offset().left;n.offset.top=n.element.offset().top}e=Math.abs(n.sizeDiff.width+(n._helper?n.offset.left-f.left:n.offset.left-a.left));i=Math.abs(n.sizeDiff.height+(n._helper?n.offset.top-f.top:n.offset.top-a.top));if(e+n.size.width>=n.parentData.width){n.size.width=n.parentData.width-e;if(h){n.size.height=n.size.width/n.aspectRatio;u=false}}if(i+n.size.height>=n.parentData.height){n.size.height=n.parentData.height-i;if(h){n.size.width=n.size.height*n.aspectRatio;u=false}}if(!u){n.position.left=n.prevPosition.left;n.position.top=n.prevPosition.top;n.size.width=n.prevSize.width;n.size.height=n.prevSize.height}},stop:function(){var t=b(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,o=t.containerElement,n=b(t.helper),r=n.offset(),a=n.outerWidth()-t.sizeDiff.width,l=n.outerHeight()-t.sizeDiff.height;if(t._helper&&!e.animate&&/relative/.test(o.css("position"))){b(this).css({left:r.left-s.left-i.left,width:a,height:l})}if(t._helper&&!e.animate&&/static/.test(o.css("position"))){b(this).css({left:r.left-s.left-i.left,width:a,height:l})}}}),b.ui.plugin.add("resizable","alsoResize",{start:function(){var t=b(this).resizable("instance"),e=t.options;b(e.alsoResize).each(function(){var t=b(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=b(this).resizable("instance"),s=e.options,o=e.originalSize,n=e.originalPosition,r={height:e.size.height-o.height||0,width:e.size.width-o.width||0,top:e.position.top-n.top||0,left:e.position.left-n.left||0};b(s.alsoResize).each(function(){var t=b(this),s=b(this).data("ui-resizable-alsoresize"),o={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];b.each(e,function(t,e){var i=(s[e]||0)+(r[e]||0);if(i&&i>=0){o[e]=i||null}});t.css(o)})},stop:function(){b(this).removeData("ui-resizable-alsoresize")}}),b.ui.plugin.add("resizable","ghost",{start:function(){var t=b(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone();t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0});t._addClass(t.ghost,"ui-resizable-ghost");if(b.uiBackCompat!==false&&typeof t.options.ghost==="string"){t.ghost.addClass(this.options.ghost)}t.ghost.appendTo(t.helper)},resize:function(){var t=b(this).resizable("instance");if(t.ghost){t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})}},stop:function(){var t=b(this).resizable("instance");if(t.ghost&&t.helper){t.helper.get(0).removeChild(t.ghost.get(0))}}}),b.ui.plugin.add("resizable","grid",{resize:function(){var t,e=b(this).resizable("instance"),i=e.options,s=e.size,o=e.originalSize,n=e.originalPosition,r=e.axis,a=typeof i.grid==="number"?[i.grid,i.grid]:i.grid,l=a[0]||1,h=a[1]||1,f=Math.round((s.width-o.width)/l)*l,p=Math.round((s.height-o.height)/h)*h,u=o.width+f,c=o.height+p,d=i.maxWidth&&i.maxWidth<u,g=i.maxHeight&&i.maxHeight<c,m=i.minWidth&&i.minWidth>u,v=i.minHeight&&i.minHeight>c;i.grid=a;if(m){u+=l}if(v){c+=h}if(d){u-=l}if(g){c-=h}if(/^(se|s|e)$/.test(r)){e.size.width=u;e.size.height=c}else if(/^(ne)$/.test(r)){e.size.width=u;e.size.height=c;e.position.top=n.top-p}else if(/^(sw)$/.test(r)){e.size.width=u;e.size.height=c;e.position.left=n.left-f}else{if(c-h<=0||u-l<=0){t=e._getPaddingPlusBorderDimensions(this)}if(c-h>0){e.size.height=c;e.position.top=n.top-p}else{c=h-t.height;e.size.height=c;e.position.top=n.top+o.height-c}if(u-l>0){e.size.width=u;e.position.left=n.left-f}else{u=l-t.width;e.size.width=u;e.position.left=n.left+o.width-u}}}});var m=b.ui.resizable}(jQuery);
//# sourceMappingURL=gridstack.min.map

@@ -8,3 +8,3 @@ Change log

- [v0.6.4-dev (upcoming changes)](#v064-dev-upcoming-changes)
- [v1.0.0 (2020-02-23)](#v100-2020-02-23)
- [v0.6.4 (2020-02-17)](#v064-2020-02-17)

@@ -34,5 +34,9 @@ - [v0.6.3 (2020-02-05)](#v063-2020-02-05)

## v0.6.4-dev (upcoming changes)
## v1.0.0 (2020-02-23)
- TBD
- **breaking**: [(1084)](https://github.com/gridstack/gridstack.js/issues/1084) jquery was removed from the API and dependencies (initialize differently, and methods take/return `GridStack` or `HTMLElement` instead of `JQuery`), so your code will need to change.
See [Migrating to v1.0.0](https://github.com/gridstack/gridstack.js/blob/develop/README.md#migrating-to-v100)
- `setColumn(N)` is now `column(N)` (matches other set/get methods) and `getColumn()` to get current column number
- add `grid.on(eventName, callback)` / `grid.off(eventName)` to hide native JQ events mix
- add `grid.getRow()` to get the current grid row number

@@ -54,3 +58,3 @@ ## v0.6.4 (2020-02-17)

- add `oneColumnModeDomSort` true|false to let you specify a custom layout (use dom order instead of x,y) for oneColumnMode `setColumn(1)` [#713](https://github.com/gridstack/gridstack.js/issues/713)
- add `oneColumnModeDomSort` true|false to let you specify a custom layout (use dom order instead of x,y) for oneColumnMode `column(1)` [#713](https://github.com/gridstack/gridstack.js/issues/713)
- fix oneColumnMode to only restore if we auto went to it as window sizes up [#1125](https://github.com/gridstack/gridstack.js/pull/1125)

@@ -62,3 +66,3 @@ - editing in 1 column (or few columns) does a better job updating higher layout (track before and after and move items accordingly).

- fix [#37](https://github.com/gridstack/gridstack.js/issues/37) oneColumnMode (<768px by default) now simply calls `setColumn(1)` and remembers prev columns (so we can restore). This gives
- fix [#37](https://github.com/gridstack/gridstack.js/issues/37) oneColumnMode (<768px by default) now simply calls `column(1)` and remembers prev columns (so we can restore). This gives
us full resize/re-order of items capabilities rather than a locked CSS only layout (see prev rev changes). [#1120](https://github.com/gridstack/gridstack.js/pull/1120)

@@ -80,3 +84,3 @@ - fix [responsive.html](https://gridstackjs.com/demo/responsive.html) demo [#1121](https://github.com/gridstack/gridstack.js/pull/1121)

- `removeAll()` is now much faster (no relayout) and calls `removed` event just once with a list [#1097](https://github.com/gridstack/gridstack.js/pull/1097)
- `setColumn()` complete re-write and is no longer "Experimental". We now do a reasonable job at sizing/position the widgets (especially 1 column) and
- `column()` complete re-write and is no longer "Experimental". We now do a reasonable job at sizing/position the widgets (especially 1 column) and
also now cache each column layout so you can go back to say 12 column and not loose original layout. [#1098](https://github.com/gridstack/gridstack.js/pull/1098)

@@ -107,3 +111,3 @@ - fix `addWidget(el)` (no data) would not render item at correct location, and overlap item at (0,0) [#1098](https://github.com/gridstack/gridstack.js/pull/1098)

- grid options `width` is now `column`, `height` now `maxRow`, and `setGridWidth()` now `setColumn()` to match what they are. Old names are still supported (console warnings). Various fixes for custom # of column and re-wrote entire doc section ([#1053](https://github.com/gridstack/gridstack.js/issues/1053)).
- grid options `width` is now `column`, `height` now `maxRow`, and `setGridWidth()` now `column()` to match what they are. Old names are still supported (console warnings). Various fixes for custom # of column and re-wrote entire doc section ([#1053](https://github.com/gridstack/gridstack.js/issues/1053)).
- fix widgets not animating when `animate: true` is used. on every move, styles were recreated-fix should slightly improve gridstack.js speed ([#937](https://github.com/gridstack/gridstack.js/issues/937)).

@@ -191,3 +195,3 @@ - fix moving widgets when having multiple grids. jquery-ui workaround ([#1043](https://github.com/gridstack/gridstack.js/issues/1043)).

- add `setAnimation` method to API
- add `setColumn` method ([#227](https://github.com/gridstack/gridstack.js/issues/227))
- add `column` method ([#227](https://github.com/gridstack/gridstack.js/issues/227))
- add `removable`/`removeTimeout` *(experimental)*

@@ -249,3 +253,3 @@ - add `detachGrid` parameter to `destroy` method ([#216](https://github.com/gridstack/gridstack.js/issues/216)) (thanks @jhpedemonte)

- auto-generate css rules (widgets `height` and `top`)
- add `GridStackUI.Utils.sort` utility function
- add `GridStack.Utils.sort` utility function
- add `removeAll` API method

@@ -252,0 +256,0 @@ - add `resize` and `move` API methods

@@ -31,2 +31,3 @@ gridstack.js API

- [commit()](#commit)
- [column(column, doNotPropagate)](#columncolumn-donotpropagate)
- [destroy([detachGrid])](#destroydetachgrid)

@@ -53,3 +54,2 @@ - [disable()](#disable)

- [setAnimation(doAnimate)](#setanimationdoanimate)
- [setColumn(column, doNotPropagate)](#setcolumncolumn-donotpropagate)
- [setStatic(staticValue)](#setstaticstaticvalue)

@@ -61,3 +61,3 @@ - [update(el, x, y, width, height)](#updateel-x-y-width-height)

- [Utils](#utils)
- [GridStackUI.Utils.sort(nodes[, dir[, width]])](#gridstackuiutilssortnodes-dir-width)
- [GridStack.Utils.sort(nodes[, dir[, width]])](#gridstackutilssortnodes-dir-width)

@@ -81,3 +81,3 @@ <!-- END doctoc generated TOC please keep comment here to allow auto update -->

* `'auto'` - height will be calculated to match cell width (initial square grid).
- `column` - number of columns (default: `12`) which can change on the fly with `setColumn()` as well. See [example](http://gridstackjs.com/demo/column.html)
- `column` - number of columns (default: `12`) which can change on the fly with `column(N)` as well. See [example](http://gridstackjs.com/demo/column.html)
- `ddPlugin` - class that implement drag'n'drop functionallity for gridstack. If `false` grid will be static. (default: `null` - first available plugin will be used)

@@ -112,3 +112,3 @@ - `disableDrag` - disallows dragging of widgets (default: `false`).

- `data-gs-max-row` - maximum rows amount. Default is `0` which means no maximum rows.
- `data-gs-current-height` - current rows amount. Set by the library only. Can be used by the CSS rules.
- `data-gs-current-row` - current rows amount. Set by the library only. Can be used by the CSS rules.

@@ -131,10 +131,12 @@ ## Item attributes

Those are the events set by the grid when items are added/removed or changed - they use standard JS calls with a CustomElement that stores the list
of nodes that changed (id, x, y, width, height, etc...)
### added(event, items)
```javascript
$('.grid-stack').on('added', function(event, items) {
for (var i = 0; i < items.length; i++) {
console.log('item added');
console.log(items[i]);
}
Called when widgets are being added to a grid
```js
grid.on('added', function(event, items) {
/* items contains GridStackNode[] info */
});

@@ -145,11 +147,7 @@ ```

Occurs when adding/removing widgets or existing widgets change their position/size
Occurs when widgets change their position/size due to constrain or direct changes
```javascript
var serializeWidgetMap = function(items) {
console.log(items);
};
$('.grid-stack').on('change', function(event, items) {
serializeWidgetMap(items);
```js
grid.on('change', function(event, items) {
/* items contains GridStackNode[] info */
});

@@ -160,4 +158,4 @@ ```

```javascript
$('.grid-stack').on('disable', function(event) {
```js
grid.on('disable', function(event) {
var grid = event.target;

@@ -169,4 +167,4 @@ });

```javascript
$('.grid-stack').on('dragstart', function(event, ui) {
```js
grid.on('dragstart', function(event, ui) {
var grid = this;

@@ -179,4 +177,4 @@ var element = event.target;

```javascript
$('.grid-stack').on('dragstop', function(event, ui) {
```js
grid.on('dragstop', function(event, ui) {
var grid = this;

@@ -189,4 +187,4 @@ var element = event.target;

```javascript
$('.grid-stack').on('dropped', function(event, previousWidget, newWidget) {
```js
grid.on('dropped', function(event, previousWidget, newWidget) {
console.log('Removed widget that was dragged out of grid:', previousWidget);

@@ -199,4 +197,4 @@ console.log('Added widget in dropped grid:', newWidget);

```javascript
$('.grid-stack').on('enable', function(event) {
```js
grid.on('enable', function(event) {
var grid = event.target;

@@ -208,8 +206,7 @@ });

```javascript
$('.grid-stack').on('removed', function(event, items) {
for (var i = 0; i < items.length; i++) {
console.log('item removed');
console.log(items[i]);
}
Called when item is being removed from the grid
```js
grid.on('removed', function(event, items) {
/* items contains GridStackNode[] info */
});

@@ -220,4 +217,4 @@ ```

```javascript
$('.grid-stack').on('resizestart', function(event, ui) {
```js
grid.on('resizestart', function(event, ui) {
var grid = this;

@@ -232,5 +229,7 @@ var element = event.target;

```javascript
$('.grid-stack').on('gsresizestop', function(event, elem) {
var newHeight = $(elem).attr('data-gs-height');
You could instead use the `change` event which has the latest node sizing.
```js
grid.on('gsresizestop', function(event, element) {
var newHeight = element.getAttribute('data-gs-height');
});

@@ -264,5 +263,4 @@ ```

```javascript
$('.grid-stack').gridstack();
var grid = $('.grid-stack').data('gridstack');
```js
var grid = GridStack.init();
grid.addWidget(el, 0, 0, 3, 2, true);

@@ -288,3 +286,3 @@ ```

```javascript
```js
grid.cellHeight(grid.cellWidth() * 1.2);

@@ -301,2 +299,12 @@ ```

### column(column, doNotPropagate)
set/get the number of columns in the grid. Will update existing widgets to conform to new number of columns,
as well as cache the original layout so you can revert back to previous positions without loss.
Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [2-11],
else you will need to generate correct CSS (see https://github.com/gridstack/gridstack.js#change-grid-columns)
- `column` - Integer > 0 (default 12), if missing it will return the current count instead.
- `doNotPropagate` - if true existing widgets will not be updated during a set.
### destroy([detachGrid])

@@ -314,3 +322,3 @@

```javascript
```js
grid.movable('.grid-stack-item', false);

@@ -324,3 +332,3 @@ grid.resizable('.grid-stack-item', false);

```javascript
```js
grid.movable('.grid-stack-item', true);

@@ -334,3 +342,3 @@ grid.resizable('.grid-stack-item', true);

```javascript
```js
grid.movable(this.container.children('.' + this.opts.itemClass), doEnable);

@@ -343,3 +351,3 @@ ```

```javascript
```js
grid.resizable(this.container.children('.' + this.opts.itemClass), doEnable);

@@ -385,7 +393,5 @@ ```

```javascript
$('.grid-stack').gridstack();
$('.grid-stack').append('<div id="gsi-1" data-gs-x="0" data-gs-y="0" data-gs-width="3" data-gs-height="2" data-gs-auto-position="true"></div>')
var grid = $('.grid-stack').data('gridstack');
```js
var grid = GridStack.init();
grid.el.appendChild('<div id="gsi-1" data-gs-x="0" data-gs-y="0" data-gs-width="3" data-gs-height="2" data-gs-auto-position="true"></div>')
grid.makeWidget('gsi-1');

@@ -477,12 +483,2 @@ ```

### setColumn(column, doNotPropagate)
Modify number of columns in the grid. Will update existing widgets to conform to new number of columns,
as well as cache the original layout so you can revert back to previous positions without loss.
Requires `gridstack-extra.css` or `gridstack-extra.min.css` for [1-11],
else you will need to generate correct CSS (see https://github.com/gridstack/gridstack.js#change-grid-columns)
- `column` - Integer > 0 (default 12).
- `doNotPropagate` - if true existing widgets will not be updated.
### setStatic(staticValue)

@@ -520,3 +516,3 @@

```javascript
```js
if (grid.willItFit(newNode.x, newNode.y, newNode.width, newNode.height, true)) {

@@ -533,3 +529,3 @@ grid.addWidget(newNode.el, newNode.x, newNode.y, newNode.width, newNode.height, true);

### GridStackUI.Utils.sort(nodes[, dir[, width]])
### GridStack.Utils.sort(nodes[, dir[, width]])

@@ -536,0 +532,0 @@ Sorts array of nodes

{
"name": "gridstack",
"version": "0.6.4",
"description": "gridstack.js for dashboard layout and creation, with many wrappers (React, Angular, Ember, knockout...)",
"main": "dist/gridstack.js",
"version": "1.0.0",
"description": "JavaScript / TypeScript for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)",
"main": "dist/gridstack",
"repository": {

@@ -18,2 +18,3 @@ "type": "git",

"keywords": [
"JavaScript",
"gridstack.js",

@@ -42,13 +43,11 @@ "grid",

"homepage": "http://gridstack.github.io/gridstack.js/",
"dependencies": {
"jquery": "^1.8 || 2 || 3"
},
"dependencies": {},
"devDependencies": {
"connect": "^3.6.6",
"core-js": "^3.0.0",
"coveralls": "^3.0.3",
"connect": "^3.7.0",
"core-js": "^3.6.4",
"coveralls": "^3.0.9",
"doctoc": "^1.4.0",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-contrib-connect": "^2.0.0",
"grunt-contrib-connect": "^2.1.0",
"grunt-contrib-copy": "^1.0.0",

@@ -58,14 +57,15 @@ "grunt-contrib-cssmin": "^3.0.0",

"grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^20.1.0",
"grunt-eslint": "^22.0.0",
"grunt-protractor-runner": "^5.0.0",
"grunt-protractor-webdriver": "^0.2.5",
"grunt-sass": "2.1.0",
"jasmine-core": "^3.3.0",
"karma": "^4.0.1",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"grunt-sass": "3.1.0",
"jasmine-core": "^3.5.0",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.1",
"karma-coveralls": "^2.1.0",
"karma-jasmine": "^2.0.1",
"puppeteer": "^1.13.0",
"serve-static": "^1.13.2"
"karma-jasmine": "^3.1.1",
"node-sass": "^4.13.1",
"puppeteer": "^2.1.1",
"serve-static": "^1.14.1"
},

@@ -72,0 +72,0 @@ "resolutions": {

gridstack.js
============
[![Build Status](https://travis-ci.org/gridstack/gridstack.js.svg?branch=develop)](https://travis-ci.org/gridstack/gridstack.js)
[![Coverage Status](https://coveralls.io/repos/github/gridstack/gridstack.js/badge.svg?branch=develop)](https://coveralls.io/github/gridstack/gridstack.js?branch=develop)
[![NPM version](https://img.shields.io/npm/v/gridstack.svg)](https://www.npmjs.com/package/gridstack)
[![Dependency Status](https://david-dm.org/gridstack/gridstack.js.svg)](https://david-dm.org/gridstack/gridstack.js)
[![devDependency Status](https://david-dm.org/gridstack/gridstack.js/dev-status.svg)](https://david-dm.org/gridstack/gridstack.js#info=devDependencies)
[![Coverage Status](https://coveralls.io/repos/github/gridstack/gridstack.js/badge.svg?branch=develop)](https://coveralls.io/github/gridstack/gridstack.js?branch=develop)
[![downloads](https://img.shields.io/npm/dm/gridstack.svg)](https://www.npmjs.com/package/gridstack)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/alaind831)
Mobile-friendly Javascript library for dashboard layout and creation. Making a drag-and-drop, multi-column dashboard has never been easier. Allows you to build draggable, responsive bootstrap v3-friendly layouts. It also has multiple bindings and works great with [React](https://reactjs.org/), [Angular](https://angular.io/), [Knockout.js](http://knockoutjs.com), [Ember](https://www.emberjs.com/) and others, and comes with a Typescript definition out of the box.
Mobile-friendly Javascript library (with Typescript bindings) for dashboard layout and creation. Making a drag-and-drop, multi-column responsive dashboard has never been easier. Allows you to build draggable, responsive bootstrap v4-friendly layouts. It also has multiple bindings and works great with [React](https://reactjs.org/), [Angular](https://angular.io/), [Knockout.js](http://knockoutjs.com), [Ember](https://www.emberjs.com/) and others. Includes Typescript defines.
Inspired by no-longer maintained gridster.js, built with love.
Inspired by no-longer maintained gridster, built with love.
Please visit http://gridstackjs.com and [these demos](http://gridstackjs.com/demo/).
If you find this lib useful, please [donate](https://www.paypal.me/alaind831) and help support it!
Join us on Slack: https://gridstackjs.troolee.com

@@ -31,3 +35,2 @@

- [Extend Library](#extend-library)
- [Touch devices support](#touch-devices-support)
- [gridstack.js for specific frameworks](#gridstackjs-for-specific-frameworks)

@@ -37,3 +40,4 @@ - [Change grid columns](#change-grid-columns)

- [Override resizable/draggable options](#override-resizabledraggable-options)
- [Migrating to v0.3.0](#migrating-to-v030)
- [Touch devices support](#touch-devices-support)
- [Migrating to v1.0.0](#migrating-to-v100)
- [Changes](#changes)

@@ -48,3 +52,3 @@ - [The Team](#the-team)

Please visit http://gridstackjs.com and [these demos](http://gridstackjs.com/demo/).
Please visit http://gridstackjs.com and [these demos](http://gridstackjs.com/demo/)

@@ -62,3 +66,5 @@

```bash
$ yarn install gridstack
yarn install gridstack
or
npm install --save gridstack
```

@@ -70,6 +76,4 @@

```html
<link rel="stylesheet" href="gridstack.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" href="gridstack.min.css" />
<script src="gridstack.all.js"></script>

@@ -81,18 +85,22 @@ ```

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@0.6.4/dist/gridstack.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gridstack@0.6.4/dist/gridstack.all.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@1.0.0/dist/gridstack.min.css" />
<script src="https://cdn.jsdelivr.net/npm/gridstack@1.0.0/dist/gridstack.all.js"></script>
```
* Using CDN (debug):
if you need to debug, look at the git demo/ examples for non min includes.
## Basic usage
creating items dynamically...
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gridstack@0.6.4/dist/gridstack.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gridstack@0.6.4/dist/gridstack.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gridstack@0.6.4/dist/jquery-ui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gridstack@0.6.4/dist/gridstack.jQueryUI.js"></script>
<div class="grid-stack"></div>
<script type="text/javascript">
var grid = GridStack.init();
grid.addWidget('<div class="grid-stack-item"><div class="grid-stack-item-content"> test </div></div>', {width: 2});
</script>
```
## Basic usage
... or DOM created items

@@ -110,5 +118,3 @@ ```html

<script type="text/javascript">
$(function () {
$('.grid-stack').gridstack();
});
GridStack.init();
</script>

@@ -121,14 +127,4 @@ ```

* [jQuery](http://jquery.com) (>= 1.8)
* `Array.prototype.find`, and `Number.isNaN()` for IE and older browsers.
* Note: as of v0.5.4 We supply a separate `gridstack-poly.js` for that
(part of `gridstack.all.js`) or you can look at other pollyfills
([core.js](https://github.com/zloirock/core-js#ecmascript-6-array) and [mozilla.org](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)).
Gridstack no longer requires external dependencies as of v1.0.0 (lodash was removed in v0.5.0 and jquery API in v1.0.0). All you need to include is `gridstack.all.js` and `gridstack.css` (layouts are done using CSS column based %).
Using gridstack.js with jQuery UI
* [jQuery UI](http://jqueryui.com) (>= 1.12.0). Minimum required components: Draggable, Droppable, Resizable (Widget, Mouse, core).
* Note: as of v0.5.4 we include this subset as `jquery-ui.js` (and min.js) which is part of `gridstack.all.js`. If you wish to bring your own lib, include the individual gridstack parts instead of all.js
* (Optional) [jquery-ui-touch-punch](https://github.com/furf/jquery-ui-touch-punch) for touch-based devices support
## API Documentation

@@ -143,44 +139,14 @@

```javascript
$(function () {
// extend gridstack with our own custom method
window.GridStackUI.prototype.printCount = function() {
console.log('grid has ' + this.grid.nodes.length + ' items');
};
```js
// extend gridstack with our own custom method
GridStack.prototype.printCount = function() {
console.log('grid has ' + this.grid.nodes.length + ' items');
};
$('.grid-stack').gridstack();
var grid = GridStack.init();
// you can now call on any grid this...
$('.grid-stack').data('gridstack').printCount();
});
// you can now call
grid.printCount();
```
## Touch devices support
Please use [jQuery UI Touch Punch](https://github.com/furf/jquery-ui-touch-punch) to make jQuery UI Draggable/Resizable
working on touch-based devices.
```html
<script src="core-js/client/shim.min.js"></script>
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script src="jquery.ui.touch-punch.min.js"></script>
<script src="gridstack.js"></script>
```
Also `alwaysShowResizeHandle` option may be useful:
```javascript
$(function () {
var options = {
alwaysShowResizeHandle: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
};
$('.grid-stack').gridstack(options);
});
```
If you're still experiencing issues on touch devices please check [#444](https://github.com/gridstack/gridstack.js/issues/444)
## gridstack.js for specific frameworks

@@ -202,3 +168,3 @@

```js
$('.grid-stack').gridstack( {column: N} );
GridStack.init( {column: N} );
```

@@ -273,4 +239,4 @@

```javascript
$('.grid-stack').gridstack({
```js
GridStack.init({
resizable: {

@@ -282,21 +248,74 @@ handles: 'e, se, s, sw, w'

Note: It's not recommended to enable `nw`, `n`, `ne` resizing handles. Their behaviour may be unexpected.
Note: It's not recommended to enable `nw`, `n`, `ne` resizing handles. Their behavior may be unexpected.
## Migrating to v0.3.0
## Touch devices support
As of v0.3.0, gridstack introduces a new plugin system. The drag'n'drop functionality has been modified to take advantage of this system. Because of this, and to avoid dependency on core code from jQuery UI, the plugin functionality was moved to a separate file.
Please use [jQuery UI Touch Punch](https://github.com/furf/jquery-ui-touch-punch) to make jQuery UI Draggable/Resizable
working on touch-based devices.
To ensure gridstack continues to work, either include the additional `gridstack.jQueryUI.js` file into your HTML or use `gridstack.all.js`:
```html
<script src="gridstack.js"></script>
<script src="gridstack.jQueryUI.js"></script>
```
or
```html
<script src="gridstack.all.js"></script>
<script src="jquery.ui.touch-punch.min.js"></script>
```
We're working on implementing support for other drag'n'drop libraries through the new plugin system.
Also `alwaysShowResizeHandle` option may be useful:
```js
var options = {
alwaysShowResizeHandle: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
};
GridStack.init(options);
```
If you're still experiencing issues on touch devices please check [#444](https://github.com/gridstack/gridstack.js/issues/444)
## Migrating to v1.0.0
v1.0.0 removed Jquery from the API and external dependencies, which will require some code changes. Here is a list of the changes:
1. your code only needs to include `gridstack.all.js` and `gristack.css` (don't include other) and is recommended you do that as internal dependencies will change. Right now jquery+jquery-ui (trimmed versions) are still being used internally for a short while.
2. code change:
**OLD** initializing code + adding a widget + adding an event:
```js
// initialization returned Jquery element, requiring second call to get GridStack var
$('.grid-stack').gridstack(opts?);
var grid = $('.grid-stack').data('grid-stack');
// returned Jquery element
grid.addWidget($('<div><div class="grid-stack-item-content"> test </div></div>'), {width: 2});
// jquery event handler
$('.grid-stack').on('added', function(e, items) {/* items contains info */});
```
**NEW**
```js
// element identifier defaults to '.grid-stack', returns the grid
// for Typescript use window.GridStack.init()
var grid = GridStack.init(opts?, element?);
// returns DOM element
grid.addWidget('<div><div class="grid-stack-item-content"> test </div></div>', {width: 2});
// event handler
grid.on('added', function(e, items) {/* items contains info */});
```
Other vars/global changes
```
`GridStackUI` --> `GridStack`
`GridStackUI.GridStackEngine` --> `GridStack.Engine`
`grid.container` (jquery grid wrapper) --> `grid.el` (grid DOM element)
`grid.grid` (GridStackEngine) --> `grid.engine`
`grid.setColumn(N)` --> `grid.column(N)` and new `grid.column()` to get value, old API still supported though
```
Recommend looking at the [many samples](../demo) for more code examples.
We're working on implementing support for other drag'n'drop libraries through the plugin system. Right now it is still jquery-ui based (but minimal build content)
Changes

@@ -303,0 +322,0 @@ =====

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc