@openmfp/webcomponents 0.18.3 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mfp-wc-dashboard.js +1 -1
- package/mfp-webcomponents.js +1 -1
- package/package.json +1 -1
package/mfp-wc-dashboard.js
CHANGED
|
@@ -131,7 +131,7 @@ This component supports nesting a \`Link\` component inside.
|
|
|
131
131
|
design guidelines, please use the \`ui5-button\` component.
|
|
132
132
|
**Note:** When the slot is not present, a built-in delete button will be displayed.`,since:"1.9.0"}],this.elementRef=x(O1),this.injector=x(a0)}get element(){return this.elementRef.nativeElement}ngAfterViewInit(){let t=this.element,i=["text","additionalText","icon","disabled","loading","loadingDelay","accessibleName","tooltip","checked","accessibilityAttributes","type","navigated","highlight","selected"];for(let r of i){let n=r.replace(/-./g,s=>s[1].toUpperCase());this[n]&&typeof this[n]=="function"&&l5(this.injector,()=>{Z0(()=>{let s=this[n]();t&&(t[r]=s)})})}let o=["ui5BeforeOpen","ui5Open","ui5BeforeClose","ui5Close","ui5Check","ui5DetailClick"];for(let r of o){let n=r.replace("ui5","").replace(/([A-Z])/g,"-$1").toLowerCase().substring(1);this[r]&&typeof this[r].emit=="function"&&t.addEventListener&&t.addEventListener(n,s=>{this[r].emit(s)})}}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=X1({type:e,selectors:[["ui5-menu-item"],["","ui5-menu-item",""]],inputs:{text:[1,"text"],additionalText:[1,"additionalText"],icon:[1,"icon"],disabled:[1,"disabled"],loading:[1,"loading"],loadingDelay:[1,"loadingDelay"],accessibleName:[1,"accessibleName"],tooltip:[1,"tooltip"],checked:[1,"checked"],accessibilityAttributes:[1,"accessibilityAttributes"],type:[1,"type"],navigated:[1,"navigated"],highlight:[1,"highlight"],selected:[1,"selected"]},outputs:{ui5BeforeOpen:"ui5BeforeOpen",ui5Open:"ui5Open",ui5BeforeClose:"ui5BeforeClose",ui5Close:"ui5Close",ui5Check:"ui5Check",ui5DetailClick:"ui5DetailClick"},exportAs:["ui5MenuItem"],ngContentSelectors:QI,decls:1,vars:0,template:function(t,i){t&1&&(x0(),m0(0))},encapsulation:2,changeDetection:0})}}return e})(),ez=["*"],tz=(()=>{class e{constructor(){this.elementRef=x(O1),this.injector=x(a0)}get element(){return this.elementRef.nativeElement}ngAfterViewInit(){let t=this.element}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=X1({type:e,selectors:[["ui5-menu-separator"],["","ui5-menu-separator",""]],exportAs:["ui5MenuSeparator"],ngContentSelectors:ez,decls:1,vars:0,template:function(t,i){t&1&&(x0(),m0(0))},encapsulation:2,changeDetection:0})}}return e})(),az="action-settings",iz="M0 7c0-.292.094-.531.281-.719A.973.973 0 0 1 1 6h.813a2.68 2.68 0 0 1 .171-.484c.073-.157.151-.318.235-.485l-.594-.562a1.043 1.043 0 0 1-.281-.719c0-.27.093-.5.281-.688l1.438-1.437a.935.935 0 0 1 .687-.281c.292 0 .531.093.719.281l.562.594c.167-.084.328-.162.485-.235A2.68 2.68 0 0 1 6 1.813V1c0-.292.094-.531.281-.719A.973.973 0 0 1 7 0h2c.292 0 .531.094.719.281A.973.973 0 0 1 10 1v.813c.167.062.328.125.484.187.157.063.308.135.454.219l.593-.594a.974.974 0 0 1 .719-.281c.27 0 .5.093.688.281l1.437 1.438a.935.935 0 0 1 .281.687c0 .27-.094.51-.281.719l-.594.593c.167.271.292.584.375.938H15c.292 0 .531.094.719.281A.973.973 0 0 1 16 7v2a.973.973 0 0 1-.281.719A.974.974 0 0 1 15 10h-.844a3.68 3.68 0 0 1-.375.938l.594.593c.188.209.281.448.281.719 0 .27-.094.5-.281.688l-1.438 1.437a.935.935 0 0 1-.687.281.974.974 0 0 1-.719-.281l-.594-.594a3.62 3.62 0 0 1-.453.219 22.56 22.56 0 0 1-.484.188V15a.974.974 0 0 1-.281.719A.973.973 0 0 1 9 16H7a.973.973 0 0 1-.719-.281A.974.974 0 0 1 6 15v-.813a2.683 2.683 0 0 1-.484-.171 19.641 19.641 0 0 1-.485-.235l-.562.594a.973.973 0 0 1-.719.281.94.94 0 0 1-.688-.281l-1.437-1.438a.935.935 0 0 1-.281-.687c0-.27.093-.51.281-.719l.594-.562a20.151 20.151 0 0 1-.235-.485A2.68 2.68 0 0 1 1.813 10H1a.973.973 0 0 1-.719-.281A.973.973 0 0 1 0 9V7Zm1 0v2h1.531c.063.208.12.39.172.547.052.156.11.307.172.453.063.167.14.338.234.516.094.177.204.39.329.64L2.343 12.25l1.406 1.406 1.094-1.094c.354.209.708.386 1.062.532.354.146.719.27 1.094.375V15h2v-1.563c.208-.062.39-.12.547-.171.156-.053.307-.1.453-.141.167-.083.344-.167.531-.25a8.68 8.68 0 0 0 .625-.313l1.094 1.094 1.406-1.406-1.094-1.125c.188-.354.35-.703.485-1.047s.265-.703.39-1.078H15V7h-1.563a9.505 9.505 0 0 0-.874-2.125l1.093-1.125-1.406-1.406-1.094 1.094a7.478 7.478 0 0 0-1.047-.516A9.907 9.907 0 0 0 9 2.562V1H7v1.531l-.516.172c-.156.052-.317.11-.484.172l-.563.25a5.519 5.519 0 0 0-.593.313L3.75 2.343 2.344 3.75l1.094 1.094A12.821 12.821 0 0 0 2.53 7H1Zm4.219 0 .093-.281a3.48 3.48 0 0 1 .22-.375c.083-.125.176-.24.28-.344.209-.208.396-.37.563-.484A3.49 3.49 0 0 1 7 5.187a3.55 3.55 0 0 1 1-.156c.354 0 .688.063 1 .188l.281.093.375.25c.125.084.24.178.344.282a.559.559 0 0 1 .156.156c.271.25.469.583.594 1 .125.313.188.646.188 1s-.063.688-.188 1a2.41 2.41 0 0 1-.594 1 .56.56 0 0 1-.156.156 2.25 2.25 0 0 1-.344.281l-.375.25-.281.094a2.665 2.665 0 0 1-1 .188 3.55 3.55 0 0 1-1-.156 3.454 3.454 0 0 1-.625-.329A4.164 4.164 0 0 1 5.812 10a2.249 2.249 0 0 1-.28-.344 3.496 3.496 0 0 1-.22-.375L5.22 9a2.667 2.667 0 0 1-.188-1c0-.354.063-.688.188-1Zm.812 1c0 .354.089.682.266.984A1.9 1.9 0 0 0 7 9.688c.292.187.625.28 1 .28.125 0 .292-.02.5-.062a2.42 2.42 0 0 0 .656-.328c.188-.135.354-.328.5-.578.188-.292.281-.625.281-1 0-.396-.093-.73-.28-1a1.843 1.843 0 0 0-.5-.578 2.42 2.42 0 0 0-.657-.328A2.69 2.69 0 0 0 8 6.03c-.375 0-.708.094-1 .282a1.897 1.897 0 0 0-.703.703c-.177.302-.266.63-.266.984Z",oz=!1,rz=da,nz="0 0 16 16",sz="SAP-icons-v4",cz="@ui5/webcomponents-icons";k(az,{pathData:iz,ltr:oz,viewBox:nz,accData:rz,collection:sz,packageName:cz});var lz="action-settings",hz="M8.549 0a1.757 1.757 0 0 1 1.568 1.49l.121.805a.251.251 0 0 0 .123.18l1.238.715a.252.252 0 0 0 .217.017l.755-.298a1.75 1.75 0 0 1 2.156.754v.001l.387.673a1.75 1.75 0 0 1-.423 2.244l-.617.49a.251.251 0 0 0-.094.196v1.465c0 .076.035.148.094.196l.616.49c.677.54.858 1.495.425 2.245l-.387.673h-.001a1.75 1.75 0 0 1-2.155.755l-.757-.298a.251.251 0 0 0-.217.016l-1.238.715a.251.251 0 0 0-.122.18l-.12.806A1.75 1.75 0 0 1 8.387 16H7.61a1.75 1.75 0 0 1-1.698-1.333l-.16-1.013a.25.25 0 0 0-.122-.18l-1.184-.684a.251.251 0 0 0-.216-.016l-.803.317a1.75 1.75 0 0 1-2.156-.754l-.387-.675-.001.001a1.753 1.753 0 0 1 .425-2.244l.695-.555A.25.25 0 0 0 2.1 8.67V7.33a.25.25 0 0 0-.095-.195L1.31 6.58a1.753 1.753 0 0 1-.425-2.244l.388-.674a1.75 1.75 0 0 1 2.156-.754l.802.317c.07.027.15.02.216-.017l1.185-.685a.25.25 0 0 0 .122-.18l.16-1.011A1.75 1.75 0 0 1 7.611 0h.938Zm-.982 1.504a.25.25 0 0 0-.19.164l-.14.9a1.75 1.75 0 0 1-.855 1.255l-1.185.685a1.752 1.752 0 0 1-1.516.113l-.803-.315a.25.25 0 0 0-.307.107l-.388.673a.253.253 0 0 0 .06.321l.696.555c.416.332.66.835.66 1.368v1.34a1.75 1.75 0 0 1-.66 1.368l-.695.555a.251.251 0 0 0-.061.321l.387.674a.25.25 0 0 0 .308.107l.802-.315a1.752 1.752 0 0 1 1.517.112l1.185.685c.461.266.775.729.854 1.256l.14.9a.25.25 0 0 0 .235.168h.777a.25.25 0 0 0 .246-.213l.121-.806a1.75 1.75 0 0 1 .855-1.255l1.238-.716a1.751 1.751 0 0 1 1.516-.114l.757.298c.1.04.213.01.28-.07l.415-.71a.25.25 0 0 0-.06-.321l-.617-.492a1.751 1.751 0 0 1-.66-1.369V7.267c0-.533.244-1.037.66-1.369l.616-.49a.25.25 0 0 0 .06-.321l-.387-.675a.249.249 0 0 0-.307-.106l-.758.297a1.75 1.75 0 0 1-1.515-.114L9.61 3.773a1.75 1.75 0 0 1-.855-1.255l-.121-.805a.25.25 0 0 0-.201-.21h-.866ZM8 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 1.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",dz=!1,uz=da,_z="0 0 16 16",pz="SAP-icons-v5",vz="@ui5/webcomponents-icons";k(lz,{pathData:hz,ltr:dz,viewBox:_z,accData:uz,collection:pz,packageName:vz});var mz="menu2",fz="M1 4.01a.96.96 0 0 1-.703-.298A.969.969 0 0 1 0 3.005c0-.293.099-.534.297-.722A.985.985 0 0 1 1 2h14a.97.97 0 0 1 .719.283.981.981 0 0 1 .281.722.996.996 0 0 1-.281.707.944.944 0 0 1-.719.298H1Zm0 4.995c-.27 0-.505-.1-.703-.298A.969.969 0 0 1 0 8c0-.293.099-.534.297-.723A.985.985 0 0 1 1 6.995h14a.97.97 0 0 1 .719.282c.187.189.281.43.281.723a.996.996 0 0 1-.281.707.944.944 0 0 1-.719.298H1ZM1 14c-.27 0-.505-.1-.703-.298A.969.969 0 0 1 0 12.995c0-.293.099-.534.297-.723A.986.986 0 0 1 1 11.99h14c.292 0 .531.095.719.283.187.189.281.43.281.723a.996.996 0 0 1-.281.707A.945.945 0 0 1 15 14H1Z",gz=!1,bz="0 0 16 16",Az="SAP-icons-v4",wz="@ui5/webcomponents-icons";k(mz,{pathData:fz,ltr:gz,viewBox:bz,collection:Az,packageName:wz});var Zz="menu2",Cz="M15.25 12.5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1 0-1.5h14.5Zm0-5.5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1 0-1.5h14.5Zm0-5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1 0-1.5h14.5Z",yz=!1,xz="0 0 16 16",Mz="SAP-icons-v5",Hz="@ui5/webcomponents-icons";k(Zz,{pathData:Cz,ltr:yz,viewBox:xz,collection:Mz,packageName:Hz});var f=class N0{static getElements(a,t=document){if(typeof a=="string"){let i="getElementById"in t?t:void 0;if(i&&!isNaN(+a[0])){let r=i.getElementById(a);return r?[r]:[]}let o=t.querySelectorAll(a);if(!o.length&&a[0]!=="."&&a[0]!=="#"&&(o=t.querySelectorAll("."+a),o.length||(o=t.querySelectorAll("#"+a)),!o.length)){let r=t.querySelector(`[gs-id="${a}"]`);return r?[r]:[]}return Array.from(o)}return[a]}static getElement(a,t=document){if(typeof a=="string"){let i="getElementById"in t?t:void 0;if(!a.length)return null;if(i&&a[0]==="#")return i.getElementById(a.substring(1));if(a[0]==="#"||a[0]==="."||a[0]==="[")return t.querySelector(a);if(i&&!isNaN(+a[0]))return i.getElementById(a);let o=t.querySelector(a);return i&&!o&&(o=i.getElementById(a)),o||(o=t.querySelector("."+a)),o}return a}static lazyLoad(a){return!!(a.lazyLoad||a.grid?.opts?.lazyLoad&&a.lazyLoad!==!1)}static createDiv(a,t){let i=document.createElement("div");return a.forEach(o=>{o&&i.classList.add(o)}),t?.appendChild(i),i}static shouldSizeToContent(a,t=!1){return!!(a?.grid&&(t?a.sizeToContent===!0||a.grid.opts.sizeToContent===!0&&a.sizeToContent===void 0:a.sizeToContent||a.grid.opts.sizeToContent&&a.sizeToContent!==!1))}static isIntercepted(a,t){return!(a.y>=t.y+t.h||a.y+a.h<=t.y||a.x+a.w<=t.x||a.x>=t.x+t.w)}static isTouching(a,t){return N0.isIntercepted(a,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(a,t){let i=a.x>t.x?a.x:t.x,o=a.x+a.w<t.x+t.w?a.x+a.w:t.x+t.w;if(o<=i)return 0;let r=a.y>t.y?a.y:t.y,n=a.y+a.h<t.y+t.h?a.y+a.h:t.y+t.h;return n<=r?0:(o-i)*(n-r)}static area(a){return a.w*a.h}static sort(a,t=1){let i=Number.MAX_SAFE_INTEGER;return a.sort((o,r)=>{let n=t*((o.y??i)-(r.y??i));return n===0?t*((o.x??i)-(r.x??i)):n})}static find(a,t){return t?a.find(i=>i.id===t):void 0}static findInGrid(a,t,i){let o=a.engine.nodes.find(r=>String(r.id)===t);if(o||!i)return o;for(let r of a.engine.nodes)if(r.subGrid){let n=N0.findInGrid(r.subGrid,t);if(n)return n}}static toBool(a){return typeof a=="boolean"?a:typeof a=="string"?(a=a.toLowerCase(),!(a===""||a==="no"||a==="false"||a==="0")):!!a}static toNumber(a){return a===null||a.length===0?void 0:Number(a)}static parseHeight(a){let t,i="px";if(typeof a=="string")if(a==="auto"||a==="")t=0;else{let o=a.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!o)throw new Error(`Invalid height val = ${a}`);i=o[2]||"px",t=parseFloat(o[1])}else t=a;return{h:t,unit:i}}static defaults(a,...t){return t.forEach(i=>{for(let o in i){if(!Object.prototype.hasOwnProperty.call(i,o))return;a[o]===null||a[o]===void 0?a[o]=i[o]:typeof i[o]=="object"&&typeof a[o]=="object"&&N0.defaults(a[o],i[o])}}),a}static same(a,t){if(typeof a!="object")return a==t;if(typeof a!=typeof t)return!1;let i=a,o=t;if(Object.keys(i).length!==Object.keys(o).length)return!1;for(let r in i)if(i[r]!==o[r])return!1;return!0}static copyPos(a,t,i=!1){return t.x!==void 0&&(a.x=t.x),t.y!==void 0&&(a.y=t.y),t.w!==void 0&&(a.w=t.w),t.h!==void 0&&(a.h=t.h),i&&(t.minW&&(a.minW=t.minW),t.minH&&(a.minH=t.minH),t.maxW&&(a.maxW=t.maxW),t.maxH&&(a.maxH=t.maxH)),a}static samePos(a,t){return a&&t&&a.x===t.x&&a.y===t.y&&(a.w||1)===(t.w||1)&&(a.h||1)===(t.h||1)}static sanitizeMinMax(a){a.minW||delete a.minW,a.minH||delete a.minH,a.maxW||delete a.maxW,a.maxH||delete a.maxH}static removeInternalAndSame(a,t){if(typeof a!="object"||typeof t!="object"||!a||!t||Array.isArray(a)||Array.isArray(t))return;let i=a,o=t;for(let r in i){let n=i[r],s=o[r];r[0]==="_"||n===s?delete i[r]:n&&typeof n=="object"&&s!==void 0&&(N0.removeInternalAndSame(n,s),Object.keys(n).length||delete i[r])}}static removeInternalForSave(a,t=!0){let i=a;for(let o in i)(o[0]==="_"||i[o]===null||i[o]===void 0)&&delete i[o];delete a.grid,t&&delete a.el,a.autoPosition||delete a.autoPosition,a.noResize||delete a.noResize,a.noMove||delete a.noMove,a.locked||delete a.locked,(a.w===1||a.w===a.minW)&&delete a.w,(a.h===1||a.h===a.minH)&&delete a.h}static throttle(a,t){let i=!1;return(...o)=>{i||(i=!0,setTimeout(()=>{a(...o),i=!1},t))}}static removePositioningStyles(a){let t=a.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(a){if(!a)return document.scrollingElement||document.documentElement;let t=getComputedStyle(a).overflowY;return(t==="auto"||t==="scroll")&&a.scrollHeight>a.clientHeight?a:N0.getScrollElement(a.parentElement??void 0)}static updateScrollResize(a,t,i){let o=N0.getScrollElement(t),r=o.clientHeight,n=o===N0.getScrollElement()?0:o.getBoundingClientRect().top,s=a.clientY-n,c=s<i,l=s>r-i;c?o.scrollBy({behavior:"smooth",top:s-i}):l&&o.scrollBy({behavior:"smooth",top:i-(r-s)})}static clone(a){return a==null||typeof a!="object"?a:a instanceof Array?[...a]:Z({},a)}static cloneDeep(a){let t=["parentGrid","el","grid","subGrid","engine"],i=N0.clone(a);for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&typeof i[o]=="object"&&o.substring(0,2)!=="__"&&!t.find(r=>r===o)&&(i[o]=N0.cloneDeep(a[o]));return i}static cloneNode(a){let t=a.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(a,t){let i;typeof t=="string"?i=N0.getElement(t):i=t,i&&i.appendChild(a)}static addElStyles(a,t){if(t instanceof Object){let i=a.style;for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(Array.isArray(t[o])?t[o].forEach(r=>{i[o]=r}):i[o]=t[o])}}static initEvent(a,t){let i={type:t.type},o={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:a.target},r=a;return["altKey","ctrlKey","metaKey","shiftKey"].forEach(n=>i[n]=r[n]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(n=>i[n]=r[n]),Z(Z({},i),o)}static simulateMouseEvent(a,t,i){let o=a,r=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY,ctrlKey:o.ctrlKey??!1,altKey:o.altKey??!1,shiftKey:o.shiftKey??!1,metaKey:o.metaKey??!1,button:0,relatedTarget:a.target});(i||a.target).dispatchEvent(r)}static getValuesFromTransformedElement(a){let t=document.createElement("div");N0.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),a.appendChild(t);let i=t.getBoundingClientRect();return a.removeChild(t),t.remove(),{xScale:1/i.width,yScale:1/i.height,xOffset:i.left,yOffset:i.top}}static swap(a,t,i){if(!a)return;let o=a,r=o[t];o[t]=o[i],o[i]=r}static canBeRotated(a){return!(!a||a.w===a.h||a.locked||a.noResize||a.grid?.opts.disableResize||a.minW&&a.minW===a.maxW||a.minH&&a.minH===a.maxH)}},bl=(()=>{class e{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=t.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=t.maxRow??0,this._float=t.float??!1,this.nodes=t.nodes||[],this.onChange=t.onChange??(()=>{})}batchUpdate(t=!0,i=!0){return!!this.batchMode===t?this:(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.nodes.some(o=>o._updating)||this.saveInitial()):(this._float=this._prevFloat??!1,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(t,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!t._moving||t._skipDown||i.y<=t.y)}_fixCollisions(t,i=t,o,r={}){if(this.sortNodes(-1),o=o||this.collide(t,i),!o)return!1;if(t._moving&&!t._isExternal&&!r.nested&&!this.float&&this.swap(t,o))return!0;let n=i;!this._loading&&this._useEntireRowArea(t,i)&&(n={x:0,w:this.column,y:i.y,h:i.h},o=this.collide(t,n,r.skip));let s=!1,c={nested:!0,pack:!1},l=0;for(;o=o||this.collide(t,n,r.skip);){if(l++>this.nodes.length*2)throw new Error("Infinite collide check");let d;if(o.locked||this._loading||t._moving&&!t._skipDown&&i.y>t.y&&!this.float&&(!this.collide(o,F(Z({},o),{y:t.y}),t)||!this.collide(o,F(Z({},o),{y:i.y-o.h}),t))){t._skipDown=t._skipDown||i.y>t.y;let h=Z(F(Z({},i),{y:o.y+o.h}),c);d=this._loading&&f.samePos(t,h)?!0:this.moveNode(t,h),(o.locked||this._loading)&&d?f.copyPos(i,t):!o.locked&&d&&r.pack&&(this._packNodes(),i.y=o.y+o.h,f.copyPos(t,i)),s=s||d}else d=this.moveNode(o,Z(F(Z({},o),{y:i.y+i.h,skip:t}),c));if(!d)return s;o=void 0}return s}collide(t,i=t,o){let r=t._id,n=o?._id;return this.nodes.find(s=>s._id!==r&&s._id!==n&&f.isIntercepted(s,i))}collideAll(t,i=t,o){let r=t._id,n=o?._id;return this.nodes.filter(s=>s._id!==r&&s._id!==n&&f.isIntercepted(s,i))}directionCollideCoverage(t,i,o){if(!i.rect||!t._rect)return;let r=t._rect,n=Z({},i.rect);n.y>r.y?(n.h=n.h+n.y-r.y,n.y=r.y):n.h=n.h+r.y-n.y,n.x>r.x?(n.w=n.w+n.x-r.x,n.x=r.x):n.w=n.w+r.x-n.x;let s,c=.5;for(let l of o){if(l.locked||!l._rect)continue;let d=l._rect,h=Number.MAX_VALUE,_=Number.MAX_VALUE;r.y<d.y?h=(n.y+n.h-d.y)/d.h:r.y+r.h>d.y+d.h&&(h=(d.y+d.h-n.y)/d.h),r.x<d.x?_=(n.x+n.w-d.x)/d.w:r.x+r.w>d.x+d.w&&(_=(d.x+d.w-n.x)/d.w);let u=Math.min(_,h);u>c&&(c=u,s=l)}return i.collide=s,s}cacheRects(t,i,o,r,n,s){return this.nodes.forEach(c=>c._rect={y:c.y*i+o,x:c.x*t+s,w:c.w*t-s-r,h:c.h*i-o-n}),this}swap(t,i){if(!i||i.locked||!t||t.locked)return!1;function o(){let n=i.x,s=i.y;return i.x=t.x,i.y=t.y,t.h!=i.h?(t.x=n,t.y=i.y+i.h):t.w!=i.w?(t.x=i.x+i.w,t.y=s):(t.x=n,t.y=s),t._dirty=i._dirty=!0,!0}let r;if(t.w===i.w&&t.h===i.h&&(t.x===i.x||t.y===i.y)&&(r=f.isTouching(t,i)))return o();if(r!==!1){if(t.w===i.w&&t.x===i.x&&(r||(r=f.isTouching(t,i)))){if(i.y<t.y){let n=t;t=i,i=n}return o()}if(r!==!1){if(t.h===i.h&&t.y===i.y&&(r||(r=f.isTouching(t,i)))){if(i.x<t.x){let n=t;t=i,i=n}return o()}return!1}}}isAreaEmpty(t,i,o,r){let n={x:t||0,y:i||0,w:o||1,h:r||1};return!this.collide(n)}compact(t="compact",i=!0){if(this.nodes.length===0)return this;i&&this.sortNodes();let o=this.batchMode;o||this.batchUpdate();let r=this._inColumnResize;r||(this._inColumnResize=!0);let n=this.nodes;return this.nodes=[],n.forEach((s,c,l)=>{let d;s.locked||(s.autoPosition=!0,t==="list"&&c&&(d=l[c-1])),this.addNode(s,!1,d)}),r||delete this._inColumnResize,o||this.batchUpdate(!1),this}set float(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(t=1){return this.nodes=f.sort(this.nodes,t),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(t=>{if(t._updating||t._orig===void 0||t.y===t._orig.y)return;let i=t.y;for(;i>t._orig.y;)--i,this.collide(t,{x:t.x,y:i,w:t.w,h:t.h})||(t._dirty=!0,t.y=i)}):this.nodes.forEach((t,i)=>{if(!t.locked)for(;t.y>0;){let o=i===0?0:t.y-1;if(!(i===0||!this.collide(t,{x:t.x,y:o,w:t.w,h:t.h})))break;t._dirty=t.y!==o,t.y=o}}),this)}prepareNode(t,i){t._id=t._id??e._idSeq++;let o=t.id;if(o){let n=1;for(;this.nodes.find(s=>s.id===t.id&&s!==t);)t.id=o+"_"+n++}(t.x===void 0||t.y===void 0||t.x===null||t.y===null)&&(t.autoPosition=!0);let r={x:0,y:0,w:1,h:1};return f.defaults(t,r),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,f.sanitizeMinMax(t),typeof t.x=="string"&&(t.x=Number(t.x)),typeof t.y=="string"&&(t.y=Number(t.y)),typeof t.w=="string"&&(t.w=Number(t.w)),typeof t.h=="string"&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=r.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=r.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=r.w),isNaN(t.h)&&(t.h=r.h),this.nodeBoundFix(t,i),t}nodeBoundFix(t,i){let o=t._orig||f.copyPos({},t);if(t.maxW&&(t.w=Math.min(t.w||1,t.maxW)),t.maxH&&(t.h=Math.min(t.h||1,t.maxH)),t.minW&&(t.w=Math.max(t.w||1,t.minW)),t.minH&&(t.h=Math.max(t.h||1,t.minH)),(t.x||0)+(t.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&t._id!=null&&this.findCacheLayout(t,this.defaultColumn)===-1){let r=Z({},t);r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(this.defaultColumn-1,r.x),r.w=Math.min(this.defaultColumn,r.w||1),this.cacheOneLayout(r,this.defaultColumn)}return 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&&(i?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(i?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),f.samePos(t,o)||(t._dirty=!0),this}getDirtyNodes(t){return t?this.nodes.filter(i=>i._dirty&&i._orig&&!f.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(t){if(this.batchMode||!this.onChange)return this;let i=(t||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(t=>{delete t._dirty,delete t._lastTried}),this)}saveInitial(){return this.nodes.forEach(t=>{t._orig=f.copyPos({},t),delete t._dirty}),this._hasLocked=this.nodes.some(t=>t.locked),this}restoreInitial(){return this.nodes.forEach(t=>{!t._orig||f.samePos(t,t._orig)||(f.copyPos(t,t._orig),t._dirty=!0)}),this._notify(),this}findEmptyPosition(t,i=this.nodes,o=this.column,r){let n=r?r.y*o+(r.x+r.w):0,s=!1;for(let c=n;!s;++c){let l=c%o,d=Math.floor(c/o);if(l+t.w>o)continue;let h={x:l,y:d,w:t.w,h:t.h};i.find(_=>f.isIntercepted(h,_))||((t.x!==l||t.y!==d)&&(t._dirty=!0),t.x=l,t.y=d,delete t.autoPosition,s=!0)}return s}addNode(t,i=!1,o){let r=this.nodes.find(s=>s._id===t._id);if(r)return r;this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t),delete t._temporaryRemoved,delete t._removeDOM;let n=!1;return t.autoPosition&&this.findEmptyPosition(t,this.nodes,this.column,o)&&(delete t.autoPosition,n=!0),this.nodes.push(t),i&&this.addedNodes.push(t),n||this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t}removeNode(t,i=!0,o=!1){return this.nodes.find(r=>r._id===t._id)?(o&&this.removedNodes.push(t),i&&(t._removeDOM=!0),this.nodes=this.nodes.filter(r=>r._id!==t._id),t._isAboutToRemove||this._packNodes(),this._notify([t]),this):this}removeAll(t=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;t&&this.nodes.forEach(r=>r._removeDOM=!0);let o=this.nodes;return this.removedNodes=i?o:[],this.nodes=[],this._notify(o)}moveNodeCheck(t,i){if(!this.changedPosConstrain(t,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(t,i);let o,r=new e({column:this.column,float:this.float,nodes:this.nodes.map(s=>s._id===t._id?(o=Z({},s),o):Z({},s))});if(!o)return!1;let n=r.moveNode(o,i)&&r.getRow()<=Math.max(this.getRow(),this.maxRow);if(!n&&!i.resizing&&i.collide&&!t._isExternal){let s=i.collide.el?.gridstackNode;if(s&&this.swap(t,s))return this._notify(),!0}return n?(r.nodes.filter(s=>s._dirty).forEach(s=>{let c=this.nodes.find(l=>l._id===s._id);c&&(f.copyPos(c,s),c._dirty=!0)}),this._notify(),!0):!1}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;let i=new e({column:this.column,float:this.float,nodes:this.nodes.map(r=>Z({},r))}),o=Z({},t);return this.cleanupNode(o),delete o.el,delete o._id,delete o.content,delete o.grid,i.addNode(o),i.getRow()<=this.maxRow?(t._willFitPos=f.copyPos({},o),!0):!1}changedPosConstrain(t,i){return i.w=i.w||t.w,i.h=i.h||t.h,t.x!==i.x||t.y!==i.y?!0:(t.maxW&&(i.w=Math.min(i.w,t.maxW)),t.maxH&&(i.h=Math.min(i.h,t.maxH)),t.minW&&(i.w=Math.max(i.w,t.minW)),t.minH&&(i.h=Math.max(i.h,t.minH)),t.w!==i.w||t.h!==i.h)}moveNode(t,i){if(!t||!i)return!1;let o=!1;i.pack===void 0&&!this.batchMode&&(o=i.pack=!0),typeof i.x!="number"&&(i.x=t.x),typeof i.y!="number"&&(i.y=t.y),typeof i.w!="number"&&(i.w=t.w),typeof i.h!="number"&&(i.h=t.h);let r=t.w!==i.w||t.h!==i.h,n=f.copyPos({},t,!0);if(f.copyPos(n,i),this.nodeBoundFix(n,r),f.copyPos(i,n),!i.forceCollide&&f.samePos(t,i))return!1;let s=f.copyPos({},t),c=this.collideAll(t,n,i.skip),l=!0;if(c.length){let d=t._moving&&!i.nested,h=d?this.directionCollideCoverage(t,i,c):c[0];if(d&&h&&t.grid?.opts?.subGridDynamic&&!t.grid._isTemp){let _=f.areaIntercept(i.rect,h._rect),u=f.area(i.rect),m=f.area(h._rect);_/(u<m?u:m)>.8&&(h.grid.makeSubGrid(h.el,void 0,t),h=void 0)}h?l=!this._fixCollisions(t,n,h,i):(l=!1,o&&delete i.pack)}return l&&!f.samePos(t,n)&&(t._dirty=!0,f.copyPos(t,n)),i.pack&&this._packNodes()._notify(),!f.samePos(t,s)}getRow(){return this.nodes.reduce((t,i)=>Math.max(t,i.y+i.h),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let t=this.nodes.find(i=>i._updating);return t&&(delete t._updating,delete t._skipDown),this}save(t=!0,i,o){let r=this._layouts?.length||0,n;r&&(o?o!==this.column&&(n=this._layouts[o]):this.column!==r-1&&(n=this._layouts[r-1]));let s=[];return this.sortNodes(),this.nodes.forEach(c=>{let l=n?.find(h=>h._id===c._id),d=Z(Z({},c),l||{});f.removeInternalForSave(d,!t),i&&i(c,d),s.push(d)}),s}layoutsNodesChange(t){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,o)=>{if(!(!i||o===this.column))if(o<this.column)this._layouts[o]=void 0;else{let r=o/this.column;t.forEach(n=>{if(!n._orig)return;let s=i.find(c=>c._id===n._id);s&&(s.y>=0&&n.y!==n._orig.y&&(s.y=s.y+(n.y-n._orig.y),s.y<0&&(s.y=0)),n.x!==n._orig.x&&(s.x=Math.round(n.x*r),s.x<0&&(s.x=0)),n.w!==n._orig.w&&(s.w=Math.round(n.w*r),s.w<1&&(s.w=1)))})}}),this)}columnChanged(t,i,o="moveScale"){if(!this.nodes.length||!i||t===i)return this;let r=o==="compact"||o==="list";r&&this.sortNodes(1),i<t&&this.cacheLayout(this.nodes,t),this.batchUpdate();let n=[],s=r?this.nodes:f.sort(this.nodes,-1);if(i>t&&this._layouts){let c=this._layouts[i]||[],l=this._layouts.length-1;!c.length&&t!==l&&this._layouts[l]?.length&&(t=l,this._layouts[l].forEach(d=>{let h=s.find(_=>_._id===d._id);h&&(!r&&!d.autoPosition&&(h.x=d.x??h.x,h.y=d.y??h.y),h.w=d.w??h.w,(d.x==null||d.y===void 0)&&(h.autoPosition=!0))})),c.forEach(d=>{let h=s.findIndex(_=>_._id===d._id);if(h!==-1){let _=s[h];if(r){_.w=d.w;return}(d.autoPosition||isNaN(d.x)||isNaN(d.y))&&this.findEmptyPosition(d,n),d.autoPosition||(_.x=d.x??_.x,_.y=d.y??_.y,_.w=d.w??_.w,n.push(_)),s.splice(h,1)}})}if(r)this.compact(o,!1);else{if(s.length)if(typeof o=="function")o(i,t,n,s);else{let c=r||o==="none"?1:i/t,l=o==="move"||o==="moveScale",d=o==="scale"||o==="moveScale";s.forEach(h=>{h.x=i===1?0:l?Math.round(h.x*c):Math.min(h.x,i-1),h.w=i===1||t===1?1:d?Math.round(h.w*c)||1:Math.min(h.w,i),n.push(h)}),s=[]}n=f.sort(n,-1),this._inColumnResize=!0,this.nodes=[],n.forEach(c=>{this.addNode(c,!1),delete c._orig})}return this.nodes.forEach(c=>delete c._orig),this.batchUpdate(!1,!r),delete this._inColumnResize,this}cacheLayout(t,i,o=!1){let r=[];return t.forEach((n,s)=>{if(n._id===void 0){let c=n.id?this.nodes.find(l=>l.id===n.id):void 0;n._id=c?._id??e._idSeq++}r[s]={x:n.x,y:n.y,w:n.w,_id:n._id}}),this._layouts=o?[]:this._layouts||[],this._layouts[i]=r,this}cacheOneLayout(t,i){t._id=t._id??e._idSeq++;let o={x:t.x,y:t.y,w:t.w,_id:t._id};(t.autoPosition||t.x===void 0)&&(delete o.x,delete o.y,t.autoPosition&&(o.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];let r=this.findCacheLayout(t,i);return r===-1?this._layouts[i].push(o):this._layouts[i][r]=o,this}findCacheLayout(t,i){return this._layouts?.[i]?.findIndex(o=>o._id===t._id)??-1}removeNodeFromLayoutCache(t){if(this._layouts)for(let i=0;i<this._layouts.length;i++){let o=this.findCacheLayout(t,i);o!==-1&&this._layouts[i].splice(o,1)}}cleanupNode(t){let i=t;for(let o in i)o[0]==="_"&&o!=="_id"&&delete i[o];return this}}return e._idSeq=0,e})(),V0={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"},H=class{},n5=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0&&window.matchMedia("(any-pointer: coarse)").matches||navigator.msMaxTouchPoints>0),S0=class{};function l4(e,a){e.touches.length>1||(e.cancelable&&e.preventDefault(),f.simulateMouseEvent(e.changedTouches[0],a))}function x_(e,a){e.cancelable&&e.preventDefault(),f.simulateMouseEvent(e,a)}function h4(e){S0.touchHandled||(S0.touchHandled=!0,l4(e,"mousedown"))}function d4(e){S0.touchHandled&&l4(e,"mousemove")}function u4(e){if(!S0.touchHandled)return;S0.pointerLeaveTimeout&&(window.clearTimeout(S0.pointerLeaveTimeout),delete S0.pointerLeaveTimeout);let a=!!H.dragElement;l4(e,"mouseup"),a||l4(e,"click"),S0.touchHandled=!1}function _4(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function Al(e){H.dragElement&&e.pointerType!=="mouse"&&x_(e,"mouseenter")}function wl(e){H.dragElement&&e.pointerType!=="mouse"&&(S0.pointerLeaveTimeout=window.setTimeout(()=>{delete S0.pointerLeaveTimeout,x_(e,"mouseleave")},10))}var Bz=(()=>{class e{constructor(t,i,o){this.host=t,this.dir=i,this.option=o,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(t){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",t)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${e.prefix}${this.dir}`),this.el.addEventListener("mousedown",this._mouseDown),n5&&(this.el.addEventListener("touchstart",h4),this.el.addEventListener("pointerdown",_4)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),n5&&(this.el.removeEventListener("touchstart",h4),this.el.removeEventListener("pointerdown",_4)),this.option.element||this.host.removeChild(this.el),this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),n5&&(this.el.addEventListener("touchmove",d4),this.el.addEventListener("touchend",u4)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){let i=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-i.x)+Math.abs(t.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",t),document.addEventListener("keydown",this._keyEvent)),t.stopPropagation()}_mouseUp(t){this.moving&&(this._triggerEvent("stop",t),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),n5&&(this.el.removeEventListener("touchmove",d4),this.el.removeEventListener("touchend",u4)),delete this.moving,delete this.mouseDownEvent,t.stopPropagation(),t.preventDefault()}_keyEvent(t){t.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(t,i){let o=this.option;return o[t]&&o[t](i),this}}return e.prefix="ui-resizable-",e})(),Y9=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,a){this._eventRegister[e]=a}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){this._eventRegister={}}triggerEvent(e,a){if(!this.disabled&&this._eventRegister[e])return this._eventRegister[e](a)}},kz=(()=>{class e extends Y9{constructor(t,i={}){super(),this.el=t,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{let o=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},n=this.temporalRect||r;return{position:{left:this.option.rtl?(o.right-n.right)*this.rectScale.x:(n.left-o.left)*this.rectScale.x,top:(n.top-o.top)*this.rectScale.y},size:{width:n.width*this.rectScale.x,height:n.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(!!this.option.autoHide),this._setupHandlers()}on(t,i){super.on(t,i)}off(t){super.off(t)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(!!this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(t){let i=t.handles&&t.handles!==this.option.handles,o=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.assign(this.option,t),i&&(this._removeHandlers(),this._setupHandlers()),o&&this._setupAutoHide(!!this.option.autoHide),this}_setupAutoHide(t){return t?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),H.overResizeElement===this&&delete H.overResizeElement),this}_mouseOver(t){H.overResizeElement||H.dragElement||(H.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){H.overResizeElement===this&&(delete H.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=(this.option.handles??"se").split(",").map(t=>t.trim()).map(t=>new Bz(this.el,t,{element:this.option.element,start:i=>this._resizeStart(i),stop:i=>this._resizeStop(i),move:i=>this._resizing(i,t)})),this}_resizeStart(t){this.sizeToContent=f.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=f.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();let i=f.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(t,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,i),this._applyChange();let o=f.initEvent(t,{type:"resize",target:this.el});return o.resizeDir=i,o.hasMovedX=this.option.rtl?i.includes("e"):i.includes("w"),o.hasMovedY=i.includes("n"),this.option.resize&&this.option.resize(o,this._ui()),this.triggerEvent("resize",o),this}_resizeStop(t){let i=f.initEvent(t,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=e._originStyleProp.map(o=>this.el.style[o]);let t=this.el.parentElement;this.parentOriginStylePosition=t.style.position;let i=f.getValuesFromTransformedElement(t);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(t).position.match(/static/)&&(t.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return e._originStyleProp.forEach((t,i)=>{this.el.style[t]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,i){let o=this.startEvent,r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},n=t.clientX-o.clientX,s=this.sizeToContent?0:t.clientY-o.clientY,c=!1,l=!1,d=this.option.rtl;!d&&i.indexOf("e")>-1?r.width+=n:d&&i.indexOf("w")>-1?r.width-=n:!d&&i.indexOf("w")>-1?(r.width-=n,r.left+=n,c=!0):d&&i.indexOf("e")>-1&&(r.width+=n,r.right+=n,c=!0),i.indexOf("s")>-1?r.height+=s:i.indexOf("n")>-1&&(r.height-=s,r.top+=s,l=!0);let h=this._constrainSize(r.width,r.height,c,l);return Math.round(r.width)!==Math.round(h.width)&&(!d&&i.indexOf("w")>-1?r.left+=r.width-h.width:d&&i.indexOf("e")>-1&&(r.right-=r.width-h.width),r.width=h.width),Math.round(r.height)!==Math.round(h.height)&&(i.indexOf("n")>-1&&(r.top+=r.height-h.height),r.height=h.height),r}_constrainSize(t,i,o,r){let n=this.option,s=(o?n.maxWidthMoveLeft:n.maxWidth)||Number.MAX_SAFE_INTEGER,c=(n.minWidth??0)/this.rectScale.x||t,l=(r?n.maxHeightMoveUp:n.maxHeight)||Number.MAX_SAFE_INTEGER,d=(n.minHeight??0)/this.rectScale.y||i,h=Math.min(s,Math.max(c,t)),_=Math.min(l,Math.max(d,i));return{width:h,height:_}}_applyChange(){let t={left:0,right:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let o=this.el.parentElement,{left:r,right:n,top:s}=o.getBoundingClientRect();t={left:r,right:n,top:s,width:0,height:0}}if(!this.temporalRect)return this;let i=t;return Object.entries(this.temporalRect).forEach(([o,r])=>{if(this.option.rtl?o==="left":o==="right")return;let n=o==="width"||o==="left"||o==="right"?this.rectScale.x:o==="height"||o==="top"?this.rectScale.y:1,s;o==="right"?s=(t.right-r)*this.rectScale.x+"px":s=(r-i[o])*n+"px",this.el.style[o]=s}),this}_removeHandlers(){return this.handlers.forEach(t=>t.destroy()),delete this.handlers,this}}return e._originStyleProp=["width","height","position","left","right","top","opacity","zIndex"],e})(),Lz='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Vz=(()=>{class e extends Y9{constructor(t,i={}){super(),this.el=t,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},this._autoScrollTick=()=>{let n=this.helper,s=this._autoScrollContainer;if(!n||!s){this._stopScrolling();return}let c=this._getClipping(n,s);if(c===0){this._stopScrolling();return}if(!this._autoScrollMaxSpeed){let u=window.innerHeight||document.documentElement.clientHeight;this._autoScrollMaxSpeed=Math.max(u/150,4)}let l=Math.abs(c),d=Math.min(l*.5,this._autoScrollMaxSpeed),h=c>0?d:-d,_=s.scrollTop;if(s.scrollTop+=h,s.scrollTop===_){this._stopScrolling();return}this.dragging&&this.lastDrag&&(this._dragFollow(this.lastDrag),this._callDrag(this.lastDrag)),this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick)};let o=i?.handle?.substring(1),r=t.gridstackNode;this.dragEls=!o||t.classList.contains(o)?[t]:r?.subGrid?[t.querySelector(i.handle)||t]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[t]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}getAllHandles(){return Array.from(this.el.querySelectorAll(this.option.handle)).filter(t=>{if(!(t instanceof HTMLElement))return!1;let i=t.closest(".grid-stack-item");return i===this.el||!i})}on(t,i){super.on(t,i)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(t=>{t.addEventListener("mousedown",this._mouseDown),n5&&(t.addEventListener("touchstart",h4),t.addEventListener("pointerdown",_4))}),this.el.classList.remove("ui-draggable-disabled"))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),n5&&(i.removeEventListener("touchstart",h4),i.removeEventListener("pointerdown",_4))}),t||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.option,super.destroy()}updateOption(t){return Object.assign(this.option,t),this}refreshHandles(){let t=this.disabled;t||this.disable(!0);let i=this.option?.handle?.substring(1),o=this.el.gridstackNode;this.dragEls=!i||this.el.classList.contains(i)?[this.el]:o?.subGrid?[this.el.querySelector(this.option.handle)||this.el]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[this.el]),t||this.enable()}_mouseDown(t){return t.isTrusted&&(S0.touchHandled&&(S0.touchHandled=!1),H.mouseHandled&&t.timeStamp!==H.mouseHandledTimeStamp&&delete H.mouseHandled),H.mouseHandled||t.button!==0||!this.dragEls.find(i=>i===t.target)&&t.target.closest(Lz)||this.option.cancel&&t.target.closest(this.option.cancel)||(this.mouseDownEvent=t,delete this.dragging,delete H.dragElement,delete H.dropElement,delete this._autoScrollMaxSpeed,delete this._autoScrollContainer,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),n5&&t.currentTarget&&(t.currentTarget.addEventListener("touchmove",d4),t.currentTarget.addEventListener("touchend",u4)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),H.mouseHandled=!0,H.mouseHandledTimeStamp=t.timeStamp),!0}_callDrag(t){if(!this.dragging)return;let i=f.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(t){let i=this.mouseDownEvent;if(this.lastDrag=t,this.dragging)if(this._dragFollow(t),H.pauseDrag){let o=Number.isInteger(H.pauseDrag)?H.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(t),o)}else this._callDrag(t);else if(Math.abs(t.x-i.x)+Math.abs(t.y-i.y)>3){this.dragging=!0,H.dragElement=this;let o=this.el.gridstackNode?.grid;o?H.dropElement=o.el.ddElement?.ddDroppable:delete H.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=f.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment),this._setupHelperStyle(t);let r=f.initEvent(t,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(r,this.ui()),this.triggerEvent("dragstart",r),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(t){if(this._stopScrolling(),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),n5&&t.currentTarget&&(t.currentTarget.removeEventListener("touchmove",d4,!0),t.currentTarget.removeEventListener("touchend",u4,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),H.dropElement?.el===this.el.parentElement&&delete H.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper&&this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let i=f.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),H.dropElement&&H.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete H.dragElement,delete H.dropElement,delete H.mouseHandled,delete H.mouseHandledTimeStamp,t.preventDefault()}_keyEvent(t){let i=this.el.gridstackNode,o=i?.grid||H.dropElement?.el?.gridstack;if(t.key==="Escape")i&&i._origRotate&&(i._orig=i._origRotate,delete i._origRotate),o?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(i&&o&&(t.key==="r"||t.key==="R")){if(!f.canBeRotated(i))return;i._origRotate=i._origRotate||Z({},i._orig),delete i._moving,o.setAnimation(!1).rotate(i.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetX}).setAnimation(),i._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,i.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",f.swap(i._orig,"w","h"),delete i._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let t=this.el;return typeof this.option.helper=="function"?t=this.option.helper(this.el):this.option.helper==="clone"&&(t=f.cloneNode(this.el)),t.parentElement||f.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo??"body"),this.dragElementOriginStyle=e.originStyleProp.map(i=>this.el.style[i]),t}_setupHelperStyle(t){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let i=this.helper.style;return i.pointerEvents="none",i.width=this.dragOffset.width+"px",i.height=this.dragOffset.height+"px",i.willChange="left, right, top",i.position="fixed",this._dragFollow(t),i.transition="none",setTimeout(()=>{this.helper&&(i.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),(this.el._gridstackNodeOrig||this.el.gridstackNode)?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){let t=this.helper,i=this.dragElementOriginStyle,o=e.originStyleProp.indexOf("transition"),r=i[o]||null;t.style.transition=i[o]="none";let n=t.style;e.originStyleProp.forEach((s,c)=>n[s]=i[c]||null),setTimeout(()=>t.style.transition=r||"",50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){let i=this.helper.style,o=this.dragOffset;this.option.rtl?(i.right=(window.innerWidth-t.clientX+o.offsetX)*this.dragTransform.xScale+"px",i.left&&(i.left="")):(i.left=(t.clientX+o.offsetX)*this.dragTransform.xScale+"px",i.right&&(i.right="")),i.top=(t.clientY+o.offsetTop)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(t,i,o){let r=0,n=0;o&&(r=this.dragTransform.xOffset,n=this.dragTransform.yOffset);let s=i.getBoundingClientRect(),c=this.option.rtl?s.right:s.left,l=this.option.rtl?t.clientX-s.right+r:-t.clientX+s.left-r;return{x:c,top:s.top,offsetX:l,offsetTop:-t.clientY+s.top-n,width:s.width*this.dragTransform.xScale,height:s.height*this.dragTransform.yScale}}updateScrollPosition(t){this._autoScrollContainer=f.getScrollElement(t),this._getClipping(this.helper,this._autoScrollContainer)===0?this._stopScrolling():this._autoScrollAnimId||(this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick))}_getClipping(t,i){let o=t.getBoundingClientRect(),r=i.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight;if(o.bottom<r.top||o.top>r.bottom)return 0;let s=o.bottom-Math.min(r.bottom,n),c=o.top-Math.max(r.top,0);return c<0?c:s>0?s:0}_stopScrolling(){this._autoScrollAnimId&&(cancelAnimationFrame(this._autoScrollAnimId),delete this._autoScrollAnimId)}ui(){let t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect(),o=this.option.rtl?(t.right-i.right)*this.dragTransform.xScale:(i.left-t.left)*this.dragTransform.xScale;return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:o}}}}return e.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","right","top","minWidth","willChange"],e})(),Sz=class extends Y9{constructor(e,a={}){super(),this.el=e,this.option=a,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.eventEl=this.el.closest(".grid-stack-item")||this.el,this.enable(),this._setupAccept()}on(e,a){super.on(e,a)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.eventEl.addEventListener("mouseenter",this._mouseEnter),this.eventEl.addEventListener("mouseleave",this._mouseLeave),n5&&(this.eventEl.addEventListener("pointerenter",Al),this.eventEl.addEventListener("pointerleave",wl)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.eventEl.removeEventListener("mouseenter",this._mouseEnter),this.eventEl.removeEventListener("mouseleave",this._mouseLeave),n5&&(this.eventEl.removeEventListener("pointerenter",Al),this.eventEl.removeEventListener("pointerleave",wl)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.assign(this.option,e),this._setupAccept(),this}_mouseEnter(e){if(!H.dragElement||S0.touchHandled&&e.isTrusted||!this._canDrop(H.dragElement.el))return;e.preventDefault(),e.stopPropagation(),H.dragElement._stopScrolling(),H.dropElement&&H.dropElement!==this&&H.dropElement._mouseLeave(e,!0),H.dropElement=this;let a=f.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(H.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,a=!1){if(!H.dragElement||H.dropElement!==this)return;e.preventDefault(),e.stopPropagation(),a&&H.dragElement._stopScrolling();let t=f.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(H.dragElement)),this.triggerEvent("dropout",t),H.dropElement===this&&(delete H.dropElement,!a)){let i,o=this.el.parentElement;for(;!i&&o;)i=o.ddElement?.ddDroppable,o=o.parentElement;i&&i._mouseEnter(e)}}drop(e){e.preventDefault();let a=f.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(H.dragElement)),this.triggerEvent("drop",a)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return Z({draggable:e.el},e.ui())}},Tz=class M_{static init(a){return a.ddElement||(a.ddElement=new M_(a)),a.ddElement}constructor(a){this.el=a}on(a,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.on(a,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.on(a,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.on(a,t),this}off(a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(a)>-1?this.ddDraggable.off(a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(a)>-1?this.ddDroppable.off(a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(a)>-1&&this.ddResizable.off(a),this}setupDraggable(a){return this.ddDraggable?this.ddDraggable.updateOption(a):this.ddDraggable=new Vz(this.el,a),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(a){return this.ddResizable?this.ddResizable.updateOption(a):this.ddResizable=new kz(this.el,a),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(a){return this.ddDroppable?this.ddDroppable.updateOption(a):this.ddDroppable=new Sz(this.el,a),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}},Ez=class{resizable(e,a,t,i){return this._getDDElements(e,typeof a=="string"?a:void 0).forEach(o=>{if(a==="disable"||a==="enable")o.ddResizable&&o.ddResizable[a]();else if(a==="destroy")o.ddResizable&&o.cleanResizable();else if(a==="option")o.setupResizable({[t]:i});else{let r=o.el.gridstackNode.grid,n=o.el.getAttribute("gs-resize-handles")||r.opts.resizable.handles||"e,s,se";n==="all"&&(n="n,e,s,w,se,sw,ne,nw");let s=!r.opts.alwaysShowResizeHandle,c=a;o.setupResizable(F(Z({},r.opts.resizable),{handles:n,autoHide:s,start:c.start,stop:c.stop,resize:c.resize,rtl:c.rtl}))}}),this}draggable(e,a,t,i){return this._getDDElements(e,typeof a=="string"?a:void 0).forEach(o=>{if(a==="disable"||a==="enable")o.ddDraggable&&o.ddDraggable[a]();else if(a==="destroy")o.ddDraggable&&o.cleanDraggable();else if(a==="option")o.setupDraggable({[t]:i});else{let r=o.el.gridstackNode.grid,n=a;o.setupDraggable(F(Z({},r.opts.draggable),{start:n.start,stop:n.stop,drag:n.drag,rtl:n.rtl}))}}),this}dragIn(e,a){return this._getDDElements(e).forEach(t=>t.setupDraggable(a)),this}droppable(e,a,t,i){if(typeof a!="string"){let r=a;typeof r.accept=="function"&&!r._accept&&(r._accept=r.accept,r.accept=n=>r._accept(n))}let o=typeof a=="string"?a:void 0;return this._getDDElements(e,o).forEach(r=>{a==="disable"||a==="enable"?r.ddDroppable&&r.ddDroppable[a]():a==="destroy"?r.ddDroppable&&r.cleanDroppable():a==="option"?r.setupDroppable({[t]:i}):r.setupDroppable(a)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,a,t){return this._getDDElements(e).forEach(i=>i.on(a,o=>{t(o,H.dragElement?H.dragElement.el:o.target,H.dragElement?H.dragElement.helper:void 0)})),this}off(e,a){return this._getDDElements(e).forEach(t=>t.off(a)),this}_getDDElements(e,a){let t=e.gridstack||a!=="destroy"&&a!=="disable",i=f.getElements(e);return i.length?i.map(o=>o.ddElement||(t?Tz.init(o):null)).filter(o=>!!o):[]}},v0=new Ez,X2=(()=>{class e{static init(t={},i=".grid-stack"){if(typeof document>"u")return null;let o=e.getGridElement(i);return o?(o.gridstack||(o.gridstack=new e(o,f.cloneDeep(t))),o.gridstack):(console.error(typeof i=="string"?'GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
|
|
133
133
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(t={},i=".grid-stack"){let o=[];return typeof document>"u"||(e.getGridElements(i).forEach(r=>{r.gridstack||(r.gridstack=new e(r,f.cloneDeep(t))),o.push(r.gridstack)}),o.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
|
|
134
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),o}static addGrid(t,i={}){if(!t)return null;let o=t;if(o.gridstack){let r=o.gridstack;return i&&(r.opts=Z(Z({},r.opts),i)),i.children!==void 0&&r.load(i.children),r}return(!t.classList.contains("grid-stack")||e.addRemoveCB)&&(e.addRemoveCB?o=e.addRemoveCB(t,i,!0,!0):o=f.createDiv(["grid-stack",i.class],t)),e.init(i,o)}static registerEngine(t){e.engineClass=t}get placeholder(){if(!this._placeholder){this._placeholder=f.createDiv([this.opts.placeholderClass,V0.itemClass,this.opts.itemClass]);let t=f.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(t.textContent=this.opts.placeholderText)}return this._placeholder}constructor(t,i={}){this.el=t,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},t.gridstack=this,this.opts=i=i||{},t.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);let o=f.toNumber(t.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);let r=i.columnOpts;if(r){let l=r.breakpoints;!r.columnWidth&&!l?.length?delete i.columnOpts:(r.columnMax=r.columnMax||12,l.length>1&&l.sort((d,h)=>(h.w||0)-(d.w||0)))}let n=F(Z({},f.cloneDeep(V0)),{column:f.toNumber(t.getAttribute("gs-column"))||V0.column,minRow:o||f.toNumber(t.getAttribute("gs-min-row"))||V0.minRow,maxRow:o||f.toNumber(t.getAttribute("gs-max-row"))||V0.maxRow,staticGrid:f.toBool(t.getAttribute("gs-static"))||V0.staticGrid,sizeToContent:f.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||V0.draggable.handle},removableOptions:{accept:i.itemClass||V0.removableOptions.accept,decline:V0.removableOptions.decline}});t.getAttribute("gs-animate")&&(n.animate=f.toBool(t.getAttribute("gs-animate"))),i=f.defaults(i,n),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=t.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");let s=this.el.closest("."+V0.itemClass)?.gridstackNode;if(s&&(s.subGrid=this,this.parentGridNode=s,this.el.classList.add("grid-stack-nested"),s.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==V0.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);let l=i.cellHeight;delete i.cellHeight,this.cellHeight(l)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=n5),this._setStaticClass();let c=i.engineClass||e.engineClass||bl;if(this.engine=new c({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:l=>{l.forEach(d=>{let h=d.el;h&&(d._removeDOM?(h&&h.remove(),delete d._removeDOM):this._writePosAttr(h,d))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(l=>this._prepareElement(l)),delete this.engine._loading,this.batchUpdate(!1)),i.children){let l=i.children;delete i.children,l.length&&this.load(l)}this.setAnimation(),i.subGridDynamic&&!H.pauseDrag&&(H.pauseDrag=!0),i.draggable?.pause!==void 0&&(H.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(t=this.opts){this.el.classList.add("gs-"+t.column),typeof t.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/t.column}%`)}addWidget(t){if(!t)return;if(typeof t=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(t.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(t);let i,o=t;if(o.grid=this,o.el?i=o.el:e.addRemoveCB?i=e.addRemoveCB(this.el,t,!0,!1):i=this.createWidgetDivs(o),!i)return;if(o=i.gridstackNode,o&&i.parentElement===this.el&&this.engine.nodes.find(n=>n._id===o._id))return i;let r=this._readAttr(i);return f.defaults(t,r),this.engine.prepareNode(t),this.el.appendChild(i),this.makeWidget(i,t),i}createWidgetDivs(t){let i=f.createDiv(["grid-stack-item",this.opts.itemClass]),o=f.createDiv(["grid-stack-item-content"],i);return f.lazyLoad(t)?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([r])=>{r.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,e.renderCB(o,t),t.grid?.prepareDragDrop(t.el))}),window.setTimeout(()=>t.visibleObservable?.observe(i))):e.renderCB(o,t),i}makeSubGrid(t,i,o,r=!0){let n=t.gridstackNode;if(n||(n=this.makeWidget(t).gridstackNode),n.subGrid?.el)return n.subGrid;let s,c=this;for(;c&&!s;)s=c.opts?.subGridOpts,c=c.parentGridNode?.grid;i=f.cloneDeep(Z(Z(F(Z({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),s||{}),i||n.subGridOpts||{})),n.subGridOpts=i;let l=!1;i.column==="auto"&&(l=!0,i.column=Math.max(n.w||1,o?.w||1),delete i.columnOpts);let d=n.el.querySelector(".grid-stack-item-content"),h,_;if(r&&(this._removeDD(n.el),_=F(Z({},n),{x:0,y:0}),f.removeInternalForSave(_),delete _.subGridOpts,n.content&&(_.content=n.content,delete n.content),e.addRemoveCB?h=e.addRemoveCB(this.el,_,!0,!1)||void 0:(h=f.createDiv(["grid-stack-item"]),h.appendChild(d),d=f.createDiv(["grid-stack-item-content"],n.el)),this.prepareDragDrop(n.el)),o){let m=l?i.column:n.w,A=n.h+o.h,C=n.el.style;C.transition="none",this.update(n.el,{w:m,h:A}),setTimeout(()=>C.transition="")}let u=n.subGrid=e.addGrid(d,i)||void 0;return o?._moving&&(u._isTemp=!0),l&&(u._autoColumn=!0),r&&u.makeWidget(h,_),o&&(o._moving?window.setTimeout(()=>f.simulateMouseEvent(o._event,"mouseenter",u.el),0):u.makeWidget(n.el,n)),this.resizeToContentCheck(!1,n),u}removeAsSubGrid(t){let i=this.parentGridNode?.grid;if(i&&(i.batchUpdate(),i.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(o=>{o.x=(o.x??0)+(this.parentGridNode.x??0),o.y=(o.y??0)+(this.parentGridNode.y??0),this._removeDD(o.el),o.el.remove(),delete o.el.gridstackNode,i.makeWidget(o.el,o)}),i.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,t)){let o=t.el?.gridstackNode;o&&o!==t&&(o._temporaryRemoved=!0),window.setTimeout(()=>{let r=H.dragElement?.lastDrag||t._event;r&&f.simulateMouseEvent(r,"mouseenter",i.el)},0)}}save(t=!0,i=!1,o=e.saveCB,r){let n=this.engine.save(t,o,r);if(n.forEach(s=>{if(t&&s.el&&!s.subGrid&&!o){let c=s.el.querySelector(".grid-stack-item-content");s.content=c?.innerHTML,s.content||delete s.content}else if(!t&&!o&&delete s.content,s.subGrid?.el){let c=s.w||s.subGrid.getColumn(),l=s.subGrid.save(t,i,o,c);s.subGridOpts=i?l:{children:l},delete s.subGrid}delete s.el}),i){let s=f.cloneDeep(this.opts);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===(this.el.style.direction==="rtl")&&(s.rtl="auto"),this._isAutoCellHeight&&(s.cellHeight="auto"),this._autoColumn&&(s.column="auto");let c=s._alwaysShowResizeHandle;return delete s._alwaysShowResizeHandle,c!==void 0?s.alwaysShowResizeHandle=c:delete s.alwaysShowResizeHandle,f.removeInternalAndSame(s,V0),s.children=n,s}return n}load(t,i=e.addRemoveCB||!0){t.forEach(h=>{h.w=h.w||h.minW||1,h.h=h.h||h.minH||1}),t=f.sort(t),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let o=0;t.forEach(h=>{o=Math.max(o,(h.x||0)+h.w)}),o>this.engine.defaultColumn&&(this.engine.defaultColumn=o);let r=this.getColumn();o>r&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=t,this.engine.columnChanged(o,r,this.responseLayout),t=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(t,o,!0));let n=e.addRemoveCB;typeof i=="function"&&(e.addRemoveCB=i);let s=[];this.batchUpdate();let c=!this.engine.nodes.length,l=c&&this.opts.animate;l&&this.setAnimation(!1),!c&&i&&[...this.engine.nodes].forEach(h=>{h.id&&(f.find(t,h.id)||(e.addRemoveCB&&e.addRemoveCB(this.el,h,!1,!1),s.push(h),this.removeWidget(h.el,!0,!1)))}),this.engine._loading=!0;let d=[];return this.engine.nodes=this.engine.nodes.filter(h=>h.id&&f.find(t,h.id)?(d.push(h),!1):!0),t.forEach(h=>{let _=h.id?f.find(d,h.id):void 0;if(_){if(f.shouldSizeToContent(_)&&(h.h=_.h),this.engine.nodeBoundFix(h),(h.autoPosition||h.x===void 0||h.y===void 0)&&(h.w=h.w||_.w,h.h=h.h||_.h,this.engine.findEmptyPosition(h)),this.engine.nodes.push(_),f.samePos(_,h)&&this.engine.nodes.length>1&&(this.moveNode(_,F(Z({},h),{forceCollide:!0})),f.copyPos(h,_)),this.update(_.el,h),h.subGridOpts?.children){let u=_.el.querySelector(".grid-stack");u&&u.gridstack&&u.gridstack.load(h.subGridOpts.children)}}else i&&this.addWidget(h)}),delete this.engine._loading,this.engine.removedNodes=s,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,n?e.addRemoveCB=n:delete e.addRemoveCB,l&&this.setAnimation(!0,!0),this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!t||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let i=this.el.querySelector("."+this.opts.itemClass);if(i){let r=f.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/r)}let o=parseInt(this.el.getAttribute("gs-current-row")||"0");return o?Math.round(this.el.getBoundingClientRect().height/o):this.opts.cellHeight}cellHeight(t){if(t!==void 0&&this._isAutoCellHeight!==(t==="auto")&&(this._isAutoCellHeight=t==="auto",this._updateResizeEvent()),(t==="initial"||t==="auto")&&(t=void 0),t===void 0){let o=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+o}let i=f.parseHeight(t);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(t=!1){return t&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let t=this.opts.columnOpts;if(!t||!t.columnWidth&&!t.breakpoints?.length)return!1;let i=this.getColumn(),o=i,r=this._widthOrContainer(!0);if(t.columnWidth)o=Math.min(Math.round(r/t.columnWidth)||1,t.columnMax);else{o=t.columnMax;let n=0;for(;n<t.breakpoints.length&&r<=t.breakpoints[n].w;)o=t.breakpoints[n++].c||i}if(o!==i){let n=t.breakpoints?.find(s=>s.c===o);return this.column(o,n?.layout||t.layout),!0}return!1}compact(t="compact",i=!0){return this.engine.compact(t,i),this._triggerChangeEvent(),this}column(t,i="moveScale"){if(!t||t<1||this.opts.column===t)return this;let o=this.getColumn();return this.opts.column=t,this.engine?(this.engine.column=t,this.el.classList.remove("gs-"+o),this._updateColumnVar(),this.engine.columnChanged(o,t,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,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))}isIgnoreChangeCB(){return!!this._ignoreLayoutsNodeChange}destroy(t=!0){return this.el?(this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this):this}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,i=!1){let o=this.el.getBoundingClientRect(),r;i?r={top:o.top+document.documentElement.scrollTop,left:o.left}:r={top:this.el.offsetTop,left:this.el.offsetLeft};let n=t.left-r.left,s=t.top-r.top,c=o.width/this.getColumn(),l=o.height/parseInt(this.el.getAttribute("gs-current-row")||"0");return{x:Math.floor(n/c),y:Math.floor(s/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(t,i,o,r){return this.engine.isAreaEmpty(t,i,o,r)}makeWidget(t,i){let o=e.getElement(t);if(!o||o.gridstackNode)return o;o.parentElement||this.el.appendChild(o),this._prepareElement(o,!0,i);let r=o.gridstackNode;this._updateContainerHeight(),r.subGridOpts&&this.makeSubGrid(o,r.subGridOpts,void 0,!1);let n=!1;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(n=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),n&&delete this._ignoreLayoutsNodeChange,o}on(t,i){return t.indexOf(" ")!==-1?(t.split(" ").forEach(o=>this.on(o,i)),this):(t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable"?(t==="enable"||t==="disable"?this._gsEventHandler[t]=o=>i(o):this._gsEventHandler[t]=o=>{o.detail&&i(o,o.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):t==="drag"||t==="dragstart"||t==="dragstop"||t==="resizestart"||t==="resize"||t==="resizestop"||t==="dropped"||t==="resizecontent"?this._gsEventHandler[t]=i:console.error("GridStack.on("+t+") event not supported"),this)}off(t){return t.indexOf(" ")!==-1?(t.split(" ").forEach(i=>this.off(i)),this):((t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable")&&this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(t=>this.off(t)),this}removeWidget(t,i=!0,o=!0){return t?(e.getElements(t).forEach(r=>{if(r.parentElement&&r.parentElement!==this.el)return;let n=r.gridstackNode;n||(n=this.engine.nodes.find(s=>r===s.el)),n&&(i&&e.addRemoveCB&&e.addRemoveCB(this.el,n,!1,!1),delete r.gridstackNode,this._removeDD(r),this.engine.removeNode(n,i,o),i&&r.parentElement&&r.remove())}),o&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(t=!0,i=!0){return this.engine.nodes.forEach(o=>{t&&e.addRemoveCB&&e.addRemoveCB(this.el,o,!1,!1),delete o.el.gridstackNode,this.opts.staticGrid||this._removeDD(o.el)}),this.engine.removeAll(t,i),i&&this._triggerRemoveEvent(),this}setAnimation(t=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(t)}):t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=t,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(t,i=!0,o=!0){return!!this.opts.staticGrid===t?this:(t?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&o&&r.subGrid.setStatic(t,i,o)}),i&&this._setStaticClass(),this)}updateOptions(t){let i=this.opts;if(t===i)return this;if(t.acceptWidgets!==void 0&&(i.acceptWidgets=t.acceptWidgets,this._setupAcceptWidget()),t.animate!==void 0&&this.setAnimation(t.animate),t.cellHeight&&this.cellHeight(t.cellHeight),t.class!==void 0&&t.class!==i.class&&(i.class&&this.el.classList.remove(i.class),t.class&&this.el.classList.add(t.class)),t.columnOpts){let o=!!this.opts.columnOpts;this.opts.columnOpts=t.columnOpts,o!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else t.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof t.column=="number"&&this.column(t.column);return t.margin!==void 0&&this.margin(t.margin),t.staticGrid!==void 0&&this.setStatic(t.staticGrid),t.disableDrag!==void 0&&!t.staticGrid&&this.enableMove(!t.disableDrag),t.disableResize!==void 0&&!t.staticGrid&&this.enableResize(!t.disableResize),t.float!==void 0&&this.float(t.float),t.row!==void 0?(i.minRow=i.maxRow=this.engine.maxRow=i.row=t.row,this._updateContainerHeight(),this.engine.getRow()>t.row&&this.compact()):(t.minRow!==void 0&&(i.minRow=t.minRow,this._updateContainerHeight()),t.maxRow!==void 0&&(i.maxRow=this.engine.maxRow=t.maxRow,this.engine.getRow()>t.maxRow&&this.compact())),t.lazyLoad!==void 0&&(i.lazyLoad=t.lazyLoad),t.children?.length&&this.load(t.children),this}update(t,i){return e.getElements(t).forEach(o=>{let r=o?.gridstackNode;if(!r)return;let n=Z(Z({},f.copyPos({},r)),f.cloneDeep(i));this.engine.nodeBoundFix(n),delete n.autoPosition;let s=["x","y","w","h"],c,l=n,d=r;if(s.some(u=>l[u]!==void 0&&l[u]!==d[u])){c={};let u=c;s.forEach(m=>{u[m]=l[m]!==void 0?l[m]:d[m],delete l[m]})}if(!c&&(n.minW||n.minH||n.maxW||n.maxH)&&(c={}),n.content!==void 0){let u=o.querySelector(".grid-stack-item-content");u&&u.textContent!==n.content&&(r.content=n.content,e.renderCB(u,n),r.subGrid?.el&&(u.appendChild(r.subGrid.el),r.subGrid._updateContainerHeight())),delete n.content}let h=!1,_=!1;for(let u in l)u[0]!=="_"&&d[u]!==l[u]&&(d[u]=l[u],h=!0,_=_||!this.opts.staticGrid&&(u==="noResize"||u==="noMove"||u==="locked"));if(f.sanitizeMinMax(r),c){let u=c.w!==void 0&&c.w!==r.w;this.moveNode(r,c),u&&r.subGrid?r.subGrid.onResize(this.hasAnimationCSS()?r.w:void 0):this.resizeToContentCheck(u,r),delete r._orig}(c||h)&&this._writeAttr(o,r),_&&this.prepareDragDrop(r.el),e.updateCB&&e.updateCB(r)}),this}moveNode(t,i){let o=t._updating;o||this.engine.cleanNodes().beginUpdate(t),this.engine.moveNode(t,i),this._updateContainerHeight(),o||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(t){if(!t||(t.classList.remove("size-to-content-max"),!t.clientHeight))return;let i=t.gridstackNode;if(!i)return;let o=i.grid;if(!o||t.parentElement!==o.el)return;let r=o.getCellHeight(!0);if(!r)return;let n=i.h?i.h*r:t.clientHeight,s=null;if(i.resizeToContentParent&&(s=t.querySelector(i.resizeToContentParent)),s||(s=t.querySelector(e.resizeToContentParent)),!s)return;let c=t.clientHeight-s.clientHeight,l=i.h?i.h*r-c:s.clientHeight,d;if(i.subGrid){d=i.subGrid.getRow()*i.subGrid.getCellHeight(!0);let u=i.subGrid.el.getBoundingClientRect(),m=t.getBoundingClientRect();d+=u.top-m.top}else{if(i.subGridOpts?.children?.length)return;{let u=s.firstElementChild;if(!u){console.error(`Error: GridStack.resizeToContent() widget id:${i.id} '${e.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}d=u.getBoundingClientRect().height||l}}if(l===d)return;n+=d-l;let h=Math.ceil(n/r),_=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;_&&h>_&&(h=_,t.classList.add("size-to-content-max")),i.minH&&h<i.minH?h=i.minH:i.maxH&&h>i.maxH&&(h=i.maxH),h!==i.h&&(o._ignoreLayoutsNodeChange=!0,o.moveNode(i,{h}),delete o._ignoreLayoutsNodeChange)}resizeToContentCBCheck(t){e.resizeToContentCB?e.resizeToContentCB(t):this.resizeToContent(t)}rotate(t,i){return e.getElements(t).forEach(o=>{let r=o.gridstackNode;if(!r||!f.canBeRotated(r))return;let n={w:r.h,h:r.w,minH:r.minW,minW:r.minH,maxH:r.maxW,maxW:r.maxH};if(i){let l=i.left>0?Math.floor(i.left/this.cellWidth()):0,d=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;n.x=r.x+l-(r.h-(d+1)),n.y=r.y+d-l}let s=n;Object.keys(s).forEach(l=>{s[l]===void 0&&delete s[l]});let c=r._orig;this.update(o,n),r._orig=c}),this}margin(t){if(!(typeof t=="string"&&t.split(" ").length>1)){let i=f.parseHeight(t);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return this}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(t){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(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});let t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(t,i){let o=i?new CustomEvent(t,{bubbles:!1,detail:i}):new Event(t),r=this;for(;r.parentGridNode;)r=r.parentGridNode.grid;return r.el.dispatchEvent(o),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.parentGridNode,i=this.getRow()+this._extraDragRow,o=this.opts.cellHeight,r=this.opts.cellHeightUnit;if(!o)return this;if(!t&&!this.opts.minRow){let n=f.parseHeight(getComputedStyle(this.el).minHeight);if(n.h>0&&n.unit===r){let s=Math.floor(n.h/o);i<s&&(i=s)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[t?"minHeight":"height"]=i*o+r),t&&f.shouldSizeToContent(t)&&t.grid.resizeToContentCBCheck(t.el),this}_prepareElement(t,i=!1,o){o=o||this._readAttr(t),t.gridstackNode=o,o.el=t,o.grid=this,o=this.engine.addNode(o,i),this._writeAttr(t,o),t.classList.add(V0.itemClass,this.opts.itemClass);let r=f.shouldSizeToContent(o);return r?t.classList.add("size-to-content"):t.classList.remove("size-to-content"),r&&this.resizeToContentCheck(!1,o),(!f.lazyLoad(o)||!o.visibleObservable)&&this.prepareDragDrop(o.el),this}_writePosAttr(t,i){if(!i._moving&&!i._resizing||this._placeholder===t){let o=this.opts.rtl?"right":"left",r=t.style;r.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,r[o]=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,r.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,r.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null}return t.setAttribute("gs-x",String(i.x??0)),t.setAttribute("gs-y",String(i.y??0)),i.w>1?t.setAttribute("gs-w",String(i.w)):t.removeAttribute("gs-w"),i.h>1?t.setAttribute("gs-h",String(i.h)):t.removeAttribute("gs-h"),this}_writeAttr(t,i){if(!i)return this;this._writePosAttr(t,i);let o={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"},r=i,n=o;for(let s in n)r[s]?t.setAttribute(n[s],String(r[s])):t.removeAttribute(n[s]);return this}_readAttr(t,i=!0){let o={};o.x=f.toNumber(t.getAttribute("gs-x")),o.y=f.toNumber(t.getAttribute("gs-y")),o.w=f.toNumber(t.getAttribute("gs-w")),o.h=f.toNumber(t.getAttribute("gs-h")),o.autoPosition=f.toBool(t.getAttribute("gs-auto-position")),o.noResize=f.toBool(t.getAttribute("gs-no-resize")),o.noMove=f.toBool(t.getAttribute("gs-no-move")),o.locked=f.toBool(t.getAttribute("gs-locked"));let r=t.getAttribute("gs-size-to-content");r&&(r==="true"||r==="false"?o.sizeToContent=f.toBool(r):o.sizeToContent=parseInt(r,10)),o.id=t.getAttribute("gs-id")??void 0,o.maxW=f.toNumber(t.getAttribute("gs-max-w")),o.minW=f.toNumber(t.getAttribute("gs-min-w")),o.maxH=f.toNumber(t.getAttribute("gs-max-h")),o.minH=f.toNumber(t.getAttribute("gs-min-h")),i&&(o.w===1&&t.removeAttribute("gs-w"),o.h===1&&t.removeAttribute("gs-h"),o.maxW&&t.removeAttribute("gs-max-w"),o.minW&&t.removeAttribute("gs-min-w"),o.maxH&&t.removeAttribute("gs-max-h"),o.minH&&t.removeAttribute("gs-min-h"));let n=o;for(let s in n)o.hasOwnProperty(s)&&!n[s]&&n[s]!==0&&s!=="sizeToContent"&&delete n[s];return o}_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}onResize(t=this.el?.clientWidth){if(!t)return this;if(this.prevWidth===t)return this;this.prevWidth=t,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(t=!1,i){if(!this.engine)return;if(t&&this.hasAnimationCSS()){setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);return}if(i)f.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(r=>f.shouldSizeToContent(r))){let r=[...this.engine.nodes];this.batchUpdate(),r.forEach(n=>{f.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}let o=this._gsEventHandler.resizecontent;o&&o(new Event("resizecontent"),i?[i]:this.engine.nodes)}_updateResizeEvent(t=!1){let i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(o=>o.sizeToContent));return!t&&i&&!this.resizeObserver?(this._sizeThrottle=f.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(t||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(t=".grid-stack-item"){return f.getElement(t)}static getElements(t=".grid-stack-item"){return f.getElements(t)}static getGridElement(t){return e.getElement(t)}static getGridElements(t){return f.getElements(t)}_initMargin(){let t={h:0,unit:"px"},i=0,o=[];typeof this.opts.margin=="string"&&(o=this.opts.margin.split(" ")),o.length===2?(this.opts.marginTop=this.opts.marginBottom=o[0],this.opts.marginLeft=this.opts.marginRight=o[1]):o.length===4?(this.opts.marginTop=o[0],this.opts.marginRight=o[1],this.opts.marginBottom=o[2],this.opts.marginLeft=o[3]):(t=f.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,i=this.opts.margin=t.h);let r=["marginTop","marginRight","marginBottom","marginLeft"],n=this.opts;r.forEach(c=>{n[c]===void 0?n[c]=i:(t=f.parseHeight(n[c]),n[c]=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);let s=this.el.style;return s.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),s.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),s.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),s.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return v0}static setupDragIn(t,i,o,r=document){i?.pause!==void 0&&(H.pauseDrag=i.pause),i=Z({appendTo:"body",helper:"clone"},i||{}),(typeof t=="string"?f.getElements(t,r):t).forEach((n,s)=>{v0.isDraggable(n)||v0.dragIn(n,i),o?.[s]&&(n.gridstackNode=o[s])})}movable(t,i){return this.opts.staticGrid?this:(e.getElements(t).forEach(o=>{let r=o.gridstackNode;r&&(i?delete r.noMove:r.noMove=!0,this.prepareDragDrop(r.el))}),this)}resizable(t,i){return this.opts.staticGrid?this:(e.getElements(t).forEach(o=>{let r=o.gridstackNode;r&&(i?delete r.noResize:r.noResize=!0,this.prepareDragDrop(r.el))}),this)}disable(t=!0){return this.opts.staticGrid?this:(this.enableMove(!1,t),this.enableResize(!1,t),this._triggerEvent("disable"),this)}enable(t=!0){return this.opts.staticGrid?this:(this.enableMove(!0,t),this.enableResize(!0,t),this._triggerEvent("enable"),this)}enableMove(t,i=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&i&&o.subGrid.enableMove(t,i)}),this)}enableResize(t,i=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&i&&o.subGrid.enableResize(t,i)}),this)}cancelDrag(){let t=H.dragElement?.el;if(t?._gridstackNodeOrig){let o=t._gridstackNodeOrig,r=o.grid,n=this._placeholder?.gridstackNode;n&&(n._isAboutToRemove=!0,this.engine.removeNode(n)),this.engine.restoreInitial(),t.gridstackNode=o,delete t._gridstackNodeOrig,delete H.dropElement,r&&(r.engine.addNode(o,!1),r.engine.restoreInitial());return}let i=this._placeholder?.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&e._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(t){return v0.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return v0.droppable(this.el,"destroy"),this;let t,i,o=(r,n,s)=>{s=s||n;let c=s.gridstackNode;if(!c)return;if(!c.grid?.el){s.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let u=s.getBoundingClientRect();s.style.left=u.x+(this.dragTransform.xScale-1)*(r.clientX-u.x)/this.dragTransform.xScale+"px",s.style.top=u.y+(this.dragTransform.yScale-1)*(r.clientY-u.y)/this.dragTransform.yScale+"px",s.style.transformOrigin="0px 0px"}let{top:l,left:d}=s.getBoundingClientRect(),h=this.el.getBoundingClientRect();d-=h.left,l-=h.top;let _={position:{top:l*this.dragTransform.xScale,left:d*this.dragTransform.yScale}};if(c._temporaryRemoved){if(c.x=Math.max(0,Math.round(d/i)),c.y=Math.max(0,Math.round(l/t)),delete c.autoPosition,this.engine.nodeBoundFix(c),!this.engine.willItFit(c)){if(c.autoPosition=!0,!this.engine.willItFit(c)){v0.off(n,"drag");return}c._willFitPos&&(f.copyPos(c,c._willFitPos),delete c._willFitPos)}this._onStartMoving(s,r,_,c,i,t)}else this._dragOrResize(s,r,_,c,i,t)};return v0.droppable(this.el,{accept:r=>{let n=r.gridstackNode||this._readAttr(r,!1);if(n?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let s=!0;if(typeof this.opts.acceptWidgets=="function")s=this.opts.acceptWidgets(r);else{let c=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;s=r.matches(c)}if(s&&n&&this.opts.maxRow){let c={w:n.w,h:n.h,minW:n.minW,minH:n.minH};s=this.engine.willItFit(c)}return s}}).on(this.el,"dropover",(r,n,s)=>{let c=s?.gridstackNode||n.gridstackNode;if(c?.grid===this&&!c._temporaryRemoved)return!1;if(c?._sidebarOrig&&(c.w=c._sidebarOrig.w,c.h=c._sidebarOrig.h),c?.grid&&c.grid!==this&&!c._temporaryRemoved&&c.grid._leave(n,s),s=s||n,i=this.cellWidth(),t=this.getCellHeight(!0),!c){let h=s.getAttribute("data-gs-widget")||s.getAttribute("gridstacknode");if(h){try{c=JSON.parse(h)}catch{console.error("Gridstack dropover: Bad JSON format: ",h)}s.removeAttribute("data-gs-widget"),s.removeAttribute("gridstacknode")}c||(c=this._readAttr(s)),c._sidebarOrig={w:c.w,h:c.h}}c.grid||(c.el||(c=Z({},c)),c._isExternal=!0,s.gridstackNode=c);let l=c.w||Math.round(s.offsetWidth/i)||1,d=c.h||Math.round(s.offsetHeight/t)||1;return c.grid&&c.grid!==this?(n._gridstackNodeOrig||(n._gridstackNodeOrig=c),n.gridstackNode=c=F(Z({},c),{w:l,h:d,grid:this}),delete c.x,delete c.y,this.engine.cleanupNode(c).nodeBoundFix(c),c._initDD=c._isExternal=c._temporaryRemoved=!0):(c.w=l,c.h=d,c._temporaryRemoved=!0),e._itemRemoving(c.el,!1),v0.on(n,"drag",o),o(r,n,s),!1}).on(this.el,"dropout",(r,n,s)=>{let c=s?.gridstackNode||n.gridstackNode;return c&&(!c.grid||c.grid===this)&&(this._leave(n,s),this._isTemp&&this.removeAsSubGrid(c)),!1}).on(this.el,"drop",(r,n,s)=>{let c=s?.gridstackNode||n.gridstackNode;if(c?.grid===this&&!c._isExternal)return!1;let l=!!this.placeholder.parentElement,d=n!==s;this.placeholder.remove(),delete this.placeholder.gridstackNode,l&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let h=n._gridstackNodeOrig;if(delete n._gridstackNodeOrig,l&&h?.grid&&h.grid!==this){let u=h.grid;u.engine.removeNodeFromLayoutCache(h),u.engine.removedNodes.push(h),u._triggerRemoveEvent()._triggerChangeEvent(),u.parentGridNode&&!u.engine.nodes.length&&u.opts.subGridDynamic&&u.removeAsSubGrid()}if(!c||(l&&(this.engine.cleanupNode(c),c.grid=this),delete c.grid?._isTemp,v0.off(n,"drag"),s&&s!==n?(s.remove(),n=s):n.remove(),this._removeDD(n),!l))return!1;let _=c.subGrid?.el?.gridstack;return f.copyPos(c,this._readAttr(this.placeholder)),f.removePositioningStyles(n),d&&(c.content||c.subGridOpts||e.addRemoveCB)?(delete c.el,n=this.addWidget(c)||n):(this._prepareElement(n,!0,c),this.el.appendChild(n),this.resizeToContentCheck(!1,c),_&&(_.parentGridNode=c),this._updateContainerHeight()),this.engine.addedNodes.push(c),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(F(Z({},r),{type:"dropped"}),h&&h.grid?h:void 0,c),!1}),this}static _itemRemoving(t,i){if(!t)return;let o=t?t.gridstackNode:void 0;!o?.grid||t.classList.contains(o.grid.opts.removableOptions.decline)||(i?o._isAboutToRemove=!0:delete o._isAboutToRemove,i?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let t=document.querySelector(this.opts.removable);return t?(!this.opts.staticGrid&&!v0.isDroppable(t)&&v0.droppable(t,this.opts.removableOptions).on(t,"dropover",(i,o)=>e._itemRemoving(o,!0)).on(t,"dropout",(i,o)=>e._itemRemoving(o,!1)),this):this}refreshDragHandles(t){return e.getElements(t).forEach(i=>{i.ddElement?.ddDraggable?.refreshHandles()}),this}prepareDragDrop(t,i=!1){let o=t?.gridstackNode;if(!o)return this;let r=o.noMove||this.opts.disableDrag,n=o.noResize||this.opts.disableResize,s=this.opts.staticGrid||r&&n;if((i||s)&&(o._initDD&&(this._removeDD(t),delete o._initDD),s))return t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!o._initDD){let c,l,d=(u,m)=>{this.triggerEvent(u,u.target),c=this.cellWidth(),l=this.getCellHeight(!0),this._onStartMoving(t,u,m,o,c,l)},h=(u,m)=>{this._dragOrResize(t,u,m,o,c,l)},_=u=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete o._moving,delete o._resizing,delete o._event,delete o._lastTried;let m=o.w!==o._orig.w,A=u.target;if(!(!A.gridstackNode||A.gridstackNode.grid!==this)){if(o.el=A,o._isAboutToRemove){let C=t.gridstackNode.grid;C._gsEventHandler[u.type]&&C._gsEventHandler[u.type](u,A),C.engine.nodes.push(o),C.removeWidget(t,!0,!0)}else f.removePositioningStyles(A),o._temporaryRemoved?(this._writePosAttr(A,o),this.engine.addNode(o)):this._writePosAttr(A,o),this.triggerEvent(u,A);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),u.type==="resizestop"&&(Number.isInteger(o.sizeToContent)&&(o.sizeToContent=o.h),this.resizeToContentCheck(m,o))}};v0.draggable(t,{start:d,stop:_,drag:h,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}).resizable(t,{start:d,stop:_,resize:h,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}),o._initDD=!0}return v0.draggable(t,r?"disable":"enable").resizable(t,n?"disable":"enable"),this}_onStartMoving(t,i,o,r,n,s){if(this.engine.cleanNodes().beginUpdate(r),this._writePosAttr(this.placeholder,r),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=r,r.grid?.el)this.dragTransform=f.getValuesFromTransformedElement(t);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let c=this.placeholder.closest(".grid-stack");this.dragTransform=f.getValuesFromTransformedElement(c)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(r.el=this.placeholder,r._lastUiPosition=o.position,r._prevYPix=o.position.top,r._moving=i.type==="dragstart",r._resizing=i.type==="resizestart",delete r._lastTried,i.type==="dropover"&&r._temporaryRemoved&&(this.engine.addNode(r),r._moving=!0),this.engine.cacheRects(n,s,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){let c=this.getColumn()-r.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-r.y;v0.resizable(t,"option","minWidth",n*Math.min(r.minW||1,c)).resizable(t,"option","minHeight",s*Math.min(r.minH||1,l)).resizable(t,"option","maxWidth",n*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,c)).resizable(t,"option","maxWidthMoveLeft",n*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,r.x+r.w)).resizable(t,"option","maxHeight",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(t,"option","maxHeightMoveUp",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,r.y+r.h))}}_dragOrResize(t,i,o,r,n,s){let c=Z({},r._orig),l=!1,d=this.opts.marginLeft,h=this.opts.marginRight,_=this.opts.marginTop,u=this.opts.marginBottom,m=Math.round(s*.1),A=Math.round(n*.1);if(d=Math.min(d,A),h=Math.min(h,A),_=Math.min(_,m),u=Math.min(u,m),i.type==="drag"){if(r._temporaryRemoved)return;r._prevYPix=o.position.top,this.opts.draggable.scroll!==!1&&H.dragElement?.updateScrollPosition(this.el);let w=o.position.left+(o.position.left>r._lastUiPosition.left?-h:d),M=o.position.top+(o.position.top>r._lastUiPosition.top?-u:_);c.x=Math.round(w/n),c.y=Math.round(M/s);let I=this._extraDragRow;if(this.engine.collide(r,c)){let w1=this.getRow(),H0=Math.max(0,c.y+r.h-w1);this.opts.maxRow&&w1+H0>this.opts.maxRow&&(H0=Math.max(0,this.opts.maxRow-w1)),this._extraDragRow=H0}else this._extraDragRow=0;if(this._extraDragRow!==I&&this._updateContainerHeight(),r.x===c.x&&r.y===c.y)return}else if(i.type==="resize"){if((c.x??0)<0||(f.updateScrollResize(i,t,s),c.w=Math.round((o.size.width-d)/n),c.h=Math.round((o.size.height-_)/s),r.w===c.w&&r.h===c.h)||r._lastTried&&r._lastTried.w===c.w&&r._lastTried.h===c.h)return;if(i.hasMovedX){let w=o.position.left+d;c.x=Math.round(w/n)}if(i.hasMovedY){let w=o.position.top+_;c.y=Math.round(w/s)}l=!0}r._event=i,r._lastTried=c;let C={x:o.position.left+d,y:o.position.top+_,w:(o.size?o.size.width:r.w*n)-d-h,h:(o.size?o.size.height:r.h*s)-_-u};if(this.engine.moveNodeCheck(r,F(Z({},c),{cellWidth:n,cellHeight:s,rect:C,resizing:l}))){r._lastUiPosition=o.position,this.engine.cacheRects(n,s,_,h,u,d),delete r._skipDown,l&&r.subGrid&&r.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let w=i.target;r._sidebarOrig||this._writePosAttr(w,r),this.triggerEvent(i,w)}}triggerEvent(t,i){let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;o._gsEventHandler[t.type]&&o._gsEventHandler[t.type](t,i)}_leave(t,i){i=i||t;let o=i.gridstackNode;if(!o||(i.style.transform=i.style.transformOrigin="",v0.off(t,"drag"),o._temporaryRemoved))return;o._temporaryRemoved=!0,this.engine.removeNode(o),o.el=o._isExternal&&i?i:t;let r=o._sidebarOrig;o._isExternal&&this.engine.cleanupNode(o),o._sidebarOrig=r,this.opts.removable===!0&&e._itemRemoving(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):o._isExternal&&this.engine.restoreInitial()}}return e.renderCB=(a,t)=>{a&&t?.content&&(a.textContent=t.content)},e.resizeToContentParent=".grid-stack-item-content",e.Utils=f,e.Engine=bl,e.GDRev="13.0.0",e})(),H_=["container"],Iz=["*"];function zz(e,a){}var Dz=["*",[["","empty-content",""]]],Rz=["*","[empty-content]"];function Oz(e,a){e&1&&m0(0,1,["*ngIf","isEmpty"])}function Nz(e,a){}var Q9=(()=>{class e{constructor(t){this.elementRef=t,this.el._gridItemComp=this}set options(t){let i=this.el.gridstackNode?.grid;i?i.update(this.el,t):this._options=F(Z({},t),{el:this.el})}get options(){return this.el.gridstackNode||this._options||{el:this.el}}get el(){return this.elementRef.nativeElement}clearOptions(){delete this._options}ngOnDestroy(){this.clearOptions(),delete this.childWidget,delete this.el._gridItemComp,delete this.container,delete this.ref}}return e.\u0275fac=function(a){return new(a||e)(l7(O1))},e.\u0275cmp=X1({type:e,selectors:[["gridstack-item"]],viewQuery:function(a,t){if(a&1&&q9(H_,7,B2),a&2){let i;y8(i=x8())&&(t.container=i.first)}},inputs:{options:"options"},ngContentSelectors:Iz,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(a,t){a&1&&(x0(),ju(0,"div",1),Pu(1,zz,0,0,"ng-template",null,0,e_),m0(3),A1(4),Gu()),a&2&&(B(4),k3(" ",t.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),e})(),R8=(()=>{class e{constructor(t){this.elementRef=t,this.addedCB=new H1,this.changeCB=new H1,this.disableCB=new H1,this.dragCB=new H1,this.dragStartCB=new H1,this.dragStopCB=new H1,this.droppedCB=new H1,this.enableCB=new H1,this.removedCB=new H1,this.resizeCB=new H1,this.resizeStartCB=new H1,this.resizeStopCB=new H1,X2.addRemoveCB||(X2.addRemoveCB=Pz),X2.saveCB||(X2.saveCB=Fz),X2.updateCB||(X2.updateCB=Uz),this.el._gridComp=this}set options(t){this._grid?this._grid.updateOptions(t):this._options=t}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static registerComponents(t){t.forEach(i=>e.componentMap[e.getSelector(i)]=i)}static getSelector(t){return n_(t).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=X2.init(this._options,this.el),delete this._options,this.checkEmpty()}ngAfterContentInit(){this._sub=this.gridstackItems?.changes.subscribe(()=>this.updateAll()),this.loaded||this.updateAll(),this.hookEvents(this.grid)}ngOnDestroy(){this.unhookEvents(this._grid),this._sub?.unsubscribe(),this._grid?.destroy(),delete this._grid,delete this.el._gridComp,delete this.container,delete this.ref}updateAll(){if(!this.grid)return;let t=[];this.gridstackItems?.forEach(i=>{t.push(i.options),i.clearOptions()}),this.grid.load(t)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(t){t&&(t.parentGridNode||t.on("added",(i,o)=>{(o[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:i,nodes:o})}).on("change",(i,o)=>this.changeCB.emit({event:i,nodes:o})).on("disable",i=>this.disableCB.emit({event:i})).on("drag",(i,o)=>this.dragCB.emit({event:i,el:o})).on("dragstart",(i,o)=>this.dragStartCB.emit({event:i,el:o})).on("dragstop",(i,o)=>this.dragStopCB.emit({event:i,el:o})).on("dropped",(i,o,r)=>this.droppedCB.emit({event:i,previousNode:o,newNode:r})).on("enable",i=>this.enableCB.emit({event:i})).on("removed",(i,o)=>{(o[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:i,nodes:o})}).on("resize",(i,o)=>this.resizeCB.emit({event:i,el:o})).on("resizestart",(i,o)=>this.resizeStartCB.emit({event:i,el:o})).on("resizestop",(i,o)=>this.resizeStopCB.emit({event:i,el:o})))}unhookEvents(t){t&&(t.parentGridNode||t.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return e.componentMap={},e.\u0275fac=function(a){return new(a||e)(l7(O1))},e.\u0275cmp=X1({type:e,selectors:[["gridstack"]],contentQueries:function(a,t,i){if(a&1&&$u(i,Q9,4),a&2){let o;y8(o=x8())&&(t.gridstackItems=o)}},viewQuery:function(a,t){if(a&1&&q9(H_,7,B2),a&2){let i;y8(i=x8())&&(t.container=i.first)}},inputs:{options:"options",isEmpty:"isEmpty"},outputs:{addedCB:"addedCB",changeCB:"changeCB",disableCB:"disableCB",dragCB:"dragCB",dragStartCB:"dragStartCB",dragStopCB:"dragStopCB",droppedCB:"droppedCB",enableCB:"enableCB",removedCB:"removedCB",resizeCB:"resizeCB",resizeStartCB:"resizeStartCB",resizeStopCB:"resizeStopCB"},ngContentSelectors:Rz,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(a,t){a&1&&(x0(Dz),Nu(0,Oz,1,0,"ng-content",1)(1,Nz,0,0,"ng-template",null,0,e_),m0(3)),a&2&&Q("ngIf",t.isEmpty)},dependencies:[Yk],styles:["[_nghost-%COMP%]{display:block}"]}),e})();function Pz(e,a,t,i){if(t){if(!e)return;if(i){let o=e.parentElement?._gridItemComp;if(!o)return;let r=(o.childWidget?.container||o.container)?.createComponent(R8),n=r?.instance;return n?(n.ref=r,n.options=a,n.el):void 0}else{let o=e._gridComp?.container?.createComponent(Q9),r=o?.instance;if(!r)return;r.ref=o;let n=a.component,s=n?R8.componentMap[n]:void 0;if(s){let c=()=>{let l=r.container?.createComponent(s),d=l?.instance;d&&typeof d.serialize=="function"&&typeof d.deserialize=="function"&&(r.childWidget=d,d._compRef=l,d.deserialize(a))};a.lazyLoad||a.grid?.opts?.lazyLoad&&a.lazyLoad!==!1?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([l])=>{l.isIntersecting&&(a.visibleObservable?.disconnect(),delete a.visibleObservable,c(),a.grid?.refreshDragHandles(r.el))}),window.setTimeout(()=>a.visibleObservable?.observe(r.el))):(c(),a.grid?.refreshDragHandles(r.el))}return r.el}}else if(i){let o=a.el?._gridComp;o?.ref?o.ref.destroy():o?.ngOnDestroy()}else{let o=a.el?._gridItemComp;o?.ref?o.ref.destroy():o?.ngOnDestroy()}}function Fz(e,a){let t=e.el?._gridItemComp;if(t){let o=t.childWidget?.serialize();o&&(a.props=o);return}let i=e.el?._gridComp}function Uz(e){let a=e,t=e.el?._gridItemComp;t?.childWidget&&a.props&&t.childWidget.deserialize(a)}var qz={unsavedChanges:"Nicht gespeicherte \xC4nderungen",editCards:"Karten bearbeiten",editView:"Ansicht bearbeiten",actions:"Aktionen",save:"Speichern",cancel:"Abbrechen",discard:"Verwerfen",discardChanges:"\xC4nderungen verwerfen",discardConfirmBody:"\xC4nderungen verwerfen? Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",unsavedNavBody:"Sie verlassen diese Seite. Speichern oder verwerfen Sie die \xC4nderungen, um fortzufahren. Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",noCardsAvailable:"Keine Karten verf\xFCgbar.",removeSection:"Bereich entfernen",removeCard:"Karte entfernen",resizable:"Gr\xF6\xDFenver\xE4nderbar"},jz={unsavedChanges:"Unsaved Changes",editCards:"Edit Cards",editView:"Edit View",actions:"Actions",save:"Save",cancel:"Cancel",discard:"Discard",discardChanges:"Discard Changes",discardConfirmBody:"Discard the changes? This action cannot be undone.",unsavedNavBody:"You are leaving this page. Save or discard the changes to proceed. This action cannot be undone.",noCardsAvailable:"No cards available.",removeSection:"Remove section",removeCard:"Remove card",resizable:"Resizable"},Z2={UNSAVED_CHANGES:"unsavedChanges",EDIT_CARDS:"editCards",EDIT_VIEW:"editView",ACTIONS:"actions",SAVE:"save",CANCEL:"cancel",DISCARD:"discard",DISCARD_CHANGES:"discardChanges",DISCARD_CONFIRM_BODY:"discardConfirmBody",UNSAVED_NAV_BODY:"unsavedNavBody",NO_CARDS_AVAILABLE:"noCardsAvailable",REMOVE_SECTION:"removeSection",REMOVE_CARD:"removeCard",RESIZABLE:"resizable"},Gz={en:jz,de:qz},_7=class Nt{language=o5("en");getTranslation(a){return Gz[this.language()][a]??a}static \u0275fac=function(a){return new(a||Nt)};static \u0275prov=T1({token:Nt,factory:Nt.\u0275fac})},$a={WC:"wc",ANGULAR:"angular",SAP_UI:"sap-ui"},Wz=/^[a-z](?:[a-z0-9-]*)$/,O8=new Map;function $z(e){for(let a of e){let t=n_(a);if(!t)throw new Error(`Dashboard card registration failed: "${B_(a)}" is not an Angular component.`);if(!lC(a))throw new Error(`Dashboard card registration failed: "${t.selector}" must be a standalone Angular component.`);let i=Qz(t.selector,a),o=O8.get(i);if(o&&o.componentType!==a)throw new Error(`Dashboard card registration failed: selector "${i}" is already registered.`);O8.set(i,{componentType:a,selector:i,inputs:Yz(t.inputs)})}}function Kz(e){return O8.get(e)}function Xz(e,a){Lk()&&console.warn(`Dashboard card "${e}" ignores unknown Angular input "${a}".`)}function Yz(e){let a=new Map;for(let t of e)a.set(t.templateName,t.templateName),a.set(t.propName,t.templateName);return a}function Qz(e,a){let t=e.trim();if(!Wz.test(t))throw new Error(`Dashboard card registration failed: "${B_(a)}" must use a single element selector. Received "${e}".`);return t}function B_(e){return e.name.replace(/^_+/,"")||"AnonymousComponent"}function Jz(e,a,t){let i=Kz(e.component);if(!i){console.warn(`[DashboardCard] Angular component "${e.component}" is not registered`);return}let o=a.createComponent(i.componentType);for(let[r,n]of Object.entries(e.componentInputs??{})){let s=i.inputs.get(r);if(!s){Xz(e.component,r);continue}o.setInput(s,n)}o.changeDetectorRef.detectChanges(),t(()=>{a.clear()})}function eD(e,a,t){let i=a.element.nativeElement,o=null,r=!1,n=window.sap?.ui?.require;n?n(["sap/ui/core/ComponentContainer"],s=>{if(r)return;let c=new s({name:e.component,manifest:!0,async:!0,settings:e.componentInputs??{}});c.placeAt(i),o=c}):console.error("[DashboardCard] SAP UI5 is not available on window.sap"),t(()=>{r=!0,o?.destroy(),i.innerHTML=""})}function tD(e,a,t,i){let o=a.element.nativeElement,r=i.createElement(e.component);for(let[n,s]of Object.entries(e.componentInputs??{}))i.setProperty(r,n,s);i.appendChild(o,r),t(()=>{o.innerHTML=""})}var aD=["elementHost"],iD=["*"];function oD(e,a){if(e&1){let t=W0();V(0,"div",5)(1,"ui5-button",6),o1("click",function(){j1(t);let i=O(2);return G1(i.removeCard.emit())}),z()(),x5(2,"ui5-icon",7)}if(e&2){let t=O(2);B(),Q("accessibleName",t.i18n.getTranslation(t.i18nKeys.REMOVE_CARD)+": "+(t.card().label||t.card().component)),c5("data-testid","dashboard-card-"+t.card().id+"-remove"),B(),Q("accessibleName",t.i18n.getTranslation(t.i18nKeys.RESIZABLE))}}function rD(e,a){if(e&1&&(V(0,"div",3),A0(1,oD,3,3),V(2,"div",4),x5(3,"div",null,0),z()()),e&2){let t=O();G9("component-card--editing",t.editMode()),c5("data-testid","dashboard-card-"+t.card().id),B(),w0(t.editMode()?1:-1),B(),d7("pointer-events",t.editMode()?"none":"auto")}}function nD(e,a){if(e&1&&(V(0,"div",2)(1,"div",8),m0(2),z()()),e&2){let t=O();c5("data-testid","dashboard-card-"+t.card().id),B(),d7("pointer-events",t.editMode()?"none":"auto")}}var k_=class N8{card=b.required();editMode=b(!1);removeCard=R();i18n=x(_7);i18nKeys=Z2;gridColumn=P0(()=>{let a=this.card().w??12;return this.createGridTrack(this.card().x,a)});gridRow=P0(()=>{let a=this.card().h??100;return this.createGridTrack(this.card().y,a)});host=k8("elementHost",{read:B2});renderer=x(fH);mountCfg=P0(()=>{let a=this.card();return{type:a.type,component:a.component,componentInputs:a.componentInputs}},{equal:(a,t)=>a.type===t.type&&a.component===t.component&&JSON.stringify(a.componentInputs)===JSON.stringify(t.componentInputs)});constructor(){Z0(a=>{let t=this.host(),i=this.mountCfg();if(!(!t||!i.component))switch(t.clear(),t.element.nativeElement.innerHTML="",i.type){case $a.SAP_UI:eD(i,t,a);break;case $a.ANGULAR:Jz(i,t,a);break;case $a.WC:default:tD(i,t,a,this.renderer);break}})}createGridTrack(a,t){return a===void 0?`span ${t}`:`${a+1} / span ${t}`}static \u0275fac=function(a){return new(a||N8)};static \u0275cmp=X1({type:N8,selectors:[["mfp-dashboard-card"]],viewQuery:function(a,t){a&1&&j9(t.host,aD,5,B2),a&2&&Ku()},hostVars:4,hostBindings:function(a,t){a&2&&d7("grid-column",t.gridColumn())("grid-row",t.gridRow())},inputs:{card:[1,"card"],editMode:[1,"editMode"]},outputs:{removeCard:"removeCard"},ngContentSelectors:iD,decls:2,vars:1,consts:[["elementHost",""],[1,"component-card",3,"component-card--editing"],[1,"card"],[1,"component-card"],[1,"component-host"],[1,"remove-wrapper"],["design","Default","icon","decline",1,"card__remove",3,"click","accessibleName"],["aria-hidden","true","name","resize-corner",1,"card__resize-indicator",3,"accessibleName"],[1,"card__body"]],template:function(a,t){a&1&&(x0(),A0(0,rD,5,6,"div",1)(1,nD,3,3,"div",2)),a&2&&w0(t.card().component?0:1)},dependencies:[ve,m_],styles:["[_nghost-%COMP%]{display:block;min-width:0;min-height:0;overflow:visible}.card__remove[_ngcontent-%COMP%]{position:absolute;top:0;right:-.5rem;z-index:10;border-radius:50%!important;width:1.25rem!important;height:1.25rem!important;min-width:unset!important;padding:0!important;font-size:.625rem!important}.remove-wrapper[_ngcontent-%COMP%]{position:sticky;height:.5rem;top:0;right:0;z-index:10}.component-card[_ngcontent-%COMP%]{position:relative;height:100%;overflow:visible;isolation:isolate;padding-inline-start:var(--mfp_cardContainerPadding, 10px);padding-inline-end:var(--mfp_cardContainerPadding, 10px)}.component-card--editing[_ngcontent-%COMP%]{cursor:grab}.component-card--editing[_ngcontent-%COMP%]:hover{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.component-card--editing[_ngcontent-%COMP%]:hover .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{cursor:grabbing!important}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.component-host[_ngcontent-%COMP%]{position:relative;height:100%}.card__resize-indicator[_ngcontent-%COMP%]{position:absolute;right:calc(var(--mfp_cardContainerPadding, 10px) + 4px);bottom:4px;width:1rem;height:1rem;pointer-events:none;opacity:0;transition:opacity .12s ease-out;color:var(--sapHighlightColor, #0070f2);z-index:9}.card[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;border:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);border-radius:.5rem;background:var(--sapBackgroundColor, #fff);overflow:visible}.card__header[_ngcontent-%COMP%]{padding:.75rem 1rem;font-weight:600;border-bottom:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);background:var(--sapGroup_TitleBackground, #f5f5f5)}.card__body[_ngcontent-%COMP%]{flex:1;padding:1rem;overflow:auto}"]})},sD=[{w:4e3,c:14,layout:"compact"},{w:1439,c:12,layout:"compact"},{w:1023,c:8,layout:"compact"},{w:599,c:1,layout:"list"}],cD=class P8{i18n=x(_7);i18nKeys=Z2;open=b(!1);confirm=R();cancelled=R();static \u0275fac=function(a){return new(a||P8)};static \u0275cmp=X1({type:P8,selectors:[["mfp-discard-changes-dialog"]],inputs:{open:[1,"open"]},outputs:{confirm:"confirm",cancelled:"cancelled"},decls:11,vars:5,consts:[["data-testid","dashboard-discard-changes-dialog","state","Critical",3,"ui5BeforeClose","open"],["slot","header",1,"discard-changes-dialog__header"],["level","H5"],[1,"discard-changes-dialog__body"],["slot","footer",1,"discard-changes-dialog__footer"],["data-testid","dashboard-discard-changes-confirm-btn","design","Emphasized",3,"click"],["data-testid","dashboard-discard-changes-cancel-btn","design","Transparent",3,"click"]],template:function(a,t){a&1&&(V(0,"ui5-dialog",0),o1("ui5BeforeClose",function(){return t.cancelled.emit()}),V(1,"div",1)(2,"ui5-title",2),A1(3),z()(),V(4,"div",3),A1(5),z(),V(6,"div",4)(7,"ui5-button",5),o1("click",function(){return t.confirm.emit()}),A1(8),z(),V(9,"ui5-button",6),o1("click",function(){return t.cancelled.emit()}),A1(10),z()()()),a&2&&(Q("open",t.open()),B(3),B1(t.i18n.getTranslation(t.i18nKeys.DISCARD_CHANGES)),B(2),k3(" ",t.i18n.getTranslation(t.i18nKeys.DISCARD_CONFIRM_BODY)," "),B(3),B1(t.i18n.getTranslation(t.i18nKeys.DISCARD)),B(2),B1(t.i18n.getTranslation(t.i18nKeys.CANCEL)))},dependencies:[ve,X9,S4],styles:[`:host{display:contents}.discard-changes-dialog__header{display:flex;align-items:center;width:100%;padding:.75rem 0}.discard-changes-dialog__body{padding:0 0 1rem;min-width:320px}.discard-changes-dialog__footer{display:flex;justify-content:flex-end;align-items:center;width:100%;gap:.5rem}
|
|
134
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),o}static addGrid(t,i={}){if(!t)return null;let o=t;if(o.gridstack){let r=o.gridstack;return i&&(r.opts=Z(Z({},r.opts),i)),i.children!==void 0&&r.load(i.children),r}return(!t.classList.contains("grid-stack")||e.addRemoveCB)&&(e.addRemoveCB?o=e.addRemoveCB(t,i,!0,!0):o=f.createDiv(["grid-stack",i.class],t)),e.init(i,o)}static registerEngine(t){e.engineClass=t}get placeholder(){if(!this._placeholder){this._placeholder=f.createDiv([this.opts.placeholderClass,V0.itemClass,this.opts.itemClass]);let t=f.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(t.textContent=this.opts.placeholderText)}return this._placeholder}constructor(t,i={}){this.el=t,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},t.gridstack=this,this.opts=i=i||{},t.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);let o=f.toNumber(t.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);let r=i.columnOpts;if(r){let l=r.breakpoints;!r.columnWidth&&!l?.length?delete i.columnOpts:(r.columnMax=r.columnMax||12,l.length>1&&l.sort((d,h)=>(h.w||0)-(d.w||0)))}let n=F(Z({},f.cloneDeep(V0)),{column:f.toNumber(t.getAttribute("gs-column"))||V0.column,minRow:o||f.toNumber(t.getAttribute("gs-min-row"))||V0.minRow,maxRow:o||f.toNumber(t.getAttribute("gs-max-row"))||V0.maxRow,staticGrid:f.toBool(t.getAttribute("gs-static"))||V0.staticGrid,sizeToContent:f.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||V0.draggable.handle},removableOptions:{accept:i.itemClass||V0.removableOptions.accept,decline:V0.removableOptions.decline}});t.getAttribute("gs-animate")&&(n.animate=f.toBool(t.getAttribute("gs-animate"))),i=f.defaults(i,n),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=t.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");let s=this.el.closest("."+V0.itemClass)?.gridstackNode;if(s&&(s.subGrid=this,this.parentGridNode=s,this.el.classList.add("grid-stack-nested"),s.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==V0.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);let l=i.cellHeight;delete i.cellHeight,this.cellHeight(l)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=n5),this._setStaticClass();let c=i.engineClass||e.engineClass||bl;if(this.engine=new c({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:l=>{l.forEach(d=>{let h=d.el;h&&(d._removeDOM?(h&&h.remove(),delete d._removeDOM):this._writePosAttr(h,d))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(l=>this._prepareElement(l)),delete this.engine._loading,this.batchUpdate(!1)),i.children){let l=i.children;delete i.children,l.length&&this.load(l)}this.setAnimation(),i.subGridDynamic&&!H.pauseDrag&&(H.pauseDrag=!0),i.draggable?.pause!==void 0&&(H.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(t=this.opts){this.el.classList.add("gs-"+t.column),typeof t.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/t.column}%`)}addWidget(t){if(!t)return;if(typeof t=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(t.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(t);let i,o=t;if(o.grid=this,o.el?i=o.el:e.addRemoveCB?i=e.addRemoveCB(this.el,t,!0,!1):i=this.createWidgetDivs(o),!i)return;if(o=i.gridstackNode,o&&i.parentElement===this.el&&this.engine.nodes.find(n=>n._id===o._id))return i;let r=this._readAttr(i);return f.defaults(t,r),this.engine.prepareNode(t),this.el.appendChild(i),this.makeWidget(i,t),i}createWidgetDivs(t){let i=f.createDiv(["grid-stack-item",this.opts.itemClass]),o=f.createDiv(["grid-stack-item-content"],i);return f.lazyLoad(t)?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([r])=>{r.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,e.renderCB(o,t),t.grid?.prepareDragDrop(t.el))}),window.setTimeout(()=>t.visibleObservable?.observe(i))):e.renderCB(o,t),i}makeSubGrid(t,i,o,r=!0){let n=t.gridstackNode;if(n||(n=this.makeWidget(t).gridstackNode),n.subGrid?.el)return n.subGrid;let s,c=this;for(;c&&!s;)s=c.opts?.subGridOpts,c=c.parentGridNode?.grid;i=f.cloneDeep(Z(Z(F(Z({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),s||{}),i||n.subGridOpts||{})),n.subGridOpts=i;let l=!1;i.column==="auto"&&(l=!0,i.column=Math.max(n.w||1,o?.w||1),delete i.columnOpts);let d=n.el.querySelector(".grid-stack-item-content"),h,_;if(r&&(this._removeDD(n.el),_=F(Z({},n),{x:0,y:0}),f.removeInternalForSave(_),delete _.subGridOpts,n.content&&(_.content=n.content,delete n.content),e.addRemoveCB?h=e.addRemoveCB(this.el,_,!0,!1)||void 0:(h=f.createDiv(["grid-stack-item"]),h.appendChild(d),d=f.createDiv(["grid-stack-item-content"],n.el)),this.prepareDragDrop(n.el)),o){let m=l?i.column:n.w,A=n.h+o.h,C=n.el.style;C.transition="none",this.update(n.el,{w:m,h:A}),setTimeout(()=>C.transition="")}let u=n.subGrid=e.addGrid(d,i)||void 0;return o?._moving&&(u._isTemp=!0),l&&(u._autoColumn=!0),r&&u.makeWidget(h,_),o&&(o._moving?window.setTimeout(()=>f.simulateMouseEvent(o._event,"mouseenter",u.el),0):u.makeWidget(n.el,n)),this.resizeToContentCheck(!1,n),u}removeAsSubGrid(t){let i=this.parentGridNode?.grid;if(i&&(i.batchUpdate(),i.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(o=>{o.x=(o.x??0)+(this.parentGridNode.x??0),o.y=(o.y??0)+(this.parentGridNode.y??0),this._removeDD(o.el),o.el.remove(),delete o.el.gridstackNode,i.makeWidget(o.el,o)}),i.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,t)){let o=t.el?.gridstackNode;o&&o!==t&&(o._temporaryRemoved=!0),window.setTimeout(()=>{let r=H.dragElement?.lastDrag||t._event;r&&f.simulateMouseEvent(r,"mouseenter",i.el)},0)}}save(t=!0,i=!1,o=e.saveCB,r){let n=this.engine.save(t,o,r);if(n.forEach(s=>{if(t&&s.el&&!s.subGrid&&!o){let c=s.el.querySelector(".grid-stack-item-content");s.content=c?.innerHTML,s.content||delete s.content}else if(!t&&!o&&delete s.content,s.subGrid?.el){let c=s.w||s.subGrid.getColumn(),l=s.subGrid.save(t,i,o,c);s.subGridOpts=i?l:{children:l},delete s.subGrid}delete s.el}),i){let s=f.cloneDeep(this.opts);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===(this.el.style.direction==="rtl")&&(s.rtl="auto"),this._isAutoCellHeight&&(s.cellHeight="auto"),this._autoColumn&&(s.column="auto");let c=s._alwaysShowResizeHandle;return delete s._alwaysShowResizeHandle,c!==void 0?s.alwaysShowResizeHandle=c:delete s.alwaysShowResizeHandle,f.removeInternalAndSame(s,V0),s.children=n,s}return n}load(t,i=e.addRemoveCB||!0){t.forEach(h=>{h.w=h.w||h.minW||1,h.h=h.h||h.minH||1}),t=f.sort(t),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let o=0;t.forEach(h=>{o=Math.max(o,(h.x||0)+h.w)}),o>this.engine.defaultColumn&&(this.engine.defaultColumn=o);let r=this.getColumn();o>r&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=t,this.engine.columnChanged(o,r,this.responseLayout),t=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(t,o,!0));let n=e.addRemoveCB;typeof i=="function"&&(e.addRemoveCB=i);let s=[];this.batchUpdate();let c=!this.engine.nodes.length,l=c&&this.opts.animate;l&&this.setAnimation(!1),!c&&i&&[...this.engine.nodes].forEach(h=>{h.id&&(f.find(t,h.id)||(e.addRemoveCB&&e.addRemoveCB(this.el,h,!1,!1),s.push(h),this.removeWidget(h.el,!0,!1)))}),this.engine._loading=!0;let d=[];return this.engine.nodes=this.engine.nodes.filter(h=>h.id&&f.find(t,h.id)?(d.push(h),!1):!0),t.forEach(h=>{let _=h.id?f.find(d,h.id):void 0;if(_){if(f.shouldSizeToContent(_)&&(h.h=_.h),this.engine.nodeBoundFix(h),(h.autoPosition||h.x===void 0||h.y===void 0)&&(h.w=h.w||_.w,h.h=h.h||_.h,this.engine.findEmptyPosition(h)),this.engine.nodes.push(_),f.samePos(_,h)&&this.engine.nodes.length>1&&(this.moveNode(_,F(Z({},h),{forceCollide:!0})),f.copyPos(h,_)),this.update(_.el,h),h.subGridOpts?.children){let u=_.el.querySelector(".grid-stack");u&&u.gridstack&&u.gridstack.load(h.subGridOpts.children)}}else i&&this.addWidget(h)}),delete this.engine._loading,this.engine.removedNodes=s,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,n?e.addRemoveCB=n:delete e.addRemoveCB,l&&this.setAnimation(!0,!0),this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!t||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let i=this.el.querySelector("."+this.opts.itemClass);if(i){let r=f.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/r)}let o=parseInt(this.el.getAttribute("gs-current-row")||"0");return o?Math.round(this.el.getBoundingClientRect().height/o):this.opts.cellHeight}cellHeight(t){if(t!==void 0&&this._isAutoCellHeight!==(t==="auto")&&(this._isAutoCellHeight=t==="auto",this._updateResizeEvent()),(t==="initial"||t==="auto")&&(t=void 0),t===void 0){let o=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+o}let i=f.parseHeight(t);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(t=!1){return t&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let t=this.opts.columnOpts;if(!t||!t.columnWidth&&!t.breakpoints?.length)return!1;let i=this.getColumn(),o=i,r=this._widthOrContainer(!0);if(t.columnWidth)o=Math.min(Math.round(r/t.columnWidth)||1,t.columnMax);else{o=t.columnMax;let n=0;for(;n<t.breakpoints.length&&r<=t.breakpoints[n].w;)o=t.breakpoints[n++].c||i}if(o!==i){let n=t.breakpoints?.find(s=>s.c===o);return this.column(o,n?.layout||t.layout),!0}return!1}compact(t="compact",i=!0){return this.engine.compact(t,i),this._triggerChangeEvent(),this}column(t,i="moveScale"){if(!t||t<1||this.opts.column===t)return this;let o=this.getColumn();return this.opts.column=t,this.engine?(this.engine.column=t,this.el.classList.remove("gs-"+o),this._updateColumnVar(),this.engine.columnChanged(o,t,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,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))}isIgnoreChangeCB(){return!!this._ignoreLayoutsNodeChange}destroy(t=!0){return this.el?(this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this):this}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,i=!1){let o=this.el.getBoundingClientRect(),r;i?r={top:o.top+document.documentElement.scrollTop,left:o.left}:r={top:this.el.offsetTop,left:this.el.offsetLeft};let n=t.left-r.left,s=t.top-r.top,c=o.width/this.getColumn(),l=o.height/parseInt(this.el.getAttribute("gs-current-row")||"0");return{x:Math.floor(n/c),y:Math.floor(s/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(t,i,o,r){return this.engine.isAreaEmpty(t,i,o,r)}makeWidget(t,i){let o=e.getElement(t);if(!o||o.gridstackNode)return o;o.parentElement||this.el.appendChild(o),this._prepareElement(o,!0,i);let r=o.gridstackNode;this._updateContainerHeight(),r.subGridOpts&&this.makeSubGrid(o,r.subGridOpts,void 0,!1);let n=!1;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(n=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),n&&delete this._ignoreLayoutsNodeChange,o}on(t,i){return t.indexOf(" ")!==-1?(t.split(" ").forEach(o=>this.on(o,i)),this):(t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable"?(t==="enable"||t==="disable"?this._gsEventHandler[t]=o=>i(o):this._gsEventHandler[t]=o=>{o.detail&&i(o,o.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):t==="drag"||t==="dragstart"||t==="dragstop"||t==="resizestart"||t==="resize"||t==="resizestop"||t==="dropped"||t==="resizecontent"?this._gsEventHandler[t]=i:console.error("GridStack.on("+t+") event not supported"),this)}off(t){return t.indexOf(" ")!==-1?(t.split(" ").forEach(i=>this.off(i)),this):((t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable")&&this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(t=>this.off(t)),this}removeWidget(t,i=!0,o=!0){return t?(e.getElements(t).forEach(r=>{if(r.parentElement&&r.parentElement!==this.el)return;let n=r.gridstackNode;n||(n=this.engine.nodes.find(s=>r===s.el)),n&&(i&&e.addRemoveCB&&e.addRemoveCB(this.el,n,!1,!1),delete r.gridstackNode,this._removeDD(r),this.engine.removeNode(n,i,o),i&&r.parentElement&&r.remove())}),o&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(t=!0,i=!0){return this.engine.nodes.forEach(o=>{t&&e.addRemoveCB&&e.addRemoveCB(this.el,o,!1,!1),delete o.el.gridstackNode,this.opts.staticGrid||this._removeDD(o.el)}),this.engine.removeAll(t,i),i&&this._triggerRemoveEvent(),this}setAnimation(t=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(t)}):t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=t,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(t,i=!0,o=!0){return!!this.opts.staticGrid===t?this:(t?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&o&&r.subGrid.setStatic(t,i,o)}),i&&this._setStaticClass(),this)}updateOptions(t){let i=this.opts;if(t===i)return this;if(t.acceptWidgets!==void 0&&(i.acceptWidgets=t.acceptWidgets,this._setupAcceptWidget()),t.animate!==void 0&&this.setAnimation(t.animate),t.cellHeight&&this.cellHeight(t.cellHeight),t.class!==void 0&&t.class!==i.class&&(i.class&&this.el.classList.remove(i.class),t.class&&this.el.classList.add(t.class)),t.columnOpts){let o=!!this.opts.columnOpts;this.opts.columnOpts=t.columnOpts,o!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else t.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof t.column=="number"&&this.column(t.column);return t.margin!==void 0&&this.margin(t.margin),t.staticGrid!==void 0&&this.setStatic(t.staticGrid),t.disableDrag!==void 0&&!t.staticGrid&&this.enableMove(!t.disableDrag),t.disableResize!==void 0&&!t.staticGrid&&this.enableResize(!t.disableResize),t.float!==void 0&&this.float(t.float),t.row!==void 0?(i.minRow=i.maxRow=this.engine.maxRow=i.row=t.row,this._updateContainerHeight(),this.engine.getRow()>t.row&&this.compact()):(t.minRow!==void 0&&(i.minRow=t.minRow,this._updateContainerHeight()),t.maxRow!==void 0&&(i.maxRow=this.engine.maxRow=t.maxRow,this.engine.getRow()>t.maxRow&&this.compact())),t.lazyLoad!==void 0&&(i.lazyLoad=t.lazyLoad),t.children?.length&&this.load(t.children),this}update(t,i){return e.getElements(t).forEach(o=>{let r=o?.gridstackNode;if(!r)return;let n=Z(Z({},f.copyPos({},r)),f.cloneDeep(i));this.engine.nodeBoundFix(n),delete n.autoPosition;let s=["x","y","w","h"],c,l=n,d=r;if(s.some(u=>l[u]!==void 0&&l[u]!==d[u])){c={};let u=c;s.forEach(m=>{u[m]=l[m]!==void 0?l[m]:d[m],delete l[m]})}if(!c&&(n.minW||n.minH||n.maxW||n.maxH)&&(c={}),n.content!==void 0){let u=o.querySelector(".grid-stack-item-content");u&&u.textContent!==n.content&&(r.content=n.content,e.renderCB(u,n),r.subGrid?.el&&(u.appendChild(r.subGrid.el),r.subGrid._updateContainerHeight())),delete n.content}let h=!1,_=!1;for(let u in l)u[0]!=="_"&&d[u]!==l[u]&&(d[u]=l[u],h=!0,_=_||!this.opts.staticGrid&&(u==="noResize"||u==="noMove"||u==="locked"));if(f.sanitizeMinMax(r),c){let u=c.w!==void 0&&c.w!==r.w;this.moveNode(r,c),u&&r.subGrid?r.subGrid.onResize(this.hasAnimationCSS()?r.w:void 0):this.resizeToContentCheck(u,r),delete r._orig}(c||h)&&this._writeAttr(o,r),_&&this.prepareDragDrop(r.el),e.updateCB&&e.updateCB(r)}),this}moveNode(t,i){let o=t._updating;o||this.engine.cleanNodes().beginUpdate(t),this.engine.moveNode(t,i),this._updateContainerHeight(),o||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(t){if(!t||(t.classList.remove("size-to-content-max"),!t.clientHeight))return;let i=t.gridstackNode;if(!i)return;let o=i.grid;if(!o||t.parentElement!==o.el)return;let r=o.getCellHeight(!0);if(!r)return;let n=i.h?i.h*r:t.clientHeight,s=null;if(i.resizeToContentParent&&(s=t.querySelector(i.resizeToContentParent)),s||(s=t.querySelector(e.resizeToContentParent)),!s)return;let c=t.clientHeight-s.clientHeight,l=i.h?i.h*r-c:s.clientHeight,d;if(i.subGrid){d=i.subGrid.getRow()*i.subGrid.getCellHeight(!0);let u=i.subGrid.el.getBoundingClientRect(),m=t.getBoundingClientRect();d+=u.top-m.top}else{if(i.subGridOpts?.children?.length)return;{let u=s.firstElementChild;if(!u){console.error(`Error: GridStack.resizeToContent() widget id:${i.id} '${e.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}d=u.getBoundingClientRect().height||l}}if(l===d)return;n+=d-l;let h=Math.ceil(n/r),_=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;_&&h>_&&(h=_,t.classList.add("size-to-content-max")),i.minH&&h<i.minH?h=i.minH:i.maxH&&h>i.maxH&&(h=i.maxH),h!==i.h&&(o._ignoreLayoutsNodeChange=!0,o.moveNode(i,{h}),delete o._ignoreLayoutsNodeChange)}resizeToContentCBCheck(t){e.resizeToContentCB?e.resizeToContentCB(t):this.resizeToContent(t)}rotate(t,i){return e.getElements(t).forEach(o=>{let r=o.gridstackNode;if(!r||!f.canBeRotated(r))return;let n={w:r.h,h:r.w,minH:r.minW,minW:r.minH,maxH:r.maxW,maxW:r.maxH};if(i){let l=i.left>0?Math.floor(i.left/this.cellWidth()):0,d=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;n.x=r.x+l-(r.h-(d+1)),n.y=r.y+d-l}let s=n;Object.keys(s).forEach(l=>{s[l]===void 0&&delete s[l]});let c=r._orig;this.update(o,n),r._orig=c}),this}margin(t){if(!(typeof t=="string"&&t.split(" ").length>1)){let i=f.parseHeight(t);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return this}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(t){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(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});let t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(t,i){let o=i?new CustomEvent(t,{bubbles:!1,detail:i}):new Event(t),r=this;for(;r.parentGridNode;)r=r.parentGridNode.grid;return r.el.dispatchEvent(o),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.parentGridNode,i=this.getRow()+this._extraDragRow,o=this.opts.cellHeight,r=this.opts.cellHeightUnit;if(!o)return this;if(!t&&!this.opts.minRow){let n=f.parseHeight(getComputedStyle(this.el).minHeight);if(n.h>0&&n.unit===r){let s=Math.floor(n.h/o);i<s&&(i=s)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[t?"minHeight":"height"]=i*o+r),t&&f.shouldSizeToContent(t)&&t.grid.resizeToContentCBCheck(t.el),this}_prepareElement(t,i=!1,o){o=o||this._readAttr(t),t.gridstackNode=o,o.el=t,o.grid=this,o=this.engine.addNode(o,i),this._writeAttr(t,o),t.classList.add(V0.itemClass,this.opts.itemClass);let r=f.shouldSizeToContent(o);return r?t.classList.add("size-to-content"):t.classList.remove("size-to-content"),r&&this.resizeToContentCheck(!1,o),(!f.lazyLoad(o)||!o.visibleObservable)&&this.prepareDragDrop(o.el),this}_writePosAttr(t,i){if(!i._moving&&!i._resizing||this._placeholder===t){let o=this.opts.rtl?"right":"left",r=t.style;r.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,r[o]=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,r.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,r.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null}return t.setAttribute("gs-x",String(i.x??0)),t.setAttribute("gs-y",String(i.y??0)),i.w>1?t.setAttribute("gs-w",String(i.w)):t.removeAttribute("gs-w"),i.h>1?t.setAttribute("gs-h",String(i.h)):t.removeAttribute("gs-h"),this}_writeAttr(t,i){if(!i)return this;this._writePosAttr(t,i);let o={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"},r=i,n=o;for(let s in n)r[s]?t.setAttribute(n[s],String(r[s])):t.removeAttribute(n[s]);return this}_readAttr(t,i=!0){let o={};o.x=f.toNumber(t.getAttribute("gs-x")),o.y=f.toNumber(t.getAttribute("gs-y")),o.w=f.toNumber(t.getAttribute("gs-w")),o.h=f.toNumber(t.getAttribute("gs-h")),o.autoPosition=f.toBool(t.getAttribute("gs-auto-position")),o.noResize=f.toBool(t.getAttribute("gs-no-resize")),o.noMove=f.toBool(t.getAttribute("gs-no-move")),o.locked=f.toBool(t.getAttribute("gs-locked"));let r=t.getAttribute("gs-size-to-content");r&&(r==="true"||r==="false"?o.sizeToContent=f.toBool(r):o.sizeToContent=parseInt(r,10)),o.id=t.getAttribute("gs-id")??void 0,o.maxW=f.toNumber(t.getAttribute("gs-max-w")),o.minW=f.toNumber(t.getAttribute("gs-min-w")),o.maxH=f.toNumber(t.getAttribute("gs-max-h")),o.minH=f.toNumber(t.getAttribute("gs-min-h")),i&&(o.w===1&&t.removeAttribute("gs-w"),o.h===1&&t.removeAttribute("gs-h"),o.maxW&&t.removeAttribute("gs-max-w"),o.minW&&t.removeAttribute("gs-min-w"),o.maxH&&t.removeAttribute("gs-max-h"),o.minH&&t.removeAttribute("gs-min-h"));let n=o;for(let s in n)o.hasOwnProperty(s)&&!n[s]&&n[s]!==0&&s!=="sizeToContent"&&delete n[s];return o}_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}onResize(t=this.el?.clientWidth){if(!t)return this;if(this.prevWidth===t)return this;this.prevWidth=t,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(o=>{o.subGrid&&o.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(t=!1,i){if(!this.engine)return;if(t&&this.hasAnimationCSS()){setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);return}if(i)f.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(r=>f.shouldSizeToContent(r))){let r=[...this.engine.nodes];this.batchUpdate(),r.forEach(n=>{f.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}let o=this._gsEventHandler.resizecontent;o&&o(new Event("resizecontent"),i?[i]:this.engine.nodes)}_updateResizeEvent(t=!1){let i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(o=>o.sizeToContent));return!t&&i&&!this.resizeObserver?(this._sizeThrottle=f.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(t||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(t=".grid-stack-item"){return f.getElement(t)}static getElements(t=".grid-stack-item"){return f.getElements(t)}static getGridElement(t){return e.getElement(t)}static getGridElements(t){return f.getElements(t)}_initMargin(){let t={h:0,unit:"px"},i=0,o=[];typeof this.opts.margin=="string"&&(o=this.opts.margin.split(" ")),o.length===2?(this.opts.marginTop=this.opts.marginBottom=o[0],this.opts.marginLeft=this.opts.marginRight=o[1]):o.length===4?(this.opts.marginTop=o[0],this.opts.marginRight=o[1],this.opts.marginBottom=o[2],this.opts.marginLeft=o[3]):(t=f.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,i=this.opts.margin=t.h);let r=["marginTop","marginRight","marginBottom","marginLeft"],n=this.opts;r.forEach(c=>{n[c]===void 0?n[c]=i:(t=f.parseHeight(n[c]),n[c]=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);let s=this.el.style;return s.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),s.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),s.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),s.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return v0}static setupDragIn(t,i,o,r=document){i?.pause!==void 0&&(H.pauseDrag=i.pause),i=Z({appendTo:"body",helper:"clone"},i||{}),(typeof t=="string"?f.getElements(t,r):t).forEach((n,s)=>{v0.isDraggable(n)||v0.dragIn(n,i),o?.[s]&&(n.gridstackNode=o[s])})}movable(t,i){return this.opts.staticGrid?this:(e.getElements(t).forEach(o=>{let r=o.gridstackNode;r&&(i?delete r.noMove:r.noMove=!0,this.prepareDragDrop(r.el))}),this)}resizable(t,i){return this.opts.staticGrid?this:(e.getElements(t).forEach(o=>{let r=o.gridstackNode;r&&(i?delete r.noResize:r.noResize=!0,this.prepareDragDrop(r.el))}),this)}disable(t=!0){return this.opts.staticGrid?this:(this.enableMove(!1,t),this.enableResize(!1,t),this._triggerEvent("disable"),this)}enable(t=!0){return this.opts.staticGrid?this:(this.enableMove(!0,t),this.enableResize(!0,t),this._triggerEvent("enable"),this)}enableMove(t,i=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&i&&o.subGrid.enableMove(t,i)}),this)}enableResize(t,i=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(o=>{this.prepareDragDrop(o.el),o.subGrid&&i&&o.subGrid.enableResize(t,i)}),this)}cancelDrag(){let t=H.dragElement?.el;if(t?._gridstackNodeOrig){let o=t._gridstackNodeOrig,r=o.grid,n=this._placeholder?.gridstackNode;n&&(n._isAboutToRemove=!0,this.engine.removeNode(n)),this.engine.restoreInitial(),t.gridstackNode=o,delete t._gridstackNodeOrig,delete H.dropElement,r&&(r.engine.addNode(o,!1),r.engine.restoreInitial());return}let i=this._placeholder?.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&e._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(t){return v0.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return v0.droppable(this.el,"destroy"),this;let t,i,o=(r,n,s)=>{s=s||n;let c=s.gridstackNode;if(!c)return;if(!c.grid?.el){s.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let u=s.getBoundingClientRect();s.style.left=u.x+(this.dragTransform.xScale-1)*(r.clientX-u.x)/this.dragTransform.xScale+"px",s.style.top=u.y+(this.dragTransform.yScale-1)*(r.clientY-u.y)/this.dragTransform.yScale+"px",s.style.transformOrigin="0px 0px"}let{top:l,left:d}=s.getBoundingClientRect(),h=this.el.getBoundingClientRect();d-=h.left,l-=h.top;let _={position:{top:l*this.dragTransform.xScale,left:d*this.dragTransform.yScale}};if(c._temporaryRemoved){if(c.x=Math.max(0,Math.round(d/i)),c.y=Math.max(0,Math.round(l/t)),delete c.autoPosition,this.engine.nodeBoundFix(c),!this.engine.willItFit(c)){if(c.autoPosition=!0,!this.engine.willItFit(c)){v0.off(n,"drag");return}c._willFitPos&&(f.copyPos(c,c._willFitPos),delete c._willFitPos)}this._onStartMoving(s,r,_,c,i,t)}else this._dragOrResize(s,r,_,c,i,t)};return v0.droppable(this.el,{accept:r=>{let n=r.gridstackNode||this._readAttr(r,!1);if(n?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let s=!0;if(typeof this.opts.acceptWidgets=="function")s=this.opts.acceptWidgets(r);else{let c=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;s=r.matches(c)}if(s&&n&&this.opts.maxRow){let c={w:n.w,h:n.h,minW:n.minW,minH:n.minH};s=this.engine.willItFit(c)}return s}}).on(this.el,"dropover",(r,n,s)=>{let c=s?.gridstackNode||n.gridstackNode;if(c?.grid===this&&!c._temporaryRemoved)return!1;if(c?._sidebarOrig&&(c.w=c._sidebarOrig.w,c.h=c._sidebarOrig.h),c?.grid&&c.grid!==this&&!c._temporaryRemoved&&c.grid._leave(n,s),s=s||n,i=this.cellWidth(),t=this.getCellHeight(!0),!c){let h=s.getAttribute("data-gs-widget")||s.getAttribute("gridstacknode");if(h){try{c=JSON.parse(h)}catch{console.error("Gridstack dropover: Bad JSON format: ",h)}s.removeAttribute("data-gs-widget"),s.removeAttribute("gridstacknode")}c||(c=this._readAttr(s)),c._sidebarOrig={w:c.w,h:c.h}}c.grid||(c.el||(c=Z({},c)),c._isExternal=!0,s.gridstackNode=c);let l=c.w||Math.round(s.offsetWidth/i)||1,d=c.h||Math.round(s.offsetHeight/t)||1;return c.grid&&c.grid!==this?(n._gridstackNodeOrig||(n._gridstackNodeOrig=c),n.gridstackNode=c=F(Z({},c),{w:l,h:d,grid:this}),delete c.x,delete c.y,this.engine.cleanupNode(c).nodeBoundFix(c),c._initDD=c._isExternal=c._temporaryRemoved=!0):(c.w=l,c.h=d,c._temporaryRemoved=!0),e._itemRemoving(c.el,!1),v0.on(n,"drag",o),o(r,n,s),!1}).on(this.el,"dropout",(r,n,s)=>{let c=s?.gridstackNode||n.gridstackNode;return c&&(!c.grid||c.grid===this)&&(this._leave(n,s),this._isTemp&&this.removeAsSubGrid(c)),!1}).on(this.el,"drop",(r,n,s)=>{let c=s?.gridstackNode||n.gridstackNode;if(c?.grid===this&&!c._isExternal)return!1;let l=!!this.placeholder.parentElement,d=n!==s;this.placeholder.remove(),delete this.placeholder.gridstackNode,l&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let h=n._gridstackNodeOrig;if(delete n._gridstackNodeOrig,l&&h?.grid&&h.grid!==this){let u=h.grid;u.engine.removeNodeFromLayoutCache(h),u.engine.removedNodes.push(h),u._triggerRemoveEvent()._triggerChangeEvent(),u.parentGridNode&&!u.engine.nodes.length&&u.opts.subGridDynamic&&u.removeAsSubGrid()}if(!c||(l&&(this.engine.cleanupNode(c),c.grid=this),delete c.grid?._isTemp,v0.off(n,"drag"),s&&s!==n?(s.remove(),n=s):n.remove(),this._removeDD(n),!l))return!1;let _=c.subGrid?.el?.gridstack;return f.copyPos(c,this._readAttr(this.placeholder)),f.removePositioningStyles(n),d&&(c.content||c.subGridOpts||e.addRemoveCB)?(delete c.el,n=this.addWidget(c)||n):(this._prepareElement(n,!0,c),this.el.appendChild(n),this.resizeToContentCheck(!1,c),_&&(_.parentGridNode=c),this._updateContainerHeight()),this.engine.addedNodes.push(c),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(F(Z({},r),{type:"dropped"}),h&&h.grid?h:void 0,c),!1}),this}static _itemRemoving(t,i){if(!t)return;let o=t?t.gridstackNode:void 0;!o?.grid||t.classList.contains(o.grid.opts.removableOptions.decline)||(i?o._isAboutToRemove=!0:delete o._isAboutToRemove,i?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let t=document.querySelector(this.opts.removable);return t?(!this.opts.staticGrid&&!v0.isDroppable(t)&&v0.droppable(t,this.opts.removableOptions).on(t,"dropover",(i,o)=>e._itemRemoving(o,!0)).on(t,"dropout",(i,o)=>e._itemRemoving(o,!1)),this):this}refreshDragHandles(t){return e.getElements(t).forEach(i=>{i.ddElement?.ddDraggable?.refreshHandles()}),this}prepareDragDrop(t,i=!1){let o=t?.gridstackNode;if(!o)return this;let r=o.noMove||this.opts.disableDrag,n=o.noResize||this.opts.disableResize,s=this.opts.staticGrid||r&&n;if((i||s)&&(o._initDD&&(this._removeDD(t),delete o._initDD),s))return t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!o._initDD){let c,l,d=(u,m)=>{this.triggerEvent(u,u.target),c=this.cellWidth(),l=this.getCellHeight(!0),this._onStartMoving(t,u,m,o,c,l)},h=(u,m)=>{this._dragOrResize(t,u,m,o,c,l)},_=u=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete o._moving,delete o._resizing,delete o._event,delete o._lastTried;let m=o.w!==o._orig.w,A=u.target;if(!(!A.gridstackNode||A.gridstackNode.grid!==this)){if(o.el=A,o._isAboutToRemove){let C=t.gridstackNode.grid;C._gsEventHandler[u.type]&&C._gsEventHandler[u.type](u,A),C.engine.nodes.push(o),C.removeWidget(t,!0,!0)}else f.removePositioningStyles(A),o._temporaryRemoved?(this._writePosAttr(A,o),this.engine.addNode(o)):this._writePosAttr(A,o),this.triggerEvent(u,A);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),u.type==="resizestop"&&(Number.isInteger(o.sizeToContent)&&(o.sizeToContent=o.h),this.resizeToContentCheck(m,o))}};v0.draggable(t,{start:d,stop:_,drag:h,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}).resizable(t,{start:d,stop:_,resize:h,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}),o._initDD=!0}return v0.draggable(t,r?"disable":"enable").resizable(t,n?"disable":"enable"),this}_onStartMoving(t,i,o,r,n,s){if(this.engine.cleanNodes().beginUpdate(r),this._writePosAttr(this.placeholder,r),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=r,r.grid?.el)this.dragTransform=f.getValuesFromTransformedElement(t);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let c=this.placeholder.closest(".grid-stack");this.dragTransform=f.getValuesFromTransformedElement(c)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(r.el=this.placeholder,r._lastUiPosition=o.position,r._prevYPix=o.position.top,r._moving=i.type==="dragstart",r._resizing=i.type==="resizestart",delete r._lastTried,i.type==="dropover"&&r._temporaryRemoved&&(this.engine.addNode(r),r._moving=!0),this.engine.cacheRects(n,s,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){let c=this.getColumn()-r.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-r.y;v0.resizable(t,"option","minWidth",n*Math.min(r.minW||1,c)).resizable(t,"option","minHeight",s*Math.min(r.minH||1,l)).resizable(t,"option","maxWidth",n*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,c)).resizable(t,"option","maxWidthMoveLeft",n*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,r.x+r.w)).resizable(t,"option","maxHeight",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(t,"option","maxHeightMoveUp",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,r.y+r.h))}}_dragOrResize(t,i,o,r,n,s){let c=Z({},r._orig),l=!1,d=this.opts.marginLeft,h=this.opts.marginRight,_=this.opts.marginTop,u=this.opts.marginBottom,m=Math.round(s*.1),A=Math.round(n*.1);if(d=Math.min(d,A),h=Math.min(h,A),_=Math.min(_,m),u=Math.min(u,m),i.type==="drag"){if(r._temporaryRemoved)return;r._prevYPix=o.position.top,this.opts.draggable.scroll!==!1&&H.dragElement?.updateScrollPosition(this.el);let w=o.position.left+(o.position.left>r._lastUiPosition.left?-h:d),M=o.position.top+(o.position.top>r._lastUiPosition.top?-u:_);c.x=Math.round(w/n),c.y=Math.round(M/s);let I=this._extraDragRow;if(this.engine.collide(r,c)){let w1=this.getRow(),H0=Math.max(0,c.y+r.h-w1);this.opts.maxRow&&w1+H0>this.opts.maxRow&&(H0=Math.max(0,this.opts.maxRow-w1)),this._extraDragRow=H0}else this._extraDragRow=0;if(this._extraDragRow!==I&&this._updateContainerHeight(),r.x===c.x&&r.y===c.y)return}else if(i.type==="resize"){if((c.x??0)<0||(f.updateScrollResize(i,t,s),c.w=Math.round((o.size.width-d)/n),c.h=Math.round((o.size.height-_)/s),r.w===c.w&&r.h===c.h)||r._lastTried&&r._lastTried.w===c.w&&r._lastTried.h===c.h)return;if(i.hasMovedX){let w=o.position.left+d;c.x=Math.round(w/n)}if(i.hasMovedY){let w=o.position.top+_;c.y=Math.round(w/s)}l=!0}r._event=i,r._lastTried=c;let C={x:o.position.left+d,y:o.position.top+_,w:(o.size?o.size.width:r.w*n)-d-h,h:(o.size?o.size.height:r.h*s)-_-u};if(this.engine.moveNodeCheck(r,F(Z({},c),{cellWidth:n,cellHeight:s,rect:C,resizing:l}))){r._lastUiPosition=o.position,this.engine.cacheRects(n,s,_,h,u,d),delete r._skipDown,l&&r.subGrid&&r.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let w=i.target;r._sidebarOrig||this._writePosAttr(w,r),this.triggerEvent(i,w)}}triggerEvent(t,i){let o=this;for(;o.parentGridNode;)o=o.parentGridNode.grid;o._gsEventHandler[t.type]&&o._gsEventHandler[t.type](t,i)}_leave(t,i){i=i||t;let o=i.gridstackNode;if(!o||(i.style.transform=i.style.transformOrigin="",v0.off(t,"drag"),o._temporaryRemoved))return;o._temporaryRemoved=!0,this.engine.removeNode(o),o.el=o._isExternal&&i?i:t;let r=o._sidebarOrig;o._isExternal&&this.engine.cleanupNode(o),o._sidebarOrig=r,this.opts.removable===!0&&e._itemRemoving(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):o._isExternal&&this.engine.restoreInitial()}}return e.renderCB=(a,t)=>{a&&t?.content&&(a.textContent=t.content)},e.resizeToContentParent=".grid-stack-item-content",e.Utils=f,e.Engine=bl,e.GDRev="13.0.1",e})(),H_=["container"],Iz=["*"];function zz(e,a){}var Dz=["*",[["","empty-content",""]]],Rz=["*","[empty-content]"];function Oz(e,a){e&1&&m0(0,1,["*ngIf","isEmpty"])}function Nz(e,a){}var Q9=(()=>{class e{constructor(t){this.elementRef=t,this.el._gridItemComp=this}set options(t){let i=this.el.gridstackNode?.grid;i?i.update(this.el,t):this._options=F(Z({},t),{el:this.el})}get options(){return this.el.gridstackNode||this._options||{el:this.el}}get el(){return this.elementRef.nativeElement}clearOptions(){delete this._options}ngOnDestroy(){this.clearOptions(),delete this.childWidget,delete this.el._gridItemComp,delete this.container,delete this.ref}}return e.\u0275fac=function(a){return new(a||e)(l7(O1))},e.\u0275cmp=X1({type:e,selectors:[["gridstack-item"]],viewQuery:function(a,t){if(a&1&&q9(H_,7,B2),a&2){let i;y8(i=x8())&&(t.container=i.first)}},inputs:{options:"options"},ngContentSelectors:Iz,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(a,t){a&1&&(x0(),ju(0,"div",1),Pu(1,zz,0,0,"ng-template",null,0,e_),m0(3),A1(4),Gu()),a&2&&(B(4),k3(" ",t.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),e})(),R8=(()=>{class e{constructor(t){this.elementRef=t,this.addedCB=new H1,this.changeCB=new H1,this.disableCB=new H1,this.dragCB=new H1,this.dragStartCB=new H1,this.dragStopCB=new H1,this.droppedCB=new H1,this.enableCB=new H1,this.removedCB=new H1,this.resizeCB=new H1,this.resizeStartCB=new H1,this.resizeStopCB=new H1,X2.addRemoveCB||(X2.addRemoveCB=Pz),X2.saveCB||(X2.saveCB=Fz),X2.updateCB||(X2.updateCB=Uz),this.el._gridComp=this}set options(t){this._grid?this._grid.updateOptions(t):this._options=t}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static registerComponents(t){t.forEach(i=>e.componentMap[e.getSelector(i)]=i)}static getSelector(t){return n_(t).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=X2.init(this._options,this.el),delete this._options,this.checkEmpty()}ngAfterContentInit(){this._sub=this.gridstackItems?.changes.subscribe(()=>this.updateAll()),this.loaded||this.updateAll(),this.hookEvents(this.grid)}ngOnDestroy(){this.unhookEvents(this._grid),this._sub?.unsubscribe(),this._grid?.destroy(),delete this._grid,delete this.el._gridComp,delete this.container,delete this.ref}updateAll(){if(!this.grid)return;let t=[];this.gridstackItems?.forEach(i=>{t.push(i.options),i.clearOptions()}),this.grid.load(t)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(t){t&&(t.parentGridNode||t.on("added",(i,o)=>{(o[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:i,nodes:o})}).on("change",(i,o)=>this.changeCB.emit({event:i,nodes:o})).on("disable",i=>this.disableCB.emit({event:i})).on("drag",(i,o)=>this.dragCB.emit({event:i,el:o})).on("dragstart",(i,o)=>this.dragStartCB.emit({event:i,el:o})).on("dragstop",(i,o)=>this.dragStopCB.emit({event:i,el:o})).on("dropped",(i,o,r)=>this.droppedCB.emit({event:i,previousNode:o,newNode:r})).on("enable",i=>this.enableCB.emit({event:i})).on("removed",(i,o)=>{(o[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:i,nodes:o})}).on("resize",(i,o)=>this.resizeCB.emit({event:i,el:o})).on("resizestart",(i,o)=>this.resizeStartCB.emit({event:i,el:o})).on("resizestop",(i,o)=>this.resizeStopCB.emit({event:i,el:o})))}unhookEvents(t){t&&(t.parentGridNode||t.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return e.componentMap={},e.\u0275fac=function(a){return new(a||e)(l7(O1))},e.\u0275cmp=X1({type:e,selectors:[["gridstack"]],contentQueries:function(a,t,i){if(a&1&&$u(i,Q9,4),a&2){let o;y8(o=x8())&&(t.gridstackItems=o)}},viewQuery:function(a,t){if(a&1&&q9(H_,7,B2),a&2){let i;y8(i=x8())&&(t.container=i.first)}},inputs:{options:"options",isEmpty:"isEmpty"},outputs:{addedCB:"addedCB",changeCB:"changeCB",disableCB:"disableCB",dragCB:"dragCB",dragStartCB:"dragStartCB",dragStopCB:"dragStopCB",droppedCB:"droppedCB",enableCB:"enableCB",removedCB:"removedCB",resizeCB:"resizeCB",resizeStartCB:"resizeStartCB",resizeStopCB:"resizeStopCB"},ngContentSelectors:Rz,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(a,t){a&1&&(x0(Dz),Nu(0,Oz,1,0,"ng-content",1)(1,Nz,0,0,"ng-template",null,0,e_),m0(3)),a&2&&Q("ngIf",t.isEmpty)},dependencies:[Yk],styles:["[_nghost-%COMP%]{display:block}"]}),e})();function Pz(e,a,t,i){if(t){if(!e)return;if(i){let o=e.parentElement?._gridItemComp;if(!o)return;let r=(o.childWidget?.container||o.container)?.createComponent(R8),n=r?.instance;return n?(n.ref=r,n.options=a,n.el):void 0}else{let o=e._gridComp?.container?.createComponent(Q9),r=o?.instance;if(!r)return;r.ref=o;let n=a.component,s=n?R8.componentMap[n]:void 0;if(s){let c=()=>{let l=r.container?.createComponent(s),d=l?.instance;d&&typeof d.serialize=="function"&&typeof d.deserialize=="function"&&(r.childWidget=d,d._compRef=l,d.deserialize(a))};a.lazyLoad||a.grid?.opts?.lazyLoad&&a.lazyLoad!==!1?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([l])=>{l.isIntersecting&&(a.visibleObservable?.disconnect(),delete a.visibleObservable,c(),a.grid?.refreshDragHandles(r.el))}),window.setTimeout(()=>a.visibleObservable?.observe(r.el))):(c(),a.grid?.refreshDragHandles(r.el))}return r.el}}else if(i){let o=a.el?._gridComp;o?.ref?o.ref.destroy():o?.ngOnDestroy()}else{let o=a.el?._gridItemComp;o?.ref?o.ref.destroy():o?.ngOnDestroy()}}function Fz(e,a){let t=e.el?._gridItemComp;if(t){let o=t.childWidget?.serialize();o&&(a.props=o);return}let i=e.el?._gridComp}function Uz(e){let a=e,t=e.el?._gridItemComp;t?.childWidget&&a.props&&t.childWidget.deserialize(a)}var qz={unsavedChanges:"Nicht gespeicherte \xC4nderungen",editCards:"Karten bearbeiten",editView:"Ansicht bearbeiten",actions:"Aktionen",save:"Speichern",cancel:"Abbrechen",discard:"Verwerfen",discardChanges:"\xC4nderungen verwerfen",discardConfirmBody:"\xC4nderungen verwerfen? Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",unsavedNavBody:"Sie verlassen diese Seite. Speichern oder verwerfen Sie die \xC4nderungen, um fortzufahren. Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",noCardsAvailable:"Keine Karten verf\xFCgbar.",removeSection:"Bereich entfernen",removeCard:"Karte entfernen",resizable:"Gr\xF6\xDFenver\xE4nderbar"},jz={unsavedChanges:"Unsaved Changes",editCards:"Edit Cards",editView:"Edit View",actions:"Actions",save:"Save",cancel:"Cancel",discard:"Discard",discardChanges:"Discard Changes",discardConfirmBody:"Discard the changes? This action cannot be undone.",unsavedNavBody:"You are leaving this page. Save or discard the changes to proceed. This action cannot be undone.",noCardsAvailable:"No cards available.",removeSection:"Remove section",removeCard:"Remove card",resizable:"Resizable"},Z2={UNSAVED_CHANGES:"unsavedChanges",EDIT_CARDS:"editCards",EDIT_VIEW:"editView",ACTIONS:"actions",SAVE:"save",CANCEL:"cancel",DISCARD:"discard",DISCARD_CHANGES:"discardChanges",DISCARD_CONFIRM_BODY:"discardConfirmBody",UNSAVED_NAV_BODY:"unsavedNavBody",NO_CARDS_AVAILABLE:"noCardsAvailable",REMOVE_SECTION:"removeSection",REMOVE_CARD:"removeCard",RESIZABLE:"resizable"},Gz={en:jz,de:qz},_7=class Nt{language=o5("en");getTranslation(a){return Gz[this.language()][a]??a}static \u0275fac=function(a){return new(a||Nt)};static \u0275prov=T1({token:Nt,factory:Nt.\u0275fac})},$a={WC:"wc",ANGULAR:"angular",SAP_UI:"sap-ui"},Wz=/^[a-z](?:[a-z0-9-]*)$/,O8=new Map;function $z(e){for(let a of e){let t=n_(a);if(!t)throw new Error(`Dashboard card registration failed: "${B_(a)}" is not an Angular component.`);if(!lC(a))throw new Error(`Dashboard card registration failed: "${t.selector}" must be a standalone Angular component.`);let i=Qz(t.selector,a),o=O8.get(i);if(o&&o.componentType!==a)throw new Error(`Dashboard card registration failed: selector "${i}" is already registered.`);O8.set(i,{componentType:a,selector:i,inputs:Yz(t.inputs)})}}function Kz(e){return O8.get(e)}function Xz(e,a){Lk()&&console.warn(`Dashboard card "${e}" ignores unknown Angular input "${a}".`)}function Yz(e){let a=new Map;for(let t of e)a.set(t.templateName,t.templateName),a.set(t.propName,t.templateName);return a}function Qz(e,a){let t=e.trim();if(!Wz.test(t))throw new Error(`Dashboard card registration failed: "${B_(a)}" must use a single element selector. Received "${e}".`);return t}function B_(e){return e.name.replace(/^_+/,"")||"AnonymousComponent"}function Jz(e,a,t){let i=Kz(e.component);if(!i){console.warn(`[DashboardCard] Angular component "${e.component}" is not registered`);return}let o=a.createComponent(i.componentType);for(let[r,n]of Object.entries(e.componentInputs??{})){let s=i.inputs.get(r);if(!s){Xz(e.component,r);continue}o.setInput(s,n)}o.changeDetectorRef.detectChanges(),t(()=>{a.clear()})}function eD(e,a,t){let i=a.element.nativeElement,o=null,r=!1,n=window.sap?.ui?.require;n?n(["sap/ui/core/ComponentContainer"],s=>{if(r)return;let c=new s({name:e.component,manifest:!0,async:!0,settings:e.componentInputs??{}});c.placeAt(i),o=c}):console.error("[DashboardCard] SAP UI5 is not available on window.sap"),t(()=>{r=!0,o?.destroy(),i.innerHTML=""})}function tD(e,a,t,i){let o=a.element.nativeElement,r=i.createElement(e.component);for(let[n,s]of Object.entries(e.componentInputs??{}))i.setProperty(r,n,s);i.appendChild(o,r),t(()=>{o.innerHTML=""})}var aD=["elementHost"],iD=["*"];function oD(e,a){if(e&1){let t=W0();V(0,"div",5)(1,"ui5-button",6),o1("click",function(){j1(t);let i=O(2);return G1(i.removeCard.emit())}),z()(),x5(2,"ui5-icon",7)}if(e&2){let t=O(2);B(),Q("accessibleName",t.i18n.getTranslation(t.i18nKeys.REMOVE_CARD)+": "+(t.card().label||t.card().component)),c5("data-testid","dashboard-card-"+t.card().id+"-remove"),B(),Q("accessibleName",t.i18n.getTranslation(t.i18nKeys.RESIZABLE))}}function rD(e,a){if(e&1&&(V(0,"div",3),A0(1,oD,3,3),V(2,"div",4),x5(3,"div",null,0),z()()),e&2){let t=O();G9("component-card--editing",t.editMode()),c5("data-testid","dashboard-card-"+t.card().id),B(),w0(t.editMode()?1:-1),B(),d7("pointer-events",t.editMode()?"none":"auto")}}function nD(e,a){if(e&1&&(V(0,"div",2)(1,"div",8),m0(2),z()()),e&2){let t=O();c5("data-testid","dashboard-card-"+t.card().id),B(),d7("pointer-events",t.editMode()?"none":"auto")}}var k_=class N8{card=b.required();editMode=b(!1);removeCard=R();i18n=x(_7);i18nKeys=Z2;gridColumn=P0(()=>{let a=this.card().w??12;return this.createGridTrack(this.card().x,a)});gridRow=P0(()=>{let a=this.card().h??100;return this.createGridTrack(this.card().y,a)});host=k8("elementHost",{read:B2});renderer=x(fH);mountCfg=P0(()=>{let a=this.card();return{type:a.type,component:a.component,componentInputs:a.componentInputs}},{equal:(a,t)=>a.type===t.type&&a.component===t.component&&JSON.stringify(a.componentInputs)===JSON.stringify(t.componentInputs)});constructor(){Z0(a=>{let t=this.host(),i=this.mountCfg();if(!(!t||!i.component))switch(t.clear(),t.element.nativeElement.innerHTML="",i.type){case $a.SAP_UI:eD(i,t,a);break;case $a.ANGULAR:Jz(i,t,a);break;case $a.WC:default:tD(i,t,a,this.renderer);break}})}createGridTrack(a,t){return a===void 0?`span ${t}`:`${a+1} / span ${t}`}static \u0275fac=function(a){return new(a||N8)};static \u0275cmp=X1({type:N8,selectors:[["mfp-dashboard-card"]],viewQuery:function(a,t){a&1&&j9(t.host,aD,5,B2),a&2&&Ku()},hostVars:4,hostBindings:function(a,t){a&2&&d7("grid-column",t.gridColumn())("grid-row",t.gridRow())},inputs:{card:[1,"card"],editMode:[1,"editMode"]},outputs:{removeCard:"removeCard"},ngContentSelectors:iD,decls:2,vars:1,consts:[["elementHost",""],[1,"component-card",3,"component-card--editing"],[1,"card"],[1,"component-card"],[1,"component-host"],[1,"remove-wrapper"],["design","Default","icon","decline",1,"card__remove",3,"click","accessibleName"],["aria-hidden","true","name","resize-corner",1,"card__resize-indicator",3,"accessibleName"],[1,"card__body"]],template:function(a,t){a&1&&(x0(),A0(0,rD,5,6,"div",1)(1,nD,3,3,"div",2)),a&2&&w0(t.card().component?0:1)},dependencies:[ve,m_],styles:["[_nghost-%COMP%]{display:block;min-width:0;min-height:0;overflow:visible}.card__remove[_ngcontent-%COMP%]{position:absolute;top:0;right:-.5rem;z-index:10;border-radius:50%!important;width:1.25rem!important;height:1.25rem!important;min-width:unset!important;padding:0!important;font-size:.625rem!important}.remove-wrapper[_ngcontent-%COMP%]{position:sticky;height:.5rem;top:0;right:0;z-index:10}.component-card[_ngcontent-%COMP%]{position:relative;height:100%;overflow:visible;isolation:isolate;padding-inline-start:var(--mfp_cardContainerPadding, 10px);padding-inline-end:var(--mfp_cardContainerPadding, 10px)}.component-card--editing[_ngcontent-%COMP%]{cursor:grab}.component-card--editing[_ngcontent-%COMP%]:hover{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.component-card--editing[_ngcontent-%COMP%]:hover .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{cursor:grabbing!important}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.component-host[_ngcontent-%COMP%]{position:relative;height:100%}.card__resize-indicator[_ngcontent-%COMP%]{position:absolute;right:calc(var(--mfp_cardContainerPadding, 10px) + 4px);bottom:4px;width:1rem;height:1rem;pointer-events:none;opacity:0;transition:opacity .12s ease-out;color:var(--sapHighlightColor, #0070f2);z-index:9}.card[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;border:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);border-radius:.5rem;background:var(--sapBackgroundColor, #fff);overflow:visible}.card__header[_ngcontent-%COMP%]{padding:.75rem 1rem;font-weight:600;border-bottom:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);background:var(--sapGroup_TitleBackground, #f5f5f5)}.card__body[_ngcontent-%COMP%]{flex:1;padding:1rem;overflow:auto}"]})},sD=[{w:4e3,c:14,layout:"compact"},{w:1439,c:12,layout:"compact"},{w:1023,c:8,layout:"compact"},{w:599,c:1,layout:"list"}],cD=class P8{i18n=x(_7);i18nKeys=Z2;open=b(!1);confirm=R();cancelled=R();static \u0275fac=function(a){return new(a||P8)};static \u0275cmp=X1({type:P8,selectors:[["mfp-discard-changes-dialog"]],inputs:{open:[1,"open"]},outputs:{confirm:"confirm",cancelled:"cancelled"},decls:11,vars:5,consts:[["data-testid","dashboard-discard-changes-dialog","state","Critical",3,"ui5BeforeClose","open"],["slot","header",1,"discard-changes-dialog__header"],["level","H5"],[1,"discard-changes-dialog__body"],["slot","footer",1,"discard-changes-dialog__footer"],["data-testid","dashboard-discard-changes-confirm-btn","design","Emphasized",3,"click"],["data-testid","dashboard-discard-changes-cancel-btn","design","Transparent",3,"click"]],template:function(a,t){a&1&&(V(0,"ui5-dialog",0),o1("ui5BeforeClose",function(){return t.cancelled.emit()}),V(1,"div",1)(2,"ui5-title",2),A1(3),z()(),V(4,"div",3),A1(5),z(),V(6,"div",4)(7,"ui5-button",5),o1("click",function(){return t.confirm.emit()}),A1(8),z(),V(9,"ui5-button",6),o1("click",function(){return t.cancelled.emit()}),A1(10),z()()()),a&2&&(Q("open",t.open()),B(3),B1(t.i18n.getTranslation(t.i18nKeys.DISCARD_CHANGES)),B(2),k3(" ",t.i18n.getTranslation(t.i18nKeys.DISCARD_CONFIRM_BODY)," "),B(3),B1(t.i18n.getTranslation(t.i18nKeys.DISCARD)),B(2),B1(t.i18n.getTranslation(t.i18nKeys.CANCEL)))},dependencies:[ve,X9,S4],styles:[`:host{display:contents}.discard-changes-dialog__header{display:flex;align-items:center;width:100%;padding:.75rem 0}.discard-changes-dialog__body{padding:0 0 1rem;min-width:320px}.discard-changes-dialog__footer{display:flex;justify-content:flex-end;align-items:center;width:100%;gap:.5rem}
|
|
135
135
|
`],encapsulation:3})},lD=["*"],hD=(()=>{class e{constructor(){this.headerText=b(),this.footerText=b(),this.indent=b(!1,{transform:_1}),this.selectionMode=b("None"),this.noDataText=b(),this.separators=b("All"),this.growing=b("None"),this.growingButtonText=b(),this.loading=b(!1,{transform:_1}),this.loadingDelay=b(1e3),this.stickyHeader=b(!1,{transform:_1}),this.accessibleName=b(),this.accessibilityAttributes=b({}),this.accessibleNameRef=b(),this.accessibleDescription=b(),this.accessibleDescriptionRef=b(),this.accessibleRole=b("List"),this.ui5ItemClick=R(),this.ui5ItemClose=R(),this.ui5ItemToggle=R(),this.ui5ItemDelete=R(),this.ui5SelectionChange=R(),this.ui5LoadMore=R(),this.ui5MoveOver=R(),this.ui5Move=R(),this.slots=[{name:"default",description:"Defines the items of the component.\n\n**Note:** Use `ui5-li`, `ui5-li-custom`, and `ui5-li-group` for the intended design."},{name:"header",description:"Defines the component header.\n\n**Note:** When `header` is set, the\n`headerText` property is ignored."}],this.elementRef=x(O1),this.injector=x(a0)}get listItems(){return this.element?.listItems??[]}get element(){return this.elementRef.nativeElement}ngAfterViewInit(){let t=this.element,i=["headerText","footerText","indent","selectionMode","noDataText","separators","growing","growingButtonText","loading","loadingDelay","stickyHeader","accessibleName","accessibilityAttributes","accessibleNameRef","accessibleDescription","accessibleDescriptionRef","accessibleRole"];for(let r of i){let n=r.replace(/-./g,s=>s[1].toUpperCase());this[n]&&typeof this[n]=="function"&&l5(this.injector,()=>{Z0(()=>{let s=this[n]();t&&(t[r]=s)})})}let o=["ui5ItemClick","ui5ItemClose","ui5ItemToggle","ui5ItemDelete","ui5SelectionChange","ui5LoadMore","ui5MoveOver","ui5Move"];for(let r of o){let n=r.replace("ui5","").replace(/([A-Z])/g,"-$1").toLowerCase().substring(1);this[r]&&typeof this[r].emit=="function"&&t.addEventListener&&t.addEventListener(n,s=>{this[r].emit(s)})}}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=X1({type:e,selectors:[["ui5-list"],["","ui5-list",""]],inputs:{headerText:[1,"headerText"],footerText:[1,"footerText"],indent:[1,"indent"],selectionMode:[1,"selectionMode"],noDataText:[1,"noDataText"],separators:[1,"separators"],growing:[1,"growing"],growingButtonText:[1,"growingButtonText"],loading:[1,"loading"],loadingDelay:[1,"loadingDelay"],stickyHeader:[1,"stickyHeader"],accessibleName:[1,"accessibleName"],accessibilityAttributes:[1,"accessibilityAttributes"],accessibleNameRef:[1,"accessibleNameRef"],accessibleDescription:[1,"accessibleDescription"],accessibleDescriptionRef:[1,"accessibleDescriptionRef"],accessibleRole:[1,"accessibleRole"]},outputs:{ui5ItemClick:"ui5ItemClick",ui5ItemClose:"ui5ItemClose",ui5ItemToggle:"ui5ItemToggle",ui5ItemDelete:"ui5ItemDelete",ui5SelectionChange:"ui5SelectionChange",ui5LoadMore:"ui5LoadMore",ui5MoveOver:"ui5MoveOver",ui5Move:"ui5Move"},exportAs:["ui5List"],ngContentSelectors:lD,decls:1,vars:0,template:function(t,i){t&1&&(x0(),m0(0))},encapsulation:2,changeDetection:0})}}return e})(),dD=["*"],uD=(()=>{class e{constructor(){this.movable=b(!1,{transform:_1}),this.accessibleName=b(),this.type=b("Active"),this.accessibilityAttributes=b({}),this.navigated=b(!1,{transform:_1}),this.tooltip=b(),this.highlight=b("None"),this.selected=b(!1,{transform:_1}),this.ui5DetailClick=R(),this.slots=[{name:"default",description:"Defines the content of the component."},{name:"deleteButton",description:`Defines the delete button, displayed in "Delete" mode.
|
|
136
136
|
**Note:** While the slot allows custom buttons, to match
|
|
137
137
|
design guidelines, please use the \`ui5-button\` component.
|
package/mfp-webcomponents.js
CHANGED
|
@@ -563,7 +563,7 @@ This component supports nesting a \`Link\` component inside.
|
|
|
563
563
|
design guidelines, please use the \`ui5-button\` component.
|
|
564
564
|
**Note:** When the slot is not present, a built-in delete button will be displayed.`,since:"1.9.0"}],this.elementRef=ae(gt),this.injector=ae(xt)}get element(){return this.elementRef.nativeElement}ngAfterViewInit(){let i=this.element,o=["text","additionalText","icon","disabled","loading","loadingDelay","accessibleName","tooltip","checked","accessibilityAttributes","type","navigated","highlight","selected"];for(let n of o){let c=n.replace(/-./g,d=>d[1].toUpperCase());this[c]&&typeof this[c]=="function"&&g1(this.injector,()=>{At(()=>{let d=this[c]();i&&(i[n]=d)})})}let a=["ui5BeforeOpen","ui5Open","ui5BeforeClose","ui5Close","ui5Check","ui5DetailClick"];for(let n of a){let c=n.replace("ui5","").replace(/([A-Z])/g,"-$1").toLowerCase().substring(1);this[n]&&typeof this[n].emit=="function"&&i.addEventListener&&i.addEventListener(c,d=>{this[n].emit(d)})}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=Ye({type:e,selectors:[["ui5-menu-item"],["","ui5-menu-item",""]],inputs:{text:[1,"text"],additionalText:[1,"additionalText"],icon:[1,"icon"],disabled:[1,"disabled"],loading:[1,"loading"],loadingDelay:[1,"loadingDelay"],accessibleName:[1,"accessibleName"],tooltip:[1,"tooltip"],checked:[1,"checked"],accessibilityAttributes:[1,"accessibilityAttributes"],type:[1,"type"],navigated:[1,"navigated"],highlight:[1,"highlight"],selected:[1,"selected"]},outputs:{ui5BeforeOpen:"ui5BeforeOpen",ui5Open:"ui5Open",ui5BeforeClose:"ui5BeforeClose",ui5Close:"ui5Close",ui5Check:"ui5Check",ui5DetailClick:"ui5DetailClick"},exportAs:["ui5MenuItem"],ngContentSelectors:W9e,decls:1,vars:0,template:function(i,o){i&1&&(Kt(),jt(0))},encapsulation:2,changeDetection:0})}}return e})(),q9e=["*"],$9e=(()=>{class e{constructor(){this.elementRef=ae(gt),this.injector=ae(xt)}get element(){return this.elementRef.nativeElement}ngAfterViewInit(){let i=this.element}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=Ye({type:e,selectors:[["ui5-menu-separator"],["","ui5-menu-separator",""]],exportAs:["ui5MenuSeparator"],ngContentSelectors:q9e,decls:1,vars:0,template:function(i,o){i&1&&(Kt(),jt(0))},encapsulation:2,changeDetection:0})}}return e})(),X9e="action-settings",K9e="M0 7c0-.292.094-.531.281-.719A.973.973 0 0 1 1 6h.813a2.68 2.68 0 0 1 .171-.484c.073-.157.151-.318.235-.485l-.594-.562a1.043 1.043 0 0 1-.281-.719c0-.27.093-.5.281-.688l1.438-1.437a.935.935 0 0 1 .687-.281c.292 0 .531.093.719.281l.562.594c.167-.084.328-.162.485-.235A2.68 2.68 0 0 1 6 1.813V1c0-.292.094-.531.281-.719A.973.973 0 0 1 7 0h2c.292 0 .531.094.719.281A.973.973 0 0 1 10 1v.813c.167.062.328.125.484.187.157.063.308.135.454.219l.593-.594a.974.974 0 0 1 .719-.281c.27 0 .5.093.688.281l1.437 1.438a.935.935 0 0 1 .281.687c0 .27-.094.51-.281.719l-.594.593c.167.271.292.584.375.938H15c.292 0 .531.094.719.281A.973.973 0 0 1 16 7v2a.973.973 0 0 1-.281.719A.974.974 0 0 1 15 10h-.844a3.68 3.68 0 0 1-.375.938l.594.593c.188.209.281.448.281.719 0 .27-.094.5-.281.688l-1.438 1.437a.935.935 0 0 1-.687.281.974.974 0 0 1-.719-.281l-.594-.594a3.62 3.62 0 0 1-.453.219 22.56 22.56 0 0 1-.484.188V15a.974.974 0 0 1-.281.719A.973.973 0 0 1 9 16H7a.973.973 0 0 1-.719-.281A.974.974 0 0 1 6 15v-.813a2.683 2.683 0 0 1-.484-.171 19.641 19.641 0 0 1-.485-.235l-.562.594a.973.973 0 0 1-.719.281.94.94 0 0 1-.688-.281l-1.437-1.438a.935.935 0 0 1-.281-.687c0-.27.093-.51.281-.719l.594-.562a20.151 20.151 0 0 1-.235-.485A2.68 2.68 0 0 1 1.813 10H1a.973.973 0 0 1-.719-.281A.973.973 0 0 1 0 9V7Zm1 0v2h1.531c.063.208.12.39.172.547.052.156.11.307.172.453.063.167.14.338.234.516.094.177.204.39.329.64L2.343 12.25l1.406 1.406 1.094-1.094c.354.209.708.386 1.062.532.354.146.719.27 1.094.375V15h2v-1.563c.208-.062.39-.12.547-.171.156-.053.307-.1.453-.141.167-.083.344-.167.531-.25a8.68 8.68 0 0 0 .625-.313l1.094 1.094 1.406-1.406-1.094-1.125c.188-.354.35-.703.485-1.047s.265-.703.39-1.078H15V7h-1.563a9.505 9.505 0 0 0-.874-2.125l1.093-1.125-1.406-1.406-1.094 1.094a7.478 7.478 0 0 0-1.047-.516A9.907 9.907 0 0 0 9 2.562V1H7v1.531l-.516.172c-.156.052-.317.11-.484.172l-.563.25a5.519 5.519 0 0 0-.593.313L3.75 2.343 2.344 3.75l1.094 1.094A12.821 12.821 0 0 0 2.53 7H1Zm4.219 0 .093-.281a3.48 3.48 0 0 1 .22-.375c.083-.125.176-.24.28-.344.209-.208.396-.37.563-.484A3.49 3.49 0 0 1 7 5.187a3.55 3.55 0 0 1 1-.156c.354 0 .688.063 1 .188l.281.093.375.25c.125.084.24.178.344.282a.559.559 0 0 1 .156.156c.271.25.469.583.594 1 .125.313.188.646.188 1s-.063.688-.188 1a2.41 2.41 0 0 1-.594 1 .56.56 0 0 1-.156.156 2.25 2.25 0 0 1-.344.281l-.375.25-.281.094a2.665 2.665 0 0 1-1 .188 3.55 3.55 0 0 1-1-.156 3.454 3.454 0 0 1-.625-.329A4.164 4.164 0 0 1 5.812 10a2.249 2.249 0 0 1-.28-.344 3.496 3.496 0 0 1-.22-.375L5.22 9a2.667 2.667 0 0 1-.188-1c0-.354.063-.688.188-1Zm.812 1c0 .354.089.682.266.984A1.9 1.9 0 0 0 7 9.688c.292.187.625.28 1 .28.125 0 .292-.02.5-.062a2.42 2.42 0 0 0 .656-.328c.188-.135.354-.328.5-.578.188-.292.281-.625.281-1 0-.396-.093-.73-.28-1a1.843 1.843 0 0 0-.5-.578 2.42 2.42 0 0 0-.657-.328A2.69 2.69 0 0 0 8 6.03c-.375 0-.708.094-1 .282a1.897 1.897 0 0 0-.703.703c-.177.302-.266.63-.266.984Z",Y9e=!1,Q9e=fh,J9e="0 0 16 16",ehe="SAP-icons-v4",the="@ui5/webcomponents-icons";ee(X9e,{pathData:K9e,ltr:Y9e,viewBox:J9e,accData:Q9e,collection:ehe,packageName:the});var ihe="action-settings",ohe="M8.549 0a1.757 1.757 0 0 1 1.568 1.49l.121.805a.251.251 0 0 0 .123.18l1.238.715a.252.252 0 0 0 .217.017l.755-.298a1.75 1.75 0 0 1 2.156.754v.001l.387.673a1.75 1.75 0 0 1-.423 2.244l-.617.49a.251.251 0 0 0-.094.196v1.465c0 .076.035.148.094.196l.616.49c.677.54.858 1.495.425 2.245l-.387.673h-.001a1.75 1.75 0 0 1-2.155.755l-.757-.298a.251.251 0 0 0-.217.016l-1.238.715a.251.251 0 0 0-.122.18l-.12.806A1.75 1.75 0 0 1 8.387 16H7.61a1.75 1.75 0 0 1-1.698-1.333l-.16-1.013a.25.25 0 0 0-.122-.18l-1.184-.684a.251.251 0 0 0-.216-.016l-.803.317a1.75 1.75 0 0 1-2.156-.754l-.387-.675-.001.001a1.753 1.753 0 0 1 .425-2.244l.695-.555A.25.25 0 0 0 2.1 8.67V7.33a.25.25 0 0 0-.095-.195L1.31 6.58a1.753 1.753 0 0 1-.425-2.244l.388-.674a1.75 1.75 0 0 1 2.156-.754l.802.317c.07.027.15.02.216-.017l1.185-.685a.25.25 0 0 0 .122-.18l.16-1.011A1.75 1.75 0 0 1 7.611 0h.938Zm-.982 1.504a.25.25 0 0 0-.19.164l-.14.9a1.75 1.75 0 0 1-.855 1.255l-1.185.685a1.752 1.752 0 0 1-1.516.113l-.803-.315a.25.25 0 0 0-.307.107l-.388.673a.253.253 0 0 0 .06.321l.696.555c.416.332.66.835.66 1.368v1.34a1.75 1.75 0 0 1-.66 1.368l-.695.555a.251.251 0 0 0-.061.321l.387.674a.25.25 0 0 0 .308.107l.802-.315a1.752 1.752 0 0 1 1.517.112l1.185.685c.461.266.775.729.854 1.256l.14.9a.25.25 0 0 0 .235.168h.777a.25.25 0 0 0 .246-.213l.121-.806a1.75 1.75 0 0 1 .855-1.255l1.238-.716a1.751 1.751 0 0 1 1.516-.114l.757.298c.1.04.213.01.28-.07l.415-.71a.25.25 0 0 0-.06-.321l-.617-.492a1.751 1.751 0 0 1-.66-1.369V7.267c0-.533.244-1.037.66-1.369l.616-.49a.25.25 0 0 0 .06-.321l-.387-.675a.249.249 0 0 0-.307-.106l-.758.297a1.75 1.75 0 0 1-1.515-.114L9.61 3.773a1.75 1.75 0 0 1-.855-1.255l-.121-.805a.25.25 0 0 0-.201-.21h-.866ZM8 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 1.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",ahe=!1,rhe=fh,nhe="0 0 16 16",she="SAP-icons-v5",lhe="@ui5/webcomponents-icons";ee(ihe,{pathData:ohe,ltr:ahe,viewBox:nhe,accData:rhe,collection:she,packageName:lhe});var che="menu2",hhe="M1 4.01a.96.96 0 0 1-.703-.298A.969.969 0 0 1 0 3.005c0-.293.099-.534.297-.722A.985.985 0 0 1 1 2h14a.97.97 0 0 1 .719.283.981.981 0 0 1 .281.722.996.996 0 0 1-.281.707.944.944 0 0 1-.719.298H1Zm0 4.995c-.27 0-.505-.1-.703-.298A.969.969 0 0 1 0 8c0-.293.099-.534.297-.723A.985.985 0 0 1 1 6.995h14a.97.97 0 0 1 .719.282c.187.189.281.43.281.723a.996.996 0 0 1-.281.707.944.944 0 0 1-.719.298H1ZM1 14c-.27 0-.505-.1-.703-.298A.969.969 0 0 1 0 12.995c0-.293.099-.534.297-.723A.986.986 0 0 1 1 11.99h14c.292 0 .531.095.719.283.187.189.281.43.281.723a.996.996 0 0 1-.281.707A.945.945 0 0 1 15 14H1Z",dhe=!1,uhe="0 0 16 16",phe="SAP-icons-v4",_he="@ui5/webcomponents-icons";ee(che,{pathData:hhe,ltr:dhe,viewBox:uhe,collection:phe,packageName:_he});var vhe="menu2",mhe="M15.25 12.5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1 0-1.5h14.5Zm0-5.5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1 0-1.5h14.5Zm0-5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1 0-1.5h14.5Z",ghe=!1,fhe="0 0 16 16",bhe="SAP-icons-v5",Che="@ui5/webcomponents-icons";ee(vhe,{pathData:mhe,ltr:ghe,viewBox:fhe,collection:bhe,packageName:Che});var K=class L5{static getElements(t,i=document){if(typeof t=="string"){let o="getElementById"in i?i:void 0;if(o&&!isNaN(+t[0])){let n=o.getElementById(t);return n?[n]:[]}let a=i.querySelectorAll(t);if(!a.length&&t[0]!=="."&&t[0]!=="#"&&(a=i.querySelectorAll("."+t),a.length||(a=i.querySelectorAll("#"+t)),!a.length)){let n=i.querySelector(`[gs-id="${t}"]`);return n?[n]:[]}return Array.from(a)}return[t]}static getElement(t,i=document){if(typeof t=="string"){let o="getElementById"in i?i:void 0;if(!t.length)return null;if(o&&t[0]==="#")return o.getElementById(t.substring(1));if(t[0]==="#"||t[0]==="."||t[0]==="[")return i.querySelector(t);if(o&&!isNaN(+t[0]))return o.getElementById(t);let a=i.querySelector(t);return o&&!a&&(a=o.getElementById(t)),a||(a=i.querySelector("."+t)),a}return t}static lazyLoad(t){return!!(t.lazyLoad||t.grid?.opts?.lazyLoad&&t.lazyLoad!==!1)}static createDiv(t,i){let o=document.createElement("div");return t.forEach(a=>{a&&o.classList.add(a)}),i?.appendChild(o),o}static shouldSizeToContent(t,i=!1){return!!(t?.grid&&(i?t.sizeToContent===!0||t.grid.opts.sizeToContent===!0&&t.sizeToContent===void 0:t.sizeToContent||t.grid.opts.sizeToContent&&t.sizeToContent!==!1))}static isIntercepted(t,i){return!(t.y>=i.y+i.h||t.y+t.h<=i.y||t.x+t.w<=i.x||t.x>=i.x+i.w)}static isTouching(t,i){return L5.isIntercepted(t,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(t,i){let o=t.x>i.x?t.x:i.x,a=t.x+t.w<i.x+i.w?t.x+t.w:i.x+i.w;if(a<=o)return 0;let n=t.y>i.y?t.y:i.y,c=t.y+t.h<i.y+i.h?t.y+t.h:i.y+i.h;return c<=n?0:(a-o)*(c-n)}static area(t){return t.w*t.h}static sort(t,i=1){let o=Number.MAX_SAFE_INTEGER;return t.sort((a,n)=>{let c=i*((a.y??o)-(n.y??o));return c===0?i*((a.x??o)-(n.x??o)):c})}static find(t,i){return i?t.find(o=>o.id===i):void 0}static findInGrid(t,i,o){let a=t.engine.nodes.find(n=>String(n.id)===i);if(a||!o)return a;for(let n of t.engine.nodes)if(n.subGrid){let c=L5.findInGrid(n.subGrid,i);if(c)return c}}static toBool(t){return typeof t=="boolean"?t:typeof t=="string"?(t=t.toLowerCase(),!(t===""||t==="no"||t==="false"||t==="0")):!!t}static toNumber(t){return t===null||t.length===0?void 0:Number(t)}static parseHeight(t){let i,o="px";if(typeof t=="string")if(t==="auto"||t==="")i=0;else{let a=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!a)throw new Error(`Invalid height val = ${t}`);o=a[2]||"px",i=parseFloat(a[1])}else i=t;return{h:i,unit:o}}static defaults(t,...i){return i.forEach(o=>{for(let a in o){if(!Object.prototype.hasOwnProperty.call(o,a))return;t[a]===null||t[a]===void 0?t[a]=o[a]:typeof o[a]=="object"&&typeof t[a]=="object"&&L5.defaults(t[a],o[a])}}),t}static same(t,i){if(typeof t!="object")return t==i;if(typeof t!=typeof i)return!1;let o=t,a=i;if(Object.keys(o).length!==Object.keys(a).length)return!1;for(let n in o)if(o[n]!==a[n])return!1;return!0}static copyPos(t,i,o=!1){return i.x!==void 0&&(t.x=i.x),i.y!==void 0&&(t.y=i.y),i.w!==void 0&&(t.w=i.w),i.h!==void 0&&(t.h=i.h),o&&(i.minW&&(t.minW=i.minW),i.minH&&(t.minH=i.minH),i.maxW&&(t.maxW=i.maxW),i.maxH&&(t.maxH=i.maxH)),t}static samePos(t,i){return t&&i&&t.x===i.x&&t.y===i.y&&(t.w||1)===(i.w||1)&&(t.h||1)===(i.h||1)}static sanitizeMinMax(t){t.minW||delete t.minW,t.minH||delete t.minH,t.maxW||delete t.maxW,t.maxH||delete t.maxH}static removeInternalAndSame(t,i){if(typeof t!="object"||typeof i!="object"||!t||!i||Array.isArray(t)||Array.isArray(i))return;let o=t,a=i;for(let n in o){let c=o[n],d=a[n];n[0]==="_"||c===d?delete o[n]:c&&typeof c=="object"&&d!==void 0&&(L5.removeInternalAndSame(c,d),Object.keys(c).length||delete o[n])}}static removeInternalForSave(t,i=!0){let o=t;for(let a in o)(a[0]==="_"||o[a]===null||o[a]===void 0)&&delete o[a];delete t.grid,i&&delete t.el,t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,t.locked||delete t.locked,(t.w===1||t.w===t.minW)&&delete t.w,(t.h===1||t.h===t.minH)&&delete t.h}static throttle(t,i){let o=!1;return(...a)=>{o||(o=!0,setTimeout(()=>{t(...a),o=!1},i))}}static removePositioningStyles(t){let i=t.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(t){if(!t)return document.scrollingElement||document.documentElement;let i=getComputedStyle(t).overflowY;return(i==="auto"||i==="scroll")&&t.scrollHeight>t.clientHeight?t:L5.getScrollElement(t.parentElement??void 0)}static updateScrollResize(t,i,o){let a=L5.getScrollElement(i),n=a.clientHeight,c=a===L5.getScrollElement()?0:a.getBoundingClientRect().top,d=t.clientY-c,m=d<o,C=d>n-o;m?a.scrollBy({behavior:"smooth",top:d-o}):C&&a.scrollBy({behavior:"smooth",top:o-(n-d)})}static clone(t){return t==null||typeof t!="object"?t:t instanceof Array?[...t]:Y({},t)}static cloneDeep(t){let i=["parentGrid","el","grid","subGrid","engine"],o=L5.clone(t);for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&typeof o[a]=="object"&&a.substring(0,2)!=="__"&&!i.find(n=>n===a)&&(o[a]=L5.cloneDeep(t[a]));return o}static cloneNode(t){let i=t.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(t,i){let o;typeof i=="string"?o=L5.getElement(i):o=i,o&&o.appendChild(t)}static addElStyles(t,i){if(i instanceof Object){let o=t.style;for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&(Array.isArray(i[a])?i[a].forEach(n=>{o[a]=n}):o[a]=i[a])}}static initEvent(t,i){let o={type:i.type},a={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:t.target},n=t;return["altKey","ctrlKey","metaKey","shiftKey"].forEach(c=>o[c]=n[c]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(c=>o[c]=n[c]),Y(Y({},o),a)}static simulateMouseEvent(t,i,o){let a=t,n=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,ctrlKey:a.ctrlKey??!1,altKey:a.altKey??!1,shiftKey:a.shiftKey??!1,metaKey:a.metaKey??!1,button:0,relatedTarget:t.target});(o||t.target).dispatchEvent(n)}static getValuesFromTransformedElement(t){let i=document.createElement("div");L5.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),t.appendChild(i);let o=i.getBoundingClientRect();return t.removeChild(i),i.remove(),{xScale:1/o.width,yScale:1/o.height,xOffset:o.left,yOffset:o.top}}static swap(t,i,o){if(!t)return;let a=t,n=a[i];a[i]=a[o],a[o]=n}static canBeRotated(t){return!(!t||t.w===t.h||t.locked||t.noResize||t.grid?.opts.disableResize||t.minW&&t.minW===t.maxW||t.minH&&t.minH===t.maxH)}},hx=(()=>{class e{constructor(i={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=i.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=i.maxRow??0,this._float=i.float??!1,this.nodes=i.nodes||[],this.onChange=i.onChange??(()=>{})}batchUpdate(i=!0,o=!0){return!!this.batchMode===i?this:(this.batchMode=i,i?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.nodes.some(a=>a._updating)||this.saveInitial()):(this._float=this._prevFloat??!1,delete this._prevFloat,o&&this._packNodes(),this._notify()),this)}_useEntireRowArea(i,o){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!i._moving||i._skipDown||o.y<=i.y)}_fixCollisions(i,o=i,a,n={}){if(this.sortNodes(-1),a=a||this.collide(i,o),!a)return!1;if(i._moving&&!i._isExternal&&!n.nested&&!this.float&&this.swap(i,a))return!0;let c=o;!this._loading&&this._useEntireRowArea(i,o)&&(c={x:0,w:this.column,y:o.y,h:o.h},a=this.collide(i,c,n.skip));let d=!1,m={nested:!0,pack:!1},C=0;for(;a=a||this.collide(i,c,n.skip);){if(C++>this.nodes.length*2)throw new Error("Infinite collide check");let x;if(a.locked||this._loading||i._moving&&!i._skipDown&&o.y>i.y&&!this.float&&(!this.collide(a,De(Y({},a),{y:i.y}),i)||!this.collide(a,De(Y({},a),{y:o.y-a.h}),i))){i._skipDown=i._skipDown||o.y>i.y;let w=Y(De(Y({},o),{y:a.y+a.h}),m);x=this._loading&&K.samePos(i,w)?!0:this.moveNode(i,w),(a.locked||this._loading)&&x?K.copyPos(o,i):!a.locked&&x&&n.pack&&(this._packNodes(),o.y=a.y+a.h,K.copyPos(i,o)),d=d||x}else x=this.moveNode(a,Y(De(Y({},a),{y:o.y+o.h,skip:i}),m));if(!x)return d;a=void 0}return d}collide(i,o=i,a){let n=i._id,c=a?._id;return this.nodes.find(d=>d._id!==n&&d._id!==c&&K.isIntercepted(d,o))}collideAll(i,o=i,a){let n=i._id,c=a?._id;return this.nodes.filter(d=>d._id!==n&&d._id!==c&&K.isIntercepted(d,o))}directionCollideCoverage(i,o,a){if(!o.rect||!i._rect)return;let n=i._rect,c=Y({},o.rect);c.y>n.y?(c.h=c.h+c.y-n.y,c.y=n.y):c.h=c.h+n.y-c.y,c.x>n.x?(c.w=c.w+c.x-n.x,c.x=n.x):c.w=c.w+n.x-c.x;let d,m=.5;for(let C of a){if(C.locked||!C._rect)continue;let x=C._rect,w=Number.MAX_VALUE,B=Number.MAX_VALUE;n.y<x.y?w=(c.y+c.h-x.y)/x.h:n.y+n.h>x.y+x.h&&(w=(x.y+x.h-c.y)/x.h),n.x<x.x?B=(c.x+c.w-x.x)/x.w:n.x+n.w>x.x+x.w&&(B=(x.x+x.w-c.x)/x.w);let S=Math.min(B,w);S>m&&(m=S,d=C)}return o.collide=d,d}cacheRects(i,o,a,n,c,d){return this.nodes.forEach(m=>m._rect={y:m.y*o+a,x:m.x*i+d,w:m.w*i-d-n,h:m.h*o-a-c}),this}swap(i,o){if(!o||o.locked||!i||i.locked)return!1;function a(){let c=o.x,d=o.y;return o.x=i.x,o.y=i.y,i.h!=o.h?(i.x=c,i.y=o.y+o.h):i.w!=o.w?(i.x=o.x+o.w,i.y=d):(i.x=c,i.y=d),i._dirty=o._dirty=!0,!0}let n;if(i.w===o.w&&i.h===o.h&&(i.x===o.x||i.y===o.y)&&(n=K.isTouching(i,o)))return a();if(n!==!1){if(i.w===o.w&&i.x===o.x&&(n||(n=K.isTouching(i,o)))){if(o.y<i.y){let c=i;i=o,o=c}return a()}if(n!==!1){if(i.h===o.h&&i.y===o.y&&(n||(n=K.isTouching(i,o)))){if(o.x<i.x){let c=i;i=o,o=c}return a()}return!1}}}isAreaEmpty(i,o,a,n){let c={x:i||0,y:o||0,w:a||1,h:n||1};return!this.collide(c)}compact(i="compact",o=!0){if(this.nodes.length===0)return this;o&&this.sortNodes();let a=this.batchMode;a||this.batchUpdate();let n=this._inColumnResize;n||(this._inColumnResize=!0);let c=this.nodes;return this.nodes=[],c.forEach((d,m,C)=>{let x;d.locked||(d.autoPosition=!0,i==="list"&&m&&(x=C[m-1])),this.addNode(d,!1,x)}),n||delete this._inColumnResize,a||this.batchUpdate(!1),this}set float(i){this._float!==i&&(this._float=i||!1,i||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(i=1){return this.nodes=K.sort(this.nodes,i),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(i=>{if(i._updating||i._orig===void 0||i.y===i._orig.y)return;let o=i.y;for(;o>i._orig.y;)--o,this.collide(i,{x:i.x,y:o,w:i.w,h:i.h})||(i._dirty=!0,i.y=o)}):this.nodes.forEach((i,o)=>{if(!i.locked)for(;i.y>0;){let a=o===0?0:i.y-1;if(!(o===0||!this.collide(i,{x:i.x,y:a,w:i.w,h:i.h})))break;i._dirty=i.y!==a,i.y=a}}),this)}prepareNode(i,o){i._id=i._id??e._idSeq++;let a=i.id;if(a){let c=1;for(;this.nodes.find(d=>d.id===i.id&&d!==i);)i.id=a+"_"+c++}(i.x===void 0||i.y===void 0||i.x===null||i.y===null)&&(i.autoPosition=!0);let n={x:0,y:0,w:1,h:1};return K.defaults(i,n),i.autoPosition||delete i.autoPosition,i.noResize||delete i.noResize,i.noMove||delete i.noMove,K.sanitizeMinMax(i),typeof i.x=="string"&&(i.x=Number(i.x)),typeof i.y=="string"&&(i.y=Number(i.y)),typeof i.w=="string"&&(i.w=Number(i.w)),typeof i.h=="string"&&(i.h=Number(i.h)),isNaN(i.x)&&(i.x=n.x,i.autoPosition=!0),isNaN(i.y)&&(i.y=n.y,i.autoPosition=!0),isNaN(i.w)&&(i.w=n.w),isNaN(i.h)&&(i.h=n.h),this.nodeBoundFix(i,o),i}nodeBoundFix(i,o){let a=i._orig||K.copyPos({},i);if(i.maxW&&(i.w=Math.min(i.w||1,i.maxW)),i.maxH&&(i.h=Math.min(i.h||1,i.maxH)),i.minW&&(i.w=Math.max(i.w||1,i.minW)),i.minH&&(i.h=Math.max(i.h||1,i.minH)),(i.x||0)+(i.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&i._id!=null&&this.findCacheLayout(i,this.defaultColumn)===-1){let n=Y({},i);n.autoPosition||n.x===void 0?(delete n.x,delete n.y):n.x=Math.min(this.defaultColumn-1,n.x),n.w=Math.min(this.defaultColumn,n.w||1),this.cacheOneLayout(n,this.defaultColumn)}return i.w>this.column?i.w=this.column:i.w<1&&(i.w=1),this.maxRow&&i.h>this.maxRow?i.h=this.maxRow:i.h<1&&(i.h=1),i.x<0&&(i.x=0),i.y<0&&(i.y=0),i.x+i.w>this.column&&(o?i.w=this.column-i.x:i.x=this.column-i.w),this.maxRow&&i.y+i.h>this.maxRow&&(o?i.h=this.maxRow-i.y:i.y=this.maxRow-i.h),K.samePos(i,a)||(i._dirty=!0),this}getDirtyNodes(i){return i?this.nodes.filter(o=>o._dirty&&o._orig&&!K.samePos(o,o._orig)):this.nodes.filter(o=>o._dirty)}_notify(i){if(this.batchMode||!this.onChange)return this;let o=(i||[]).concat(this.getDirtyNodes());return this.onChange(o),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(i=>{delete i._dirty,delete i._lastTried}),this)}saveInitial(){return this.nodes.forEach(i=>{i._orig=K.copyPos({},i),delete i._dirty}),this._hasLocked=this.nodes.some(i=>i.locked),this}restoreInitial(){return this.nodes.forEach(i=>{!i._orig||K.samePos(i,i._orig)||(K.copyPos(i,i._orig),i._dirty=!0)}),this._notify(),this}findEmptyPosition(i,o=this.nodes,a=this.column,n){let c=n?n.y*a+(n.x+n.w):0,d=!1;for(let m=c;!d;++m){let C=m%a,x=Math.floor(m/a);if(C+i.w>a)continue;let w={x:C,y:x,w:i.w,h:i.h};o.find(B=>K.isIntercepted(w,B))||((i.x!==C||i.y!==x)&&(i._dirty=!0),i.x=C,i.y=x,delete i.autoPosition,d=!0)}return d}addNode(i,o=!1,a){let n=this.nodes.find(d=>d._id===i._id);if(n)return n;this._inColumnResize?this.nodeBoundFix(i):this.prepareNode(i),delete i._temporaryRemoved,delete i._removeDOM;let c=!1;return i.autoPosition&&this.findEmptyPosition(i,this.nodes,this.column,a)&&(delete i.autoPosition,c=!0),this.nodes.push(i),o&&this.addedNodes.push(i),c||this._fixCollisions(i),this.batchMode||this._packNodes()._notify(),i}removeNode(i,o=!0,a=!1){return this.nodes.find(n=>n._id===i._id)?(a&&this.removedNodes.push(i),o&&(i._removeDOM=!0),this.nodes=this.nodes.filter(n=>n._id!==i._id),i._isAboutToRemove||this._packNodes(),this._notify([i]),this):this}removeAll(i=!0,o=!0){if(delete this._layouts,!this.nodes.length)return this;i&&this.nodes.forEach(n=>n._removeDOM=!0);let a=this.nodes;return this.removedNodes=o?a:[],this.nodes=[],this._notify(a)}moveNodeCheck(i,o){if(!this.changedPosConstrain(i,o))return!1;if(o.pack=!0,!this.maxRow)return this.moveNode(i,o);let a,n=new e({column:this.column,float:this.float,nodes:this.nodes.map(d=>d._id===i._id?(a=Y({},d),a):Y({},d))});if(!a)return!1;let c=n.moveNode(a,o)&&n.getRow()<=Math.max(this.getRow(),this.maxRow);if(!c&&!o.resizing&&o.collide&&!i._isExternal){let d=o.collide.el?.gridstackNode;if(d&&this.swap(i,d))return this._notify(),!0}return c?(n.nodes.filter(d=>d._dirty).forEach(d=>{let m=this.nodes.find(C=>C._id===d._id);m&&(K.copyPos(m,d),m._dirty=!0)}),this._notify(),!0):!1}willItFit(i){if(delete i._willFitPos,!this.maxRow)return!0;let o=new e({column:this.column,float:this.float,nodes:this.nodes.map(n=>Y({},n))}),a=Y({},i);return this.cleanupNode(a),delete a.el,delete a._id,delete a.content,delete a.grid,o.addNode(a),o.getRow()<=this.maxRow?(i._willFitPos=K.copyPos({},a),!0):!1}changedPosConstrain(i,o){return o.w=o.w||i.w,o.h=o.h||i.h,i.x!==o.x||i.y!==o.y?!0:(i.maxW&&(o.w=Math.min(o.w,i.maxW)),i.maxH&&(o.h=Math.min(o.h,i.maxH)),i.minW&&(o.w=Math.max(o.w,i.minW)),i.minH&&(o.h=Math.max(o.h,i.minH)),i.w!==o.w||i.h!==o.h)}moveNode(i,o){if(!i||!o)return!1;let a=!1;o.pack===void 0&&!this.batchMode&&(a=o.pack=!0),typeof o.x!="number"&&(o.x=i.x),typeof o.y!="number"&&(o.y=i.y),typeof o.w!="number"&&(o.w=i.w),typeof o.h!="number"&&(o.h=i.h);let n=i.w!==o.w||i.h!==o.h,c=K.copyPos({},i,!0);if(K.copyPos(c,o),this.nodeBoundFix(c,n),K.copyPos(o,c),!o.forceCollide&&K.samePos(i,o))return!1;let d=K.copyPos({},i),m=this.collideAll(i,c,o.skip),C=!0;if(m.length){let x=i._moving&&!o.nested,w=x?this.directionCollideCoverage(i,o,m):m[0];if(x&&w&&i.grid?.opts?.subGridDynamic&&!i.grid._isTemp){let B=K.areaIntercept(o.rect,w._rect),S=K.area(o.rect),D=K.area(w._rect);B/(S<D?S:D)>.8&&(w.grid.makeSubGrid(w.el,void 0,i),w=void 0)}w?C=!this._fixCollisions(i,c,w,o):(C=!1,a&&delete o.pack)}return C&&!K.samePos(i,c)&&(i._dirty=!0,K.copyPos(i,c)),o.pack&&this._packNodes()._notify(),!K.samePos(i,d)}getRow(){return this.nodes.reduce((i,o)=>Math.max(i,o.y+o.h),0)}beginUpdate(i){return i._updating||(i._updating=!0,delete i._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let i=this.nodes.find(o=>o._updating);return i&&(delete i._updating,delete i._skipDown),this}save(i=!0,o,a){let n=this._layouts?.length||0,c;n&&(a?a!==this.column&&(c=this._layouts[a]):this.column!==n-1&&(c=this._layouts[n-1]));let d=[];return this.sortNodes(),this.nodes.forEach(m=>{let C=c?.find(w=>w._id===m._id),x=Y(Y({},m),C||{});K.removeInternalForSave(x,!i),o&&o(m,x),d.push(x)}),d}layoutsNodesChange(i){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((o,a)=>{if(!(!o||a===this.column))if(a<this.column)this._layouts[a]=void 0;else{let n=a/this.column;i.forEach(c=>{if(!c._orig)return;let d=o.find(m=>m._id===c._id);d&&(d.y>=0&&c.y!==c._orig.y&&(d.y=d.y+(c.y-c._orig.y),d.y<0&&(d.y=0)),c.x!==c._orig.x&&(d.x=Math.round(c.x*n),d.x<0&&(d.x=0)),c.w!==c._orig.w&&(d.w=Math.round(c.w*n),d.w<1&&(d.w=1)))})}}),this)}columnChanged(i,o,a="moveScale"){if(!this.nodes.length||!o||i===o)return this;let n=a==="compact"||a==="list";n&&this.sortNodes(1),o<i&&this.cacheLayout(this.nodes,i),this.batchUpdate();let c=[],d=n?this.nodes:K.sort(this.nodes,-1);if(o>i&&this._layouts){let m=this._layouts[o]||[],C=this._layouts.length-1;!m.length&&i!==C&&this._layouts[C]?.length&&(i=C,this._layouts[C].forEach(x=>{let w=d.find(B=>B._id===x._id);w&&(!n&&!x.autoPosition&&(w.x=x.x??w.x,w.y=x.y??w.y),w.w=x.w??w.w,(x.x==null||x.y===void 0)&&(w.autoPosition=!0))})),m.forEach(x=>{let w=d.findIndex(B=>B._id===x._id);if(w!==-1){let B=d[w];if(n){B.w=x.w;return}(x.autoPosition||isNaN(x.x)||isNaN(x.y))&&this.findEmptyPosition(x,c),x.autoPosition||(B.x=x.x??B.x,B.y=x.y??B.y,B.w=x.w??B.w,c.push(B)),d.splice(w,1)}})}if(n)this.compact(a,!1);else{if(d.length)if(typeof a=="function")a(o,i,c,d);else{let m=n||a==="none"?1:o/i,C=a==="move"||a==="moveScale",x=a==="scale"||a==="moveScale";d.forEach(w=>{w.x=o===1?0:C?Math.round(w.x*m):Math.min(w.x,o-1),w.w=o===1||i===1?1:x?Math.round(w.w*m)||1:Math.min(w.w,o),c.push(w)}),d=[]}c=K.sort(c,-1),this._inColumnResize=!0,this.nodes=[],c.forEach(m=>{this.addNode(m,!1),delete m._orig})}return this.nodes.forEach(m=>delete m._orig),this.batchUpdate(!1,!n),delete this._inColumnResize,this}cacheLayout(i,o,a=!1){let n=[];return i.forEach((c,d)=>{if(c._id===void 0){let m=c.id?this.nodes.find(C=>C.id===c.id):void 0;c._id=m?._id??e._idSeq++}n[d]={x:c.x,y:c.y,w:c.w,_id:c._id}}),this._layouts=a?[]:this._layouts||[],this._layouts[o]=n,this}cacheOneLayout(i,o){i._id=i._id??e._idSeq++;let a={x:i.x,y:i.y,w:i.w,_id:i._id};(i.autoPosition||i.x===void 0)&&(delete a.x,delete a.y,i.autoPosition&&(a.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[o]=this._layouts[o]||[];let n=this.findCacheLayout(i,o);return n===-1?this._layouts[o].push(a):this._layouts[o][n]=a,this}findCacheLayout(i,o){return this._layouts?.[o]?.findIndex(a=>a._id===i._id)??-1}removeNodeFromLayoutCache(i){if(this._layouts)for(let o=0;o<this._layouts.length;o++){let a=this.findCacheLayout(i,o);a!==-1&&this._layouts[o].splice(a,1)}}cleanupNode(i){let o=i;for(let a in o)a[0]==="_"&&a!=="_id"&&delete o[a];return this}}return e._idSeq=0,e})(),r5={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"},He=class{},uo=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0&&window.matchMedia("(any-pointer: coarse)").matches||navigator.msMaxTouchPoints>0),s5=class{};function Ac(e,t){e.touches.length>1||(e.cancelable&&e.preventDefault(),K.simulateMouseEvent(e.changedTouches[0],t))}function Ak(e,t){e.cancelable&&e.preventDefault(),K.simulateMouseEvent(e,t)}function xc(e){s5.touchHandled||(s5.touchHandled=!0,Ac(e,"mousedown"))}function Sc(e){s5.touchHandled&&Ac(e,"mousemove")}function Ic(e){if(!s5.touchHandled)return;s5.pointerLeaveTimeout&&(window.clearTimeout(s5.pointerLeaveTimeout),delete s5.pointerLeaveTimeout);let t=!!He.dragElement;Ac(e,"mouseup"),t||Ac(e,"click"),s5.touchHandled=!1}function Tc(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function dx(e){He.dragElement&&e.pointerType!=="mouse"&&Ak(e,"mouseenter")}function ux(e){He.dragElement&&e.pointerType!=="mouse"&&(s5.pointerLeaveTimeout=window.setTimeout(()=>{delete s5.pointerLeaveTimeout,Ak(e,"mouseleave")},10))}var whe=(()=>{class e{constructor(i,o,a){this.host=i,this.dir=o,this.option=a,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(i){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",i)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${e.prefix}${this.dir}`),this.el.addEventListener("mousedown",this._mouseDown),uo&&(this.el.addEventListener("touchstart",xc),this.el.addEventListener("pointerdown",Tc)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),uo&&(this.el.removeEventListener("touchstart",xc),this.el.removeEventListener("pointerdown",Tc)),this.option.element||this.host.removeChild(this.el),this}_mouseDown(i){this.mouseDownEvent=i,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),uo&&(this.el.addEventListener("touchmove",Sc),this.el.addEventListener("touchend",Ic)),i.stopPropagation(),i.preventDefault()}_mouseMove(i){let o=this.mouseDownEvent;this.moving?this._triggerEvent("move",i):Math.abs(i.x-o.x)+Math.abs(i.y-o.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",i),document.addEventListener("keydown",this._keyEvent)),i.stopPropagation()}_mouseUp(i){this.moving&&(this._triggerEvent("stop",i),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),uo&&(this.el.removeEventListener("touchmove",Sc),this.el.removeEventListener("touchend",Ic)),delete this.moving,delete this.mouseDownEvent,i.stopPropagation(),i.preventDefault()}_keyEvent(i){i.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(i,o){let a=this.option;return a[i]&&a[i](o),this}}return e.prefix="ui-resizable-",e})(),nv=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){this._eventRegister={}}triggerEvent(e,t){if(!this.disabled&&this._eventRegister[e])return this._eventRegister[e](t)}},yhe=(()=>{class e extends nv{constructor(i,o={}){super(),this.el=i,this.option=o,this.rectScale={x:1,y:1},this._ui=()=>{let a=this.el.parentElement.getBoundingClientRect(),n={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},c=this.temporalRect||n;return{position:{left:this.option.rtl?(a.right-c.right)*this.rectScale.x:(c.left-a.left)*this.rectScale.x,top:(c.top-a.top)*this.rectScale.y},size:{width:c.width*this.rectScale.x,height:c.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(!!this.option.autoHide),this._setupHandlers()}on(i,o){super.on(i,o)}off(i){super.off(i)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(!!this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(i){let o=i.handles&&i.handles!==this.option.handles,a=i.autoHide&&i.autoHide!==this.option.autoHide;return Object.assign(this.option,i),o&&(this._removeHandlers(),this._setupHandlers()),a&&this._setupAutoHide(!!this.option.autoHide),this}_setupAutoHide(i){return i?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),He.overResizeElement===this&&delete He.overResizeElement),this}_mouseOver(i){He.overResizeElement||He.dragElement||(He.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(i){He.overResizeElement===this&&(delete He.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=(this.option.handles??"se").split(",").map(i=>i.trim()).map(i=>new whe(this.el,i,{element:this.option.element,start:o=>this._resizeStart(o),stop:o=>this._resizeStop(o),move:o=>this._resizing(o,i)})),this}_resizeStart(i){this.sizeToContent=K.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=K.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=i,this._setupHelper(),this._applyChange();let o=K.initEvent(i,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(o,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",o),this}_resizing(i,o){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(i,o),this._applyChange();let a=K.initEvent(i,{type:"resize",target:this.el});return a.resizeDir=o,a.hasMovedX=this.option.rtl?o.includes("e"):o.includes("w"),a.hasMovedY=o.includes("n"),this.option.resize&&this.option.resize(a,this._ui()),this.triggerEvent("resize",a),this}_resizeStop(i){let o=K.initEvent(i,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(o),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",o),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=e._originStyleProp.map(a=>this.el.style[a]);let i=this.el.parentElement;this.parentOriginStylePosition=i.style.position;let o=K.getValuesFromTransformedElement(i);return this.rectScale={x:o.xScale,y:o.yScale},getComputedStyle(i).position.match(/static/)&&(i.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return e._originStyleProp.forEach((i,o)=>{this.el.style[i]=this.elOriginStyleVal[o]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(i,o){let a=this.startEvent,n={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},c=i.clientX-a.clientX,d=this.sizeToContent?0:i.clientY-a.clientY,m=!1,C=!1,x=this.option.rtl;!x&&o.indexOf("e")>-1?n.width+=c:x&&o.indexOf("w")>-1?n.width-=c:!x&&o.indexOf("w")>-1?(n.width-=c,n.left+=c,m=!0):x&&o.indexOf("e")>-1&&(n.width+=c,n.right+=c,m=!0),o.indexOf("s")>-1?n.height+=d:o.indexOf("n")>-1&&(n.height-=d,n.top+=d,C=!0);let w=this._constrainSize(n.width,n.height,m,C);return Math.round(n.width)!==Math.round(w.width)&&(!x&&o.indexOf("w")>-1?n.left+=n.width-w.width:x&&o.indexOf("e")>-1&&(n.right-=n.width-w.width),n.width=w.width),Math.round(n.height)!==Math.round(w.height)&&(o.indexOf("n")>-1&&(n.top+=n.height-w.height),n.height=w.height),n}_constrainSize(i,o,a,n){let c=this.option,d=(a?c.maxWidthMoveLeft:c.maxWidth)||Number.MAX_SAFE_INTEGER,m=(c.minWidth??0)/this.rectScale.x||i,C=(n?c.maxHeightMoveUp:c.maxHeight)||Number.MAX_SAFE_INTEGER,x=(c.minHeight??0)/this.rectScale.y||o,w=Math.min(d,Math.max(m,i)),B=Math.min(C,Math.max(x,o));return{width:w,height:B}}_applyChange(){let i={left:0,right:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let a=this.el.parentElement,{left:n,right:c,top:d}=a.getBoundingClientRect();i={left:n,right:c,top:d,width:0,height:0}}if(!this.temporalRect)return this;let o=i;return Object.entries(this.temporalRect).forEach(([a,n])=>{if(this.option.rtl?a==="left":a==="right")return;let c=a==="width"||a==="left"||a==="right"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1,d;a==="right"?d=(i.right-n)*this.rectScale.x+"px":d=(n-o[a])*c+"px",this.el.style[a]=d}),this}_removeHandlers(){return this.handlers.forEach(i=>i.destroy()),delete this.handlers,this}}return e._originStyleProp=["width","height","position","left","right","top","opacity","zIndex"],e})(),Ahe='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',xhe=(()=>{class e extends nv{constructor(i,o={}){super(),this.el=i,this.option=o,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},this._autoScrollTick=()=>{let c=this.helper,d=this._autoScrollContainer;if(!c||!d){this._stopScrolling();return}let m=this._getClipping(c,d);if(m===0){this._stopScrolling();return}if(!this._autoScrollMaxSpeed){let S=window.innerHeight||document.documentElement.clientHeight;this._autoScrollMaxSpeed=Math.max(S/150,4)}let C=Math.abs(m),x=Math.min(C*.5,this._autoScrollMaxSpeed),w=m>0?x:-x,B=d.scrollTop;if(d.scrollTop+=w,d.scrollTop===B){this._stopScrolling();return}this.dragging&&this.lastDrag&&(this._dragFollow(this.lastDrag),this._callDrag(this.lastDrag)),this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick)};let a=o?.handle?.substring(1),n=i.gridstackNode;this.dragEls=!a||i.classList.contains(a)?[i]:n?.subGrid?[i.querySelector(o.handle)||i]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[i]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}getAllHandles(){return Array.from(this.el.querySelectorAll(this.option.handle)).filter(i=>{if(!(i instanceof HTMLElement))return!1;let o=i.closest(".grid-stack-item");return o===this.el||!o})}on(i,o){super.on(i,o)}off(i){super.off(i)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(i=>{i.addEventListener("mousedown",this._mouseDown),uo&&(i.addEventListener("touchstart",xc),i.addEventListener("pointerdown",Tc))}),this.el.classList.remove("ui-draggable-disabled"))}disable(i=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(o=>{o.removeEventListener("mousedown",this._mouseDown),uo&&(o.removeEventListener("touchstart",xc),o.removeEventListener("pointerdown",Tc))}),i||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.option,super.destroy()}updateOption(i){return Object.assign(this.option,i),this}refreshHandles(){let i=this.disabled;i||this.disable(!0);let o=this.option?.handle?.substring(1),a=this.el.gridstackNode;this.dragEls=!o||this.el.classList.contains(o)?[this.el]:a?.subGrid?[this.el.querySelector(this.option.handle)||this.el]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[this.el]),i||this.enable()}_mouseDown(i){return i.isTrusted&&(s5.touchHandled&&(s5.touchHandled=!1),He.mouseHandled&&i.timeStamp!==He.mouseHandledTimeStamp&&delete He.mouseHandled),He.mouseHandled||i.button!==0||!this.dragEls.find(o=>o===i.target)&&i.target.closest(Ahe)||this.option.cancel&&i.target.closest(this.option.cancel)||(this.mouseDownEvent=i,delete this.dragging,delete He.dragElement,delete He.dropElement,delete this._autoScrollMaxSpeed,delete this._autoScrollContainer,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),uo&&i.currentTarget&&(i.currentTarget.addEventListener("touchmove",Sc),i.currentTarget.addEventListener("touchend",Ic)),i.preventDefault(),document.activeElement&&document.activeElement.blur(),He.mouseHandled=!0,He.mouseHandledTimeStamp=i.timeStamp),!0}_callDrag(i){if(!this.dragging)return;let o=K.initEvent(i,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(o,this.ui()),this.triggerEvent("drag",o)}_mouseMove(i){let o=this.mouseDownEvent;if(this.lastDrag=i,this.dragging)if(this._dragFollow(i),He.pauseDrag){let a=Number.isInteger(He.pauseDrag)?He.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(i),a)}else this._callDrag(i);else if(Math.abs(i.x-o.x)+Math.abs(i.y-o.y)>3){this.dragging=!0,He.dragElement=this;let a=this.el.gridstackNode?.grid;a?He.dropElement=a.el.ddElement?.ddDroppable:delete He.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=K.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(i,this.el,this.helperContainment),this._setupHelperStyle(i);let n=K.initEvent(i,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(n,this.ui()),this.triggerEvent("dragstart",n),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(i){if(this._stopScrolling(),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),uo&&i.currentTarget&&(i.currentTarget.removeEventListener("touchmove",Sc,!0),i.currentTarget.removeEventListener("touchend",Ic,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),He.dropElement?.el===this.el.parentElement&&delete He.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper&&this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let o=K.initEvent(i,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(o),this.triggerEvent("dragstop",o),He.dropElement&&He.dropElement.drop(i)}delete this.helper,delete this.mouseDownEvent,delete He.dragElement,delete He.dropElement,delete He.mouseHandled,delete He.mouseHandledTimeStamp,i.preventDefault()}_keyEvent(i){let o=this.el.gridstackNode,a=o?.grid||He.dropElement?.el?.gridstack;if(i.key==="Escape")o&&o._origRotate&&(o._orig=o._origRotate,delete o._origRotate),a?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(o&&a&&(i.key==="r"||i.key==="R")){if(!K.canBeRotated(o))return;o._origRotate=o._origRotate||Y({},o._orig),delete o._moving,a.setAnimation(!1).rotate(o.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetX}).setAnimation(),o._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,o.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",K.swap(o._orig,"w","h"),delete o._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let i=this.el;return typeof this.option.helper=="function"?i=this.option.helper(this.el):this.option.helper==="clone"&&(i=K.cloneNode(this.el)),i.parentElement||K.appendTo(i,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo??"body"),this.dragElementOriginStyle=e.originStyleProp.map(o=>this.el.style[o]),i}_setupHelperStyle(i){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let o=this.helper.style;return o.pointerEvents="none",o.width=this.dragOffset.width+"px",o.height=this.dragOffset.height+"px",o.willChange="left, right, top",o.position="fixed",this._dragFollow(i),o.transition="none",setTimeout(()=>{this.helper&&(o.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),(this.el._gridstackNodeOrig||this.el.gridstackNode)?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){let i=this.helper,o=this.dragElementOriginStyle,a=e.originStyleProp.indexOf("transition"),n=o[a]||null;i.style.transition=o[a]="none";let c=i.style;e.originStyleProp.forEach((d,m)=>c[d]=o[m]||null),setTimeout(()=>i.style.transition=n||"",50)}return delete this.dragElementOriginStyle,this}_dragFollow(i){let o=this.helper.style,a=this.dragOffset;this.option.rtl?(o.right=(window.innerWidth-i.clientX+a.offsetX)*this.dragTransform.xScale+"px",o.left&&(o.left="")):(o.left=(i.clientX+a.offsetX)*this.dragTransform.xScale+"px",o.right&&(o.right="")),o.top=(i.clientY+a.offsetTop)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(i,o,a){let n=0,c=0;a&&(n=this.dragTransform.xOffset,c=this.dragTransform.yOffset);let d=o.getBoundingClientRect(),m=this.option.rtl?d.right:d.left,C=this.option.rtl?i.clientX-d.right+n:-i.clientX+d.left-n;return{x:m,top:d.top,offsetX:C,offsetTop:-i.clientY+d.top-c,width:d.width*this.dragTransform.xScale,height:d.height*this.dragTransform.yScale}}updateScrollPosition(i){this._autoScrollContainer=K.getScrollElement(i),this._getClipping(this.helper,this._autoScrollContainer)===0?this._stopScrolling():this._autoScrollAnimId||(this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick))}_getClipping(i,o){let a=i.getBoundingClientRect(),n=o.getBoundingClientRect(),c=window.innerHeight||document.documentElement.clientHeight;if(a.bottom<n.top||a.top>n.bottom)return 0;let d=a.bottom-Math.min(n.bottom,c),m=a.top-Math.max(n.top,0);return m<0?m:d>0?d:0}_stopScrolling(){this._autoScrollAnimId&&(cancelAnimationFrame(this._autoScrollAnimId),delete this._autoScrollAnimId)}ui(){let i=this.el.parentElement.getBoundingClientRect(),o=this.helper.getBoundingClientRect(),a=this.option.rtl?(i.right-o.right)*this.dragTransform.xScale:(o.left-i.left)*this.dragTransform.xScale;return{position:{top:(o.top-i.top)*this.dragTransform.yScale,left:a}}}}return e.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","right","top","minWidth","willChange"],e})(),She=class extends nv{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.eventEl=this.el.closest(".grid-stack-item")||this.el,this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.eventEl.addEventListener("mouseenter",this._mouseEnter),this.eventEl.addEventListener("mouseleave",this._mouseLeave),uo&&(this.eventEl.addEventListener("pointerenter",dx),this.eventEl.addEventListener("pointerleave",ux)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.eventEl.removeEventListener("mouseenter",this._mouseEnter),this.eventEl.removeEventListener("mouseleave",this._mouseLeave),uo&&(this.eventEl.removeEventListener("pointerenter",dx),this.eventEl.removeEventListener("pointerleave",ux)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.assign(this.option,e),this._setupAccept(),this}_mouseEnter(e){if(!He.dragElement||s5.touchHandled&&e.isTrusted||!this._canDrop(He.dragElement.el))return;e.preventDefault(),e.stopPropagation(),He.dragElement._stopScrolling(),He.dropElement&&He.dropElement!==this&&He.dropElement._mouseLeave(e,!0),He.dropElement=this;let t=K.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(He.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){if(!He.dragElement||He.dropElement!==this)return;e.preventDefault(),e.stopPropagation(),t&&He.dragElement._stopScrolling();let i=K.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(He.dragElement)),this.triggerEvent("dropout",i),He.dropElement===this&&(delete He.dropElement,!t)){let o,a=this.el.parentElement;for(;!o&&a;)o=a.ddElement?.ddDroppable,a=a.parentElement;o&&o._mouseEnter(e)}}drop(e){e.preventDefault();let t=K.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(He.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return Y({draggable:e.el},e.ui())}},Ihe=class xk{static init(t){return t.ddElement||(t.ddElement=new xk(t)),t.ddElement}constructor(t){this.el=t}on(t,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.on(t,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.on(t,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.on(t,i),this}off(t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(t)>-1?this.ddDraggable.off(t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(t)>-1?this.ddDroppable.off(t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(t)>-1&&this.ddResizable.off(t),this}setupDraggable(t){return this.ddDraggable?this.ddDraggable.updateOption(t):this.ddDraggable=new xhe(this.el,t),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(t){return this.ddResizable?this.ddResizable.updateOption(t):this.ddResizable=new yhe(this.el,t),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(t){return this.ddDroppable?this.ddDroppable.updateOption(t):this.ddDroppable=new She(this.el,t),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}},The=class{resizable(e,t,i,o){return this._getDDElements(e,typeof t=="string"?t:void 0).forEach(a=>{if(t==="disable"||t==="enable")a.ddResizable&&a.ddResizable[t]();else if(t==="destroy")a.ddResizable&&a.cleanResizable();else if(t==="option")a.setupResizable({[i]:o});else{let n=a.el.gridstackNode.grid,c=a.el.getAttribute("gs-resize-handles")||n.opts.resizable.handles||"e,s,se";c==="all"&&(c="n,e,s,w,se,sw,ne,nw");let d=!n.opts.alwaysShowResizeHandle,m=t;a.setupResizable(De(Y({},n.opts.resizable),{handles:c,autoHide:d,start:m.start,stop:m.stop,resize:m.resize,rtl:m.rtl}))}}),this}draggable(e,t,i,o){return this._getDDElements(e,typeof t=="string"?t:void 0).forEach(a=>{if(t==="disable"||t==="enable")a.ddDraggable&&a.ddDraggable[t]();else if(t==="destroy")a.ddDraggable&&a.cleanDraggable();else if(t==="option")a.setupDraggable({[i]:o});else{let n=a.el.gridstackNode.grid,c=t;a.setupDraggable(De(Y({},n.opts.draggable),{start:c.start,stop:c.stop,drag:c.drag,rtl:c.rtl}))}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,o){if(typeof t!="string"){let n=t;typeof n.accept=="function"&&!n._accept&&(n._accept=n.accept,n.accept=c=>n._accept(c))}let a=typeof t=="string"?t:void 0;return this._getDDElements(e,a).forEach(n=>{t==="disable"||t==="enable"?n.ddDroppable&&n.ddDroppable[t]():t==="destroy"?n.ddDroppable&&n.cleanDroppable():t==="option"?n.setupDroppable({[i]:o}):n.setupDroppable(t)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(o=>o.on(t,a=>{i(a,He.dragElement?He.dragElement.el:a.target,He.dragElement?He.dragElement.helper:void 0)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){let i=e.gridstack||t!=="destroy"&&t!=="disable",o=K.getElements(e);return o.length?o.map(a=>a.ddElement||(i?Ihe.init(a):null)).filter(a=>!!a):[]}},yi=new The,K2=(()=>{class e{static init(i={},o=".grid-stack"){if(typeof document>"u")return null;let a=e.getGridElement(o);return a?(a.gridstack||(a.gridstack=new e(a,K.cloneDeep(i))),a.gridstack):(console.error(typeof o=="string"?'GridStack.initAll() no grid was found with selector "'+o+`" - element missing or wrong selector ?
|
|
565
565
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(i={},o=".grid-stack"){let a=[];return typeof document>"u"||(e.getGridElements(o).forEach(n=>{n.gridstack||(n.gridstack=new e(n,K.cloneDeep(i))),a.push(n.gridstack)}),a.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+o+`" - element missing or wrong selector ?
|
|
566
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),a}static addGrid(i,o={}){if(!i)return null;let a=i;if(a.gridstack){let n=a.gridstack;return o&&(n.opts=Y(Y({},n.opts),o)),o.children!==void 0&&n.load(o.children),n}return(!i.classList.contains("grid-stack")||e.addRemoveCB)&&(e.addRemoveCB?a=e.addRemoveCB(i,o,!0,!0):a=K.createDiv(["grid-stack",o.class],i)),e.init(o,a)}static registerEngine(i){e.engineClass=i}get placeholder(){if(!this._placeholder){this._placeholder=K.createDiv([this.opts.placeholderClass,r5.itemClass,this.opts.itemClass]);let i=K.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(i.textContent=this.opts.placeholderText)}return this._placeholder}constructor(i,o={}){this.el=i,this.opts=o,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},i.gridstack=this,this.opts=o=o||{},i.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),o.row&&(o.minRow=o.maxRow=o.row,delete o.row);let a=K.toNumber(i.getAttribute("gs-row"));o.column==="auto"&&delete o.column,o.alwaysShowResizeHandle!==void 0&&(o._alwaysShowResizeHandle=o.alwaysShowResizeHandle);let n=o.columnOpts;if(n){let C=n.breakpoints;!n.columnWidth&&!C?.length?delete o.columnOpts:(n.columnMax=n.columnMax||12,C.length>1&&C.sort((x,w)=>(w.w||0)-(x.w||0)))}let c=De(Y({},K.cloneDeep(r5)),{column:K.toNumber(i.getAttribute("gs-column"))||r5.column,minRow:a||K.toNumber(i.getAttribute("gs-min-row"))||r5.minRow,maxRow:a||K.toNumber(i.getAttribute("gs-max-row"))||r5.maxRow,staticGrid:K.toBool(i.getAttribute("gs-static"))||r5.staticGrid,sizeToContent:K.toBool(i.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(o.handleClass?"."+o.handleClass:o.handle?o.handle:"")||r5.draggable.handle},removableOptions:{accept:o.itemClass||r5.removableOptions.accept,decline:r5.removableOptions.decline}});i.getAttribute("gs-animate")&&(c.animate=K.toBool(i.getAttribute("gs-animate"))),o=K.defaults(o,c),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(o),o.rtl==="auto"&&(o.rtl=i.style.direction==="rtl"),o.rtl&&this.el.classList.add("grid-stack-rtl");let d=this.el.closest("."+r5.itemClass)?.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=o.cellHeight==="auto",this._isAutoCellHeight||o.cellHeight==="initial")this.cellHeight(void 0);else{typeof o.cellHeight=="number"&&o.cellHeightUnit&&o.cellHeightUnit!==r5.cellHeightUnit&&(o.cellHeight=o.cellHeight+o.cellHeightUnit,delete o.cellHeightUnit);let C=o.cellHeight;delete o.cellHeight,this.cellHeight(C)}o.alwaysShowResizeHandle==="mobile"&&(o.alwaysShowResizeHandle=uo),this._setStaticClass();let m=o.engineClass||e.engineClass||hx;if(this.engine=new m({column:this.getColumn(),float:o.float,maxRow:o.maxRow,onChange:C=>{C.forEach(x=>{let w=x.el;w&&(x._removeDOM?(w&&w.remove(),delete x._removeDOM):this._writePosAttr(w,x))}),this._updateContainerHeight()}}),o.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(C=>this._prepareElement(C)),delete this.engine._loading,this.batchUpdate(!1)),o.children){let C=o.children;delete o.children,C.length&&this.load(C)}this.setAnimation(),o.subGridDynamic&&!He.pauseDrag&&(He.pauseDrag=!0),o.draggable?.pause!==void 0&&(He.pauseDrag=o.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(i=this.opts){this.el.classList.add("gs-"+i.column),typeof i.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/i.column}%`)}addWidget(i){if(!i)return;if(typeof i=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(i.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(i);let o,a=i;if(a.grid=this,a.el?o=a.el:e.addRemoveCB?o=e.addRemoveCB(this.el,i,!0,!1):o=this.createWidgetDivs(a),!o)return;if(a=o.gridstackNode,a&&o.parentElement===this.el&&this.engine.nodes.find(c=>c._id===a._id))return o;let n=this._readAttr(o);return K.defaults(i,n),this.engine.prepareNode(i),this.el.appendChild(o),this.makeWidget(o,i),o}createWidgetDivs(i){let o=K.createDiv(["grid-stack-item",this.opts.itemClass]),a=K.createDiv(["grid-stack-item-content"],o);return K.lazyLoad(i)?i.visibleObservable||(i.visibleObservable=new IntersectionObserver(([n])=>{n.isIntersecting&&(i.visibleObservable?.disconnect(),delete i.visibleObservable,e.renderCB(a,i),i.grid?.prepareDragDrop(i.el))}),window.setTimeout(()=>i.visibleObservable?.observe(o))):e.renderCB(a,i),o}makeSubGrid(i,o,a,n=!0){let c=i.gridstackNode;if(c||(c=this.makeWidget(i).gridstackNode),c.subGrid?.el)return c.subGrid;let d,m=this;for(;m&&!d;)d=m.opts?.subGridOpts,m=m.parentGridNode?.grid;o=K.cloneDeep(Y(Y(De(Y({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),d||{}),o||c.subGridOpts||{})),c.subGridOpts=o;let C=!1;o.column==="auto"&&(C=!0,o.column=Math.max(c.w||1,a?.w||1),delete o.columnOpts);let x=c.el.querySelector(".grid-stack-item-content"),w,B;if(n&&(this._removeDD(c.el),B=De(Y({},c),{x:0,y:0}),K.removeInternalForSave(B),delete B.subGridOpts,c.content&&(B.content=c.content,delete c.content),e.addRemoveCB?w=e.addRemoveCB(this.el,B,!0,!1)||void 0:(w=K.createDiv(["grid-stack-item"]),w.appendChild(x),x=K.createDiv(["grid-stack-item-content"],c.el)),this.prepareDragDrop(c.el)),a){let D=C?o.column:c.w,X=c.h+a.h,ne=c.el.style;ne.transition="none",this.update(c.el,{w:D,h:X}),setTimeout(()=>ne.transition="")}let S=c.subGrid=e.addGrid(x,o)||void 0;return a?._moving&&(S._isTemp=!0),C&&(S._autoColumn=!0),n&&S.makeWidget(w,B),a&&(a._moving?window.setTimeout(()=>K.simulateMouseEvent(a._event,"mouseenter",S.el),0):S.makeWidget(c.el,c)),this.resizeToContentCheck(!1,c),S}removeAsSubGrid(i){let o=this.parentGridNode?.grid;if(o&&(o.batchUpdate(),o.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(a=>{a.x=(a.x??0)+(this.parentGridNode.x??0),a.y=(a.y??0)+(this.parentGridNode.y??0),this._removeDD(a.el),a.el.remove(),delete a.el.gridstackNode,o.makeWidget(a.el,a)}),o.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,i)){let a=i.el?.gridstackNode;a&&a!==i&&(a._temporaryRemoved=!0),window.setTimeout(()=>{let n=He.dragElement?.lastDrag||i._event;n&&K.simulateMouseEvent(n,"mouseenter",o.el)},0)}}save(i=!0,o=!1,a=e.saveCB,n){let c=this.engine.save(i,a,n);if(c.forEach(d=>{if(i&&d.el&&!d.subGrid&&!a){let m=d.el.querySelector(".grid-stack-item-content");d.content=m?.innerHTML,d.content||delete d.content}else if(!i&&!a&&delete d.content,d.subGrid?.el){let m=d.w||d.subGrid.getColumn(),C=d.subGrid.save(i,o,a,m);d.subGridOpts=o?C:{children:C},delete d.subGrid}delete d.el}),o){let d=K.cloneDeep(this.opts);d.marginBottom===d.marginTop&&d.marginRight===d.marginLeft&&d.marginTop===d.marginRight&&(d.margin=d.marginTop,delete d.marginTop,delete d.marginRight,delete d.marginBottom,delete d.marginLeft),d.rtl===(this.el.style.direction==="rtl")&&(d.rtl="auto"),this._isAutoCellHeight&&(d.cellHeight="auto"),this._autoColumn&&(d.column="auto");let m=d._alwaysShowResizeHandle;return delete d._alwaysShowResizeHandle,m!==void 0?d.alwaysShowResizeHandle=m:delete d.alwaysShowResizeHandle,K.removeInternalAndSame(d,r5),d.children=c,d}return c}load(i,o=e.addRemoveCB||!0){i.forEach(w=>{w.w=w.w||w.minW||1,w.h=w.h||w.minH||1}),i=K.sort(i),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let a=0;i.forEach(w=>{a=Math.max(a,(w.x||0)+w.w)}),a>this.engine.defaultColumn&&(this.engine.defaultColumn=a);let n=this.getColumn();a>n&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=i,this.engine.columnChanged(a,n,this.responseLayout),i=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(i,a,!0));let c=e.addRemoveCB;typeof o=="function"&&(e.addRemoveCB=o);let d=[];this.batchUpdate();let m=!this.engine.nodes.length,C=m&&this.opts.animate;C&&this.setAnimation(!1),!m&&o&&[...this.engine.nodes].forEach(w=>{w.id&&(K.find(i,w.id)||(e.addRemoveCB&&e.addRemoveCB(this.el,w,!1,!1),d.push(w),this.removeWidget(w.el,!0,!1)))}),this.engine._loading=!0;let x=[];return this.engine.nodes=this.engine.nodes.filter(w=>w.id&&K.find(i,w.id)?(x.push(w),!1):!0),i.forEach(w=>{let B=w.id?K.find(x,w.id):void 0;if(B){if(K.shouldSizeToContent(B)&&(w.h=B.h),this.engine.nodeBoundFix(w),(w.autoPosition||w.x===void 0||w.y===void 0)&&(w.w=w.w||B.w,w.h=w.h||B.h,this.engine.findEmptyPosition(w)),this.engine.nodes.push(B),K.samePos(B,w)&&this.engine.nodes.length>1&&(this.moveNode(B,De(Y({},w),{forceCollide:!0})),K.copyPos(w,B)),this.update(B.el,w),w.subGridOpts?.children){let S=B.el.querySelector(".grid-stack");S&&S.gridstack&&S.gridstack.load(w.subGridOpts.children)}}else o&&this.addWidget(w)}),delete this.engine._loading,this.engine.removedNodes=d,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,c?e.addRemoveCB=c:delete e.addRemoveCB,C&&this.setAnimation(!0,!0),this}batchUpdate(i=!0){return this.engine.batchUpdate(i),i||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(i=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!i||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let o=this.el.querySelector("."+this.opts.itemClass);if(o){let n=K.toNumber(o.getAttribute("gs-h"))||1;return Math.round(o.offsetHeight/n)}let a=parseInt(this.el.getAttribute("gs-current-row")||"0");return a?Math.round(this.el.getBoundingClientRect().height/a):this.opts.cellHeight}cellHeight(i){if(i!==void 0&&this._isAutoCellHeight!==(i==="auto")&&(this._isAutoCellHeight=i==="auto",this._updateResizeEvent()),(i==="initial"||i==="auto")&&(i=void 0),i===void 0){let a=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;i=this.cellWidth()+a}let o=K.parseHeight(i);return this.opts.cellHeightUnit===o.unit&&this.opts.cellHeight===o.h?this:(this.opts.cellHeightUnit=o.unit,this.opts.cellHeight=o.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(i=!1){return i&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let i=this.opts.columnOpts;if(!i||!i.columnWidth&&!i.breakpoints?.length)return!1;let o=this.getColumn(),a=o,n=this._widthOrContainer(!0);if(i.columnWidth)a=Math.min(Math.round(n/i.columnWidth)||1,i.columnMax);else{a=i.columnMax;let c=0;for(;c<i.breakpoints.length&&n<=i.breakpoints[c].w;)a=i.breakpoints[c++].c||o}if(a!==o){let c=i.breakpoints?.find(d=>d.c===a);return this.column(a,c?.layout||i.layout),!0}return!1}compact(i="compact",o=!0){return this.engine.compact(i,o),this._triggerChangeEvent(),this}column(i,o="moveScale"){if(!i||i<1||this.opts.column===i)return this;let a=this.getColumn();return this.opts.column=i,this.engine?(this.engine.column=i,this.el.classList.remove("gs-"+a),this._updateColumnVar(),this.engine.columnChanged(a,i,o),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=o,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(i=>i.matches("."+this.opts.itemClass)&&!i.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return!!this._ignoreLayoutsNodeChange}destroy(i=!0){return this.el?(this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),i?this.el.parentNode.removeChild(this.el):(this.removeAll(i),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this):this}float(i){return this.opts.float!==i&&(this.opts.float=this.engine.float=i,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(i,o=!1){let a=this.el.getBoundingClientRect(),n;o?n={top:a.top+document.documentElement.scrollTop,left:a.left}:n={top:this.el.offsetTop,left:this.el.offsetLeft};let c=i.left-n.left,d=i.top-n.top,m=a.width/this.getColumn(),C=a.height/parseInt(this.el.getAttribute("gs-current-row")||"0");return{x:Math.floor(c/m),y:Math.floor(d/C)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(i,o,a,n){return this.engine.isAreaEmpty(i,o,a,n)}makeWidget(i,o){let a=e.getElement(i);if(!a||a.gridstackNode)return a;a.parentElement||this.el.appendChild(a),this._prepareElement(a,!0,o);let n=a.gridstackNode;this._updateContainerHeight(),n.subGridOpts&&this.makeSubGrid(a,n.subGridOpts,void 0,!1);let c=!1;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(c=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),c&&delete this._ignoreLayoutsNodeChange,a}on(i,o){return i.indexOf(" ")!==-1?(i.split(" ").forEach(a=>this.on(a,o)),this):(i==="change"||i==="added"||i==="removed"||i==="enable"||i==="disable"?(i==="enable"||i==="disable"?this._gsEventHandler[i]=a=>o(a):this._gsEventHandler[i]=a=>{a.detail&&o(a,a.detail)},this.el.addEventListener(i,this._gsEventHandler[i])):i==="drag"||i==="dragstart"||i==="dragstop"||i==="resizestart"||i==="resize"||i==="resizestop"||i==="dropped"||i==="resizecontent"?this._gsEventHandler[i]=o:console.error("GridStack.on("+i+") event not supported"),this)}off(i){return i.indexOf(" ")!==-1?(i.split(" ").forEach(o=>this.off(o)),this):((i==="change"||i==="added"||i==="removed"||i==="enable"||i==="disable")&&this._gsEventHandler[i]&&this.el.removeEventListener(i,this._gsEventHandler[i]),delete this._gsEventHandler[i],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(i=>this.off(i)),this}removeWidget(i,o=!0,a=!0){return i?(e.getElements(i).forEach(n=>{if(n.parentElement&&n.parentElement!==this.el)return;let c=n.gridstackNode;c||(c=this.engine.nodes.find(d=>n===d.el)),c&&(o&&e.addRemoveCB&&e.addRemoveCB(this.el,c,!1,!1),delete n.gridstackNode,this._removeDD(n),this.engine.removeNode(c,o,a),o&&n.parentElement&&n.remove())}),a&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(i=!0,o=!0){return this.engine.nodes.forEach(a=>{i&&e.addRemoveCB&&e.addRemoveCB(this.el,a,!1,!1),delete a.el.gridstackNode,this.opts.staticGrid||this._removeDD(a.el)}),this.engine.removeAll(i,o),o&&this._triggerRemoveEvent(),this}setAnimation(i=this.opts.animate,o){return o?setTimeout(()=>{this.opts&&this.setAnimation(i)}):i?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=i,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(i,o=!0,a=!0){return!!this.opts.staticGrid===i?this:(i?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(n=>{this.prepareDragDrop(n.el),n.subGrid&&a&&n.subGrid.setStatic(i,o,a)}),o&&this._setStaticClass(),this)}updateOptions(i){let o=this.opts;if(i===o)return this;if(i.acceptWidgets!==void 0&&(o.acceptWidgets=i.acceptWidgets,this._setupAcceptWidget()),i.animate!==void 0&&this.setAnimation(i.animate),i.cellHeight&&this.cellHeight(i.cellHeight),i.class!==void 0&&i.class!==o.class&&(o.class&&this.el.classList.remove(o.class),i.class&&this.el.classList.add(i.class)),i.columnOpts){let a=!!this.opts.columnOpts;this.opts.columnOpts=i.columnOpts,a!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else i.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof i.column=="number"&&this.column(i.column);return i.margin!==void 0&&this.margin(i.margin),i.staticGrid!==void 0&&this.setStatic(i.staticGrid),i.disableDrag!==void 0&&!i.staticGrid&&this.enableMove(!i.disableDrag),i.disableResize!==void 0&&!i.staticGrid&&this.enableResize(!i.disableResize),i.float!==void 0&&this.float(i.float),i.row!==void 0?(o.minRow=o.maxRow=this.engine.maxRow=o.row=i.row,this._updateContainerHeight(),this.engine.getRow()>i.row&&this.compact()):(i.minRow!==void 0&&(o.minRow=i.minRow,this._updateContainerHeight()),i.maxRow!==void 0&&(o.maxRow=this.engine.maxRow=i.maxRow,this.engine.getRow()>i.maxRow&&this.compact())),i.lazyLoad!==void 0&&(o.lazyLoad=i.lazyLoad),i.children?.length&&this.load(i.children),this}update(i,o){return e.getElements(i).forEach(a=>{let n=a?.gridstackNode;if(!n)return;let c=Y(Y({},K.copyPos({},n)),K.cloneDeep(o));this.engine.nodeBoundFix(c),delete c.autoPosition;let d=["x","y","w","h"],m,C=c,x=n;if(d.some(S=>C[S]!==void 0&&C[S]!==x[S])){m={};let S=m;d.forEach(D=>{S[D]=C[D]!==void 0?C[D]:x[D],delete C[D]})}if(!m&&(c.minW||c.minH||c.maxW||c.maxH)&&(m={}),c.content!==void 0){let S=a.querySelector(".grid-stack-item-content");S&&S.textContent!==c.content&&(n.content=c.content,e.renderCB(S,c),n.subGrid?.el&&(S.appendChild(n.subGrid.el),n.subGrid._updateContainerHeight())),delete c.content}let w=!1,B=!1;for(let S in C)S[0]!=="_"&&x[S]!==C[S]&&(x[S]=C[S],w=!0,B=B||!this.opts.staticGrid&&(S==="noResize"||S==="noMove"||S==="locked"));if(K.sanitizeMinMax(n),m){let S=m.w!==void 0&&m.w!==n.w;this.moveNode(n,m),S&&n.subGrid?n.subGrid.onResize(this.hasAnimationCSS()?n.w:void 0):this.resizeToContentCheck(S,n),delete n._orig}(m||w)&&this._writeAttr(a,n),B&&this.prepareDragDrop(n.el),e.updateCB&&e.updateCB(n)}),this}moveNode(i,o){let a=i._updating;a||this.engine.cleanNodes().beginUpdate(i),this.engine.moveNode(i,o),this._updateContainerHeight(),a||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(i){if(!i||(i.classList.remove("size-to-content-max"),!i.clientHeight))return;let o=i.gridstackNode;if(!o)return;let a=o.grid;if(!a||i.parentElement!==a.el)return;let n=a.getCellHeight(!0);if(!n)return;let c=o.h?o.h*n:i.clientHeight,d=null;if(o.resizeToContentParent&&(d=i.querySelector(o.resizeToContentParent)),d||(d=i.querySelector(e.resizeToContentParent)),!d)return;let m=i.clientHeight-d.clientHeight,C=o.h?o.h*n-m:d.clientHeight,x;if(o.subGrid){x=o.subGrid.getRow()*o.subGrid.getCellHeight(!0);let S=o.subGrid.el.getBoundingClientRect(),D=i.getBoundingClientRect();x+=S.top-D.top}else{if(o.subGridOpts?.children?.length)return;{let S=d.firstElementChild;if(!S){console.error(`Error: GridStack.resizeToContent() widget id:${o.id} '${e.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}x=S.getBoundingClientRect().height||C}}if(C===x)return;c+=x-C;let w=Math.ceil(c/n),B=Number.isInteger(o.sizeToContent)?o.sizeToContent:0;B&&w>B&&(w=B,i.classList.add("size-to-content-max")),o.minH&&w<o.minH?w=o.minH:o.maxH&&w>o.maxH&&(w=o.maxH),w!==o.h&&(a._ignoreLayoutsNodeChange=!0,a.moveNode(o,{h:w}),delete a._ignoreLayoutsNodeChange)}resizeToContentCBCheck(i){e.resizeToContentCB?e.resizeToContentCB(i):this.resizeToContent(i)}rotate(i,o){return e.getElements(i).forEach(a=>{let n=a.gridstackNode;if(!n||!K.canBeRotated(n))return;let c={w:n.h,h:n.w,minH:n.minW,minW:n.minH,maxH:n.maxW,maxW:n.maxH};if(o){let C=o.left>0?Math.floor(o.left/this.cellWidth()):0,x=o.top>0?Math.floor(o.top/this.opts.cellHeight):0;c.x=n.x+C-(n.h-(x+1)),c.y=n.y+x-C}let d=c;Object.keys(d).forEach(C=>{d[C]===void 0&&delete d[C]});let m=n._orig;this.update(a,c),n._orig=m}),this}margin(i){if(!(typeof i=="string"&&i.split(" ").length>1)){let o=K.parseHeight(i);if(this.opts.marginUnit===o.unit&&this.opts.margin===o.h)return this}return this.opts.margin=i,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(i){return this.engine.willItFit(i)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let i=this.engine.getDirtyNodes(!0);return i&&i.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(i),this._triggerEvent("change",i)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(o=>{delete o._dirty});let i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(i,o){let a=o?new CustomEvent(i,{bubbles:!1,detail:o}):new Event(i),n=this;for(;n.parentGridNode;)n=n.parentGridNode.grid;return n.el.dispatchEvent(a),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let i=this.parentGridNode,o=this.getRow()+this._extraDragRow,a=this.opts.cellHeight,n=this.opts.cellHeightUnit;if(!a)return this;if(!i&&!this.opts.minRow){let c=K.parseHeight(getComputedStyle(this.el).minHeight);if(c.h>0&&c.unit===n){let d=Math.floor(c.h/a);o<d&&(o=d)}}return this.el.setAttribute("gs-current-row",String(o)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),o&&(this.el.style[i?"minHeight":"height"]=o*a+n),i&&K.shouldSizeToContent(i)&&i.grid.resizeToContentCBCheck(i.el),this}_prepareElement(i,o=!1,a){a=a||this._readAttr(i),i.gridstackNode=a,a.el=i,a.grid=this,a=this.engine.addNode(a,o),this._writeAttr(i,a),i.classList.add(r5.itemClass,this.opts.itemClass);let n=K.shouldSizeToContent(a);return n?i.classList.add("size-to-content"):i.classList.remove("size-to-content"),n&&this.resizeToContentCheck(!1,a),(!K.lazyLoad(a)||!a.visibleObservable)&&this.prepareDragDrop(a.el),this}_writePosAttr(i,o){if(!o._moving&&!o._resizing||this._placeholder===i){let a=this.opts.rtl?"right":"left",n=i.style;n.top=o.y?o.y===1?"var(--gs-cell-height)":`calc(${o.y} * var(--gs-cell-height))`:null,n[a]=o.x?o.x===1?"var(--gs-column-width)":`calc(${o.x} * var(--gs-column-width))`:null,n.width=o.w>1?`calc(${o.w} * var(--gs-column-width))`:null,n.height=o.h>1?`calc(${o.h} * var(--gs-cell-height))`:null}return i.setAttribute("gs-x",String(o.x??0)),i.setAttribute("gs-y",String(o.y??0)),o.w>1?i.setAttribute("gs-w",String(o.w)):i.removeAttribute("gs-w"),o.h>1?i.setAttribute("gs-h",String(o.h)):i.removeAttribute("gs-h"),this}_writeAttr(i,o){if(!o)return this;this._writePosAttr(i,o);let a={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"},n=o,c=a;for(let d in c)n[d]?i.setAttribute(c[d],String(n[d])):i.removeAttribute(c[d]);return this}_readAttr(i,o=!0){let a={};a.x=K.toNumber(i.getAttribute("gs-x")),a.y=K.toNumber(i.getAttribute("gs-y")),a.w=K.toNumber(i.getAttribute("gs-w")),a.h=K.toNumber(i.getAttribute("gs-h")),a.autoPosition=K.toBool(i.getAttribute("gs-auto-position")),a.noResize=K.toBool(i.getAttribute("gs-no-resize")),a.noMove=K.toBool(i.getAttribute("gs-no-move")),a.locked=K.toBool(i.getAttribute("gs-locked"));let n=i.getAttribute("gs-size-to-content");n&&(n==="true"||n==="false"?a.sizeToContent=K.toBool(n):a.sizeToContent=parseInt(n,10)),a.id=i.getAttribute("gs-id")??void 0,a.maxW=K.toNumber(i.getAttribute("gs-max-w")),a.minW=K.toNumber(i.getAttribute("gs-min-w")),a.maxH=K.toNumber(i.getAttribute("gs-max-h")),a.minH=K.toNumber(i.getAttribute("gs-min-h")),o&&(a.w===1&&i.removeAttribute("gs-w"),a.h===1&&i.removeAttribute("gs-h"),a.maxW&&i.removeAttribute("gs-max-w"),a.minW&&i.removeAttribute("gs-min-w"),a.maxH&&i.removeAttribute("gs-max-h"),a.minH&&i.removeAttribute("gs-min-h"));let c=a;for(let d in c)a.hasOwnProperty(d)&&!c[d]&&c[d]!==0&&d!=="sizeToContent"&&delete c[d];return a}_setStaticClass(){let i=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...i),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...i),this.el.removeAttribute("gs-static")),this}onResize(i=this.el?.clientWidth){if(!i)return this;if(this.prevWidth===i)return this;this.prevWidth=i,this.batchUpdate();let o=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),o=!0):o=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(a=>{a.subGrid&&a.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(o),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(i=!1,o){if(!this.engine)return;if(i&&this.hasAnimationCSS()){setTimeout(()=>this.resizeToContentCheck(!1,o),this.animationDelay);return}if(o)K.shouldSizeToContent(o)&&this.resizeToContentCBCheck(o.el);else if(this.engine.nodes.some(n=>K.shouldSizeToContent(n))){let n=[...this.engine.nodes];this.batchUpdate(),n.forEach(c=>{K.shouldSizeToContent(c)&&this.resizeToContentCBCheck(c.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}let a=this._gsEventHandler.resizecontent;a&&a(new Event("resizecontent"),o?[o]:this.engine.nodes)}_updateResizeEvent(i=!1){let o=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(a=>a.sizeToContent));return!i&&o&&!this.resizeObserver?(this._sizeThrottle=K.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(i||!o)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(i=".grid-stack-item"){return K.getElement(i)}static getElements(i=".grid-stack-item"){return K.getElements(i)}static getGridElement(i){return e.getElement(i)}static getGridElements(i){return K.getElements(i)}_initMargin(){let i={h:0,unit:"px"},o=0,a=[];typeof this.opts.margin=="string"&&(a=this.opts.margin.split(" ")),a.length===2?(this.opts.marginTop=this.opts.marginBottom=a[0],this.opts.marginLeft=this.opts.marginRight=a[1]):a.length===4?(this.opts.marginTop=a[0],this.opts.marginRight=a[1],this.opts.marginBottom=a[2],this.opts.marginLeft=a[3]):(i=K.parseHeight(this.opts.margin),this.opts.marginUnit=i.unit,o=this.opts.margin=i.h);let n=["marginTop","marginRight","marginBottom","marginLeft"],c=this.opts;n.forEach(m=>{c[m]===void 0?c[m]=o:(i=K.parseHeight(c[m]),c[m]=i.h,delete this.opts.margin)}),this.opts.marginUnit=i.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);let d=this.el.style;return d.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),d.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),d.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),d.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return yi}static setupDragIn(i,o,a,n=document){o?.pause!==void 0&&(He.pauseDrag=o.pause),o=Y({appendTo:"body",helper:"clone"},o||{}),(typeof i=="string"?K.getElements(i,n):i).forEach((c,d)=>{yi.isDraggable(c)||yi.dragIn(c,o),a?.[d]&&(c.gridstackNode=a[d])})}movable(i,o){return this.opts.staticGrid?this:(e.getElements(i).forEach(a=>{let n=a.gridstackNode;n&&(o?delete n.noMove:n.noMove=!0,this.prepareDragDrop(n.el))}),this)}resizable(i,o){return this.opts.staticGrid?this:(e.getElements(i).forEach(a=>{let n=a.gridstackNode;n&&(o?delete n.noResize:n.noResize=!0,this.prepareDragDrop(n.el))}),this)}disable(i=!0){return this.opts.staticGrid?this:(this.enableMove(!1,i),this.enableResize(!1,i),this._triggerEvent("disable"),this)}enable(i=!0){return this.opts.staticGrid?this:(this.enableMove(!0,i),this.enableResize(!0,i),this._triggerEvent("enable"),this)}enableMove(i,o=!0){return this.opts.staticGrid?this:(i?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(a=>{this.prepareDragDrop(a.el),a.subGrid&&o&&a.subGrid.enableMove(i,o)}),this)}enableResize(i,o=!0){return this.opts.staticGrid?this:(i?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(a=>{this.prepareDragDrop(a.el),a.subGrid&&o&&a.subGrid.enableResize(i,o)}),this)}cancelDrag(){let i=He.dragElement?.el;if(i?._gridstackNodeOrig){let a=i._gridstackNodeOrig,n=a.grid,c=this._placeholder?.gridstackNode;c&&(c._isAboutToRemove=!0,this.engine.removeNode(c)),this.engine.restoreInitial(),i.gridstackNode=a,delete i._gridstackNodeOrig,delete He.dropElement,n&&(n.engine.addNode(a,!1),n.engine.restoreInitial());return}let o=this._placeholder?.gridstackNode;o&&(o._isExternal?(o._isAboutToRemove=!0,this.engine.removeNode(o)):o._isAboutToRemove&&e._itemRemoving(o.el,!1),this.engine.restoreInitial())}_removeDD(i){return yi.draggable(i,"destroy").resizable(i,"destroy"),i.gridstackNode&&delete i.gridstackNode._initDD,delete i.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return yi.droppable(this.el,"destroy"),this;let i,o,a=(n,c,d)=>{d=d||c;let m=d.gridstackNode;if(!m)return;if(!m.grid?.el){d.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let S=d.getBoundingClientRect();d.style.left=S.x+(this.dragTransform.xScale-1)*(n.clientX-S.x)/this.dragTransform.xScale+"px",d.style.top=S.y+(this.dragTransform.yScale-1)*(n.clientY-S.y)/this.dragTransform.yScale+"px",d.style.transformOrigin="0px 0px"}let{top:C,left:x}=d.getBoundingClientRect(),w=this.el.getBoundingClientRect();x-=w.left,C-=w.top;let B={position:{top:C*this.dragTransform.xScale,left:x*this.dragTransform.yScale}};if(m._temporaryRemoved){if(m.x=Math.max(0,Math.round(x/o)),m.y=Math.max(0,Math.round(C/i)),delete m.autoPosition,this.engine.nodeBoundFix(m),!this.engine.willItFit(m)){if(m.autoPosition=!0,!this.engine.willItFit(m)){yi.off(c,"drag");return}m._willFitPos&&(K.copyPos(m,m._willFitPos),delete m._willFitPos)}this._onStartMoving(d,n,B,m,o,i)}else this._dragOrResize(d,n,B,m,o,i)};return yi.droppable(this.el,{accept:n=>{let c=n.gridstackNode||this._readAttr(n,!1);if(c?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let d=!0;if(typeof this.opts.acceptWidgets=="function")d=this.opts.acceptWidgets(n);else{let m=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;d=n.matches(m)}if(d&&c&&this.opts.maxRow){let m={w:c.w,h:c.h,minW:c.minW,minH:c.minH};d=this.engine.willItFit(m)}return d}}).on(this.el,"dropover",(n,c,d)=>{let m=d?.gridstackNode||c.gridstackNode;if(m?.grid===this&&!m._temporaryRemoved)return!1;if(m?._sidebarOrig&&(m.w=m._sidebarOrig.w,m.h=m._sidebarOrig.h),m?.grid&&m.grid!==this&&!m._temporaryRemoved&&m.grid._leave(c,d),d=d||c,o=this.cellWidth(),i=this.getCellHeight(!0),!m){let w=d.getAttribute("data-gs-widget")||d.getAttribute("gridstacknode");if(w){try{m=JSON.parse(w)}catch{console.error("Gridstack dropover: Bad JSON format: ",w)}d.removeAttribute("data-gs-widget"),d.removeAttribute("gridstacknode")}m||(m=this._readAttr(d)),m._sidebarOrig={w:m.w,h:m.h}}m.grid||(m.el||(m=Y({},m)),m._isExternal=!0,d.gridstackNode=m);let C=m.w||Math.round(d.offsetWidth/o)||1,x=m.h||Math.round(d.offsetHeight/i)||1;return m.grid&&m.grid!==this?(c._gridstackNodeOrig||(c._gridstackNodeOrig=m),c.gridstackNode=m=De(Y({},m),{w:C,h:x,grid:this}),delete m.x,delete m.y,this.engine.cleanupNode(m).nodeBoundFix(m),m._initDD=m._isExternal=m._temporaryRemoved=!0):(m.w=C,m.h=x,m._temporaryRemoved=!0),e._itemRemoving(m.el,!1),yi.on(c,"drag",a),a(n,c,d),!1}).on(this.el,"dropout",(n,c,d)=>{let m=d?.gridstackNode||c.gridstackNode;return m&&(!m.grid||m.grid===this)&&(this._leave(c,d),this._isTemp&&this.removeAsSubGrid(m)),!1}).on(this.el,"drop",(n,c,d)=>{let m=d?.gridstackNode||c.gridstackNode;if(m?.grid===this&&!m._isExternal)return!1;let C=!!this.placeholder.parentElement,x=c!==d;this.placeholder.remove(),delete this.placeholder.gridstackNode,C&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let w=c._gridstackNodeOrig;if(delete c._gridstackNodeOrig,C&&w?.grid&&w.grid!==this){let S=w.grid;S.engine.removeNodeFromLayoutCache(w),S.engine.removedNodes.push(w),S._triggerRemoveEvent()._triggerChangeEvent(),S.parentGridNode&&!S.engine.nodes.length&&S.opts.subGridDynamic&&S.removeAsSubGrid()}if(!m||(C&&(this.engine.cleanupNode(m),m.grid=this),delete m.grid?._isTemp,yi.off(c,"drag"),d&&d!==c?(d.remove(),c=d):c.remove(),this._removeDD(c),!C))return!1;let B=m.subGrid?.el?.gridstack;return K.copyPos(m,this._readAttr(this.placeholder)),K.removePositioningStyles(c),x&&(m.content||m.subGridOpts||e.addRemoveCB)?(delete m.el,c=this.addWidget(m)||c):(this._prepareElement(c,!0,m),this.el.appendChild(c),this.resizeToContentCheck(!1,m),B&&(B.parentGridNode=m),this._updateContainerHeight()),this.engine.addedNodes.push(m),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(De(Y({},n),{type:"dropped"}),w&&w.grid?w:void 0,m),!1}),this}static _itemRemoving(i,o){if(!i)return;let a=i?i.gridstackNode:void 0;!a?.grid||i.classList.contains(a.grid.opts.removableOptions.decline)||(o?a._isAboutToRemove=!0:delete a._isAboutToRemove,o?i.classList.add("grid-stack-item-removing"):i.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let i=document.querySelector(this.opts.removable);return i?(!this.opts.staticGrid&&!yi.isDroppable(i)&&yi.droppable(i,this.opts.removableOptions).on(i,"dropover",(o,a)=>e._itemRemoving(a,!0)).on(i,"dropout",(o,a)=>e._itemRemoving(a,!1)),this):this}refreshDragHandles(i){return e.getElements(i).forEach(o=>{o.ddElement?.ddDraggable?.refreshHandles()}),this}prepareDragDrop(i,o=!1){let a=i?.gridstackNode;if(!a)return this;let n=a.noMove||this.opts.disableDrag,c=a.noResize||this.opts.disableResize,d=this.opts.staticGrid||n&&c;if((o||d)&&(a._initDD&&(this._removeDD(i),delete a._initDD),d))return i.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!a._initDD){let m,C,x=(S,D)=>{this.triggerEvent(S,S.target),m=this.cellWidth(),C=this.getCellHeight(!0),this._onStartMoving(i,S,D,a,m,C)},w=(S,D)=>{this._dragOrResize(i,S,D,a,m,C)},B=S=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete a._moving,delete a._resizing,delete a._event,delete a._lastTried;let D=a.w!==a._orig.w,X=S.target;if(!(!X.gridstackNode||X.gridstackNode.grid!==this)){if(a.el=X,a._isAboutToRemove){let ne=i.gridstackNode.grid;ne._gsEventHandler[S.type]&&ne._gsEventHandler[S.type](S,X),ne.engine.nodes.push(a),ne.removeWidget(i,!0,!0)}else K.removePositioningStyles(X),a._temporaryRemoved?(this._writePosAttr(X,a),this.engine.addNode(a)):this._writePosAttr(X,a),this.triggerEvent(S,X);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),S.type==="resizestop"&&(Number.isInteger(a.sizeToContent)&&(a.sizeToContent=a.h),this.resizeToContentCheck(D,a))}};yi.draggable(i,{start:x,stop:B,drag:w,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}).resizable(i,{start:x,stop:B,resize:w,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}),a._initDD=!0}return yi.draggable(i,n?"disable":"enable").resizable(i,c?"disable":"enable"),this}_onStartMoving(i,o,a,n,c,d){if(this.engine.cleanNodes().beginUpdate(n),this._writePosAttr(this.placeholder,n),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=n,n.grid?.el)this.dragTransform=K.getValuesFromTransformedElement(i);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let m=this.placeholder.closest(".grid-stack");this.dragTransform=K.getValuesFromTransformedElement(m)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(n.el=this.placeholder,n._lastUiPosition=a.position,n._prevYPix=a.position.top,n._moving=o.type==="dragstart",n._resizing=o.type==="resizestart",delete n._lastTried,o.type==="dropover"&&n._temporaryRemoved&&(this.engine.addNode(n),n._moving=!0),this.engine.cacheRects(c,d,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),o.type==="resizestart"){let m=this.getColumn()-n.x,C=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-n.y;yi.resizable(i,"option","minWidth",c*Math.min(n.minW||1,m)).resizable(i,"option","minHeight",d*Math.min(n.minH||1,C)).resizable(i,"option","maxWidth",c*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,m)).resizable(i,"option","maxWidthMoveLeft",c*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,n.x+n.w)).resizable(i,"option","maxHeight",d*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,C)).resizable(i,"option","maxHeightMoveUp",d*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,n.y+n.h))}}_dragOrResize(i,o,a,n,c,d){let m=Y({},n._orig),C=!1,x=this.opts.marginLeft,w=this.opts.marginRight,B=this.opts.marginTop,S=this.opts.marginBottom,D=Math.round(d*.1),X=Math.round(c*.1);if(x=Math.min(x,X),w=Math.min(w,X),B=Math.min(B,D),S=Math.min(S,D),o.type==="drag"){if(n._temporaryRemoved)return;n._prevYPix=a.position.top,this.opts.draggable.scroll!==!1&&He.dragElement?.updateScrollPosition(this.el);let U=a.position.left+(a.position.left>n._lastUiPosition.left?-w:x),he=a.position.top+(a.position.top>n._lastUiPosition.top?-S:B);m.x=Math.round(U/c),m.y=Math.round(he/d);let be=this._extraDragRow;if(this.engine.collide(n,m)){let qe=this.getRow(),oe=Math.max(0,m.y+n.h-qe);this.opts.maxRow&&qe+oe>this.opts.maxRow&&(oe=Math.max(0,this.opts.maxRow-qe)),this._extraDragRow=oe}else this._extraDragRow=0;if(this._extraDragRow!==be&&this._updateContainerHeight(),n.x===m.x&&n.y===m.y)return}else if(o.type==="resize"){if((m.x??0)<0||(K.updateScrollResize(o,i,d),m.w=Math.round((a.size.width-x)/c),m.h=Math.round((a.size.height-B)/d),n.w===m.w&&n.h===m.h)||n._lastTried&&n._lastTried.w===m.w&&n._lastTried.h===m.h)return;if(o.hasMovedX){let U=a.position.left+x;m.x=Math.round(U/c)}if(o.hasMovedY){let U=a.position.top+B;m.y=Math.round(U/d)}C=!0}n._event=o,n._lastTried=m;let ne={x:a.position.left+x,y:a.position.top+B,w:(a.size?a.size.width:n.w*c)-x-w,h:(a.size?a.size.height:n.h*d)-B-S};if(this.engine.moveNodeCheck(n,De(Y({},m),{cellWidth:c,cellHeight:d,rect:ne,resizing:C}))){n._lastUiPosition=a.position,this.engine.cacheRects(c,d,B,w,S,x),delete n._skipDown,C&&n.subGrid&&n.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let U=o.target;n._sidebarOrig||this._writePosAttr(U,n),this.triggerEvent(o,U)}}triggerEvent(i,o){let a=this;for(;a.parentGridNode;)a=a.parentGridNode.grid;a._gsEventHandler[i.type]&&a._gsEventHandler[i.type](i,o)}_leave(i,o){o=o||i;let a=o.gridstackNode;if(!a||(o.style.transform=o.style.transformOrigin="",yi.off(i,"drag"),a._temporaryRemoved))return;a._temporaryRemoved=!0,this.engine.removeNode(a),a.el=a._isExternal&&o?o:i;let n=a._sidebarOrig;a._isExternal&&this.engine.cleanupNode(a),a._sidebarOrig=n,this.opts.removable===!0&&e._itemRemoving(i,!0),i._gridstackNodeOrig?(i.gridstackNode=i._gridstackNodeOrig,delete i._gridstackNodeOrig):a._isExternal&&this.engine.restoreInitial()}}return e.renderCB=(t,i)=>{t&&i?.content&&(t.textContent=i.content)},e.resizeToContentParent=".grid-stack-item-content",e.Utils=K,e.Engine=hx,e.GDRev="13.0.0",e})(),Sk=["container"],Bhe=["*"];function Mhe(e,t){}var khe=["*",[["","empty-content",""]]],Ehe=["*","[empty-content]"];function Zhe(e,t){e&1&&jt(0,1,["*ngIf","isEmpty"])}function Lhe(e,t){}var sv=(()=>{class e{constructor(i){this.elementRef=i,this.el._gridItemComp=this}set options(i){let o=this.el.gridstackNode?.grid;o?o.update(this.el,i):this._options=De(Y({},i),{el:this.el})}get options(){return this.el.gridstackNode||this._options||{el:this.el}}get el(){return this.elementRef.nativeElement}clearOptions(){delete this._options}ngOnDestroy(){this.clearOptions(),delete this.childWidget,delete this.el._gridItemComp,delete this.container,delete this.ref}}return e.\u0275fac=function(t){return new(t||e)(O1(gt))},e.\u0275cmp=Ye({type:e,selectors:[["gridstack-item"]],viewQuery:function(t,i){if(t&1&&w_(Sk,7,t2),t&2){let o;pu(o=_u())&&(i.container=o.first)}},inputs:{options:"options"},ngContentSelectors:Bhe,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(t,i){t&1&&(Kt(),b_(0,"div",1),PT(1,Mhe,0,0,"ng-template",null,0,iB),jt(3),xe(4),C_()),t&2&&(P(4),e0(" ",i.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),e})(),sp=(()=>{class e{constructor(i){this.elementRef=i,this.addedCB=new x1,this.changeCB=new x1,this.disableCB=new x1,this.dragCB=new x1,this.dragStartCB=new x1,this.dragStopCB=new x1,this.droppedCB=new x1,this.enableCB=new x1,this.removedCB=new x1,this.resizeCB=new x1,this.resizeStartCB=new x1,this.resizeStopCB=new x1,K2.addRemoveCB||(K2.addRemoveCB=Hhe),K2.saveCB||(K2.saveCB=Dhe),K2.updateCB||(K2.updateCB=Rhe),this.el._gridComp=this}set options(i){this._grid?this._grid.updateOptions(i):this._options=i}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static registerComponents(i){i.forEach(o=>e.componentMap[e.getSelector(o)]=o)}static getSelector(i){return lB(i).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=K2.init(this._options,this.el),delete this._options,this.checkEmpty()}ngAfterContentInit(){this._sub=this.gridstackItems?.changes.subscribe(()=>this.updateAll()),this.loaded||this.updateAll(),this.hookEvents(this.grid)}ngOnDestroy(){this.unhookEvents(this._grid),this._sub?.unsubscribe(),this._grid?.destroy(),delete this._grid,delete this.el._gridComp,delete this.container,delete this.ref}updateAll(){if(!this.grid)return;let i=[];this.gridstackItems?.forEach(o=>{i.push(o.options),o.clearOptions()}),this.grid.load(i)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(i){i&&(i.parentGridNode||i.on("added",(o,a)=>{(a[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:o,nodes:a})}).on("change",(o,a)=>this.changeCB.emit({event:o,nodes:a})).on("disable",o=>this.disableCB.emit({event:o})).on("drag",(o,a)=>this.dragCB.emit({event:o,el:a})).on("dragstart",(o,a)=>this.dragStartCB.emit({event:o,el:a})).on("dragstop",(o,a)=>this.dragStopCB.emit({event:o,el:a})).on("dropped",(o,a,n)=>this.droppedCB.emit({event:o,previousNode:a,newNode:n})).on("enable",o=>this.enableCB.emit({event:o})).on("removed",(o,a)=>{(a[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:o,nodes:a})}).on("resize",(o,a)=>this.resizeCB.emit({event:o,el:a})).on("resizestart",(o,a)=>this.resizeStartCB.emit({event:o,el:a})).on("resizestop",(o,a)=>this.resizeStopCB.emit({event:o,el:a})))}unhookEvents(i){i&&(i.parentGridNode||i.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return e.componentMap={},e.\u0275fac=function(t){return new(t||e)(O1(gt))},e.\u0275cmp=Ye({type:e,selectors:[["gridstack"]],contentQueries:function(t,i,o){if(t&1&&jT(o,sv,4),t&2){let a;pu(a=_u())&&(i.gridstackItems=a)}},viewQuery:function(t,i){if(t&1&&w_(Sk,7,t2),t&2){let o;pu(o=_u())&&(i.container=o.first)}},inputs:{options:"options",isEmpty:"isEmpty"},outputs:{addedCB:"addedCB",changeCB:"changeCB",disableCB:"disableCB",dragCB:"dragCB",dragStartCB:"dragStartCB",dragStopCB:"dragStopCB",droppedCB:"droppedCB",enableCB:"enableCB",removedCB:"removedCB",resizeCB:"resizeCB",resizeStartCB:"resizeStartCB",resizeStopCB:"resizeStopCB"},ngContentSelectors:Ehe,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(t,i){t&1&&(Kt(khe),VT(0,Zhe,1,0,"ng-content",1)(1,Lhe,0,0,"ng-template",null,0,iB),jt(3)),t&2&&ve("ngIf",i.isEmpty)},dependencies:[D$],styles:["[_nghost-%COMP%]{display:block}"]}),e})();function Hhe(e,t,i,o){if(i){if(!e)return;if(o){let a=e.parentElement?._gridItemComp;if(!a)return;let n=(a.childWidget?.container||a.container)?.createComponent(sp),c=n?.instance;return c?(c.ref=n,c.options=t,c.el):void 0}else{let a=e._gridComp?.container?.createComponent(sv),n=a?.instance;if(!n)return;n.ref=a;let c=t.component,d=c?sp.componentMap[c]:void 0;if(d){let m=()=>{let C=n.container?.createComponent(d),x=C?.instance;x&&typeof x.serialize=="function"&&typeof x.deserialize=="function"&&(n.childWidget=x,x._compRef=C,x.deserialize(t))};t.lazyLoad||t.grid?.opts?.lazyLoad&&t.lazyLoad!==!1?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([C])=>{C.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,m(),t.grid?.refreshDragHandles(n.el))}),window.setTimeout(()=>t.visibleObservable?.observe(n.el))):(m(),t.grid?.refreshDragHandles(n.el))}return n.el}}else if(o){let a=t.el?._gridComp;a?.ref?a.ref.destroy():a?.ngOnDestroy()}else{let a=t.el?._gridItemComp;a?.ref?a.ref.destroy():a?.ngOnDestroy()}}function Dhe(e,t){let i=e.el?._gridItemComp;if(i){let a=i.childWidget?.serialize();a&&(t.props=a);return}let o=e.el?._gridComp}function Rhe(e){let t=e,i=e.el?._gridItemComp;i?.childWidget&&t.props&&i.childWidget.deserialize(t)}var Ohe={unsavedChanges:"Nicht gespeicherte \xC4nderungen",editCards:"Karten bearbeiten",editView:"Ansicht bearbeiten",actions:"Aktionen",save:"Speichern",cancel:"Abbrechen",discard:"Verwerfen",discardChanges:"\xC4nderungen verwerfen",discardConfirmBody:"\xC4nderungen verwerfen? Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",unsavedNavBody:"Sie verlassen diese Seite. Speichern oder verwerfen Sie die \xC4nderungen, um fortzufahren. Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",noCardsAvailable:"Keine Karten verf\xFCgbar.",removeSection:"Bereich entfernen",removeCard:"Karte entfernen",resizable:"Gr\xF6\xDFenver\xE4nderbar"},Nhe={unsavedChanges:"Unsaved Changes",editCards:"Edit Cards",editView:"Edit View",actions:"Actions",save:"Save",cancel:"Cancel",discard:"Discard",discardChanges:"Discard Changes",discardConfirmBody:"Discard the changes? This action cannot be undone.",unsavedNavBody:"You are leaving this page. Save or discard the changes to proceed. This action cannot be undone.",noCardsAvailable:"No cards available.",removeSection:"Remove section",removeCard:"Remove card",resizable:"Resizable"},Yr={UNSAVED_CHANGES:"unsavedChanges",EDIT_CARDS:"editCards",EDIT_VIEW:"editView",ACTIONS:"actions",SAVE:"save",CANCEL:"cancel",DISCARD:"discard",DISCARD_CHANGES:"discardChanges",DISCARD_CONFIRM_BODY:"discardConfirmBody",UNSAVED_NAV_BODY:"unsavedNavBody",NO_CARDS_AVAILABLE:"noCardsAvailable",REMOVE_SECTION:"removeSection",REMOVE_CARD:"removeCard",RESIZABLE:"resizable"},Vhe={en:Nhe,de:Ohe},In=class L6{language=$t("en");getTranslation(t){return Vhe[this.language()][t]??t}static \u0275fac=function(t){return new(t||L6)};static \u0275prov=q1({token:L6,factory:L6.\u0275fac})},Ld={WC:"wc",ANGULAR:"angular",SAP_UI:"sap-ui"},Phe=/^[a-z](?:[a-z0-9-]*)$/,lp=new Map;function zhe(e){for(let t of e){let i=lB(t);if(!i)throw new Error(`Dashboard card registration failed: "${Ik(t)}" is not an Angular component.`);if(!Bz(t))throw new Error(`Dashboard card registration failed: "${i.selector}" must be a standalone Angular component.`);let o=Whe(i.selector,t),a=lp.get(o);if(a&&a.componentType!==t)throw new Error(`Dashboard card registration failed: selector "${o}" is already registered.`);lp.set(o,{componentType:t,selector:o,inputs:jhe(i.inputs)})}}function Fhe(e){return lp.get(e)}function Uhe(e,t){a$()&&console.warn(`Dashboard card "${e}" ignores unknown Angular input "${t}".`)}function jhe(e){let t=new Map;for(let i of e)t.set(i.templateName,i.templateName),t.set(i.propName,i.templateName);return t}function Whe(e,t){let i=e.trim();if(!Phe.test(i))throw new Error(`Dashboard card registration failed: "${Ik(t)}" must use a single element selector. Received "${e}".`);return i}function Ik(e){return e.name.replace(/^_+/,"")||"AnonymousComponent"}function Ghe(e,t,i){let o=Fhe(e.component);if(!o){console.warn(`[DashboardCard] Angular component "${e.component}" is not registered`);return}let a=t.createComponent(o.componentType);for(let[n,c]of Object.entries(e.componentInputs??{})){let d=o.inputs.get(n);if(!d){Uhe(e.component,n);continue}a.setInput(d,c)}a.changeDetectorRef.detectChanges(),i(()=>{t.clear()})}function qhe(e,t,i){let o=t.element.nativeElement,a=null,n=!1,c=window.sap?.ui?.require;c?c(["sap/ui/core/ComponentContainer"],d=>{if(n)return;let m=new d({name:e.component,manifest:!0,async:!0,settings:e.componentInputs??{}});m.placeAt(o),a=m}):console.error("[DashboardCard] SAP UI5 is not available on window.sap"),i(()=>{n=!0,a?.destroy(),o.innerHTML=""})}function $he(e,t,i,o){let a=t.element.nativeElement,n=o.createElement(e.component);for(let[c,d]of Object.entries(e.componentInputs??{}))o.setProperty(n,c,d);o.appendChild(a,n),i(()=>{a.innerHTML=""})}var Xhe=["elementHost"],Khe=["*"];function Yhe(e,t){if(e&1){let i=ut();W(0,"div",5)(1,"ui5-button",6),we("click",function(){Me(i);let o=F(2);return ke(o.removeCard.emit())}),$()(),p1(2,"ui5-icon",7)}if(e&2){let i=F(2);P(),ve("accessibleName",i.i18n.getTranslation(i.i18nKeys.REMOVE_CARD)+": "+(i.card().label||i.card().component)),st("data-testid","dashboard-card-"+i.card().id+"-remove"),P(),ve("accessibleName",i.i18n.getTranslation(i.i18nKeys.RESIZABLE))}}function Qhe(e,t){if(e&1&&(W(0,"div",3),Xe(1,Yhe,3,3),W(2,"div",4),p1(3,"div",null,0),$()()),e&2){let i=F();fo("component-card--editing",i.editMode()),st("data-testid","dashboard-card-"+i.card().id),P(),Ke(i.editMode()?1:-1),P(),qo("pointer-events",i.editMode()?"none":"auto")}}function Jhe(e,t){if(e&1&&(W(0,"div",2)(1,"div",8),jt(2),$()()),e&2){let i=F();st("data-testid","dashboard-card-"+i.card().id),P(),qo("pointer-events",i.editMode()?"none":"auto")}}var Tk=class cp{card=Z.required();editMode=Z(!1);removeCard=_e();i18n=ae(In);i18nKeys=Yr;gridColumn=Le(()=>{let t=this.card().w??12;return this.createGridTrack(this.card().x,t)});gridRow=Le(()=>{let t=this.card().h??100;return this.createGridTrack(this.card().y,t)});host=sc("elementHost",{read:t2});renderer=ae(u_);mountCfg=Le(()=>{let t=this.card();return{type:t.type,component:t.component,componentInputs:t.componentInputs}},{equal:(t,i)=>t.type===i.type&&t.component===i.component&&JSON.stringify(t.componentInputs)===JSON.stringify(i.componentInputs)});constructor(){At(t=>{let i=this.host(),o=this.mountCfg();if(!(!i||!o.component))switch(i.clear(),i.element.nativeElement.innerHTML="",o.type){case Ld.SAP_UI:qhe(o,i,t);break;case Ld.ANGULAR:Ghe(o,i,t);break;case Ld.WC:default:$he(o,i,t,this.renderer);break}})}createGridTrack(t,i){return t===void 0?`span ${i}`:`${t+1} / span ${i}`}static \u0275fac=function(t){return new(t||cp)};static \u0275cmp=Ye({type:cp,selectors:[["mfp-dashboard-card"]],viewQuery:function(t,i){t&1&&Uc(i.host,Xhe,5,t2),t&2&&y_()},hostVars:4,hostBindings:function(t,i){t&2&&qo("grid-column",i.gridColumn())("grid-row",i.gridRow())},inputs:{card:[1,"card"],editMode:[1,"editMode"]},outputs:{removeCard:"removeCard"},ngContentSelectors:Khe,decls:2,vars:1,consts:[["elementHost",""],[1,"component-card",3,"component-card--editing"],[1,"card"],[1,"component-card"],[1,"component-host"],[1,"remove-wrapper"],["design","Default","icon","decline",1,"card__remove",3,"click","accessibleName"],["aria-hidden","true","name","resize-corner",1,"card__resize-indicator",3,"accessibleName"],[1,"card__body"]],template:function(t,i){t&1&&(Kt(),Xe(0,Qhe,5,6,"div",1)(1,Jhe,3,3,"div",2)),t&2&&Ke(i.card().component?0:1)},dependencies:[aa,rr],styles:["[_nghost-%COMP%]{display:block;min-width:0;min-height:0;overflow:visible}.card__remove[_ngcontent-%COMP%]{position:absolute;top:0;right:-.5rem;z-index:10;border-radius:50%!important;width:1.25rem!important;height:1.25rem!important;min-width:unset!important;padding:0!important;font-size:.625rem!important}.remove-wrapper[_ngcontent-%COMP%]{position:sticky;height:.5rem;top:0;right:0;z-index:10}.component-card[_ngcontent-%COMP%]{position:relative;height:100%;overflow:visible;isolation:isolate;padding-inline-start:var(--mfp_cardContainerPadding, 10px);padding-inline-end:var(--mfp_cardContainerPadding, 10px)}.component-card--editing[_ngcontent-%COMP%]{cursor:grab}.component-card--editing[_ngcontent-%COMP%]:hover{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.component-card--editing[_ngcontent-%COMP%]:hover .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{cursor:grabbing!important}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.component-host[_ngcontent-%COMP%]{position:relative;height:100%}.card__resize-indicator[_ngcontent-%COMP%]{position:absolute;right:calc(var(--mfp_cardContainerPadding, 10px) + 4px);bottom:4px;width:1rem;height:1rem;pointer-events:none;opacity:0;transition:opacity .12s ease-out;color:var(--sapHighlightColor, #0070f2);z-index:9}.card[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;border:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);border-radius:.5rem;background:var(--sapBackgroundColor, #fff);overflow:visible}.card__header[_ngcontent-%COMP%]{padding:.75rem 1rem;font-weight:600;border-bottom:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);background:var(--sapGroup_TitleBackground, #f5f5f5)}.card__body[_ngcontent-%COMP%]{flex:1;padding:1rem;overflow:auto}"]})},ede=[{w:4e3,c:14,layout:"compact"},{w:1439,c:12,layout:"compact"},{w:1023,c:8,layout:"compact"},{w:599,c:1,layout:"list"}],tde=class hp{i18n=ae(In);i18nKeys=Yr;open=Z(!1);confirm=_e();cancelled=_e();static \u0275fac=function(t){return new(t||hp)};static \u0275cmp=Ye({type:hp,selectors:[["mfp-discard-changes-dialog"]],inputs:{open:[1,"open"]},outputs:{confirm:"confirm",cancelled:"cancelled"},decls:11,vars:5,consts:[["data-testid","dashboard-discard-changes-dialog","state","Critical",3,"ui5BeforeClose","open"],["slot","header",1,"discard-changes-dialog__header"],["level","H5"],[1,"discard-changes-dialog__body"],["slot","footer",1,"discard-changes-dialog__footer"],["data-testid","dashboard-discard-changes-confirm-btn","design","Emphasized",3,"click"],["data-testid","dashboard-discard-changes-cancel-btn","design","Transparent",3,"click"]],template:function(t,i){t&1&&(W(0,"ui5-dialog",0),we("ui5BeforeClose",function(){return i.cancelled.emit()}),W(1,"div",1)(2,"ui5-title",2),xe(3),$()(),W(4,"div",3),xe(5),$(),W(6,"div",4)(7,"ui5-button",5),we("click",function(){return i.confirm.emit()}),xe(8),$(),W(9,"ui5-button",6),we("click",function(){return i.cancelled.emit()}),xe(10),$()()()),t&2&&(ve("open",i.open()),P(3),nt(i.i18n.getTranslation(i.i18nKeys.DISCARD_CHANGES)),P(2),e0(" ",i.i18n.getTranslation(i.i18nKeys.DISCARD_CONFIRM_BODY)," "),P(3),nt(i.i18n.getTranslation(i.i18nKeys.DISCARD)),P(2),nt(i.i18n.getTranslation(i.i18nKeys.CANCEL)))},dependencies:[aa,u8,Cl],styles:[`:host{display:contents}.discard-changes-dialog__header{display:flex;align-items:center;width:100%;padding:.75rem 0}.discard-changes-dialog__body{padding:0 0 1rem;min-width:320px}.discard-changes-dialog__footer{display:flex;justify-content:flex-end;align-items:center;width:100%;gap:.5rem}
|
|
566
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),a}static addGrid(i,o={}){if(!i)return null;let a=i;if(a.gridstack){let n=a.gridstack;return o&&(n.opts=Y(Y({},n.opts),o)),o.children!==void 0&&n.load(o.children),n}return(!i.classList.contains("grid-stack")||e.addRemoveCB)&&(e.addRemoveCB?a=e.addRemoveCB(i,o,!0,!0):a=K.createDiv(["grid-stack",o.class],i)),e.init(o,a)}static registerEngine(i){e.engineClass=i}get placeholder(){if(!this._placeholder){this._placeholder=K.createDiv([this.opts.placeholderClass,r5.itemClass,this.opts.itemClass]);let i=K.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(i.textContent=this.opts.placeholderText)}return this._placeholder}constructor(i,o={}){this.el=i,this.opts=o,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},i.gridstack=this,this.opts=o=o||{},i.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),o.row&&(o.minRow=o.maxRow=o.row,delete o.row);let a=K.toNumber(i.getAttribute("gs-row"));o.column==="auto"&&delete o.column,o.alwaysShowResizeHandle!==void 0&&(o._alwaysShowResizeHandle=o.alwaysShowResizeHandle);let n=o.columnOpts;if(n){let C=n.breakpoints;!n.columnWidth&&!C?.length?delete o.columnOpts:(n.columnMax=n.columnMax||12,C.length>1&&C.sort((x,w)=>(w.w||0)-(x.w||0)))}let c=De(Y({},K.cloneDeep(r5)),{column:K.toNumber(i.getAttribute("gs-column"))||r5.column,minRow:a||K.toNumber(i.getAttribute("gs-min-row"))||r5.minRow,maxRow:a||K.toNumber(i.getAttribute("gs-max-row"))||r5.maxRow,staticGrid:K.toBool(i.getAttribute("gs-static"))||r5.staticGrid,sizeToContent:K.toBool(i.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(o.handleClass?"."+o.handleClass:o.handle?o.handle:"")||r5.draggable.handle},removableOptions:{accept:o.itemClass||r5.removableOptions.accept,decline:r5.removableOptions.decline}});i.getAttribute("gs-animate")&&(c.animate=K.toBool(i.getAttribute("gs-animate"))),o=K.defaults(o,c),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(o),o.rtl==="auto"&&(o.rtl=i.style.direction==="rtl"),o.rtl&&this.el.classList.add("grid-stack-rtl");let d=this.el.closest("."+r5.itemClass)?.gridstackNode;if(d&&(d.subGrid=this,this.parentGridNode=d,this.el.classList.add("grid-stack-nested"),d.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=o.cellHeight==="auto",this._isAutoCellHeight||o.cellHeight==="initial")this.cellHeight(void 0);else{typeof o.cellHeight=="number"&&o.cellHeightUnit&&o.cellHeightUnit!==r5.cellHeightUnit&&(o.cellHeight=o.cellHeight+o.cellHeightUnit,delete o.cellHeightUnit);let C=o.cellHeight;delete o.cellHeight,this.cellHeight(C)}o.alwaysShowResizeHandle==="mobile"&&(o.alwaysShowResizeHandle=uo),this._setStaticClass();let m=o.engineClass||e.engineClass||hx;if(this.engine=new m({column:this.getColumn(),float:o.float,maxRow:o.maxRow,onChange:C=>{C.forEach(x=>{let w=x.el;w&&(x._removeDOM?(w&&w.remove(),delete x._removeDOM):this._writePosAttr(w,x))}),this._updateContainerHeight()}}),o.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(C=>this._prepareElement(C)),delete this.engine._loading,this.batchUpdate(!1)),o.children){let C=o.children;delete o.children,C.length&&this.load(C)}this.setAnimation(),o.subGridDynamic&&!He.pauseDrag&&(He.pauseDrag=!0),o.draggable?.pause!==void 0&&(He.pauseDrag=o.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(i=this.opts){this.el.classList.add("gs-"+i.column),typeof i.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/i.column}%`)}addWidget(i){if(!i)return;if(typeof i=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(i.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(i);let o,a=i;if(a.grid=this,a.el?o=a.el:e.addRemoveCB?o=e.addRemoveCB(this.el,i,!0,!1):o=this.createWidgetDivs(a),!o)return;if(a=o.gridstackNode,a&&o.parentElement===this.el&&this.engine.nodes.find(c=>c._id===a._id))return o;let n=this._readAttr(o);return K.defaults(i,n),this.engine.prepareNode(i),this.el.appendChild(o),this.makeWidget(o,i),o}createWidgetDivs(i){let o=K.createDiv(["grid-stack-item",this.opts.itemClass]),a=K.createDiv(["grid-stack-item-content"],o);return K.lazyLoad(i)?i.visibleObservable||(i.visibleObservable=new IntersectionObserver(([n])=>{n.isIntersecting&&(i.visibleObservable?.disconnect(),delete i.visibleObservable,e.renderCB(a,i),i.grid?.prepareDragDrop(i.el))}),window.setTimeout(()=>i.visibleObservable?.observe(o))):e.renderCB(a,i),o}makeSubGrid(i,o,a,n=!0){let c=i.gridstackNode;if(c||(c=this.makeWidget(i).gridstackNode),c.subGrid?.el)return c.subGrid;let d,m=this;for(;m&&!d;)d=m.opts?.subGridOpts,m=m.parentGridNode?.grid;o=K.cloneDeep(Y(Y(De(Y({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),d||{}),o||c.subGridOpts||{})),c.subGridOpts=o;let C=!1;o.column==="auto"&&(C=!0,o.column=Math.max(c.w||1,a?.w||1),delete o.columnOpts);let x=c.el.querySelector(".grid-stack-item-content"),w,B;if(n&&(this._removeDD(c.el),B=De(Y({},c),{x:0,y:0}),K.removeInternalForSave(B),delete B.subGridOpts,c.content&&(B.content=c.content,delete c.content),e.addRemoveCB?w=e.addRemoveCB(this.el,B,!0,!1)||void 0:(w=K.createDiv(["grid-stack-item"]),w.appendChild(x),x=K.createDiv(["grid-stack-item-content"],c.el)),this.prepareDragDrop(c.el)),a){let D=C?o.column:c.w,X=c.h+a.h,ne=c.el.style;ne.transition="none",this.update(c.el,{w:D,h:X}),setTimeout(()=>ne.transition="")}let S=c.subGrid=e.addGrid(x,o)||void 0;return a?._moving&&(S._isTemp=!0),C&&(S._autoColumn=!0),n&&S.makeWidget(w,B),a&&(a._moving?window.setTimeout(()=>K.simulateMouseEvent(a._event,"mouseenter",S.el),0):S.makeWidget(c.el,c)),this.resizeToContentCheck(!1,c),S}removeAsSubGrid(i){let o=this.parentGridNode?.grid;if(o&&(o.batchUpdate(),o.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(a=>{a.x=(a.x??0)+(this.parentGridNode.x??0),a.y=(a.y??0)+(this.parentGridNode.y??0),this._removeDD(a.el),a.el.remove(),delete a.el.gridstackNode,o.makeWidget(a.el,a)}),o.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,i)){let a=i.el?.gridstackNode;a&&a!==i&&(a._temporaryRemoved=!0),window.setTimeout(()=>{let n=He.dragElement?.lastDrag||i._event;n&&K.simulateMouseEvent(n,"mouseenter",o.el)},0)}}save(i=!0,o=!1,a=e.saveCB,n){let c=this.engine.save(i,a,n);if(c.forEach(d=>{if(i&&d.el&&!d.subGrid&&!a){let m=d.el.querySelector(".grid-stack-item-content");d.content=m?.innerHTML,d.content||delete d.content}else if(!i&&!a&&delete d.content,d.subGrid?.el){let m=d.w||d.subGrid.getColumn(),C=d.subGrid.save(i,o,a,m);d.subGridOpts=o?C:{children:C},delete d.subGrid}delete d.el}),o){let d=K.cloneDeep(this.opts);d.marginBottom===d.marginTop&&d.marginRight===d.marginLeft&&d.marginTop===d.marginRight&&(d.margin=d.marginTop,delete d.marginTop,delete d.marginRight,delete d.marginBottom,delete d.marginLeft),d.rtl===(this.el.style.direction==="rtl")&&(d.rtl="auto"),this._isAutoCellHeight&&(d.cellHeight="auto"),this._autoColumn&&(d.column="auto");let m=d._alwaysShowResizeHandle;return delete d._alwaysShowResizeHandle,m!==void 0?d.alwaysShowResizeHandle=m:delete d.alwaysShowResizeHandle,K.removeInternalAndSame(d,r5),d.children=c,d}return c}load(i,o=e.addRemoveCB||!0){i.forEach(w=>{w.w=w.w||w.minW||1,w.h=w.h||w.minH||1}),i=K.sort(i),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let a=0;i.forEach(w=>{a=Math.max(a,(w.x||0)+w.w)}),a>this.engine.defaultColumn&&(this.engine.defaultColumn=a);let n=this.getColumn();a>n&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=i,this.engine.columnChanged(a,n,this.responseLayout),i=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(i,a,!0));let c=e.addRemoveCB;typeof o=="function"&&(e.addRemoveCB=o);let d=[];this.batchUpdate();let m=!this.engine.nodes.length,C=m&&this.opts.animate;C&&this.setAnimation(!1),!m&&o&&[...this.engine.nodes].forEach(w=>{w.id&&(K.find(i,w.id)||(e.addRemoveCB&&e.addRemoveCB(this.el,w,!1,!1),d.push(w),this.removeWidget(w.el,!0,!1)))}),this.engine._loading=!0;let x=[];return this.engine.nodes=this.engine.nodes.filter(w=>w.id&&K.find(i,w.id)?(x.push(w),!1):!0),i.forEach(w=>{let B=w.id?K.find(x,w.id):void 0;if(B){if(K.shouldSizeToContent(B)&&(w.h=B.h),this.engine.nodeBoundFix(w),(w.autoPosition||w.x===void 0||w.y===void 0)&&(w.w=w.w||B.w,w.h=w.h||B.h,this.engine.findEmptyPosition(w)),this.engine.nodes.push(B),K.samePos(B,w)&&this.engine.nodes.length>1&&(this.moveNode(B,De(Y({},w),{forceCollide:!0})),K.copyPos(w,B)),this.update(B.el,w),w.subGridOpts?.children){let S=B.el.querySelector(".grid-stack");S&&S.gridstack&&S.gridstack.load(w.subGridOpts.children)}}else o&&this.addWidget(w)}),delete this.engine._loading,this.engine.removedNodes=d,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,c?e.addRemoveCB=c:delete e.addRemoveCB,C&&this.setAnimation(!0,!0),this}batchUpdate(i=!0){return this.engine.batchUpdate(i),i||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(i=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!i||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let o=this.el.querySelector("."+this.opts.itemClass);if(o){let n=K.toNumber(o.getAttribute("gs-h"))||1;return Math.round(o.offsetHeight/n)}let a=parseInt(this.el.getAttribute("gs-current-row")||"0");return a?Math.round(this.el.getBoundingClientRect().height/a):this.opts.cellHeight}cellHeight(i){if(i!==void 0&&this._isAutoCellHeight!==(i==="auto")&&(this._isAutoCellHeight=i==="auto",this._updateResizeEvent()),(i==="initial"||i==="auto")&&(i=void 0),i===void 0){let a=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;i=this.cellWidth()+a}let o=K.parseHeight(i);return this.opts.cellHeightUnit===o.unit&&this.opts.cellHeight===o.h?this:(this.opts.cellHeightUnit=o.unit,this.opts.cellHeight=o.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(i=!1){return i&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let i=this.opts.columnOpts;if(!i||!i.columnWidth&&!i.breakpoints?.length)return!1;let o=this.getColumn(),a=o,n=this._widthOrContainer(!0);if(i.columnWidth)a=Math.min(Math.round(n/i.columnWidth)||1,i.columnMax);else{a=i.columnMax;let c=0;for(;c<i.breakpoints.length&&n<=i.breakpoints[c].w;)a=i.breakpoints[c++].c||o}if(a!==o){let c=i.breakpoints?.find(d=>d.c===a);return this.column(a,c?.layout||i.layout),!0}return!1}compact(i="compact",o=!0){return this.engine.compact(i,o),this._triggerChangeEvent(),this}column(i,o="moveScale"){if(!i||i<1||this.opts.column===i)return this;let a=this.getColumn();return this.opts.column=i,this.engine?(this.engine.column=i,this.el.classList.remove("gs-"+a),this._updateColumnVar(),this.engine.columnChanged(a,i,o),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=o,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(i=>i.matches("."+this.opts.itemClass)&&!i.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return!!this._ignoreLayoutsNodeChange}destroy(i=!0){return this.el?(this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),i?this.el.parentNode.removeChild(this.el):(this.removeAll(i),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this):this}float(i){return this.opts.float!==i&&(this.opts.float=this.engine.float=i,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(i,o=!1){let a=this.el.getBoundingClientRect(),n;o?n={top:a.top+document.documentElement.scrollTop,left:a.left}:n={top:this.el.offsetTop,left:this.el.offsetLeft};let c=i.left-n.left,d=i.top-n.top,m=a.width/this.getColumn(),C=a.height/parseInt(this.el.getAttribute("gs-current-row")||"0");return{x:Math.floor(c/m),y:Math.floor(d/C)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(i,o,a,n){return this.engine.isAreaEmpty(i,o,a,n)}makeWidget(i,o){let a=e.getElement(i);if(!a||a.gridstackNode)return a;a.parentElement||this.el.appendChild(a),this._prepareElement(a,!0,o);let n=a.gridstackNode;this._updateContainerHeight(),n.subGridOpts&&this.makeSubGrid(a,n.subGridOpts,void 0,!1);let c=!1;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(c=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),c&&delete this._ignoreLayoutsNodeChange,a}on(i,o){return i.indexOf(" ")!==-1?(i.split(" ").forEach(a=>this.on(a,o)),this):(i==="change"||i==="added"||i==="removed"||i==="enable"||i==="disable"?(i==="enable"||i==="disable"?this._gsEventHandler[i]=a=>o(a):this._gsEventHandler[i]=a=>{a.detail&&o(a,a.detail)},this.el.addEventListener(i,this._gsEventHandler[i])):i==="drag"||i==="dragstart"||i==="dragstop"||i==="resizestart"||i==="resize"||i==="resizestop"||i==="dropped"||i==="resizecontent"?this._gsEventHandler[i]=o:console.error("GridStack.on("+i+") event not supported"),this)}off(i){return i.indexOf(" ")!==-1?(i.split(" ").forEach(o=>this.off(o)),this):((i==="change"||i==="added"||i==="removed"||i==="enable"||i==="disable")&&this._gsEventHandler[i]&&this.el.removeEventListener(i,this._gsEventHandler[i]),delete this._gsEventHandler[i],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(i=>this.off(i)),this}removeWidget(i,o=!0,a=!0){return i?(e.getElements(i).forEach(n=>{if(n.parentElement&&n.parentElement!==this.el)return;let c=n.gridstackNode;c||(c=this.engine.nodes.find(d=>n===d.el)),c&&(o&&e.addRemoveCB&&e.addRemoveCB(this.el,c,!1,!1),delete n.gridstackNode,this._removeDD(n),this.engine.removeNode(c,o,a),o&&n.parentElement&&n.remove())}),a&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(i=!0,o=!0){return this.engine.nodes.forEach(a=>{i&&e.addRemoveCB&&e.addRemoveCB(this.el,a,!1,!1),delete a.el.gridstackNode,this.opts.staticGrid||this._removeDD(a.el)}),this.engine.removeAll(i,o),o&&this._triggerRemoveEvent(),this}setAnimation(i=this.opts.animate,o){return o?setTimeout(()=>{this.opts&&this.setAnimation(i)}):i?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=i,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(i,o=!0,a=!0){return!!this.opts.staticGrid===i?this:(i?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(n=>{this.prepareDragDrop(n.el),n.subGrid&&a&&n.subGrid.setStatic(i,o,a)}),o&&this._setStaticClass(),this)}updateOptions(i){let o=this.opts;if(i===o)return this;if(i.acceptWidgets!==void 0&&(o.acceptWidgets=i.acceptWidgets,this._setupAcceptWidget()),i.animate!==void 0&&this.setAnimation(i.animate),i.cellHeight&&this.cellHeight(i.cellHeight),i.class!==void 0&&i.class!==o.class&&(o.class&&this.el.classList.remove(o.class),i.class&&this.el.classList.add(i.class)),i.columnOpts){let a=!!this.opts.columnOpts;this.opts.columnOpts=i.columnOpts,a!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else i.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof i.column=="number"&&this.column(i.column);return i.margin!==void 0&&this.margin(i.margin),i.staticGrid!==void 0&&this.setStatic(i.staticGrid),i.disableDrag!==void 0&&!i.staticGrid&&this.enableMove(!i.disableDrag),i.disableResize!==void 0&&!i.staticGrid&&this.enableResize(!i.disableResize),i.float!==void 0&&this.float(i.float),i.row!==void 0?(o.minRow=o.maxRow=this.engine.maxRow=o.row=i.row,this._updateContainerHeight(),this.engine.getRow()>i.row&&this.compact()):(i.minRow!==void 0&&(o.minRow=i.minRow,this._updateContainerHeight()),i.maxRow!==void 0&&(o.maxRow=this.engine.maxRow=i.maxRow,this.engine.getRow()>i.maxRow&&this.compact())),i.lazyLoad!==void 0&&(o.lazyLoad=i.lazyLoad),i.children?.length&&this.load(i.children),this}update(i,o){return e.getElements(i).forEach(a=>{let n=a?.gridstackNode;if(!n)return;let c=Y(Y({},K.copyPos({},n)),K.cloneDeep(o));this.engine.nodeBoundFix(c),delete c.autoPosition;let d=["x","y","w","h"],m,C=c,x=n;if(d.some(S=>C[S]!==void 0&&C[S]!==x[S])){m={};let S=m;d.forEach(D=>{S[D]=C[D]!==void 0?C[D]:x[D],delete C[D]})}if(!m&&(c.minW||c.minH||c.maxW||c.maxH)&&(m={}),c.content!==void 0){let S=a.querySelector(".grid-stack-item-content");S&&S.textContent!==c.content&&(n.content=c.content,e.renderCB(S,c),n.subGrid?.el&&(S.appendChild(n.subGrid.el),n.subGrid._updateContainerHeight())),delete c.content}let w=!1,B=!1;for(let S in C)S[0]!=="_"&&x[S]!==C[S]&&(x[S]=C[S],w=!0,B=B||!this.opts.staticGrid&&(S==="noResize"||S==="noMove"||S==="locked"));if(K.sanitizeMinMax(n),m){let S=m.w!==void 0&&m.w!==n.w;this.moveNode(n,m),S&&n.subGrid?n.subGrid.onResize(this.hasAnimationCSS()?n.w:void 0):this.resizeToContentCheck(S,n),delete n._orig}(m||w)&&this._writeAttr(a,n),B&&this.prepareDragDrop(n.el),e.updateCB&&e.updateCB(n)}),this}moveNode(i,o){let a=i._updating;a||this.engine.cleanNodes().beginUpdate(i),this.engine.moveNode(i,o),this._updateContainerHeight(),a||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(i){if(!i||(i.classList.remove("size-to-content-max"),!i.clientHeight))return;let o=i.gridstackNode;if(!o)return;let a=o.grid;if(!a||i.parentElement!==a.el)return;let n=a.getCellHeight(!0);if(!n)return;let c=o.h?o.h*n:i.clientHeight,d=null;if(o.resizeToContentParent&&(d=i.querySelector(o.resizeToContentParent)),d||(d=i.querySelector(e.resizeToContentParent)),!d)return;let m=i.clientHeight-d.clientHeight,C=o.h?o.h*n-m:d.clientHeight,x;if(o.subGrid){x=o.subGrid.getRow()*o.subGrid.getCellHeight(!0);let S=o.subGrid.el.getBoundingClientRect(),D=i.getBoundingClientRect();x+=S.top-D.top}else{if(o.subGridOpts?.children?.length)return;{let S=d.firstElementChild;if(!S){console.error(`Error: GridStack.resizeToContent() widget id:${o.id} '${e.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}x=S.getBoundingClientRect().height||C}}if(C===x)return;c+=x-C;let w=Math.ceil(c/n),B=Number.isInteger(o.sizeToContent)?o.sizeToContent:0;B&&w>B&&(w=B,i.classList.add("size-to-content-max")),o.minH&&w<o.minH?w=o.minH:o.maxH&&w>o.maxH&&(w=o.maxH),w!==o.h&&(a._ignoreLayoutsNodeChange=!0,a.moveNode(o,{h:w}),delete a._ignoreLayoutsNodeChange)}resizeToContentCBCheck(i){e.resizeToContentCB?e.resizeToContentCB(i):this.resizeToContent(i)}rotate(i,o){return e.getElements(i).forEach(a=>{let n=a.gridstackNode;if(!n||!K.canBeRotated(n))return;let c={w:n.h,h:n.w,minH:n.minW,minW:n.minH,maxH:n.maxW,maxW:n.maxH};if(o){let C=o.left>0?Math.floor(o.left/this.cellWidth()):0,x=o.top>0?Math.floor(o.top/this.opts.cellHeight):0;c.x=n.x+C-(n.h-(x+1)),c.y=n.y+x-C}let d=c;Object.keys(d).forEach(C=>{d[C]===void 0&&delete d[C]});let m=n._orig;this.update(a,c),n._orig=m}),this}margin(i){if(!(typeof i=="string"&&i.split(" ").length>1)){let o=K.parseHeight(i);if(this.opts.marginUnit===o.unit&&this.opts.margin===o.h)return this}return this.opts.margin=i,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(i){return this.engine.willItFit(i)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let i=this.engine.getDirtyNodes(!0);return i&&i.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(i),this._triggerEvent("change",i)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(o=>{delete o._dirty});let i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(i,o){let a=o?new CustomEvent(i,{bubbles:!1,detail:o}):new Event(i),n=this;for(;n.parentGridNode;)n=n.parentGridNode.grid;return n.el.dispatchEvent(a),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let i=this.parentGridNode,o=this.getRow()+this._extraDragRow,a=this.opts.cellHeight,n=this.opts.cellHeightUnit;if(!a)return this;if(!i&&!this.opts.minRow){let c=K.parseHeight(getComputedStyle(this.el).minHeight);if(c.h>0&&c.unit===n){let d=Math.floor(c.h/a);o<d&&(o=d)}}return this.el.setAttribute("gs-current-row",String(o)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),o&&(this.el.style[i?"minHeight":"height"]=o*a+n),i&&K.shouldSizeToContent(i)&&i.grid.resizeToContentCBCheck(i.el),this}_prepareElement(i,o=!1,a){a=a||this._readAttr(i),i.gridstackNode=a,a.el=i,a.grid=this,a=this.engine.addNode(a,o),this._writeAttr(i,a),i.classList.add(r5.itemClass,this.opts.itemClass);let n=K.shouldSizeToContent(a);return n?i.classList.add("size-to-content"):i.classList.remove("size-to-content"),n&&this.resizeToContentCheck(!1,a),(!K.lazyLoad(a)||!a.visibleObservable)&&this.prepareDragDrop(a.el),this}_writePosAttr(i,o){if(!o._moving&&!o._resizing||this._placeholder===i){let a=this.opts.rtl?"right":"left",n=i.style;n.top=o.y?o.y===1?"var(--gs-cell-height)":`calc(${o.y} * var(--gs-cell-height))`:null,n[a]=o.x?o.x===1?"var(--gs-column-width)":`calc(${o.x} * var(--gs-column-width))`:null,n.width=o.w>1?`calc(${o.w} * var(--gs-column-width))`:null,n.height=o.h>1?`calc(${o.h} * var(--gs-cell-height))`:null}return i.setAttribute("gs-x",String(o.x??0)),i.setAttribute("gs-y",String(o.y??0)),o.w>1?i.setAttribute("gs-w",String(o.w)):i.removeAttribute("gs-w"),o.h>1?i.setAttribute("gs-h",String(o.h)):i.removeAttribute("gs-h"),this}_writeAttr(i,o){if(!o)return this;this._writePosAttr(i,o);let a={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"},n=o,c=a;for(let d in c)n[d]?i.setAttribute(c[d],String(n[d])):i.removeAttribute(c[d]);return this}_readAttr(i,o=!0){let a={};a.x=K.toNumber(i.getAttribute("gs-x")),a.y=K.toNumber(i.getAttribute("gs-y")),a.w=K.toNumber(i.getAttribute("gs-w")),a.h=K.toNumber(i.getAttribute("gs-h")),a.autoPosition=K.toBool(i.getAttribute("gs-auto-position")),a.noResize=K.toBool(i.getAttribute("gs-no-resize")),a.noMove=K.toBool(i.getAttribute("gs-no-move")),a.locked=K.toBool(i.getAttribute("gs-locked"));let n=i.getAttribute("gs-size-to-content");n&&(n==="true"||n==="false"?a.sizeToContent=K.toBool(n):a.sizeToContent=parseInt(n,10)),a.id=i.getAttribute("gs-id")??void 0,a.maxW=K.toNumber(i.getAttribute("gs-max-w")),a.minW=K.toNumber(i.getAttribute("gs-min-w")),a.maxH=K.toNumber(i.getAttribute("gs-max-h")),a.minH=K.toNumber(i.getAttribute("gs-min-h")),o&&(a.w===1&&i.removeAttribute("gs-w"),a.h===1&&i.removeAttribute("gs-h"),a.maxW&&i.removeAttribute("gs-max-w"),a.minW&&i.removeAttribute("gs-min-w"),a.maxH&&i.removeAttribute("gs-max-h"),a.minH&&i.removeAttribute("gs-min-h"));let c=a;for(let d in c)a.hasOwnProperty(d)&&!c[d]&&c[d]!==0&&d!=="sizeToContent"&&delete c[d];return a}_setStaticClass(){let i=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...i),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...i),this.el.removeAttribute("gs-static")),this}onResize(i=this.el?.clientWidth){if(!i)return this;if(this.prevWidth===i)return this;this.prevWidth=i,this.batchUpdate();let o=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),o=!0):o=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(a=>{a.subGrid&&a.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(o),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(i=!1,o){if(!this.engine)return;if(i&&this.hasAnimationCSS()){setTimeout(()=>this.resizeToContentCheck(!1,o),this.animationDelay);return}if(o)K.shouldSizeToContent(o)&&this.resizeToContentCBCheck(o.el);else if(this.engine.nodes.some(n=>K.shouldSizeToContent(n))){let n=[...this.engine.nodes];this.batchUpdate(),n.forEach(c=>{K.shouldSizeToContent(c)&&this.resizeToContentCBCheck(c.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}let a=this._gsEventHandler.resizecontent;a&&a(new Event("resizecontent"),o?[o]:this.engine.nodes)}_updateResizeEvent(i=!1){let o=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(a=>a.sizeToContent));return!i&&o&&!this.resizeObserver?(this._sizeThrottle=K.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(i||!o)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(i=".grid-stack-item"){return K.getElement(i)}static getElements(i=".grid-stack-item"){return K.getElements(i)}static getGridElement(i){return e.getElement(i)}static getGridElements(i){return K.getElements(i)}_initMargin(){let i={h:0,unit:"px"},o=0,a=[];typeof this.opts.margin=="string"&&(a=this.opts.margin.split(" ")),a.length===2?(this.opts.marginTop=this.opts.marginBottom=a[0],this.opts.marginLeft=this.opts.marginRight=a[1]):a.length===4?(this.opts.marginTop=a[0],this.opts.marginRight=a[1],this.opts.marginBottom=a[2],this.opts.marginLeft=a[3]):(i=K.parseHeight(this.opts.margin),this.opts.marginUnit=i.unit,o=this.opts.margin=i.h);let n=["marginTop","marginRight","marginBottom","marginLeft"],c=this.opts;n.forEach(m=>{c[m]===void 0?c[m]=o:(i=K.parseHeight(c[m]),c[m]=i.h,delete this.opts.margin)}),this.opts.marginUnit=i.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);let d=this.el.style;return d.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),d.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),d.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),d.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return yi}static setupDragIn(i,o,a,n=document){o?.pause!==void 0&&(He.pauseDrag=o.pause),o=Y({appendTo:"body",helper:"clone"},o||{}),(typeof i=="string"?K.getElements(i,n):i).forEach((c,d)=>{yi.isDraggable(c)||yi.dragIn(c,o),a?.[d]&&(c.gridstackNode=a[d])})}movable(i,o){return this.opts.staticGrid?this:(e.getElements(i).forEach(a=>{let n=a.gridstackNode;n&&(o?delete n.noMove:n.noMove=!0,this.prepareDragDrop(n.el))}),this)}resizable(i,o){return this.opts.staticGrid?this:(e.getElements(i).forEach(a=>{let n=a.gridstackNode;n&&(o?delete n.noResize:n.noResize=!0,this.prepareDragDrop(n.el))}),this)}disable(i=!0){return this.opts.staticGrid?this:(this.enableMove(!1,i),this.enableResize(!1,i),this._triggerEvent("disable"),this)}enable(i=!0){return this.opts.staticGrid?this:(this.enableMove(!0,i),this.enableResize(!0,i),this._triggerEvent("enable"),this)}enableMove(i,o=!0){return this.opts.staticGrid?this:(i?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(a=>{this.prepareDragDrop(a.el),a.subGrid&&o&&a.subGrid.enableMove(i,o)}),this)}enableResize(i,o=!0){return this.opts.staticGrid?this:(i?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(a=>{this.prepareDragDrop(a.el),a.subGrid&&o&&a.subGrid.enableResize(i,o)}),this)}cancelDrag(){let i=He.dragElement?.el;if(i?._gridstackNodeOrig){let a=i._gridstackNodeOrig,n=a.grid,c=this._placeholder?.gridstackNode;c&&(c._isAboutToRemove=!0,this.engine.removeNode(c)),this.engine.restoreInitial(),i.gridstackNode=a,delete i._gridstackNodeOrig,delete He.dropElement,n&&(n.engine.addNode(a,!1),n.engine.restoreInitial());return}let o=this._placeholder?.gridstackNode;o&&(o._isExternal?(o._isAboutToRemove=!0,this.engine.removeNode(o)):o._isAboutToRemove&&e._itemRemoving(o.el,!1),this.engine.restoreInitial())}_removeDD(i){return yi.draggable(i,"destroy").resizable(i,"destroy"),i.gridstackNode&&delete i.gridstackNode._initDD,delete i.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return yi.droppable(this.el,"destroy"),this;let i,o,a=(n,c,d)=>{d=d||c;let m=d.gridstackNode;if(!m)return;if(!m.grid?.el){d.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let S=d.getBoundingClientRect();d.style.left=S.x+(this.dragTransform.xScale-1)*(n.clientX-S.x)/this.dragTransform.xScale+"px",d.style.top=S.y+(this.dragTransform.yScale-1)*(n.clientY-S.y)/this.dragTransform.yScale+"px",d.style.transformOrigin="0px 0px"}let{top:C,left:x}=d.getBoundingClientRect(),w=this.el.getBoundingClientRect();x-=w.left,C-=w.top;let B={position:{top:C*this.dragTransform.xScale,left:x*this.dragTransform.yScale}};if(m._temporaryRemoved){if(m.x=Math.max(0,Math.round(x/o)),m.y=Math.max(0,Math.round(C/i)),delete m.autoPosition,this.engine.nodeBoundFix(m),!this.engine.willItFit(m)){if(m.autoPosition=!0,!this.engine.willItFit(m)){yi.off(c,"drag");return}m._willFitPos&&(K.copyPos(m,m._willFitPos),delete m._willFitPos)}this._onStartMoving(d,n,B,m,o,i)}else this._dragOrResize(d,n,B,m,o,i)};return yi.droppable(this.el,{accept:n=>{let c=n.gridstackNode||this._readAttr(n,!1);if(c?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let d=!0;if(typeof this.opts.acceptWidgets=="function")d=this.opts.acceptWidgets(n);else{let m=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;d=n.matches(m)}if(d&&c&&this.opts.maxRow){let m={w:c.w,h:c.h,minW:c.minW,minH:c.minH};d=this.engine.willItFit(m)}return d}}).on(this.el,"dropover",(n,c,d)=>{let m=d?.gridstackNode||c.gridstackNode;if(m?.grid===this&&!m._temporaryRemoved)return!1;if(m?._sidebarOrig&&(m.w=m._sidebarOrig.w,m.h=m._sidebarOrig.h),m?.grid&&m.grid!==this&&!m._temporaryRemoved&&m.grid._leave(c,d),d=d||c,o=this.cellWidth(),i=this.getCellHeight(!0),!m){let w=d.getAttribute("data-gs-widget")||d.getAttribute("gridstacknode");if(w){try{m=JSON.parse(w)}catch{console.error("Gridstack dropover: Bad JSON format: ",w)}d.removeAttribute("data-gs-widget"),d.removeAttribute("gridstacknode")}m||(m=this._readAttr(d)),m._sidebarOrig={w:m.w,h:m.h}}m.grid||(m.el||(m=Y({},m)),m._isExternal=!0,d.gridstackNode=m);let C=m.w||Math.round(d.offsetWidth/o)||1,x=m.h||Math.round(d.offsetHeight/i)||1;return m.grid&&m.grid!==this?(c._gridstackNodeOrig||(c._gridstackNodeOrig=m),c.gridstackNode=m=De(Y({},m),{w:C,h:x,grid:this}),delete m.x,delete m.y,this.engine.cleanupNode(m).nodeBoundFix(m),m._initDD=m._isExternal=m._temporaryRemoved=!0):(m.w=C,m.h=x,m._temporaryRemoved=!0),e._itemRemoving(m.el,!1),yi.on(c,"drag",a),a(n,c,d),!1}).on(this.el,"dropout",(n,c,d)=>{let m=d?.gridstackNode||c.gridstackNode;return m&&(!m.grid||m.grid===this)&&(this._leave(c,d),this._isTemp&&this.removeAsSubGrid(m)),!1}).on(this.el,"drop",(n,c,d)=>{let m=d?.gridstackNode||c.gridstackNode;if(m?.grid===this&&!m._isExternal)return!1;let C=!!this.placeholder.parentElement,x=c!==d;this.placeholder.remove(),delete this.placeholder.gridstackNode,C&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let w=c._gridstackNodeOrig;if(delete c._gridstackNodeOrig,C&&w?.grid&&w.grid!==this){let S=w.grid;S.engine.removeNodeFromLayoutCache(w),S.engine.removedNodes.push(w),S._triggerRemoveEvent()._triggerChangeEvent(),S.parentGridNode&&!S.engine.nodes.length&&S.opts.subGridDynamic&&S.removeAsSubGrid()}if(!m||(C&&(this.engine.cleanupNode(m),m.grid=this),delete m.grid?._isTemp,yi.off(c,"drag"),d&&d!==c?(d.remove(),c=d):c.remove(),this._removeDD(c),!C))return!1;let B=m.subGrid?.el?.gridstack;return K.copyPos(m,this._readAttr(this.placeholder)),K.removePositioningStyles(c),x&&(m.content||m.subGridOpts||e.addRemoveCB)?(delete m.el,c=this.addWidget(m)||c):(this._prepareElement(c,!0,m),this.el.appendChild(c),this.resizeToContentCheck(!1,m),B&&(B.parentGridNode=m),this._updateContainerHeight()),this.engine.addedNodes.push(m),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(De(Y({},n),{type:"dropped"}),w&&w.grid?w:void 0,m),!1}),this}static _itemRemoving(i,o){if(!i)return;let a=i?i.gridstackNode:void 0;!a?.grid||i.classList.contains(a.grid.opts.removableOptions.decline)||(o?a._isAboutToRemove=!0:delete a._isAboutToRemove,o?i.classList.add("grid-stack-item-removing"):i.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let i=document.querySelector(this.opts.removable);return i?(!this.opts.staticGrid&&!yi.isDroppable(i)&&yi.droppable(i,this.opts.removableOptions).on(i,"dropover",(o,a)=>e._itemRemoving(a,!0)).on(i,"dropout",(o,a)=>e._itemRemoving(a,!1)),this):this}refreshDragHandles(i){return e.getElements(i).forEach(o=>{o.ddElement?.ddDraggable?.refreshHandles()}),this}prepareDragDrop(i,o=!1){let a=i?.gridstackNode;if(!a)return this;let n=a.noMove||this.opts.disableDrag,c=a.noResize||this.opts.disableResize,d=this.opts.staticGrid||n&&c;if((o||d)&&(a._initDD&&(this._removeDD(i),delete a._initDD),d))return i.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!a._initDD){let m,C,x=(S,D)=>{this.triggerEvent(S,S.target),m=this.cellWidth(),C=this.getCellHeight(!0),this._onStartMoving(i,S,D,a,m,C)},w=(S,D)=>{this._dragOrResize(i,S,D,a,m,C)},B=S=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete a._moving,delete a._resizing,delete a._event,delete a._lastTried;let D=a.w!==a._orig.w,X=S.target;if(!(!X.gridstackNode||X.gridstackNode.grid!==this)){if(a.el=X,a._isAboutToRemove){let ne=i.gridstackNode.grid;ne._gsEventHandler[S.type]&&ne._gsEventHandler[S.type](S,X),ne.engine.nodes.push(a),ne.removeWidget(i,!0,!0)}else K.removePositioningStyles(X),a._temporaryRemoved?(this._writePosAttr(X,a),this.engine.addNode(a)):this._writePosAttr(X,a),this.triggerEvent(S,X);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),S.type==="resizestop"&&(Number.isInteger(a.sizeToContent)&&(a.sizeToContent=a.h),this.resizeToContentCheck(D,a))}};yi.draggable(i,{start:x,stop:B,drag:w,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}).resizable(i,{start:x,stop:B,resize:w,rtl:this.opts.rtl==="auto"?void 0:this.opts.rtl}),a._initDD=!0}return yi.draggable(i,n?"disable":"enable").resizable(i,c?"disable":"enable"),this}_onStartMoving(i,o,a,n,c,d){if(this.engine.cleanNodes().beginUpdate(n),this._writePosAttr(this.placeholder,n),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=n,n.grid?.el)this.dragTransform=K.getValuesFromTransformedElement(i);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let m=this.placeholder.closest(".grid-stack");this.dragTransform=K.getValuesFromTransformedElement(m)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(n.el=this.placeholder,n._lastUiPosition=a.position,n._prevYPix=a.position.top,n._moving=o.type==="dragstart",n._resizing=o.type==="resizestart",delete n._lastTried,o.type==="dropover"&&n._temporaryRemoved&&(this.engine.addNode(n),n._moving=!0),this.engine.cacheRects(c,d,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),o.type==="resizestart"){let m=this.getColumn()-n.x,C=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-n.y;yi.resizable(i,"option","minWidth",c*Math.min(n.minW||1,m)).resizable(i,"option","minHeight",d*Math.min(n.minH||1,C)).resizable(i,"option","maxWidth",c*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,m)).resizable(i,"option","maxWidthMoveLeft",c*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,n.x+n.w)).resizable(i,"option","maxHeight",d*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,C)).resizable(i,"option","maxHeightMoveUp",d*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,n.y+n.h))}}_dragOrResize(i,o,a,n,c,d){let m=Y({},n._orig),C=!1,x=this.opts.marginLeft,w=this.opts.marginRight,B=this.opts.marginTop,S=this.opts.marginBottom,D=Math.round(d*.1),X=Math.round(c*.1);if(x=Math.min(x,X),w=Math.min(w,X),B=Math.min(B,D),S=Math.min(S,D),o.type==="drag"){if(n._temporaryRemoved)return;n._prevYPix=a.position.top,this.opts.draggable.scroll!==!1&&He.dragElement?.updateScrollPosition(this.el);let U=a.position.left+(a.position.left>n._lastUiPosition.left?-w:x),he=a.position.top+(a.position.top>n._lastUiPosition.top?-S:B);m.x=Math.round(U/c),m.y=Math.round(he/d);let be=this._extraDragRow;if(this.engine.collide(n,m)){let qe=this.getRow(),oe=Math.max(0,m.y+n.h-qe);this.opts.maxRow&&qe+oe>this.opts.maxRow&&(oe=Math.max(0,this.opts.maxRow-qe)),this._extraDragRow=oe}else this._extraDragRow=0;if(this._extraDragRow!==be&&this._updateContainerHeight(),n.x===m.x&&n.y===m.y)return}else if(o.type==="resize"){if((m.x??0)<0||(K.updateScrollResize(o,i,d),m.w=Math.round((a.size.width-x)/c),m.h=Math.round((a.size.height-B)/d),n.w===m.w&&n.h===m.h)||n._lastTried&&n._lastTried.w===m.w&&n._lastTried.h===m.h)return;if(o.hasMovedX){let U=a.position.left+x;m.x=Math.round(U/c)}if(o.hasMovedY){let U=a.position.top+B;m.y=Math.round(U/d)}C=!0}n._event=o,n._lastTried=m;let ne={x:a.position.left+x,y:a.position.top+B,w:(a.size?a.size.width:n.w*c)-x-w,h:(a.size?a.size.height:n.h*d)-B-S};if(this.engine.moveNodeCheck(n,De(Y({},m),{cellWidth:c,cellHeight:d,rect:ne,resizing:C}))){n._lastUiPosition=a.position,this.engine.cacheRects(c,d,B,w,S,x),delete n._skipDown,C&&n.subGrid&&n.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let U=o.target;n._sidebarOrig||this._writePosAttr(U,n),this.triggerEvent(o,U)}}triggerEvent(i,o){let a=this;for(;a.parentGridNode;)a=a.parentGridNode.grid;a._gsEventHandler[i.type]&&a._gsEventHandler[i.type](i,o)}_leave(i,o){o=o||i;let a=o.gridstackNode;if(!a||(o.style.transform=o.style.transformOrigin="",yi.off(i,"drag"),a._temporaryRemoved))return;a._temporaryRemoved=!0,this.engine.removeNode(a),a.el=a._isExternal&&o?o:i;let n=a._sidebarOrig;a._isExternal&&this.engine.cleanupNode(a),a._sidebarOrig=n,this.opts.removable===!0&&e._itemRemoving(i,!0),i._gridstackNodeOrig?(i.gridstackNode=i._gridstackNodeOrig,delete i._gridstackNodeOrig):a._isExternal&&this.engine.restoreInitial()}}return e.renderCB=(t,i)=>{t&&i?.content&&(t.textContent=i.content)},e.resizeToContentParent=".grid-stack-item-content",e.Utils=K,e.Engine=hx,e.GDRev="13.0.1",e})(),Sk=["container"],Bhe=["*"];function Mhe(e,t){}var khe=["*",[["","empty-content",""]]],Ehe=["*","[empty-content]"];function Zhe(e,t){e&1&&jt(0,1,["*ngIf","isEmpty"])}function Lhe(e,t){}var sv=(()=>{class e{constructor(i){this.elementRef=i,this.el._gridItemComp=this}set options(i){let o=this.el.gridstackNode?.grid;o?o.update(this.el,i):this._options=De(Y({},i),{el:this.el})}get options(){return this.el.gridstackNode||this._options||{el:this.el}}get el(){return this.elementRef.nativeElement}clearOptions(){delete this._options}ngOnDestroy(){this.clearOptions(),delete this.childWidget,delete this.el._gridItemComp,delete this.container,delete this.ref}}return e.\u0275fac=function(t){return new(t||e)(O1(gt))},e.\u0275cmp=Ye({type:e,selectors:[["gridstack-item"]],viewQuery:function(t,i){if(t&1&&w_(Sk,7,t2),t&2){let o;pu(o=_u())&&(i.container=o.first)}},inputs:{options:"options"},ngContentSelectors:Bhe,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(t,i){t&1&&(Kt(),b_(0,"div",1),PT(1,Mhe,0,0,"ng-template",null,0,iB),jt(3),xe(4),C_()),t&2&&(P(4),e0(" ",i.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),e})(),sp=(()=>{class e{constructor(i){this.elementRef=i,this.addedCB=new x1,this.changeCB=new x1,this.disableCB=new x1,this.dragCB=new x1,this.dragStartCB=new x1,this.dragStopCB=new x1,this.droppedCB=new x1,this.enableCB=new x1,this.removedCB=new x1,this.resizeCB=new x1,this.resizeStartCB=new x1,this.resizeStopCB=new x1,K2.addRemoveCB||(K2.addRemoveCB=Hhe),K2.saveCB||(K2.saveCB=Dhe),K2.updateCB||(K2.updateCB=Rhe),this.el._gridComp=this}set options(i){this._grid?this._grid.updateOptions(i):this._options=i}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static registerComponents(i){i.forEach(o=>e.componentMap[e.getSelector(o)]=o)}static getSelector(i){return lB(i).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=K2.init(this._options,this.el),delete this._options,this.checkEmpty()}ngAfterContentInit(){this._sub=this.gridstackItems?.changes.subscribe(()=>this.updateAll()),this.loaded||this.updateAll(),this.hookEvents(this.grid)}ngOnDestroy(){this.unhookEvents(this._grid),this._sub?.unsubscribe(),this._grid?.destroy(),delete this._grid,delete this.el._gridComp,delete this.container,delete this.ref}updateAll(){if(!this.grid)return;let i=[];this.gridstackItems?.forEach(o=>{i.push(o.options),o.clearOptions()}),this.grid.load(i)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(i){i&&(i.parentGridNode||i.on("added",(o,a)=>{(a[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:o,nodes:a})}).on("change",(o,a)=>this.changeCB.emit({event:o,nodes:a})).on("disable",o=>this.disableCB.emit({event:o})).on("drag",(o,a)=>this.dragCB.emit({event:o,el:a})).on("dragstart",(o,a)=>this.dragStartCB.emit({event:o,el:a})).on("dragstop",(o,a)=>this.dragStopCB.emit({event:o,el:a})).on("dropped",(o,a,n)=>this.droppedCB.emit({event:o,previousNode:a,newNode:n})).on("enable",o=>this.enableCB.emit({event:o})).on("removed",(o,a)=>{(a[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:o,nodes:a})}).on("resize",(o,a)=>this.resizeCB.emit({event:o,el:a})).on("resizestart",(o,a)=>this.resizeStartCB.emit({event:o,el:a})).on("resizestop",(o,a)=>this.resizeStopCB.emit({event:o,el:a})))}unhookEvents(i){i&&(i.parentGridNode||i.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return e.componentMap={},e.\u0275fac=function(t){return new(t||e)(O1(gt))},e.\u0275cmp=Ye({type:e,selectors:[["gridstack"]],contentQueries:function(t,i,o){if(t&1&&jT(o,sv,4),t&2){let a;pu(a=_u())&&(i.gridstackItems=a)}},viewQuery:function(t,i){if(t&1&&w_(Sk,7,t2),t&2){let o;pu(o=_u())&&(i.container=o.first)}},inputs:{options:"options",isEmpty:"isEmpty"},outputs:{addedCB:"addedCB",changeCB:"changeCB",disableCB:"disableCB",dragCB:"dragCB",dragStartCB:"dragStartCB",dragStopCB:"dragStopCB",droppedCB:"droppedCB",enableCB:"enableCB",removedCB:"removedCB",resizeCB:"resizeCB",resizeStartCB:"resizeStartCB",resizeStopCB:"resizeStopCB"},ngContentSelectors:Ehe,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(t,i){t&1&&(Kt(khe),VT(0,Zhe,1,0,"ng-content",1)(1,Lhe,0,0,"ng-template",null,0,iB),jt(3)),t&2&&ve("ngIf",i.isEmpty)},dependencies:[D$],styles:["[_nghost-%COMP%]{display:block}"]}),e})();function Hhe(e,t,i,o){if(i){if(!e)return;if(o){let a=e.parentElement?._gridItemComp;if(!a)return;let n=(a.childWidget?.container||a.container)?.createComponent(sp),c=n?.instance;return c?(c.ref=n,c.options=t,c.el):void 0}else{let a=e._gridComp?.container?.createComponent(sv),n=a?.instance;if(!n)return;n.ref=a;let c=t.component,d=c?sp.componentMap[c]:void 0;if(d){let m=()=>{let C=n.container?.createComponent(d),x=C?.instance;x&&typeof x.serialize=="function"&&typeof x.deserialize=="function"&&(n.childWidget=x,x._compRef=C,x.deserialize(t))};t.lazyLoad||t.grid?.opts?.lazyLoad&&t.lazyLoad!==!1?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([C])=>{C.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,m(),t.grid?.refreshDragHandles(n.el))}),window.setTimeout(()=>t.visibleObservable?.observe(n.el))):(m(),t.grid?.refreshDragHandles(n.el))}return n.el}}else if(o){let a=t.el?._gridComp;a?.ref?a.ref.destroy():a?.ngOnDestroy()}else{let a=t.el?._gridItemComp;a?.ref?a.ref.destroy():a?.ngOnDestroy()}}function Dhe(e,t){let i=e.el?._gridItemComp;if(i){let a=i.childWidget?.serialize();a&&(t.props=a);return}let o=e.el?._gridComp}function Rhe(e){let t=e,i=e.el?._gridItemComp;i?.childWidget&&t.props&&i.childWidget.deserialize(t)}var Ohe={unsavedChanges:"Nicht gespeicherte \xC4nderungen",editCards:"Karten bearbeiten",editView:"Ansicht bearbeiten",actions:"Aktionen",save:"Speichern",cancel:"Abbrechen",discard:"Verwerfen",discardChanges:"\xC4nderungen verwerfen",discardConfirmBody:"\xC4nderungen verwerfen? Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",unsavedNavBody:"Sie verlassen diese Seite. Speichern oder verwerfen Sie die \xC4nderungen, um fortzufahren. Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.",noCardsAvailable:"Keine Karten verf\xFCgbar.",removeSection:"Bereich entfernen",removeCard:"Karte entfernen",resizable:"Gr\xF6\xDFenver\xE4nderbar"},Nhe={unsavedChanges:"Unsaved Changes",editCards:"Edit Cards",editView:"Edit View",actions:"Actions",save:"Save",cancel:"Cancel",discard:"Discard",discardChanges:"Discard Changes",discardConfirmBody:"Discard the changes? This action cannot be undone.",unsavedNavBody:"You are leaving this page. Save or discard the changes to proceed. This action cannot be undone.",noCardsAvailable:"No cards available.",removeSection:"Remove section",removeCard:"Remove card",resizable:"Resizable"},Yr={UNSAVED_CHANGES:"unsavedChanges",EDIT_CARDS:"editCards",EDIT_VIEW:"editView",ACTIONS:"actions",SAVE:"save",CANCEL:"cancel",DISCARD:"discard",DISCARD_CHANGES:"discardChanges",DISCARD_CONFIRM_BODY:"discardConfirmBody",UNSAVED_NAV_BODY:"unsavedNavBody",NO_CARDS_AVAILABLE:"noCardsAvailable",REMOVE_SECTION:"removeSection",REMOVE_CARD:"removeCard",RESIZABLE:"resizable"},Vhe={en:Nhe,de:Ohe},In=class L6{language=$t("en");getTranslation(t){return Vhe[this.language()][t]??t}static \u0275fac=function(t){return new(t||L6)};static \u0275prov=q1({token:L6,factory:L6.\u0275fac})},Ld={WC:"wc",ANGULAR:"angular",SAP_UI:"sap-ui"},Phe=/^[a-z](?:[a-z0-9-]*)$/,lp=new Map;function zhe(e){for(let t of e){let i=lB(t);if(!i)throw new Error(`Dashboard card registration failed: "${Ik(t)}" is not an Angular component.`);if(!Bz(t))throw new Error(`Dashboard card registration failed: "${i.selector}" must be a standalone Angular component.`);let o=Whe(i.selector,t),a=lp.get(o);if(a&&a.componentType!==t)throw new Error(`Dashboard card registration failed: selector "${o}" is already registered.`);lp.set(o,{componentType:t,selector:o,inputs:jhe(i.inputs)})}}function Fhe(e){return lp.get(e)}function Uhe(e,t){a$()&&console.warn(`Dashboard card "${e}" ignores unknown Angular input "${t}".`)}function jhe(e){let t=new Map;for(let i of e)t.set(i.templateName,i.templateName),t.set(i.propName,i.templateName);return t}function Whe(e,t){let i=e.trim();if(!Phe.test(i))throw new Error(`Dashboard card registration failed: "${Ik(t)}" must use a single element selector. Received "${e}".`);return i}function Ik(e){return e.name.replace(/^_+/,"")||"AnonymousComponent"}function Ghe(e,t,i){let o=Fhe(e.component);if(!o){console.warn(`[DashboardCard] Angular component "${e.component}" is not registered`);return}let a=t.createComponent(o.componentType);for(let[n,c]of Object.entries(e.componentInputs??{})){let d=o.inputs.get(n);if(!d){Uhe(e.component,n);continue}a.setInput(d,c)}a.changeDetectorRef.detectChanges(),i(()=>{t.clear()})}function qhe(e,t,i){let o=t.element.nativeElement,a=null,n=!1,c=window.sap?.ui?.require;c?c(["sap/ui/core/ComponentContainer"],d=>{if(n)return;let m=new d({name:e.component,manifest:!0,async:!0,settings:e.componentInputs??{}});m.placeAt(o),a=m}):console.error("[DashboardCard] SAP UI5 is not available on window.sap"),i(()=>{n=!0,a?.destroy(),o.innerHTML=""})}function $he(e,t,i,o){let a=t.element.nativeElement,n=o.createElement(e.component);for(let[c,d]of Object.entries(e.componentInputs??{}))o.setProperty(n,c,d);o.appendChild(a,n),i(()=>{a.innerHTML=""})}var Xhe=["elementHost"],Khe=["*"];function Yhe(e,t){if(e&1){let i=ut();W(0,"div",5)(1,"ui5-button",6),we("click",function(){Me(i);let o=F(2);return ke(o.removeCard.emit())}),$()(),p1(2,"ui5-icon",7)}if(e&2){let i=F(2);P(),ve("accessibleName",i.i18n.getTranslation(i.i18nKeys.REMOVE_CARD)+": "+(i.card().label||i.card().component)),st("data-testid","dashboard-card-"+i.card().id+"-remove"),P(),ve("accessibleName",i.i18n.getTranslation(i.i18nKeys.RESIZABLE))}}function Qhe(e,t){if(e&1&&(W(0,"div",3),Xe(1,Yhe,3,3),W(2,"div",4),p1(3,"div",null,0),$()()),e&2){let i=F();fo("component-card--editing",i.editMode()),st("data-testid","dashboard-card-"+i.card().id),P(),Ke(i.editMode()?1:-1),P(),qo("pointer-events",i.editMode()?"none":"auto")}}function Jhe(e,t){if(e&1&&(W(0,"div",2)(1,"div",8),jt(2),$()()),e&2){let i=F();st("data-testid","dashboard-card-"+i.card().id),P(),qo("pointer-events",i.editMode()?"none":"auto")}}var Tk=class cp{card=Z.required();editMode=Z(!1);removeCard=_e();i18n=ae(In);i18nKeys=Yr;gridColumn=Le(()=>{let t=this.card().w??12;return this.createGridTrack(this.card().x,t)});gridRow=Le(()=>{let t=this.card().h??100;return this.createGridTrack(this.card().y,t)});host=sc("elementHost",{read:t2});renderer=ae(u_);mountCfg=Le(()=>{let t=this.card();return{type:t.type,component:t.component,componentInputs:t.componentInputs}},{equal:(t,i)=>t.type===i.type&&t.component===i.component&&JSON.stringify(t.componentInputs)===JSON.stringify(i.componentInputs)});constructor(){At(t=>{let i=this.host(),o=this.mountCfg();if(!(!i||!o.component))switch(i.clear(),i.element.nativeElement.innerHTML="",o.type){case Ld.SAP_UI:qhe(o,i,t);break;case Ld.ANGULAR:Ghe(o,i,t);break;case Ld.WC:default:$he(o,i,t,this.renderer);break}})}createGridTrack(t,i){return t===void 0?`span ${i}`:`${t+1} / span ${i}`}static \u0275fac=function(t){return new(t||cp)};static \u0275cmp=Ye({type:cp,selectors:[["mfp-dashboard-card"]],viewQuery:function(t,i){t&1&&Uc(i.host,Xhe,5,t2),t&2&&y_()},hostVars:4,hostBindings:function(t,i){t&2&&qo("grid-column",i.gridColumn())("grid-row",i.gridRow())},inputs:{card:[1,"card"],editMode:[1,"editMode"]},outputs:{removeCard:"removeCard"},ngContentSelectors:Khe,decls:2,vars:1,consts:[["elementHost",""],[1,"component-card",3,"component-card--editing"],[1,"card"],[1,"component-card"],[1,"component-host"],[1,"remove-wrapper"],["design","Default","icon","decline",1,"card__remove",3,"click","accessibleName"],["aria-hidden","true","name","resize-corner",1,"card__resize-indicator",3,"accessibleName"],[1,"card__body"]],template:function(t,i){t&1&&(Kt(),Xe(0,Qhe,5,6,"div",1)(1,Jhe,3,3,"div",2)),t&2&&Ke(i.card().component?0:1)},dependencies:[aa,rr],styles:["[_nghost-%COMP%]{display:block;min-width:0;min-height:0;overflow:visible}.card__remove[_ngcontent-%COMP%]{position:absolute;top:0;right:-.5rem;z-index:10;border-radius:50%!important;width:1.25rem!important;height:1.25rem!important;min-width:unset!important;padding:0!important;font-size:.625rem!important}.remove-wrapper[_ngcontent-%COMP%]{position:sticky;height:.5rem;top:0;right:0;z-index:10}.component-card[_ngcontent-%COMP%]{position:relative;height:100%;overflow:visible;isolation:isolate;padding-inline-start:var(--mfp_cardContainerPadding, 10px);padding-inline-end:var(--mfp_cardContainerPadding, 10px)}.component-card--editing[_ngcontent-%COMP%]{cursor:grab}.component-card--editing[_ngcontent-%COMP%]:hover{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.component-card--editing[_ngcontent-%COMP%]:hover .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{cursor:grabbing!important}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%]{--sapTile_BorderColor: var(--sapHighlightColor, #0070f2);--sapGroup_ContentBorderColor: var(--sapHighlightColor, #0070f2)}.ui-draggable-dragging[_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%], .ui-draggable-dragging [_nghost-%COMP%] .component-card--editing[_ngcontent-%COMP%] .card__resize-indicator[_ngcontent-%COMP%]{opacity:1}.component-host[_ngcontent-%COMP%]{position:relative;height:100%}.card__resize-indicator[_ngcontent-%COMP%]{position:absolute;right:calc(var(--mfp_cardContainerPadding, 10px) + 4px);bottom:4px;width:1rem;height:1rem;pointer-events:none;opacity:0;transition:opacity .12s ease-out;color:var(--sapHighlightColor, #0070f2);z-index:9}.card[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;border:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);border-radius:.5rem;background:var(--sapBackgroundColor, #fff);overflow:visible}.card__header[_ngcontent-%COMP%]{padding:.75rem 1rem;font-weight:600;border-bottom:1px solid var(--sapGroup_ContentBorderColor, #d9d9d9);background:var(--sapGroup_TitleBackground, #f5f5f5)}.card__body[_ngcontent-%COMP%]{flex:1;padding:1rem;overflow:auto}"]})},ede=[{w:4e3,c:14,layout:"compact"},{w:1439,c:12,layout:"compact"},{w:1023,c:8,layout:"compact"},{w:599,c:1,layout:"list"}],tde=class hp{i18n=ae(In);i18nKeys=Yr;open=Z(!1);confirm=_e();cancelled=_e();static \u0275fac=function(t){return new(t||hp)};static \u0275cmp=Ye({type:hp,selectors:[["mfp-discard-changes-dialog"]],inputs:{open:[1,"open"]},outputs:{confirm:"confirm",cancelled:"cancelled"},decls:11,vars:5,consts:[["data-testid","dashboard-discard-changes-dialog","state","Critical",3,"ui5BeforeClose","open"],["slot","header",1,"discard-changes-dialog__header"],["level","H5"],[1,"discard-changes-dialog__body"],["slot","footer",1,"discard-changes-dialog__footer"],["data-testid","dashboard-discard-changes-confirm-btn","design","Emphasized",3,"click"],["data-testid","dashboard-discard-changes-cancel-btn","design","Transparent",3,"click"]],template:function(t,i){t&1&&(W(0,"ui5-dialog",0),we("ui5BeforeClose",function(){return i.cancelled.emit()}),W(1,"div",1)(2,"ui5-title",2),xe(3),$()(),W(4,"div",3),xe(5),$(),W(6,"div",4)(7,"ui5-button",5),we("click",function(){return i.confirm.emit()}),xe(8),$(),W(9,"ui5-button",6),we("click",function(){return i.cancelled.emit()}),xe(10),$()()()),t&2&&(ve("open",i.open()),P(3),nt(i.i18n.getTranslation(i.i18nKeys.DISCARD_CHANGES)),P(2),e0(" ",i.i18n.getTranslation(i.i18nKeys.DISCARD_CONFIRM_BODY)," "),P(3),nt(i.i18n.getTranslation(i.i18nKeys.DISCARD)),P(2),nt(i.i18n.getTranslation(i.i18nKeys.CANCEL)))},dependencies:[aa,u8,Cl],styles:[`:host{display:contents}.discard-changes-dialog__header{display:flex;align-items:center;width:100%;padding:.75rem 0}.discard-changes-dialog__body{padding:0 0 1rem;min-width:320px}.discard-changes-dialog__footer{display:flex;justify-content:flex-end;align-items:center;width:100%;gap:.5rem}
|
|
567
567
|
`],encapsulation:3})},ide=["*"],ode=(()=>{class e{constructor(){this.headerText=Z(),this.footerText=Z(),this.indent=Z(!1,{transform:Pe}),this.selectionMode=Z("None"),this.noDataText=Z(),this.separators=Z("All"),this.growing=Z("None"),this.growingButtonText=Z(),this.loading=Z(!1,{transform:Pe}),this.loadingDelay=Z(1e3),this.stickyHeader=Z(!1,{transform:Pe}),this.accessibleName=Z(),this.accessibilityAttributes=Z({}),this.accessibleNameRef=Z(),this.accessibleDescription=Z(),this.accessibleDescriptionRef=Z(),this.accessibleRole=Z("List"),this.ui5ItemClick=_e(),this.ui5ItemClose=_e(),this.ui5ItemToggle=_e(),this.ui5ItemDelete=_e(),this.ui5SelectionChange=_e(),this.ui5LoadMore=_e(),this.ui5MoveOver=_e(),this.ui5Move=_e(),this.slots=[{name:"default",description:"Defines the items of the component.\n\n**Note:** Use `ui5-li`, `ui5-li-custom`, and `ui5-li-group` for the intended design."},{name:"header",description:"Defines the component header.\n\n**Note:** When `header` is set, the\n`headerText` property is ignored."}],this.elementRef=ae(gt),this.injector=ae(xt)}get listItems(){return this.element?.listItems??[]}get element(){return this.elementRef.nativeElement}ngAfterViewInit(){let i=this.element,o=["headerText","footerText","indent","selectionMode","noDataText","separators","growing","growingButtonText","loading","loadingDelay","stickyHeader","accessibleName","accessibilityAttributes","accessibleNameRef","accessibleDescription","accessibleDescriptionRef","accessibleRole"];for(let n of o){let c=n.replace(/-./g,d=>d[1].toUpperCase());this[c]&&typeof this[c]=="function"&&g1(this.injector,()=>{At(()=>{let d=this[c]();i&&(i[n]=d)})})}let a=["ui5ItemClick","ui5ItemClose","ui5ItemToggle","ui5ItemDelete","ui5SelectionChange","ui5LoadMore","ui5MoveOver","ui5Move"];for(let n of a){let c=n.replace("ui5","").replace(/([A-Z])/g,"-$1").toLowerCase().substring(1);this[n]&&typeof this[n].emit=="function"&&i.addEventListener&&i.addEventListener(c,d=>{this[n].emit(d)})}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=Ye({type:e,selectors:[["ui5-list"],["","ui5-list",""]],inputs:{headerText:[1,"headerText"],footerText:[1,"footerText"],indent:[1,"indent"],selectionMode:[1,"selectionMode"],noDataText:[1,"noDataText"],separators:[1,"separators"],growing:[1,"growing"],growingButtonText:[1,"growingButtonText"],loading:[1,"loading"],loadingDelay:[1,"loadingDelay"],stickyHeader:[1,"stickyHeader"],accessibleName:[1,"accessibleName"],accessibilityAttributes:[1,"accessibilityAttributes"],accessibleNameRef:[1,"accessibleNameRef"],accessibleDescription:[1,"accessibleDescription"],accessibleDescriptionRef:[1,"accessibleDescriptionRef"],accessibleRole:[1,"accessibleRole"]},outputs:{ui5ItemClick:"ui5ItemClick",ui5ItemClose:"ui5ItemClose",ui5ItemToggle:"ui5ItemToggle",ui5ItemDelete:"ui5ItemDelete",ui5SelectionChange:"ui5SelectionChange",ui5LoadMore:"ui5LoadMore",ui5MoveOver:"ui5MoveOver",ui5Move:"ui5Move"},exportAs:["ui5List"],ngContentSelectors:ide,decls:1,vars:0,template:function(i,o){i&1&&(Kt(),jt(0))},encapsulation:2,changeDetection:0})}}return e})(),ade=["*"],rde=(()=>{class e{constructor(){this.movable=Z(!1,{transform:Pe}),this.accessibleName=Z(),this.type=Z("Active"),this.accessibilityAttributes=Z({}),this.navigated=Z(!1,{transform:Pe}),this.tooltip=Z(),this.highlight=Z("None"),this.selected=Z(!1,{transform:Pe}),this.ui5DetailClick=_e(),this.slots=[{name:"default",description:"Defines the content of the component."},{name:"deleteButton",description:`Defines the delete button, displayed in "Delete" mode.
|
|
568
568
|
**Note:** While the slot allows custom buttons, to match
|
|
569
569
|
design guidelines, please use the \`ui5-button\` component.
|