%PDF- %PDF-
Direktori : /var/www/projetos/suporte.iigd.com.br/public/lib/ |
Current File : /var/www/projetos/suporte.iigd.com.br/public/lib/gridstack.min.js |
(()=>{"use strict";var e={102:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:true});t.GridStackDD=void 0;const s=i(91);const r=i(88);const n=i(90);class o extends s.GridStackDDI{static get(){return s.GridStackDDI.get()}remove(e){this.draggable(e,"destroy").resizable(e,"destroy");if(e.gridstackNode){delete e.gridstackNode._initDD}return this}}t.GridStackDD=o;r.GridStack.prototype._setupAcceptWidget=function(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable){o.get().droppable(this.el,"destroy");return this}let e,t;let i=(i,s,r)=>{let l=s.gridstackNode;if(!l)return;r=r||s;let a=this.el.getBoundingClientRect();let{top:h,left:d}=r.getBoundingClientRect();d-=a.left;h-=a.top;let g={position:{top:h,left:d}};if(l._temporaryRemoved){l.x=Math.max(0,Math.round(d/t));l.y=Math.max(0,Math.round(h/e));delete l.autoPosition;this.engine.nodeBoundFix(l);if(!this.engine.willItFit(l)){l.autoPosition=true;if(!this.engine.willItFit(l)){o.get().off(s,"drag");return}if(l._willFitPos){n.Utils.copyPos(l,l._willFitPos);delete l._willFitPos}}this._onStartMoving(r,i,g,l,t,e)}else{this._dragOrResize(r,i,g,l,t,e)}};o.get().droppable(this.el,{accept:e=>{let t=e.gridstackNode;if((t===null||t===void 0?void 0:t.grid)===this)return true;if(!this.opts.acceptWidgets)return false;if(t===null||t===void 0?void 0:t.subGrid)return false;let i=true;if(typeof this.opts.acceptWidgets==="function"){i=this.opts.acceptWidgets(e)}else{let t=this.opts.acceptWidgets===true?".grid-stack-item":this.opts.acceptWidgets;i=e.matches(t)}if(i&&t&&this.opts.maxRow){let e={w:t.w,h:t.h,minW:t.minW,minH:t.minH};i=this.engine.willItFit(e)}return i}}).on(this.el,"dropover",((s,r,n)=>{let a=r.gridstackNode;if((a===null||a===void 0?void 0:a.grid)===this&&!a._temporaryRemoved){return false}if((a===null||a===void 0?void 0:a.grid)&&a.grid!==this&&!a._temporaryRemoved){let e=a.grid;e._leave(r,n)}t=this.cellWidth();e=this.getCellHeight(true);if(!a){a=this._readAttr(r)}if(!a.grid){a._isExternal=true;r.gridstackNode=a}n=n||r;let h=a.w||Math.round(n.offsetWidth/t)||1;let d=a.h||Math.round(n.offsetHeight/e)||1;if(a.grid&&a.grid!==this){if(!r._gridstackNodeOrig)r._gridstackNodeOrig=a;r.gridstackNode=a=Object.assign(Object.assign({},a),{w:h,h:d,grid:this});this.engine.cleanupNode(a).nodeBoundFix(a);a._initDD=a._isExternal=a._temporaryRemoved=true}else{a.w=h;a.h=d;a._temporaryRemoved=true}l(a.el,false);o.get().on(r,"drag",i);i(s,r,n);return false})).on(this.el,"dropout",((e,t,i)=>{let s=t.gridstackNode;if(!s)return false;if(!s.grid||s.grid===this){this._leave(t,i)}return false})).on(this.el,"drop",((e,t,i)=>{let s=t.gridstackNode;if((s===null||s===void 0?void 0:s.grid)===this&&!s._isExternal)return false;let r=!!this.placeholder.parentElement;this.placeholder.remove();let l=t._gridstackNodeOrig;delete t._gridstackNodeOrig;if(r&&l&&l.grid&&l.grid!==this){let e=l.grid;e.engine.removedNodes.push(l);e._triggerRemoveEvent()}if(!s)return false;if(r){this.engine.cleanupNode(s);s.grid=this}o.get().off(t,"drag");if(i!==t){i.remove();t.gridstackNode=l;if(r){t=t.cloneNode(true)}}else{t.remove();o.get().remove(t)}if(!r)return false;t.gridstackNode=s;s.el=t;n.Utils.copyPos(s,this._readAttr(this.placeholder));n.Utils.removePositioningStyles(t);this._writeAttr(t,s);this.el.appendChild(t);this._updateContainerHeight();this.engine.addedNodes.push(s);this._triggerAddEvent();this._triggerChangeEvent();this.engine.endUpdate();if(this._gsEventHandler["dropped"]){this._gsEventHandler["dropped"](Object.assign(Object.assign({},e),{type:"dropped"}),l&&l.grid?l:undefined,s)}window.setTimeout((()=>{if(s.el&&s.el.parentElement){this._prepareDragDropByNode(s)}else{this.engine.removeNode(s)}}));return false}));return this};function l(e,t){let i=e?e.gridstackNode:undefined;if(!i||!i.grid)return;t?i._isAboutToRemove=true:delete i._isAboutToRemove;t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing")}r.GridStack.prototype._setupRemoveDrop=function(){if(!this.opts.staticGrid&&typeof this.opts.removable==="string"){let e=document.querySelector(this.opts.removable);if(!e)return this;if(!o.get().isDroppable(e)){o.get().droppable(e,this.opts.removableOptions).on(e,"dropover",((e,t)=>l(t,true))).on(e,"dropout",((e,t)=>l(t,false)))}}return this};r.GridStack.setupDragIn=function(e,t){let i;let s;const r={revert:"invalid",handle:".grid-stack-item-content",scroll:false,appendTo:"body"};if(e){i=e;s=Object.assign(Object.assign({},r),t||{})}if(typeof i!=="string")return;let l=o.get();n.Utils.getElements(i).forEach((e=>{if(!l.isDraggable(e))l.dragIn(e,s)}))};r.GridStack.prototype._prepareDragDropByNode=function(e){let t=e.el;let i=o.get();if(this.opts.staticGrid||(e.noMove||this.opts.disableDrag)&&(e.noResize||this.opts.disableResize)){if(e._initDD){i.remove(t);delete e._initDD}t.classList.add("ui-draggable-disabled","ui-resizable-disabled");return this}if(!e._initDD){let s;let r;let o=(i,n)=>{if(this._gsEventHandler[i.type]){this._gsEventHandler[i.type](i,i.target)}s=this.cellWidth();r=this.getCellHeight(true);this._onStartMoving(t,i,n,e,s,r)};let l=(i,n)=>{this._dragOrResize(t,i,n,e,s,r)};let a=s=>{this.placeholder.remove();delete e._moving;delete e._lastTried;let r=s.target;if(!r.gridstackNode||r.gridstackNode.grid!==this)return;e.el=r;if(e._isAboutToRemove){let n=t.gridstackNode.grid;if(n._gsEventHandler[s.type]){n._gsEventHandler[s.type](s,r)}i.remove(t);n.engine.removedNodes.push(e);n._triggerRemoveEvent();delete t.gridstackNode;delete e.el;t.remove()}else{if(!e._temporaryRemoved){n.Utils.removePositioningStyles(r);this._writePosAttr(r,e)}else{n.Utils.removePositioningStyles(r);n.Utils.copyPos(e,e._orig);this._writePosAttr(r,e);this.engine.addNode(e)}if(this._gsEventHandler[s.type]){this._gsEventHandler[s.type](s,r)}}this._extraDragRow=0;this._updateContainerHeight();this._triggerChangeEvent();this.engine.endUpdate()};i.draggable(t,{start:o,stop:a,drag:l}).resizable(t,{start:o,stop:a,resize:l});e._initDD=true}if(e.noMove||this.opts.disableDrag){i.draggable(t,"disable");t.classList.add("ui-draggable-disabled")}else{i.draggable(t,"enable");t.classList.remove("ui-draggable-disabled")}if(e.noResize||this.opts.disableResize){i.resizable(t,"disable");t.classList.add("ui-resizable-disabled")}else{i.resizable(t,"enable");t.classList.remove("ui-resizable-disabled")}return this};r.GridStack.prototype._onStartMoving=function(e,t,i,s,r,n){this.engine.cleanNodes().beginUpdate(s);this._writePosAttr(this.placeholder,s);this.el.appendChild(this.placeholder);s.el=this.placeholder;s._lastUiPosition=i.position;s._prevYPix=i.position.top;s._moving=t.type==="dragstart";delete s._lastTried;if(t.type==="dropover"&&s._temporaryRemoved){this.engine.addNode(s);s._moving=true}this.engine.cacheRects(r,n,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft);if(t.type==="resizestart"){let t=o.get().resizable(e,"option","minWidth",r*(s.minW||1)).resizable(e,"option","minHeight",n*(s.minH||1));if(s.maxW){t.resizable(e,"option","maxWidth",r*s.maxW)}if(s.maxH){t.resizable(e,"option","maxHeight",n*s.maxH)}}};r.GridStack.prototype._leave=function(e,t){let i=e.gridstackNode;if(!i)return;o.get().off(e,"drag");if(i._temporaryRemoved)return;i._temporaryRemoved=true;this.engine.removeNode(i);i.el=i._isExternal&&t?t:e;if(this.opts.removable===true){l(e,true)}if(e._gridstackNodeOrig){e.gridstackNode=e._gridstackNodeOrig;delete e._gridstackNodeOrig}else if(i._isExternal){delete i.el;delete e.gridstackNode;this.engine.restoreInitial()}};r.GridStack.prototype._dragOrResize=function(e,t,i,s,r,o){let l=Object.assign({},s._orig);let a;let h=this.opts.marginLeft,d=this.opts.marginRight,g=this.opts.marginTop,u=this.opts.marginBottom;let p=Math.round(o*.1),c=Math.round(r*.1);h=Math.min(h,c);d=Math.min(d,c);g=Math.min(g,p);u=Math.min(u,p);if(t.type==="drag"){if(s._temporaryRemoved)return;let t=i.position.top-s._prevYPix;s._prevYPix=i.position.top;n.Utils.updateScrollPosition(e,i.position,t);let a=i.position.left+(i.position.left>s._lastUiPosition.left?-d:h);let p=i.position.top+(i.position.top>s._lastUiPosition.top?-u:g);l.x=Math.round(a/r);l.y=Math.round(p/o);let c=this._extraDragRow;if(this.engine.collide(s,l)){let e=this.getRow();let t=Math.max(0,l.y+s.h-e);if(this.opts.maxRow&&e+t>this.opts.maxRow){t=Math.max(0,this.opts.maxRow-e)}this._extraDragRow=t}else this._extraDragRow=0;if(this._extraDragRow!==c)this._updateContainerHeight();if(s.x===l.x&&s.y===l.y)return}else if(t.type==="resize"){if(l.x<0)return;n.Utils.updateScrollResize(t,e,o);l.w=Math.round((i.size.width-h)/r);l.h=Math.round((i.size.height-g)/o);if(s.w===l.w&&s.h===l.h)return;if(s._lastTried&&s._lastTried.w===l.w&&s._lastTried.h===l.h)return;let d=i.position.left+h;let u=i.position.top+g;l.x=Math.round(d/r);l.y=Math.round(u/o);a=true}s._lastTried=l;let f={x:i.position.left+h,y:i.position.top+g,w:(i.size?i.size.width:s.w*r)-h-d,h:(i.size?i.size.height:s.h*o)-g-u};if(this.engine.moveNodeCheck(s,Object.assign(Object.assign({},l),{cellWidth:r,cellHeight:o,rect:f,resizing:a}))){s._lastUiPosition=i.position;this.engine.cacheRects(r,o,g,d,u,h);delete s._skipDown;if(a&&s.subGrid){s.subGrid.onParentResize()}this._extraDragRow=0;this._updateContainerHeight();let e=t.target;this._writePosAttr(e,s);if(this._gsEventHandler[t.type]){this._gsEventHandler[t.type](t,e)}}};r.GridStack.prototype.movable=function(e,t){if(this.opts.staticGrid)return this;r.GridStack.getElements(e).forEach((e=>{let i=e.gridstackNode;if(!i)return;if(t)delete i.noMove;else i.noMove=true;this._prepareDragDropByNode(i)}));return this};r.GridStack.prototype.resizable=function(e,t){if(this.opts.staticGrid)return this;r.GridStack.getElements(e).forEach((e=>{let i=e.gridstackNode;if(!i)return;if(t)delete i.noResize;else i.noResize=true;this._prepareDragDropByNode(i)}));return this};r.GridStack.prototype.disable=function(){if(this.opts.staticGrid)return;this.enableMove(false);this.enableResize(false);this._triggerEvent("disable");return this};r.GridStack.prototype.enable=function(){if(this.opts.staticGrid)return;this.enableMove(true);this.enableResize(true);this._triggerEvent("enable");return this};r.GridStack.prototype.enableMove=function(e){if(this.opts.staticGrid)return this;this.opts.disableDrag=!e;this.engine.nodes.forEach((t=>this.movable(t.el,e)));return this};r.GridStack.prototype.enableResize=function(e){if(this.opts.staticGrid)return this;this.opts.disableResize=!e;this.engine.nodes.forEach((t=>this.resizable(t.el,e)));return this}},91:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.GridStackDDI=void 0;class i{static registerPlugin(e){i.ddi=new e;return i.ddi}static get(){return i.ddi||i.registerPlugin(i)}remove(e){return this}}t.GridStackDDI=i},89:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:true});t.GridStackEngine=void 0;const s=i(90);class r{constructor(e={}){this.addedNodes=[];this.removedNodes=[];this.column=e.column||12;this.onChange=e.onChange;this._float=e.float;this.maxRow=e.maxRow;this.nodes=e.nodes||[]}batchUpdate(){if(this.batchMode)return this;this.batchMode=true;this._prevFloat=this._float;this._float=true;this.saveInitial();return this}commit(){if(!this.batchMode)return this;this.batchMode=false;this._float=this._prevFloat;delete this._prevFloat;return this._packNodes()._notify()}_useEntireRowArea(e,t){return!this.float&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,r={}){this._sortNodes(-1);i=i||this.collide(e,t);if(!i)return false;if(e._moving&&!r.nested&&!this.float){if(this.swap(e,i))return true}let n=t;if(this._useEntireRowArea(e,t)){n={x:0,w:this.column,y:t.y,h:t.h};i=this.collide(e,n,r.skip)}let o=false;let l={nested:true,pack:false};while(i=i||this.collide(e,n,r.skip)){let n;if(i.locked||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,Object.assign(Object.assign({},i),{y:e.y}),e)||!this.collide(i,Object.assign(Object.assign({},i),{y:t.y-i.h}),e))){e._skipDown=e._skipDown||t.y>e.y;n=this.moveNode(e,Object.assign(Object.assign(Object.assign({},t),{y:i.y+i.h}),l));if(i.locked&&n){s.Utils.copyPos(t,e)}else if(!i.locked&&n&&r.pack){this._packNodes();t.y=i.y+i.h;s.Utils.copyPos(e,t)}o=o||n}else{n=this.moveNode(i,Object.assign(Object.assign(Object.assign({},i),{y:t.y+t.h,skip:e}),l))}if(!n){return o}i=undefined}return o}collide(e,t=e,i){return this.nodes.find((r=>r!==e&&r!==i&&s.Utils.isIntercepted(r,t)))}collideAll(e,t=e,i){return this.nodes.filter((r=>r!==e&&r!==i&&s.Utils.isIntercepted(r,t)))}collideCoverage(e,t,i){if(!t.rect||!e._rect)return;let s=e._rect;let r=Object.assign({},t.rect);if(r.y>s.y){r.h+=r.y-s.y;r.y=s.y}else{r.h+=s.y-r.y}if(r.x>s.x){r.w+=r.x-s.x;r.x=s.x}else{r.w+=s.x-r.x}let n;i.forEach((e=>{if(e.locked||!e._rect)return;let t=e._rect;let i=Number.MAX_VALUE,o=Number.MAX_VALUE,l=.5;if(s.y<t.y){i=(r.y+r.h-t.y)/t.h}else if(s.y+s.h>t.y+t.h){i=(t.y+t.h-r.y)/t.h}if(s.x<t.x){o=(r.x+r.w-t.x)/t.w}else if(s.x+s.w>t.x+t.w){o=(t.x+t.w-r.x)/t.w}let a=Math.min(o,i);if(a>l){l=a;n=e}}));return n}cacheRects(e,t,i,s,r,n){this.nodes.forEach((o=>o._rect={y:o.y*t+i,x:o.x*e+n,w:o.w*e-n-s,h:o.h*t-i-r}));return this}swap(e,t){if(!t||t.locked||!e||e.locked)return false;function i(){let i=t.x,s=t.y;t.x=e.x;t.y=e.y;if(e.h!=t.h){e.x=i;e.y=t.y+t.h}else if(e.w!=t.w){e.x=t.x+t.w;e.y=s}else{e.x=i;e.y=s}e._dirty=t._dirty=true;return true}let r;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(r=s.Utils.isTouching(e,t)))return i();if(r===false)return;if(e.w===t.w&&e.x===t.x&&(r||(r=s.Utils.isTouching(e,t)))){if(t.y<e.y){let i=e;e=t;t=i}return i()}if(r===false)return;if(e.h===t.h&&e.y===t.y&&(r||(r=s.Utils.isTouching(e,t)))){if(t.x<e.x){let i=e;e=t;t=i}return i()}return false}isAreaEmpty(e,t,i,s){let r={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(r)}compact(){if(this.nodes.length===0)return this;this.batchUpdate()._sortNodes();let e=this.nodes;this.nodes=[];e.forEach((e=>{if(!e.locked){e.autoPosition=true}this.addNode(e,false);e._dirty=true}));return this.commit()}set float(e){if(this._float===e)return;this._float=e||false;if(!e){this._packNodes()._notify()}}get float(){return this._float||false}_sortNodes(e){this.nodes=s.Utils.sort(this.nodes,e,this.column);return this}_packNodes(){if(this.batchMode){return this}this._sortNodes();if(this.float){this.nodes.forEach((e=>{if(e._updating||e._orig===undefined||e.y===e._orig.y)return;let t=e.y;while(t>e._orig.y){--t;let i=this.collide(e,{x:e.x,y:t,w:e.w,h:e.h});if(!i){e._dirty=true;e.y=t}}}))}else{this.nodes.forEach(((e,t)=>{if(e.locked)return;while(e.y>0){let i=t===0?0:e.y-1;let s=t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h});if(!s)break;e._dirty=e.y!==i;e.y=i}}))}return this}prepareNode(e,t){e=e||{};e._id=e._id||r._idSeq++;if(e.x===undefined||e.y===undefined||e.x===null||e.y===null){e.autoPosition=true}let i={x:0,y:0,w:1,h:1};s.Utils.defaults(e,i);if(!e.autoPosition){delete e.autoPosition}if(!e.noResize){delete e.noResize}if(!e.noMove){delete e.noMove}if(typeof e.x=="string"){e.x=Number(e.x)}if(typeof e.y=="string"){e.y=Number(e.y)}if(typeof e.w=="string"){e.w=Number(e.w)}if(typeof e.h=="string"){e.h=Number(e.h)}if(isNaN(e.x)){e.x=i.x;e.autoPosition=true}if(isNaN(e.y)){e.y=i.y;e.autoPosition=true}if(isNaN(e.w)){e.w=i.w}if(isNaN(e.h)){e.h=i.h}return this.nodeBoundFix(e,t)}nodeBoundFix(e,t){let i=e._orig||s.Utils.copyPos({},e);if(e.maxW){e.w=Math.min(e.w,e.maxW)}if(e.maxH){e.h=Math.min(e.h,e.maxH)}if(e.minW&&e.minW<=this.column){e.w=Math.max(e.w,e.minW)}if(e.minH){e.h=Math.max(e.h,e.minH)}if(e.w>this.column){if(this.column<12&&!this._inColumnResize){e.w=Math.min(12,e.w);this.cacheOneLayout(e,12)}e.w=this.column}else if(e.w<1){e.w=1}if(this.maxRow&&e.h>this.maxRow){e.h=this.maxRow}else if(e.h<1){e.h=1}if(e.x<0){e.x=0}if(e.y<0){e.y=0}if(e.x+e.w>this.column){if(t){e.w=this.column-e.x}else{e.x=this.column-e.w}}if(this.maxRow&&e.y+e.h>this.maxRow){if(t){e.h=this.maxRow-e.y}else{e.y=this.maxRow-e.h}}if(!s.Utils.samePos(e,i)){e._dirty=true}return e}getDirtyNodes(e){if(e){return this.nodes.filter((e=>e._dirty&&!s.Utils.samePos(e,e._orig)))}return this.nodes.filter((e=>e._dirty))}_notify(e,t=true){if(this.batchMode)return this;e=e===undefined?[]:Array.isArray(e)?e:[e];let i=e.concat(this.getDirtyNodes());this.onChange&&this.onChange(i,t);return this}cleanNodes(){if(this.batchMode)return this;this.nodes.forEach((e=>{delete e._dirty;delete e._lastTried}));return this}saveInitial(){this.nodes.forEach((e=>{e._orig=s.Utils.copyPos({},e);delete e._dirty}));this._hasLocked=this.nodes.some((e=>e.locked));return this}restoreInitial(){this.nodes.forEach((e=>{if(s.Utils.samePos(e,e._orig))return;s.Utils.copyPos(e,e._orig);e._dirty=true}));this._notify();return this}addNode(e,t=false){let i=this.nodes.find((t=>t._id===e._id));if(i)return i;e=this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e);delete e._temporaryRemoved;delete e._removeDOM;if(e.autoPosition){this._sortNodes();for(let t=0;;++t){let i=t%this.column;let r=Math.floor(t/this.column);if(i+e.w>this.column){continue}let n={x:i,y:r,w:e.w,h:e.h};if(!this.nodes.find((e=>s.Utils.isIntercepted(n,e)))){e.x=i;e.y=r;delete e.autoPosition;break}}}this.nodes.push(e);if(t){this.addedNodes.push(e)}this._fixCollisions(e);if(!this.batchMode){this._packNodes()._notify()}return e}removeNode(e,t=true,i=false){if(!this.nodes.find((t=>t===e))){return this}if(i){this.removedNodes.push(e)}if(t)e._removeDOM=true;this.nodes=this.nodes.filter((t=>t!==e));return this._packNodes()._notify(e)}removeAll(e=true){delete this._layouts;if(this.nodes.length===0)return this;e&&this.nodes.forEach((e=>e._removeDOM=true));this.removedNodes=this.nodes;this.nodes=[];return this._notify(this.removedNodes)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return false;t.pack=true;if(!this.maxRow){return this.moveNode(e,t)}let i;let n=new r({column:this.column,float:this.float,nodes:this.nodes.map((t=>{if(t===e){i=Object.assign({},t);return i}return Object.assign({},t)}))});if(!i)return false;let o=n.moveNode(i,t);if(this.maxRow&&o){o=n.getRow()<=this.maxRow;if(!o&&!t.resizing){let i=this.collide(e,t);if(i&&this.swap(e,i)){this._notify();return true}}}if(!o)return false;n.nodes.filter((e=>e._dirty)).forEach((e=>{let t=this.nodes.find((t=>t._id===e._id));if(!t)return;s.Utils.copyPos(t,e);t._dirty=true}));this._notify();return true}willItFit(e){delete e._willFitPos;if(!this.maxRow)return true;let t=new r({column:this.column,float:this.float,nodes:this.nodes.map((e=>Object.assign({},e)))});let i=Object.assign({},e);this.cleanupNode(i);delete i.el;delete i._id;delete i.content;delete i.grid;t.addNode(i);if(t.getRow()<=this.maxRow){e._willFitPos=s.Utils.copyPos({},i);return true}return false}changedPosConstrain(e,t){t.w=t.w||e.w;t.h=t.h||e.h;if(e.x!==t.x||e.y!==t.y)return true;if(e.maxW){t.w=Math.min(t.w,e.maxW)}if(e.maxH){t.h=Math.min(t.h,e.maxH)}if(e.minW){t.w=Math.max(t.w,e.minW)}if(e.minH){t.h=Math.max(t.h,e.minH)}return e.w!==t.w||e.h!==t.h}moveNode(e,t){if(!e||!t)return false;if(t.pack===undefined)t.pack=true;if(typeof t.x!=="number"){t.x=e.x}if(typeof t.y!=="number"){t.y=e.y}if(typeof t.w!=="number"){t.w=e.w}if(typeof t.h!=="number"){t.h=e.h}let i=e.w!==t.w||e.h!==t.h;let r=s.Utils.copyPos({},e,true);s.Utils.copyPos(r,t);r=this.nodeBoundFix(r,i);s.Utils.copyPos(t,r);if(s.Utils.samePos(e,t))return false;let n=s.Utils.copyPos({},e);let o=r;let l=this.collideAll(e,o,t.skip);let a=true;if(l.length){let i=e._moving&&!t.nested?this.collideCoverage(e,t,l):l[0];if(i){a=!this._fixCollisions(e,r,i,t)}else{a=false}}if(a){e._dirty=true;s.Utils.copyPos(e,r)}if(t.pack){this._packNodes()._notify()}return!s.Utils.samePos(e,n)}getRow(){return this.nodes.reduce(((e,t)=>Math.max(e,t.y+t.h)),0)}beginUpdate(e){if(!e._updating){e._updating=true;delete e._skipDown;if(!this.batchMode)this.saveInitial()}return this}endUpdate(){let e=this.nodes.find((e=>e._updating));if(e){delete e._updating;delete e._skipDown}return this}save(e=true){var t;let i=(t=this._layouts)===null||t===void 0?void 0:t.length;let s=i&&this.column!==i-1?this._layouts[i-1]:null;let r=[];this._sortNodes();this.nodes.forEach((t=>{let i=s===null||s===void 0?void 0:s.find((e=>e._id===t._id));let n=Object.assign({},t);if(i){n.x=i.x;n.y=i.y;n.w=i.w}for(let e in n){if(e[0]==="_"||n[e]===null||n[e]===undefined)delete n[e]}delete n.grid;if(!e)delete n.el;if(!n.autoPosition)delete n.autoPosition;if(!n.noResize)delete n.noResize;if(!n.noMove)delete n.noMove;if(!n.locked)delete n.locked;r.push(n)}));return r}layoutsNodesChange(e){if(!this._layouts||this._inColumnResize)return this;this._layouts.forEach(((t,i)=>{if(!t||i===this.column)return this;if(i<this.column){this._layouts[i]=undefined}else{let s=i/this.column;e.forEach((e=>{if(!e._orig)return;let i=t.find((t=>t._id===e._id));if(!i)return;if(e.y!==e._orig.y){i.y+=e.y-e._orig.y}if(e.x!==e._orig.x){i.x=Math.round(e.x*s)}if(e.w!==e._orig.w){i.w=Math.round(e.w*s)}}))}}));return this}updateNodeWidths(e,t,i,r="moveScale"){var n;if(!this.nodes.length||!t||e===t)return this;this.cacheLayout(this.nodes,e);this.batchUpdate();let o=[];let l=false;if(t===1&&(i===null||i===void 0?void 0:i.length)){l=true;let e=0;i.forEach((t=>{t.x=0;t.w=1;t.y=Math.max(t.y,e);e=t.y+t.h}));o=i;i=[]}else{i=s.Utils.sort(this.nodes,-1,e)}let a=[];if(t>e){a=this._layouts[t]||[];let s=this._layouts.length-1;if(!a.length&&e!==s&&((n=this._layouts[s])===null||n===void 0?void 0:n.length)){e=s;this._layouts[s].forEach((e=>{let t=i.find((t=>t._id===e._id));if(t){t.x=e.x;t.y=e.y;t.w=e.w}}))}}a.forEach((e=>{let t=i.findIndex((t=>t._id===e._id));if(t!==-1){i[t].x=e.x;i[t].y=e.y;i[t].w=e.w;o.push(i[t]);i.splice(t,1)}}));if(i.length){if(typeof r==="function"){r(t,e,o,i)}else if(!l){let s=t/e;let n=r==="move"||r==="moveScale";let l=r==="scale"||r==="moveScale";i.forEach((i=>{i.x=t===1?0:n?Math.round(i.x*s):Math.min(i.x,t-1);i.w=t===1||e===1?1:l?Math.round(i.w*s)||1:Math.min(i.w,t);o.push(i)}));i=[]}}o=s.Utils.sort(o,-1,t);this._inColumnResize=true;this.nodes=[];o.forEach((e=>{this.addNode(e,false);delete e._orig}));this.commit();delete this._inColumnResize;return this}cacheLayout(e,t,i=false){let s=[];e.forEach(((e,t)=>{e._id=e._id||r._idSeq++;s[t]={x:e.x,y:e.y,w:e.w,_id:e._id}}));this._layouts=i?[]:this._layouts||[];this._layouts[t]=s;return this}cacheOneLayout(e,t){e._id=e._id||r._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};this._layouts=this._layouts||[];this._layouts[t]=this._layouts[t]||[];let s=this._layouts[t].findIndex((t=>t._id===e._id));s===-1?this._layouts[t].push(i):this._layouts[t][s]=i;return this}cleanupNode(e){for(let t in e){if(t[0]==="_"&&t!=="_id")delete e[t]}return this}}t.GridStackEngine=r;r._idSeq=1},88:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){if(s===undefined)s=i;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[i]}})}:function(e,t,i,s){if(s===undefined)s=i;e[s]=t[i]});var r=this&&this.__exportStar||function(e,t){for(var i in e)if(i!=="default"&&!t.hasOwnProperty(i))s(t,e,i)};Object.defineProperty(t,"__esModule",{value:true});t.GridStack=void 0; /*! * GridStack 5.0 * https://gridstackjs.com/ * * Copyright (c) 2021 Alain Dumesny * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE */const n=i(89);const o=i(90);const l=i(91);r(i(92),t);r(i(90),t);r(i(89),t);r(i(91),t);const a={column:12,minRow:0,maxRow:0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,styleInHead:false,cellHeight:"auto",cellHeightThrottle:100,margin:10,auto:true,minWidth:768,float:false,staticGrid:false,animate:true,alwaysShowResizeHandle:false,resizable:{autoHide:true,handles:"se"},draggable:{handle:".grid-stack-item-content",scroll:false,appendTo:"body"},disableDrag:false,disableResize:false,rtl:"auto",removable:false,removableOptions:{accept:".grid-stack-item"},marginUnit:"px",cellHeightUnit:"px",disableOneColumnMode:false,oneColumnModeDomSort:false};class h{constructor(e,t={}){this._gsEventHandler={};this._extraDragRow=0;this.el=e;t=t||{};if(t.row){t.minRow=t.maxRow=t.row;delete t.row}let i=o.Utils.toNumber(e.getAttribute("gs-row"));if(t.column==="auto"){delete t.column}let s=Object.assign(Object.assign({},o.Utils.cloneDeep(a)),{column:o.Utils.toNumber(e.getAttribute("gs-column"))||12,minRow:i?i:o.Utils.toNumber(e.getAttribute("gs-min-row"))||0,maxRow:i?i:o.Utils.toNumber(e.getAttribute("gs-max-row"))||0,staticGrid:o.Utils.toBool(e.getAttribute("gs-static"))||false,_styleSheetClass:"grid-stack-instance-"+(Math.random()*1e4).toFixed(0),alwaysShowResizeHandle:t.alwaysShowResizeHandle||false,resizable:{autoHide:!(t.alwaysShowResizeHandle||false),handles:"se"},draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||".grid-stack-item-content",scroll:false,appendTo:"body"},removableOptions:{accept:"."+(t.itemClass||"grid-stack-item")}});if(e.getAttribute("gs-animate")){s.animate=o.Utils.toBool(e.getAttribute("gs-animate"))}this.opts=o.Utils.defaults(t,s);t=null;this.initMargin();if(this.opts.column!==1&&!this.opts.disableOneColumnMode&&this._widthOrContainer()<=this.opts.minWidth){this._prevColumn=this.getColumn();this.opts.column=1}if(this.opts.rtl==="auto"){this.opts.rtl=e.style.direction==="rtl"}if(this.opts.rtl){this.el.classList.add("grid-stack-rtl")}let r=o.Utils.closestByClass(this.el,a.itemClass);if(r&&r.gridstackNode){this.opts._isNested=r.gridstackNode;this.opts._isNested.subGrid=this;r.classList.add("grid-stack-nested");this.el.classList.add("grid-stack-nested")}this._isAutoCellHeight=this.opts.cellHeight==="auto";if(this._isAutoCellHeight||this.opts.cellHeight==="initial"){this.cellHeight(undefined,false)}else{if(typeof this.opts.cellHeight=="number"&&this.opts.cellHeightUnit&&this.opts.cellHeightUnit!==a.cellHeightUnit){this.opts.cellHeight=this.opts.cellHeight+this.opts.cellHeightUnit;delete this.opts.cellHeightUnit}this.cellHeight(this.opts.cellHeight,false)}this.el.classList.add(this.opts._styleSheetClass);this._setStaticClass();this.engine=new n.GridStackEngine({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:e=>{let t=0;this.engine.nodes.forEach((e=>{t=Math.max(t,e.y+e.h)}));e.forEach((e=>{let t=e.el;if(!t)return;if(e._removeDOM){if(t)t.remove();delete e._removeDOM}else{this._writePosAttr(t,e)}}));this._updateStyles(false,t)}});if(this.opts.auto){this.batchUpdate();let e=[];this.getGridItems().forEach((t=>{let i=parseInt(t.getAttribute("gs-x"));let s=parseInt(t.getAttribute("gs-y"));e.push({el:t,i:(Number.isNaN(i)?1e3:i)+(Number.isNaN(s)?1e3:s)*this.getColumn()})}));e.sort(((e,t)=>e.i-t.i)).forEach((e=>this._prepareElement(e.el)));this.commit()}this.setAnimation(this.opts.animate);this._updateStyles();if(this.opts.column!=12){this.el.classList.add("grid-stack-"+this.opts.column)}if(this.opts.dragIn)h.setupDragIn(this.opts.dragIn,this.opts.dragInOptions);delete this.opts.dragIn;delete this.opts.dragInOptions;this._setupRemoveDrop();this._setupAcceptWidget();this._updateWindowResizeEvent()}static init(e={},t=".grid-stack"){let i=h.getGridElement(t);if(!i){if(typeof t==="string"){console.error('GridStack.initAll() no grid was found with selector "'+t+'" - element missing or wrong selector ?'+'\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.')}else{console.error("GridStack.init() no grid element was passed.")}return null}if(!i.gridstack){i.gridstack=new h(i,o.Utils.cloneDeep(e))}return i.gridstack}static initAll(e={},t=".grid-stack"){let i=[];h.getGridElements(t).forEach((t=>{if(!t.gridstack){t.gridstack=new h(t,o.Utils.cloneDeep(e));delete e.dragIn;delete e.dragInOptions}i.push(t.gridstack)}));if(i.length===0){console.error('GridStack.initAll() no grid was found with selector "'+t+'" - element missing or wrong selector ?'+'\nNote: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.')}return i}static addGrid(e,t={}){if(!e)return null;let i=e;if(!e.classList.contains("grid-stack")){let s=document.implementation.createHTMLDocument("");s.body.innerHTML=`<div class="grid-stack ${t.class||""}"></div>`;i=s.body.children[0];e.appendChild(i)}let s=h.init(t,i);if(s.opts.children){let e=s.opts.children;delete s.opts.children;s.load(e)}return s}get placeholder(){if(!this._placeholder){let e=document.createElement("div");e.className="placeholder-content";if(this.opts.placeholderText){e.innerHTML=this.opts.placeholderText}this._placeholder=document.createElement("div");this._placeholder.classList.add(this.opts.placeholderClass,a.itemClass,this.opts.itemClass);this.placeholder.appendChild(e)}return this._placeholder}addWidget(e,t){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 t=arguments,i=1,s={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++],minW:t[i++],maxW:t[i++],minH:t[i++],maxH:t[i++],id:t[i++]};return this.addWidget(e,s)}function i(e){return e.x!==undefined||e.y!==undefined||e.w!==undefined||e.h!==undefined||e.content!==undefined?true:false}let s;if(typeof e==="string"){let t=document.implementation.createHTMLDocument("");t.body.innerHTML=e;s=t.body.children[0]}else if(arguments.length===0||arguments.length===1&&i(e)){let i=e?e.content||"":"";t=e;let r=document.implementation.createHTMLDocument("");r.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${i}</div></div>`;s=r.body.children[0]}else{s=e}let r=this._readAttr(s);t=o.Utils.cloneDeep(t)||{};o.Utils.defaults(t,r);let n=this.engine.prepareNode(t);this._writeAttr(s,t);if(this._insertNotAppend){this.el.prepend(s)}else{this.el.appendChild(s)}this._prepareElement(s,true,t);this._updateContainerHeight();if(n.subGrid&&!n.subGrid.el){let e;let t=n.subGrid;if(t.column==="auto"){t.column=n.w;t.disableOneColumnMode=true;e=true}let i=n.el.querySelector(".grid-stack-item-content");n.subGrid=h.addGrid(i,n.subGrid);if(e){n.subGrid._autoColumn=true}}this._triggerAddEvent();this._triggerChangeEvent();return s}save(e=true,t=false){let i=this.engine.save(e);i.forEach((t=>{if(e&&t.el&&!t.subGrid){let e=t.el.querySelector(".grid-stack-item-content");t.content=e?e.innerHTML:undefined;if(!t.content)delete t.content}else{if(!e){delete t.content}if(t.subGrid){t.subGrid=t.subGrid.save(e,true)}}delete t.el}));if(t){let e=o.Utils.cloneDeep(this.opts);if(e.marginBottom===e.marginTop&&e.marginRight===e.marginLeft&&e.marginTop===e.marginRight){e.margin=e.marginTop;delete e.marginTop;delete e.marginRight;delete e.marginBottom;delete e.marginLeft}if(e.rtl===(this.el.style.direction==="rtl")){e.rtl="auto"}if(this._isAutoCellHeight){e.cellHeight="auto"}if(this._autoColumn){e.column="auto";delete e.disableOneColumnMode}o.Utils.removeInternalAndSame(e,a);e.children=i;return e}return i}load(e,t=true){let i=h.Utils.sort([...e],-1,this._prevColumn||this.getColumn());this._insertNotAppend=true;if(this._prevColumn&&this._prevColumn!==this.opts.column&&i.some((e=>e.x+e.w>this.opts.column))){this._ignoreLayoutsNodeChange=true;this.engine.cacheLayout(i,this._prevColumn,true)}let s=[];this.batchUpdate();if(t){let e=[...this.engine.nodes];e.forEach((e=>{let r=i.find((t=>e.id===t.id));if(!r){if(typeof t==="function"){t(this,e,false)}else{s.push(e);this.removeWidget(e.el,true,false)}}}))}i.forEach((e=>{let i=e.id||e.id===0?this.engine.nodes.find((t=>t.id===e.id)):undefined;if(i){this.update(i.el,e);if(e.subGrid&&e.subGrid.children){let t=i.el.querySelector(".grid-stack");if(t&&t.gridstack){t.gridstack.load(e.subGrid.children);this._insertNotAppend=true}}}else if(t){if(typeof t==="function"){e=t(this,e,true).gridstackNode}else{e=this.addWidget(e).gridstackNode}}}));this.engine.removedNodes=s;this.commit();delete this._ignoreLayoutsNodeChange;delete this._insertNotAppend;return this}batchUpdate(){this.engine.batchUpdate();return this}getCellHeight(e=false){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px")){return this.opts.cellHeight}let t=this.el.querySelector("."+this.opts.itemClass);if(t){let e=o.Utils.toNumber(t.getAttribute("gs-h"));return Math.round(t.offsetHeight/e)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e,t=true){if(t&&e!==undefined){if(this._isAutoCellHeight!==(e==="auto")){this._isAutoCellHeight=e==="auto";this._updateWindowResizeEvent()}}if(e==="initial"||e==="auto"){e=undefined}if(e===undefined){let t=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+t}let i=o.Utils.parseHeight(e);if(this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h){return this}this.opts.cellHeightUnit=i.unit;this.opts.cellHeight=i.h;if(t){this._updateStyles(true,this.getRow())}return this}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(){return this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}commit(){this.engine.commit();this._triggerRemoveEvent();this._triggerAddEvent();this._triggerChangeEvent();return this}compact(){this.engine.compact();this._triggerChangeEvent();return this}column(e,t="moveScale"){if(e<1||this.opts.column===e)return this;let i=this.getColumn();if(e===1){this._prevColumn=i}else{delete this._prevColumn}this.el.classList.remove("grid-stack-"+i);this.el.classList.add("grid-stack-"+e);this.opts.column=this.engine.column=e;let s;if(e===1&&this.opts.oneColumnModeDomSort){s=[];this.getGridItems().forEach((e=>{if(e.gridstackNode){s.push(e.gridstackNode)}}));if(!s.length){s=undefined}}this.engine.updateNodeWidths(i,e,s,t);if(this._isAutoCellHeight)this.cellHeight();this._ignoreLayoutsNodeChange=true;this._triggerChangeEvent();delete this._ignoreLayoutsNodeChange;return this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter((e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass)))}destroy(e=true){if(!this.el)return;this._updateWindowResizeEvent(true);this.setStatic(true,false);this.setAnimation(false);if(!e){this.removeAll(e);this.el.classList.remove(this.opts._styleSheetClass)}else{this.el.parentNode.removeChild(this.el)}this._removeStylesheet();this.el.removeAttribute("gs-current-row");delete this.opts._isNested;delete this.opts;delete this._placeholder;delete this.engine;delete this.el.gridstack;delete this.el;return this}float(e){this.engine.float=e;this._triggerChangeEvent();return this}getFloat(){return this.engine.float}getCellFromPixel(e,t=false){let i=this.el.getBoundingClientRect();let s;if(t){s={top:i.top+document.documentElement.scrollTop,left:i.left}}else{s={top:this.el.offsetTop,left:this.el.offsetLeft}}let r=e.left-s.left;let n=e.top-s.top;let o=i.width/this.getColumn();let l=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/o),y:Math.floor(n/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(e,t,i,s){return this.engine.isAreaEmpty(e,t,i,s)}makeWidget(e){let t=h.getElement(e);this._prepareElement(t,true);this._updateContainerHeight();this._triggerAddEvent();this._triggerChangeEvent();return t}on(e,t){if(e.indexOf(" ")!==-1){let i=e.split(" ");i.forEach((e=>this.on(e,t)));return this}if(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"){let i=e==="enable"||e==="disable";if(i){this._gsEventHandler[e]=e=>t(e)}else{this._gsEventHandler[e]=e=>t(e,e.detail)}this.el.addEventListener(e,this._gsEventHandler[e])}else if(e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"){this._gsEventHandler[e]=t}else{console.log("GridStack.on("+e+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.')}return this}off(e){if(e.indexOf(" ")!==-1){let t=e.split(" ");t.forEach((e=>this.off(e)));return this}if(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"){if(this._gsEventHandler[e]){this.el.removeEventListener(e,this._gsEventHandler[e])}}delete this._gsEventHandler[e];return this}removeWidget(e,t=true,i=true){h.getElements(e).forEach((e=>{if(e.parentElement!==this.el)return;let s=e.gridstackNode;if(!s){s=this.engine.nodes.find((t=>e===t.el))}if(!s)return;delete e.gridstackNode;l.GridStackDDI.get().remove(e);this.engine.removeNode(s,t,i);if(t&&e.parentElement){e.remove()}}));if(i){this._triggerRemoveEvent();this._triggerChangeEvent()}return this}removeAll(e=true){this.engine.nodes.forEach((e=>{delete e.el.gridstackNode;l.GridStackDDI.get().remove(e.el)}));this.engine.removeAll(e);this._triggerRemoveEvent();return this}setAnimation(e){if(e){this.el.classList.add("grid-stack-animate")}else{this.el.classList.remove("grid-stack-animate")}return this}setStatic(e,t=true){if(this.opts.staticGrid===e)return this;this.opts.staticGrid=e;this._setupRemoveDrop();this._setupAcceptWidget();this.engine.nodes.forEach((e=>this._prepareDragDropByNode(e)));if(t){this._setStaticClass()}return this}update(e,t){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let i=arguments,s=1;t={x:i[s++],y:i[s++],w:i[s++],h:i[s++]};return this.update(e,t)}h.getElements(e).forEach((e=>{if(!e||!e.gridstackNode)return;let i=e.gridstackNode;let s=o.Utils.cloneDeep(t);delete s.autoPosition;let r=["x","y","w","h"];let n;if(r.some((e=>s[e]!==undefined&&s[e]!==i[e]))){n={};r.forEach((e=>{n[e]=s[e]!==undefined?s[e]:i[e];delete s[e]}))}if(!n&&(s.minW||s.minH||s.maxW||s.maxH)){n={}}if(s.content){let t=e.querySelector(".grid-stack-item-content");if(t&&t.innerHTML!==s.content){t.innerHTML=s.content}delete s.content}let l=false;let a=false;for(const e in s){if(e[0]!=="_"&&i[e]!==s[e]){i[e]=s[e];l=true;a=a||!this.opts.staticGrid&&(e==="noResize"||e==="noMove"||e==="locked")}}if(n){this.engine.cleanNodes().beginUpdate(i).moveNode(i,n);this._updateContainerHeight();this._triggerChangeEvent();this.engine.endUpdate()}if(l){this._writeAttr(e,i)}if(a){this._prepareDragDropByNode(i)}}));return this}margin(e){let t=typeof e==="string"&&e.split(" ").length>1;if(!t){let t=o.Utils.parseHeight(e);if(this.opts.marginUnit===t.unit&&this.opts.margin===t.h)return}this.opts.margin=e;this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=undefined;this.initMargin();this._updateStyles(true);return this}getMargin(){return this.opts.margin}willItFit(e){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 e=arguments,t=0,i={x:e[t++],y:e[t++],w:e[t++],h:e[t++],autoPosition:e[t++]};return this.willItFit(i)}return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let e=this.engine.getDirtyNodes(true);if(e&&e.length){if(!this._ignoreLayoutsNodeChange){this.engine.layoutsNodesChange(e)}this._triggerEvent("change",e)}this.engine.saveInitial();return this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes&&this.engine.addedNodes.length>0){if(!this._ignoreLayoutsNodeChange){this.engine.layoutsNodesChange(this.engine.addedNodes)}this.engine.addedNodes.forEach((e=>{delete e._dirty}));this._triggerEvent("added",this.engine.addedNodes);this.engine.addedNodes=[]}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes&&this.engine.removedNodes.length>0){this._triggerEvent("removed",this.engine.removedNodes);this.engine.removedNodes=[]}return this}_triggerEvent(e,t){let i=t?new CustomEvent(e,{bubbles:false,detail:t}):new Event(e);this.el.dispatchEvent(i);return this}_removeStylesheet(){if(this._styles){o.Utils.removeStylesheet(this._styles._id);delete this._styles}return this}_updateStyles(e=false,t){if(e){this._removeStylesheet()}this._updateContainerHeight();if(this.opts.cellHeight===0){return this}let i=this.opts.cellHeight;let s=this.opts.cellHeightUnit;let r=`.${this.opts._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let e="gridstack-style-"+(Math.random()*1e5).toFixed();let t=this.opts.styleInHead?undefined:this.el.parentNode;this._styles=o.Utils.createStylesheet(e,t);if(!this._styles)return this;this._styles._id=e;this._styles._max=0;o.Utils.addCSSRule(this._styles,r,`min-height: ${i}${s}`);let n=this.opts.marginTop+this.opts.marginUnit;let l=this.opts.marginBottom+this.opts.marginUnit;let a=this.opts.marginRight+this.opts.marginUnit;let h=this.opts.marginLeft+this.opts.marginUnit;let d=`${r} > .grid-stack-item-content`;let g=`.${this.opts._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;o.Utils.addCSSRule(this._styles,d,`top: ${n}; right: ${a}; bottom: ${l}; left: ${h};`);o.Utils.addCSSRule(this._styles,g,`top: ${n}; right: ${a}; bottom: ${l}; left: ${h};`);o.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-ne`,`right: ${a}`);o.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-e`,`right: ${a}`);o.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-se`,`right: ${a}; bottom: ${l}`);o.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-nw`,`left: ${h}`);o.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-w`,`left: ${h}`);o.Utils.addCSSRule(this._styles,`${r} > .ui-resizable-sw`,`left: ${h}; bottom: ${l}`)}t=t||this._styles._max;if(t>this._styles._max){let e=e=>i*e+s;for(let i=this._styles._max+1;i<=t;i++){let t=e(i);o.Utils.addCSSRule(this._styles,`${r}[gs-y="${i-1}"]`,`top: ${e(i-1)}`);o.Utils.addCSSRule(this._styles,`${r}[gs-h="${i}"]`,`height: ${t}`);o.Utils.addCSSRule(this._styles,`${r}[gs-min-h="${i}"]`,`min-height: ${t}`);o.Utils.addCSSRule(this._styles,`${r}[gs-max-h="${i}"]`,`max-height: ${t}`)}this._styles._max=t}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let e=this.getRow()+this._extraDragRow;this.el.setAttribute("gs-current-row",String(e));if(e===0){this.el.style.removeProperty("height");return this}let t=this.opts.cellHeight;let i=this.opts.cellHeightUnit;if(!t)return this;this.el.style.height=e*t+i;return this}_prepareElement(e,t=false,i){if(!i){e.classList.add(this.opts.itemClass);i=this._readAttr(e)}e.gridstackNode=i;i.el=e;i.grid=this;let s=Object.assign({},i);i=this.engine.addNode(i,t);if(!o.Utils.same(i,s)){this._writeAttr(e,i)}this._prepareDragDropByNode(i);return this}_writePosAttr(e,t){if(t.x!==undefined&&t.x!==null){e.setAttribute("gs-x",String(t.x))}if(t.y!==undefined&&t.y!==null){e.setAttribute("gs-y",String(t.y))}if(t.w){e.setAttribute("gs-w",String(t.w))}if(t.h){e.setAttribute("gs-h",String(t.h))}return this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);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){if(t[s]){e.setAttribute(i[s],String(t[s]))}else{e.removeAttribute(i[s])}}return this}_readAttr(e){let t={};t.x=o.Utils.toNumber(e.getAttribute("gs-x"));t.y=o.Utils.toNumber(e.getAttribute("gs-y"));t.w=o.Utils.toNumber(e.getAttribute("gs-w"));t.h=o.Utils.toNumber(e.getAttribute("gs-h"));t.maxW=o.Utils.toNumber(e.getAttribute("gs-max-w"));t.minW=o.Utils.toNumber(e.getAttribute("gs-min-w"));t.maxH=o.Utils.toNumber(e.getAttribute("gs-max-h"));t.minH=o.Utils.toNumber(e.getAttribute("gs-min-h"));t.autoPosition=o.Utils.toBool(e.getAttribute("gs-auto-position"));t.noResize=o.Utils.toBool(e.getAttribute("gs-no-resize"));t.noMove=o.Utils.toBool(e.getAttribute("gs-no-move"));t.locked=o.Utils.toBool(e.getAttribute("gs-locked"));t.resizeHandles=e.getAttribute("gs-resize-handles");t.id=e.getAttribute("gs-id");for(const e in t){if(!t.hasOwnProperty(e))return;if(!t[e]&&t[e]!==0){delete t[e]}}return t}_setStaticClass(){let e=["grid-stack-static"];if(this.opts.staticGrid){this.el.classList.add(...e);this.el.setAttribute("gs-static","true")}else{this.el.classList.remove(...e);this.el.removeAttribute("gs-static")}return this}onParentResize(){if(!this.el||!this.el.clientWidth)return;let e=false;if(this._autoColumn&&this.opts._isNested){if(this.opts.column!==this.opts._isNested.w){e=true;this.column(this.opts._isNested.w,"none")}}else{let t=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.minWidth;if(this.opts.column===1!==t){e=true;if(this.opts.animate){this.setAnimation(false)}this.column(t?1:this._prevColumn);if(this.opts.animate){this.setAnimation(true)}}}if(this._isAutoCellHeight){if(!e&&this.opts.cellHeightThrottle){if(!this._cellHeightThrottle){this._cellHeightThrottle=o.Utils.throttle((()=>this.cellHeight()),this.opts.cellHeightThrottle)}this._cellHeightThrottle()}else{this.cellHeight()}}this.engine.nodes.forEach((e=>{if(e.subGrid){e.subGrid.onParentResize()}}));return this}_updateWindowResizeEvent(e=false){const t=(this._isAutoCellHeight||!this.opts.disableOneColumnMode)&&!this.opts._isNested;if(!e&&t&&!this._windowResizeBind){this._windowResizeBind=this.onParentResize.bind(this);window.addEventListener("resize",this._windowResizeBind)}else if((e||!t)&&this._windowResizeBind){window.removeEventListener("resize",this._windowResizeBind);delete this._windowResizeBind}return this}static getElement(e=".grid-stack-item"){return o.Utils.getElement(e)}static getElements(e=".grid-stack-item"){return o.Utils.getElements(e)}static getGridElement(e){return h.getElement(e)}static getGridElements(e){return o.Utils.getElements(e)}initMargin(){let e;let t=0;let i=[];if(typeof this.opts.margin==="string"){i=this.opts.margin.split(" ")}if(i.length===2){this.opts.marginTop=this.opts.marginBottom=i[0];this.opts.marginLeft=this.opts.marginRight=i[1]}else if(i.length===4){this.opts.marginTop=i[0];this.opts.marginRight=i[1];this.opts.marginBottom=i[2];this.opts.marginLeft=i[3]}else{e=o.Utils.parseHeight(this.opts.margin);this.opts.marginUnit=e.unit;t=this.opts.margin=e.h}if(this.opts.marginTop===undefined){this.opts.marginTop=t}else{e=o.Utils.parseHeight(this.opts.marginTop);this.opts.marginTop=e.h;delete this.opts.margin}if(this.opts.marginBottom===undefined){this.opts.marginBottom=t}else{e=o.Utils.parseHeight(this.opts.marginBottom);this.opts.marginBottom=e.h;delete this.opts.margin}if(this.opts.marginRight===undefined){this.opts.marginRight=t}else{e=o.Utils.parseHeight(this.opts.marginRight);this.opts.marginRight=e.h;delete this.opts.margin}if(this.opts.marginLeft===undefined){this.opts.marginLeft=t}else{e=o.Utils.parseHeight(this.opts.marginLeft);this.opts.marginLeft=e.h;delete this.opts.margin}this.opts.marginUnit=e.unit;if(this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight){this.opts.margin=this.opts.marginTop}return this}static setupDragIn(e,t){}movable(e,t){return this}resizable(e,t){return this}disable(){return this}enable(){return this}enableMove(e){return this}enableResize(e){return this}_setupAcceptWidget(){return this}_setupRemoveDrop(){return this}_prepareDragDropByNode(e){return this}_onStartMoving(e,t,i,s,r,n){return}_dragOrResize(e,t,i,s,r,n){return}_leave(e,t){return}}t.GridStack=h;h.Utils=o.Utils;h.Engine=n.GridStackEngine},98:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDBaseImplement=void 0;class i{constructor(){this._disabled=false;this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=false}disable(){this._disabled=true}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}}t.DDBaseImplement=i},100:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDDraggable=void 0;const s=i(94);const r=i(99);const n=i(98);class o extends n.DDBaseImplement{constructor(e,t={}){super();this.dragging=false;this.ui=()=>{const e=this.el.parentElement;const t=e.getBoundingClientRect();const i=this.helper.getBoundingClientRect();return{position:{top:i.top-t.top,left:i.left-t.left}}};this.el=e;this.option=t;let i=t.handle.substring(1);this.dragEl=e.classList.contains(i)?e:e.querySelector(t.handle)||e;this._dragStart=this._dragStart.bind(this);this._drag=this._drag.bind(this);this._dragEnd=this._dragEnd.bind(this);this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable();this.dragEl.draggable=true;this.dragEl.addEventListener("dragstart",this._dragStart);this.el.classList.remove("ui-draggable-disabled");this.el.classList.add("ui-draggable")}disable(e=false){super.disable();this.dragEl.removeAttribute("draggable");this.dragEl.removeEventListener("dragstart",this._dragStart);this.el.classList.remove("ui-draggable");if(!e)this.el.classList.add("ui-draggable-disabled")}destroy(){if(this.dragging){this._dragEnd({})}this.disable(true);delete this.el;delete this.helper;delete this.option;super.destroy()}updateOption(e){Object.keys(e).forEach((t=>this.option[t]=e[t]));return this}_dragStart(e){s.DDManager.dragElement=this;this.helper=this._createHelper(e);this._setupHelperContainmentStyle();this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment);const t=r.DDUtils.initEvent(e,{target:this.el,type:"dragstart"});if(this.helper!==this.el){this._setupDragFollowNodeNotifyStart(t);this._dragFollow(e)}else{this.dragFollowTimer=window.setTimeout((()=>{delete this.dragFollowTimer;this._setupDragFollowNodeNotifyStart(t)}),0)}this._cancelDragGhost(e)}_setupDragFollowNodeNotifyStart(e){this._setupHelperStyle();document.addEventListener("dragover",this._drag,o.dragEventListenerOption);this.dragEl.addEventListener("dragend",this._dragEnd);if(this.option.start){this.option.start(e,this.ui())}this.dragging=true;this.helper.classList.add("ui-draggable-dragging");this.triggerEvent("dragstart",e);return this}_drag(e){e.preventDefault();this._dragFollow(e);const t=r.DDUtils.initEvent(e,{target:this.el,type:"drag"});if(this.option.drag){this.option.drag(t,this.ui())}this.triggerEvent("drag",t)}_dragEnd(e){if(this.dragFollowTimer){clearTimeout(this.dragFollowTimer);delete this.dragFollowTimer;return}else{if(this.paintTimer){cancelAnimationFrame(this.paintTimer)}document.removeEventListener("dragover",this._drag,o.dragEventListenerOption);this.dragEl.removeEventListener("dragend",this._dragEnd)}this.dragging=false;this.helper.classList.remove("ui-draggable-dragging");this.helperContainment.style.position=this.parentOriginStylePosition||null;if(this.helper===this.el){this._removeHelperStyle()}else{this.helper.remove()}const t=r.DDUtils.initEvent(e,{target:this.el,type:"dragstop"});if(this.option.stop){this.option.stop(t)}this.triggerEvent("dragstop",t);delete s.DDManager.dragElement;delete this.helper}_createHelper(e){let t=this.el;if(typeof this.option.helper==="function"){t=this.option.helper(e)}else if(this.option.helper==="clone"){t=r.DDUtils.clone(this.el)}if(!document.body.contains(t)){r.DDUtils.appendTo(t,this.option.appendTo==="parent"?this.el.parentNode:this.option.appendTo)}if(t===this.el){this.dragElementOriginStyle=o.originStyleProp.map((e=>this.el.style[e]))}return t}_setupHelperStyle(){const e=this.helper.getBoundingClientRect();const t=this.helper.style;t.pointerEvents="none";t["min-width"]=0;t.width=this.dragOffset.width+"px";t.height=this.dragOffset.height+"px";t.willChange="left, top";t.position="fixed";t.left=e.left+"px";t.top=e.top+"px";t.transition="none";setTimeout((()=>{if(this.helper){t.transition=null}}),0);return this}_removeHelperStyle(){let e=this.helper?this.helper.gridstackNode:undefined;if(this.dragElementOriginStyle&&(!e||!e._isAboutToRemove)){o.originStyleProp.forEach((e=>{this.helper.style[e]=this.dragElementOriginStyle[e]||null}));this.helper.style.transition="none";setTimeout((()=>{if(this.helper){this.helper.style.transition=this.dragElementOriginStyle["transition"]}}),0)}delete this.dragElementOriginStyle;return this}_dragFollow(e){if(this.paintTimer){cancelAnimationFrame(this.paintTimer)}this.paintTimer=requestAnimationFrame((()=>{delete this.paintTimer;const t=this.dragOffset;let i={left:0,top:0};if(this.helper.style.position==="absolute"){const{left:e,top:t}=this.helperContainment.getBoundingClientRect();i={left:e,top:t}}this.helper.style.left=e.clientX+t.offsetLeft-i.left+"px";this.helper.style.top=e.clientY+t.offsetTop-i.top+"px"}))}_setupHelperContainmentStyle(){this.helperContainment=this.helper.parentElement;if(this.helper.style.position!=="fixed"){this.parentOriginStylePosition=this.helperContainment.style.position;if(window.getComputedStyle(this.helperContainment).position.match(/static/)){this.helperContainment.style.position="relative"}}return this}_cancelDragGhost(e){let t=document.createElement("div");t.style.width="1px";t.style.height="1px";t.style.position="fixed";document.body.appendChild(t);e.dataTransfer.setDragImage(t,0,0);setTimeout((()=>document.body.removeChild(t)));e.stopPropagation();return this}_getDragOffset(e,t,i){let s=0;let n=0;if(i){const e=document.createElement("div");r.DDUtils.addElStyles(e,{opacity:"0",position:"fixed",top:0+"px",left:0+"px",width:"1px",height:"1px",zIndex:"-999999"});i.appendChild(e);const t=e.getBoundingClientRect();i.removeChild(e);s=t.left;n=t.top}const o=t.getBoundingClientRect();return{left:o.left,top:o.top,offsetLeft:-e.clientX+o.left-s,offsetTop:-e.clientY+o.top-n,width:o.width,height:o.height}}}t.DDDraggable=o;o.dragEventListenerOption=true;o.originStyleProp=["transition","pointerEvents","position","left","top","opacity","zIndex","width","height","willChange","min-width"]},101:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDDroppable=void 0;const s=i(94);const r=i(98);const n=i(99);class o extends r.DDBaseImplement{constructor(e,t={}){super();this.el=e;this.option=t;this._dragEnter=this._dragEnter.bind(this);this._dragOver=this._dragOver.bind(this);this._dragLeave=this._dragLeave.bind(this);this._drop=this._drop.bind(this);this.el.classList.add("ui-droppable");this.el.addEventListener("dragenter",this._dragEnter);this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){if(!this.disabled)return;super.enable();this.el.classList.remove("ui-droppable-disabled");this.el.addEventListener("dragenter",this._dragEnter)}disable(e=false){if(this.disabled)return;super.disable();if(!e)this.el.classList.add("ui-droppable-disabled");this.el.removeEventListener("dragenter",this._dragEnter)}destroy(){this._removeLeaveCallbacks();this.disable(true);this.el.classList.remove("ui-droppable");this.el.classList.remove("ui-droppable-disabled");super.destroy()}updateOption(e){Object.keys(e).forEach((t=>this.option[t]=e[t]));this._setupAccept();return this}_dragEnter(e){if(!this._canDrop())return;e.preventDefault();e.stopPropagation();if(this.moving)return;this.moving=true;const t=n.DDUtils.initEvent(e,{target:this.el,type:"dropover"});if(this.option.over){this.option.over(t,this._ui(s.DDManager.dragElement))}this.triggerEvent("dropover",t);this.el.addEventListener("dragover",this._dragOver);this.el.addEventListener("drop",this._drop);this.el.addEventListener("dragleave",this._dragLeave);if(o.lastActive&&o.lastActive!==this){o.lastActive._dragLeave(e,true)}o.lastActive=this}_dragOver(e){e.preventDefault();e.stopPropagation()}_dragLeave(e,t){var i;e.preventDefault();e.stopPropagation();if(!t){let t=n.DDUtils.inside(e,this.el);let r=s.DDManager.dragElement.el;if(t&&!((i=r.gridstackNode)===null||i===void 0?void 0:i.subGrid)){let i=this.el.gridstack.engine.nodes.filter((e=>e.subGrid)).map((e=>e.subGrid.el));t=!i.some((t=>n.DDUtils.inside(e,t)))}if(t)return}if(this.moving){const t=n.DDUtils.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out){this.option.out(t,this._ui(s.DDManager.dragElement))}this.triggerEvent("dropout",t)}this._removeLeaveCallbacks();if(o.lastActive===this){delete o.lastActive}}_drop(e){if(!this.moving)return;e.preventDefault();const t=n.DDUtils.initEvent(e,{target:this.el,type:"drop"});if(this.option.drop){this.option.drop(t,this._ui(s.DDManager.dragElement))}this.triggerEvent("drop",t);this._removeLeaveCallbacks()}_removeLeaveCallbacks(){if(!this.moving){return}delete this.moving;this.el.removeEventListener("dragover",this._dragOver);this.el.removeEventListener("drop",this._drop);this.el.removeEventListener("dragleave",this._dragLeave)}_canDrop(){return s.DDManager.dragElement&&(!this.accept||this.accept(s.DDManager.dragElement.el))}_setupAccept(){if(this.option.accept&&typeof this.option.accept==="string"){this.accept=e=>e.matches(this.option.accept)}else{this.accept=this.option.accept}return this}_ui(e){return Object.assign({draggable:e.el},e.ui())}}t.DDDroppable=o},95:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDElement=void 0;const s=i(96);const r=i(100);const n=i(101);class o{constructor(e){this.el=e}static init(e){if(!e.ddElement){e.ddElement=new o(e)}return e.ddElement}on(e,t){if(this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1){this.ddDraggable.on(e,t)}else if(this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1){this.ddDroppable.on(e,t)}else if(this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1){this.ddResizable.on(e,t)}return this}off(e){if(this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1){this.ddDraggable.off(e)}else if(this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1){this.ddDroppable.off(e)}else if(this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1){this.ddResizable.off(e)}return this}setupDraggable(e){if(!this.ddDraggable){this.ddDraggable=new r.DDDraggable(this.el,e)}else{this.ddDraggable.updateOption(e)}return this}cleanDraggable(){if(this.ddDraggable){this.ddDraggable.destroy();delete this.ddDraggable}return this}setupResizable(e){if(!this.ddResizable){this.ddResizable=new s.DDResizable(this.el,e)}else{this.ddResizable.updateOption(e)}return this}cleanResizable(){if(this.ddResizable){this.ddResizable.destroy();delete this.ddResizable}return this}setupDroppable(e){if(!this.ddDroppable){this.ddDroppable=new n.DDDroppable(this.el,e)}else{this.ddDroppable.updateOption(e)}return this}cleanDroppable(){if(this.ddDroppable){this.ddDroppable.destroy();delete this.ddDroppable}return this}}t.DDElement=o},94:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDManager=void 0;class i{}t.DDManager=i},97:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDResizableHandle=void 0;class i{constructor(e,t,i){this.moving=false;this.host=e;this.dir=t;this.option=i;this._mouseDown=this._mouseDown.bind(this);this._mouseMove=this._mouseMove.bind(this);this._mouseUp=this._mouseUp.bind(this);this._init()}_init(){const e=document.createElement("div");e.classList.add("ui-resizable-handle");e.classList.add(`${i.prefix}${this.dir}`);e.style.zIndex="100";e.style.userSelect="none";this.el=e;this.host.appendChild(this.el);this.el.addEventListener("mousedown",this._mouseDown);return this}destroy(){if(this.moving)this._mouseUp(this.mouseDownEvent);this.el.removeEventListener("mousedown",this._mouseDown);this.host.removeChild(this.el);delete this.el;delete this.host;return this}_mouseDown(e){e.preventDefault();this.mouseDownEvent=e;document.addEventListener("mousemove",this._mouseMove,true);document.addEventListener("mouseup",this._mouseUp)}_mouseMove(e){let t=this.mouseDownEvent;if(!this.moving&&Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2){this.moving=true;this._triggerEvent("start",this.mouseDownEvent)}else if(this.moving){this._triggerEvent("move",e)}}_mouseUp(e){if(this.moving){this._triggerEvent("stop",e)}document.removeEventListener("mousemove",this._mouseMove,true);document.removeEventListener("mouseup",this._mouseUp);delete this.moving;delete this.mouseDownEvent}_triggerEvent(e,t){if(this.option[e])this.option[e](t);return this}}t.DDResizableHandle=i;i.prefix="ui-resizable-"},96:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDResizable=void 0;const s=i(97);const r=i(98);const n=i(99);const o=i(90);class l extends r.DDBaseImplement{constructor(e,t={}){super();this._showHandlers=()=>{this.el.classList.remove("ui-resizable-autohide")};this._hideHandlers=()=>{this.el.classList.add("ui-resizable-autohide")};this._ui=()=>{const e=this.el.parentElement;const t=e.getBoundingClientRect();const i={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled};const s=this.temporalRect||i;return{position:{left:s.left-t.left,top:s.top-t.top},size:{width:s.width,height:s.height}}};this.el=e;this.option=t;this.enable();this._setupAutoHide();this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable();this.el.classList.add("ui-resizable");this.el.classList.remove("ui-resizable-disabled")}disable(){super.disable();this.el.classList.add("ui-resizable-disabled");this.el.classList.remove("ui-resizable")}destroy(){this._removeHandlers();if(this.option.autoHide){this.el.removeEventListener("mouseover",this._showHandlers);this.el.removeEventListener("mouseout",this._hideHandlers)}this.el.classList.remove("ui-resizable");delete this.el;super.destroy()}updateOption(e){let t=e.handles&&e.handles!==this.option.handles;let i=e.autoHide&&e.autoHide!==this.option.autoHide;Object.keys(e).forEach((t=>this.option[t]=e[t]));if(t){this._removeHandlers();this._setupHandlers()}if(i){this._setupAutoHide()}return this}_setupAutoHide(){if(this.option.autoHide){this.el.classList.add("ui-resizable-autohide");this.el.addEventListener("mouseover",this._showHandlers);this.el.addEventListener("mouseout",this._hideHandlers)}else{this.el.classList.remove("ui-resizable-autohide");this.el.removeEventListener("mouseover",this._showHandlers);this.el.removeEventListener("mouseout",this._hideHandlers)}return this}_setupHandlers(){let e=this.option.handles||"e,s,se";if(e==="all"){e="n,e,s,w,se,sw,ne,nw"}this.handlers=e.split(",").map((e=>e.trim())).map((e=>new s.DDResizableHandle(this.el,e,{start:e=>{this._resizeStart(e)},stop:e=>{this._resizeStop(e)},move:t=>{this._resizing(t,e)}})));return this}_resizeStart(e){this.originalRect=this.el.getBoundingClientRect();this.scrollEl=o.Utils.getScrollElement(this.el);this.scrollY=this.scrollEl.scrollTop;this.scrolled=0;this.startEvent=e;this._setupHelper();this._applyChange();const t=n.DDUtils.initEvent(e,{type:"resizestart",target:this.el});if(this.option.start){this.option.start(t,this._ui())}this.el.classList.add("ui-resizable-resizing");this.triggerEvent("resizestart",t);return this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY;this.temporalRect=this._getChange(e,t);this._applyChange();const i=n.DDUtils.initEvent(e,{type:"resize",target:this.el});if(this.option.resize){this.option.resize(i,this._ui())}this.triggerEvent("resize",i);return this}_resizeStop(e){const t=n.DDUtils.initEvent(e,{type:"resizestop",target:this.el});if(this.option.stop){this.option.stop(t)}this.el.classList.remove("ui-resizable-resizing");this.triggerEvent("resizestop",t);this._cleanHelper();delete this.startEvent;delete this.originalRect;delete this.temporalRect;delete this.scrollY;delete this.scrolled;return this}_setupHelper(){this.elOriginStyleVal=l._originStyleProp.map((e=>this.el.style[e]));this.parentOriginStylePosition=this.el.parentElement.style.position;if(window.getComputedStyle(this.el.parentElement).position.match(/static/)){this.el.parentElement.style.position="relative"}this.el.style.position="absolute";this.el.style.opacity="0.8";return this}_cleanHelper(){l._originStyleProp.forEach(((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}));this.el.parentElement.style.position=this.parentOriginStylePosition||null;return this}_getChange(e,t){const i=this.startEvent;const s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled};const r=e.clientX-i.clientX;const n=e.clientY-i.clientY;if(t.indexOf("e")>-1){s.width+=r}else if(t.indexOf("w")>-1){s.width-=r;s.left+=r}if(t.indexOf("s")>-1){s.height+=n}else if(t.indexOf("n")>-1){s.height-=n;s.top+=n}const o=this._constrainSize(s.width,s.height);if(Math.round(s.width)!==Math.round(o.width)){if(t.indexOf("w")>-1){s.left+=s.width-o.width}s.width=o.width}if(Math.round(s.height)!==Math.round(o.height)){if(t.indexOf("n")>-1){s.top+=s.height-o.height}s.height=o.height}return s}_constrainSize(e,t){const i=this.option.maxWidth||Number.MAX_SAFE_INTEGER;const s=this.option.minWidth||e;const r=this.option.maxHeight||Number.MAX_SAFE_INTEGER;const n=this.option.minHeight||t;const o=Math.min(i,Math.max(s,e));const l=Math.min(r,Math.max(n,t));return{width:o,height:l}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const t=this.el.parentElement;const{left:i,top:s}=t.getBoundingClientRect();e={left:i,top:s,width:0,height:0}}if(!this.temporalRect)return this;Object.keys(this.temporalRect).forEach((t=>{const i=this.temporalRect[t];this.el.style[t]=i-e[t]+"px"}));return this}_removeHandlers(){this.handlers.forEach((e=>e.destroy()));delete this.handlers;return this}}t.DDResizable=l;l._originStyleProp=["width","height","position","left","top","opacity","zIndex"]},99:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.DDUtils=void 0;class i{static clone(e){const t=e.cloneNode(true);t.removeAttribute("id");return t}static appendTo(e,t){let i;if(typeof t==="string"){i=document.querySelector(t)}else{i=t}if(i){i.appendChild(e)}}static setPositionRelative(e){if(!/^(?:r|a|f)/.test(window.getComputedStyle(e).position)){e.style.position="relative"}}static addElStyles(e,t){if(t instanceof Object){for(const i in t){if(t.hasOwnProperty(i)){if(Array.isArray(t[i])){t[i].forEach((t=>{e.style[i]=t}))}else{e.style[i]=t[i]}}}}}static initEvent(e,t){const i={type:t.type};const s={button:0,which:0,buttons:1,bubbles:true,cancelable:true,target:t.target?t.target:e.target};if(e.dataTransfer){i["dataTransfer"]=e.dataTransfer}["altKey","ctrlKey","metaKey","shiftKey"].forEach((t=>i[t]=e[t]));["pageX","pageY","clientX","clientY","screenX","screenY"].forEach((t=>i[t]=e[t]));return Object.assign(Object.assign({},i),s)}static inside(e,t){let i=e.relatedTarget||e.fromElement;if(!i){const{bottom:i,left:s,right:r,top:n}=t.getBoundingClientRect();return e.x<r&&e.x>s&&e.y<i&&e.y>n}return t.contains(i)}}t.DDUtils=i;i.isEventSupportPassiveOption=(()=>{let e=false;let t=()=>{};document.addEventListener("test",t,{get passive(){e=true;return true}});document.removeEventListener("test",t);return e})()},93:function(e,t,i){var s=this&&this.__createBinding||(Object.create?function(e,t,i,s){if(s===undefined)s=i;Object.defineProperty(e,s,{enumerable:true,get:function(){return t[i]}})}:function(e,t,i,s){if(s===undefined)s=i;e[s]=t[i]});var r=this&&this.__exportStar||function(e,t){for(var i in e)if(i!=="default"&&!t.hasOwnProperty(i))s(t,e,i)};Object.defineProperty(t,"__esModule",{value:true});t.GridStackDDNative=void 0;const n=i(94);const o=i(95);const l=i(102);const a=i(90);r(i(102),t);class h extends l.GridStackDD{resizable(e,t,i,s){this._getDDElements(e).forEach((e=>{if(t==="disable"||t==="enable"){e.ddResizable&&e.ddResizable[t]()}else if(t==="destroy"){e.ddResizable&&e.cleanResizable()}else if(t==="option"){e.setupResizable({[i]:s})}else{const i=e.el.gridstackNode.grid;let s=e.el.getAttribute("gs-resize-handles")?e.el.getAttribute("gs-resize-handles"):i.opts.resizable.handles;e.setupResizable(Object.assign(Object.assign(Object.assign({},i.opts.resizable),{handles:s}),{start:t.start,stop:t.stop,resize:t.resize}))}}));return this}draggable(e,t,i,s){this._getDDElements(e).forEach((e=>{if(t==="disable"||t==="enable"){e.ddDraggable&&e.ddDraggable[t]()}else if(t==="destroy"){e.ddDraggable&&e.cleanDraggable()}else if(t==="option"){e.setupDraggable({[i]:s})}else{const i=e.el.gridstackNode.grid;e.setupDraggable(Object.assign(Object.assign({},i.opts.draggable),{containment:i.opts._isNested&&!i.opts.dragOut?i.el.parentElement:i.opts.draggable.containment||null,start:t.start,stop:t.stop,drag:t.drag}))}}));return this}dragIn(e,t){this._getDDElements(e).forEach((e=>e.setupDraggable(t)));return this}droppable(e,t,i,s){if(typeof t.accept==="function"&&!t._accept){t._accept=t.accept;t.accept=e=>t._accept(e)}this._getDDElements(e).forEach((e=>{if(t==="disable"||t==="enable"){e.ddDroppable&&e.ddDroppable[t]()}else if(t==="destroy"){if(e.ddDroppable){e.cleanDroppable()}}else if(t==="option"){e.setupDroppable({[i]:s})}else{e.setupDroppable(t)}}));return this}isDroppable(e){return!!(e&&e.ddElement&&e.ddElement.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e&&e.ddElement&&e.ddElement.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e&&e.ddElement&&e.ddElement.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){this._getDDElements(e).forEach((e=>e.on(t,(e=>{i(e,n.DDManager.dragElement?n.DDManager.dragElement.el:e.target,n.DDManager.dragElement?n.DDManager.dragElement.helper:null)}))));return this}off(e,t){this._getDDElements(e).forEach((e=>e.off(t)));return this}_getDDElements(e,t=true){let i=a.Utils.getElements(e);if(!i.length)return[];let s=i.map((e=>e.ddElement||(t?o.DDElement.init(e):null)));if(!t){s.filter((e=>e))}return s}}t.GridStackDDNative=h;l.GridStackDD.registerPlugin(h)},92:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true})},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.Utils=t.obsoleteAttr=t.obsoleteOptsDel=t.obsoleteOpts=t.obsolete=void 0;function i(e,t,i,s,r){let n=(...n)=>{console.warn("gridstack.js: Function `"+i+"` is deprecated in "+r+" and has been replaced "+"with `"+s+"`. It will be **completely** removed in v1.0");return t.apply(e,n)};n.prototype=t.prototype;return n}t.obsolete=i;function s(e,t,i,s){if(e[t]!==undefined){e[i]=e[t];console.warn("gridstack.js: Option `"+t+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}}t.obsoleteOpts=s;function r(e,t,i,s){if(e[t]!==undefined){console.warn("gridstack.js: Option `"+t+"` is deprecated in "+i+s)}}t.obsoleteOptsDel=r;function n(e,t,i,s){let r=e.getAttribute(t);if(r!==null){e.setAttribute(i,r);console.warn("gridstack.js: attribute `"+t+"`="+r+" is deprecated on this object in "+s+" and has been replaced with `"+i+"`. It will be **completely** removed in v1.0")}}t.obsoleteAttr=n;class o{static getElements(e){if(typeof e==="string"){let t=document.querySelectorAll(e);if(!t.length&&e[0]!=="."&&e[0]!=="#"){t=document.querySelectorAll("."+e);if(!t.length){t=document.querySelectorAll("#"+e)}}return Array.from(t)}return[e]}static getElement(e){if(typeof e==="string"){if(!e.length)return null;if(e[0]==="#"){return document.getElementById(e.substring(1))}if(e[0]==="."||e[0]==="["){return document.querySelector(e)}if(!isNaN(+e[0])){return document.getElementById(e)}let t=document.querySelector(e);if(!t){t=document.getElementById(e)}if(!t){t=document.querySelector("."+e)}return t}return e}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return o.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static sort(e,t,i){i=i||e.reduce(((e,t)=>Math.max(t.x+t.w,e)),0)||12;if(t===-1)return e.sort(((e,t)=>t.x+t.y*i-(e.x+e.y*i)));else return e.sort(((e,t)=>e.x+e.y*i-(t.x+t.y*i)))}static createStylesheet(e,t){let i=document.createElement("style");i.setAttribute("type","text/css");i.setAttribute("gs-style-id",e);if(i.styleSheet){i.styleSheet.cssText=""}else{i.appendChild(document.createTextNode(""))}if(!t){t=document.getElementsByTagName("head")[0];t.appendChild(i)}else{t.insertBefore(i,t.firstChild)}return i.sheet}static removeStylesheet(e){let t=document.querySelector("STYLE[gs-style-id="+e+"]");if(t&&t.parentNode)t.remove()}static addCSSRule(e,t,i){if(typeof e.addRule==="function"){e.addRule(t,i)}else if(typeof e.insertRule==="function"){e.insertRule(`${t}{${i}}`)}}static toBool(e){if(typeof e==="boolean"){return e}if(typeof e==="string"){e=e.toLowerCase();return!(e===""||e==="no"||e==="false"||e==="0")}return Boolean(e)}static toNumber(e){return e===null||e.length===0?undefined:Number(e)}static parseHeight(e){let t;let i="px";if(typeof e==="string"){let s=e.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";t=parseFloat(s[1])}else{t=e}return{h:t,unit:i}}static defaults(e,...t){t.forEach((t=>{for(const i in t){if(!t.hasOwnProperty(i))return;if(e[i]===null||e[i]===undefined){e[i]=t[i]}else if(typeof t[i]==="object"&&typeof e[i]==="object"){this.defaults(e[i],t[i])}}}));return e}static same(e,t){if(typeof e!=="object")return e==t;if(typeof e!==typeof t)return false;if(Object.keys(e).length!==Object.keys(t).length)return false;for(const i in e){if(e[i]!==t[i])return false}return true}static copyPos(e,t,i=false){e.x=t.x;e.y=t.y;e.w=t.w;e.h=t.h;if(!i)return e;if(t.minW)e.minW=t.minW;if(t.minH)e.minH=t.minH;if(t.maxW)e.maxW=t.maxW;if(t.maxH)e.maxH=t.maxH;return e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h}static removeInternalAndSame(e,t){if(typeof e!=="object"||typeof t!=="object")return;for(let i in e){let s=e[i];if(i[0]==="_"||s===t[i]){delete e[i]}else if(s&&typeof s==="object"&&t[i]!==undefined){for(let e in s){if(s[e]===t[i][e]||e[0]==="_"){delete s[e]}}if(!Object.keys(s).length){delete e[i]}}}}static closestByClass(e,t){while(e){if(e.classList.contains(t))return e;e=e.parentElement}return null}static throttle(e,t){let i=false;return(...s)=>{if(!i){i=true;setTimeout((()=>{e(...s);i=false}),t)}}}static removePositioningStyles(e){let t=e.style;if(t.position){t.removeProperty("position")}if(t.left){t.removeProperty("left")}if(t.top){t.removeProperty("top")}if(t.width){t.removeProperty("width")}if(t.height){t.removeProperty("height")}}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const t=getComputedStyle(e);const i=/(auto|scroll)/;if(i.test(t.overflow+t.overflowY)){return e}else{return this.getScrollElement(e.parentElement)}}static updateScrollPosition(e,t,i){let s=e.getBoundingClientRect();let r=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>r){let n=s.bottom-r;let o=s.top;let l=this.getScrollElement(e);if(l!==null){let a=l.scrollTop;if(s.top<0&&i<0){if(e.offsetHeight>r){l.scrollTop+=i}else{l.scrollTop+=Math.abs(o)>Math.abs(i)?i:o}}else if(i>0){if(e.offsetHeight>r){l.scrollTop+=i}else{l.scrollTop+=n>i?i:n}}t.top+=l.scrollTop-a}}}static updateScrollResize(e,t,i){const s=this.getScrollElement(t);const r=s.clientHeight;const n=s===this.getScrollElement()?0:s.getBoundingClientRect().top;const o=e.clientY-n;const l=o<i;const a=o>r-i;if(l){s.scrollBy({behavior:"smooth",top:o-i})}else if(a){s.scrollBy({behavior:"smooth",top:i-(r-o)})}}static clone(e){if(e===null||e===undefined||typeof e!=="object"){return e}if(e instanceof Array){return[...e]}return Object.assign({},e)}static cloneDeep(e){const t=o.clone(e);for(const i in t){if(t.hasOwnProperty(i)&&typeof t[i]==="object"&&i.substring(0,2)!=="__"&&!l.find((e=>e===i))){t[i]=o.cloneDeep(e[i])}}return t}}t.Utils=o;const l=["_isNested","el","grid","subGrid","engine"]},103:(e,t,i)=>{i.r(t)}};var t={};function i(s){var r=t[s];if(r!==undefined){return r.exports}var n=t[s]={exports:{}};e[s].call(n.exports,n,n.exports,i);return n.exports}(()=>{i.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;i.d(t,{a:t});return t}})();(()=>{i.d=(e,t)=>{for(var s in t){if(i.o(t,s)&&!i.o(e,s)){Object.defineProperty(e,s,{enumerable:true,get:t[s]})}}}})();(()=>{i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{i.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();var s={};i.r(s);var r=i(88);var n=i.n(r); /** * --------------------------------------------------------------------- * * GLPI - Gestionnaire Libre de Parc Informatique * * http://glpi-project.org * * @copyright 2015-2024 Teclib' and contributors. * @copyright 2003-2014 by the INDEPNET Development Team. * @licence https://www.gnu.org/licenses/gpl-3.0.html * * --------------------------------------------------------------------- * * LICENSE * * This file is part of GLPI. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * * --------------------------------------------------------------------- */window.GridStack=r.GridStack;i(93);i(103)})();