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 3.1.4 to 3.1.5

53

dist/gridstack-dd.js
"use strict";
// gridstack-GridStackDD.get().ts 3.1.4 @preserve
// gridstack-GridStackDD.get().ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -86,10 +86,20 @@ /**

let node = el.gridstackNode;
if (node && node.grid === this) {
return true; // set accept drop to true on ourself (which we ignore) so we don't get "can't drop" icon in HTML5 mode while moving
}
// set accept drop to true on ourself (which we ignore) so we don't get "can't drop" icon in HTML5 mode while moving
if (node && node.grid === this)
return true;
// check for accept method or class matching
let canAccept = true;
if (typeof this.opts.acceptWidgets === 'function') {
return this.opts.acceptWidgets(el);
canAccept = this.opts.acceptWidgets(el);
}
let selector = (this.opts.acceptWidgets === true ? '.grid-stack-item' : this.opts.acceptWidgets);
return el.matches(selector);
else {
let selector = (this.opts.acceptWidgets === true ? '.grid-stack-item' : this.opts.acceptWidgets);
canAccept = el.matches(selector);
}
// finally check to make sure we actually have space left #1571
if (canAccept && node && this.opts.maxRow) {
let n = { w: node.w, h: node.h, minW: node.minW, minH: node.minH }; // only width/height matters
canAccept = this.engine.willItFit(n);
}
return canAccept;
}

@@ -125,5 +135,4 @@ })

let node = el.gridstackNode;
if (!node) {
if (!node)
return;
}
// clear any added flag now that we are leaving #1484

@@ -150,5 +159,4 @@ delete node._added;

// ignore drop on ourself from ourself - dragend will handle the simple move instead
if (node && node.grid === this) {
if (node && node.grid === this)
return false;
}
this.placeholder.remove();

@@ -165,5 +173,4 @@ // notify previous grid of removal

}
if (!node) {
if (!node)
return false;
}
// use existing placeholder node as it's already in our list with drop location

@@ -334,3 +341,3 @@ if (wasAdded) {

let x = Math.round(ui.position.left / cellWidth);
let y = Math.floor((ui.position.top + cellHeight / 2) / cellHeight);
let y = Math.round(ui.position.top / cellHeight);
let w;

@@ -343,3 +350,3 @@ let h;

// if inTrash, outside of the bounds or added to another grid (#393) temporarily remove it from us
if (el.dataset.inTrashZone || x < 0 || x >= this.engine.column || y < 0 || (!this.engine.float && y > this.engine.getRow()) || node._added) {
if (el.dataset.inTrashZone || node._added || this.engine.isOutside(x, y, node)) {
if (node._temporaryRemoved)

@@ -468,10 +475,8 @@ return;

gridstack_1.GridStack.prototype.movable = function (els, val) {
if (this.opts.staticGrid) {
return this;
} // can't move a static grid!
if (this.opts.staticGrid)
return this; // can't move a static grid!
gridstack_1.GridStack.getElements(els).forEach(el => {
let node = el.gridstackNode;
if (!node || node.locked) {
if (!node || node.locked)
return;
}
node.noMove = !(val || false);

@@ -496,10 +501,8 @@ if (node.noMove) {

gridstack_1.GridStack.prototype.resizable = function (els, val) {
if (this.opts.staticGrid) {
return this;
} // can't resize a static grid!
if (this.opts.staticGrid)
return this; // can't resize a static grid!
gridstack_1.GridStack.getElements(els).forEach(el => {
let node = el.gridstackNode;
if (!node || node.locked) {
if (!node || node.locked)
return;
}
node.noResize = !(val || false);

@@ -506,0 +509,0 @@ if (node.noResize) {

"use strict";
// gridstack-ddi.ts 3.1.4 @preserve
// gridstack-ddi.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -4,0 +4,0 @@ /**

@@ -28,2 +28,4 @@ import { GridStackNode } from './types';

commit(): GridStackEngine;
/** return any intercepted node with the given area, skipping the passed in node (usually self) */
collide(node: GridStackNode, area?: GridStackNode): GridStackNode;
isAreaEmpty(x: number, y: number, w: number, h: number): boolean;

@@ -49,2 +51,4 @@ /** re-layout grid items to reclaim any empty space */

willItFit(node: GridStackNode): boolean;
/** return true if the passed in node (x,y) is being dragged outside of the grid, and not added to bottom */
isOutside(x: number, y: number, node: GridStackNode): boolean;
isNodeChangedPosition(node: GridStackNode, x: number, y: number, w?: number, h?: number): boolean;

@@ -51,0 +55,0 @@ moveNode(node: GridStackNode, x: number, y: number, w?: number, h?: number, noPack?: boolean): GridStackNode;

"use strict";
// gridstack-engine.ts 3.1.4 @preserve
// gridstack-engine.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -55,6 +55,5 @@ /**

while (true) {
let collisionNode = this.nodes.find(n => n !== node && utils_1.Utils.isIntercepted(n, nn), { node: node, nn: nn });
if (!collisionNode) {
let collisionNode = this.collide(node, nn);
if (!collisionNode)
return this;
}
let moved;

@@ -68,19 +67,18 @@ if (collisionNode.locked) {

}
if (!moved) {
return this;
} // break inf loop if we couldn't move after all (ex: maxRow, fixed)
if (!moved)
return this; // break inf loop if we couldn't move after all (ex: maxRow, fixed)
}
}
/** return any intercepted node with the given area, skipping the passed in node (usually self) */
collide(node, area = node) {
return this.nodes.find(n => n !== node && utils_1.Utils.isIntercepted(n, area));
}
isAreaEmpty(x, y, w, h) {
let nn = { x: x || 0, y: y || 0, w: w || 1, h: h || 1 };
let collisionNode = this.nodes.find(n => {
return utils_1.Utils.isIntercepted(n, nn);
});
return !collisionNode;
return !this.collide(nn);
}
/** re-layout grid items to reclaim any empty space */
compact() {
if (this.nodes.length === 0) {
if (this.nodes.length === 0)
return this;
}
this.batchUpdate();

@@ -102,5 +100,4 @@ this._sortNodes();

set float(val) {
if (this._float === val) {
if (this._float === val)
return;
}
this._float = val || false;

@@ -130,5 +127,3 @@ if (!val) {

let box = { x: n.x, y: newY, w: n.w, h: n.h };
let collisionNode = this.nodes
.slice(0, i)
.find(bn => utils_1.Utils.isIntercepted(box, bn), { n: n, newY: newY });
let collisionNode = this.nodes.slice(0, i).find(bn => utils_1.Utils.isIntercepted(box, bn));
if (!collisionNode) {

@@ -144,5 +139,4 @@ n._dirty = true;

this.nodes.forEach((n, i) => {
if (n.locked) {
if (n.locked)
return this;
}
while (n.y > 0) {

@@ -153,6 +147,4 @@ let newY = n.y - 1;

if (i > 0) {
let collisionNode = this.nodes
.slice(0, i)
.find(bn => utils_1.Utils.isIntercepted(box, bn), { n: n, newY: newY });
canBeMoved = collisionNode === undefined;
let collisionNode = this.nodes.slice(0, i).find(bn => utils_1.Utils.isIntercepted(box, bn));
canBeMoved = !collisionNode;
}

@@ -291,5 +283,4 @@ if (!canBeMoved) {

_notify(nodes, removeDOM = true) {
if (this.batchMode) {
if (this.batchMode)
return this;
}
nodes = (nodes === undefined ? [] : (Array.isArray(nodes) ? nodes : [nodes]));

@@ -303,5 +294,4 @@ let dirtyNodes = nodes.concat(this.getDirtyNodes());

cleanNodes() {
if (this.batchMode) {
if (this.batchMode)
return this;
}
this.nodes.forEach(n => { delete n._dirty; });

@@ -321,3 +311,3 @@ return this;

let box = { x, y, w: node.w, h: node.h };
if (!this.nodes.find(n => utils_1.Utils.isIntercepted(box, n), { x, y, node })) {
if (!this.nodes.find(n => utils_1.Utils.isIntercepted(box, n))) {
node.x = x;

@@ -354,5 +344,4 @@ node.y = y;

delete this._layouts;
if (this.nodes.length === 0) {
if (this.nodes.length === 0)
return this;
}
if (removeDOM) {

@@ -410,2 +399,30 @@ this.nodes.forEach(n => { n._id = null; }); // hint that node is being removed

}
/** return true if the passed in node (x,y) is being dragged outside of the grid, and not added to bottom */
isOutside(x, y, node) {
// simple outside boundaries
if (x < 0 || x >= this.column || y < 0)
return true;
if (this.maxRow)
return (y >= this.maxRow);
else if (this.float)
return false; // infinite grow with no maxRow
// see if dragging PAST bottom (row+1)
let row = this.getRow();
if (y < row || y === 0)
return false;
if (y > row)
return true;
// else check to see if we can add that item to the bottom... (y == row)
if (!node._temporaryRemoved) {
let clone = new GridStackEngine({
column: this.column,
float: this.float,
nodes: this.nodes.filter(n => n !== node).map(n => { return Object.assign({}, n); })
});
let nn = Object.assign(Object.assign({}, node), { x, y });
clone.addNode(nn);
return nn.y === node.y && nn.x === node.x; // didn't actually move, so last row was a drag out and not a new place...
}
return node._temporaryRemoved; // if still outside so we don't flicker back & forth
}
isNodeChangedPosition(node, x, y, w, h) {

@@ -442,5 +459,4 @@ if (typeof x !== 'number') {

moveNode(node, x, y, w, h, noPack) {
if (node.locked) {
if (node.locked)
return null;
}
if (typeof x !== 'number') {

@@ -572,5 +588,4 @@ x = node.x;

updateNodeWidths(oldColumn, column, nodes, layout = 'moveScale') {
if (!this.nodes.length || oldColumn === column) {
if (!this.nodes.length || oldColumn === column)
return this;
}
// cache the current layout in case they want to go back (like 12 -> 1 -> 12) as it requires original data

@@ -577,0 +592,0 @@ this.cacheLayout(this.nodes, oldColumn);

@@ -1,29 +0,29 @@

// dd-base-impl.ts 3.1.4 @preserve
// dd-base-impl.ts 3.1.5 @preserve
// dd-draggable.ts 3.1.4 @preserve
// dd-draggable.ts 3.1.5 @preserve
// dd-droppable.ts 3.1.4 @preserve
// dd-droppable.ts 3.1.5 @preserve
// dd-elements.ts 3.1.4 @preserve
// dd-elements.ts 3.1.5 @preserve
// dd-manager.ts 3.1.4 @preserve
// dd-manager.ts 3.1.5 @preserve
// dd-resizable-handle.ts 3.1.4 @preserve
// dd-resizable-handle.ts 3.1.5 @preserve
// dd-resizable.ts 3.1.4 @preserve
// dd-resizable.ts 3.1.5 @preserve
// dd-utils.ts 3.1.4 @preserve
// dd-utils.ts 3.1.5 @preserve
// gridstack-GridStackDD.get().ts 3.1.4 @preserve
// gridstack-GridStackDD.get().ts 3.1.5 @preserve
// gridstack-dd-native.ts 3.1.4 @preserve
// gridstack-dd-native.ts 3.1.5 @preserve
// gridstack-ddi.ts 3.1.4 @preserve
// gridstack-ddi.ts 3.1.5 @preserve
// gridstack-engine.ts 3.1.4 @preserve
// gridstack-engine.ts 3.1.5 @preserve
// gridstack.ts 3.1.4 @preserve
// gridstack.ts 3.1.5 @preserve
// index.html5.ts 3.1.4 - everything you need for a Grid that uses HTML5 native drag&drop (work in progress) @preserve
// index.html5.ts 3.1.5 - everything you need for a Grid that uses HTML5 native drag&drop (work in progress) @preserve
// utils.ts 3.1.4 @preserve
// utils.ts 3.1.5 @preserve

@@ -32,14 +32,14 @@ /*!

// gridstack-GridStackDD.get().ts 3.1.4 @preserve
// gridstack-GridStackDD.get().ts 3.1.5 @preserve
// gridstack-dd-jqueryui.ts 3.1.3-dev @preserve
// gridstack-ddi.ts 3.1.4 @preserve
// gridstack-ddi.ts 3.1.5 @preserve
// gridstack-engine.ts 3.1.4 @preserve
// gridstack-engine.ts 3.1.5 @preserve
// gridstack.ts 3.1.4 @preserve
// gridstack.ts 3.1.5 @preserve
// index.jq.ts 3.1.4 - everything you need for a Grid that uses Jquery-ui drag&drop (original, full feature) @preserve
// index.jq.ts 3.1.5 - everything you need for a Grid that uses Jquery-ui drag&drop (original, full feature) @preserve
// utils.ts 3.1.4 @preserve
// utils.ts 3.1.5 @preserve
/*! For license information please see gridstack-static.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GridStack=e():t.GridStack=e()}(self,(function(){return(()=>{"use strict";var t={334:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});class i{static registerPlugin(t){return i.ddi=new t,i.ddi}static get(){return i.ddi||i.registerPlugin(i)}remove(t){return this}}e.GridStackDDI=i},62:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const s=i(593);class o{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.getGridHeight=s.obsolete(this,o.prototype.getRow,"getGridHeight","getRow","v1.0.0"),this.column=t.column||12,this.onChange=t.onChange,this._float=t.float,this.maxRow=t.maxRow,this.nodes=t.nodes||[]}batchUpdate(){return this.batchMode||(this.batchMode=!0,this._prevFloat=this._float,this._float=!0),this}commit(){return this.batchMode?(this.batchMode=!1,this._float=this._prevFloat,delete this._prevFloat,this._packNodes(),this._notify(),this):this}_fixCollisions(t){this._sortNodes(-1);let e=t,i=Boolean(this.nodes.find((t=>t.locked)));for(this.float||i||(e={x:0,y:t.y,w:this.column,h:t.h});;){let i,o=this.nodes.find((i=>i!==t&&s.Utils.isIntercepted(i,e)),{node:t,nn:e});if(!o)return this;if(i=o.locked?this.moveNode(t,t.x,o.y+o.h,t.w,t.h,!0):this.moveNode(o,o.x,t.y+t.h,o.w,o.h,!0),!i)return this}}isAreaEmpty(t,e,i,o){let n={x:t||0,y:e||0,w:i||1,h:o||1};return!this.nodes.find((t=>s.Utils.isIntercepted(t,n)))}compact(){if(0===this.nodes.length)return this;this.batchUpdate(),this._sortNodes();let t=this.nodes;return this.nodes=[],t.forEach((t=>{t.noMove||t.locked||(t.autoPosition=!0),this.addNode(t,!1),t._dirty=!0})),this.commit(),this}set float(t){this._float!==t&&(this._float=t||!1,t||(this._packNodes(),this._notify()))}get float(){return this._float||!1}_sortNodes(t){return this.nodes=s.Utils.sort(this.nodes,t,this.column),this}_packNodes(){return this._sortNodes(),this.float?this.nodes.forEach(((t,e)=>{if(t._updating||void 0===t._packY||t.y===t._packY)return this;let i=t.y;for(;i>=t._packY;){let o={x:t.x,y:i,w:t.w,h:t.h};this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(o,t)),{n:t,newY:i})||(t._dirty=!0,t.y=i),--i}})):this.nodes.forEach(((t,e)=>{if(t.locked)return this;for(;t.y>0;){let i=t.y-1,o=0===e,n={x:t.x,y:i,w:t.w,h:t.h};if(e>0&&(o=void 0===this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(n,t)),{n:t,newY:i})),!o)break;t._dirty=t.y!==i,t.y=i}})),this}prepareNode(t,e){(t=t||{})._id=t._id||o._idSeq++,void 0!==t.x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);let i={x:0,y:0,w:1,h:1};return s.Utils.defaults(t,i),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,"string"==typeof t.x&&(t.x=Number(t.x)),"string"==typeof t.y&&(t.y=Number(t.y)),"string"==typeof t.w&&(t.w=Number(t.w)),"string"==typeof t.h&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=i.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=i.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=i.w),isNaN(t.h)&&(t.h=i.h),t.maxW&&(t.w=Math.min(t.w,t.maxW)),t.maxH&&(t.h=Math.min(t.h,t.maxH)),t.minW&&(t.w=Math.max(t.w,t.minW)),t.minH&&(t.h=Math.max(t.h,t.minH)),t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),t}getDirtyNodes(t){if(t){let t=[];return this.nodes.forEach((e=>{e._dirty&&(e.y===e._origY&&e.x===e._origX&&e.w===e._origW&&e.h===e._origH?delete e._dirty:t.push(e))})),t}return this.nodes.filter((t=>t._dirty))}_notify(t,e=!0){if(this.batchMode)return this;let i=(t=void 0===t?[]:Array.isArray(t)?t:[t]).concat(this.getDirtyNodes());return this.onChange&&this.onChange(i,e),this}cleanNodes(){return this.batchMode||this.nodes.forEach((t=>{delete t._dirty})),this}addNode(t,e=!1){if((t=this.prepareNode(t)).autoPosition){this._sortNodes();for(let e=0;;++e){let i=e%this.column,o=Math.floor(e/this.column);if(i+t.w>this.column)continue;let n={x:i,y:o,w:t.w,h:t.h};if(!this.nodes.find((t=>s.Utils.isIntercepted(n,t)),{x:i,y:o,node:t})){t.x=i,t.y=o,delete t.autoPosition;break}}}return this.nodes.push(t),e&&this.addedNodes.push(t),this._fixCollisions(t),this._packNodes(),this._notify(),t}removeNode(t,e=!0,i=!1){return i&&this.removedNodes.push(t),t._id=null,this.nodes=this.nodes.filter((e=>e!==t)),this.float||this._packNodes(),this._notify(t,e),this}removeAll(t=!0){return delete this._layouts,0===this.nodes.length||(t&&this.nodes.forEach((t=>{t._id=null})),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes,t)),this}canMoveNode(t,e,i,s,n){if(!this.isNodeChangedPosition(t,e,i,s,n))return!1;let r,l=this.nodes.some((t=>t.locked));if(!this.maxRow&&!l)return!0;let h=new o({column:this.column,float:this.float,nodes:this.nodes.map((e=>e===t?(r=Object.assign({},e),r):Object.assign({},e)))});if(!r)return!0;h.moveNode(r,e,i,s,n);let a=!0;return l&&(a=!h.nodes.some((t=>t.locked&&t._dirty&&t!==r))),this.maxRow&&a&&(a=h.getRow()<=this.maxRow),a}willItFit(t){if(!this.maxRow)return!0;let e=new o({column:this.column,float:this.float,nodes:this.nodes.map((t=>Object.assign({},t)))});return e.addNode(t),e.getRow()<=this.maxRow}isNodeChangedPosition(t,e,i,s,o){return"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h),t.maxW&&(s=Math.min(s,t.maxW)),t.maxH&&(o=Math.min(o,t.maxH)),t.minW&&(s=Math.max(s,t.minW)),t.minH&&(o=Math.max(o,t.minH)),t.x!==e||t.y!==i||t.w!==s||t.h!==o}moveNode(t,e,i,s,o,n){if(t.locked)return null;"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h);let r=t.w!==s||t.h!==o,l={x:e,y:i,w:s,h:o,maxW:t.maxW,maxH:t.maxH,minW:t.minW,minH:t.minH};return l=this.prepareNode(l,r),t.x===l.x&&t.y===l.y&&t.w===l.w&&t.h===l.h?null:(t._dirty=!0,t.x=t._lastTriedX=l.x,t.y=t._lastTriedY=l.y,t.w=t._lastTriedW=l.w,t.h=t._lastTriedH=l.h,this._fixCollisions(t),n||(this._packNodes(),this._notify()),t)}getRow(){return this.nodes.reduce(((t,e)=>Math.max(t,e.y+e.h)),0)}beginUpdate(t){return t._updating||(t._updating=!0,this.nodes.forEach((t=>{t._packY=t.y}))),this}endUpdate(){let t=this.nodes.find((t=>t._updating));return t&&(delete t._updating,this.nodes.forEach((t=>{delete t._packY}))),this}save(t=!0){let e=[];return s.Utils.sort(this.nodes),this.nodes.forEach((i=>{let s={};for(let t in i)"_"!==t[0]&&null!==i[t]&&void 0!==i[t]&&(s[t]=i[t]);t||delete s.el,delete s.grid,s.autoPosition||delete s.autoPosition,s.noResize||delete s.noResize,s.noMove||delete s.noMove,s.locked||delete s.locked,e.push(s)})),e}layoutsNodesChange(t){return!this._layouts||this._ignoreLayoutsNodeChange||this._layouts.forEach(((e,i)=>{if(!e||i===this.column)return this;i<this.column?this._layouts[i]=void 0:t.forEach((t=>{let s=e.find((e=>e._id===t._id));if(!s)return this;let o=i/this.column;t.y!==t._origY&&(s.y+=t.y-t._origY),t.x!==t._origX&&(s.x=Math.round(t.x*o)),t.w!==t._origW&&(s.w=Math.round(t.w*o))}))})),this}updateNodeWidths(t,e,i,o="moveScale"){if(!this.nodes.length||t===e)return this;if(this.cacheLayout(this.nodes,t),1===e&&i&&i.length){let t=0;i.forEach((e=>{e.x=0,e.w=1,e.y=Math.max(e.y,t),t=e.y+e.h}))}else i=s.Utils.sort(this.nodes,-1,t);let n=this._layouts[e]||[],r=this._layouts.length-1;0===n.length&&e>t&&e<r&&(n=this._layouts[r]||[],n.length&&(t=r,n.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w)})),n=[]));let l=[];if(n.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w,l.push(i[e]),i.splice(e,1))})),i.length)if("function"==typeof o)o(e,t,l,i);else{let s=e/t,n="move"===o||"moveScale"===o,r="scale"===o||"moveScale"===o;i.forEach((i=>{i.x=1===e?0:n?Math.round(i.x*s):Math.min(i.x,e-1),i.w=1===e||1===t?1:r?Math.round(i.w*s)||1:Math.min(i.w,e),l.push(i)})),i=[]}return l=s.Utils.sort(l,-1,e),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],l.forEach((t=>{this.addNode(t,!1),t._dirty=!0}),this),this.commit(),delete this._ignoreLayoutsNodeChange,this}saveInitial(){return this.nodes.forEach((t=>{t._origX=t.x,t._origY=t.y,t._origW=t.w,t._origH=t.h,delete t._dirty})),this}cacheLayout(t,e,i=!1){let s=[];return t.forEach(((t,e)=>{t._id=t._id||o._idSeq++,s[e]={x:t.x,y:t.y,w:t.w,_id:t._id}})),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cleanupNode(t){for(let e in t)"_"===e[0]&&delete t[e];return this}}e.GridStackEngine=o,o._idSeq=1},270:(t,e,i)=>{function s(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}Object.defineProperty(e,"__esModule",{value:!0});const o=i(62),n=i(593),r=i(334);s(i(593)),s(i(62)),s(i(334));const l={column:12,minRow:0,maxRow:0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:!1,cellHeight:"auto",margin:10,auto:!0,minWidth:768,float:!1,staticGrid:!1,animate:!0,alwaysShowResizeHandle:!1,resizable:{autoHide:!0,handles:"se"},draggable:{handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},dragIn:void 0,dragInOptions:{revert:"invalid",handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},disableDrag:!1,disableResize:!1,rtl:"auto",removable:!1,removableOptions:{accept:".grid-stack-item"},removeTimeout:2e3,marginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:!1,oneColumnModeDomSort:!1};class h{constructor(t,e={}){this._gsEventHandler={},this.el=t,e=e||{},n.obsoleteOpts(e,"verticalMargin","margin","v2.0"),n.obsoleteAttr(this.el,"data-gs-current-height","gs-current-row","v1.0.0"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=n.Utils.toNumber(t.getAttribute("gs-row")),s=Object.assign(Object.assign({},l),{column:n.Utils.toNumber(t.getAttribute("gs-column"))||12,minRow:i||n.Utils.toNumber(t.getAttribute("gs-min-row"))||0,maxRow:i||n.Utils.toNumber(t.getAttribute("gs-max-row"))||0,staticGrid:n.Utils.toBool(t.getAttribute("gs-static"))||!1,_styleSheetClass:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:{autoHide:!e.alwaysShowResizeHandle,handles:"se"},draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"},removableOptions:{accept:"."+(e.itemClass||"grid-stack-item")}});t.getAttribute("gs-animate")&&(s.animate=n.Utils.toBool(t.getAttribute("gs-animate"))),this.opts=n.Utils.defaults(e,s),e=null,this.initMargin(),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===t.style.direction),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");let r=n.Utils.closestByClass(this.el,l.itemClass);if(r&&r.gridstackNode&&(this.opts._isNested=r.gridstackNode,this.opts._isNested.subGrid=this,this.el.classList.add("grid-stack-nested")),this._isAutoCellHeight="auto"===this.opts.cellHeight,this._isAutoCellHeight){let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t,!1)}else this.cellHeight(this.opts.cellHeight,!1);if(this.el.classList.add(this.opts._styleSheetClass),this._setStaticClass(),this.engine=new o.GridStackEngine({column:this.opts.column,float:this.opts.float,maxRow:this.opts.maxRow,onChange:(t,e=!0)=>{let i=0;this.engine.nodes.forEach((t=>{i=Math.max(i,t.y+t.h)})),t.forEach((t=>{let i=t.el;e&&null===t._id?i&&i.parentNode&&i.parentNode.removeChild(i):this._writePosAttr(i,t.x,t.y,t.w,t.h)})),this._updateStyles(!1,i)}}),this.opts.auto){this.batchUpdate();let t=[];this.getGridItems().forEach((e=>{let i=parseInt(e.getAttribute("gs-x")),s=parseInt(e.getAttribute("gs-y"));t.push({el:e,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(s)?1e3:s)*this.opts.column})})),t.sort((t=>t.i)).forEach((t=>this._prepareElement(t.el))),this.commit()}this.engine.saveInitial(),this.setAnimation(this.opts.animate);let h=document.createElement("div");h.className="placeholder-content",h.innerHTML=this.opts.placeholderText,this.placeholder=document.createElement("div"),this.placeholder.classList.add(this.opts.placeholderClass,s.itemClass,this.opts.itemClass),this.placeholder.appendChild(h),this._updateStyles(),this._setupDragIn(),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}static init(t={},e=".grid-stack"){let i=h.getGridElement(e);return i?(i.gridstack||(i.gridstack=new h(i,Object.assign({},t))),i.gridstack):("string"==typeof e?console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'):console.error("GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let i=[];return h.getGridElements(e).forEach((e=>{e.gridstack||(e.gridstack=new h(e,Object.assign({},t))),i.push(e.gridstack)})),0===i.length&&console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'),i}static addGrid(t,e={}){if(!t)return null;let i=document.implementation.createHTMLDocument();i.body.innerHTML=`<div class="grid-stack ${e.class||""}"></div>`;let s=i.body.children[0];t.append(s);let o=h.init(e,s);return e.children&&o.load(e.children),o}addWidget(t,e){if(arguments.length>2){console.warn("gridstack.ts: `addWidget(el, x, y, width...)` is deprecated. Use `addWidget({x, y, w, content, ...})`. It will be removed soon");let e=arguments,i=1,s={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++],minW:e[i++],maxW:e[i++],minH:e[i++],maxH:e[i++],id:e[i++]};return this.addWidget(t,s)}let i;if("string"==typeof t){let e=document.implementation.createHTMLDocument();e.body.innerHTML=t,i=e.body.children[0]}else if(0===arguments.length||1===arguments.length&&(void 0!==(s=t).x||void 0!==s.y||void 0!==s.w||void 0!==s.h||void 0!==s.content)){let s=t&&t.content||"";e=t;let o=document.implementation.createHTMLDocument();o.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${s}</div></div>`,i=o.body.children[0]}else i=t;var s;let o=this._readAttr(i);return e=Object.assign({},e||{}),n.Utils.defaults(e,o),this.engine.prepareNode(e),this._writeAttr(i,e),this._insertNotAppend?this.el.prepend(i):this.el.appendChild(i),this._prepareElement(i,!0,e),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),i}save(t=!0,e=!1){let i=this.engine.save(t);if(t&&i.forEach((t=>{if(t.el&&!t.subGrid){let e=t.el.querySelector(".grid-stack-item-content");t.content=e?e.innerHTML:void 0,t.content||delete t.content,delete t.el}})),e){i.forEach((i=>{i.subGrid&&(i.subGrid=i.subGrid.save(t,e))}));let s=Object.assign({},this.opts);return s.marginBottom===s.marginTop&&s.marginRight===s.marginLeft&&s.marginTop===s.marginRight&&(s.margin=s.marginTop,delete s.marginTop,delete s.marginRight,delete s.marginBottom,delete s.marginLeft),s.rtl===("rtl"===this.el.style.direction)&&(s.rtl="auto"),this._isAutoCellHeight&&(s.cellHeight="auto"),n.Utils.removeInternalAndSame(s,l),s.children=i,s}return i}load(t,e=!0){let i=h.Utils.sort(t,-1,this._prevColumn||this.opts.column);this._insertNotAppend=!0,this._prevColumn&&this._prevColumn!==this.opts.column&&i.some((t=>t.x+t.w>this.opts.column))&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(i,this._prevColumn,!0));let s=[];return this.batchUpdate(),e&&[...this.engine.nodes].forEach((t=>{i.find((e=>t.id===e.id))||("function"==typeof e?e(this,t,!1):(s.push(t),this.removeWidget(t.el,!0,!1)))})),i.forEach((t=>{let i=t.id||0===t.id?this.engine.nodes.find((e=>e.id===t.id)):void 0;if(i){if(this.update(i.el,t),t.subGrid&&t.subGrid.children){let e=i.el.querySelector(".grid-stack");e&&e.gridstack&&(e.gridstack.load(t.subGrid.children),this._insertNotAppend=!0)}}else if(e&&(t="function"==typeof e?e(this,t,!0).gridstackNode:this.addWidget(t).gridstackNode).subGrid){let e=t.el.querySelector(".grid-stack-item-content");t.subGrid=h.addGrid(e,t.subGrid)}})),this.engine.removedNodes=s,this.commit(),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,this}batchUpdate(){return this.engine.batchUpdate(),this}getCellHeight(t=!1){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight&&(!t||!this.opts.cellHeightUnit||"px"===this.opts.cellHeightUnit))return this.opts.cellHeight;let e=this.el.querySelector("."+this.opts.itemClass),i=n.Utils.toNumber(e.getAttribute("gs-h"));return Math.round(e.offsetHeight/i)}cellHeight(t,e=!0){let i=n.Utils.parseHeight(t);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h||(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,e&&this._updateStyles(!0),this._resizeNestedGrids(this.el)),this}cellWidth(){return(this.el.offsetWidth||this.el.parentElement.offsetWidth||window.innerWidth)/this.opts.column}commit(){return this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent(),this}compact(){return this.engine.compact(),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(this.opts.column===t)return this;let i,s=this.opts.column;return 1===t?this._prevColumn=s:delete this._prevColumn,this.el.classList.remove("grid-stack-"+s),this.el.classList.add("grid-stack-"+t),this.opts.column=this.engine.column=t,1===t&&this.opts.oneColumnModeDomSort&&(i=[],this.getGridItems().forEach((t=>{t.gridstackNode&&i.push(t.gridstackNode)})),i.length||(i=void 0)),this.engine.updateNodeWidths(s,t,i,e),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter((t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass)))}destroy(t=!0){if(this.el)return this._updateWindowResizeEvent(!0),this.setStatic(!0),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.classList.remove(this.opts._styleSheetClass)),this._removeStylesheet(),delete this.opts._isNested,delete this.opts,delete this.placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}disable(){if(!this.opts.staticGrid)return this.enableMove(!1),this.enableResize(!1),this._triggerEvent("disable"),this}enable(){if(!this.opts.staticGrid)return this.enableMove(!0),this.enableResize(!0),this._triggerEvent("enable"),this}enableMove(t,e=!0){return this.opts.staticGrid||(this.getGridItems().forEach((e=>this.movable(e,t))),e&&(this.opts.disableDrag=!t)),this}enableResize(t,e=!0){return this.opts.staticGrid||(this.getGridItems().forEach((e=>this.resizable(e,t))),e&&(this.opts.disableResize=!t)),this}float(t){return this.engine.float=t,this._triggerChangeEvent(),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i,s=this.el.getBoundingClientRect();i=e?{top:s.top+document.documentElement.scrollTop,left:s.left}:{top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-i.left,n=t.top-i.top,r=s.width/this.opts.column,l=s.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/r),y:Math.floor(n/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t){let e=h.getElement(t);return this._prepareElement(e,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),e}on(t,e){if(-1!==t.indexOf(" "))return t.split(" ").forEach((t=>this.on(t,e))),this;if("change"===t||"added"===t||"removed"===t||"enable"===t||"disable"===t){let i="enable"===t||"disable"===t;this._gsEventHandler[t]=i?t=>e(t):t=>e(t,t.detail),this.el.addEventListener(t,this._gsEventHandler[t])}else"dragstart"===t||"dragstop"===t||"resizestart"===t||"resizestop"===t||"dropped"===t?this._gsEventHandler[t]=e:console.log("GridStack.on("+t+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.');return this}off(t){return-1!==t.indexOf(" ")?(t.split(" ").forEach((t=>this.off(t))),this):("change"!==t&&"added"!==t&&"removed"!==t&&"enable"!==t&&"disable"!==t||this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}removeWidget(t,e=!0,i=!0){return h.getElements(t).forEach((t=>{if(t.parentElement!==this.el)return;let s=t.gridstackNode;s||(s=this.engine.nodes.find((e=>t===e.el))),s&&(delete t.gridstackNode,r.GridStackDDI.get().remove(t),this.engine.removeNode(s,e,i),e&&t.parentElement&&t.remove())})),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(t=!0){return this.engine.nodes.forEach((t=>{delete t.el.gridstackNode,r.GridStackDDI.get().remove(t.el)})),this.engine.removeAll(t),this._triggerRemoveEvent(),this}setAnimation(t){return t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(t){return this.opts.staticGrid===t||(this.opts.staticGrid=t,this.engine.nodes.forEach((t=>this._prepareDragDropByNode(t))),this._setStaticClass()),this}update(t,e){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update({x, w, content, ...})`. It will be removed soon");let i=arguments,s=1;return e={x:i[s++],y:i[s++],w:i[s++],h:i[s++]},this.update(t,e)}return h.getElements(t).forEach((t=>{if(!t||!t.gridstackNode)return;let i=t.gridstackNode,s=Object.assign({},e);delete s.autoPosition;let o,n=["x","y","w","h"];if(n.some((t=>void 0!==s[t]&&s[t]!==i[t]))&&(o={},n.forEach((t=>{o[t]=void 0!==s[t]?s[t]:i[t],delete s[t]}))),!o&&(s.minW||s.minH||s.maxW||s.maxH)&&(o={}),s.content){let e=t.querySelector(".grid-stack-item-content");e&&e.innerHTML!==s.content&&(e.innerHTML=s.content),delete s.content}let r=!1,l=!1;for(const t in s)"_"!==t[0]&&i[t]!==s[t]&&(i[t]=s[t],r=!0,l=l||!this.opts.staticGrid&&("noResize"===t||"noMove"===t||"locked"===t));o&&(this.engine.cleanNodes(),this.engine.beginUpdate(i),this.engine.moveNode(i,o.x,o.y,o.w,o.h),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()),r&&this._writeAttr(t,i),l&&this._prepareDragDropByNode(i)})),this}margin(t){if(!("string"==typeof t&&t.split(" ").length>1)){let e=n.Utils.parseHeight(t);if(this.opts.marginUnit===e.unit&&this.opts.margin===e.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this.initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(t){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let t=arguments,e=0,i={x:t[e++],y:t[e++],w:t[e++],h:t[e++],autoPosition:t[e++]};return this.willItFit(i)}return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode||this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach((t=>{delete t._dirty})),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this}_triggerRemoveEvent(){return this.engine.batchMode||this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this}_triggerEvent(t,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t);return this.el.dispatchEvent(i),this}_removeStylesheet(){return this._styles&&(n.Utils.removeStylesheet(this._styles._id),delete this._styles),this}_updateStyles(t=!1,e){if(t&&this._removeStylesheet(),this._updateContainerHeight(),0===this.opts.cellHeight)return this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit,o=`.${this.opts._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let t="gridstack-style-"+(1e5*Math.random()).toFixed(),e=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=n.Utils.createStylesheet(t,e),!this._styles)return this;this._styles._id=t,this._styles._max=0,n.Utils.addCSSRule(this._styles,o,`min-height: ${i}${s}`);let r=this.opts.marginTop+this.opts.marginUnit,l=this.opts.marginBottom+this.opts.marginUnit,h=this.opts.marginRight+this.opts.marginUnit,a=this.opts.marginLeft+this.opts.marginUnit,d=`${o} > .grid-stack-item-content`,g=`.${this.opts._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;n.Utils.addCSSRule(this._styles,d,`top: ${r}; right: ${h}; bottom: ${l}; left: ${a};`),n.Utils.addCSSRule(this._styles,g,`top: ${r}; right: ${h}; bottom: ${l}; left: ${a};`),n.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-ne`,`right: ${h}`),n.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-e`,`right: ${h}`),n.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-se`,`right: ${h}; bottom: ${l}`),n.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-nw`,`left: ${a}`),n.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-w`,`left: ${a}`),n.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-sw`,`left: ${a}; bottom: ${l}`)}if((e=e||this._styles._max)>this._styles._max){let t=t=>i*t+s;for(let i=this._styles._max+1;i<=e;i++){let e=t(i);n.Utils.addCSSRule(this._styles,`${o}[gs-y="${i-1}"]`,`top: ${t(i-1)}`),n.Utils.addCSSRule(this._styles,`${o}[gs-h="${i}"]`,`height: ${e}`),n.Utils.addCSSRule(this._styles,`${o}[gs-min-h="${i}"]`,`min-height: ${e}`),n.Utils.addCSSRule(this._styles,`${o}[gs-max-h="${i}"]`,`max-height: ${e}`)}this._styles._max=e}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.getRow(),e=parseInt(getComputedStyle(this.el)["min-height"]);if(e>0){let i=Math.round(e/this.getCellHeight(!0));t<i&&(t=i)}if(this.el.setAttribute("gs-current-row",String(t)),0===t)return this.el.style.removeProperty("height"),this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit;return i?(this.el.style.height=t*i+s,this):this}_resizeNestedGrids(t){return t.querySelectorAll(".grid-stack").forEach((t=>{t.gridstack&&t.gridstack.onParentResize()})),this}_prepareElement(t,e=!1,i){i||(t.classList.add(this.opts.itemClass),i=this._readAttr(t)),t.gridstackNode=i,i.el=t,i.grid=this;let s=Object.assign({},i);return i=this.engine.addNode(i,e),n.Utils.same(i,s)||this._writeAttr(t,i),this._prepareDragDropByNode(i),this}_writePosAttr(t,e,i,s,o){return null!=e&&t.setAttribute("gs-x",String(e)),null!=i&&t.setAttribute("gs-y",String(i)),s&&t.setAttribute("gs-w",String(s)),o&&t.setAttribute("gs-h",String(o)),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e.x,e.y,e.w,e.h);let i={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",resizeHandles:"gs-resize-handles"};for(const s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t){let e={};e.x=n.Utils.toNumber(t.getAttribute("gs-x")),e.y=n.Utils.toNumber(t.getAttribute("gs-y")),e.w=n.Utils.toNumber(t.getAttribute("gs-w")),e.h=n.Utils.toNumber(t.getAttribute("gs-h")),e.maxW=n.Utils.toNumber(t.getAttribute("gs-max-w")),e.minW=n.Utils.toNumber(t.getAttribute("gs-min-w")),e.maxH=n.Utils.toNumber(t.getAttribute("gs-max-h")),e.minH=n.Utils.toNumber(t.getAttribute("gs-min-h")),e.autoPosition=n.Utils.toBool(t.getAttribute("gs-auto-position")),e.noResize=n.Utils.toBool(t.getAttribute("gs-no-resize")),e.noMove=n.Utils.toBool(t.getAttribute("gs-no-move")),e.locked=n.Utils.toBool(t.getAttribute("gs-locked")),e.resizeHandles=t.getAttribute("gs-resize-handles"),e.id=t.getAttribute("gs-id");for(const t in e){if(!e.hasOwnProperty(t))return;e[t]||0===e[t]||delete e[t]}return e}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onParentResize(){if(this.el&&this.el.clientWidth){if(this._isAutoCellHeight&&n.Utils.throttle((()=>{let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t)}),100),!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.minWidth){if(this._oneColumnMode)return this;this._oneColumnMode=!0,this.column(1),this._resizeNestedGrids(this.el)}else{if(!this._oneColumnMode)return this;delete this._oneColumnMode,this.column(this._prevColumn),this._resizeNestedGrids(this.el)}return this}}_updateWindowResizeEvent(t=!1){const e=this._isAutoCellHeight||!this.opts.disableOneColumnMode;return!e||t||this.opts._isNested||this._windowResizeBind?!t&&e||!this._windowResizeBind||(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind):(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind),this.onParentResize()),this}static getElement(t=".grid-stack-item"){return n.Utils.getElement(t)}static getElements(t=".grid-stack-item"){return n.Utils.getElements(t)}static getGridElement(t){return h.getElement(t)}static getGridElements(t){return n.Utils.getElements(t)}initMargin(){let t,e=0,i=[];return"string"==typeof this.opts.margin&&(i=this.opts.margin.split(" ")),2===i.length?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):4===i.length?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=n.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),void 0===this.opts.marginTop?this.opts.marginTop=e:(t=n.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=t.h,delete this.opts.margin),void 0===this.opts.marginBottom?this.opts.marginBottom=e:(t=n.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=t.h,delete this.opts.margin),void 0===this.opts.marginRight?this.opts.marginRight=e:(t=n.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=t.h,delete this.opts.margin),void 0===this.opts.marginLeft?this.opts.marginLeft=e:(t=n.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=t.h,delete this.opts.margin),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}movable(t,e){return this}resizable(t,e){return this}_setupAcceptWidget(){return this}_setupRemoveDrop(){return this}_setupRemovingTimeout(t){return this}_clearRemovingTimeout(t){return this}_setupDragIn(){return this}_prepareDragDropByNode(t){return this}locked(t,e){return this.update(t,{locked:e})}maxWidth(t,e){return this.update(t,{maxW:e})}minWidth(t,e){return this.update(t,{minW:e})}maxHeight(t,e){return this.update(t,{maxH:e})}minHeight(t,e){return this.update(t,{minH:e})}move(t,e,i){return this.update(t,{x:e,y:i})}resize(t,e,i){return this.update(t,{w:e,h:i})}}e.GridStack=h,h.Utils=n.Utils,h.Engine=o.GridStackEngine},822:(t,e,i)=>{function s(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}Object.defineProperty(e,"__esModule",{value:!0}),s(i(593)),s(i(62)),s(i(334)),s(i(270))},593:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.obsolete=function(t,e,i,s,o){let n=(...n)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+o+" and has been replaced with `"+s+"`. It will be **completely** removed in v1.0"),e.apply(t,n));return n.prototype=e.prototype,n},e.obsoleteOpts=function(t,e,i,s){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.obsoleteOptsDel=function(t,e,i,s){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+s)},e.obsoleteAttr=function(t,e,i,s){let o=t.getAttribute(e);null!==o&&(t.setAttribute(i,o),console.warn("gridstack.js: attribute `"+e+"`="+o+" is deprecated on this object in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.Utils=class{static getElements(t){if("string"==typeof t){let e=document.querySelectorAll(t);return e.length||"."===t[0]||"#"===t[0]||(e=document.querySelectorAll("."+t),e.length||(e=document.querySelectorAll("#"+t))),Array.from(e)}return[t]}static getElement(t){if("string"==typeof t){if(!t.length)return null;if("#"===t[0])return document.getElementById(t.substring(1));if("."===t[0]||"["===t[0])return document.querySelector(t);if(!isNaN(+t[0]))return document.getElementById(t);let e=document.querySelector(t);return e||(e=document.getElementById(t)),e||(e=document.querySelector("."+t)),e}return t}static isIntercepted(t,e){return!(t.x+t.w<=e.x||e.x+e.w<=t.x||t.y+t.h<=e.y||e.y+e.h<=t.y)}static sort(t,e,i){if(!i){let e=t.map((t=>t.x+t.w));i=Math.max(...e)}return-1===e?t.sort(((t,e)=>e.x+e.y*i-(t.x+t.y*i))):t.sort(((t,e)=>t.x+t.y*i-(e.x+e.y*i)))}static createStylesheet(t,e){let i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),e?e.insertBefore(i,e.firstChild):(e=document.getElementsByTagName("head")[0]).appendChild(i),i.sheet}static removeStylesheet(t){let e=document.querySelector("STYLE[gs-style-id="+t+"]");e&&e.parentNode&&e.parentNode.removeChild(e)}static addCSSRule(t,e,i){"function"==typeof t.addRule?t.addRule(e,i):"function"==typeof t.insertRule&&t.insertRule(`${e}{${i}}`)}static toBool(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)}static toNumber(t){return null===t||0===t.length?void 0:Number(t)}static parseHeight(t){let e,i="px";if("string"==typeof t){let s=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!s)throw new Error("Invalid height");i=s[2]||"px",e=parseFloat(s[1])}else e=t;return{h:e,unit:i}}static defaults(t,...e){return e.forEach((e=>{for(const i in e){if(!e.hasOwnProperty(i))return;null===t[i]||void 0===t[i]?t[i]=e[i]:"object"==typeof e[i]&&"object"==typeof t[i]&&this.defaults(t[i],e[i])}})),t}static same(t,e){if("object"!=typeof t)return t==e;if(typeof t!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}static removeInternalAndSame(t,e){if("object"==typeof t&&"object"==typeof e)for(let i in t){let s=t[i];if(s&&"object"==typeof s){for(let t in s)s[t]!==e[i][t]&&"_"!==t[0]||delete s[t];Object.keys(s).length||delete t[i]}else s!==e[i]&&"_"!==i[0]||delete t[i]}}static closestByClass(t,e){for(;t=t.parentElement;)if(t.classList.contains(e))return t;return null}static throttle(t,e){let i=!1;return(...s)=>{i||(t.apply(this,s),i=!0,setTimeout((()=>i=!1),e))}}static removePositioningStyles(t){let e=t.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")}static getScrollParent(t){if(null===t)return document.documentElement;const e=getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowY)?t:this.getScrollParent(t.parentElement)}static updateScrollPosition(t,e,i){let s=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>o){let n=s.bottom-o,r=s.top,l=this.getScrollParent(t);if(null!==l){let h=l.scrollTop;s.top<0&&i<0?t.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=Math.abs(r)>Math.abs(i)?i:r:i>0&&(t.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=n>i?i:n),e.top+=l.scrollTop-h}}}static updateScrollResize(t,e,i){const s=this.getScrollParent(e),o=s.clientHeight,n=t.clientY<i,r=t.clientY>o-i;n?s.scrollBy({behavior:"smooth",top:t.clientY-i}):r&&s.scrollBy({behavior:"smooth",top:i-(o-t.clientY)})}}}},e={};return function i(s){if(e[s])return e[s].exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}(822)})().GridStack}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GridStack=e():t.GridStack=e()}(self,(function(){return(()=>{"use strict";var t={334:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});class i{static registerPlugin(t){return i.ddi=new t,i.ddi}static get(){return i.ddi||i.registerPlugin(i)}remove(t){return this}}e.GridStackDDI=i},62:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});const s=i(593);class o{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.getGridHeight=s.obsolete(this,o.prototype.getRow,"getGridHeight","getRow","v1.0.0"),this.column=t.column||12,this.onChange=t.onChange,this._float=t.float,this.maxRow=t.maxRow,this.nodes=t.nodes||[]}batchUpdate(){return this.batchMode||(this.batchMode=!0,this._prevFloat=this._float,this._float=!0),this}commit(){return this.batchMode?(this.batchMode=!1,this._float=this._prevFloat,delete this._prevFloat,this._packNodes(),this._notify(),this):this}_fixCollisions(t){this._sortNodes(-1);let e=t,i=Boolean(this.nodes.find((t=>t.locked)));for(this.float||i||(e={x:0,y:t.y,w:this.column,h:t.h});;){let i,s=this.collide(t,e);if(!s)return this;if(i=s.locked?this.moveNode(t,t.x,s.y+s.h,t.w,t.h,!0):this.moveNode(s,s.x,t.y+t.h,s.w,s.h,!0),!i)return this}}collide(t,e=t){return this.nodes.find((i=>i!==t&&s.Utils.isIntercepted(i,e)))}isAreaEmpty(t,e,i,s){let o={x:t||0,y:e||0,w:i||1,h:s||1};return!this.collide(o)}compact(){if(0===this.nodes.length)return this;this.batchUpdate(),this._sortNodes();let t=this.nodes;return this.nodes=[],t.forEach((t=>{t.noMove||t.locked||(t.autoPosition=!0),this.addNode(t,!1),t._dirty=!0})),this.commit(),this}set float(t){this._float!==t&&(this._float=t||!1,t||(this._packNodes(),this._notify()))}get float(){return this._float||!1}_sortNodes(t){return this.nodes=s.Utils.sort(this.nodes,t,this.column),this}_packNodes(){return this._sortNodes(),this.float?this.nodes.forEach(((t,e)=>{if(t._updating||void 0===t._packY||t.y===t._packY)return this;let i=t.y;for(;i>=t._packY;){let o={x:t.x,y:i,w:t.w,h:t.h};this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(o,t)))||(t._dirty=!0,t.y=i),--i}})):this.nodes.forEach(((t,e)=>{if(t.locked)return this;for(;t.y>0;){let i=t.y-1,o=0===e,r={x:t.x,y:i,w:t.w,h:t.h};if(e>0&&(o=!this.nodes.slice(0,e).find((t=>s.Utils.isIntercepted(r,t)))),!o)break;t._dirty=t.y!==i,t.y=i}})),this}prepareNode(t,e){(t=t||{})._id=t._id||o._idSeq++,void 0!==t.x&&void 0!==t.y&&null!==t.x&&null!==t.y||(t.autoPosition=!0);let i={x:0,y:0,w:1,h:1};return s.Utils.defaults(t,i),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,"string"==typeof t.x&&(t.x=Number(t.x)),"string"==typeof t.y&&(t.y=Number(t.y)),"string"==typeof t.w&&(t.w=Number(t.w)),"string"==typeof t.h&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=i.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=i.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=i.w),isNaN(t.h)&&(t.h=i.h),t.maxW&&(t.w=Math.min(t.w,t.maxW)),t.maxH&&(t.h=Math.min(t.h,t.maxH)),t.minW&&(t.w=Math.max(t.w,t.minW)),t.minH&&(t.h=Math.max(t.h,t.minH)),t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),t}getDirtyNodes(t){if(t){let t=[];return this.nodes.forEach((e=>{e._dirty&&(e.y===e._origY&&e.x===e._origX&&e.w===e._origW&&e.h===e._origH?delete e._dirty:t.push(e))})),t}return this.nodes.filter((t=>t._dirty))}_notify(t,e=!0){if(this.batchMode)return this;let i=(t=void 0===t?[]:Array.isArray(t)?t:[t]).concat(this.getDirtyNodes());return this.onChange&&this.onChange(i,e),this}cleanNodes(){return this.batchMode||this.nodes.forEach((t=>{delete t._dirty})),this}addNode(t,e=!1){if((t=this.prepareNode(t)).autoPosition){this._sortNodes();for(let e=0;;++e){let i=e%this.column,o=Math.floor(e/this.column);if(i+t.w>this.column)continue;let r={x:i,y:o,w:t.w,h:t.h};if(!this.nodes.find((t=>s.Utils.isIntercepted(r,t)))){t.x=i,t.y=o,delete t.autoPosition;break}}}return this.nodes.push(t),e&&this.addedNodes.push(t),this._fixCollisions(t),this._packNodes(),this._notify(),t}removeNode(t,e=!0,i=!1){return i&&this.removedNodes.push(t),t._id=null,this.nodes=this.nodes.filter((e=>e!==t)),this.float||this._packNodes(),this._notify(t,e),this}removeAll(t=!0){return delete this._layouts,0===this.nodes.length||(t&&this.nodes.forEach((t=>{t._id=null})),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes,t)),this}canMoveNode(t,e,i,s,r){if(!this.isNodeChangedPosition(t,e,i,s,r))return!1;let n,l=this.nodes.some((t=>t.locked));if(!this.maxRow&&!l)return!0;let h=new o({column:this.column,float:this.float,nodes:this.nodes.map((e=>e===t?(n=Object.assign({},e),n):Object.assign({},e)))});if(!n)return!0;h.moveNode(n,e,i,s,r);let a=!0;return l&&(a=!h.nodes.some((t=>t.locked&&t._dirty&&t!==n))),this.maxRow&&a&&(a=h.getRow()<=this.maxRow),a}willItFit(t){if(!this.maxRow)return!0;let e=new o({column:this.column,float:this.float,nodes:this.nodes.map((t=>Object.assign({},t)))});return e.addNode(t),e.getRow()<=this.maxRow}isOutside(t,e,i){if(t<0||t>=this.column||e<0)return!0;if(this.maxRow)return e>=this.maxRow;if(this.float)return!1;let s=this.getRow();if(e<s||0===e)return!1;if(e>s)return!0;if(!i._temporaryRemoved){let s=new o({column:this.column,float:this.float,nodes:this.nodes.filter((t=>t!==i)).map((t=>Object.assign({},t)))}),r=Object.assign(Object.assign({},i),{x:t,y:e});return s.addNode(r),r.y===i.y&&r.x===i.x}return i._temporaryRemoved}isNodeChangedPosition(t,e,i,s,o){return"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h),t.maxW&&(s=Math.min(s,t.maxW)),t.maxH&&(o=Math.min(o,t.maxH)),t.minW&&(s=Math.max(s,t.minW)),t.minH&&(o=Math.max(o,t.minH)),t.x!==e||t.y!==i||t.w!==s||t.h!==o}moveNode(t,e,i,s,o,r){if(t.locked)return null;"number"!=typeof e&&(e=t.x),"number"!=typeof i&&(i=t.y),"number"!=typeof s&&(s=t.w),"number"!=typeof o&&(o=t.h);let n=t.w!==s||t.h!==o,l={x:e,y:i,w:s,h:o,maxW:t.maxW,maxH:t.maxH,minW:t.minW,minH:t.minH};return l=this.prepareNode(l,n),t.x===l.x&&t.y===l.y&&t.w===l.w&&t.h===l.h?null:(t._dirty=!0,t.x=t._lastTriedX=l.x,t.y=t._lastTriedY=l.y,t.w=t._lastTriedW=l.w,t.h=t._lastTriedH=l.h,this._fixCollisions(t),r||(this._packNodes(),this._notify()),t)}getRow(){return this.nodes.reduce(((t,e)=>Math.max(t,e.y+e.h)),0)}beginUpdate(t){return t._updating||(t._updating=!0,this.nodes.forEach((t=>{t._packY=t.y}))),this}endUpdate(){let t=this.nodes.find((t=>t._updating));return t&&(delete t._updating,this.nodes.forEach((t=>{delete t._packY}))),this}save(t=!0){let e=[];return s.Utils.sort(this.nodes),this.nodes.forEach((i=>{let s={};for(let t in i)"_"!==t[0]&&null!==i[t]&&void 0!==i[t]&&(s[t]=i[t]);t||delete s.el,delete s.grid,s.autoPosition||delete s.autoPosition,s.noResize||delete s.noResize,s.noMove||delete s.noMove,s.locked||delete s.locked,e.push(s)})),e}layoutsNodesChange(t){return!this._layouts||this._ignoreLayoutsNodeChange||this._layouts.forEach(((e,i)=>{if(!e||i===this.column)return this;i<this.column?this._layouts[i]=void 0:t.forEach((t=>{let s=e.find((e=>e._id===t._id));if(!s)return this;let o=i/this.column;t.y!==t._origY&&(s.y+=t.y-t._origY),t.x!==t._origX&&(s.x=Math.round(t.x*o)),t.w!==t._origW&&(s.w=Math.round(t.w*o))}))})),this}updateNodeWidths(t,e,i,o="moveScale"){if(!this.nodes.length||t===e)return this;if(this.cacheLayout(this.nodes,t),1===e&&i&&i.length){let t=0;i.forEach((e=>{e.x=0,e.w=1,e.y=Math.max(e.y,t),t=e.y+e.h}))}else i=s.Utils.sort(this.nodes,-1,t);let r=this._layouts[e]||[],n=this._layouts.length-1;0===r.length&&e>t&&e<n&&(r=this._layouts[n]||[],r.length&&(t=n,r.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w)})),r=[]));let l=[];if(r.forEach((t=>{let e=i.findIndex((e=>e._id===t._id));-1!==e&&(i[e].x=t.x,i[e].y=t.y,i[e].w=t.w,l.push(i[e]),i.splice(e,1))})),i.length)if("function"==typeof o)o(e,t,l,i);else{let s=e/t,r="move"===o||"moveScale"===o,n="scale"===o||"moveScale"===o;i.forEach((i=>{i.x=1===e?0:r?Math.round(i.x*s):Math.min(i.x,e-1),i.w=1===e||1===t?1:n?Math.round(i.w*s)||1:Math.min(i.w,e),l.push(i)})),i=[]}return l=s.Utils.sort(l,-1,e),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(),this.nodes=[],l.forEach((t=>{this.addNode(t,!1),t._dirty=!0}),this),this.commit(),delete this._ignoreLayoutsNodeChange,this}saveInitial(){return this.nodes.forEach((t=>{t._origX=t.x,t._origY=t.y,t._origW=t.w,t._origH=t.h,delete t._dirty})),this}cacheLayout(t,e,i=!1){let s=[];return t.forEach(((t,e)=>{t._id=t._id||o._idSeq++,s[e]={x:t.x,y:t.y,w:t.w,_id:t._id}})),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cleanupNode(t){for(let e in t)"_"===e[0]&&delete t[e];return this}}e.GridStackEngine=o,o._idSeq=1},270:(t,e,i)=>{function s(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}Object.defineProperty(e,"__esModule",{value:!0});const o=i(62),r=i(593),n=i(334);s(i(593)),s(i(62)),s(i(334));const l={column:12,minRow:0,maxRow:0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:!1,cellHeight:"auto",margin:10,auto:!0,minWidth:768,float:!1,staticGrid:!1,animate:!0,alwaysShowResizeHandle:!1,resizable:{autoHide:!0,handles:"se"},draggable:{handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},dragIn:void 0,dragInOptions:{revert:"invalid",handle:".grid-stack-item-content",scroll:!1,appendTo:"body"},disableDrag:!1,disableResize:!1,rtl:"auto",removable:!1,removableOptions:{accept:".grid-stack-item"},removeTimeout:2e3,marginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:!1,oneColumnModeDomSort:!1};class h{constructor(t,e={}){this._gsEventHandler={},this.el=t,e=e||{},r.obsoleteOpts(e,"verticalMargin","margin","v2.0"),r.obsoleteAttr(this.el,"data-gs-current-height","gs-current-row","v1.0.0"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=r.Utils.toNumber(t.getAttribute("gs-row")),s=Object.assign(Object.assign({},l),{column:r.Utils.toNumber(t.getAttribute("gs-column"))||12,minRow:i||r.Utils.toNumber(t.getAttribute("gs-min-row"))||0,maxRow:i||r.Utils.toNumber(t.getAttribute("gs-max-row"))||0,staticGrid:r.Utils.toBool(t.getAttribute("gs-static"))||!1,_styleSheetClass:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),alwaysShowResizeHandle:e.alwaysShowResizeHandle||!1,resizable:{autoHide:!e.alwaysShowResizeHandle,handles:"se"},draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"},removableOptions:{accept:"."+(e.itemClass||"grid-stack-item")}});t.getAttribute("gs-animate")&&(s.animate=r.Utils.toBool(t.getAttribute("gs-animate"))),this.opts=r.Utils.defaults(e,s),e=null,this.initMargin(),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===t.style.direction),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");let n=r.Utils.closestByClass(this.el,l.itemClass);if(n&&n.gridstackNode&&(this.opts._isNested=n.gridstackNode,this.opts._isNested.subGrid=this,this.el.classList.add("grid-stack-nested")),this._isAutoCellHeight="auto"===this.opts.cellHeight,this._isAutoCellHeight){let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t,!1)}else this.cellHeight(this.opts.cellHeight,!1);if(this.el.classList.add(this.opts._styleSheetClass),this._setStaticClass(),this.engine=new o.GridStackEngine({column:this.opts.column,float:this.opts.float,maxRow:this.opts.maxRow,onChange:(t,e=!0)=>{let i=0;this.engine.nodes.forEach((t=>{i=Math.max(i,t.y+t.h)})),t.forEach((t=>{let i=t.el;e&&null===t._id?i&&i.parentNode&&i.parentNode.removeChild(i):this._writePosAttr(i,t.x,t.y,t.w,t.h)})),this._updateStyles(!1,i)}}),this.opts.auto){this.batchUpdate();let t=[];this.getGridItems().forEach((e=>{let i=parseInt(e.getAttribute("gs-x")),s=parseInt(e.getAttribute("gs-y"));t.push({el:e,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(s)?1e3:s)*this.opts.column})})),t.sort((t=>t.i)).forEach((t=>this._prepareElement(t.el))),this.commit()}this.engine.saveInitial(),this.setAnimation(this.opts.animate);let h=document.createElement("div");h.className="placeholder-content",h.innerHTML=this.opts.placeholderText,this.placeholder=document.createElement("div"),this.placeholder.classList.add(this.opts.placeholderClass,s.itemClass,this.opts.itemClass),this.placeholder.appendChild(h),this._updateStyles(),12!=this.opts.column&&this.el.classList.add("grid-stack-"+this.opts.column),this._setupDragIn(),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateWindowResizeEvent()}static init(t={},e=".grid-stack"){let i=h.getGridElement(e);return i?(i.gridstack||(i.gridstack=new h(i,Object.assign({},t))),i.gridstack):("string"==typeof e?console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'):console.error("GridStack.init() no grid element was passed."),null)}static initAll(t={},e=".grid-stack"){let i=[];return h.getGridElements(e).forEach((e=>{e.gridstack||(e.gridstack=new h(e,Object.assign({},t))),i.push(e.gridstack)})),0===i.length&&console.error('GridStack.initAll() no grid was found with selector "'+e+'" - element missing or wrong selector ?\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.'),i}static addGrid(t,e={}){if(!t)return null;let i=document.implementation.createHTMLDocument();i.body.innerHTML=`<div class="grid-stack ${e.class||""}"></div>`;let s=i.body.children[0];t.append(s);let o=h.init(e,s);return e.children&&o.load(e.children),o}addWidget(t,e){if(arguments.length>2){console.warn("gridstack.ts: `addWidget(el, x, y, width...)` is deprecated. Use `addWidget({x, y, w, content, ...})`. It will be removed soon");let e=arguments,i=1,s={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++],minW:e[i++],maxW:e[i++],minH:e[i++],maxH:e[i++],id:e[i++]};return this.addWidget(t,s)}let i;if("string"==typeof t){let e=document.implementation.createHTMLDocument();e.body.innerHTML=t,i=e.body.children[0]}else if(0===arguments.length||1===arguments.length&&(void 0!==(s=t).x||void 0!==s.y||void 0!==s.w||void 0!==s.h||void 0!==s.content)){let s=t&&t.content||"";e=t;let o=document.implementation.createHTMLDocument();o.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${s}</div></div>`,i=o.body.children[0]}else i=t;var s;let o=this._readAttr(i);return e=Object.assign({},e||{}),r.Utils.defaults(e,o),this.engine.prepareNode(e),this._writeAttr(i,e),this._insertNotAppend?this.el.prepend(i):this.el.appendChild(i),this._prepareElement(i,!0,e),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),i}save(t=!0,e=!1){let i=this.engine.save(t);if(t&&i.forEach((t=>{if(t.el&&!t.subGrid){let e=t.el.querySelector(".grid-stack-item-content");t.content=e?e.innerHTML:void 0,t.content||delete t.content,delete t.el}})),e){i.forEach((i=>{i.subGrid&&(i.subGrid=i.subGrid.save(t,e))}));let s=Object.assign({},this.opts);return s.marginBottom===s.marginTop&&s.marginRight===s.marginLeft&&s.marginTop===s.marginRight&&(s.margin=s.marginTop,delete s.marginTop,delete s.marginRight,delete s.marginBottom,delete s.marginLeft),s.rtl===("rtl"===this.el.style.direction)&&(s.rtl="auto"),this._isAutoCellHeight&&(s.cellHeight="auto"),r.Utils.removeInternalAndSame(s,l),s.children=i,s}return i}load(t,e=!0){let i=h.Utils.sort(t,-1,this._prevColumn||this.opts.column);this._insertNotAppend=!0,this._prevColumn&&this._prevColumn!==this.opts.column&&i.some((t=>t.x+t.w>this.opts.column))&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(i,this._prevColumn,!0));let s=[];return this.batchUpdate(),e&&[...this.engine.nodes].forEach((t=>{i.find((e=>t.id===e.id))||("function"==typeof e?e(this,t,!1):(s.push(t),this.removeWidget(t.el,!0,!1)))})),i.forEach((t=>{let i=t.id||0===t.id?this.engine.nodes.find((e=>e.id===t.id)):void 0;if(i){if(this.update(i.el,t),t.subGrid&&t.subGrid.children){let e=i.el.querySelector(".grid-stack");e&&e.gridstack&&(e.gridstack.load(t.subGrid.children),this._insertNotAppend=!0)}}else if(e&&(t="function"==typeof e?e(this,t,!0).gridstackNode:this.addWidget(t).gridstackNode).subGrid){let e=t.el.querySelector(".grid-stack-item-content");t.subGrid=h.addGrid(e,t.subGrid)}})),this.engine.removedNodes=s,this.commit(),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,this}batchUpdate(){return this.engine.batchUpdate(),this}getCellHeight(t=!1){if(this.opts.cellHeight&&"auto"!==this.opts.cellHeight&&(!t||!this.opts.cellHeightUnit||"px"===this.opts.cellHeightUnit))return this.opts.cellHeight;let e=this.el.querySelector("."+this.opts.itemClass),i=r.Utils.toNumber(e.getAttribute("gs-h"));return Math.round(e.offsetHeight/i)}cellHeight(t,e=!0){let i=r.Utils.parseHeight(t);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h||(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,e&&this._updateStyles(!0,this.getRow()),this._resizeNestedGrids(this.el)),this}cellWidth(){return(this.el.offsetWidth||this.el.parentElement.offsetWidth||window.innerWidth)/this.opts.column}commit(){return this.engine.commit(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent(),this}compact(){return this.engine.compact(),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(this.opts.column===t)return this;let i,s=this.opts.column;return 1===t?this._prevColumn=s:delete this._prevColumn,this.el.classList.remove("grid-stack-"+s),this.el.classList.add("grid-stack-"+t),this.opts.column=this.engine.column=t,1===t&&this.opts.oneColumnModeDomSort&&(i=[],this.getGridItems().forEach((t=>{t.gridstackNode&&i.push(t.gridstackNode)})),i.length||(i=void 0)),this.engine.updateNodeWidths(s,t,i,e),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter((t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass)))}destroy(t=!0){if(this.el)return this._updateWindowResizeEvent(!0),this.setStatic(!0),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.classList.remove(this.opts._styleSheetClass)),this._removeStylesheet(),delete this.opts._isNested,delete this.opts,delete this.placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}disable(){if(!this.opts.staticGrid)return this.enableMove(!1),this.enableResize(!1),this._triggerEvent("disable"),this}enable(){if(!this.opts.staticGrid)return this.enableMove(!0),this.enableResize(!0),this._triggerEvent("enable"),this}enableMove(t,e=!0){return this.opts.staticGrid||(this.getGridItems().forEach((e=>this.movable(e,t))),e&&(this.opts.disableDrag=!t)),this}enableResize(t,e=!0){return this.opts.staticGrid||(this.getGridItems().forEach((e=>this.resizable(e,t))),e&&(this.opts.disableResize=!t)),this}float(t){return this.engine.float=t,this._triggerChangeEvent(),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i,s=this.el.getBoundingClientRect();i=e?{top:s.top+document.documentElement.scrollTop,left:s.left}:{top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-i.left,r=t.top-i.top,n=s.width/this.opts.column,l=s.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/n),y:Math.floor(r/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t){let e=h.getElement(t);return this._prepareElement(e,!0),this._updateContainerHeight(),this._triggerAddEvent(),this._triggerChangeEvent(),e}on(t,e){if(-1!==t.indexOf(" "))return t.split(" ").forEach((t=>this.on(t,e))),this;if("change"===t||"added"===t||"removed"===t||"enable"===t||"disable"===t){let i="enable"===t||"disable"===t;this._gsEventHandler[t]=i?t=>e(t):t=>e(t,t.detail),this.el.addEventListener(t,this._gsEventHandler[t])}else"dragstart"===t||"dragstop"===t||"resizestart"===t||"resizestop"===t||"dropped"===t?this._gsEventHandler[t]=e:console.log("GridStack.on("+t+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.');return this}off(t){return-1!==t.indexOf(" ")?(t.split(" ").forEach((t=>this.off(t))),this):("change"!==t&&"added"!==t&&"removed"!==t&&"enable"!==t&&"disable"!==t||this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}removeWidget(t,e=!0,i=!0){return h.getElements(t).forEach((t=>{if(t.parentElement!==this.el)return;let s=t.gridstackNode;s||(s=this.engine.nodes.find((e=>t===e.el))),s&&(delete t.gridstackNode,n.GridStackDDI.get().remove(t),this.engine.removeNode(s,e,i),e&&t.parentElement&&t.remove())})),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(t=!0){return this.engine.nodes.forEach((t=>{delete t.el.gridstackNode,n.GridStackDDI.get().remove(t.el)})),this.engine.removeAll(t),this._triggerRemoveEvent(),this}setAnimation(t){return t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(t){return this.opts.staticGrid===t||(this.opts.staticGrid=t,this.engine.nodes.forEach((t=>this._prepareDragDropByNode(t))),this._setStaticClass()),this}update(t,e){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update({x, w, content, ...})`. It will be removed soon");let i=arguments,s=1;return e={x:i[s++],y:i[s++],w:i[s++],h:i[s++]},this.update(t,e)}return h.getElements(t).forEach((t=>{if(!t||!t.gridstackNode)return;let i=t.gridstackNode,s=Object.assign({},e);delete s.autoPosition;let o,r=["x","y","w","h"];if(r.some((t=>void 0!==s[t]&&s[t]!==i[t]))&&(o={},r.forEach((t=>{o[t]=void 0!==s[t]?s[t]:i[t],delete s[t]}))),!o&&(s.minW||s.minH||s.maxW||s.maxH)&&(o={}),s.content){let e=t.querySelector(".grid-stack-item-content");e&&e.innerHTML!==s.content&&(e.innerHTML=s.content),delete s.content}let n=!1,l=!1;for(const t in s)"_"!==t[0]&&i[t]!==s[t]&&(i[t]=s[t],n=!0,l=l||!this.opts.staticGrid&&("noResize"===t||"noMove"===t||"locked"===t));o&&(this.engine.cleanNodes(),this.engine.beginUpdate(i),this.engine.moveNode(i,o.x,o.y,o.w,o.h),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()),n&&this._writeAttr(t,i),l&&this._prepareDragDropByNode(i)})),this}margin(t){if(!("string"==typeof t&&t.split(" ").length>1)){let e=r.Utils.parseHeight(t);if(this.opts.marginUnit===e.unit&&this.opts.margin===e.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this.initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(t){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let t=arguments,e=0,i={x:t[e++],y:t[e++],w:t[e++],h:t[e++],autoPosition:t[e++]};return this.willItFit(i)}return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode||this.engine.addedNodes&&this.engine.addedNodes.length>0&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach((t=>{delete t._dirty})),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this}_triggerRemoveEvent(){return this.engine.batchMode||this.engine.removedNodes&&this.engine.removedNodes.length>0&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this}_triggerEvent(t,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t);return this.el.dispatchEvent(i),this}_removeStylesheet(){return this._styles&&(r.Utils.removeStylesheet(this._styles._id),delete this._styles),this}_updateStyles(t=!1,e){if(t&&this._removeStylesheet(),this._updateContainerHeight(),0===this.opts.cellHeight)return this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit,o=`.${this.opts._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let t="gridstack-style-"+(1e5*Math.random()).toFixed(),e=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=r.Utils.createStylesheet(t,e),!this._styles)return this;this._styles._id=t,this._styles._max=0,r.Utils.addCSSRule(this._styles,o,`min-height: ${i}${s}`);let n=this.opts.marginTop+this.opts.marginUnit,l=this.opts.marginBottom+this.opts.marginUnit,h=this.opts.marginRight+this.opts.marginUnit,a=this.opts.marginLeft+this.opts.marginUnit,d=`${o} > .grid-stack-item-content`,g=`.${this.opts._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;r.Utils.addCSSRule(this._styles,d,`top: ${n}; right: ${h}; bottom: ${l}; left: ${a};`),r.Utils.addCSSRule(this._styles,g,`top: ${n}; right: ${h}; bottom: ${l}; left: ${a};`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-ne`,`right: ${h}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-e`,`right: ${h}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-se`,`right: ${h}; bottom: ${l}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-nw`,`left: ${a}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-w`,`left: ${a}`),r.Utils.addCSSRule(this._styles,`${o} > .ui-resizable-sw`,`left: ${a}; bottom: ${l}`)}if((e=e||this._styles._max)>this._styles._max){let t=t=>i*t+s;for(let i=this._styles._max+1;i<=e;i++){let e=t(i);r.Utils.addCSSRule(this._styles,`${o}[gs-y="${i-1}"]`,`top: ${t(i-1)}`),r.Utils.addCSSRule(this._styles,`${o}[gs-h="${i}"]`,`height: ${e}`),r.Utils.addCSSRule(this._styles,`${o}[gs-min-h="${i}"]`,`min-height: ${e}`),r.Utils.addCSSRule(this._styles,`${o}[gs-max-h="${i}"]`,`max-height: ${e}`)}this._styles._max=e}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.getRow(),e=parseInt(getComputedStyle(this.el)["min-height"]);if(e>0){let i=Math.round(e/this.getCellHeight(!0));t<i&&(t=i)}if(this.el.setAttribute("gs-current-row",String(t)),0===t)return this.el.style.removeProperty("height"),this;let i=this.opts.cellHeight,s=this.opts.cellHeightUnit;return i?(this.el.style.height=t*i+s,this):this}_resizeNestedGrids(t){return t.querySelectorAll(".grid-stack").forEach((t=>{t.gridstack&&t.gridstack.onParentResize()})),this}_prepareElement(t,e=!1,i){i||(t.classList.add(this.opts.itemClass),i=this._readAttr(t)),t.gridstackNode=i,i.el=t,i.grid=this;let s=Object.assign({},i);return i=this.engine.addNode(i,e),r.Utils.same(i,s)||this._writeAttr(t,i),this._prepareDragDropByNode(i),this}_writePosAttr(t,e,i,s,o){return null!=e&&t.setAttribute("gs-x",String(e)),null!=i&&t.setAttribute("gs-y",String(i)),s&&t.setAttribute("gs-w",String(s)),o&&t.setAttribute("gs-h",String(o)),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e.x,e.y,e.w,e.h);let i={autoPosition:"gs-auto-position",minW:"gs-min-w",minH:"gs-min-h",maxW:"gs-max-w",maxH:"gs-max-h",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",resizeHandles:"gs-resize-handles"};for(const s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t){let e={};e.x=r.Utils.toNumber(t.getAttribute("gs-x")),e.y=r.Utils.toNumber(t.getAttribute("gs-y")),e.w=r.Utils.toNumber(t.getAttribute("gs-w")),e.h=r.Utils.toNumber(t.getAttribute("gs-h")),e.maxW=r.Utils.toNumber(t.getAttribute("gs-max-w")),e.minW=r.Utils.toNumber(t.getAttribute("gs-min-w")),e.maxH=r.Utils.toNumber(t.getAttribute("gs-max-h")),e.minH=r.Utils.toNumber(t.getAttribute("gs-min-h")),e.autoPosition=r.Utils.toBool(t.getAttribute("gs-auto-position")),e.noResize=r.Utils.toBool(t.getAttribute("gs-no-resize")),e.noMove=r.Utils.toBool(t.getAttribute("gs-no-move")),e.locked=r.Utils.toBool(t.getAttribute("gs-locked")),e.resizeHandles=t.getAttribute("gs-resize-handles"),e.id=t.getAttribute("gs-id");for(const t in e){if(!e.hasOwnProperty(t))return;e[t]||0===e[t]||delete e[t]}return e}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onParentResize(){if(this.el&&this.el.clientWidth){if(this._isAutoCellHeight&&r.Utils.throttle((()=>{let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;this.cellHeight(this.cellWidth()+t)}),100),!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.minWidth){if(this._oneColumnMode)return this;this._oneColumnMode=!0,this.column(1),this._resizeNestedGrids(this.el)}else{if(!this._oneColumnMode)return this;delete this._oneColumnMode,this.column(this._prevColumn),this._resizeNestedGrids(this.el)}return this}}_updateWindowResizeEvent(t=!1){const e=this._isAutoCellHeight||!this.opts.disableOneColumnMode;return!e||t||this.opts._isNested||this._windowResizeBind?!t&&e||!this._windowResizeBind||(window.removeEventListener("resize",this._windowResizeBind),delete this._windowResizeBind):(this._windowResizeBind=this.onParentResize.bind(this),window.addEventListener("resize",this._windowResizeBind),this.onParentResize()),this}static getElement(t=".grid-stack-item"){return r.Utils.getElement(t)}static getElements(t=".grid-stack-item"){return r.Utils.getElements(t)}static getGridElement(t){return h.getElement(t)}static getGridElements(t){return r.Utils.getElements(t)}initMargin(){let t,e=0,i=[];return"string"==typeof this.opts.margin&&(i=this.opts.margin.split(" ")),2===i.length?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):4===i.length?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=r.Utils.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),void 0===this.opts.marginTop?this.opts.marginTop=e:(t=r.Utils.parseHeight(this.opts.marginTop),this.opts.marginTop=t.h,delete this.opts.margin),void 0===this.opts.marginBottom?this.opts.marginBottom=e:(t=r.Utils.parseHeight(this.opts.marginBottom),this.opts.marginBottom=t.h,delete this.opts.margin),void 0===this.opts.marginRight?this.opts.marginRight=e:(t=r.Utils.parseHeight(this.opts.marginRight),this.opts.marginRight=t.h,delete this.opts.margin),void 0===this.opts.marginLeft?this.opts.marginLeft=e:(t=r.Utils.parseHeight(this.opts.marginLeft),this.opts.marginLeft=t.h,delete this.opts.margin),this.opts.marginUnit=t.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}movable(t,e){return this}resizable(t,e){return this}_setupAcceptWidget(){return this}_setupRemoveDrop(){return this}_setupRemovingTimeout(t){return this}_clearRemovingTimeout(t){return this}_setupDragIn(){return this}_prepareDragDropByNode(t){return this}locked(t,e){return this.update(t,{locked:e})}maxWidth(t,e){return this.update(t,{maxW:e})}minWidth(t,e){return this.update(t,{minW:e})}maxHeight(t,e){return this.update(t,{maxH:e})}minHeight(t,e){return this.update(t,{minH:e})}move(t,e,i){return this.update(t,{x:e,y:i})}resize(t,e,i){return this.update(t,{w:e,h:i})}}e.GridStack=h,h.Utils=r.Utils,h.Engine=o.GridStackEngine},822:(t,e,i)=>{function s(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}Object.defineProperty(e,"__esModule",{value:!0}),s(i(593)),s(i(62)),s(i(334)),s(i(270))},593:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.obsolete=function(t,e,i,s,o){let r=(...r)=>(console.warn("gridstack.js: Function `"+i+"` is deprecated in "+o+" and has been replaced with `"+s+"`. It will be **completely** removed in v1.0"),e.apply(t,r));return r.prototype=e.prototype,r},e.obsoleteOpts=function(t,e,i,s){void 0!==t[e]&&(t[i]=t[e],console.warn("gridstack.js: Option `"+e+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.obsoleteOptsDel=function(t,e,i,s){void 0!==t[e]&&console.warn("gridstack.js: Option `"+e+"` is deprecated in "+i+s)},e.obsoleteAttr=function(t,e,i,s){let o=t.getAttribute(e);null!==o&&(t.setAttribute(i,o),console.warn("gridstack.js: attribute `"+e+"`="+o+" is deprecated on this object in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0"))},e.Utils=class{static getElements(t){if("string"==typeof t){let e=document.querySelectorAll(t);return e.length||"."===t[0]||"#"===t[0]||(e=document.querySelectorAll("."+t),e.length||(e=document.querySelectorAll("#"+t))),Array.from(e)}return[t]}static getElement(t){if("string"==typeof t){if(!t.length)return null;if("#"===t[0])return document.getElementById(t.substring(1));if("."===t[0]||"["===t[0])return document.querySelector(t);if(!isNaN(+t[0]))return document.getElementById(t);let e=document.querySelector(t);return e||(e=document.getElementById(t)),e||(e=document.querySelector("."+t)),e}return t}static isIntercepted(t,e){return!(t.x+t.w<=e.x||e.x+e.w<=t.x||t.y+t.h<=e.y||e.y+e.h<=t.y)}static sort(t,e,i){if(!i){let e=t.map((t=>t.x+t.w));i=Math.max(...e)}return-1===e?t.sort(((t,e)=>e.x+e.y*i-(t.x+t.y*i))):t.sort(((t,e)=>t.x+t.y*i-(e.x+e.y*i)))}static createStylesheet(t,e){let i=document.createElement("style");return i.setAttribute("type","text/css"),i.setAttribute("gs-style-id",t),i.styleSheet?i.styleSheet.cssText="":i.appendChild(document.createTextNode("")),e?e.insertBefore(i,e.firstChild):(e=document.getElementsByTagName("head")[0]).appendChild(i),i.sheet}static removeStylesheet(t){let e=document.querySelector("STYLE[gs-style-id="+t+"]");e&&e.parentNode&&e.remove()}static addCSSRule(t,e,i){"function"==typeof t.addRule?t.addRule(e,i):"function"==typeof t.insertRule&&t.insertRule(`${e}{${i}}`)}static toBool(t){return"boolean"==typeof t?t:"string"==typeof t?!(""===(t=t.toLowerCase())||"no"===t||"false"===t||"0"===t):Boolean(t)}static toNumber(t){return null===t||0===t.length?void 0:Number(t)}static parseHeight(t){let e,i="px";if("string"==typeof t){let s=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!s)throw new Error("Invalid height");i=s[2]||"px",e=parseFloat(s[1])}else e=t;return{h:e,unit:i}}static defaults(t,...e){return e.forEach((e=>{for(const i in e){if(!e.hasOwnProperty(i))return;null===t[i]||void 0===t[i]?t[i]=e[i]:"object"==typeof e[i]&&"object"==typeof t[i]&&this.defaults(t[i],e[i])}})),t}static same(t,e){if("object"!=typeof t)return t==e;if(typeof t!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(t[i]!==e[i])return!1;return!0}static removeInternalAndSame(t,e){if("object"==typeof t&&"object"==typeof e)for(let i in t){let s=t[i];if(s&&"object"==typeof s){for(let t in s)s[t]!==e[i][t]&&"_"!==t[0]||delete s[t];Object.keys(s).length||delete t[i]}else s!==e[i]&&"_"!==i[0]||delete t[i]}}static closestByClass(t,e){for(;t=t.parentElement;)if(t.classList.contains(e))return t;return null}static throttle(t,e){let i=!1;return(...s)=>{i||(t.apply(this,s),i=!0,setTimeout((()=>i=!1),e))}}static removePositioningStyles(t){let e=t.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")}static getScrollParent(t){if(null===t)return document.documentElement;const e=getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowY)?t:this.getScrollParent(t.parentElement)}static updateScrollPosition(t,e,i){let s=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>o){let r=s.bottom-o,n=s.top,l=this.getScrollParent(t);if(null!==l){let h=l.scrollTop;s.top<0&&i<0?t.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=Math.abs(n)>Math.abs(i)?i:n:i>0&&(t.offsetHeight>o?l.scrollTop+=i:l.scrollTop+=r>i?i:r),e.top+=l.scrollTop-h}}}static updateScrollResize(t,e,i){const s=this.getScrollParent(e),o=s.clientHeight,r=t.clientY<i,n=t.clientY>o-i;r?s.scrollBy({behavior:"smooth",top:t.clientY-i}):n&&s.scrollBy({behavior:"smooth",top:i-(o-t.clientY)})}}}},e={};return function i(s){if(e[s])return e[s].exports;var o=e[s]={exports:{}};return t[s](o,o.exports,i),o.exports}(822)})().GridStack}));
//# sourceMappingURL=gridstack-static.js.map

@@ -1,9 +0,9 @@

// gridstack-ddi.ts 3.1.4 @preserve
// gridstack-ddi.ts 3.1.5 @preserve
// gridstack-engine.ts 3.1.4 @preserve
// gridstack-engine.ts 3.1.5 @preserve
// gridstack.ts 3.1.4 @preserve
// gridstack.ts 3.1.5 @preserve
// index.static.ts 3.1.4 - everything you need for a static Grid (non draggable) @preserve
// index.static.ts 3.1.5 - everything you need for a static Grid (non draggable) @preserve
// utils.ts 3.1.4 @preserve
// utils.ts 3.1.5 @preserve
"use strict";
// gridstack.ts 3.1.4 @preserve
// gridstack.ts 3.1.5 @preserve
function __export(m) {

@@ -182,2 +182,5 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];

this._updateStyles();
if (this.opts.column != 12) {
this.el.classList.add('grid-stack-' + this.opts.column);
}
this._setupDragIn();

@@ -249,5 +252,4 @@ this._setupRemoveDrop();

static addGrid(parent, opt = {}) {
if (!parent) {
if (!parent)
return null;
}
// create the grid element

@@ -488,3 +490,3 @@ let doc = document.implementation.createHTMLDocument();

if (update) {
this._updateStyles(true); // true = force re-create
this._updateStyles(true, this.getRow()); // true = force re-create, for that # of rows
}

@@ -527,5 +529,4 @@ this._resizeNestedGrids(this.el);

column(column, layout = 'moveScale') {
if (this.opts.column === column) {
if (this.opts.column === column)
return this;
}
let oldColumn = this.opts.column;

@@ -579,5 +580,4 @@ // if we go into 1 column mode (which happens if we're sized less than minW unless disableOneColumnMode is on)

destroy(removeDOM = true) {
if (!this.el) {
return;
} // prevent multiple calls
if (!this.el)
return; // prevent multiple calls
this._updateWindowResizeEvent(true);

@@ -611,5 +611,4 @@ this.setStatic(true); // permanently removes DD

disable() {
if (this.opts.staticGrid) {
if (this.opts.staticGrid)
return;
}
this.enableMove(false);

@@ -629,5 +628,4 @@ this.enableResize(false);

enable() {
if (this.opts.staticGrid) {
if (this.opts.staticGrid)
return;
}
this.enableMove(true);

@@ -646,5 +644,4 @@ this.enableResize(true);

enableMove(doEnable, includeNewWidgets = true) {
if (this.opts.staticGrid) {
return this;
} // can't move a static grid!
if (this.opts.staticGrid)
return this; // can't move a static grid!
this.getGridItems().forEach(el => this.movable(el, doEnable));

@@ -663,5 +660,4 @@ if (includeNewWidgets) {

enableResize(doEnable, includeNewWidgets = true) {
if (this.opts.staticGrid) {
return this;
} // can't size a static grid!
if (this.opts.staticGrid)
return this; // can't size a static grid!
this.getGridItems().forEach(el => this.resizable(el, doEnable));

@@ -883,5 +879,4 @@ if (includeNewWidgets) {

setStatic(val) {
if (this.opts.staticGrid === val) {
if (this.opts.staticGrid === val)
return this;
}
this.opts.staticGrid = val;

@@ -907,5 +902,4 @@ this.engine.nodes.forEach(n => this._prepareDragDropByNode(n)); // either delete Drag&drop or initialize it

GridStack.getElements(els).forEach(el => {
if (!el || !el.gridstackNode) {
if (!el || !el.gridstackNode)
return;
}
let n = el.gridstackNode;

@@ -1009,5 +1003,4 @@ let w = Object.assign({}, opt); // make a copy we can modify in case they re-use it or multiple items

_triggerChangeEvent() {
if (this.engine.batchMode) {
if (this.engine.batchMode)
return this;
}
let elements = this.engine.getDirtyNodes(true); // verify they really changed

@@ -1025,5 +1018,4 @@ if (elements && elements.length) {

_triggerAddEvent() {
if (this.engine.batchMode) {
if (this.engine.batchMode)
return this;
}
if (this.engine.addedNodes && this.engine.addedNodes.length > 0) {

@@ -1042,5 +1034,4 @@ if (!this._ignoreLayoutsNodeChange) {

_triggerRemoveEvent() {
if (this.engine.batchMode) {
if (this.engine.batchMode)
return this;
}
if (this.engine.removedNodes && this.engine.removedNodes.length > 0) {

@@ -1086,5 +1077,4 @@ this._triggerEvent('removed', this.engine.removedNodes);

this._styles = utils_1.Utils.createStylesheet(id, styleLocation);
if (!this._styles) {
if (!this._styles)
return this;
}
this._styles._id = id;

@@ -1128,5 +1118,4 @@ this._styles._max = 0;

_updateContainerHeight() {
if (!this.engine || this.engine.batchMode) {
if (!this.engine || this.engine.batchMode)
return this;
}
let row = this.getRow(); // checks for minRow already

@@ -1148,5 +1137,4 @@ // check for css min height

let unit = this.opts.cellHeightUnit;
if (!cellHeight) {
if (!cellHeight)
return this;
}
this.el.style.height = row * cellHeight + unit;

@@ -1244,5 +1232,4 @@ return this;

for (const key in node) {
if (!node.hasOwnProperty(key)) {
if (!node.hasOwnProperty(key))
return;
}
if (!node[key] && node[key] !== 0) { // 0 can be valid value (x,y only really)

@@ -1283,5 +1270,4 @@ delete node[key];

if (!this.opts.disableOneColumnMode && this.el.clientWidth <= this.opts.minWidth) {
if (this._oneColumnMode) {
if (this._oneColumnMode)
return this;
}
this._oneColumnMode = true;

@@ -1292,5 +1278,4 @@ this.column(1);

else {
if (!this._oneColumnMode) {
if (!this._oneColumnMode)
return this;
}
delete this._oneColumnMode;

@@ -1297,0 +1282,0 @@ this.column(this._prevColumn);

"use strict";
// dd-base-impl.ts 3.1.4 @preserve
// dd-base-impl.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -29,5 +29,4 @@ class DDBaseImplement {

triggerEvent(eventName, event) {
if (this.disabled) {
if (this.disabled)
return;
}
if (!this._eventRegister) {

@@ -34,0 +33,0 @@ return;

"use strict";
// dd-draggable.ts 3.1.4 @preserve
// dd-draggable.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -35,4 +35,6 @@ /**

this.option = option;
// get the element that is actually supposed to be dragged by
let className = option.handle.substring(1);
this.dragEl = el.classList.contains(className) ? el : el.querySelector(option.handle) || el;
// create var event binding so we can easily remove and still look like TS methods (unlike anonymous functions)
this._mouseDown = this._mouseDown.bind(this);
this._dragStart = this._dragStart.bind(this);

@@ -52,16 +54,14 @@ this._drag = this._drag.bind(this);

super.enable();
this.el.draggable = true;
this.dragEl.draggable = true;
this.dragEl.addEventListener('dragstart', this._dragStart);
this.el.classList.remove('ui-draggable-disabled');
this.el.classList.add('ui-draggable');
this.el.addEventListener('mousedown', this._mouseDown);
this.el.addEventListener('dragstart', this._dragStart);
}
disable(forDestroy = false) {
super.disable();
this.el.removeAttribute('draggable');
this.dragEl.removeAttribute('draggable');
this.dragEl.removeEventListener('dragstart', this._dragStart);
this.el.classList.remove('ui-draggable');
if (!forDestroy)
this.el.classList.add('ui-draggable-disabled');
this.el.removeEventListener('mousedown', this._mouseDown);
this.el.removeEventListener('dragstart', this._dragStart);
}

@@ -85,18 +85,4 @@ destroy() {

}
/** @internal call when mouse goes down before a dragstart happens */
_mouseDown(event) {
// make sure we are clicking on a drag handle or child of it...
let className = this.option.handle.substring(1);
let el = event.target;
while (el && !el.classList.contains(className)) {
el = el.parentElement;
}
this.dragEl = el;
}
/** @internal */
_dragStart(event) {
if (!this.dragEl) {
event.preventDefault();
return;
}
dd_manager_1.DDManager.dragElement = this;

@@ -122,3 +108,3 @@ this.helper = this._createHelper(event);

document.addEventListener('dragover', this._drag, DDDraggable.dragEventListenerOption);
this.el.addEventListener('dragend', this._dragEnd);
this.dragEl.addEventListener('dragend', this._dragEnd);
if (this.option.start) {

@@ -156,3 +142,3 @@ this.option.start(ev, this.ui());

document.removeEventListener('dragover', this._drag, DDDraggable.dragEventListenerOption);
this.el.removeEventListener('dragend', this._dragEnd);
this.dragEl.removeEventListener('dragend', this._dragEnd);
}

@@ -175,3 +161,2 @@ this.dragging = false;

delete this.helper;
delete this.dragEl;
}

@@ -178,0 +163,0 @@ /** @internal create a clone copy (or user defined method) of the original drag item if set */

@@ -16,5 +16,5 @@ import { DDBaseImplement, HTMLElementExtendOpt } from './dd-base-impl';

enable(): void;
disable(): void;
disable(forDestroy?: boolean): void;
destroy(): void;
updateOption(opts: DDDroppableOpt): DDDroppable;
}
"use strict";
// dd-droppable.ts 3.1.4 @preserve
// dd-droppable.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -10,4 +10,2 @@ const dd_manager_1 = require("./dd-manager");

super();
/** @internal */
this.acceptable = null;
this.el = el;

@@ -31,5 +29,4 @@ this.option = opts;

enable() {
if (!this.disabled) {
if (!this.disabled)
return;
}
super.enable();

@@ -39,19 +36,18 @@ this.el.classList.remove('ui-droppable-disabled');

}
disable() {
if (this.disabled) {
disable(forDestroy = false) {
if (this.disabled)
return;
}
super.disable();
this.el.classList.add('ui-droppable-disabled');
if (!forDestroy)
this.el.classList.add('ui-droppable-disabled');
this.el.removeEventListener('dragenter', this._dragEnter);
}
destroy() {
if (this.moving) {
this._removeLeaveCallbacks();
}
this.disable(true);
this.el.classList.remove('ui-droppable');
if (this.disabled) {
this.el.classList.remove('ui-droppable-disabled');
this.el.removeEventListener('dragenter', this._dragEnter);
this.el.removeEventListener('dragover', this._dragOver);
this.el.removeEventListener('drop', this._drop);
this.el.removeEventListener('dragleave', this._dragLeave);
}
this.el.classList.remove('ui-droppable-disabled');
delete this.moving;
super.destroy();

@@ -66,18 +62,17 @@ }

_dragEnter(event) {
this.el.removeEventListener('dragenter', this._dragEnter);
this.acceptable = this._canDrop();
if (this.acceptable) {
event.preventDefault();
const ev = dd_utils_1.DDUtils.initEvent(event, { target: this.el, type: 'dropover' });
if (this.option.over) {
this.option.over(ev, this._ui(dd_manager_1.DDManager.dragElement));
}
this.triggerEvent('dropover', ev);
this.el.addEventListener('dragover', this._dragOver);
this.el.addEventListener('drop', this._drop);
if (!this._canDrop())
return;
this.moving = true;
event.preventDefault();
const ev = dd_utils_1.DDUtils.initEvent(event, { target: this.el, type: 'dropover' });
if (this.option.over) {
this.option.over(ev, this._ui(dd_manager_1.DDManager.dragElement));
}
this.triggerEvent('dropover', ev);
this.el.addEventListener('dragover', this._dragOver);
this.el.addEventListener('drop', this._drop);
this.el.addEventListener('dragleave', this._dragLeave);
this.el.classList.add('ui-droppable-over');
this.el.addEventListener('dragleave', this._dragLeave);
}
/** @internal called when an acceptable to drop item is being dragged over - do nothing but eat the event */
/** @internal called when an moving to drop item is being dragged over - do nothing but eat the event */
_dragOver(event) {

@@ -87,9 +82,8 @@ event.preventDefault();

}
/** @internal called when the item is leaving our area, stop tracking if we had acceptable item */
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
_dragLeave(event) {
if (this.el.contains(event.relatedTarget)) {
if (this.el.contains(event.relatedTarget))
return;
}
this._removeLeaveCallbacks();
if (this.acceptable) {
if (this.moving) {
event.preventDefault();

@@ -105,5 +99,4 @@ const ev = dd_utils_1.DDUtils.initEvent(event, { target: this.el, type: 'dropout' });

_drop(event) {
if (!this.acceptable) {
return;
} // should not have received event...
if (!this.moving)
return; // should not have received event...
event.preventDefault();

@@ -121,7 +114,6 @@ const ev = dd_utils_1.DDUtils.initEvent(event, { target: this.el, type: 'drop' });

this.el.classList.remove('ui-droppable-over');
if (this.acceptable) {
if (this.moving) {
this.el.removeEventListener('dragover', this._dragOver);
this.el.removeEventListener('drop', this._drop);
}
this.el.addEventListener('dragenter', this._dragEnter);
}

@@ -128,0 +120,0 @@ /** @internal */

"use strict";
// dd-elements.ts 3.1.4 @preserve
// dd-elements.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -4,0 +4,0 @@ /**

"use strict";
// dd-manager.ts 3.1.4 @preserve
// dd-manager.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -4,0 +4,0 @@ class DDManager {

"use strict";
// dd-resizable-handle.ts 3.1.4 @preserve
// dd-resizable-handle.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -4,0 +4,0 @@ class DDResizableHandle {

"use strict";
// dd-resizable.ts 3.1.4 @preserve
// dd-resizable.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -4,0 +4,0 @@ /**

"use strict";
// dd-utils.ts 3.1.4 @preserve
// dd-utils.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -4,0 +4,0 @@ /**

"use strict";
// gridstack-dd-native.ts 3.1.4 @preserve
// gridstack-dd-native.ts 3.1.5 @preserve
function __export(m) {

@@ -122,5 +122,4 @@ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];

let hosts = utils_1.Utils.getElements(els);
if (!hosts.length) {
if (!hosts.length)
return [];
}
let list = hosts.map(e => e.ddElement || (create ? dd_element_1.DDElement.init(e) : null));

@@ -127,0 +126,0 @@ if (!create) {

@@ -49,3 +49,4 @@ /**

column?: number;
/** additional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance */
/** additional class on top of '.grid-stack' (which is required for our CSS) to differentiate this instance.
Note: only used by addGrid(), else your element should have the needed class */
class?: string;

@@ -72,3 +73,3 @@ /** disallows dragging of widgets (default?: false) */

handleClass?: string;
/** widget class (default?: 'grid-stack-item') */
/** additional widget class (default?: 'grid-stack-item') */
itemClass?: string;

@@ -75,0 +76,0 @@ /**

"use strict";
// types.ts 3.1.4 @preserve
// types.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map
"use strict";
// utils.ts 3.1.4 @preserve
// utils.ts 3.1.5 @preserve
Object.defineProperty(exports, "__esModule", { value: true });

@@ -63,5 +63,4 @@ /** checks for obsolete method names */

if (typeof els === 'string') {
if (!els.length) {
if (!els.length)
return null;
}
if (els[0] === '#') {

@@ -140,5 +139,4 @@ return document.getElementById(els.substring(1));

let el = document.querySelector('STYLE[gs-style-id=' + id + ']');
if (!el || !el.parentNode)
return;
el.parentNode.removeChild(el);
if (el && el.parentNode)
el.remove();
}

@@ -189,5 +187,4 @@ /** inserts a CSS rule */

for (const key in source) {
if (!source.hasOwnProperty(key)) {
if (!source.hasOwnProperty(key))
return;
}
if (target[key] === null || target[key] === undefined) {

@@ -206,16 +203,12 @@ target[key] = source[key];

static same(a, b) {
if (typeof a !== 'object') {
if (typeof a !== 'object')
return a == b;
}
if (typeof a !== typeof b) {
if (typeof a !== typeof b)
return false;
}
// else we have object, check just 1 level deep for being same things...
if (Object.keys(a).length !== Object.keys(b).length) {
if (Object.keys(a).length !== Object.keys(b).length)
return false;
}
for (const key in a) {
if (a[key] !== b[key]) {
if (a[key] !== b[key])
return false;
}
}

@@ -222,0 +215,0 @@ return true;

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

- [3.1.4-dev](#314-dev)
- [3.1.5 (2021-1-23)](#315-2021-1-23)
- [3.1.4 (2021-1-11)](#314-2021-1-11)

@@ -49,9 +49,14 @@ - [3.1.3 (2021-1-2)](#313-2021-1-2)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## 3.1.4-dev
## 3.1.5 (2021-1-23)
- TBD
- fix [1572](https://github.com/gridstack/gridstack.js/issues/1572) `column: N` option now sets CSS class
- fix [1571](https://github.com/gridstack/gridstack.js/issues/1571) don't allow drop when grid is full
- fix [1570](https://github.com/gridstack/gridstack.js/issues/1570) easier to drag out/in from below
- fix [1579](https://github.com/gridstack/gridstack.js/issues/1579) `cellHeight()` not updating CSS correctly
- fix [1581](https://github.com/gridstack/gridstack.js/issues/1581) H5 draggable by actual div handle rather than entire item (let content respond to drag as well)
## 3.1.4 (2021-1-11)
- fix [1557](https://github.com/gridstack/gridstack.js/pull/1557) fix no-drop cursor on windows when dragging within a default grid (no external drag in)
- fix [1541](https://github.com/gridstack/gridstack.js/pull/1541) fix Safari H5 delay when dropping items
- fix [1557](https://github.com/gridstack/gridstack.js/issues/1557) fix no-drop cursor on windows when dragging within a default grid (no external drag in)
- fix [1541](https://github.com/gridstack/gridstack.js/issues/1541) fix Safari H5 delay when dropping items

@@ -58,0 +63,0 @@ ## 3.1.3 (2021-1-2)

{
"name": "gridstack",
"version": "3.1.4",
"version": "3.1.5",
"description": "TypeScript/Javascript lib for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Ember, knockout...)",

@@ -5,0 +5,0 @@ "main": "./dist/gridstack.js",

@@ -182,3 +182,3 @@ # gridstack.js

Note: we added `.grid-stack-N` and include `gridstack-extra.css` which defines CSS for grids with custom [2-11] columns. Anything more and you'll need to generate the SASS/CSS yourself (see next).
Note: class `.grid-stack-N` was added and we include `gridstack-extra.css` which defines CSS for grids with custom [2-11] columns. Anything more and you'll need to generate the SASS/CSS yourself (see next).

@@ -185,0 +185,0 @@ See example: [2 grids demo](http://gridstack.github.io/gridstack.js/demo/two.html) with 6 columns

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 not supported yet

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 not supported yet

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 not supported yet

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 not supported yet

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 not supported yet

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 not supported yet

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 not supported yet

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