@mxtommy/kip 4.0.6-beta.2 → 4.0.6

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # v 4.0.6
2
2
  ## Fixes
3
- * Rare case where changing widget source does not resubscribe to data and reloading the dashboard is needed.
3
+ * Rare case where changing widget source does not resubscribe to data and a KIP restart is needed.
4
4
  * Switch Panel not responding to touch with Chrome on some OS/versions when fill color opacity is 0.
5
5
  # v 4.0.5
6
6
  ## Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxtommy/kip",
3
- "version": "4.0.6-beta.2",
3
+ "version": "4.0.6",
4
4
  "description": "An advanced and versatile marine instrumentation package to display Signal K data.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -99,7 +99,7 @@
99
99
  "karma-spec-reporter": "^0.0.36",
100
100
  "karma-chrome-launcher": "~3.1.0",
101
101
  "karma-cli": "~2.0.0",
102
- "karma-coverage": "^2.2.0",
102
+ "karma-coverage": "^2.2.0",
103
103
  "karma-jasmine": "~4.0.0",
104
104
  "karma-jasmine-html-reporter": "^1.6.0",
105
105
  "lodash-es": "^4.17.21",
@@ -0,0 +1,3 @@
1
+ import{a as dt,b as be,c as gt,d as ft,f as pt,k as ve,m as mt,n as we,o as Ce,p as xe,q as Ee,r as De}from"./chunk-LOZEULT5.js";import{a as _e,b as ye,d as Re,e as ke,g as ze,h as Se}from"./chunk-RYHOAWDD.js";import{a as lt,b as ut}from"./chunk-S7WGIMJE.js";import{a as Ht,d as rt}from"./chunk-XDPHEQEO.js";import{Ab as G,Bb as U,Da as Ut,Db as te,Ea as Rt,Eb as ee,Fa as H,Gb as at,Gd as ht,Hd as ct,Ja as kt,Kb as b,La as Q,Lb as ie,Mb as se,Nc as Ot,Oa as M,Oc as ce,Sa as Vt,Sb as re,Ta as jt,Tb as oe,Ua as qt,Ub as ne,Uc as ue,Va as Yt,Wa as S,Wc as ge,Xd as fe,Yd as pe,_d as me,a as m,b as w,bb as K,bc as St,ca as Wt,cb as J,cc as it,dc as ae,ec as st,fb as $t,ga as v,gb as Xt,hb as N,ib as _,ja as R,jb as y,jc as Tt,ka as k,kb as Qt,kc as de,lb as Z,mb as tt,nb as Kt,pa as Ft,qb as Jt,ra as Gt,rb as A,tb as T,tc as le,vb as L,wa as X,wb as zt,xb as nt,yb as Zt,zb as et,zc as he}from"./chunk-OB3QLUH6.js";function Te(a,r,t,e,i){let s=(...o)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+i+" and has been replaced with `"+e+"`. It will be **removed** in a future release"),r.apply(a,o));return s.prototype=r.prototype,s}var h=class a{static getElements(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(e&&!isNaN(+r[0])){let s=e.getElementById(r);return s?[s]:[]}let i=t.querySelectorAll(r);return!i.length&&r[0]!=="."&&r[0]!=="#"&&(i=t.querySelectorAll("."+r),i.length||(i=t.querySelectorAll("#"+r))),Array.from(i)}return[r]}static getElement(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(!r.length)return null;if(e&&r[0]==="#")return e.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return t.querySelector(r);if(e&&!isNaN(+r[0]))return e.getElementById(r);let i=t.querySelector(r);return e&&!i&&(i=e.getElementById(r)),i||(i=t.querySelector("."+r)),i}return r}static lazyLoad(r){return r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1}static createDiv(r,t){let e=document.createElement("div");return r.forEach(i=>{i&&e.classList.add(i)}),t?.appendChild(e),e}static shouldSizeToContent(r,t=!1){return r?.grid&&(t?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,t){return!(r.y>=t.y+t.h||r.y+r.h<=t.y||r.x+r.w<=t.x||r.x>=t.x+t.w)}static isTouching(r,t){return a.isIntercepted(r,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(r,t){let e=r.x>t.x?r.x:t.x,i=r.x+r.w<t.x+t.w?r.x+r.w:t.x+t.w;if(i<=e)return 0;let s=r.y>t.y?r.y:t.y,o=r.y+r.h<t.y+t.h?r.y+r.h:t.y+t.h;return o<=s?0:(i-e)*(o-s)}static area(r){return r.w*r.h}static sort(r,t=1){return r.sort((i,s)=>{let o=t*((i.y??1e4)-(s.y??1e4));return o===0?t*((i.x??1e4)-(s.x??1e4)):o})}static find(r,t){return t?r.find(e=>e.id===t):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let t,e="px";if(typeof r=="string")if(r==="auto"||r==="")t=0;else{let i=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${r}`);e=i[2]||"px",t=parseFloat(i[1])}else t=r;return{h:t,unit:e}}static defaults(r,...t){return t.forEach(e=>{for(let i in e){if(!e.hasOwnProperty(i))return;r[i]===null||r[i]===void 0?r[i]=e[i]:typeof e[i]=="object"&&typeof r[i]=="object"&&a.defaults(r[i],e[i])}}),r}static same(r,t){if(typeof r!="object")return r==t;if(typeof r!=typeof t||Object.keys(r).length!==Object.keys(t).length)return!1;for(let e in r)if(r[e]!==t[e])return!1;return!0}static copyPos(r,t,e=!1){return t.x!==void 0&&(r.x=t.x),t.y!==void 0&&(r.y=t.y),t.w!==void 0&&(r.w=t.w),t.h!==void 0&&(r.h=t.h),e&&(t.minW&&(r.minW=t.minW),t.minH&&(r.minH=t.minH),t.maxW&&(r.maxW=t.maxW),t.maxH&&(r.maxH=t.maxH)),r}static samePos(r,t){return r&&t&&r.x===t.x&&r.y===t.y&&(r.w||1)===(t.w||1)&&(r.h||1)===(t.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,t){if(!(typeof r!="object"||typeof t!="object"))for(let e in r){let i=r[e],s=t[e];e[0]==="_"||i===s?delete r[e]:i&&typeof i=="object"&&s!==void 0&&(a.removeInternalAndSame(i,s),Object.keys(i).length||delete r[e])}}static removeInternalForSave(r,t=!0){for(let e in r)(e[0]==="_"||r[e]===null||r[e]===void 0)&&delete r[e];delete r.grid,t&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,t){let e=!1;return(...i)=>{e||(e=!0,setTimeout(()=>{r(...i),e=!1},t))}}static removePositioningStyles(r){let t=r.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(r){if(!r)return document.scrollingElement||document.documentElement;let t=getComputedStyle(r);return/(auto|scroll)/.test(t.overflow+t.overflowY)?r:a.getScrollElement(r.parentElement)}static updateScrollPosition(r,t,e){let i=a.getScrollElement(r);if(!i)return;let s=r.getBoundingClientRect(),o=i.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,d=s.bottom-Math.min(o.bottom,n),u=s.top-Math.max(o.top,0),c=i.scrollTop;u<0&&e<0?r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=Math.abs(u)>Math.abs(e)?e:u:d>0&&e>0&&(r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=d>e?e:d),t.top+=i.scrollTop-c}static updateScrollResize(r,t,e){let i=a.getScrollElement(t),s=i.clientHeight,o=i===a.getScrollElement()?0:i.getBoundingClientRect().top,n=r.clientY-o,d=n<e,u=n>s-e;d?i.scrollBy({behavior:"smooth",top:n-e}):u&&i.scrollBy({behavior:"smooth",top:e-(s-n)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:m({},r)}static cloneDeep(r){let t=["parentGrid","el","grid","subGrid","engine"],e=a.clone(r);for(let i in e)e.hasOwnProperty(i)&&typeof e[i]=="object"&&i.substring(0,2)!=="__"&&!t.find(s=>s===i)&&(e[i]=a.cloneDeep(r[i]));return e}static cloneNode(r){let t=r.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(r,t){let e;typeof t=="string"?e=a.getElement(t):e=t,e&&e.appendChild(r)}static addElStyles(r,t){if(t instanceof Object)for(let e in t)t.hasOwnProperty(e)&&(Array.isArray(t[e])?t[e].forEach(i=>{r.style[e]=i}):r.style[e]=t[e])}static initEvent(r,t){let e={type:t.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(s=>e[s]=r[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>e[s]=r[s]),m(m({},e),i)}static simulateMouseEvent(r,t,e){let i=r,s=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:r.target});(e||r.target).dispatchEvent(s)}static getValuesFromTransformedElement(r){let t=document.createElement("div");a.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(t);let e=t.getBoundingClientRect();return r.removeChild(t),t.remove(),{xScale:1/e.width,yScale:1/e.height,xOffset:e.left,yOffset:e.top}}static swap(r,t,e){if(!r)return;let i=r[t];r[t]=r[e],r[e]=i}static canBeRotated(r){return!(!r||r.w===r.h||r.locked||r.noResize||r.grid?.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}};var Mt=(()=>{class a{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,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}batchUpdate(t=!0,e=!0){return!!this.batchMode===t?this:(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,e&&this._packNodes(),this._notify()),this)}_useEntireRowArea(t,e){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!t._moving||t._skipDown||e.y<=t.y)}_fixCollisions(t,e=t,i,s={}){if(this.sortNodes(-1),i=i||this.collide(t,e),!i)return!1;if(t._moving&&!s.nested&&!this.float&&this.swap(t,i))return!0;let o=e;!this._loading&&this._useEntireRowArea(t,e)&&(o={x:0,w:this.column,y:e.y,h:e.h},i=this.collide(t,o,s.skip));let n=!1,d={nested:!0,pack:!1},u=0;for(;i=i||this.collide(t,o,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||t._moving&&!t._skipDown&&e.y>t.y&&!this.float&&(!this.collide(i,w(m({},i),{y:t.y}),t)||!this.collide(i,w(m({},i),{y:e.y-i.h}),t))){t._skipDown=t._skipDown||e.y>t.y;let l=m(w(m({},e),{y:i.y+i.h}),d);c=this._loading&&h.samePos(t,l)?!0:this.moveNode(t,l),(i.locked||this._loading)&&c?h.copyPos(e,t):!i.locked&&c&&s.pack&&(this._packNodes(),e.y=i.y+i.h,h.copyPos(t,e)),n=n||c}else c=this.moveNode(i,m(w(m({},i),{y:e.y+e.h,skip:t}),d));if(!c)return n;i=void 0}return n}collide(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.find(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}collideAll(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.filter(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}directionCollideCoverage(t,e,i){if(!e.rect||!t._rect)return;let s=t._rect,o=m({},e.rect);o.y>s.y?(o.h+=o.y-s.y,o.y=s.y):o.h+=s.y-o.y,o.x>s.x?(o.w+=o.x-s.x,o.x=s.x):o.w+=s.x-o.x;let n,d=.5;for(let u of i){if(u.locked||!u._rect)break;let c=u._rect,l=Number.MAX_VALUE,g=Number.MAX_VALUE;s.y<c.y?l=(o.y+o.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(l=(c.y+c.h-o.y)/c.h),s.x<c.x?g=(o.x+o.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(g=(c.x+c.w-o.x)/c.w);let p=Math.min(g,l);p>d&&(d=p,n=u)}return e.collide=n,n}cacheRects(t,e,i,s,o,n){return this.nodes.forEach(d=>d._rect={y:d.y*e+i,x:d.x*t+n,w:d.w*t-n-s,h:d.h*e-i-o}),this}swap(t,e){if(!e||e.locked||!t||t.locked)return!1;function i(){let o=e.x,n=e.y;return e.x=t.x,e.y=t.y,t.h!=e.h?(t.x=o,t.y=e.y+e.h):t.w!=e.w?(t.x=e.x+e.w,t.y=n):(t.x=o,t.y=n),t._dirty=e._dirty=!0,!0}let s;if(t.w===e.w&&t.h===e.h&&(t.x===e.x||t.y===e.y)&&(s=h.isTouching(t,e)))return i();if(s!==!1){if(t.w===e.w&&t.x===e.x&&(s||(s=h.isTouching(t,e)))){if(e.y<t.y){let o=t;t=e,e=o}return i()}if(s!==!1){if(t.h===e.h&&t.y===e.y&&(s||(s=h.isTouching(t,e)))){if(e.x<t.x){let o=t;t=e,e=o}return i()}return!1}}}isAreaEmpty(t,e,i,s){let o={x:t||0,y:e||0,w:i||1,h:s||1};return!this.collide(o)}compact(t="compact",e=!0){if(this.nodes.length===0)return this;e&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let s=this._inColumnResize;s||(this._inColumnResize=!0);let o=this.nodes;return this.nodes=[],o.forEach((n,d,u)=>{let c;n.locked||(n.autoPosition=!0,t==="list"&&d&&(c=u[d-1])),this.addNode(n,!1,c)}),s||delete this._inColumnResize,i||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=h.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 e=t.y;for(;e>t._orig.y;)--e,this.collide(t,{x:t.x,y:e,w:t.w,h:t.h})||(t._dirty=!0,t.y=e)}):this.nodes.forEach((t,e)=>{if(!t.locked)for(;t.y>0;){let i=e===0?0:t.y-1;if(!(e===0||!this.collide(t,{x:t.x,y:i,w:t.w,h:t.h})))break;t._dirty=t.y!==i,t.y=i}}),this)}prepareNode(t,e){t._id=t._id??a._idSeq++;let i=t.id;if(i){let o=1;for(;this.nodes.find(n=>n.id===t.id&&n!==t);)t.id=i+"_"+o++}(t.x===void 0||t.y===void 0||t.x===null||t.y===null)&&(t.autoPosition=!0);let s={x:0,y:0,w:1,h:1};return h.defaults(t,s),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,h.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=s.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=s.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=s.w),isNaN(t.h)&&(t.h=s.h),this.nodeBoundFix(t,e),t}nodeBoundFix(t,e){let i=t._orig||h.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 o=m({},t);o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,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&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),h.samePos(t,i)||(t._dirty=!0),this}getDirtyNodes(t){return t?this.nodes.filter(e=>e._dirty&&!h.samePos(e,e._orig)):this.nodes.filter(e=>e._dirty)}_notify(t){if(this.batchMode||!this.onChange)return this;let e=(t||[]).concat(this.getDirtyNodes());return this.onChange(e),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=h.copyPos({},t),delete t._dirty}),this._hasLocked=this.nodes.some(t=>t.locked),this}restoreInitial(){return this.nodes.forEach(t=>{!t._orig||h.samePos(t,t._orig)||(h.copyPos(t,t._orig),t._dirty=!0)}),this._notify(),this}findEmptyPosition(t,e=this.nodes,i=this.column,s){let o=s?s.y*i+(s.x+s.w):0,n=!1;for(let d=o;!n;++d){let u=d%i,c=Math.floor(d/i);if(u+t.w>i)continue;let l={x:u,y:c,w:t.w,h:t.h};e.find(g=>h.isIntercepted(l,g))||((t.x!==u||t.y!==c)&&(t._dirty=!0),t.x=u,t.y=c,delete t.autoPosition,n=!0)}return n}addNode(t,e=!1,i){let s=this.nodes.find(n=>n._id===t._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t),delete t._temporaryRemoved,delete t._removeDOM;let o;return t.autoPosition&&this.findEmptyPosition(t,this.nodes,this.column,i)&&(delete t.autoPosition,o=!0),this.nodes.push(t),e&&this.addedNodes.push(t),o||this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t}removeNode(t,e=!0,i=!1){return this.nodes.find(s=>s._id===t._id)?(i&&this.removedNodes.push(t),e&&(t._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==t._id),t._isAboutToRemove||this._packNodes(),this._notify([t]),this):this}removeAll(t=!0,e=!0){if(delete this._layouts,!this.nodes.length)return this;t&&this.nodes.forEach(s=>s._removeDOM=!0);let i=this.nodes;return this.removedNodes=e?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(t,e){if(!this.changedPosConstrain(t,e))return!1;if(e.pack=!0,!this.maxRow)return this.moveNode(t,e);let i,s=new a({column:this.column,float:this.float,nodes:this.nodes.map(n=>n._id===t._id?(i=m({},n),i):m({},n))});if(!i)return!1;let o=s.moveNode(i,e)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!e.resizing&&e.collide){let n=e.collide.el.gridstackNode;if(this.swap(t,n))return this._notify(),!0}return o?(s.nodes.filter(n=>n._dirty).forEach(n=>{let d=this.nodes.find(u=>u._id===n._id);d&&(h.copyPos(d,n),d._dirty=!0)}),this._notify(),!0):!1}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;let e=new a({column:this.column,float:this.float,nodes:this.nodes.map(s=>m({},s))}),i=m({},t);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,e.addNode(i),e.getRow()<=this.maxRow?(t._willFitPos=h.copyPos({},i),!0):!1}changedPosConstrain(t,e){return e.w=e.w||t.w,e.h=e.h||t.h,t.x!==e.x||t.y!==e.y?!0:(t.maxW&&(e.w=Math.min(e.w,t.maxW)),t.maxH&&(e.h=Math.min(e.h,t.maxH)),t.minW&&(e.w=Math.max(e.w,t.minW)),t.minH&&(e.h=Math.max(e.h,t.minH)),t.w!==e.w||t.h!==e.h)}moveNode(t,e){if(!t||!e)return!1;let i;e.pack===void 0&&!this.batchMode&&(i=e.pack=!0),typeof e.x!="number"&&(e.x=t.x),typeof e.y!="number"&&(e.y=t.y),typeof e.w!="number"&&(e.w=t.w),typeof e.h!="number"&&(e.h=t.h);let s=t.w!==e.w||t.h!==e.h,o=h.copyPos({},t,!0);if(h.copyPos(o,e),this.nodeBoundFix(o,s),h.copyPos(e,o),!e.forceCollide&&h.samePos(t,e))return!1;let n=h.copyPos({},t),d=this.collideAll(t,o,e.skip),u=!0;if(d.length){let c=t._moving&&!e.nested,l=c?this.directionCollideCoverage(t,e,d):d[0];if(c&&l&&t.grid?.opts?.subGridDynamic&&!t.grid._isTemp){let g=h.areaIntercept(e.rect,l._rect),p=h.area(e.rect),C=h.area(l._rect);g/(p<C?p:C)>.8&&(l.grid.makeSubGrid(l.el,void 0,t),l=void 0)}l?u=!this._fixCollisions(t,o,l,e):(u=!1,i&&delete e.pack)}return u&&!h.samePos(t,o)&&(t._dirty=!0,h.copyPos(t,o)),e.pack&&this._packNodes()._notify(),!h.samePos(t,n)}getRow(){return this.nodes.reduce((t,e)=>Math.max(t,e.y+e.h),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let t=this.nodes.find(e=>e._updating);return t&&(delete t._updating,delete t._skipDown),this}save(t=!0,e,i){let s=this._layouts?.length||0,o;s&&(i?i!==this.column&&(o=this._layouts[i]):this.column!==s-1&&(o=this._layouts[s-1]));let n=[];return this.sortNodes(),this.nodes.forEach(d=>{let u=o?.find(l=>l._id===d._id),c=m(m({},d),u||{});h.removeInternalForSave(c,!t),e&&e(d,c),n.push(c)}),n}layoutsNodesChange(t){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((e,i)=>{if(!e||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let s=i/this.column;t.forEach(o=>{if(!o._orig)return;let n=e.find(d=>d._id===o._id);n&&(n.y>=0&&o.y!==o._orig.y&&(n.y+=o.y-o._orig.y),o.x!==o._orig.x&&(n.x=Math.round(o.x*s)),o.w!==o._orig.w&&(n.w=Math.round(o.w*s)))})}}),this)}columnChanged(t,e,i="moveScale"){if(!this.nodes.length||!e||t===e)return this;let s=i==="compact"||i==="list";s&&this.sortNodes(1),e<t&&this.cacheLayout(this.nodes,t),this.batchUpdate();let o=[],n=s?this.nodes:h.sort(this.nodes,-1);if(e>t&&this._layouts){let d=this._layouts[e]||[],u=this._layouts.length-1;!d.length&&t!==u&&this._layouts[u]?.length&&(t=u,this._layouts[u].forEach(c=>{let l=n.find(g=>g._id===c._id);l&&(!s&&!c.autoPosition&&(l.x=c.x??l.x,l.y=c.y??l.y),l.w=c.w??l.w,(c.x==null||c.y===void 0)&&(l.autoPosition=!0))})),d.forEach(c=>{let l=n.findIndex(g=>g._id===c._id);if(l!==-1){let g=n[l];if(s){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(g.x=c.x??g.x,g.y=c.y??g.y,g.w=c.w??g.w,o.push(g)),n.splice(l,1)}})}if(s)this.compact(i,!1);else{if(n.length)if(typeof i=="function")i(e,t,o,n);else{let d=s||i==="none"?1:e/t,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";n.forEach(l=>{l.x=e===1?0:u?Math.round(l.x*d):Math.min(l.x,e-1),l.w=e===1||t===1?1:c?Math.round(l.w*d)||1:Math.min(l.w,e),o.push(l)}),n=[]}o=h.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(t,e,i=!1){let s=[];return t.forEach((o,n)=>{if(o._id===void 0){let d=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=d?._id??a._idSeq++}s[n]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cacheOneLayout(t,e){t._id=t._id??a._idSeq++;let i={x:t.x,y:t.y,w:t.w,_id:t._id};(t.autoPosition||t.x===void 0)&&(delete i.x,delete i.y,t.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[e]=this._layouts[e]||[];let s=this.findCacheLayout(t,e);return s===-1?this._layouts[e].push(i):this._layouts[e][s]=i,this}findCacheLayout(t,e){return this._layouts?.[e]?.findIndex(i=>i._id===t._id)??-1}removeNodeFromLayoutCache(t){if(this._layouts)for(let e=0;e<this._layouts.length;e++){let i=this.findCacheLayout(t,e);i!==-1&&this._layouts[e].splice(i,1)}}cleanupNode(t){for(let e in t)e[0]==="_"&&e!=="_id"&&delete t[e];return this}}return a._idSeq=0,a})();var z={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"};var f=class{};var x=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),O=class{};function _t(a,r){a.touches.length>1||(a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a.changedTouches[0],r))}function He(a,r){a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a,r)}function V(a){O.touchHandled||(O.touchHandled=!0,_t(a,"mousedown"))}function j(a){O.touchHandled&&_t(a,"mousemove")}function q(a){if(!O.touchHandled)return;O.pointerLeaveTimeout&&(window.clearTimeout(O.pointerLeaveTimeout),delete O.pointerLeaveTimeout);let r=!!f.dragElement;_t(a,"mouseup"),r||_t(a,"click"),O.touchHandled=!1}function Y(a){a.pointerType!=="mouse"&&a.target.releasePointerCapture(a.pointerId)}function Nt(a){f.dragElement&&a.pointerType!=="mouse"&&He(a,"mouseenter")}function Pt(a){f.dragElement&&a.pointerType!=="mouse"&&(O.pointerLeaveTimeout=window.setTimeout(()=>{delete O.pointerLeaveTimeout,He(a,"mouseleave")},10))}var Oe=(()=>{class a{constructor(t,e,i){this.host=t,this.dir=e,this.option=i,this.moving=!1,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(){let t=this.el=document.createElement("div");return t.classList.add("ui-resizable-handle"),t.classList.add(`${a.prefix}${this.dir}`),t.style.zIndex="100",t.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),x&&(this.el.addEventListener("touchstart",V),this.el.addEventListener("pointerdown",Y)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),x&&(this.el.removeEventListener("touchstart",V),this.el.removeEventListener("pointerdown",Y)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),x&&(this.el.addEventListener("touchmove",j),this.el.addEventListener("touchend",q)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){let e=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-e.x)+Math.abs(t.y-e.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),x&&(this.el.removeEventListener("touchmove",j),this.el.removeEventListener("touchend",q)),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,e){return this.option[t]&&this.option[t](e),this}}return a.prefix="ui-resizable-",a})();var B=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,t){this._eventRegister[r]=t}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](t)}};var Me=(()=>{class a extends B{constructor(t,e={}){super(),this.el=t,this.option=e,this.rectScale={x:1,y:1},this._ui=()=>{let s=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||o;return{position:{left:(n.left-s.left)*this.rectScale.x,top:(n.top-s.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,e){super.on(t,e)}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 e=t.handles&&t.handles!==this.option.handles,i=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach(s=>this.option[s]=t[s]),e&&(this._removeHandlers(),this._setupHandlers()),i&&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),f.overResizeElement===this&&delete f.overResizeElement),this}_mouseOver(t){f.overResizeElement||f.dragElement||(f.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){f.overResizeElement===this&&(delete f.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(t=>t.trim()).map(t=>new Oe(this.el,t,{start:e=>{this._resizeStart(e)},stop:e=>{this._resizeStop(e)},move:e=>{this._resizing(e,t)}})),this}_resizeStart(t){this.sizeToContent=h.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=h.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();let e=h.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(e,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",e),this}_resizing(t,e){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,e),this._applyChange();let i=h.initEvent(t,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(t){let e=h.initEvent(t,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(e),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",e),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=a._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let t=this.el.parentElement,e=h.getValuesFromTransformedElement(t);return this.rectScale={x:e.xScale,y:e.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return a._originStyleProp.forEach((t,e)=>{this.el.style[t]=this.elOriginStyleVal[e]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,e){let i=this.startEvent,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},o=t.clientX-i.clientX,n=this.sizeToContent?0:t.clientY-i.clientY,d,u;e.indexOf("e")>-1?s.width+=o:e.indexOf("w")>-1&&(s.width-=o,s.left+=o,d=!0),e.indexOf("s")>-1?s.height+=n:e.indexOf("n")>-1&&(s.height-=n,s.top+=n,u=!0);let c=this._constrainSize(s.width,s.height,d,u);return Math.round(s.width)!==Math.round(c.width)&&(e.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(e.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(t,e,i,s){let o=this.option,n=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,d=o.minWidth/this.rectScale.x||t,u=(s?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,c=o.minHeight/this.rectScale.y||e,l=Math.min(n,Math.max(d,t)),g=Math.min(u,Math.max(c,e));return{width:l,height:g}}_applyChange(){let t={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let e=this.el.parentElement,{left:i,top:s}=e.getBoundingClientRect();t={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(e=>{let i=this.temporalRect[e],s=e==="width"||e==="left"?this.rectScale.x:e==="height"||e==="top"?this.rectScale.y:1;this.el.style[e]=(i-t[e])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(t=>t.destroy()),delete this.handlers,this}}return a._originStyleProp=["width","height","position","left","top","opacity","zIndex"],a})();var Ue='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Ne=(()=>{class a extends B{constructor(t,e={}){super(),this.el=t,this.option=e,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=e?.handle?.substring(1),s=t.gridstackNode;this.dragEls=!i||t.classList.contains(i)?[t]:s?.subGrid?[t.querySelector(e.handle)||t]:Array.from(t.querySelectorAll(e.handle)),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()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(t=>{t.addEventListener("mousedown",this._mouseDown),x&&(t.addEventListener("touchstart",V),t.addEventListener("pointerdown",Y))}),this.el.classList.remove("ui-draggable-disabled"))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(e=>{e.removeEventListener("mousedown",this._mouseDown),x&&(e.removeEventListener("touchstart",V),e.removeEventListener("pointerdown",Y))}),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.helper,delete this.option,super.destroy()}updateOption(t){return Object.keys(t).forEach(e=>this.option[e]=t[e]),this}_mouseDown(t){if(!f.mouseHandled)return t.button!==0||!this.dragEls.find(e=>e===t.target)&&t.target.closest(Ue)||this.option.cancel&&t.target.closest(this.option.cancel)||(this.mouseDownEvent=t,delete this.dragging,delete f.dragElement,delete f.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),x&&(t.currentTarget.addEventListener("touchmove",j),t.currentTarget.addEventListener("touchend",q)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),f.mouseHandled=!0),!0}_callDrag(t){if(!this.dragging)return;let e=h.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(e,this.ui()),this.triggerEvent("drag",e)}_mouseMove(t){let e=this.mouseDownEvent;if(this.lastDrag=t,this.dragging)if(this._dragFollow(t),f.pauseDrag){let i=Number.isInteger(f.pauseDrag)?f.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(t),i)}else this._callDrag(t);else if(Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>3){this.dragging=!0,f.dragElement=this;let i=this.el.gridstackNode?.grid;i?f.dropElement=i.el.ddElement.ddDroppable:delete f.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=h.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment),this._setupHelperStyle(t);let s=h.initEvent(t,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(s,this.ui()),this.triggerEvent("dragstart",s),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(t){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),x&&t.currentTarget&&(t.currentTarget.removeEventListener("touchmove",j,!0),t.currentTarget.removeEventListener("touchend",q,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),f.dropElement?.el===this.el.parentElement&&delete f.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let e=h.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(e),this.triggerEvent("dragstop",e),f.dropElement&&f.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete f.dragElement,delete f.dropElement,delete f.mouseHandled,t.preventDefault()}_keyEvent(t){let e=this.el.gridstackNode,i=e?.grid||f.dropElement?.el?.gridstack;if(t.key==="Escape")e&&e._origRotate&&(e._orig=e._origRotate,delete e._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(e&&i&&(t.key==="r"||t.key==="R")){if(!h.canBeRotated(e))return;e._origRotate=e._origRotate||m({},e._orig),delete e._moving,i.setAnimation(!1).rotate(e.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),e._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,e.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",h.swap(e._orig,"w","h"),delete e._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=h.cloneNode(this.el)),t.parentElement||h.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=a.originStyleProp.map(e=>this.el.style[e]),t}_setupHelperStyle(t){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let e=this.helper.style;return e.pointerEvents="none",e.width=this.dragOffset.width+"px",e.height=this.dragOffset.height+"px",e.willChange="left, top",e.position="fixed",this._dragFollow(t),e.transition="none",setTimeout(()=>{this.helper&&(e.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){let e=this.helper,i=this.dragElementOriginStyle.transition||null;e.style.transition=this.dragElementOriginStyle.transition="none",a.originStyleProp.forEach(s=>e.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>e.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){let e={left:0,top:0},i=this.helper.style,s=this.dragOffset;i.left=(t.clientX+s.offsetLeft-e.left)*this.dragTransform.xScale+"px",i.top=(t.clientY+s.offsetTop-e.top)*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,e,i){let s=0,o=0;i&&(s=this.dragTransform.xOffset,o=this.dragTransform.yOffset);let n=e.getBoundingClientRect();return{left:n.left,top:n.top,offsetLeft:-t.clientX+n.left-s,offsetTop:-t.clientY+n.top-o,width:n.width*this.dragTransform.xScale,height:n.height*this.dragTransform.yScale}}ui(){let e=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-e.top)*this.dragTransform.yScale,left:(i.left-e.left)*this.dragTransform.xScale}}}}return a.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"],a})();var yt=class extends B{constructor(r,t={}){super(),this.el=r,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,t){super.on(r,t)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),x&&(this.el.addEventListener("pointerenter",Nt),this.el.addEventListener("pointerleave",Pt)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),x&&(this.el.removeEventListener("pointerenter",Nt),this.el.removeEventListener("pointerleave",Pt)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(t=>this.option[t]=r[t]),this._setupAccept(),this}_mouseEnter(r){if(!f.dragElement||!this._canDrop(f.dragElement.el))return;r.preventDefault(),r.stopPropagation(),f.dropElement&&f.dropElement!==this&&f.dropElement._mouseLeave(r,!0),f.dropElement=this;let t=h.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(f.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,t=!1){if(!f.dragElement||f.dropElement!==this)return;r.preventDefault(),r.stopPropagation();let e=h.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(e,this._ui(f.dragElement)),this.triggerEvent("dropout",e),f.dropElement===this&&(delete f.dropElement,!t)){let i,s=this.el.parentElement;for(;!i&&s;)i=s.ddElement?.ddDroppable,s=s.parentElement;i&&i._mouseEnter(r)}}drop(r){r.preventDefault();let t=h.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(f.dragElement)),this.triggerEvent("drop",t)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return m({draggable:r.el},r.ui())}};var bt=class a{static init(r){return r.ddElement||(r.ddElement=new a(r)),r.ddElement}constructor(r){this.el=r}on(r,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,t),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new Ne(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new Me(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new yt(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var vt=class{resizable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddResizable&&s.ddResizable[t]();else if(t==="destroy")s.ddResizable&&s.cleanResizable();else if(t==="option")s.setupResizable({[e]:i});else{let n=s.el.gridstackNode.grid,d=s.el.getAttribute("gs-resize-handles")||n.opts.resizable.handles||"e,s,se";d==="all"&&(d="n,e,s,w,se,sw,ne,nw");let u=!n.opts.alwaysShowResizeHandle;s.setupResizable(w(m({},n.opts.resizable),{handles:d,autoHide:u,start:t.start,stop:t.stop,resize:t.resize}))}}),this}draggable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddDraggable&&s.ddDraggable[t]();else if(t==="destroy")s.ddDraggable&&s.cleanDraggable();else if(t==="option")s.setupDraggable({[e]:i});else{let o=s.el.gridstackNode.grid;s.setupDraggable(w(m({},o.opts.draggable),{start:t.start,stop:t.stop,drag:t.drag}))}}),this}dragIn(r,t){return this._getDDElements(r).forEach(e=>e.setupDraggable(t)),this}droppable(r,t,e,i){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=s=>t._accept(s)),this._getDDElements(r,t).forEach(s=>{t==="disable"||t==="enable"?s.ddDroppable&&s.ddDroppable[t]():t==="destroy"?s.ddDroppable&&s.cleanDroppable():t==="option"?s.setupDroppable({[e]:i}):s.setupDroppable(t)}),this}isDroppable(r){return!!(r?.ddElement?.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){return!!(r?.ddElement?.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){return!!(r?.ddElement?.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,t,e){return this._getDDElements(r).forEach(i=>i.on(t,s=>{e(s,f.dragElement?f.dragElement.el:s.target,f.dragElement?f.dragElement.helper:null)})),this}off(r,t){return this._getDDElements(r).forEach(e=>e.off(t)),this}_getDDElements(r,t){let e=r.gridstack||t!=="destroy"&&t!=="disable",i=h.getElements(r);return i.length?i.map(o=>o.ddElement||(e?bt.init(o):null)).filter(o=>o):[]}};var E=new vt,I=(()=>{class a{static init(t={},e=".grid-stack"){if(typeof document>"u")return null;let i=a.getGridElement(e);return i?(i.gridstack||(i.gridstack=new a(i,h.cloneDeep(t))),i.gridstack):(console.error(typeof e=="string"?'GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
2
+ 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={},e=".grid-stack"){let i=[];return typeof document>"u"||(a.getGridElements(e).forEach(s=>{s.gridstack||(s.gridstack=new a(s,h.cloneDeep(t))),i.push(s.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
3
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(t,e={}){if(!t)return null;let i=t;if(i.gridstack){let n=i.gridstack;return e&&(n.opts=m(m({},n.opts),e)),e.children!==void 0&&n.load(e.children),n}return(!t.classList.contains("grid-stack")||a.addRemoveCB)&&(a.addRemoveCB?i=a.addRemoveCB(t,e,!0,!0):i=h.createDiv(["grid-stack",e.class],t)),a.init(e,i)}static registerEngine(t){a.engineClass=t}get placeholder(){if(!this._placeholder){this._placeholder=h.createDiv([this.opts.placeholderClass,z.itemClass,this.opts.itemClass]);let t=h.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(t.textContent=this.opts.placeholderText)}return this._placeholder}constructor(t,e={}){this.el=t,this.opts=e,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},t.gridstack=this,this.opts=e=e||{},t.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=h.toNumber(t.getAttribute("gs-row"));e.column==="auto"&&delete e.column,e.alwaysShowResizeHandle!==void 0&&(e._alwaysShowResizeHandle=e.alwaysShowResizeHandle);let s=e.columnOpts;if(s){let c=s.breakpoints;!s.columnWidth&&!c?.length?delete e.columnOpts:(s.columnMax=s.columnMax||12,c?.length>1&&c.sort((l,g)=>(g.w||0)-(l.w||0)))}let o=w(m({},h.cloneDeep(z)),{column:h.toNumber(t.getAttribute("gs-column"))||z.column,minRow:i||h.toNumber(t.getAttribute("gs-min-row"))||z.minRow,maxRow:i||h.toNumber(t.getAttribute("gs-max-row"))||z.maxRow,staticGrid:h.toBool(t.getAttribute("gs-static"))||z.staticGrid,sizeToContent:h.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||z.draggable.handle},removableOptions:{accept:e.itemClass||z.removableOptions.accept,decline:z.removableOptions.decline}});t.getAttribute("gs-animate")&&(o.animate=h.toBool(t.getAttribute("gs-animate"))),e=h.defaults(e,o),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(e),e.rtl==="auto"&&(e.rtl=t.style.direction==="rtl"),e.rtl&&this.el.classList.add("grid-stack-rtl");let d=this.el.closest("."+z.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=e.cellHeight==="auto",this._isAutoCellHeight||e.cellHeight==="initial")this.cellHeight(void 0);else{typeof e.cellHeight=="number"&&e.cellHeightUnit&&e.cellHeightUnit!==z.cellHeightUnit&&(e.cellHeight=e.cellHeight+e.cellHeightUnit,delete e.cellHeightUnit);let c=e.cellHeight;delete e.cellHeight,this.cellHeight(c)}e.alwaysShowResizeHandle==="mobile"&&(e.alwaysShowResizeHandle=x),this._setStaticClass();let u=e.engineClass||a.engineClass||Mt;if(this.engine=new u({column:this.getColumn(),float:e.float,maxRow:e.maxRow,onChange:c=>{c.forEach(l=>{let g=l.el;g&&(l._removeDOM?(g&&g.remove(),delete l._removeDOM):this._writePosAttr(g,l))}),this._updateContainerHeight()}}),e.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),e.children){let c=e.children;delete e.children,c.length&&this.load(c)}this.setAnimation(),e.subGridDynamic&&!f.pauseDrag&&(f.pauseDrag=!0),e.draggable?.pause!==void 0&&(f.pauseDrag=e.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 e,i=t;if(i.grid=this,i.el?e=i.el:a.addRemoveCB?e=a.addRemoveCB(this.el,t,!0,!1):e=this.createWidgetDivs(i),!e)return;if(i=e.gridstackNode,i&&e.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return e;let s=this._readAttr(e);return h.defaults(t,s),this.engine.prepareNode(t),this.el.appendChild(e),this.makeWidget(e,t),e}createWidgetDivs(t){let e=h.createDiv(["grid-stack-item",this.opts.itemClass]),i=h.createDiv(["grid-stack-item-content"],e);return h.lazyLoad(t)?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([s])=>{s.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,a.renderCB(i,t),t.grid?.prepareDragDrop(t.el))}),window.setTimeout(()=>t.visibleObservable?.observe(e))):a.renderCB(i,t),e}makeSubGrid(t,e,i,s=!0){let o=t.gridstackNode;if(o||(o=this.makeWidget(t).gridstackNode),o.subGrid?.el)return o.subGrid;let n,d=this;for(;d&&!n;)n=d.opts?.subGridOpts,d=d.parentGridNode?.grid;e=h.cloneDeep(m(m(w(m({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),n||{}),e||o.subGridOpts||{})),o.subGridOpts=e;let u;e.column==="auto"&&(u=!0,e.column=Math.max(o.w||1,i?.w||1),delete e.columnOpts);let c=o.el.querySelector(".grid-stack-item-content"),l,g;if(s&&(this._removeDD(o.el),g=w(m({},o),{x:0,y:0}),h.removeInternalForSave(g),delete g.subGridOpts,o.content&&(g.content=o.content,delete o.content),a.addRemoveCB?l=a.addRemoveCB(this.el,g,!0,!1):(l=h.createDiv(["grid-stack-item"]),l.appendChild(c),c=h.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){let C=u?e.column:o.w,D=o.h+i.h,P=o.el.style;P.transition="none",this.update(o.el,{w:C,h:D}),setTimeout(()=>P.transition=null)}let p=o.subGrid=a.addGrid(c,e);return i?._moving&&(p._isTemp=!0),u&&(p._autoColumn=!0),s&&p.makeWidget(l,g),i&&(i._moving?window.setTimeout(()=>h.simulateMouseEvent(i._event,"mouseenter",p.el),0):p.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),p}removeAsSubGrid(t){let e=this.parentGridNode?.grid;e&&(e.batchUpdate(),e.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridNode.x,i.y+=this.parentGridNode.y,e.makeWidget(i.el,i)}),e.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,t&&window.setTimeout(()=>h.simulateMouseEvent(t._event,"mouseenter",e.el),0))}save(t=!0,e=!1,i=a.saveCB,s){let o=this.engine.save(t,i,s);if(o.forEach(n=>{if(t&&n.el&&!n.subGrid&&!i){let d=n.el.querySelector(".grid-stack-item-content");n.content=d?.innerHTML,n.content||delete n.content}else if(!t&&!i&&delete n.content,n.subGrid?.el){let d=n.w||n.subGrid.getColumn(),u=n.subGrid.save(t,e,i,d);n.subGridOpts=e?u:{children:u},delete n.subGrid}delete n.el}),e){let n=h.cloneDeep(this.opts);n.marginBottom===n.marginTop&&n.marginRight===n.marginLeft&&n.marginTop===n.marginRight&&(n.margin=n.marginTop,delete n.marginTop,delete n.marginRight,delete n.marginBottom,delete n.marginLeft),n.rtl===(this.el.style.direction==="rtl")&&(n.rtl="auto"),this._isAutoCellHeight&&(n.cellHeight="auto"),this._autoColumn&&(n.column="auto");let d=n._alwaysShowResizeHandle;return delete n._alwaysShowResizeHandle,d!==void 0?n.alwaysShowResizeHandle=d:delete n.alwaysShowResizeHandle,h.removeInternalAndSame(n,z),n.children=o,n}return o}load(t,e=a.addRemoveCB||!0){t=h.cloneDeep(t);let i=this.getColumn();t.forEach(l=>{l.w=l.w||l.minW||1,l.h=l.h||l.minH||1}),t=h.sort(t),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;t.forEach(l=>{s=Math.max(s,(l.x||0)+l.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=t,this.engine.columnChanged(s,i,this.responseLayout),t=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(t,s,!0));let o=a.addRemoveCB;typeof e=="function"&&(a.addRemoveCB=e);let n=[];this.batchUpdate();let d=!this.engine.nodes.length,u=d&&this.opts.animate;u&&this.setAnimation(!1),!d&&e&&[...this.engine.nodes].forEach(g=>{if(!g.id)return;h.find(t,g.id)||(a.addRemoveCB&&a.addRemoveCB(this.el,g,!1,!1),n.push(g),this.removeWidget(g.el,!0,!1))}),this.engine._loading=!0;let c=[];return this.engine.nodes=this.engine.nodes.filter(l=>h.find(t,l.id)?(c.push(l),!1):!0),t.forEach(l=>{let g=h.find(c,l.id);if(g){if(h.shouldSizeToContent(g)&&(l.h=g.h),this.engine.nodeBoundFix(l),(l.autoPosition||l.x===void 0||l.y===void 0)&&(l.w=l.w||g.w,l.h=l.h||g.h,this.engine.findEmptyPosition(l)),this.engine.nodes.push(g),h.samePos(g,l)&&this.engine.nodes.length>1&&(this.moveNode(g,w(m({},l),{forceCollide:!0})),h.copyPos(l,g)),this.update(g.el,l),l.subGridOpts?.children){let p=g.el.querySelector(".grid-stack");p&&p.gridstack&&p.gridstack.load(l.subGridOpts.children)}}else e&&this.addWidget(l)}),delete this.engine._loading,this.engine.removedNodes=n,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?a.addRemoveCB=o:delete a.addRemoveCB,u&&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 e=this.el.querySelector("."+this.opts.itemClass);if(e){let s=h.toNumber(e.getAttribute("gs-h"))||1;return Math.round(e.offsetHeight/s)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):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 i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+i}let e=h.parseHeight(t);return this.opts.cellHeightUnit===e.unit&&this.opts.cellHeight===e.h?this:(this.opts.cellHeightUnit=e.unit,this.opts.cellHeight=e.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 e=this.getColumn(),i=e,s=this._widthOrContainer(!0);if(t.columnWidth)i=Math.min(Math.round(s/t.columnWidth)||1,t.columnMax);else{i=t.columnMax;let o=0;for(;o<t.breakpoints.length&&s<=t.breakpoints[o].w;)i=t.breakpoints[o++].c||e}if(i!==e){let o=t.breakpoints?.find(n=>n.c===i);return this.column(i,o?.layout||t.layout),!0}return!1}compact(t="compact",e=!0){return this.engine.compact(t,e),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(!t||t<1||this.opts.column===t)return this;let i=this.getColumn();return this.opts.column=t,this.engine?(this.engine.column=t,this.el.classList.remove("gs-"+i),this._updateColumnVar(),this.engine.columnChanged(i,t,e),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=e,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){if(this.el)return 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}float(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i=this.el.getBoundingClientRect(),s;e?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-s.left,n=t.top-s.top,d=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/d),y:Math.floor(n/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t,e){let i=a.getElement(t);if(!i||i.gridstackNode)return i;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,e);let s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&delete this._ignoreLayoutsNodeChange,i}on(t,e){return t.indexOf(" ")!==-1?(t.split(" ").forEach(s=>this.on(s,e)),this):(t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable"?(t==="enable"||t==="disable"?this._gsEventHandler[t]=s=>e(s):this._gsEventHandler[t]=s=>{s.detail&&e(s,s.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]=e: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,e=!0,i=!0){return t?(a.getElements(t).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let o=s.gridstackNode;o||(o=this.engine.nodes.find(n=>s===n.el)),o&&(e&&a.addRemoveCB&&a.addRemoveCB(this.el,o,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(o,e,i),e&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(t=!0,e=!0){return this.engine.nodes.forEach(i=>{t&&a.addRemoveCB&&a.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(t,e),e&&this._triggerRemoveEvent(),this}setAnimation(t=this.opts.animate,e){return e?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,e=!0,i=!0){return!!this.opts.staticGrid===t?this:(t?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.setStatic(t,e,i)}),e&&this._setStaticClass(),this)}updateOptions(t){let e=this.opts;return t===e?this:(t.acceptWidgets!==void 0&&(e.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!==e.class&&(e.class&&this.el.classList.remove(e.class),t.class&&this.el.classList.add(t.class)),t.columnOpts?(this.opts.columnOpts=t.columnOpts,this.checkDynamicColumn()):t.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof t.column=="number"&&this.column(t.column),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?(e.minRow=e.maxRow=e.row=t.row,this._updateContainerHeight()):(t.minRow!==void 0&&(e.minRow=t.minRow,this._updateContainerHeight()),t.maxRow!==void 0&&(e.maxRow=t.maxRow)),t.children?.length&&this.load(t.children),this)}update(t,e){return a.getElements(t).forEach(i=>{let s=i?.gridstackNode;if(!s)return;let o=m(m({},h.copyPos({},s)),h.cloneDeep(e));this.engine.nodeBoundFix(o),delete o.autoPosition;let n=["x","y","w","h"],d;if(n.some(l=>o[l]!==void 0&&o[l]!==s[l])&&(d={},n.forEach(l=>{d[l]=o[l]!==void 0?o[l]:s[l],delete o[l]})),!d&&(o.minW||o.minH||o.maxW||o.maxH)&&(d={}),o.content!==void 0){let l=i.querySelector(".grid-stack-item-content");l&&l.textContent!==o.content&&(s.content=o.content,a.renderCB(l,o),s.subGrid?.el&&(l.appendChild(s.subGrid.el),s.subGrid._updateContainerHeight())),delete o.content}let u=!1,c=!1;for(let l in o)l[0]!=="_"&&s[l]!==o[l]&&(s[l]=o[l],u=!0,c=c||!this.opts.staticGrid&&(l==="noResize"||l==="noMove"||l==="locked"));if(h.sanitizeMinMax(s),d){let l=d.w!==void 0&&d.w!==s.w;this.moveNode(s,d),l&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(l,s),delete s._orig}(d||u)&&this._writeAttr(i,s),c&&this.prepareDragDrop(s.el),a.updateCB&&a.updateCB(s)}),this}moveNode(t,e){let i=t._updating;i||this.engine.cleanNodes().beginUpdate(t),this.engine.moveNode(t,e),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(t){if(!t||(t.classList.remove("size-to-content-max"),!t.clientHeight))return;let e=t.gridstackNode;if(!e)return;let i=e.grid;if(!i||t.parentElement!==i.el)return;let s=i.getCellHeight(!0);if(!s)return;let o=e.h?e.h*s:t.clientHeight,n;if(e.resizeToContentParent&&(n=t.querySelector(e.resizeToContentParent)),n||(n=t.querySelector(a.resizeToContentParent)),!n)return;let d=t.clientHeight-n.clientHeight,u=e.h?e.h*s-d:n.clientHeight,c;if(e.subGrid){c=e.subGrid.getRow()*e.subGrid.getCellHeight(!0);let p=e.subGrid.el.getBoundingClientRect(),C=t.getBoundingClientRect();c+=p.top-C.top}else{if(e.subGridOpts?.children?.length)return;{let p=n.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${e.id} '${a.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=p.getBoundingClientRect().height||u}}if(u===c)return;o+=c-u;let l=Math.ceil(o/s),g=Number.isInteger(e.sizeToContent)?e.sizeToContent:0;g&&l>g&&(l=g,t.classList.add("size-to-content-max")),e.minH&&l<e.minH?l=e.minH:e.maxH&&l>e.maxH&&(l=e.maxH),l!==e.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(e,{h:l}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(t){a.resizeToContentCB?a.resizeToContentCB(t):this.resizeToContent(t)}rotate(t,e){return a.getElements(t).forEach(i=>{let s=i.gridstackNode;if(!h.canBeRotated(s))return;let o={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(e){let d=e.left>0?Math.floor(e.left/this.cellWidth()):0,u=e.top>0?Math.floor(e.top/this.opts.cellHeight):0;o.x=s.x+d-(s.h-(u+1)),o.y=s.y+u-d}Object.keys(o).forEach(d=>{o[d]===void 0&&delete o[d]});let n=s._orig;this.update(i,o),s._orig=n}),this}margin(t){if(!(typeof t=="string"&&t.split(" ").length>1)){let i=h.parseHeight(t);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}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){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let e=arguments,i=0,s={x:e[i++],y:e[i++],w:e[i++],h:e[i++],autoPosition:e[i++]};return this.willItFit(s)}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(e=>{delete e._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,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t),s=this;for(;s.parentGridNode;)s=s.parentGridNode.grid;return s.el.dispatchEvent(i),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.parentGridNode,e=this.getRow()+this._extraDragRow,i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!t&&!this.opts.minRow){let o=h.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===s){let n=Math.floor(o.h/i);e<n&&(e=n)}}return this.el.setAttribute("gs-current-row",String(e)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),e&&(this.el.style[t?"minHeight":"height"]=e*i+s),t&&h.shouldSizeToContent(t)&&t.grid.resizeToContentCBCheck(t.el),this}_prepareElement(t,e=!1,i){i=i||this._readAttr(t),t.gridstackNode=i,i.el=t,i.grid=this,i=this.engine.addNode(i,e),this._writeAttr(t,i),t.classList.add(z.itemClass,this.opts.itemClass);let s=h.shouldSizeToContent(i);return s?t.classList.add("size-to-content"):t.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),h.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(t,e){return(!e._moving&&!e._resizing||this._placeholder===t)&&(t.style.top=e.y?e.y===1?"var(--gs-cell-height)":`calc(${e.y} * var(--gs-cell-height))`:null,t.style.left=e.x?e.x===1?"var(--gs-column-width)":`calc(${e.x} * var(--gs-column-width))`:null,t.style.width=e.w>1?`calc(${e.w} * var(--gs-column-width))`:null,t.style.height=e.h>1?`calc(${e.h} * var(--gs-cell-height))`:null),e.x>0?t.setAttribute("gs-x",String(e.x)):t.removeAttribute("gs-x"),e.y>0?t.setAttribute("gs-y",String(e.y)):t.removeAttribute("gs-y"),e.w>1?t.setAttribute("gs-w",String(e.w)):t.removeAttribute("gs-w"),e.h>1?t.setAttribute("gs-h",String(e.h)):t.removeAttribute("gs-h"),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e);let i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t,e=!0){let i={};i.x=h.toNumber(t.getAttribute("gs-x")),i.y=h.toNumber(t.getAttribute("gs-y")),i.w=h.toNumber(t.getAttribute("gs-w")),i.h=h.toNumber(t.getAttribute("gs-h")),i.autoPosition=h.toBool(t.getAttribute("gs-auto-position")),i.noResize=h.toBool(t.getAttribute("gs-no-resize")),i.noMove=h.toBool(t.getAttribute("gs-no-move")),i.locked=h.toBool(t.getAttribute("gs-locked"));let s=t.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=h.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=t.getAttribute("gs-id"),i.maxW=h.toNumber(t.getAttribute("gs-max-w")),i.minW=h.toNumber(t.getAttribute("gs-min-w")),i.maxH=h.toNumber(t.getAttribute("gs-max-h")),i.minH=h.toNumber(t.getAttribute("gs-min-h")),e&&(i.w===1&&t.removeAttribute("gs-w"),i.h===1&&t.removeAttribute("gs-h"),i.maxW&&t.removeAttribute("gs-max-w"),i.minW&&t.removeAttribute("gs-min-w"),i.maxH&&t.removeAttribute("gs-max-h"),i.minH&&t.removeAttribute("gs-min-h"));for(let o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="sizeToContent"&&delete i[o]}return i}_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||this.prevWidth===t)return;this.prevWidth=t,this.batchUpdate();let e=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),e=!0):e=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(e),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(t=!1,e=void 0){if(this.engine){if(t&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,e),this.animationDelay);if(e)h.shouldSizeToContent(e)&&this.resizeToContentCBCheck(e.el);else if(this.engine.nodes.some(i=>h.shouldSizeToContent(i))){let i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{h.shouldSizeToContent(s)&&this.resizeToContentCBCheck(s.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,e?[e]:this.engine.nodes)}}_updateResizeEvent(t=!1){let e=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!t&&e&&!this.resizeObserver?(this._sizeThrottle=h.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(t||!e)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(t=".grid-stack-item"){return h.getElement(t)}static getElements(t=".grid-stack-item"){return h.getElements(t)}static getGridElement(t){return a.getElement(t)}static getGridElements(t){return h.getElements(t)}_initMargin(){let t,e=0,i=[];typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=h.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(n=>{this.opts[n]===void 0?this.opts[n]=e:(t=h.parseHeight(this.opts[n]),this.opts[n]=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 o=this.el.style;return o.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return E}static setupDragIn(t,e,i,s=document){e?.pause!==void 0&&(f.pauseDrag=e.pause),e=m({appendTo:"body",helper:"clone"},e||{}),(typeof t=="string"?h.getElements(t,s):t).forEach((n,d)=>{E.isDraggable(n)||E.dragIn(n,e),i?.[d]&&(n.gridstackNode=i[d])})}movable(t,e){return this.opts.staticGrid?this:(a.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(t,e){return this.opts.staticGrid?this:(a.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),this)}disable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!1,t),this.enableResize(!1,t),this._triggerEvent("disable"),this}enable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!0,t),this.enableResize(!0,t),this._triggerEvent("enable"),this}enableMove(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableMove(t,e)}),this)}enableResize(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableResize(t,e)}),this)}cancelDrag(){let t=this._placeholder?.gridstackNode;t&&(t._isExternal?(t._isAboutToRemove=!0,this.engine.removeNode(t)):t._isAboutToRemove&&a._itemRemoving(t.el,!1),this.engine.restoreInitial())}_removeDD(t){return E.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 E.droppable(this.el,"destroy"),this;let t,e,i=(s,o,n)=>{n=n||o;let d=n.gridstackNode;if(!d)return;if(!d.grid?.el){n.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let p=n.getBoundingClientRect();n.style.left=p.x+(this.dragTransform.xScale-1)*(s.clientX-p.x)/this.dragTransform.xScale+"px",n.style.top=p.y+(this.dragTransform.yScale-1)*(s.clientY-p.y)/this.dragTransform.yScale+"px",n.style.transformOrigin="0px 0px"}let{top:u,left:c}=n.getBoundingClientRect(),l=this.el.getBoundingClientRect();c-=l.left,u-=l.top;let g={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(d._temporaryRemoved){if(d.x=Math.max(0,Math.round(c/e)),d.y=Math.max(0,Math.round(u/t)),delete d.autoPosition,this.engine.nodeBoundFix(d),!this.engine.willItFit(d)){if(d.autoPosition=!0,!this.engine.willItFit(d)){E.off(o,"drag");return}d._willFitPos&&(h.copyPos(d,d._willFitPos),delete d._willFitPos)}this._onStartMoving(n,s,g,d,e,t)}else this._dragOrResize(n,s,g,d,e,t)};return E.droppable(this.el,{accept:s=>{let o=s.gridstackNode||this._readAttr(s,!1);if(o?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let n=!0;if(typeof this.opts.acceptWidgets=="function")n=this.opts.acceptWidgets(s);else{let d=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;n=s.matches(d)}if(n&&o&&this.opts.maxRow){let d={w:o.w,h:o.h,minW:o.minW,minH:o.minH};n=this.engine.willItFit(d)}return n}}).on(this.el,"dropover",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;if(d?.grid===this&&!d._temporaryRemoved)return!1;if(d?._sidebarOrig&&(d.w=d._sidebarOrig.w,d.h=d._sidebarOrig.h),d?.grid&&d.grid!==this&&!d._temporaryRemoved&&d.grid._leave(o,n),n=n||o,e=this.cellWidth(),t=this.getCellHeight(!0),!d){let l=n.getAttribute("data-gs-widget")||n.getAttribute("gridstacknode");if(l){try{d=JSON.parse(l)}catch{console.error("Gridstack dropover: Bad JSON format: ",l)}n.removeAttribute("data-gs-widget"),n.removeAttribute("gridstacknode")}d||(d=this._readAttr(n)),d._sidebarOrig={w:d.w,h:d.h}}d.grid||(d.el||(d=m({},d)),d._isExternal=!0,n.gridstackNode=d);let u=d.w||Math.round(n.offsetWidth/e)||1,c=d.h||Math.round(n.offsetHeight/t)||1;return d.grid&&d.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=d),o.gridstackNode=d=w(m({},d),{w:u,h:c,grid:this}),delete d.x,delete d.y,this.engine.cleanupNode(d).nodeBoundFix(d),d._initDD=d._isExternal=d._temporaryRemoved=!0):(d.w=u,d.h=c,d._temporaryRemoved=!0),a._itemRemoving(d.el,!1),E.on(o,"drag",i),i(s,o,n),!1}).on(this.el,"dropout",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;return d&&(!d.grid||d.grid===this)&&(this._leave(o,n),this._isTemp&&this.removeAsSubGrid(d)),!1}).on(this.el,"drop",(s,o,n)=>{let d=n?.gridstackNode||o.gridstackNode;if(d?.grid===this&&!d._isExternal)return!1;let u=!!this.placeholder.parentElement,c=o!==n;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let l=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,u&&l?.grid&&l.grid!==this){let p=l.grid;p.engine.removeNodeFromLayoutCache(l),p.engine.removedNodes.push(l),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridNode&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!d||(u&&(this.engine.cleanupNode(d),d.grid=this),delete d.grid?._isTemp,E.off(o,"drag"),n!==o?(n.remove(),o=n):o.remove(),this._removeDD(o),!u))return!1;let g=d.subGrid?.el?.gridstack;return h.copyPos(d,this._readAttr(this.placeholder)),h.removePositioningStyles(o),c&&(d.content||d.subGridOpts||a.addRemoveCB)?(delete d.el,o=this.addWidget(d)):(this._prepareElement(o,!0,d),this.el.appendChild(o),this.resizeToContentCheck(!1,d),g&&(g.parentGridNode=d),this._updateContainerHeight()),this.engine.addedNodes.push(d),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(w(m({},s),{type:"dropped"}),l&&l.grid?l:void 0,d),!1}),this}static _itemRemoving(t,e){if(!t)return;let i=t?t.gridstackNode:void 0;!i?.grid||t.classList.contains(i.grid.opts.removableOptions.decline)||(e?i._isAboutToRemove=!0:delete i._isAboutToRemove,e?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&&!E.isDroppable(t)&&E.droppable(t,this.opts.removableOptions).on(t,"dropover",(e,i)=>a._itemRemoving(i,!0)).on(t,"dropout",(e,i)=>a._itemRemoving(i,!1)),this):this}prepareDragDrop(t,e=!1){let i=t?.gridstackNode;if(!i)return;let s=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,n=this.opts.staticGrid||s&&o;if((e||n)&&(i._initDD&&(this._removeDD(t),delete i._initDD),n&&t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!e))return this;if(!i._initDD){let d,u,c=(p,C)=>{this.triggerEvent(p,p.target),d=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(t,p,C,i,d,u)},l=(p,C)=>{this._dragOrResize(t,p,C,i,d,u)},g=p=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let C=i.w!==i._orig.w,D=p.target;if(!(!D.gridstackNode||D.gridstackNode.grid!==this)){if(i.el=D,i._isAboutToRemove){let P=t.gridstackNode.grid;P._gsEventHandler[p.type]&&P._gsEventHandler[p.type](p,D),P.engine.nodes.push(i),P.removeWidget(t,!0,!0)}else h.removePositioningStyles(D),i._temporaryRemoved?(this._writePosAttr(D,i),this.engine.addNode(i)):this._writePosAttr(D,i),this.triggerEvent(p,D);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),p.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(C,i))}};E.draggable(t,{start:c,stop:g,drag:l}).resizable(t,{start:c,stop:g,resize:l}),i._initDD=!0}return E.draggable(t,s?"disable":"enable").resizable(t,o?"disable":"enable"),this}_onStartMoving(t,e,i,s,o,n){if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,s.grid?.el)this.dragTransform=h.getValuesFromTransformedElement(t);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let d=this.placeholder.closest(".grid-stack");this.dragTransform=h.getValuesFromTransformedElement(d)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=e.type==="dragstart",s._resizing=e.type==="resizestart",delete s._lastTried,e.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(o,n,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),e.type==="resizestart"){let d=this.getColumn()-s.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;E.resizable(t,"option","minWidth",o*Math.min(s.minW||1,d)).resizable(t,"option","minHeight",n*Math.min(s.minH||1,u)).resizable(t,"option","maxWidth",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,d)).resizable(t,"option","maxWidthMoveLeft",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(t,"option","maxHeight",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(t,"option","maxHeightMoveUp",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(t,e,i,s,o,n){let d=m({},s._orig),u,c=this.opts.marginLeft,l=this.opts.marginRight,g=this.opts.marginTop,p=this.opts.marginBottom,C=Math.round(n*.1),D=Math.round(o*.1);if(c=Math.min(c,D),l=Math.min(l,D),g=Math.min(g,C),p=Math.min(p,C),e.type==="drag"){if(s._temporaryRemoved)return;let F=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&h.updateScrollPosition(t,i.position,F);let xt=i.position.left+(i.position.left>s._lastUiPosition.left?-l:c),Fe=i.position.top+(i.position.top>s._lastUiPosition.top?-p:g);d.x=Math.round(xt/o),d.y=Math.round(Fe/n);let Ge=this._extraDragRow;if(this.engine.collide(s,d)){let Et=this.getRow(),Dt=Math.max(0,d.y+s.h-Et);this.opts.maxRow&&Et+Dt>this.opts.maxRow&&(Dt=Math.max(0,this.opts.maxRow-Et)),this._extraDragRow=Dt}else this._extraDragRow=0;if(this._extraDragRow!==Ge&&this._updateContainerHeight(),s.x===d.x&&s.y===d.y)return}else if(e.type==="resize"){if(d.x<0||(h.updateScrollResize(e,t,n),d.w=Math.round((i.size.width-c)/o),d.h=Math.round((i.size.height-g)/n),s.w===d.w&&s.h===d.h)||s._lastTried&&s._lastTried.w===d.w&&s._lastTried.h===d.h)return;let F=i.position.left+c,xt=i.position.top+g;d.x=Math.round(F/o),d.y=Math.round(xt/n),u=!0}s._event=e,s._lastTried=d;let P={x:i.position.left+c,y:i.position.top+g,w:(i.size?i.size.width:s.w*o)-c-l,h:(i.size?i.size.height:s.h*n)-g-p};if(this.engine.moveNodeCheck(s,w(m({},d),{cellWidth:o,cellHeight:n,rect:P,resizing:u}))){s._lastUiPosition=i.position,this.engine.cacheRects(o,n,g,l,p,c),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let F=e.target;s._sidebarOrig||this._writePosAttr(F,s),this.triggerEvent(e,F)}}triggerEvent(t,e){let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;i._gsEventHandler[t.type]&&i._gsEventHandler[t.type](t,e)}_leave(t,e){e=e||t;let i=e.gridstackNode;if(!i||(e.style.transform=e.style.transformOrigin=null,E.off(t,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&e?e:t;let s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&a._itemRemoving(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}commit(){return Te(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}return a.renderCB=(r,t)=>{r&&t?.content&&(r.textContent=t.content)},a.resizeToContentParent=".grid-stack-item-content",a.Utils=h,a.Engine=Mt,a.GDRev="12.3.2",a})();var Pe=["container"],Ve=["*"];function je(a,r){}var qe=["*",[["","empty-content",""]]],Ye=["*","[empty-content]"];function $e(a,r){a&1&&nt(0,1,["*ngIf","isEmpty"])}function Xe(a,r){}var Le=(()=>{class a{serialize(){}deserialize(t){this.widgetItem=t,t&&t.input&&Object.assign(this,t.input)}}return a.\u0275fac=function(t){return new(t||a)},a.\u0275prov=Wt({token:a,factory:a.\u0275fac}),a})(),Ae=(()=>{class a{constructor(t){this.elementRef=t,this.el._gridItemComp=this}set options(t){let e=this.el.gridstackNode?.grid;e?e.update(this.el,t):this._options=w(m({},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 a.\u0275fac=function(t){return new(t||a)(kt(X))},a.\u0275cmp=M({type:a,selectors:[["gridstack-item"]],viewQuery:function(t,e){if(t&1&&et(Pe,7,Q),t&2){let i;G(i=U())&&(e.container=i.first)}},inputs:{options:"options"},ngContentSelectors:Ve,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(t,e){t&1&&(zt(),Z(0,"div",1),Yt(1,je,0,0,"ng-template",null,0,St),nt(3),b(4),tt()),t&2&&(H(4),se(" ",e.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),a})(),ot=(()=>{class a{constructor(t){this.elementRef=t,this.addedCB=new S,this.changeCB=new S,this.disableCB=new S,this.dragCB=new S,this.dragStartCB=new S,this.dragStopCB=new S,this.droppedCB=new S,this.enableCB=new S,this.removedCB=new S,this.resizeCB=new S,this.resizeStartCB=new S,this.resizeStopCB=new S,I.addRemoveCB||(I.addRemoveCB=Qe),I.saveCB||(I.saveCB=Ke),I.updateCB||(I.updateCB=Je),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 addComponentToSelectorType(t){t.forEach(e=>a.selectorToType[a.getSelector(e)]=e)}static getSelector(t){return le(t).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=I.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(e=>{t.push(e.options),e.clearOptions()}),this.grid.load(t)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(t){t&&(t.parentGridNode||t.on("added",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:e,nodes:i})}).on("change",(e,i)=>this.changeCB.emit({event:e,nodes:i})).on("disable",e=>this.disableCB.emit({event:e})).on("drag",(e,i)=>this.dragCB.emit({event:e,el:i})).on("dragstart",(e,i)=>this.dragStartCB.emit({event:e,el:i})).on("dragstop",(e,i)=>this.dragStopCB.emit({event:e,el:i})).on("dropped",(e,i,s)=>this.droppedCB.emit({event:e,previousNode:i,newNode:s})).on("enable",e=>this.enableCB.emit({event:e})).on("removed",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:e,nodes:i})}).on("resize",(e,i)=>this.resizeCB.emit({event:e,el:i})).on("resizestart",(e,i)=>this.resizeStartCB.emit({event:e,el:i})).on("resizestop",(e,i)=>this.resizeStopCB.emit({event:e,el:i})))}unhookEvents(t){t&&(t.parentGridNode||t.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return a.selectorToType={},a.\u0275fac=function(t){return new(t||a)(kt(X))},a.\u0275cmp=M({type:a,selectors:[["gridstack"]],contentQueries:function(t,e,i){if(t&1&&Zt(i,Ae,4),t&2){let s;G(s=U())&&(e.gridstackItems=s)}},viewQuery:function(t,e){if(t&1&&et(Pe,7,Q),t&2){let i;G(i=U())&&(e.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:Ye,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(t,e){t&1&&(zt(qe),qt(0,$e,1,0,"ng-content",1)(1,Xe,0,0,"ng-template",null,0,St),nt(3)),t&2&&N("ngIf",e.isEmpty)},dependencies:[he],styles:["[_nghost-%COMP%]{display:block}"]}),a})();function Qe(a,r,t,e){if(t){if(!a)return;if(e){let i=a.parentElement?._gridItemComp;if(!i)return;let o=(i.childWidget?.container||i.container)?.createComponent(ot),n=o?.instance;return n?(n.ref=o,n.options=r,n.el):void 0}else{let s=a._gridComp?.container?.createComponent(Ae),o=s?.instance;if(!o)return;o.ref=s;let n=r.selector,d=n?ot.selectorToType[n]:void 0;if(d){let u=()=>{let l=o.container?.createComponent(d)?.instance;l&&typeof l.serialize=="function"&&typeof l.deserialize=="function"&&(o.childWidget=l,l.deserialize(r))};r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([l])=>{l.isIntersecting&&(r.visibleObservable?.disconnect(),delete r.visibleObservable,u())}),window.setTimeout(()=>r.visibleObservable?.observe(o.el))):u()}return o.el}}else if(e){let i=r.el?._gridComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}else{let i=r.el?._gridItemComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}}function Ke(a,r){let t=a.el?._gridItemComp;if(t){let i=t.childWidget?.serialize();i&&(r.input=i);return}let e=a.el?._gridComp}function Je(a){let r=a,t=a.el?._gridItemComp;t?.childWidget&&r.input&&t.childWidget.deserialize(r)}var W=(function(a){return a[a.State=0]="State",a[a.Transition=1]="Transition",a[a.Sequence=2]="Sequence",a[a.Group=3]="Group",a[a.Animate=4]="Animate",a[a.Keyframes=5]="Keyframes",a[a.Style=6]="Style",a[a.Trigger=7]="Trigger",a[a.Reference=8]="Reference",a[a.AnimateChild=9]="AnimateChild",a[a.AnimateRef=10]="AnimateRef",a[a.Query=11]="Query",a[a.Stagger=12]="Stagger",a})(W||{}),Ze="*";function Bt(a,r){return{type:W.Trigger,name:a,definitions:r,options:{}}}function Ct(a,r=null){return{type:W.Animate,styles:r,timings:a}}function Ss(a,r=null){return{type:W.Sequence,steps:a,options:r}}function $(a){return{type:W.Style,styles:a,offset:null}}function It(a,r,t=null){return{type:W.Transition,expr:a,animation:r,options:t}}var Lt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(r=0,t=0){this.totalTime=r+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(r=>r()),this._onDoneFns=[])}onStart(r){this._originalOnStartFns.push(r),this._onStartFns.push(r)}onDone(r){this._originalOnDoneFns.push(r),this._onDoneFns.push(r)}onDestroy(r){this._onDestroyFns.push(r)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(r=>r()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(r=>r()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(r){this._position=this.totalTime?r*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(r){let t=r=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},At=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(r){this.players=r;let t=0,e=0,i=0,s=this.players.length;s==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==s&&this._onFinish()}),o.onDestroy(()=>{++e==s&&this._onDestroy()}),o.onStart(()=>{++i==s&&this._onStart()})}),this.totalTime=this.players.reduce((o,n)=>Math.max(o,n.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(r=>r()),this._onDoneFns=[])}init(){this.players.forEach(r=>r.init())}onStart(r){this._onStartFns.push(r)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(r=>r()),this._onStartFns=[])}onDone(r){this._onDoneFns.push(r)}onDestroy(r){this._onDestroyFns.push(r)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(r=>r.play())}pause(){this.players.forEach(r=>r.pause())}restart(){this.players.forEach(r=>r.restart())}finish(){this._onFinish(),this.players.forEach(r=>r.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(r=>r.destroy()),this._onDestroyFns.forEach(r=>r()),this._onDestroyFns=[])}reset(){this.players.forEach(r=>r.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(r){let t=r*this.totalTime;this.players.forEach(e=>{let i=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(i)})}getPosition(){let r=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return r!=null?r.getPosition():0}beforeDestroy(){this.players.forEach(r=>{r.beforeDestroy&&r.beforeDestroy()})}triggerCallback(r){let t=r=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},ti="!";var ei=(a,r)=>r.id;function ii(a,r){if(a&1&&Kt(0,"div",4),a&2){let t=r.$index;L();let e=ne(0);at("background-color",e===t?"var(--mat-sys-on-surface)":"var(--mat-sys-inverse-on-surface)")}}var Be=(()=>{class a{activePage=Tt();dashboards=Tt();static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["dashboard-scroller"]],inputs:{activePage:[1,"activePage"],dashboards:[1,"dashboards"]},decls:7,vars:4,consts:[[1,"page-scroll-title","page-scroll-container"],[1,"page-label"],[1,"page-scroll-page-number","page-scroll-container"],[1,"page-marker",3,"background-color"],[1,"page-marker"]],template:function(e,i){if(e&1&&(re(0),Z(1,"div",0)(2,"span",1),b(3),tt()(),Z(4,"div",2),$t(5,ii,1,2,"div",3,ei),tt()),e&2){let s=i.dashboards(),o=oe(i.activePage());H(),N("@fadeInOut",o),H(2),ie(s[o].name),H(),N("@fadeInOut",o),H(),Xt(s)}},styles:["[_nghost-%COMP%]{pointer-events:none}.page-scroll-title[_ngcontent-%COMP%]{position:absolute;top:50%;right:54px;transform:translateY(-50%);z-index:100;cursor:default;text-align:center;padding:10px;color:var(--mat-sys-inverse-surface)}.page-scroll-page-number[_ngcontent-%COMP%]{position:absolute;top:50%;right:15px;transform:translateY(-50%);z-index:100;cursor:default;display:grid;padding:0}.page-scroll-container[_ngcontent-%COMP%]{opacity:0;background-color:var(--mat-sys-tertiary-fixed-dim);border-radius:10px;border:1px solid var(--mat-sys-inverse-surface)}.page-label[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);text-shadow:1px 1px 0 var(--mat-sys-outline),-1px 1px 0 var(--mat-sys-outline),-1px -1px 0 var(--mat-sys-outline),1px -1px 0 var(--mat-sys-outline);font-size:x-large}.page-marker[_ngcontent-%COMP%]{height:20px;width:20px;margin:4px;border-radius:50%;border:1px solid var(--mat-sys-outline)}"],data:{animation:[Bt("fadeInOut",[It(":increment, :decrement",[$({opacity:0}),Ct(100,$({opacity:1})),$({opacity:1}),Ct("250ms 1000ms",$({opacity:0}))])])]}})}return a})();function ri(a,r){if(a&1){let t=A();_(0,"button",0),T("click",function(){R(t);let i=L();return k(i.clickAction("cancel"))}),_(1,"mat-icon",1),b(2,"close"),y(),_(3,"span"),b(4,"Close"),y()()}}var Ie=(()=>{class a{_bottomSheetRef=v(xe);data=v(Ce);showCancel=!!(this.data&&this.data.showCancel);clickAction(t){this._bottomSheetRef.dismiss(t)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["widget-host-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(e,i){e&1&&(_(0,"mat-action-list")(1,"button",0),T("click",function(){return i.clickAction("duplicate")}),_(2,"mat-icon",1),b(3,"content_copy"),y(),_(4,"span"),b(5,"Duplicate"),y()(),_(6,"button",0),T("click",function(){return i.clickAction("delete")}),_(7,"mat-icon",1),b(8,"delete_forever"),y(),_(9,"span"),b(10,"Delete"),y()(),K(11,ri,5,0,"button",2),y()),e&2&&(H(11),J(i.showCancel?11:-1))},dependencies:[Se,ke,ze,Re,ct,ht],encapsulation:2})}return a})();var oi=["childOutlet"],We=(()=>{class a extends Le{widgetProperties;outlet;_dialog=v(mt);_dashboard=v(lt);_bottomSheet=v(Ee);_streams=v(ft,{optional:!0});_meta=v(pt,{optional:!0});_runtime=v(gt,{optional:!0});_widgetService=v(ve);_app=v(ut);theme=ce(this._app.cssThemeColorRoles$,{requireSync:!0});childRef;compType;_hasInitialized=!1;_sheetOpen=!1;_optionsOpen=!1;isDebugEnabled(){try{return typeof localStorage<"u"&&localStorage.getItem("kip:gesturesDebug")==="1"}catch{return!1}}debug(...t){this.isDebugEnabled()&&console.debug("[Host2]",...t)}constructor(){super(),st(()=>{let t=this.theme();this.childRef&&it(()=>{this.childRef.setInput("theme",t)})}),st(()=>{let t=this._dashboard.layoutEditCanceled();!this._hasInitialized||!t||it(()=>{this.reinitFromSavedConfig()})})}ngOnInit(){let t=this.widgetProperties.type;if(!t)return;this.compType=this._widgetService.getComponentType(t);let e=this.getDefaultConfig();this._runtime?.initialize?.(e,this.widgetProperties.config);let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i),this.outlet&&this.compType&&(this.childRef=this.outlet.createComponent(this.compType),this.childRef.setInput("id",this.widgetProperties.uuid),this.childRef.setInput("type",this.widgetProperties.type),this.childRef.setInput("theme",this.theme())),this._hasInitialized=!0}serialize(){let t=this._runtime?.options();return t?this.widgetProperties.config=t:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}applyRuntimeConfig(t){t&&this._runtime?.setRuntimeConfig?.(t);let e=this._runtime.options();e&&(this.widgetProperties.config=e),this._streams?.applyStreamsConfigDiff?.(e),this._meta?.applyMetaConfigDiff?.(e)}reinitFromSavedConfig(){try{let t=this.getSavedConfigForSelf(),e=this.getDefaultConfig();this._runtime?.initialize?.(e,rt(t));let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i)}catch{}}getSavedConfigForSelf(){try{let t=this._dashboard.dashboards(),e=this._dashboard.activeDashboard(),o=(t?.[e]?.configuration??[]).find(n=>n?.id===this.widgetProperties.uuid);return o?.input?.widgetProperties?.config??o?.widgetProperties?.config??void 0}catch{return}}getDefaultConfig(){let t=this.compType&&this.compType.DEFAULT_CONFIG;if(!t&&this.compType&&this.outlet){let e=this.outlet.createComponent(this.compType);t=e.instance.defaultConfig,e.destroy()}return t}openWidgetOptions(t){if(t.stopPropagation(),this.debug("openWidgetOptions invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._optionsOpen){this.debug("options already open; ignoring");return}if(this._optionsOpen=!0,!this.widgetProperties)return;this._dialog.openWidgetOptions({title:"Widget Options",config:this.widgetProperties.config,confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{this._optionsOpen=!1,e&&(this.debug("options saved",{widgetId:this.widgetProperties?.uuid}),this.applyRuntimeConfig(e))})}}openBottomSheet(t){if(t.stopPropagation(),this.debug("openBottomSheet invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._sheetOpen){this.debug("sheet already open; ignoring");return}this._sheetOpen=!0;let e=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Ie,e?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,this.debug("bottom sheet dismissed",{widgetId:this.widgetProperties?.uuid,action:s}),s){case"delete":this._dashboard.deleteWidget(this.widgetProperties.uuid);break;case"duplicate":this._dashboard.duplicateWidget(this.widgetProperties.uuid);break;default:break}})}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["widget-host2"]],viewQuery:function(e,i){if(e&1&&et(oi,7,Q),e&2){let s;G(s=U())&&(i.outlet=s.first)}},inputs:{widgetProperties:"widgetProperties"},features:[jt([ft,pt,gt]),Vt],decls:3,vars:3,consts:[["childOutlet",""],["kipGestures","","appearance","raised",1,"widget-container","kip-widget-card-colors",3,"doubletap","press","mode"]],template:function(e,i){if(e&1){let s=A();_(0,"mat-card",1),T("doubletap",function(n){return R(s),k(i.openWidgetOptions(n))})("press",function(n){return R(s),k(i.openBottomSheet(n))}),Jt(1,null,0),y()}e&2&&(at("border",i._dashboard.isDashboardStatic()?"1px dashed transparent":"1px dashed var(--mat-sys-outline)"),N("mode","press"))},dependencies:[ye,_e,De,dt],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block;overflow:hidden}.widget-container[_ngcontent-%COMP%]{display:block;width:100%;height:100%;margin:0;padding:0}.kip-widget-card-colors[_ngcontent-%COMP%]{background-color:var(--kip-widget-card-background-color)}"],changeDetection:0})}return a})();var ni=["grid"];function ai(a,r){a&1&&(_(0,"p",9)(1,"strong"),b(2,"Long press/click and hold anywhere"),y(),b(3," to add widgets"),y(),_(4,"mat-icon",10),b(5,"touch_app"),y())}function di(a,r){if(a&1){let t=A();_(0,"p",9),b(1,"This empty dashboard is ready to be customized."),y(),_(2,"button",11),T("click",function(){R(t);let i=L();return k(i.editDashboard())}),_(3,"mat-icon"),b(4,"lock_open"),y(),b(5," Unlock and Customize "),y()}}function li(a,r){if(a&1){let t=A();_(0,"div",7)(1,"button",12),T("click",function(){R(t);let i=L();return k(i.cancelLayoutChanges())}),_(2,"mat-icon"),b(3,"close"),y()(),_(4,"button",13),T("click",function(){R(t);let i=L();return k(i.saveLayoutChanges())}),_(5,"mat-icon"),b(6,"done"),y()()()}}function hi(a,r){if(a&1&&Qt(0,"dashboard-scroller",8),a&2){let t=L();N("activePage",t.dashboard.activeDashboard())("dashboards",t.dashboard.dashboards())}}var Wr=(()=>{class a{activatedRoute=v(ue);_app=v(ut);_dialog=v(mt);dashboard=v(lt);_destroyRef=v(Ft);_uiEvent=v(we);_dataset=v(be);_router=v(ge);_hostEl=v(X);isDashboardStatic=ae(()=>this.dashboard.isDashboardStatic());_gridstack=de.required("grid");_previousIsStaticState=!0;_suppressDrag=!1;gridOptions=Gt({column:24,margin:4,minRow:24,maxRow:24,float:!0,acceptWidgets:!1,resizable:{handles:"all"}});_boundHandleKeyDown=this.handleKeyDown.bind(this);_resizeObserver;_pendingResizeRaf=null;_lastContainerHeight=0;_lastCellHeight=0;_hasLoadedInitialDashboard=!1;constructor(){ot.addComponentToSelectorType([We]),st(()=>{let t=this.dashboard.isDashboardStatic();it(()=>{if(this._previousIsStaticState!==t){this._previousIsStaticState=t;try{this._gridstack().grid.setStatic(t)}catch{}}})})}ngAfterViewInit(){this._gridstack().grid?.setStatic(this._previousIsStaticState),this.resizeGridColumns(),this.setupResizeObserver(),this._uiEvent.addHotkeyListener(this._boundHandleKeyDown,{ctrlKey:!0,keys:["arrowdown","arrowup"]});try{let t=this._gridstack().grid;t&&typeof t.on=="function"&&(t.on("dragstart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("dragstop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}),t.on("resizestart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("resizestop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}))}catch{}this.dashboard.widgetAction$.pipe(Ot(this._destroyRef)).subscribe(t=>{t&&this._gridstack().grid.getGridItems().forEach(e=>{if(e.gridstackNode.id===t.id)switch(t.operation){case"delete":this.deleteWidget(e);break;case"duplicate":this.duplicateWidget(e);break;default:break}})}),this.activatedRoute.params.pipe(Ot(this._destroyRef)).subscribe(t=>{let e=t.id,i=Number(e);if(!(e!==void 0&&e!==""&&!isNaN(i))||i<0||i>=this.dashboard.dashboards().length)return;let o=this.dashboard.activeDashboard();(!this._hasLoadedInitialDashboard||i!==o)&&(i!==o&&this.dashboard.setActiveDashboard(i),this.loadDashboard(i),this._hasLoadedInitialDashboard=!0)})}setupResizeObserver(){if(this._resizeObserver)return;let t=this._hostEl.nativeElement;try{this._resizeObserver=new ResizeObserver(()=>{this._pendingResizeRaf===null&&(this._pendingResizeRaf=requestAnimationFrame(()=>{this._pendingResizeRaf=null,this.resizeGridColumns()}))}),this._resizeObserver.observe(t)}catch{}}handleKeyDown(t){t==="arrowdown"?this.previousDashboard():t==="arrowup"&&this.nextDashboard()}resizeGridColumns(){try{let e=this._gridstack().grid;if(!e)return;let i=e,s=this._hostEl.nativeElement.clientHeight||window.innerHeight;if(s===this._lastContainerHeight&&this._lastCellHeight>0)return;let o=i.getRow?i.getRow():0;if(o>0&&i.cellHeight){let n=Number(o)||0,d=n>0?s/n:1;if(d=Math.max(1,Math.round(d*100)/100),this._lastCellHeight===d&&this._lastContainerHeight===s)return;i.cellHeight(d),i.batchUpdate&&i.commit&&(i.batchUpdate(),i.commit()),this._lastContainerHeight=s,this._lastCellHeight=d}}catch{}}loadDashboard(t){let e=rt(this.dashboard.dashboards()[t]),i=this._gridstack();if(!i?.grid){queueMicrotask(()=>this.loadDashboard(t));return}i.grid.batchUpdate(),i.grid.load(e.configuration),i.grid.commit()}saveDashboard(){let t=this._gridstack().grid.save(!1,!1)||null;this.dashboard.updateConfiguration(this.dashboard.activeDashboard(),t)}saveLayoutChanges(){this.dashboard.setStaticDashboard(!0),this.saveDashboard(),this.dashboard.notifyLayoutEditSaved()}cancelLayoutChanges(){this.loadDashboard(this.dashboard.activeDashboard()),this.dashboard.setStaticDashboard(!0),this.dashboard.notifyLayoutEditCanceled()}_addDialogOpen=!1;addNewWidget(t){if(!this.dashboard.isDashboardStatic()&&t.detail!==void 0){if(this._addDialogOpen)return;let e=t.detail||{},i=e.center?.x??e.x??0,s=e.center?.y??e.y??0,o=this._gridstack().grid.getCellFromPixel({left:i,top:s});this._gridstack().grid.isAreaEmpty(o.x,o.y,1,2)&&(this._gridstack().grid.willItFit({x:o.x,y:o.y,w:4,h:6})?(this._addDialogOpen=!0,this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).subscribe({next:d=>{if(!d||typeof d!="object")return;let u=Ht.create(),c=d,l={x:o.x,y:o.y,w:c.defaultWidth,h:c.defaultHeight,minW:c.minWidth,minH:c.minHeight,id:u,selector:"widget-host2",input:{widgetProperties:{type:c.selector,uuid:u}}};this._gridstack().grid.addWidget(l)},complete:()=>{this._addDialogOpen=!1}})):this._app.sendSnackbarNotification("Error Adding Widget: Not enough space at the selected location. Please reorganize the dashboard to free up space or choose a larger empty area.",0))}}cancelPointerSequence(){if(!this._suppressDrag){this._suppressDrag=!0;try{this._gridstack().grid.setStatic(!0)}catch{}["pointerup","mouseup","touchend"].forEach(t=>{document.dispatchEvent(new Event(t,{bubbles:!0}))})}}onPointerRelease(){if(this._suppressDrag&&(this._suppressDrag=!1,!this.dashboard.isDashboardStatic()))try{this._gridstack().grid.setStatic(!1)}catch{}}duplicateWidget(t){let e=Ht.create(),i=t.gridstackNode,s={w:i.w,h:i.h,id:e,selector:i.selector,input:{widgetProperties:{type:i.input.widgetProperties.type,uuid:e,config:rt(i.input.widgetProperties.config)}}},o=this._gridstack();o.grid.willItFit(s)?o.grid.addWidget(s):(s.h=2,s.w=1,o.grid.willItFit(s)?o.grid.addWidget(s):this._app.sendSnackbarNotification("Duplication failed: Insufficient space on the dashboard. Please reorganize to free up space.",0))}deleteWidget(t){let e=t.gridstackNode;switch(this._gridstack().grid.removeWidget(t),e.selector){case"widget-numeric-chart":case"widget-windtrends-chart":{(this._dataset.list()?.filter(o=>o.uuid===e.id||o.uuid?.startsWith(`${e.id}-`))||[]).forEach(o=>this._dataset.remove(o.uuid));break}}}nextDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToNextDashboard()}previousDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToPreviousDashboard()}editDashboard(){this.dashboard.isDashboardStatic.set(!1)}navigateToHelp(){this._router.navigate(["/help"])}ngOnDestroy(){let t=this._gridstack();if(t?.grid&&t.grid.destroy(!0),this._resizeObserver){try{this._resizeObserver.disconnect()}catch{}this._resizeObserver=void 0}this._pendingResizeRaf!==null&&(cancelAnimationFrame(this._pendingResizeRaf),this._pendingResizeRaf=null),this._uiEvent.removeHotkeyListener(this._boundHandleKeyDown)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["dashboard"]],viewQuery:function(e,i){e&1&&te(i._gridstack,ni,5),e&2&&ee()},hostBindings:function(e,i){e&1&&T("mouseup",function(){return i.onPointerRelease()},Rt)("touchend",function(){return i.onPointerRelease()},Rt)},decls:16,vars:5,consts:[["grid",""],["kipGestures","",3,"swipeup","swipedown","press","resize","mode","enableDoubleTap","options"],["empty-content","",1,"dashboard-empty-state-container"],[1,"dashboard-empty-state-action"],[1,"empty-state-icon"],[1,"empty-state-help"],["mat-button","",1,"empty-state-help-button",3,"click"],[1,"edit-layout-close-icon"],[3,"activePage","dashboards"],[1,"empty-state-text"],[1,"touch-icon"],["mat-flat-button","",1,"empty-state-button",3,"click"],["mat-fab","",1,"cancel",2,"margin-right","10px",3,"click"],["mat-fab","",1,"save",3,"click"]],template:function(e,i){if(e&1){let s=A();_(0,"gridstack",1,0),T("swipeup",function(){return R(s),k(i.previousDashboard())})("swipedown",function(){return R(s),k(i.nextDashboard())})("press",function(n){return R(s),k(i.addNewWidget(n))})("resize",function(){return R(s),k(i.resizeGridColumns())},Ut),_(2,"div",2)(3,"div",3)(4,"mat-icon",4),b(5,"dashboard"),y(),K(6,ai,6,0)(7,di,6,0),y(),_(8,"div")(9,"div",5)(10,"button",6),T("click",function(){return R(s),k(i.navigateToHelp())}),_(11,"mat-icon"),b(12,"help"),y(),b(13," Get Help "),y()()()()(),K(14,li,7,0,"div",7)(15,hi,1,2,"dashboard-scroller",8)}e&2&&(N("mode","dashboard")("enableDoubleTap",!1)("options",i.gridOptions()),H(6),J(i.dashboard.isDashboardStatic()?7:6),H(8),J(i.dashboard.isDashboardStatic()?15:14))},dependencies:[ot,Be,ct,ht,me,fe,pe,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;height:100%;width:100%;overflow:hidden}.grid-stack[_ngcontent-%COMP%]{width:100%;height:100%;box-sizing:border-box;position:relative}.edit-layout-close-icon[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;cursor:pointer;z-index:100}.cancel[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary);--mat-fab-foreground-color: var(--mat-sys-background)}.save[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary-fixed);--mat-fab-foreground-color: var(--mat-sys-background)}.dashboard-empty-state-container[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:space-around;padding:1.5rem;text-align:center;box-sizing:border-box;overflow:hidden;pointer-events:auto}@media (orientation: landscape) and (max-height: 420px){.dashboard-empty-state-container[_ngcontent-%COMP%]{padding:.75rem}.empty-state-icon[_ngcontent-%COMP%]{font-size:3.25rem;width:3.25rem;height:3.25rem}}.dashboard-empty-state-action[_ngcontent-%COMP%]{max-width:500px;color:var(--mat-sys-outline-variant)}.dashboard-empty-state-action[_ngcontent-%COMP%] .touch-icon[_ngcontent-%COMP%]{font-size:2rem;width:2rem;height:2rem;color:var(--mat-sys-outline-variant);margin-top:.5rem;animation:_ngcontent-%COMP%_bounce 2s infinite}.empty-state-icon[_ngcontent-%COMP%]{font-size:4rem;width:4rem;height:4rem;color:var(--mat-sys-outline-variant);margin-bottom:1rem}.empty-state-button[_ngcontent-%COMP%]{--mat-button-filled-label-text-color: var(--kip-widget-card-background-color);--mat-button-filled-container-color: var(--mat-sys-outline-variant);--mat-button-filled-hover-state-layer-opacity: .7;--mat-button-filled-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-help-button[_ngcontent-%COMP%]{--mat-button-text-label-text-color: var(--mat-sys-outline-variant);--mat-button-text-hover-state-layer-opacity: .7;--mat-button-text-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-text[_ngcontent-%COMP%]{color:var(--mat-sys-outline-variant);font-style:italic}@keyframes _ngcontent-%COMP%_bounce{0%,20%,50%,80%,to{transform:translateY(0)}40%{transform:translateY(-10px)}60%{transform:translateY(-5px)}}"]})}return a})();export{W as a,Ze as b,Ss as c,$ as d,Lt as e,At as f,ti as g,Wr as h};
@@ -1,4 +1,4 @@
1
- import"./chunk-F5X5MWHG.js";import{L as vt,U as bi,a as ot,c as gi,e as ui,f as _i,h as fi}from"./chunk-QVCMARCU.js";import{b as yi}from"./chunk-AB255PKD.js";import{a as Ee,b as mi,c as pi}from"./chunk-PKKBBIJK.js";import{a as Si}from"./chunk-D2CYLQZF.js";import{f as Te,i as at,n as hi}from"./chunk-HIADZ4BV.js";import{a as vi}from"./chunk-QZJKBIMY.js";import{b as z}from"./chunk-GMHL2FBP.js";import{a as de}from"./chunk-OQULS6SV.js";import{A as ke,B as nt,c as Jt,d as Je,k as ni,r as re,s as ci,y as le}from"./chunk-QLTN6G6E.js";import{A as j,D as et,G as tt,J as se,K as li,L as di,M as K,N as it,d as ft,h as Ht,i as Xt,j as qt,k as Ke,l as jt,m as B,n as $e,o as Me,p as ai,q as oi,s as X,t as q,v as si,w as ae,y as ri,z as oe}from"./chunk-XDPHEQEO.js";import{b as ei,f as ti,g as ii}from"./chunk-SZ2GUIT5.js";import{$b as Bt,Ab as I,Bb as A,Db as ie,Dc as zt,Dd as Zt,E as Tt,Eb as ye,F as Ae,Fa as m,Fb as T,Fd as ge,Ga as Pt,Gb as Xe,Hb as U,Ia as Re,Jb as he,K as Et,Kb as r,La as Nt,Lb as De,Ld as Ye,Mb as Ut,Nb as ut,Nc as Se,Nd as we,Oa as x,Ob as _t,Oc as je,Pa as $,Pb as v,Qa as F,Qb as y,Qd as bt,Rb as S,Sa as Be,Sd as Yt,Td as Pe,Ua as Vt,Ud as xe,V as pt,Wa as E,Wd as $t,Xa as be,Xb as N,Xc as Kt,Xd as H,Yb as Q,_b as Wt,ab as L,ba as Ue,bb as C,cb as w,da as Y,db as ze,ea as R,eb as Ot,f as Fe,fb as ee,fd as Ge,g as Le,ga as c,gb as te,hb as h,hc as qe,ib as a,j as ce,ja as p,jb as s,ka as g,kb as u,kc as ne,kd as Qe,la as We,lb as He,mb as gt,mc as Z,md as Ce,nb as Ft,nc as W,o as kt,oa as It,pa as At,pc as M,pd as Ze,qc as D,ra as _e,rb as P,sb as Lt,tb as b,ua as fe,va as Rt,vb as k,wa as G,wb as me,wd as pe,xa as Dt,xb as V,xd as Gt,yb as ve,zb as O,zd as Qt}from"./chunk-OB3QLUH6.js";var Bi=(n,f)=>f.key,zi=(n,f)=>f.measure;function Hi(n,f){if(n&1&&(a(0,"mat-option",6),r(1),s()),n&2){let e=f.$implicit;h("value",e.measure),m(),De(e.description)}}function Xi(n,f){if(n&1&&(a(0,"mat-form-field")(1,"mat-label"),r(2),s(),a(3,"mat-select",5),ee(4,Hi,2,2,"mat-option",6,zi),s()()),n&2){let e=f.$implicit,i=k();m(2),De(e.key),m(),h("placeholder",e.key)("formControlName",e.key),m(),te(i.groupUnits[e.key])}}var Ci=(()=>{class n{units=c(pi);appSettingsService=c(B);appService=c(z);unitsFormGroup=new si({});groupUnits=[];ngOnInit(){let e=this.appSettingsService.getDefaultUnits(),i=this.units.getConversions();for(let t of i){if(t.group==="Position")continue;let o=[];for(let d of t.units)o.push(d);this.groupUnits[t.group]=o,this.unitsFormGroup.addControl(t.group,new ri(e[t.group]))}this.unitsFormGroup.updateValueAndValidity()}submitConfig(){this.appSettingsService.setDefaultUnits(this.unitsFormGroup.value),this.appService.sendSnackbarNotification("Configuration saved",3e3,!1)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(i,t){i&1&&(a(0,"form",0),b("ngSubmit",function(){return t.submitConfig()}),a(1,"p"),r(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),s(),a(3,"div",1),ee(4,Xi,6,3,"mat-form-field",null,Bi),Wt(6,"keyvalue"),s(),a(7,"div",2),u(8,"mat-divider",3),a(9,"button",4),r(10,"Save"),s()()()),i&2&&(h("formGroup",t.unitsFormGroup),m(4),te(Bt(6,2,t.unitsFormGroup.controls)),m(5),h("disabled",!t.unitsFormGroup.valid))},dependencies:[K,j,X,q,se,it,et,tt,le,re,Ee,Te,de,H,zt],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var yt=new R("CdkAccordion"),wi=(()=>{class n{_stateChanges=new ce;_openCloseAllActions=new ce;id=c(pe).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",M]},exportAs:["cdkAccordion"],features:[N([{provide:yt,useExisting:n}]),fe]})}return n})(),xi=(()=>{class n{accordion=c(yt,{optional:!0,skipSelf:!0});_changeDetectorRef=c(W);_expansionDispatcher=c(at);_openCloseAllSubscription=Le.EMPTY;closed=new E;opened=new E;destroyed=new E;expandedChange=new E;id=c(pe).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let i=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,i)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}_expanded=!1;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=_e(!1);_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,i)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===i&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e)})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",M],disabled:[2,"disabled","disabled",M]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[N([{provide:yt,useValue:void 0}])]})}return n})(),Mi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({})}return n})();var Ki=["body"],Gi=["bodyWrapper"],Qi=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],Zi=["mat-expansion-panel-header","*","mat-action-row"];function Ji(n,f){}var Yi=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],$i=["mat-panel-title","mat-panel-description","*"];function en(n,f){n&1&&(He(0,"span",1),We(),He(1,"svg",2),Ft(2,"path",3),gt()())}var St=new R("MAT_ACCORDION"),ki=new R("MAT_EXPANSION_PANEL"),tn=(()=>{class n{_template=c(Pt);_expansionPanel=c(ki,{optional:!0});constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Ti=new R("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),Ne=(()=>{class n extends xi{_viewContainerRef=c(Nt);_animationsDisabled=we();_document=c(It);_ngZone=c(be);_elementRef=c(G);_renderer=c(Re);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_togglePosition;afterExpand=new E;afterCollapse=new E;_inputChanges=new ce;accordion=c(St,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=c(pe).getId("mat-expansion-panel-header-");constructor(){super();let e=c(Ti,{optional:!0});this._expansionDispatcher=c(at),e&&(this.hideToggle=e.hideToggle)}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":!1}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(pt(null),Ae(()=>this.expanded&&!this._portal),Et(1)).subscribe(()=>{this._portal=new ei(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){let e=this._document.activeElement,i=this._body.nativeElement;return e===i||i.contains(e)}return!1}_transitionEndListener=({target:e,propertyName:i})=>{e===this._bodyWrapper?.nativeElement&&i==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(i,t,o){if(i&1&&ve(o,tn,5),i&2){let d;I(d=A())&&(t._lazyContent=d.first)}},viewQuery:function(i,t){if(i&1&&(O(Ki,5),O(Gi,5)),i&2){let o;I(o=A())&&(t._body=o.first),I(o=A())&&(t._bodyWrapper=o.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(i,t){i&2&&U("mat-expanded",t.expanded)("mat-expansion-panel-spacing",t._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",M],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[N([{provide:St,useValue:void 0},{provide:ki,useExisting:n}]),Be,fe],ngContentSelectors:Zi,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(i,t){i&1&&(me(Qi),V(0),a(1,"div",2,0)(3,"div",3,1)(5,"div",4),V(6,1),Vt(7,Ji,0,0,"ng-template",5),s(),V(8,2),s()()),i&2&&(m(),L("inert",t.expanded?null:""),m(2),h("id",t.id),L("aria-labelledby",t._headerId),m(4),h("cdkPortalOutlet",t._portal))},dependencies:[ti],styles:[`.mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:var(--mat-expansion-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}
1
+ import"./chunk-F5X5MWHG.js";import{L as vt,U as bi,a as ot,c as gi,e as ui,f as _i,h as fi}from"./chunk-QVCMARCU.js";import{b as yi}from"./chunk-AB255PKD.js";import{a as Ee,b as mi,c as pi}from"./chunk-PKKBBIJK.js";import{a as Si}from"./chunk-D2CYLQZF.js";import{f as Te,i as at,n as hi}from"./chunk-HIADZ4BV.js";import{a as vi}from"./chunk-QZJKBIMY.js";import{b as z}from"./chunk-S7WGIMJE.js";import{a as de}from"./chunk-OQULS6SV.js";import{A as ke,B as nt,c as Jt,d as Je,k as ni,r as re,s as ci,y as le}from"./chunk-QLTN6G6E.js";import{A as j,D as et,G as tt,J as se,K as li,L as di,M as K,N as it,d as ft,h as Ht,i as Xt,j as qt,k as Ke,l as jt,m as B,n as $e,o as Me,p as ai,q as oi,s as X,t as q,v as si,w as ae,y as ri,z as oe}from"./chunk-XDPHEQEO.js";import{b as ei,f as ti,g as ii}from"./chunk-SZ2GUIT5.js";import{$b as Bt,Ab as I,Bb as A,Db as ie,Dc as zt,Dd as Zt,E as Tt,Eb as ye,F as Ae,Fa as m,Fb as T,Fd as ge,Ga as Pt,Gb as Xe,Hb as U,Ia as Re,Jb as he,K as Et,Kb as r,La as Nt,Lb as De,Ld as Ye,Mb as Ut,Nb as ut,Nc as Se,Nd as we,Oa as x,Ob as _t,Oc as je,Pa as $,Pb as v,Qa as F,Qb as y,Qd as bt,Rb as S,Sa as Be,Sd as Yt,Td as Pe,Ua as Vt,Ud as xe,V as pt,Wa as E,Wd as $t,Xa as be,Xb as N,Xc as Kt,Xd as H,Yb as Q,_b as Wt,ab as L,ba as Ue,bb as C,cb as w,da as Y,db as ze,ea as R,eb as Ot,f as Fe,fb as ee,fd as Ge,g as Le,ga as c,gb as te,hb as h,hc as qe,ib as a,j as ce,ja as p,jb as s,ka as g,kb as u,kc as ne,kd as Qe,la as We,lb as He,mb as gt,mc as Z,md as Ce,nb as Ft,nc as W,o as kt,oa as It,pa as At,pc as M,pd as Ze,qc as D,ra as _e,rb as P,sb as Lt,tb as b,ua as fe,va as Rt,vb as k,wa as G,wb as me,wd as pe,xa as Dt,xb as V,xd as Gt,yb as ve,zb as O,zd as Qt}from"./chunk-OB3QLUH6.js";var Bi=(n,f)=>f.key,zi=(n,f)=>f.measure;function Hi(n,f){if(n&1&&(a(0,"mat-option",6),r(1),s()),n&2){let e=f.$implicit;h("value",e.measure),m(),De(e.description)}}function Xi(n,f){if(n&1&&(a(0,"mat-form-field")(1,"mat-label"),r(2),s(),a(3,"mat-select",5),ee(4,Hi,2,2,"mat-option",6,zi),s()()),n&2){let e=f.$implicit,i=k();m(2),De(e.key),m(),h("placeholder",e.key)("formControlName",e.key),m(),te(i.groupUnits[e.key])}}var Ci=(()=>{class n{units=c(pi);appSettingsService=c(B);appService=c(z);unitsFormGroup=new si({});groupUnits=[];ngOnInit(){let e=this.appSettingsService.getDefaultUnits(),i=this.units.getConversions();for(let t of i){if(t.group==="Position")continue;let o=[];for(let d of t.units)o.push(d);this.groupUnits[t.group]=o,this.unitsFormGroup.addControl(t.group,new ri(e[t.group]))}this.unitsFormGroup.updateValueAndValidity()}submitConfig(){this.appSettingsService.setDefaultUnits(this.unitsFormGroup.value),this.appService.sendSnackbarNotification("Configuration saved",3e3,!1)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(i,t){i&1&&(a(0,"form",0),b("ngSubmit",function(){return t.submitConfig()}),a(1,"p"),r(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),s(),a(3,"div",1),ee(4,Xi,6,3,"mat-form-field",null,Bi),Wt(6,"keyvalue"),s(),a(7,"div",2),u(8,"mat-divider",3),a(9,"button",4),r(10,"Save"),s()()()),i&2&&(h("formGroup",t.unitsFormGroup),m(4),te(Bt(6,2,t.unitsFormGroup.controls)),m(5),h("disabled",!t.unitsFormGroup.valid))},dependencies:[K,j,X,q,se,it,et,tt,le,re,Ee,Te,de,H,zt],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var yt=new R("CdkAccordion"),wi=(()=>{class n{_stateChanges=new ce;_openCloseAllActions=new ce;id=c(pe).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",M]},exportAs:["cdkAccordion"],features:[N([{provide:yt,useExisting:n}]),fe]})}return n})(),xi=(()=>{class n{accordion=c(yt,{optional:!0,skipSelf:!0});_changeDetectorRef=c(W);_expansionDispatcher=c(at);_openCloseAllSubscription=Le.EMPTY;closed=new E;opened=new E;destroyed=new E;expandedChange=new E;id=c(pe).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let i=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,i)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}_expanded=!1;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=_e(!1);_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,i)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===i&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e)})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",M],disabled:[2,"disabled","disabled",M]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[N([{provide:yt,useValue:void 0}])]})}return n})(),Mi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({})}return n})();var Ki=["body"],Gi=["bodyWrapper"],Qi=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],Zi=["mat-expansion-panel-header","*","mat-action-row"];function Ji(n,f){}var Yi=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],$i=["mat-panel-title","mat-panel-description","*"];function en(n,f){n&1&&(He(0,"span",1),We(),He(1,"svg",2),Ft(2,"path",3),gt()())}var St=new R("MAT_ACCORDION"),ki=new R("MAT_EXPANSION_PANEL"),tn=(()=>{class n{_template=c(Pt);_expansionPanel=c(ki,{optional:!0});constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Ti=new R("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),Ne=(()=>{class n extends xi{_viewContainerRef=c(Nt);_animationsDisabled=we();_document=c(It);_ngZone=c(be);_elementRef=c(G);_renderer=c(Re);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_togglePosition;afterExpand=new E;afterCollapse=new E;_inputChanges=new ce;accordion=c(St,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=c(pe).getId("mat-expansion-panel-header-");constructor(){super();let e=c(Ti,{optional:!0});this._expansionDispatcher=c(at),e&&(this.hideToggle=e.hideToggle)}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":!1}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(pt(null),Ae(()=>this.expanded&&!this._portal),Et(1)).subscribe(()=>{this._portal=new ei(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){let e=this._document.activeElement,i=this._body.nativeElement;return e===i||i.contains(e)}return!1}_transitionEndListener=({target:e,propertyName:i})=>{e===this._bodyWrapper?.nativeElement&&i==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(i,t,o){if(i&1&&ve(o,tn,5),i&2){let d;I(d=A())&&(t._lazyContent=d.first)}},viewQuery:function(i,t){if(i&1&&(O(Ki,5),O(Gi,5)),i&2){let o;I(o=A())&&(t._body=o.first),I(o=A())&&(t._bodyWrapper=o.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(i,t){i&2&&U("mat-expanded",t.expanded)("mat-expansion-panel-spacing",t._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",M],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[N([{provide:St,useValue:void 0},{provide:ki,useExisting:n}]),Be,fe],ngContentSelectors:Zi,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(i,t){i&1&&(me(Qi),V(0),a(1,"div",2,0)(3,"div",3,1)(5,"div",4),V(6,1),Vt(7,Ji,0,0,"ng-template",5),s(),V(8,2),s()()),i&2&&(m(),L("inert",t.expanded?null:""),m(2),h("id",t.id),L("aria-labelledby",t._headerId),m(4),h("cdkPortalOutlet",t._portal))},dependencies:[ti],styles:[`.mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:var(--mat-expansion-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}
2
2
  `],encapsulation:2,changeDetection:0})}return n})();var Ve=(()=>{class n{panel=c(Ne,{host:!0});_element=c(G);_focusMonitor=c(Qe);_changeDetectorRef=c(W);_parentChangeSubscription=Le.EMPTY;constructor(){c(Ce).load(xe);let e=this.panel,i=c(Ti,{optional:!0}),t=c(new qe("tabindex"),{optional:!0}),o=e.accordion?e.accordion._stateChanges.pipe(Ae(d=>!!(d.hideToggle||d.togglePosition))):kt;this.tabIndex=parseInt(t||"")||0,this._parentChangeSubscription=Tt(e.opened,e.closed,o,e._inputChanges.pipe(Ae(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),e.closed.pipe(Ae(()=>e._containsFocus())).subscribe(()=>this._focusMonitor.focusVia(this._element,"program")),i&&(this.expandedHeight=i.expandedHeight,this.collapsedHeight=i.collapsedHeight)}expandedHeight;collapsedHeight;tabIndex=0;get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){let e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}_keydown(e){switch(e.keyCode){case 32:case 13:Gt(e)||(e.preventDefault(),this._toggle());break;default:this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e);return}}focus(e,i){e?this._focusMonitor.focusVia(this._element,e,i):this._element.nativeElement.focus(i)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(e=>{e&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:13,hostBindings:function(i,t){i&1&&b("click",function(){return t._toggle()})("keydown",function(d){return t._keydown(d)}),i&2&&(L("id",t.panel._headerId)("tabindex",t.disabled?-1:t.tabIndex)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),Xe("height",t._getHeaderHeight()),U("mat-expanded",t._isExpanded())("mat-expansion-toggle-indicator-after",t._getTogglePosition()==="after")("mat-expansion-toggle-indicator-before",t._getTogglePosition()==="before"))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight",tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:D(e)]},ngContentSelectors:$i,decls:5,vars:3,consts:[[1,"mat-content"],[1,"mat-expansion-indicator"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 -960 960 960","aria-hidden","true","focusable","false"],["d","M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"]],template:function(i,t){i&1&&(me(Yi),He(0,"span",0),V(1),V(2,1),V(3,2),gt(),C(4,en,3,0,"span",1)),i&2&&(U("mat-content-hide-toggle",!t._showToggle()),m(4),w(t._showToggle()?4:-1))},styles:[`.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header::before{border-radius:inherit}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}
3
3
  `],encapsulation:2,changeDetection:0})}return n})(),rt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["mat-panel-description"]],hostAttrs:[1,"mat-expansion-panel-header-description"]})}return n})(),lt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]})}return n})(),dt=(()=>{class n extends wi{_keyManager;_ownHeaders=new Dt;_headers;hideToggle=!1;displayMode="default";togglePosition="after";ngAfterContentInit(){this._headers.changes.pipe(pt(this._headers)).subscribe(e=>{this._ownHeaders.reset(e.filter(i=>i.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new Qt(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(e){this._keyManager.onKeydown(e)}_handleHeaderFocus(e){this._keyManager.updateActiveItem(e)}ngOnDestroy(){super.ngOnDestroy(),this._keyManager?.destroy(),this._ownHeaders.destroy()}static \u0275fac=(()=>{let e;return function(t){return(e||(e=Rt(n)))(t||n)}})();static \u0275dir=F({type:n,selectors:[["mat-accordion"]],contentQueries:function(i,t,o){if(i&1&&ve(o,Ve,5),i&2){let d;I(d=A())&&(t._headers=d)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(i,t){i&2&&U("mat-accordion-multi",t.multi)},inputs:{hideToggle:[2,"hideToggle","hideToggle",M],displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[N([{provide:St,useExisting:n}]),Be]})}return n})(),ct=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({imports:[ge,Mi,ii]})}return n})();var nn=["switch"],an=["*"];function on(n,f){n&1&&(a(0,"span",10),We(),a(1,"svg",12),u(2,"path",13),s(),a(3,"svg",14),u(4,"path",15),s()())}var sn=new R("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),mt=class{source;checked;constructor(f,e){this.source=f,this.checked=e}},ue=(()=>{class n{_elementRef=c(G);_focusMonitor=c(Qe);_changeDetectorRef=c(W);defaults=c(sn);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new mt(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=we();_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new E;toggleChange=new E;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){c(Ce).load(xe);let e=c(new qe("tabindex"),{optional:!0}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=c(pe).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new mt(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(i,t){if(i&1&&O(nn,5),i&2){let o;I(o=A())&&(t._switchElement=o.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,t){i&2&&(Lt("id",t.id),L("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),he(t.color?"mat-"+t.color:""),U("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",M],color:"color",disabled:[2,"disabled","disabled",M],disableRipple:[2,"disableRipple","disableRipple",M],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:D(e)],checked:[2,"checked","checked",M],hideIcon:[2,"hideIcon","hideIcon",M],disabledInteractive:[2,"disabledInteractive","disabledInteractive",M]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[N([{provide:$e,useExisting:Ue(()=>n),multi:!0},{provide:ai,useExisting:n,multi:!0}]),fe],ngContentSelectors:an,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,t){if(i&1){let o=P();me(),a(0,"div",1)(1,"button",2,0),b("click",function(){return p(o),g(t._handleClick())}),u(3,"span",3),a(4,"span",4)(5,"span",5)(6,"span",6),u(7,"span",7),s(),a(8,"span",8),u(9,"span",9),s(),C(10,on,5,0,"span",10),s()()(),a(11,"label",11),b("click",function(l){return p(o),g(l.stopPropagation())}),V(12),s()()}if(i&2){let o=T(2);h("labelPosition",t.labelPosition),m(),U("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),h("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),L("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),m(8),h("matRippleTrigger",o)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",!0),m(),w(t.hideIcon?-1:10),m(),h("for",t.buttonId),L("id",t._labelId)}},dependencies:[Pe,hi],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}
4
4
  `],encapsulation:2,changeDetection:0})}return n})(),ht=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({imports:[ue,ge,ge]})}return n})();var rn=["notificationsForm"],ln=["statePanel"],dn=["soundPanel"];function cn(n,f){n&1&&(a(0,"mat-panel-description"),r(1," Filter Notifications sidenav items "),s())}function mn(n,f){n&1&&(a(0,"mat-panel-description"),r(1," Override server defined methods "),s())}var Ai=(()=>{class n{app=c(z);settings=c(B);_responsive=c(Ze);isPhonePortrait;notificationsForm=ne("notificationsForm");statePanel=ne("statePanel");soundPanel=ne("soundPanel");notificationConfig;notificationDisabledExpandPanel=!1;constructor(){this.isPhonePortrait=je(this._responsive.observe(Ye.HandsetPortrait)),this.notificationConfig=ft(this.settings.getNotificationConfig())}saveAllSettings(){this.settings.setNotificationConfig(ft(this.notificationConfig)),this.notificationsForm().form.markAsPristine(),this.app.sendSnackbarNotification("Configuration saved",3e3,!1)}togglePanel(e){e.checked&&(this.notificationDisabledExpandPanel=!1,this.statePanel().close(),this.soundPanel().close())}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-notifications"]],viewQuery:function(i,t){i&1&&(ie(t.notificationsForm,rn,5),ie(t.statePanel,ln,5),ie(t.soundPanel,dn,5)),i&2&&ye(3)},decls:64,vars:17,consts:[["notificationsForm","ngForm"],["statePanel",""],["soundPanel",""],["id","notificationSetting",3,"ngSubmit"],["name","disableNotifications",3,"ngModelChange","ngModel"],["name","disableNotifications",3,"ngModelChange","change","ngModel"],[1,"notification-accordion"],[3,"disabled"],["name","showNormalState",3,"ngModelChange","ngModel"],["name","showNominalState",3,"ngModelChange","ngModel"],["name","muteAlert",3,"ngModelChange","ngModel","disabled"],["name","muteWarn",3,"ngModelChange","ngModel","disabled"],["name","muteAlarm",3,"ngModelChange","ngModel","disabled"],["name","muteEmergency",3,"ngModelChange","ngModel","disabled"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"]],template:function(i,t){if(i&1){let o=P();a(0,"form",3,0),b("ngSubmit",function(){return p(o),g(t.saveAllSettings())}),a(2,"p"),r(3,"Configure audio and visual notification settings and stay informed of critical events."),s(),a(4,"mat-slide-toggle",4),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.disableSound,l)||(t.notificationConfig.sound.disableSound=l),g(l)}),r(5," Disable audio "),s(),u(6,"br")(7,"br"),a(8,"mat-slide-toggle",5),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.disableNotifications,l)||(t.notificationConfig.disableNotifications=l),g(l)}),b("change",function(l){return p(o),g(t.togglePanel(l))}),r(9," Disable Notifications "),s(),u(10,"br")(11,"br"),a(12,"div",6)(13,"mat-accordion")(14,"mat-expansion-panel",7,1)(16,"mat-expansion-panel-header")(17,"mat-panel-title"),r(18," States "),s(),C(19,cn,2,0,"mat-panel-description"),s(),a(20,"mat-checkbox",8),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.devices.showNormalState,l)||(t.notificationConfig.devices.showNormalState=l),g(l)}),r(21," Show "),a(22,"b"),r(23,"Normal"),s(),r(24," state "),s(),u(25,"br"),a(26,"mat-checkbox",9),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.devices.showNominalState,l)||(t.notificationConfig.devices.showNominalState=l),g(l)}),r(27," Show "),a(28,"b"),r(29,"Nominal"),s(),r(30," state "),s()(),a(31,"mat-expansion-panel",7,2)(33,"mat-expansion-panel-header")(34,"mat-panel-title"),r(35," Audio "),s(),C(36,mn,2,0,"mat-panel-description"),s(),a(37,"mat-checkbox",10),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteAlert,l)||(t.notificationConfig.sound.muteAlert=l),g(l)}),r(38," Mute "),a(39,"b"),r(40,"all Alert"),s(),r(41," state "),s(),u(42,"br"),a(43,"mat-checkbox",11),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteWarn,l)||(t.notificationConfig.sound.muteWarn=l),g(l)}),r(44," Mute "),a(45,"b"),r(46,"all Warn"),s(),r(47," state "),s(),u(48,"br"),a(49,"mat-checkbox",12),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteAlarm,l)||(t.notificationConfig.sound.muteAlarm=l),g(l)}),r(50," Mute "),a(51,"b"),r(52,"all Alarm"),s(),r(53," state "),s(),u(54,"br"),a(55,"mat-checkbox",13),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteEmergency,l)||(t.notificationConfig.sound.muteEmergency=l),g(l)}),r(56," Mute "),a(57,"b"),r(58,"all Emergency"),s(),r(59," state "),s()()()(),a(60,"div",14),u(61,"mat-divider",15),a(62,"button",16),r(63,"Save"),s()()()}if(i&2){let o=T(1);m(4),v("ngModel",t.notificationConfig.sound.disableSound),m(4),v("ngModel",t.notificationConfig.disableNotifications),m(6),h("disabled",t.notificationConfig.disableNotifications),m(5),w(t.isPhonePortrait().matches?-1:19),m(),v("ngModel",t.notificationConfig.devices.showNormalState),m(6),v("ngModel",t.notificationConfig.devices.showNominalState),m(5),h("disabled",t.notificationConfig.disableNotifications),m(5),w(t.isPhonePortrait().matches?-1:36),m(),v("ngModel",t.notificationConfig.sound.muteAlert),h("disabled",t.notificationConfig.sound.disableSound),m(6),v("ngModel",t.notificationConfig.sound.muteWarn),h("disabled",t.notificationConfig.sound.disableSound),m(6),v("ngModel",t.notificationConfig.sound.muteAlarm),h("disabled",t.notificationConfig.sound.disableSound),m(6),v("ngModel",t.notificationConfig.sound.muteEmergency),h("disabled",t.notificationConfig.sound.disableSound),m(7),h("disabled",!o.form.dirty)}},dependencies:[K,j,X,q,oe,ae,ot,ht,ue,ct,dt,Ne,Ve,lt,rt,de,H],styles:[".notification-accordion[_ngcontent-%COMP%]{margin-left:25px}"]})}return n})();vt.register(...bi);var Ri=vt;var hn=["activityGraph"],Ct=()=>({standalone:!1}),pn=()=>({standalone:!0}),Di=(()=>{class n{dialog=c(ni);appSettingsService=c(B);app=c(z);DataService=c(Je);signalKConnectionService=c(Xt);deltaService=c(Jt);connectionStateMachine=c(Ht);auth=c(Ke);destroyRef=c(At);canvasService=c(fi);activityGraph=ne("activityGraph");connectionConfig;isConnecting=!1;authToken;endpointServiceStatus;streamStatus;_chart=null;textColor;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.auth.authToken$.pipe(Se(this.destroyRef)).subscribe(e=>{e?this.authToken=e:this.authToken=null}),this.signalKConnectionService.getServiceEndpointStatusAsO().pipe(Se(this.destroyRef)).subscribe(e=>{this.endpointServiceStatus=e}),this.deltaService.getDataStreamStatusAsO().pipe(Se(this.destroyRef)).subscribe(e=>{this.streamStatus=e})}ngAfterViewInit(){this.textColor=window.getComputedStyle(this.activityGraph().nativeElement).color,this._chart?.destroy(),this.startChart(),this.DataService.getSignalkDeltaUpdateStatistics().pipe(Se(this.destroyRef)).subscribe(e=>{this._chart.data.datasets[0].data.push({x:e.timestamp,y:e.value}),this._chart.data.datasets[0].data.length>10&&this._chart.data.datasets[0].data.shift(),this._chart?.update("none")})}openUserCredentialModal(e){this.dialog.open(vi,{data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().pipe(Se(this.destroyRef)).subscribe(t=>{t&&(this.connectionConfig.loginName=t.user,this.connectionConfig.loginPassword=t.password,this.connectToServer())})}connectToServer(){return Fe(this,null,function*(){if(this.connectionConfig.useSharedConfig&&(!this.connectionConfig.loginName||!this.connectionConfig.loginPassword)){this.openUserCredentialModal("Credentials required");return}this.isConnecting=!0;try{console.log("[Settings-SignalK] Validating Signal K server before connecting..."),yield this.signalKConnectionService.validateSignalKUrl(this.connectionConfig.signalKUrl),console.log("[Settings-SignalK] Validation successful - proceeding with connection"),this.appSettingsService.setConnectionConfig(this.connectionConfig),this.connectionStateMachine.shutdown("Configuration changed - restarting app"),this.authToken&&!this.connectionConfig.useSharedConfig&&!this.authToken.isDeviceAccessToken&&this.auth.deleteToken(),window.__KIP_TEST__||location.reload()}catch(e){this.isConnecting=!1;let i=e?.message||"Unknown validation error";console.error("[Settings-SignalK] Server validation failed:",i),this.app.sendSnackbarNotification(`Connection failed: ${i}`,8e3,!1)}})}startChart(){this._chart=new Ri(this.activityGraph().nativeElement.getContext("2d"),{type:"line",data:{datasets:[{data:[],fill:!0,borderColor:this.textColor}]},options:{maintainAspectRatio:!1,animation:!1,parsing:!1,scales:{x:{type:"time",display:!0,time:{unit:"minute",minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'mm ss"',millisecond:"SSS"}},position:"bottom",ticks:{display:!1},grid:{display:!0}},y:{beginAtZero:!0,type:"linear",position:"right",title:{text:"Delta / Sec",display:!0}}},plugins:{legend:{display:!1,labels:{color:this.textColor}}}}})}useSharedConfigToggleClick(e){if(e.checked){let i=this.signalKConnectionService.serverVersion$.getValue();if(!qt(i,"1.46.2",">=")){this.app.sendSnackbarNotification("Configuration sharing requires Signal K version 1.46.2 or better",0),this.connectionConfig.useSharedConfig=!1;return}this.openUserCredentialModal(null)}}ngOnDestroy(){this._chart?.destroy();let e=this.activityGraph?.()?.nativeElement;this.canvasService.releaseCanvas(e,{clear:!0,removeFromDom:!0})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-signalk"]],viewQuery:function(i,t){i&1&&ie(t.activityGraph,hn,5),i&2&&ye()},decls:40,vars:22,consts:[["connectionForm","ngForm"],["useSharedConfigToggle",""],["activityGraph",""],["name","connectionForm",3,"ngSubmit"],[1,"connect-table"],[1,"url-cell"],[1,"connectUrlInput"],["type","url","matInput","","placeholder","Ex. http://192.168.0.1:3000","name","signalKURL","required","","pattern","https?://.+",3,"ngModelChange","ngModel","ngModelOptions"],[1,"connect-cell"],["mat-flat-button","","type","submit",1,"connect-btn",3,"disabled"],["colspan","2"],["name","useSharedConfigToggle","matTooltip","Activating authentication enables Signal K's user storage feature to save KIP configuration on the server. When authentication is not activated, KIP stores it's configuration locally in the Browser.",3,"ngModelChange","change","ngModel","ngModelOptions","disabled"],["mat-flat-button","","type","button","matTooltip","Configure Signal K user authentication credentials. The user must be a valid pre existing Signal K server user. It is strongly recommended not to use the default Signal K Admin user.",1,"credentials-btn",3,"click","disabled"],["name","signalKSubscribeAll",3,"ngModelChange","ngModel","ngModelOptions"],["name","isProxyEnabled",3,"ngModelChange","ngModel","ngModelOptions"],[1,"activity-container"],[1,"activity-graph-container"],[1,"activity-graph"],[1,"info-container"]],template:function(i,t){if(i&1){let o=P();a(0,"form",3,0),b("ngSubmit",function(){return p(o),g(t.connectToServer())}),u(2,"br"),a(3,"table",4)(4,"tr",4)(5,"td",5)(6,"mat-form-field",6)(7,"mat-label"),r(8,"Signal K URL"),s(),a(9,"input",7),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.signalKUrl,l)||(t.connectionConfig.signalKUrl=l),g(l)}),s(),a(10,"mat-error"),r(11,' Valid URL is required. Ex. "https://demo.signalK.org" or "http://my.server.com:3000" '),s()()(),a(12,"td",8)(13,"button",9),r(14),s()()(),a(15,"tr",4)(16,"td",10)(17,"mat-slide-toggle",11,1),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.useSharedConfig,l)||(t.connectionConfig.useSharedConfig=l),g(l)}),b("change",function(l){return p(o),g(t.useSharedConfigToggleClick(l))}),r(19," Login to server "),s(),a(20,"button",12),b("click",function(){return p(o),g(t.openUserCredentialModal(null))}),r(21," Set Credential "),s(),u(22,"br"),a(23,"mat-checkbox",13),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.signalKSubscribeAll,l)||(t.connectionConfig.signalKSubscribeAll=l),g(l)}),r(24,"Subscribe to remote sources messages such as AIS and DSC targets. "),a(25,"i"),r(26,"Warning: this maybe generate heavy traffic."),s()()()(),a(27,"tr",4)(28,"td",10)(29,"mat-checkbox",14),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.proxyEnabled,l)||(t.connectionConfig.proxyEnabled=l),g(l)}),r(30,"Signal K server is behind a Proxy"),s()()()()(),a(31,"div",15)(32,"div",16),u(33,"canvas",17,2),s(),a(35,"div",18)(36,"pre"),r(37),u(38,"br"),r(39),s()()()}if(i&2){let o=T(1);m(9),v("ngModel",t.connectionConfig.signalKUrl),h("ngModelOptions",Q(18,Ct)),m(4),h("disabled",!o.form.valid||t.isConnecting),m(),Ut(" ",t.isConnecting?"Validating...":"Connect"," "),m(3),v("ngModel",t.connectionConfig.useSharedConfig),h("ngModelOptions",Q(19,pn))("disabled",!t.connectionConfig.signalKUrl),m(3),h("disabled",!t.connectionConfig.useSharedConfig),m(3),v("ngModel",t.connectionConfig.signalKSubscribeAll),h("ngModelOptions",Q(20,Ct)),m(6),v("ngModel",t.connectionConfig.proxyEnabled),h("ngModelOptions",Q(21,Ct)),m(8),_t("KIP: ",t.app.appVersion(),`
@@ -1 +1 @@
1
- import{a as c}from"./chunk-QZJKBIMY.js";import{b as g}from"./chunk-GMHL2FBP.js";import"./chunk-OQULS6SV.js";import{k as l}from"./chunk-QLTN6G6E.js";import{k as a,m as r}from"./chunk-XDPHEQEO.js";import"./chunk-SZ2GUIT5.js";import{Oa as s,ga as t}from"./chunk-OB3QLUH6.js";var v=(()=>{class o{dialog=t(l);auth=t(a);appService=t(g);appSettingsService=t(r);connectionConfig=null;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option")}openUserCredentialModal(e){this.dialog.open(c,{disableClose:!0,data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().subscribe(i=>{i===void 0||!i||(this.connectionConfig.loginName=i.user,this.connectionConfig.loginPassword=i.password,this.appSettingsService.setConnectionConfig(this.connectionConfig),this.serverLogin())})}serverLogin(e){this.auth.login({usr:this.connectionConfig.loginName,pwd:this.connectionConfig.loginPassword,newUrl:e}).then(()=>{this.appSettingsService.reloadApp()}).catch(n=>{n.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==404?(this.appService.sendSnackbarNotification("Sign in failed: Login API not found at URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==0?(this.appService.sendSnackbarNotification("Sign in failed: Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+n.message)):(this.appService.sendSnackbarNotification("Unknown authentication failure: "+JSON.stringify(n),5e3,!1),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(n)))})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=s({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,i){},encapsulation:2})}return o})();export{v as WidgetLoginComponent};
1
+ import{a as c}from"./chunk-QZJKBIMY.js";import{b as g}from"./chunk-S7WGIMJE.js";import"./chunk-OQULS6SV.js";import{k as l}from"./chunk-QLTN6G6E.js";import{k as a,m as r}from"./chunk-XDPHEQEO.js";import"./chunk-SZ2GUIT5.js";import{Oa as s,ga as t}from"./chunk-OB3QLUH6.js";var v=(()=>{class o{dialog=t(l);auth=t(a);appService=t(g);appSettingsService=t(r);connectionConfig=null;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option")}openUserCredentialModal(e){this.dialog.open(c,{disableClose:!0,data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().subscribe(i=>{i===void 0||!i||(this.connectionConfig.loginName=i.user,this.connectionConfig.loginPassword=i.password,this.appSettingsService.setConnectionConfig(this.connectionConfig),this.serverLogin())})}serverLogin(e){this.auth.login({usr:this.connectionConfig.loginName,pwd:this.connectionConfig.loginPassword,newUrl:e}).then(()=>{this.appSettingsService.reloadApp()}).catch(n=>{n.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==404?(this.appService.sendSnackbarNotification("Sign in failed: Login API not found at URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==0?(this.appService.sendSnackbarNotification("Sign in failed: Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+n.message)):(this.appService.sendSnackbarNotification("Unknown authentication failure: "+JSON.stringify(n),5e3,!1),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(n)))})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=s({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,i){},encapsulation:2})}return o})();export{v as WidgetLoginComponent};