@mxtommy/kip 4.0.8-beta.1 → 4.1.0-beta.2

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.
Files changed (47) hide show
  1. package/package.json +1 -1
  2. package/plugin/index.js +49 -2
  3. package/plugin/openApi.json +1 -1
  4. package/public/3rdpartylicenses.txt +26 -26
  5. package/public/assets/help-docs/chartplotter.md +5 -5
  6. package/public/chunk-2QCDSHYY.js +2 -0
  7. package/public/chunk-3VEP4A7I.js +52 -0
  8. package/public/chunk-4BN4AG6O.js +3 -0
  9. package/public/chunk-7EYNQTZR.js +1 -0
  10. package/public/chunk-AQ66AGUC.js +1 -0
  11. package/public/chunk-BRLXMYKY.js +3 -0
  12. package/public/{chunk-QLTN6G6E.js → chunk-CWBDCB4U.js} +1 -1
  13. package/public/{chunk-QZJKBIMY.js → chunk-D3OVXRDS.js} +1 -1
  14. package/public/{chunk-IJ22WXFB.js → chunk-GYERRI2M.js} +1 -1
  15. package/public/{chunk-OQULS6SV.js → chunk-JWT2WFAW.js} +1 -1
  16. package/public/{chunk-SLMCWOKC.js → chunk-K75NRIFB.js} +2 -2
  17. package/public/{chunk-QVCMARCU.js → chunk-KITN4REV.js} +1 -1
  18. package/public/{chunk-2DBQEP6W.js → chunk-KNBOI7TL.js} +1 -1
  19. package/public/{chunk-BMDGKBYM.js → chunk-L4NM3HUK.js} +26 -26
  20. package/public/{chunk-RYHOAWDD.js → chunk-MHCWCMEF.js} +1 -1
  21. package/public/chunk-MKKQCG3C.js +2 -0
  22. package/public/chunk-MVXIEN3D.js +1 -0
  23. package/public/chunk-P7WHH5EN.js +2 -0
  24. package/public/chunk-PR5JLJLD.js +15 -0
  25. package/public/chunk-QL3G7CWF.js +1 -0
  26. package/public/{chunk-HIADZ4BV.js → chunk-RVSQUIEX.js} +1 -1
  27. package/public/{chunk-52M2PJJL.js → chunk-TKCKTVDR.js} +1 -1
  28. package/public/chunk-TMBKBUUJ.js +1 -0
  29. package/public/chunk-UDAYIL7R.js +1 -0
  30. package/public/{chunk-23GQYVQ6.js → chunk-VOXKUTG5.js} +1 -1
  31. package/public/{chunk-SZ2GUIT5.js → chunk-W4VRE5PG.js} +1 -1
  32. package/public/index.html +1 -1
  33. package/public/main-FLRUEB5J.js +5 -0
  34. package/public/{polyfills-HMJGV7SQ.js → polyfills-C5VXBGWL.js} +1 -1
  35. package/public/chunk-3Y7WDZKI.js +0 -1
  36. package/public/chunk-AA2M4OWK.js +0 -2
  37. package/public/chunk-AB255PKD.js +0 -2
  38. package/public/chunk-D2CYLQZF.js +0 -1
  39. package/public/chunk-NDOR4O4J.js +0 -1
  40. package/public/chunk-OB3QLUH6.js +0 -15
  41. package/public/chunk-PKKBBIJK.js +0 -3
  42. package/public/chunk-TIWUK3AU.js +0 -1
  43. package/public/chunk-VJ4U7HHN.js +0 -1
  44. package/public/chunk-WADRUSMB.js +0 -3
  45. package/public/chunk-XDPHEQEO.js +0 -2
  46. package/public/chunk-YIXYV2MV.js +0 -52
  47. package/public/main-HG5TDMOB.js +0 -5
@@ -0,0 +1,3 @@
1
+ import{a as X,b as Q,c as Ee,d as W,e as Ct,g as De,h as xt,m as Re,o as K,p as ke,q as ze,r as Se,s as Et,t as Te}from"./chunk-3VEP4A7I.js";import{a as Ce,b as xe,d as Oe,e as He,g as Ne,h as Me}from"./chunk-MHCWCMEF.js";import{c as ye}from"./chunk-QL3G7CWF.js";import{a as wt}from"./chunk-MVXIEN3D.js";import{a as Wt,d as q}from"./chunk-MKKQCG3C.js";import{$a as Pt,$b as ne,$c as pe,Ac as lt,Bc as ue,Cb as te,Cc as ht,Da as Xt,Db as ee,Eb as L,Fb as _,Ga as Qt,Gb as w,Hb as mt,Hc as Bt,Ib as nt,Ic as ge,Jb as at,Kb as ie,Na as rt,Nb as se,Ob as A,Qb as z,Rc as fe,Sb as P,Tb as Lt,Ub as _t,Va as Kt,Vb as re,W as Yt,Wa as Mt,Wb as dt,Xa as O,Xb as Y,Yb as $,_b as oe,a as m,ae as bt,b as E,bb as gt,bc as yt,be as vt,cb as ot,fc as C,gc as ae,hb as N,hc as de,lb as ft,mb as pt,na as $t,nb as Jt,nc as le,ob as Zt,oc as he,od as me,pb as M,pc as ce,pd as _e,re as be,sa as v,se as ve,ue as we,xa as D,ya as R,yb as U,yc as At,zb as V}from"./chunk-PR5JLJLD.js";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);if(!i.length&&r[0]!=="."&&r[0]!=="#"&&(i=t.querySelectorAll("."+r),i.length||(i=t.querySelectorAll("#"+r)),!i.length)){let s=t.querySelector(`[gs-id="${r}"]`);return s?[s]:[]}return 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")&&!(Array.isArray(r)||Array.isArray(t)))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 It=(()=>{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,E(m({},i),{y:t.y}),t)||!this.collide(i,E(m({},i),{y:e.y-i.h}),t))){t._skipDown=t._skipDown||e.y>t.y;let l=m(E(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(E(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 f=Math.min(g,l);f>d&&(d=f,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),f=h.area(e.rect),b=h.area(l._rect);g/(f<b?f:b)>.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,n.y<0&&(n.y=0)),o.x!==o._orig.x&&(n.x=Math.round(o.x*s),n.x<0&&(n.x=0)),o.w!==o._orig.w&&(n.w=Math.round(o.w*s),n.w<1&&(n.w=1)))})}}),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 H={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 p=class{};var S=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),k=class{};function Dt(a,r){a.touches.length>1||(a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a.changedTouches[0],r))}function Pe(a,r){a.cancelable&&a.preventDefault(),h.simulateMouseEvent(a,r)}function J(a){k.touchHandled||(k.touchHandled=!0,Dt(a,"mousedown"))}function Z(a){k.touchHandled&&Dt(a,"mousemove")}function tt(a){if(!k.touchHandled)return;k.pointerLeaveTimeout&&(window.clearTimeout(k.pointerLeaveTimeout),delete k.pointerLeaveTimeout);let r=!!p.dragElement;Dt(a,"mouseup"),r||Dt(a,"click"),k.touchHandled=!1}function et(a){a.pointerType!=="mouse"&&a.target.releasePointerCapture(a.pointerId)}function Gt(a){p.dragElement&&a.pointerType!=="mouse"&&Pe(a,"mouseenter")}function Ft(a){p.dragElement&&a.pointerType!=="mouse"&&(k.pointerLeaveTimeout=window.setTimeout(()=>{delete k.pointerLeaveTimeout,Pe(a,"mouseleave")},10))}var Le=(()=>{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(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(t){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",t)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${a.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),S&&(this.el.addEventListener("touchstart",J),this.el.addEventListener("pointerdown",et)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),S&&(this.el.removeEventListener("touchstart",J),this.el.removeEventListener("pointerdown",et)),this.option.element||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),S&&(this.el.addEventListener("touchmove",Z),this.el.addEventListener("touchend",tt)),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),S&&(this.el.removeEventListener("touchmove",Z),this.el.removeEventListener("touchend",tt)),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 I=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 Ae=(()=>{class a extends I{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),p.overResizeElement===this&&delete p.overResizeElement),this}_mouseOver(t){p.overResizeElement||p.dragElement||(p.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){p.overResizeElement===this&&(delete p.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(t=>t.trim()).map(t=>new Le(this.el,t,{element:this.option.element,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 qe='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',Be=(()=>{class a extends I{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),S&&(t.addEventListener("touchstart",J),t.addEventListener("pointerdown",et))}),this.el.classList.remove("ui-draggable-disabled"))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(e=>{e.removeEventListener("mousedown",this._mouseDown),S&&(e.removeEventListener("touchstart",J),e.removeEventListener("pointerdown",et))}),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(k.touchHandled&&t.isTrusted&&(k.touchHandled=!1),!p.mouseHandled)return t.button!==0||!this.dragEls.find(e=>e===t.target)&&t.target.closest(qe)||this.option.cancel&&t.target.closest(this.option.cancel)||(this.mouseDownEvent=t,delete this.dragging,delete p.dragElement,delete p.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),S&&(t.currentTarget.addEventListener("touchmove",Z),t.currentTarget.addEventListener("touchend",tt)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),p.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),p.pauseDrag){let i=Number.isInteger(p.pauseDrag)?p.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,p.dragElement=this;let i=this.el.gridstackNode?.grid;i?p.dropElement=i.el.ddElement.ddDroppable:delete p.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),S&&t.currentTarget&&(t.currentTarget.removeEventListener("touchmove",Z,!0),t.currentTarget.removeEventListener("touchend",tt,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),p.dropElement?.el===this.el.parentElement&&delete p.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),p.dropElement&&p.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete p.dragElement,delete p.dropElement,delete p.mouseHandled,t.preventDefault()}_keyEvent(t){let e=this.el.gridstackNode,i=e?.grid||p.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 Rt=class extends I{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),S&&(this.el.addEventListener("pointerenter",Gt),this.el.addEventListener("pointerleave",Ft)))}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),S&&(this.el.removeEventListener("pointerenter",Gt),this.el.removeEventListener("pointerleave",Ft)))}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(!p.dragElement||k.touchHandled&&r.isTrusted||!this._canDrop(p.dragElement.el))return;r.preventDefault(),r.stopPropagation(),p.dropElement&&p.dropElement!==this&&p.dropElement._mouseLeave(r,!0),p.dropElement=this;let t=h.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(p.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,t=!1){if(!p.dragElement||p.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(p.dragElement)),this.triggerEvent("dropout",e),p.dropElement===this&&(delete p.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(p.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 kt=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 Be(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 Ae(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 Rt(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var zt=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(E(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(E(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,p.dragElement?p.dragElement.el:s.target,p.dragElement?p.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?kt.init(o):null)).filter(o=>o):[]}};var T=new zt,G=(()=>{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,H.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=E(m({},h.cloneDeep(H)),{column:h.toNumber(t.getAttribute("gs-column"))||H.column,minRow:i||h.toNumber(t.getAttribute("gs-min-row"))||H.minRow,maxRow:i||h.toNumber(t.getAttribute("gs-max-row"))||H.maxRow,staticGrid:h.toBool(t.getAttribute("gs-static"))||H.staticGrid,sizeToContent:h.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||H.draggable.handle},removableOptions:{accept:e.itemClass||H.removableOptions.accept,decline:H.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("."+H.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!==H.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=S),this._setStaticClass();let u=e.engineClass||a.engineClass||It;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&&!p.pauseDrag&&(p.pauseDrag=!0),e.draggable?.pause!==void 0&&(p.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(E(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=E(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 b=u?e.column:o.w,y=o.h+i.h,x=o.el.style;x.transition="none",this.update(o.el,{w:b,h:y}),setTimeout(()=>x.transition=null)}let f=o.subGrid=a.addGrid(c,e);return i?._moving&&(f._isTemp=!0),u&&(f._autoColumn=!0),s&&f.makeWidget(l,g),i&&(i._moving?window.setTimeout(()=>h.simulateMouseEvent(i._event,"mouseenter",f.el),0):f.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),f}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,H),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,E(m({},l),{forceCollide:!0})),h.copyPos(l,g)),this.update(g.el,l),l.subGridOpts?.children){let f=g.el.querySelector(".grid-stack");f&&f.gridstack&&f.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.lazyLoad!==void 0&&(e.lazyLoad=t.lazyLoad),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 f=e.subGrid.el.getBoundingClientRect(),b=t.getBoundingClientRect();c+=f.top-b.top}else{if(e.subGridOpts?.children?.length)return;{let f=n.firstElementChild;if(!f){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=f.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){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(H.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),t.setAttribute("gs-x",String(e.x)),t.setAttribute("gs-y",String(e.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 T}static setupDragIn(t,e,i,s=document){e?.pause!==void 0&&(p.pauseDrag=e.pause),e=m({appendTo:"body",helper:"clone"},e||{}),(typeof t=="string"?h.getElements(t,s):t).forEach((n,d)=>{T.isDraggable(n)||T.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 T.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 T.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 f=n.getBoundingClientRect();n.style.left=f.x+(this.dragTransform.xScale-1)*(s.clientX-f.x)/this.dragTransform.xScale+"px",n.style.top=f.y+(this.dragTransform.yScale-1)*(s.clientY-f.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)){T.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 T.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=E(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),T.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 f=l.grid;f.engine.removeNodeFromLayoutCache(l),f.engine.removedNodes.push(l),f._triggerRemoveEvent()._triggerChangeEvent(),f.parentGridNode&&!f.engine.nodes.length&&f.opts.subGridDynamic&&f.removeAsSubGrid()}if(!d||(u&&(this.engine.cleanupNode(d),d.grid=this),delete d.grid?._isTemp,T.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(E(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&&!T.isDroppable(t)&&T.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=(f,b)=>{this.triggerEvent(f,f.target),d=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(t,f,b,i,d,u)},l=(f,b)=>{this._dragOrResize(t,f,b,i,d,u)},g=f=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let b=i.w!==i._orig.w,y=f.target;if(!(!y.gridstackNode||y.gridstackNode.grid!==this)){if(i.el=y,i._isAboutToRemove){let x=t.gridstackNode.grid;x._gsEventHandler[f.type]&&x._gsEventHandler[f.type](f,y),x.engine.nodes.push(i),x.removeWidget(t,!0,!0)}else h.removePositioningStyles(y),i._temporaryRemoved?(this._writePosAttr(y,i),this.engine.addNode(i)):this._writePosAttr(y,i),this.triggerEvent(f,y);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),f.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(b,i))}};T.draggable(t,{start:c,stop:g,drag:l}).resizable(t,{start:c,stop:g,resize:l}),i._initDD=!0}return T.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;T.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,f=this.opts.marginBottom,b=Math.round(n*.1),y=Math.round(o*.1);if(c=Math.min(c,y),l=Math.min(l,y),g=Math.min(g,b),f=Math.min(f,b),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 B=i.position.left+(i.position.left>s._lastUiPosition.left?-l:c),st=i.position.top+(i.position.top>s._lastUiPosition.top?-f:g);d.x=Math.round(B/o),d.y=Math.round(st/n);let Ve=this._extraDragRow;if(this.engine.collide(s,d)){let Ht=this.getRow(),Nt=Math.max(0,d.y+s.h-Ht);this.opts.maxRow&&Ht+Nt>this.opts.maxRow&&(Nt=Math.max(0,this.opts.maxRow-Ht)),this._extraDragRow=Nt}else this._extraDragRow=0;if(this._extraDragRow!==Ve&&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,B=i.position.top+g;d.x=Math.round(F/o),d.y=Math.round(B/n),u=!0}s._event=e,s._lastTried=d;let x={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-f};if(this.engine.moveNodeCheck(s,E(m({},d),{cellWidth:o,cellHeight:n,rect:x,resizing:u}))){s._lastUiPosition=i.position,this.engine.cacheRects(o,n,g,l,f,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,T.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()}}return a.renderCB=(r,t)=>{r&&t?.content&&(r.textContent=t.content)},a.resizeToContentParent=".grid-stack-item-content",a.Utils=h,a.Engine=It,a.GDRev="12.4.2",a})();var We=["container"],je=["*"];function Ye(a,r){}var $e=["*",[["","empty-content",""]]],Xe=["*","[empty-content]"];function Qe(a,r){a&1&&_t(0,1,["*ngIf","isEmpty"])}function Ke(a,r){}var St=(()=>{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=$t({token:a,factory:a.\u0275fac}),a})(),Ie=(()=>{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=E(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)(Pt(rt))},a.\u0275cmp=N({type:a,selectors:[["gridstack-item"]],viewQuery:function(t,e){if(t&1&&dt(We,7,ot),t&2){let i;Y(i=$())&&(e.container=i.first)}},inputs:{options:"options"},ngContentSelectors:je,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(t,e){t&1&&(Lt(),nt(0,"div",1),Zt(1,Ye,0,0,"ng-template",null,0,At),_t(3),C(4),at()),t&2&&(O(4),de(" ",e.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),a})(),ct=(()=>{class a{constructor(t){this.elementRef=t,this.addedCB=new M,this.changeCB=new M,this.disableCB=new M,this.dragCB=new M,this.dragStartCB=new M,this.dragStopCB=new M,this.droppedCB=new M,this.enableCB=new M,this.removedCB=new M,this.resizeCB=new M,this.resizeStartCB=new M,this.resizeStopCB=new M,G.addRemoveCB||(G.addRemoveCB=Je),G.saveCB||(G.saveCB=Ze),G.updateCB||(G.updateCB=ti),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 fe(t).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=G.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)(Pt(rt))},a.\u0275cmp=N({type:a,selectors:[["gridstack"]],contentQueries:function(t,e,i){if(t&1&&re(i,Ie,4),t&2){let s;Y(s=$())&&(e.gridstackItems=s)}},viewQuery:function(t,e){if(t&1&&dt(We,7,ot),t&2){let i;Y(i=$())&&(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:Xe,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(t,e){t&1&&(Lt($e),Jt(0,Qe,1,0,"ng-content",1)(1,Ke,0,0,"ng-template",null,0,At),_t(3)),t&2&&L("ngIf",e.isEmpty)},dependencies:[pe],styles:["[_nghost-%COMP%]{display:block}"]}),a})();function Je(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(ct),n=o?.instance;return n?(n.ref=o,n.options=r,n.el):void 0}else{let s=a._gridComp?.container?.createComponent(Ie),o=s?.instance;if(!o)return;o.ref=s;let n=r.selector,d=n?ct.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 Ze(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 ti(a){let r=a,t=a.el?._gridItemComp;t?.childWidget&&r.input&&t.childWidget.deserialize(r)}var j=(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})(j||{}),ei="*";function qt(a,r){return{type:j.Trigger,name:a,definitions:r,options:{}}}function Tt(a,r=null){return{type:j.Animate,styles:r,timings:a}}function Ns(a,r=null){return{type:j.Sequence,steps:a,options:r}}function it(a){return{type:j.Style,styles:a,offset:null}}function jt(a,r,t=null){return{type:j.Transition,expr:a,animation:r,options:t}}var Ut=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}},Vt=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}},ii="!";var si=(a,r)=>r.id;function ri(a,r){if(a&1&&ie(0,"div",4),a&2){let t=r.$index;P();let e=ce(0);yt("background-color",e===t?"var(--mat-sys-on-surface)":"var(--mat-sys-inverse-on-surface)")}}var Ge=(()=>{class a{activePage=Bt();dashboards=Bt();static \u0275fac=function(e){return new(e||a)};static \u0275cmp=N({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&&(le(0),nt(1,"div",0)(2,"span",1),C(3),at()(),nt(4,"div",2),te(5,ri,1,2,"div",3,si),at()),e&2){let s=i.dashboards(),o=he(i.activePage());O(),L("@fadeInOut",o),O(2),ae(s[o].name),O(),L("@fadeInOut",o),O(),ee(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:[qt("fadeInOut",[jt(":increment, :decrement",[it({opacity:0}),Tt(100,it({opacity:1})),it({opacity:1}),Tt("250ms 1000ms",it({opacity:0}))])])]}})}return a})();function ni(a,r){if(a&1){let t=A();_(0,"button",0),z("click",function(){D(t);let i=P();return R(i.clickAction("cancel"))}),_(1,"mat-icon",1),C(2,"close"),w(),_(3,"span"),C(4,"Close"),w()()}}var Ot=(()=>{class a{_bottomSheetRef=v(Se);data=v(ze);showCancel=!!(this.data&&this.data.showCancel);clickAction(t){this._bottomSheetRef.dismiss(t)}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=N({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),z("click",function(){return i.clickAction("duplicate")}),_(2,"mat-icon",1),C(3,"content_copy"),w(),_(4,"span"),C(5,"Duplicate"),w()(),_(6,"button",0),z("click",function(){return i.clickAction("delete")}),_(7,"mat-icon",1),C(8,"delete_forever"),w(),_(9,"span"),C(10,"Delete"),w()(),U(11,ni,5,0,"button",2),w()),e&2&&(O(11),V(i.showCancel?11:-1))},dependencies:[Me,He,Ne,Oe,vt,bt],encapsulation:2})}return a})();var di=["childOutlet"],Fe=(()=>{class a extends St{widgetProperties;outlet;_dialog=v(K);_dashboard=v(Q);_bottomSheet=v(Et);_streams=v(Ct,{optional:!0});_meta=v(xt,{optional:!0});_runtime=v(W,{optional:!0});_widgetService=v(Re);_app=v(wt);theme=_e(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(),ht(()=>{let t=this._dashboard.layoutEditCanceled();!this._hasInitialized||!t||lt(()=>{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,{bindings:[gt("id",()=>this.widgetProperties.uuid),gt("type",()=>this.widgetProperties.type),gt("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,q(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(Ot,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=N({type:a,selectors:[["widget-host2"]],viewQuery:function(e,i){if(e&1&&dt(di,7,ot),e&2){let s;Y(s=$())&&(i.outlet=s.first)}},inputs:{widgetProperties:"widgetProperties"},features:[pt([Ct,xt,W]),ft],decls:3,vars:2,consts:[["childOutlet",""],["kipGestures","","mode","press","appearance","raised",1,"widget-container","kip-widget-card-colors",3,"doubletap","press"]],template:function(e,i){if(e&1){let s=A();_(0,"mat-card",1),z("doubletap",function(n){return D(s),R(i.openWidgetOptions(n))})("press",function(n){return D(s),R(i.openBottomSheet(n))}),se(1,null,0),w()}e&2&&yt("border",i._dashboard.isDashboardStatic()?"1px dashed transparent":"1px dashed var(--mat-sys-outline)")},dependencies:[xe,Ce,Te,X],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})();function li(a,r){if(a&1){let t=A();_(0,"div",2),z("doubletap",function(i){D(t);let s=P();return R(s.openWidgetOptions(i))})("press",function(i){D(t);let s=P();return R(s.openBottomSheet(i))}),w()}}var Ue=(()=>{class a extends St{widgetProperties;dashboard=v(Q);_dialog=v(K);_bottomSheet=v(Et);runtime=v(W);static DEFAULT_CONFIG={displayName:"Gauge Label",color:"contrast"};_sheetOpen=!1;_optionsOpen=!1;constructor(){super()}ngOnInit(){this.runtime?.initialize?.(a.DEFAULT_CONFIG,this.widgetProperties.config)}serialize(){let t=this.runtime?.options();return t?this.widgetProperties.config=t:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}openWidgetOptions(t){if(t.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._optionsOpen)return;this._optionsOpen=!0,this._dialog.openWidgetOptions({title:"Widget Options",config:q(this.runtime.options()),confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{this._optionsOpen=!1,e&&this.runtime.setRuntimeConfig(e)})}}openBottomSheet(t){if(t.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._sheetOpen)return;this._sheetOpen=!0;let e=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Ot,e?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,s){case"delete":this.dashboard.deleteWidget(this.widgetProperties.uuid);break;default:break}})}}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=N({type:a,selectors:[["group-widget"]],inputs:{widgetProperties:"widgetProperties"},features:[pt([W]),ft],decls:2,vars:3,consts:[[3,"text","color"],["kipGestures","","mode","press",1,"widgetOverlay"],["kipGestures","","mode","press",1,"widgetOverlay",3,"doubletap","press"]],template:function(e,i){e&1&&(mt(0,"widget-title",0),U(1,li,1,0,"div",1)),e&2&&(L("text",i.runtime.options().displayName)("color",i.runtime.options().color),O(),V(i.dashboard.isDashboardStatic()?-1:1))},dependencies:[De,X],styles:["[_nghost-%COMP%]{display:block;height:15%}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:15%;right:0;top:0;color:transparent;z-index:21}"],changeDetection:0})}return a})();var hi=["grid"];function ci(a,r){a&1&&(_(0,"p",9)(1,"strong"),C(2,"Long press/click and hold anywhere"),w(),C(3," to add widgets"),w(),_(4,"mat-icon",10),C(5,"touch_app"),w())}function ui(a,r){if(a&1){let t=A();_(0,"p",9),C(1,"This empty dashboard is ready to be customized."),w(),_(2,"button",11),z("click",function(){D(t);let i=P();return R(i.editDashboard())}),_(3,"mat-icon"),C(4,"lock_open"),w(),C(5," Unlock and Customize "),w()}}function gi(a,r){if(a&1){let t=A();_(0,"div",7)(1,"button",12),z("click",function(){D(t);let i=P();return R(i.cancelLayoutChanges())}),_(2,"mat-icon"),C(3,"close"),w()(),_(4,"button",13),z("click",function(){D(t);let i=P();return R(i.saveLayoutChanges())}),_(5,"mat-icon"),C(6,"done"),w()()()}}function fi(a,r){if(a&1&&mt(0,"dashboard-scroller",8),a&2){let t=P();L("activePage",t.dashboard.activeDashboard())("dashboards",t.dashboard.dashboards())}}var oo=(()=>{class a{_app=v(wt);_dialog=v(K);dashboard=v(Q);_destroyRef=v(Xt);_uiEvent=v(ke);_dataset=v(Ee);_router=v(ye);_hostEl=v(rt);isDashboardStatic=ue(()=>this.dashboard.isDashboardStatic());_gridstack=ge.required("grid");_previousIsStaticState=!0;_suppressDrag=!1;subGridOptions={cellHeight:"auto",column:"auto",acceptWidgets:!0,subGridDynamic:!1,class:"group-container"};gridOptions=Qt({column:24,row:24,margin:4,float:!0,resizable:{handles:"all"},acceptWidgets:!0,subGridDynamic:!1,subGridOpts:this.subGridOptions,children:[]});_boundHandleKeyDown=this.handleKeyDown.bind(this);_resizeObserver;_pendingResizeRaf=null;_lastContainerHeight=0;_lastCellHeight=0;_addDialogOpen=!1;constructor(){ct.addComponentToSelectorType([Fe,Ue]),ht(()=>{let t=this.dashboard.isDashboardStatic();lt(()=>{if(this._previousIsStaticState!==t){this._previousIsStaticState=t;try{this._gridstack().grid.setStatic(t)}catch{}}})}),ht(()=>{let t=this.dashboard.activeDashboard();lt(()=>{this.loadDashboard(t),console.log(`[Dashboard] Loaded dashboard index ${t}`)})})}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",(e,i)=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}))}catch{}this.dashboard.widgetAction$.pipe(me(this._destroyRef)).subscribe(t=>{t&&this._gridstack().grid.getGridItems().forEach(e=>{let i={};if(e.gridstackNode.subGridOpts&&(i=e.gridstackNode.subGridOpts),e.gridstackNode.id===t.id)switch(t.operation){case"delete":this.deleteWidget(e);break;case"duplicate":this.duplicateWidget(e);break;default:break}})})}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.batchUpdate(),i.batchUpdate(!1)),this._lastContainerHeight=s,this._lastCellHeight=d}}catch{}}loadDashboard(t){let e=q(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.batchUpdate(!1)}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()}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._addDialogOpen=!0,this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).pipe(Yt(()=>{this._addDialogOpen=!1})).subscribe(d=>{if(!d||typeof d!="object")return;let u=d,c=Wt.create(),l={};u.selector==="group-widget"?l={x:o.x,y:o.y,w:3,h:4,id:c,selector:"group-widget",input:{widgetProperties:{type:u.selector,uuid:c,config:{displayName:"Group Widget",color:"contrast"}}},subGridOpts:{children:[]}}:l={x:o.x,y:o.y,w:u.defaultWidth,h:u.defaultHeight,minW:u.minWidth,minH:u.minHeight,id:c,selector:"widget-host2",input:{widgetProperties:{type:u.selector,uuid:c}}};let g=this._gridstack().grid,f=Number(u.minWidth??1),b=Number(u.minHeight??2),y=Number(u.defaultWidth??f),x=Number(u.defaultHeight??b);if(!(g.isAreaEmpty(o.x,o.y,y,x)&&g.willItFit({x:o.x,y:o.y,w:y,h:x}))){let st=this.findBestWidgetSizeAtCell(g,o.x,o.y,f,b,y,x);if(!st){this._app.sendSnackbarNotification(`Error Adding Widget: Not enough free space to add ${u.name} widget at the selected location. Please reorganize the dashboard to free up space or try a larger empty area.`,0);return}l.w=st.w,l.h=st.h}let B=this._gridstack().grid.addWidget(l);B.gridstackNode.subGrid&&(B.gridstackNode.subGridOpts.row=B.gridstackNode.subGridOpts.minRow=B.gridstackNode.subGridOpts.maxRow=B.gridstackNode.h)})):this._app.sendSnackbarNotification("Error Adding Widget: Not enough free space at the selected location to add a widget. Please reorganize the dashboard to free up space or try a larger empty area.",0)}}findBestWidgetSizeAtCell(t,e,i,s,o,n,d){let u=Math.max(1,Math.floor(s)),c=Math.max(1,Math.floor(o)),l=Math.max(u,Math.floor(n)),g=Math.max(c,Math.floor(d)),f=null;for(let b=u;b<=l;b++)for(let y=c;y<=g;y++){if(!t.isAreaEmpty(e,i,b,y)||!t.willItFit({x:e,y:i,w:b,h:y}))continue;let x=b*y;(!f||x>f.area||x===f.area&&y>f.h||x===f.area&&y===f.h&&b>f.w)&&(f={w:b,h:y,area:x})}return f?{w:f.w,h:f.h}:null}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=Wt.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:q(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.offAll(),t.grid.destroy()),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=N({type:a,selectors:[["dashboard"]],viewQuery:function(e,i){e&1&&oe(i._gridstack,hi,5),e&2&&ne()},hostBindings:function(e,i){e&1&&z("mouseup",function(){return i.onPointerRelease()},Mt)("touchend",function(){return i.onPointerRelease()},Mt)},decls:16,vars:6,consts:[["grid",""],["kipGestures","",3,"swipeup","swipedown","press","resize","mode","enablePress","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),z("swipeup",function(){return D(s),R(i.previousDashboard())})("swipedown",function(){return D(s),R(i.nextDashboard())})("press",function(n){return D(s),R(i.addNewWidget(n))})("resize",function(){return D(s),R(i.resizeGridColumns())},Kt),_(2,"div",2)(3,"div",3)(4,"mat-icon",4),C(5,"dashboard"),w(),U(6,ci,6,0)(7,ui,6,0),w(),_(8,"div")(9,"div",5)(10,"button",6),z("click",function(){return D(s),R(i.navigateToHelp())}),_(11,"mat-icon"),C(12,"help"),w(),C(13," Get Help "),w()()()()(),U(14,gi,7,0,"div",7)(15,fi,1,2,"dashboard-scroller",8)}if(e&2){let s=i.dashboard.isDashboardStatic();L("mode",s?"dashboard":"editor")("enablePress",!s)("enableDoubleTap",!1)("options",i.gridOptions()),O(6),V(s?7:6),O(8),V(s?15:14)}},dependencies:[ct,Ge,vt,bt,we,be,ve,X],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} .grid-stack-sub-grid{border:1px solid var(--mat-sys-outline);border-radius:8px} .grid-stack-sub-grid div{display:flex;flex-direction:column} .grid-stack-sub-grid div .grid-stack{flex:1 1 auto;min-height:500px}.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{j as a,ei as b,Ns as c,it as d,Ut as e,Vt as f,ii as g,oo as h};
@@ -0,0 +1 @@
1
+ import{a as H,b as B,c as N,d as z,e as A,f as j}from"./chunk-TKCKTVDR.js";import{a as U}from"./chunk-GYERRI2M.js";import{e as L,g as E,h as F}from"./chunk-MHCWCMEF.js";import{a as V}from"./chunk-UDAYIL7R.js";import"./chunk-RVSQUIEX.js";import"./chunk-QL3G7CWF.js";import"./chunk-JWT2WFAW.js";import{m as $}from"./chunk-MKKQCG3C.js";import{Ab as w,Cb as f,Db as h,Eb as v,Fb as a,Ga as c,Gb as r,Hb as x,Ob as y,Qb as C,Sb as l,Xa as d,ae as k,be as O,cc as T,fc as s,gc as R,hb as S,jd as D,nd as I,sa as g,ue as P,x as p,xa as u,ya as _,yb as M,zb as b}from"./chunk-PR5JLJLD.js";var K=(t,n)=>n.id;function q(t,n){if(t&1){let e=y();a(0,"button",9),C("click",function(){let o=u(e).$implicit,m=l();return _(m.displayDashboards(o.displayId))}),s(1),r()}if(t&2){let e=n.$implicit,i=l();T("selected",i.selectedDisplayButtonId()===e.displayId),d(),R(e.displayName)}}function W(t,n){t&1&&(a(0,"button",5)(1,"i"),s(2,'"No Remote"'),r()())}function G(t,n){t&1&&(a(0,"div",7),x(1,"mat-progress-spinner",10),r())}function J(t,n){if(t&1){let e=y();a(0,"tile-large-icon",12,0),C("click",function(){let o=u(e).$index,m=l(2);return _(m.setActiveScreen(o))}),r()}if(t&2){let e=n.$implicit,i=n.$index,o=l(2);v("active",o.activeScreen.value()===i)("svgIcon",e.icon)("iconSize",72)("label",e.name)}}function Q(t,n){if(t&1&&f(0,J,2,4,"tile-large-icon",11,K),t&2){let e=l();h(e.screens.value())}}function X(t,n){t&1&&(a(0,"div",8)(1,"mat-icon",13),s(2,"cast"),r(),a(3,"div",14)(4,"p"),s(5,"Select an available remote KIP in the menu."),r(),a(6,"p"),s(7,"To allow remote control of a dashboard, on that KIP device open Options \u2192 Display \u2192 Remote Control and enable it."),r()()())}var _e=(()=>{class t{http=g(D);_settings=g($);HOST_URL=this._settings.signalkUrl.url;pageTitle="Remote Control";displayId=c(null);displays=c(null);screens=I(()=>{if(this.displayId())return`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}`});activeScreen=I(()=>{if(this.displayId())return`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}/screenIndex`});selectedDisplayButtonId=c(null);appID="";ngOnInit(){this.appID=this._settings.KipUUID,p(this.http.get(`${this.HOST_URL}/plugins/kip/displays`)).then(e=>{this.displays.set(e.filter(i=>i.displayId!==this.appID))})}displayDashboards(e){this.displayId.set(e),this.selectedDisplayButtonId.set(e)}setActiveScreen(e){p(this.http.put(`${this.HOST_URL}/plugins/kip/displays/${this.displayId()}/activeScreen`,{screenIdx:e})).then(i=>{i.statusCode!==200&&console.error(`Failed to set active screen: ${i.message}`)}),this.activeScreen.set(e)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=S({type:t,selectors:[["remote-control"]],decls:11,vars:3,consts:[["tile",""],["svgIconId","remote-control",3,"pageTitle"],[1,"sidenav-remote-control-container"],["mode","side","opened",""],["mat-list-item","","tabindex","0",3,"selected"],["mat-list-item","","tabindex","0","disabled","true",2,"text-align","center"],[1,"sidenav-remote-control-content"],["aria-label","Loading screens",1,"loading-container"],["role","status","aria-live","polite",1,"empty-state-msg"],["mat-list-item","","tabindex","0",3,"click"],["mode","indeterminate","diameter","64","strokeWidth","5"],["tabindex","0",3,"active","svgIcon","iconSize","label"],["tabindex","0",3,"click","active","svgIcon","iconSize","label"],["aria-hidden","true","color","primary",1,"empty-state-icon"],[1,"copy"]],template:function(i,o){i&1&&(x(0,"page-header",1),a(1,"mat-sidenav-container",2)(2,"mat-sidenav",3)(3,"mat-action-list"),f(4,q,2,3,"button",4,w,!1,W,3,0,"button",5),r()(),a(7,"mat-sidenav-content",6),M(8,G,2,0,"div",7)(9,Q,2,0)(10,X,8,0,"div",8),r()()),i&2&&(v("pageTitle",o.pageTitle),d(4),h(o.displays()),d(4),b(o.screens.isLoading()?8:o.screens.hasValue()?9:10))},dependencies:[V,z,B,N,H,F,L,E,P,j,A,U,O,k],styles:[".sidenav-remote-control-container[_ngcontent-%COMP%]{height:calc(100% - 87px);width:calc(100% - 48px);margin:0 24px 24px;border:1px solid var(--mat-sys-outline-variant)}mat-sidenav[_ngcontent-%COMP%]{width:150px;--mat-sidenav-container-shape: square}.selected[_ngcontent-%COMP%]{background-color:var(--mat-sys-inverse-on-surface)}.loading-container[_ngcontent-%COMP%]{min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px}.sidenav-remote-control-content[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start;height:100%;width:100%;padding:5px;gap:5px;overflow-y:auto;scrollbar-width:none;overflow-x:hidden;scroll-behavior:smooth;flex:1 1 auto;min-height:0}tile-large-icon[_ngcontent-%COMP%]{width:190px}.empty-state-msg[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:center;height:100%;width:calc(100% - 150px);min-height:70vh;padding:2rem;text-align:center;color:var(--mat-sys-outline-variant);font-style:italic}.empty-state-icon[_ngcontent-%COMP%]{font-size:4rem;width:4rem;height:4rem;color:var(--mat-sys-outline-variant);margin-bottom:1rem}"]})}return t})();export{_e as RemoteControlComponent};
@@ -0,0 +1 @@
1
+ import{a as j,c as z,d as $,e as B,f as q,g as U}from"./chunk-L4NM3HUK.js";import{c as D}from"./chunk-QL3G7CWF.js";import{a as N,b as R}from"./chunk-JWT2WFAW.js";import"./chunk-W4VRE5PG.js";import{Bc as x,Cb as y,Cc as H,Db as k,Eb as f,Fb as n,Ga as v,Gb as a,Hb as _,Ob as b,Qb as h,Sb as s,Xa as r,ac as F,ae as P,bc as T,be as L,fc as l,gc as E,hb as C,hc as S,nb as M,nd as A,pe as O,re as V,sa as w,ue as I,xa as p,ya as c,yb as g,zb as u}from"./chunk-PR5JLJLD.js";var G=(e,o)=>o.file;function J(e,o){e&1&&l(0," Loading... ")}function K(e,o){e&1&&l(0," Table of Content ")}function Q(e,o){e&1&&(n(0,"button",10),l(1,"Error loading menu"),a())}function X(e,o){e&1&&(n(0,"button",10),l(1,"No help entries"),a())}function Y(e,o){if(e&1){let t=b();n(0,"button",12),h("click",function(){let i=p(t).$implicit,d=s(3);return c(d.selectFile(i.file))}),l(1),a()}if(e&2){let t=o.$implicit,m=s(3);f("disabled",m.selectedFile()===t.file),r(),S(" ",t.title," ")}}function Z(e,o){if(e&1&&y(0,Y,2,2,"button",11,G),e&2){let t=s(2);k(t.helpFiles())}}function ee(e,o){if(e&1&&g(0,Q,2,0,"button",10)(1,X,2,0,"button",10)(2,Z,2,0),e&2){let t=s();u(t.hasError()?0:!t.isLoading()&&t.helpFiles().length===0?1:2)}}function te(e,o){e&1&&(n(0,"div",9),l(1,"Unable to load help content."),a())}function ne(e,o){e&1&&(n(0,"div",9),l(1,"Loading help..."),a())}function ie(e,o){if(e&1&&(n(0,"div",9),_(1,"markdown",13),a()),e&2){let t=s();r(),f("src",`assets/help-docs/${t.selectedFile()}`)}}var xe=(()=>{class e{pageTitle="Help";_router=w(D);_helpMenuRes=A(()=>"assets/help-docs/menu.json");helpFiles=x(()=>this._helpMenuRes.hasValue()?(this._helpMenuRes.value()??[]).filter(t=>t.file.endsWith(".md")):[]);selectedFile=v("");_initSelectionOnce=v(!1);_syncEffect=H(()=>{let t=this.helpFiles();!this._initSelectionOnce()&&t.length>0&&(this.selectedFile.set(t[0].file),this._initSelectionOnce.set(!0))});hasError=x(()=>this._helpMenuRes.error()!=null);isLoading=x(()=>this._helpMenuRes.isLoading());selectFile(t){this.selectedFile.set(t)}backPage(){this._router.navigate(["/settings"])}closePage(){this._router.navigate(["/dashboard"])}static \u0275fac=function(m){return new(m||e)};static \u0275cmp=C({type:e,selectors:[["app-help"]],decls:22,vars:9,consts:[["helpMenu","matMenu"],[1,"fullpage-header"],[1,"page-icon"],["svgIcon","help-center","aria-hidden","false"],[1,"page-title"],["mat-flat-button","",3,"matMenuTriggerFor","disabled"],["matMenuContent",""],[1,"dialog-close-icon"],["mat-icon-button","",3,"click"],[1,"markdown-content"],["mat-menu-item","","disabled",""],["mat-menu-item","",3,"disabled"],["mat-menu-item","",3,"click","disabled"],["clipboard","",3,"src"]],template:function(m,i){if(m&1){let d=b();n(0,"div",1)(1,"div",2),_(2,"mat-icon",3),n(3,"h6",4),l(4),a()(),n(5,"button",5),g(6,J,1,0)(7,K,1,0),a(),n(8,"mat-menu",null,0),M(10,ee,3,1,"ng-template",6),a(),n(11,"div",7)(12,"button",8),h("click",function(){return p(d),c(i.backPage())}),n(13,"mat-icon"),l(14,"arrow_back_ios"),a()(),n(15,"button",8),h("click",function(){return p(d),c(i.closePage())}),n(16,"mat-icon"),l(17,"close"),a()()()(),_(18,"mat-divider"),g(19,te,2,0,"div",9)(20,ne,2,0,"div",9)(21,ie,2,1,"div",9)}if(m&2){let d=F(9);r(2),T("width",24,"px")("height",24,"px"),r(2),E(i.pageTitle),r(),f("matMenuTriggerFor",d)("disabled",i.isLoading()||i.hasError()||i.helpFiles().length===0),r(),u(i.isLoading()?6:7),r(13),u(i.hasError()?19:i.isLoading()&&i.helpFiles().length===0?20:i.selectedFile()?21:-1)}},dependencies:[j,I,V,O,U,B,z,$,q,R,N,L,P],styles:[".fullpage-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.page-icon[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:center;margin-left:15px}.page-title[_ngcontent-%COMP%]{margin-block-start:0px;margin-block-end:0px;padding:18px 0 13px 5px;color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, .87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, .03125em))}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}.dialog-close-icon[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px;padding-right:15px} .markdown-content{display:block;height:calc(100% - 75px);width:100%;overflow-x:scroll;padding:25px;font-size:1.1rem;line-height:1.7;background:var(--mat-sys-surface-container, #fff);color:var(--mat-sys-on-surface, #222);border-radius:12px;box-shadow:0 2px 8px #00000012;max-width:900px;margin:0 auto} .markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4{color:var(--mat-sys-primary, #1976d2);margin-top:1.5em;margin-bottom:.5em;font-weight:600} .markdown-content pre{padding:1em;overflow-x:auto} .markdown-content table{border:1px solid var(--mat-sys-on-background);border-collapse:collapse;width:100%;margin:1em 0} .markdown-content table td{border:1px solid var(--mat-sys-on-background);padding:8px;text-align:left} .markdown-content th{color:var(--mat-sys-primary, #1976d2);font-weight:600;padding:.5em 1em;border:2px solid var(--mat-sys-primary, #1976d2);text-align:left} .markdown-content table tr:nth-child(2n){background-color:var(--mat-sys-surface-container-high)} .markdown-content a{color:var(--mat-sys-primary, #1976d2);text-decoration:underline} .markdown-content a:hover{text-decoration:none;color:var(--mat-sys-secondary, #005fa3)} .markdown-content ul, .markdown-content ol{margin-left:2em;margin-bottom:1em} .markdown-content blockquote{border-left:4px solid var(--mat-sys-tertiary);background:var(--mat-sys-on-tertiary-fixed-variant);padding:.5em 1em;color:var(--mat-sys-on-surface-variant, #555);margin:1em 0}"]})}return e})();export{xe as AppHelpComponent};
@@ -0,0 +1,3 @@
1
+ import{b as Wt,c as jt,f as Ue,g as Yt,h as Jt,k as Xt,m as Le}from"./chunk-RVSQUIEX.js";import{d as Rt,v as Nt,w as Vt,z as Ht}from"./chunk-CWBDCB4U.js";import{D as Kt,O as Bt,P as Gt,m as xt,q as Ut,r as Lt,w as zt}from"./chunk-MKKQCG3C.js";import{i as Fe,q as Pe,r as qe,s as qt}from"./chunk-W4VRE5PG.js";import{$d as Ie,A as ve,Ba as Ce,Be as Ft,Ce as Pt,Eb as Me,F as at,Fb as D,Fc as kt,Ga as ut,Gb as U,Hb as yt,K as te,Ka as mt,L as _e,Lc as St,Na as dt,Nc as I,Ob as xe,Oc as De,Qb as j,Qd as Ot,R as st,Sb as G,Sd as Tt,Tb as vt,Td as oe,Ub as Oe,Ud as Et,Vb as ae,Wb as se,Wd as At,Xa as q,Xb as L,Xd as Re,Yb as z,Zc as Mt,Zd as Dt,_a as pt,ac as _t,cc as Te,d as Kr,e as Nr,ea as be,ec as bt,fa as we,fc as Ee,ga as V,gc as Ae,hb as ht,he as It,ib as ft,m as ee,na as ot,nb as gt,oa as lt,pb as ie,qa as re,rc as wt,sa as y,sc as Ct,xa as H,xb as ne,ya as B,yb as ke,za as ct,zb as Se}from"./chunk-PR5JLJLD.js";var Qt=Kr((ze,Ke)=>{(function(u,w){typeof ze=="object"&&typeof Ke<"u"?Ke.exports=w():typeof define=="function"&&define.amd?define(w):(u=typeof globalThis<"u"?globalThis:u||self,u.Qty=w())})(ze,function(){"use strict";function u(e){return typeof e=="string"||e instanceof String}var w=Number.isFinite||window.isFinite;function t(e){return w(e)}function n(e){return e}function s(e){var r={};return e.filter(function(i){return r.hasOwnProperty(i)?!1:r[i]=!0})}function l(e,r){if(r.length!==e.length)return!1;for(var i=0;i<e.length;i++)if(r[i].compareArray&&!r[i].compareArray(e[i])||r[i]!==e[i])return!1;return!0}function h(e,r){Object.keys(r).forEach(function(i){e[i]=r[i]})}function f(){for(var e=1,r=0,i=0;i<arguments.length;i++){var a=arguments[i];r=r+Ve(a),e*=a}return r!==0?Y(e,r):e}function v(e,r){if(r===0)throw new Error("Divide by zero");var i=Math.pow(10,Ve(r)),a=i/(i*r);return f(e,a)}function Y(e,r){return Math.round(e*Math.pow(10,r))/Math.pow(10,r)}function Ve(e){if(!isFinite(e))return 0;for(var r=0;e%1!==0;)e*=10,r++;return r}function p(){var e;if(!this)return e=Object.create(p.prototype),p.apply(e,arguments),e;e=Error.apply(this,arguments),this.name="QtyError",this.message=e.message,this.stack=e.stack}p.prototype=Object.create(Error.prototype,{constructor:{value:p}});function W(e,r){throw new p("Incompatible units: "+e+" and "+r)}var x={"<googol>":[["googol"],1e100,"prefix"],"<kibi>":[["Ki","Kibi","kibi"],Math.pow(2,10),"prefix"],"<mebi>":[["Mi","Mebi","mebi"],Math.pow(2,20),"prefix"],"<gibi>":[["Gi","Gibi","gibi"],Math.pow(2,30),"prefix"],"<tebi>":[["Ti","Tebi","tebi"],Math.pow(2,40),"prefix"],"<pebi>":[["Pi","Pebi","pebi"],Math.pow(2,50),"prefix"],"<exi>":[["Ei","Exi","exi"],Math.pow(2,60),"prefix"],"<zebi>":[["Zi","Zebi","zebi"],Math.pow(2,70),"prefix"],"<yebi>":[["Yi","Yebi","yebi"],Math.pow(2,80),"prefix"],"<yotta>":[["Y","Yotta","yotta"],1e24,"prefix"],"<zetta>":[["Z","Zetta","zetta"],1e21,"prefix"],"<exa>":[["E","Exa","exa"],1e18,"prefix"],"<peta>":[["P","Peta","peta"],1e15,"prefix"],"<tera>":[["T","Tera","tera"],1e12,"prefix"],"<giga>":[["G","Giga","giga"],1e9,"prefix"],"<mega>":[["M","Mega","mega"],1e6,"prefix"],"<kilo>":[["k","kilo"],1e3,"prefix"],"<hecto>":[["h","Hecto","hecto"],100,"prefix"],"<deca>":[["da","Deca","deca","deka"],10,"prefix"],"<deci>":[["d","Deci","deci"],.1,"prefix"],"<centi>":[["c","Centi","centi"],.01,"prefix"],"<milli>":[["m","Milli","milli"],.001,"prefix"],"<micro>":[["u","\u03BC","\xB5","Micro","mc","micro"],1e-6,"prefix"],"<nano>":[["n","Nano","nano"],1e-9,"prefix"],"<pico>":[["p","Pico","pico"],1e-12,"prefix"],"<femto>":[["f","Femto","femto"],1e-15,"prefix"],"<atto>":[["a","Atto","atto"],1e-18,"prefix"],"<zepto>":[["z","Zepto","zepto"],1e-21,"prefix"],"<yocto>":[["y","Yocto","yocto"],1e-24,"prefix"],"<1>":[["1","<1>"],1,""],"<meter>":[["m","meter","meters","metre","metres"],1,"length",["<meter>"]],"<inch>":[["in","inch","inches",'"'],.0254,"length",["<meter>"]],"<foot>":[["ft","foot","feet","'"],.3048,"length",["<meter>"]],"<yard>":[["yd","yard","yards"],.9144,"length",["<meter>"]],"<mile>":[["mi","mile","miles"],1609.344,"length",["<meter>"]],"<naut-mile>":[["nmi","naut-mile"],1852,"length",["<meter>"]],"<league>":[["league","leagues"],4828,"length",["<meter>"]],"<furlong>":[["furlong","furlongs"],201.2,"length",["<meter>"]],"<rod>":[["rd","rod","rods"],5.029,"length",["<meter>"]],"<mil>":[["mil","mils"],254e-7,"length",["<meter>"]],"<angstrom>":[["ang","angstrom","angstroms"],1e-10,"length",["<meter>"]],"<fathom>":[["fathom","fathoms"],1.829,"length",["<meter>"]],"<pica>":[["pica","picas"],.00423333333,"length",["<meter>"]],"<point>":[["pt","point","points"],.000352777778,"length",["<meter>"]],"<redshift>":[["z","red-shift","redshift"],1302773e20,"length",["<meter>"]],"<AU>":[["AU","astronomical-unit"],1495979e5,"length",["<meter>"]],"<light-second>":[["ls","light-second"],299792500,"length",["<meter>"]],"<light-minute>":[["lmin","light-minute"],1798755e4,"length",["<meter>"]],"<light-year>":[["ly","light-year"],9460528e9,"length",["<meter>"]],"<parsec>":[["pc","parsec","parsecs"],3085678e10,"length",["<meter>"]],"<datamile>":[["DM","datamile"],1828.8,"length",["<meter>"]],"<kilogram>":[["kg","kilogram","kilograms"],1,"mass",["<kilogram>"]],"<AMU>":[["u","AMU","amu"],1660538921e-36,"mass",["<kilogram>"]],"<dalton>":[["Da","Dalton","Daltons","dalton","daltons"],1660538921e-36,"mass",["<kilogram>"]],"<slug>":[["slug","slugs"],14.5939029,"mass",["<kilogram>"]],"<short-ton>":[["tn","ton","short-ton"],907.18474,"mass",["<kilogram>"]],"<metric-ton>":[["t","tonne","metric-ton"],1e3,"mass",["<kilogram>"]],"<carat>":[["ct","carat","carats"],2e-4,"mass",["<kilogram>"]],"<pound>":[["lbs","lb","pound","pounds","#"],.45359237,"mass",["<kilogram>"]],"<ounce>":[["oz","ounce","ounces"],.0283495231,"mass",["<kilogram>"]],"<gram>":[["g","gram","grams","gramme","grammes"],.001,"mass",["<kilogram>"]],"<grain>":[["grain","grains","gr"],6479891e-11,"mass",["<kilogram>"]],"<dram>":[["dram","drams","dr"],.0017718452,"mass",["<kilogram>"]],"<stone>":[["stone","stones","st"],6.35029318,"mass",["<kilogram>"]],"<hectare>":[["hectare"],1e4,"area",["<meter>","<meter>"]],"<acre>":[["acre","acres"],4046.85642,"area",["<meter>","<meter>"]],"<sqft>":[["sqft"],1,"area",["<foot>","<foot>"]],"<liter>":[["l","L","liter","liters","litre","litres"],.001,"volume",["<meter>","<meter>","<meter>"]],"<gallon>":[["gal","gallon","gallons"],.0037854118,"volume",["<meter>","<meter>","<meter>"]],"<gallon-imp>":[["galimp","gallon-imp","gallons-imp"],.00454609,"volume",["<meter>","<meter>","<meter>"]],"<quart>":[["qt","quart","quarts"],.00094635295,"volume",["<meter>","<meter>","<meter>"]],"<pint>":[["pt","pint","pints"],.000473176475,"volume",["<meter>","<meter>","<meter>"]],"<pint-imp>":[["ptimp","pint-imp","pints-imp"],.00056826125,"volume",["<meter>","<meter>","<meter>"]],"<cup>":[["cu","cup","cups"],.000236588238,"volume",["<meter>","<meter>","<meter>"]],"<fluid-ounce>":[["floz","fluid-ounce","fluid-ounces"],295735297e-13,"volume",["<meter>","<meter>","<meter>"]],"<fluid-ounce-imp>":[["flozimp","floz-imp","fluid-ounce-imp","fluid-ounces-imp"],284130625e-13,"volume",["<meter>","<meter>","<meter>"]],"<tablespoon>":[["tb","tbsp","tbs","tablespoon","tablespoons"],147867648e-13,"volume",["<meter>","<meter>","<meter>"]],"<teaspoon>":[["tsp","teaspoon","teaspoons"],492892161e-14,"volume",["<meter>","<meter>","<meter>"]],"<bushel>":[["bu","bsh","bushel","bushels"],.035239072,"volume",["<meter>","<meter>","<meter>"]],"<oilbarrel>":[["bbl","oilbarrel","oilbarrels","oil-barrel","oil-barrels"],.158987294928,"volume",["<meter>","<meter>","<meter>"]],"<beerbarrel>":[["bl","bl-us","beerbarrel","beerbarrels","beer-barrel","beer-barrels"],.1173477658,"volume",["<meter>","<meter>","<meter>"]],"<beerbarrel-imp>":[["blimp","bl-imp","beerbarrel-imp","beerbarrels-imp","beer-barrel-imp","beer-barrels-imp"],.16365924,"volume",["<meter>","<meter>","<meter>"]],"<kph>":[["kph"],.277777778,"speed",["<meter>"],["<second>"]],"<mph>":[["mph"],.44704,"speed",["<meter>"],["<second>"]],"<knot>":[["kt","kn","kts","knot","knots"],.514444444,"speed",["<meter>"],["<second>"]],"<fps>":[["fps"],.3048,"speed",["<meter>"],["<second>"]],"<gee>":[["gee"],9.80665,"acceleration",["<meter>"],["<second>","<second>"]],"<Gal>":[["Gal"],.01,"acceleration",["<meter>"],["<second>","<second>"]],"<kelvin>":[["degK","kelvin"],1,"temperature",["<kelvin>"]],"<celsius>":[["degC","celsius","celsius","centigrade"],1,"temperature",["<kelvin>"]],"<fahrenheit>":[["degF","fahrenheit"],5/9,"temperature",["<kelvin>"]],"<rankine>":[["degR","rankine"],5/9,"temperature",["<kelvin>"]],"<temp-K>":[["tempK","temp-K"],1,"temperature",["<temp-K>"]],"<temp-C>":[["tempC","temp-C"],1,"temperature",["<temp-K>"]],"<temp-F>":[["tempF","temp-F"],5/9,"temperature",["<temp-K>"]],"<temp-R>":[["tempR","temp-R"],5/9,"temperature",["<temp-K>"]],"<second>":[["s","sec","secs","second","seconds"],1,"time",["<second>"]],"<minute>":[["min","mins","minute","minutes"],60,"time",["<second>"]],"<hour>":[["h","hr","hrs","hour","hours"],3600,"time",["<second>"]],"<day>":[["d","day","days"],3600*24,"time",["<second>"]],"<week>":[["wk","week","weeks"],7*3600*24,"time",["<second>"]],"<fortnight>":[["fortnight","fortnights"],1209600,"time",["<second>"]],"<year>":[["y","yr","year","years","annum"],31556926,"time",["<second>"]],"<decade>":[["decade","decades"],315569260,"time",["<second>"]],"<century>":[["century","centuries"],3155692600,"time",["<second>"]],"<pascal>":[["Pa","pascal","Pascal"],1,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<bar>":[["bar","bars"],1e5,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<mmHg>":[["mmHg"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inHg>":[["inHg"],3386.3881472,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<torr>":[["torr"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<atm>":[["atm","ATM","atmosphere","atmospheres"],101325,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<psi>":[["psi"],6894.76,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<cmh2o>":[["cmH2O","cmh2o"],98.0638,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inh2o>":[["inH2O","inh2o"],249.082052,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<poise>":[["P","poise"],.1,"viscosity",["<kilogram>"],["<meter>","<second>"]],"<stokes>":[["St","stokes"],1e-4,"viscosity",["<meter>","<meter>"],["<second>"]],"<mole>":[["mol","mole"],1,"substance",["<mole>"]],"<molar>":[["M","molar"],1e3,"molar_concentration",["<mole>"],["<meter>","<meter>","<meter>"]],"<wtpercent>":[["wt%","wtpercent"],10,"molar_concentration",["<kilogram>"],["<meter>","<meter>","<meter>"]],"<katal>":[["kat","katal","Katal"],1,"activity",["<mole>"],["<second>"]],"<unit>":[["U","enzUnit","unit"],16667e-19,"activity",["<mole>"],["<second>"]],"<farad>":[["F","farad","Farad"],1,"capacitance",["<second>","<second>","<second>","<second>","<ampere>","<ampere>"],["<meter>","<meter>","<kilogram>"]],"<coulomb>":[["C","coulomb","Coulomb"],1,"charge",["<ampere>","<second>"]],"<Ah>":[["Ah"],3600,"charge",["<ampere>","<second>"]],"<ampere>":[["A","Ampere","ampere","amp","amps"],1,"current",["<ampere>"]],"<siemens>":[["S","Siemens","siemens"],1,"conductance",["<second>","<second>","<second>","<ampere>","<ampere>"],["<kilogram>","<meter>","<meter>"]],"<henry>":[["H","Henry","henry"],1,"inductance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>","<ampere>"]],"<volt>":[["V","Volt","volt","volts"],1,"potential",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>"]],"<ohm>":[["Ohm","ohm","\u03A9","\u2126"],1,"resistance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>","<ampere>"]],"<weber>":[["Wb","weber","webers"],1,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<tesla>":[["T","tesla","teslas"],1,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<gauss>":[["G","gauss"],1e-4,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<maxwell>":[["Mx","maxwell","maxwells"],1e-8,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<oersted>":[["Oe","oersted","oersteds"],250/Math.PI,"magnetism",["<ampere>"],["<meter>"]],"<joule>":[["J","joule","Joule","joules","Joules"],1,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<erg>":[["erg","ergs"],1e-7,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<btu>":[["BTU","btu","BTUs"],1055.056,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<calorie>":[["cal","calorie","calories"],4.184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Calorie>":[["Cal","Calorie","Calories"],4184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<therm-US>":[["th","therm","therms","Therm","therm-US"],105480400,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Wh>":[["Wh"],3600,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<electronvolt>":[["eV","electronvolt","electronvolts"],1602176634e-28,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<newton>":[["N","Newton","newton"],1,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<dyne>":[["dyn","dyne"],1e-5,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<pound-force>":[["lbf","pound-force"],4.448222,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<hertz>":[["Hz","hertz","Hertz"],1,"frequency",["<1>"],["<second>"]],"<radian>":[["rad","radian","radians"],1,"angle",["<radian>"]],"<degree>":[["deg","degree","degrees"],Math.PI/180,"angle",["<radian>"]],"<arcminute>":[["arcmin","arcminute","arcminutes"],Math.PI/10800,"angle",["<radian>"]],"<arcsecond>":[["arcsec","arcsecond","arcseconds"],Math.PI/648e3,"angle",["<radian>"]],"<gradian>":[["gon","grad","gradian","grads"],Math.PI/200,"angle",["<radian>"]],"<steradian>":[["sr","steradian","steradians"],1,"solid_angle",["<steradian>"]],"<rotation>":[["rotation"],2*Math.PI,"angle",["<radian>"]],"<rpm>":[["rpm"],2*Math.PI/60,"angular_velocity",["<radian>"],["<second>"]],"<byte>":[["B","byte","bytes"],1,"information",["<byte>"]],"<bit>":[["b","bit","bits"],.125,"information",["<byte>"]],"<Bps>":[["Bps"],1,"information_rate",["<byte>"],["<second>"]],"<bps>":[["bps"],.125,"information_rate",["<byte>"],["<second>"]],"<dollar>":[["USD","dollar"],1,"currency",["<dollar>"]],"<cents>":[["cents"],.01,"currency",["<dollar>"]],"<candela>":[["cd","candela"],1,"luminosity",["<candela>"]],"<lumen>":[["lm","lumen"],1,"luminous_power",["<candela>","<steradian>"]],"<lux>":[["lux"],1,"illuminance",["<candela>","<steradian>"],["<meter>","<meter>"]],"<watt>":[["W","watt","watts"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<volt-ampere>":[["VA","volt-ampere"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<volt-ampere-reactive>":[["var","Var","VAr","VAR","volt-ampere-reactive"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<horsepower>":[["hp","horsepower"],745.699872,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<gray>":[["Gy","gray","grays"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<roentgen>":[["R","roentgen"],.00933,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<sievert>":[["Sv","sievert","sieverts"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<becquerel>":[["Bq","becquerel","becquerels"],1,"radiation",["<1>"],["<second>"]],"<curie>":[["Ci","curie","curies"],37e9,"radiation",["<1>"],["<second>"]],"<cpm>":[["cpm"],1/60,"rate",["<count>"],["<second>"]],"<dpm>":[["dpm"],1/60,"rate",["<count>"],["<second>"]],"<bpm>":[["bpm"],1/60,"rate",["<count>"],["<second>"]],"<dot>":[["dot","dots"],1,"resolution",["<each>"]],"<pixel>":[["pixel","px"],1,"resolution",["<each>"]],"<ppi>":[["ppi"],1,"resolution",["<pixel>"],["<inch>"]],"<dpi>":[["dpi"],1,"typography",["<dot>"],["<inch>"]],"<cell>":[["cells","cell"],1,"counting",["<each>"]],"<each>":[["each"],1,"counting",["<each>"]],"<count>":[["count"],1,"counting",["<each>"]],"<base-pair>":[["bp","base-pair"],1,"counting",["<each>"]],"<nucleotide>":[["nt","nucleotide"],1,"counting",["<each>"]],"<molecule>":[["molecule","molecules"],1,"counting",["<1>"]],"<dozen>":[["doz","dz","dozen"],12,"prefix_only",["<each>"]],"<percent>":[["%","percent"],.01,"prefix_only",["<1>"]],"<ppm>":[["ppm"],1e-6,"prefix_only",["<1>"]],"<ppb>":[["ppb"],1e-9,"prefix_only",["<1>"]],"<ppt>":[["ppt"],1e-12,"prefix_only",["<1>"]],"<ppq>":[["ppq"],1e-15,"prefix_only",["<1>"]],"<gross>":[["gr","gross"],144,"prefix_only",["<dozen>","<dozen>"]],"<decibel>":[["dB","decibel","decibels"],1,"logarithmic",["<decibel>"]]},sr=["<meter>","<kilogram>","<second>","<mole>","<ampere>","<radian>","<kelvin>","<temp-K>","<byte>","<dollar>","<candela>","<each>","<steradian>","<decibel>"],J="<1>",C=[J];function or(e,r){var i=r[1],a=r[3]||[],o=r[4]||[];if(!t(i))throw new p(e+": Invalid unit definition. 'scalar' must be a number");a.forEach(function(c){if(x[c]===void 0)throw new p(e+": Invalid unit definition. Unit "+c+" in 'numerator' is not recognized")}),o.forEach(function(c){if(x[c]===void 0)throw new p(e+": Invalid unit definition. Unit "+c+" in 'denominator' is not recognized")})}var A={},X={},S={},K={},Q={};for(var R in x)if(x.hasOwnProperty(R)){var O=x[R];if(O[2]==="prefix"){A[R]=O[1];for(var ce=0;ce<O[0].length;ce++)X[O[0][ce]]=R}else{or(R,O),S[R]={scalar:O[1],numerator:O[3],denominator:O[4]};for(var ue=0;ue<O[0].length;ue++)K[O[0][ue]]=R}Q[R]=O[0][0]}function lr(e){var r,i=[],a=Object.keys(x);if(typeof e>"u")for(r=0;r<a.length;r++)["","prefix"].indexOf(x[a[r]][2])===-1&&i.push(a[r].substr(1,a[r].length-2));else{if(this.getKinds().indexOf(e)===-1)throw new p("Kind not recognized");for(r=0;r<a.length;r++)x[a[r]][2]===e&&i.push(a[r].substr(1,a[r].length-2))}return i.sort(function(o,c){return o.toLowerCase()<c.toLowerCase()?-1:o.toLowerCase()>c.toLowerCase()?1:0})}function cr(e){if(!K[e])throw new p("Unit not recognized");return x[K[e]][0]}var me=["length","time","temperature","mass","current","substance","luminosity","currency","information","angle"];function ur(){if(this.signature)return this.signature;for(var e=He.call(this),r=0;r<e.length;r++)e[r]*=Math.pow(20,r);return e.reduce(function(i,a){return i+a},0)}function He(){if(!this.isBase())return He.call(this.toBase());for(var e=new Array(me.length),r=0;r<e.length;r++)e[r]=0;for(var i,a,o=0;o<this.numerator.length;o++)(i=x[this.numerator[o]])&&(a=me.indexOf(i[2]),a>=0&&(e[a]=e[a]+1));for(var c=0;c<this.denominator.length;c++)(i=x[this.denominator[c]])&&(a=me.indexOf(i[2]),a>=0&&(e[a]=e[a]-1));return e}var Be="[+-]",de="\\d+",mr=Be+"?"+de,Ge="\\."+de,dr="(?:"+de+"(?:"+Ge+")?)|(?:"+Ge+")",pr="[Ee]"+mr,hr="(?:"+dr+")(?:"+pr+")?",fr=Be+"?\\s*"+hr,gr="("+fr+")?\\s*([^/]*)(?:/(.+))?",yr=new RegExp("^"+gr+"$"),We="\\^|\\*{2}",je="[01234]",vr=new RegExp("([^ \\*\\d]+?)(?:"+We+")?(-?"+je+"(?![a-zA-Z]))"),_r=new RegExp("([^ \\*\\d]+?)(?:"+We+")?("+je+"(?![a-zA-Z]))");function Ye(e){u(e)||(e=e.toString()),e=e.trim();var r=yr.exec(e);if(!r)throw new p(e+": Quantity not recognized");var i=r[1];i?(i=i.replace(/\s/g,""),this.scalar=parseFloat(i)):this.scalar=1;for(var a=r[2],o=r[3],c,_,g;r=vr.exec(a);){if(c=parseFloat(r[2]),isNaN(c))throw new p("Unit exponent is not a number");if(c===0&&!pe.test(r[1]))throw new p("Unit not recognized");_=r[1]+" ",g="";for(var b=0;b<Math.abs(c);b++)g+=_;c>=0?a=a.replace(r[0],g):(o=o?o+g:g,a=a.replace(r[0],""))}for(;r=_r.exec(o);){if(c=parseFloat(r[2]),isNaN(c))throw new p("Unit exponent is not a number");if(c===0&&!pe.test(r[1]))throw new p("Unit not recognized");_=r[1]+" ",g="";for(var M=0;M<c;M++)g+=_;o=o.replace(r[0],g)}a&&(this.numerator=Qe(a.trim())),o&&(this.denominator=Qe(o.trim()))}var br=Object.keys(X).sort(function(e,r){return r.length-e.length}).join("|"),wr=Object.keys(K).sort(function(e,r){return r.length-e.length}).join("|"),Cr="\\b|$",Je="("+br+")??("+wr+")(?:"+Cr+")",pe=new RegExp("^\\s*("+Je+"[\\s\\*]*)+$"),kr=new RegExp(Je,"g"),Xe={};function Qe(e){var r=Xe[e];if(r)return r;var i,a=[];if(!pe.test(e))throw new p("Unit not recognized");for(;i=kr.exec(e);)a.push(i.slice(1));return a=a.map(function(o){return X[o[0]]?[X[o[0]],K[o[1]]]:[K[o[1]]]}),a=a.reduce(function(o,c){return o.concat(c)},[]),a=a.filter(function(o){return o}),Xe[e]=a,a}function Sr(e){if(!u(e))throw new p("Argument should be a string");try{return this(e)}catch{return null}}function Z(e){return e instanceof m}function m(e,r){if(Mr.apply(null,arguments),!Z(this))return new m(e,r);if(this.scalar=null,this.baseScalar=null,this.signature=null,this._conversionCache={},this.numerator=C,this.denominator=C,Ze(e)?(this.scalar=e.scalar,this.numerator=e.numerator&&e.numerator.length!==0?e.numerator:C,this.denominator=e.denominator&&e.denominator.length!==0?e.denominator:C):r?(Ye.call(this,r),this.scalar=e):Ye.call(this,e),this.denominator.join("*").indexOf("temp")>=0)throw new p("Cannot divide with temperatures");if(this.numerator.join("*").indexOf("temp")>=0){if(this.numerator.length>1)throw new p("Cannot multiply by temperatures");if(!l(this.denominator,C))throw new p("Cannot divide with temperatures")}if(this.initValue=e,xr.call(this),this.isTemperature()&&this.baseScalar<0)throw new p("Temperatures must not be less than absolute zero")}m.prototype={constructor:m};function Mr(e,r){if(r){if(!(t(e)&&u(r)))throw new p("Only number accepted as initialization value when units are explicitly provided")}else if(!(u(e)||t(e)||Z(e)||Ze(e)))throw new p("Only string, number or quantity accepted as single initialization value")}function Ze(e){return e&&typeof e=="object"&&e.hasOwnProperty("scalar")}function xr(){if(this.baseScalar)return this.baseScalar;if(this.isBase())this.baseScalar=this.scalar,this.signature=ur.call(this);else{var e=this.toBase();this.baseScalar=e.scalar,this.signature=e.signature}}var he={"-312078":"elastance","-312058":"resistance","-312038":"inductance","-152058":"potential","-152040":"magnetism","-152038":"magnetism","-7997":"specific_volume","-79":"snap","-59":"jolt","-39":"acceleration","-38":"radiation","-20":"frequency","-19":"speed","-18":"viscosity","-17":"volumetric_flow","-1":"wavenumber",0:"unitless",1:"length",2:"area",3:"volume",20:"time",400:"temperature",7941:"yank",7942:"power",7959:"pressure",7961:"force",7962:"energy",7979:"viscosity",7981:"momentum",7982:"angular_momentum",7997:"density",7998:"area_density",8e3:"mass",152020:"radiation_exposure",159999:"magnetism",16e4:"current",160020:"charge",312058:"conductance",312078:"capacitance",3199980:"activity",3199997:"molar_concentration",32e5:"substance",63999998:"illuminance",64e6:"luminous_power",128e7:"currency","25599999980":"information_rate","25600000000":"information","511999999980":"angular_velocity","512000000000":"angle"};function Or(){return s(Object.keys(he).map(function(e){return he[e]}))}m.prototype.kind=function(){return he[this.signature.toString()]},h(m.prototype,{isDegrees:function(){return(this.signature===null||this.signature===400)&&this.numerator.length===1&&l(this.denominator,C)&&(this.numerator[0].match(/<temp-[CFRK]>/)||this.numerator[0].match(/<(kelvin|celsius|rankine|fahrenheit)>/))},isTemperature:function(){return this.isDegrees()&&this.numerator[0].match(/<temp-[CFRK]>/)}});function Tr(e,r){var i=e.units(),a=r.to(i),o=m(fe(i));return m({scalar:e.scalar-a.scalar,numerator:o.numerator,denominator:o.denominator})}function Er(e,r){var i=r.to(fe(e.units()));return m({scalar:e.scalar-i.scalar,numerator:e.numerator,denominator:e.denominator})}function $e(e,r){var i=r.to(fe(e.units()));return m({scalar:e.scalar+i.scalar,numerator:e.numerator,denominator:e.denominator})}function fe(e){if(e==="tempK")return"degK";if(e==="tempC")return"degC";if(e==="tempF")return"degF";if(e==="tempR")return"degR";throw new p("Unknown type for temp conversion from: "+e)}function Ar(e,r){var i=Dr(e),a=r.units(),o;if(a==="degK")o=i.scalar;else if(a==="degC")o=i.scalar;else if(a==="degF")o=i.scalar*9/5;else if(a==="degR")o=i.scalar*9/5;else throw new p("Unknown type for degree conversion to: "+a);return m({scalar:o,numerator:r.numerator,denominator:r.denominator})}function Dr(e){var r=e.units(),i;if(r.match(/(deg)[CFRK]/))i=e.baseScalar;else if(r==="tempK")i=e.scalar;else if(r==="tempC")i=e.scalar;else if(r==="tempF")i=e.scalar*5/9;else if(r==="tempR")i=e.scalar*5/9;else throw new p("Unknown type for temp conversion from: "+r);return m({scalar:i,numerator:["<kelvin>"],denominator:C})}function Rr(e,r){var i=r.units(),a;if(i==="tempK")a=e.baseScalar;else if(i==="tempC")a=e.baseScalar-273.15;else if(i==="tempF")a=e.baseScalar*9/5-459.67;else if(i==="tempR")a=e.baseScalar*9/5;else throw new p("Unknown type for temp conversion to: "+i);return m({scalar:a,numerator:r.numerator,denominator:r.denominator})}function Ir(e){var r=e.units(),i;if(r.match(/(deg)[CFRK]/))i=e.baseScalar;else if(r==="tempK")i=e.scalar;else if(r==="tempC")i=e.scalar+273.15;else if(r==="tempF")i=(e.scalar+459.67)*5/9;else if(r==="tempR")i=e.scalar*5/9;else throw new p("Unknown type for temp conversion from: "+r);return m({scalar:i,numerator:["<temp-K>"],denominator:C})}h(m.prototype,{to:function(e){var r,i;if(e==null)return this;if(!u(e))return this.to(e.units());if(r=this._conversionCache[e],r)return r;if(i=m(e),i.units()===this.units())return this;if(!this.isCompatible(i))this.isInverse(i)?i=this.inverse().to(e):W(this.units(),i.units());else if(i.isTemperature())i=Rr(this,i);else if(i.isDegrees())i=Ar(this,i);else{var a=v(this.baseScalar,i.baseScalar);i=m({scalar:a,numerator:i.numerator,denominator:i.denominator})}return this._conversionCache[e]=i,i},toBase:function(){if(this.isBase())return this;if(this.isTemperature())return Ir(this);var e=et[this.units()];return e||(e=Pr(this.numerator,this.denominator),et[this.units()]=e),e.mul(this.scalar)},toFloat:function(){if(this.isUnitless())return this.scalar;throw new p("Can't convert to Float unless unitless. Use Unit#scalar")},toPrec:function(e){if(u(e)&&(e=m(e)),t(e)&&(e=m(e+" "+this.units())),this.isUnitless()?e.isUnitless()||W(this.units(),e.units()):e=e.to(this.units()),e.scalar===0)throw new p("Divide by zero");var r=f(Math.round(this.scalar/e.scalar),e.scalar);return m(r+this.units())}});function Fr(e,r){var i=m(e),a=m(r);if(i.eq(a))return n;var o;return i.isTemperature()?o=function(c){return i.mul(c).to(a).scalar}:o=function(c){return c*i.baseScalar/a.baseScalar},function(_){var g,b,M;if(Array.isArray(_)){for(b=_.length,M=[],g=0;g<b;g++)M.push(o(_[g]));return M}else return o(_)}}var et={};function Pr(e,r){for(var i=[],a=[],o=1,c,_=0;_<e.length;_++)c=e[_],A[c]?o=f(o,A[c]):S[c]&&(o*=S[c].scalar,S[c].numerator&&i.push(S[c].numerator),S[c].denominator&&a.push(S[c].denominator));for(var g=0;g<r.length;g++)c=r[g],A[c]?o/=A[c]:S[c]&&(o/=S[c].scalar,S[c].numerator&&a.push(S[c].numerator),S[c].denominator&&i.push(S[c].denominator));return i=i.reduce(function(b,M){return b.concat(M)},[]),a=a.reduce(function(b,M){return b.concat(M)},[]),m({scalar:o,numerator:i,denominator:a})}m.parse=Sr,m.getUnits=lr,m.getAliases=cr,m.mulSafe=f,m.divSafe=v,m.getKinds=Or,m.swiftConverter=Fr,m.Error=p,h(m.prototype,{add:function(e){if(u(e)&&(e=m(e)),this.isCompatible(e)||W(this.units(),e.units()),this.isTemperature()&&e.isTemperature())throw new p("Cannot add two temperatures");return this.isTemperature()?$e(this,e):e.isTemperature()?$e(e,this):m({scalar:this.scalar+e.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},sub:function(e){if(u(e)&&(e=m(e)),this.isCompatible(e)||W(this.units(),e.units()),this.isTemperature()&&e.isTemperature())return Tr(this,e);if(this.isTemperature())return Er(this,e);if(e.isTemperature())throw new p("Cannot subtract a temperature from a differential degree unit");return m({scalar:this.scalar-e.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},mul:function(e){if(t(e))return m({scalar:f(this.scalar,e),numerator:this.numerator,denominator:this.denominator});if(u(e)&&(e=m(e)),(this.isTemperature()||e.isTemperature())&&!(this.isUnitless()||e.isUnitless()))throw new p("Cannot multiply by temperatures");var r=this,i=e;r.isCompatible(i)&&r.signature!==400&&(i=i.to(r));var a=tt(r.numerator,r.denominator,i.numerator,i.denominator);return m({scalar:f(r.scalar,i.scalar,a[2]),numerator:a[0],denominator:a[1]})},div:function(e){if(t(e)){if(e===0)throw new p("Divide by zero");return m({scalar:this.scalar/e,numerator:this.numerator,denominator:this.denominator})}else u(e)&&(e=m(e));if(e.scalar===0)throw new p("Divide by zero");if(e.isTemperature())throw new p("Cannot divide with temperatures");if(this.isTemperature()&&!e.isUnitless())throw new p("Cannot divide with temperatures");var r=this,i=e;r.isCompatible(i)&&r.signature!==400&&(i=i.to(r));var a=tt(r.numerator,r.denominator,i.denominator,i.numerator);return m({scalar:f(r.scalar,a[2])/i.scalar,numerator:a[0],denominator:a[1]})},inverse:function(){if(this.isTemperature())throw new p("Cannot divide with temperatures");if(this.scalar===0)throw new p("Divide by zero");return m({scalar:1/this.scalar,numerator:this.denominator,denominator:this.numerator})}});function tt(e,r,i,a){function o(T){return T!==J}e=e.filter(o),i=i.filter(o),r=r.filter(o),a=a.filter(o);var c={};function _(T,F){for(var E,$,ye,P=0;P<T.length;P++)if(A[T[P]]?(E=T[P+1],$=T[P],ye=A[$],P++):(E=T[P],$=null,ye=1),E&&E!==J)if(c[E]){c[E][0]+=F;var zr=c[E][2]?A[c[E][2]]:1;c[E][F===1?3:4]*=v(ye,zr)}else c[E]=[F,E,$,1,1]}_(e,1),_(r,-1),_(i,1),_(a,-1);var g=[],b=[],M=1;for(var nt in c)if(c.hasOwnProperty(nt)){var k=c[nt],N;if(k[0]>0)for(N=0;N<k[0];N++)g.push(k[2]===null?k[1]:[k[2],k[1]]);else if(k[0]<0)for(N=0;N<-k[0];N++)b.push(k[2]===null?k[1]:[k[2],k[1]]);M*=v(k[3],k[4])}return g.length===0&&(g=C),b.length===0&&(b=C),g=g.reduce(function(T,F){return T.concat(F)},[]),b=b.reduce(function(T,F){return T.concat(F)},[]),[g,b,M]}h(m.prototype,{eq:function(e){return this.compareTo(e)===0},lt:function(e){return this.compareTo(e)===-1},lte:function(e){return this.eq(e)||this.lt(e)},gt:function(e){return this.compareTo(e)===1},gte:function(e){return this.eq(e)||this.gt(e)},compareTo:function(e){if(u(e))return this.compareTo(m(e));if(this.isCompatible(e)||W(this.units(),e.units()),this.baseScalar<e.baseScalar)return-1;if(this.baseScalar===e.baseScalar)return 0;if(this.baseScalar>e.baseScalar)return 1},same:function(e){return this.scalar===e.scalar&&this.units()===e.units()}}),h(m.prototype,{isUnitless:function(){return[this.numerator,this.denominator].every(function(e){return l(e,C)})},isCompatible:function(e){return u(e)?this.isCompatible(m(e)):Z(e)&&e.signature!==void 0?this.signature===e.signature:!1},isInverse:function(e){return this.inverse().isCompatible(e)},isBase:function(){return this._isBase!==void 0?this._isBase:this.isDegrees()&&this.numerator[0].match(/<(kelvin|temp-K)>/)?(this._isBase=!0,this._isBase):(this.numerator.concat(this.denominator).forEach(function(e){e!==J&&sr.indexOf(e)===-1&&(this._isBase=!1)},this),this._isBase===!1?this._isBase:(this._isBase=!0,this._isBase))}});function ge(){}ge.prototype.get=function(e){return arguments.length>1&&(e=Array.apply(null,arguments)),e.reduce(function(r,i,a){if(r){var o=r[i];return a===e.length-1?o?o.data:void 0:o}},this)},ge.prototype.set=function(e,r){return arguments.length>2&&(e=Array.prototype.slice.call(arguments,0,-1),r=arguments[arguments.length-1]),e.reduce(function(i,a,o){var c=i[a];return c===void 0&&(c=i[a]={}),o===e.length-1?(c.data=r,r):c},this)};function qr(e,r){return(e+" "+r).trim()}m.formatter=qr,h(m.prototype,{units:function(){if(this._units!==void 0)return this._units;var e=l(this.numerator,C),r=l(this.denominator,C);if(e&&r)return this._units="",this._units;var i=it(this.numerator),a=it(this.denominator);return this._units=i+(r?"":"/"+a),this._units},toString:function(e,r){var i;if(t(e))i=this.units(),r=e;else if(u(e))i=e;else if(Z(e))return this.toPrec(e).toString(r);var a=this.to(i),o=r!==void 0?Y(a.scalar,r):a.scalar;return a=(o+" "+a.units()).trim(),a},format:function(e,r){arguments.length===1&&typeof e=="function"&&(r=e,e=void 0),r=r||m.formatter;var i=this.to(e);return r.call(this,i.scalar,i.units())}});var rt=new ge;function it(e){var r=rt.get(e);if(r)return r;var i=l(e,C);return i?r="1":r=Lr(Ur(e)).join("*"),rt.set(e,r),r}function Ur(e){for(var r=[],i,a,o=0;o<e.length;o++)i=e[o],a=e[o+1],A[i]?(r.push(Q[i]+Q[a]),o++):r.push(Q[i]);return r}function Lr(e){var r=e.reduce(function(i,a){var o=i[a];return o||i.push(o=i[a]=[a,0]),o[1]++,i},[]);return r.map(function(i){return i[0]+(i[1]>1?i[1]:"")})}return m.version="1.8.0",m})});var d=Nr(Qt());var li=(()=>{class u{AppSettingsService=y(xt);data=y(Rt);_defaultUnitsSub;_conversionList=[{group:"Unitless",units:[{measure:"unitless",description:"As-Is numeric value"},{measure:" ",description:"No unit label - As-Is numeric value"}]},{group:"Speed",units:[{measure:"knots",description:"Knots - Nautical miles per hour"},{measure:"kph",description:"kph - Kilometers per hour"},{measure:"mph",description:"mph - Miles per hour"},{measure:"m/s",description:"m/s - Meters per second (base)"}]},{group:"Flow",units:[{measure:"m3/s",description:"Cubic meters per second (base)"},{measure:"l/min",description:"Liters per minute"},{measure:"l/h",description:"Liters per hour"},{measure:"g/min",description:"Gallons per minute"},{measure:"g/h",description:"Gallons per hour"}]},{group:"Fuel Distance",units:[{measure:"m/m3",description:"Meters per cubic meter (base)"},{measure:"nm/l",description:"Nautical Miles per liter"},{measure:"nm/g",description:"Nautical Miles per gallon"},{measure:"km/l",description:"Kilometers per liter"},{measure:"mpg",description:"Miles per Gallon"}]},{group:"Energy Distance",units:[{measure:"m/J",description:"Meters per Joule (base)"},{measure:"nm/J",description:"Nautical Miles per Joule"},{measure:"km/J",description:"Kilometers per Joule"},{measure:"nm/kWh",description:"Nautical Miles per Kilowatt-hour"},{measure:"km/kWh",description:"Kilometers per Kilowatt-hour"}]},{group:"Temperature",units:[{measure:"K",description:"Kelvin (base)"},{measure:"celsius",description:"Celsius"},{measure:"fahrenheit",description:"Fahrenheit"}]},{group:"Length",units:[{measure:"m",description:"Meters (base)"},{measure:"mm",description:"Millimeters"},{measure:"fathom",description:"Fathoms"},{measure:"nm",description:"Nautical Miles"},{measure:"km",description:"Kilometers"},{measure:"mi",description:"Miles"},{measure:"feet",description:"Feet"},{measure:"inch",description:"Inches"}]},{group:"Volume",units:[{measure:"liter",description:"Liters (base)"},{measure:"m3",description:"Cubic Meters"},{measure:"gallon",description:"Gallons"}]},{group:"Current",units:[{measure:"A",description:"Amperes (base)"},{measure:"mA",description:"Milliamperes"}]},{group:"Potential",units:[{measure:"V",description:"Volts (base)"},{measure:"mV",description:"Millivolts"}]},{group:"Charge",units:[{measure:"C",description:"Coulomb (base)"},{measure:"Ah",description:"Ampere*Hours"}]},{group:"Power",units:[{measure:"W",description:"Watts (base)"},{measure:"mW",description:"Milliwatts"}]},{group:"Energy",units:[{measure:"J",description:"Joules (base)"},{measure:"kWh",description:"Kilowatt*Hours"}]},{group:"Resistance",units:[{measure:"ohm",description:"\u2126 (base)"},{measure:"kiloohm",description:"k\u2126"}]},{group:"Pressure",units:[{measure:"Pa",description:"Pa (base)"},{measure:"kPa",description:"kPa"},{measure:"hPa",description:"hPa"},{measure:"mbar",description:"mbar"},{measure:"bar",description:"Bars"},{measure:"psi",description:"psi"},{measure:"mmHg",description:"mmHg"},{measure:"inHg",description:"inHg"}]},{group:"Density",units:[{measure:"kg/m3",description:"Air density - kg/cubic meter (base)"}]},{group:"Time",units:[{measure:"s",description:"Seconds (base)"},{measure:"Minutes",description:"Minutes"},{measure:"Hours",description:"Hours"},{measure:"Days",description:"Days"},{measure:"D HH:MM:SS",description:"Day Hour:Minute:sec"}]},{group:"Angular Velocity",units:[{measure:"rad/s",description:"Radians per second (base)"},{measure:"deg/s",description:"Degrees per second"},{measure:"deg/min",description:"Degrees per minute"}]},{group:"Angle",units:[{measure:"rad",description:"Radians (base)"},{measure:"deg",description:"Degrees"},{measure:"grad",description:"Gradians"}]},{group:"Frequency",units:[{measure:"rpm",description:"RPM - Rotations per minute"},{measure:"Hz",description:"Hz - Hertz (base)"},{measure:"KHz",description:"KHz - Kilohertz"},{measure:"MHz",description:"MHz - Megahertz"},{measure:"GHz",description:"GHz - Gigahertz"}]},{group:"Ratio",units:[{measure:"percent",description:"As percentage value"},{measure:"percentraw",description:"As ratio 0-1 with % sign"},{measure:"ratio",description:"Ratio 0-1 (base)"}]},{group:"Position",units:[{measure:"pdeg",description:"Position Degrees"},{measure:"latitudeMin",description:"Latitude in minutes"},{measure:"latitudeSec",description:"Latitude in seconds"},{measure:"longitudeMin",description:"Longitude in minutes"},{measure:"longitudeSec",description:"Longitude in seconds"}]}];skBaseUnits=[{unit:"s",properties:{display:"s",quantity:"Time",quantityDisplay:"t",description:"Elapsed time (interval) in seconds"}},{unit:"Hz",properties:{display:"Hz",quantity:"Frequency",quantityDisplay:"f",description:"Frequency in Hertz"}},{unit:"m3",properties:{display:"m\xB3",quantity:"Volume",quantityDisplay:"V",description:"Volume in cubic meters"}},{unit:"m3/s",properties:{display:"m\xB3/s",quantity:"Flow",quantityDisplay:"Q",description:"Liquid or gas flow in cubic meters per second"}},{unit:"kg/s",properties:{display:"kg/s",quantity:"Mass flow rate",quantityDisplay:"\u1E41",description:"Liquid or gas flow in kilograms per second"}},{unit:"kg/m3",properties:{display:"kg/m\xB3",quantity:"Density",quantityDisplay:"\u03C1",description:"Density in kg per cubic meter"}},{unit:"deg",properties:{display:"Position",quantity:"Angle",quantityDisplay:"\u2220",description:"Latitude or longitude in decimal degrees"}},{unit:"rad",properties:{display:"\xB0",quantity:"Angle",quantityDisplay:"\u2220",description:"Angular arc in radians"}},{unit:"rad/s",properties:{display:"\u33AD/s",quantity:"Rotation",quantityDisplay:"\u03C9",description:"Angular rate in radians per second"}},{unit:"A",properties:{display:"A",quantity:"Current",quantityDisplay:"I",description:"Electrical current in ampere"}},{unit:"C",properties:{display:"C",quantity:"Charge",quantityDisplay:"Q",description:"Electrical charge in Coulomb"}},{unit:"V",properties:{display:"V",quantity:"Voltage",quantityDisplay:"V",description:"Electrical potential in volt"}},{unit:"W",properties:{display:"W",quantity:"Power",quantityDisplay:"P",description:"Power in watt"}},{unit:"Nm",properties:{display:"Nm",quantity:"Torque",quantityDisplay:"\u03C4",description:"Torque in Newton meter"}},{unit:"J",properties:{display:"J",quantity:"Energy",quantityDisplay:"E",description:"Electrical energy in joule"}},{unit:"ohm",properties:{display:"\u2126",quantity:"Resistance",quantityDisplay:"R",description:"Electrical resistance in ohm"}},{unit:"m",properties:{display:"m",quantity:"Distance",quantityDisplay:"d",description:"Distance in meters"}},{unit:"m/s",properties:{display:"m/s",quantity:"Speed",quantityDisplay:"v",description:"Speed in meters per second"}},{unit:"m2",properties:{display:"\u33A1",quantity:"Area",quantityDisplay:"A",description:"(Surface) area in square meters"}},{unit:"K",properties:{display:"K",quantity:"Temperature",quantityDisplay:"T",description:"Temperature in kelvin"}},{unit:"Pa",properties:{display:"Pa",quantity:"Pressure",quantityDisplay:"P",description:"Pressure in pascal"}},{unit:"kg",properties:{display:"kg",quantity:"Mass",quantityDisplay:"m",description:"Mass in kilogram"}},{unit:"ratio",properties:{display:"",quantity:"Ratio",quantityDisplay:"\u03C6",description:"Relative value compared to reference or normal value. 0 = 0%, 1 = 100%, 1e-3 = 1 ppt"}},{unit:"m/s2",properties:{display:"m/s\xB2",quantity:"Acceleration",quantityDisplay:"a",description:"Acceleration in meters per second squared"}},{unit:"rad/s2",properties:{display:"rad/s\xB2",quantity:"Angular acceleration",quantityDisplay:"a",description:"Angular acceleration in radians per second squared"}},{unit:"N",properties:{display:"N",quantity:"Force",quantityDisplay:"F",description:"Force in newton"}},{unit:"T",properties:{display:"T",quantity:"Magnetic field",quantityDisplay:"B",description:"Magnetic field strength in tesla"}},{unit:"Lux",properties:{display:"lx",quantity:"Light Intensity",quantityDisplay:"Ev",description:"Light Intensity in lux"}},{unit:"Pa/s",properties:{display:"Pa/s",quantity:"Pressure rate",quantityDisplay:"R",description:"Pressure change rate in pascal per second"}},{unit:"Pa.s",properties:{display:"Pa s",quantity:"Viscosity",quantityDisplay:"\u03BC",description:"Viscosity in pascal seconds"}}];_defaultUnits=null;constructor(){this._defaultUnitsSub=this.AppSettingsService.getDefaultUnitsAsO().subscribe(t=>{this._defaultUnits=t})}unitConversionFunctions={unitless:function(t){return t}," ":function(t){return t},knots:d.default.swiftConverter("m/s","kn"),kph:d.default.swiftConverter("m/s","kph"),"m/s":function(t){return t},mph:d.default.swiftConverter("m/s","mph"),liter:d.default.swiftConverter("m^3","liter"),gallon:d.default.swiftConverter("m^3","gallon"),m3:function(t){return t},"m3/s":function(t){return t},"l/min":d.default.swiftConverter("m^3/s","liter/minute"),"l/h":d.default.swiftConverter("m^3/s","liter/hour"),"g/min":d.default.swiftConverter("m^3/s","gallon/minute"),"g/h":d.default.swiftConverter("m^3/s","gallon/hour"),"m/m3":function(t){return t},"nm/l":d.default.swiftConverter("m/m^3","naut-mile/liter"),"nm/g":d.default.swiftConverter("m/m^3","naut-mile/gallon"),"km/l":d.default.swiftConverter("m/m^3","km/liter"),mpg:d.default.swiftConverter("m/m^3","mile/gallon"),"m/J":function(t){return t},"nm/J":d.default.swiftConverter("m/J","naut-mile/J"),"km/J":d.default.swiftConverter("km/J","km/J"),"nm/kWh":d.default.swiftConverter("m/J","naut-mile/kWh"),"km/kWh":d.default.swiftConverter("m/J","km/kWh"),K:function(t){return t},celsius:d.default.swiftConverter("tempK","tempC"),fahrenheit:d.default.swiftConverter("tempK","tempF"),m:function(t){return t},mm:function(t){return t*1e3},fathom:d.default.swiftConverter("m","fathom"),feet:d.default.swiftConverter("m","foot"),inch:d.default.swiftConverter("m","in"),km:d.default.swiftConverter("m","km"),nm:d.default.swiftConverter("m","nmi"),mi:d.default.swiftConverter("m","mi"),V:function(t){return t},mV:function(t){return t*1e3},A:function(t){return t},mA:function(t){return t*1e3},C:function(t){return t},Ah:d.default.swiftConverter("C","Ah"),W:function(t){return t},mW:function(t){return t*1e3},J:function(t){return t},kWh:d.default.swiftConverter("J","kWh"),ohm:function(t){return t},kiloohm:function(t){return t/1e3},Pa:function(t){return t},bar:d.default.swiftConverter("Pa","bar"),psi:d.default.swiftConverter("Pa","psi"),mmHg:d.default.swiftConverter("Pa","mmHg"),inHg:d.default.swiftConverter("Pa","inHg"),hPa:d.default.swiftConverter("Pa","hPa"),kPa:d.default.swiftConverter("Pa","kPa"),mbar:d.default.swiftConverter("Pa","millibar"),"kg/m3":function(t){return t},s:function(t){return t},Minutes:d.default.swiftConverter("s","minutes"),Hours:d.default.swiftConverter("s","hours"),Days:d.default.swiftConverter("s","days"),"D HH:MM:SS":function(t){t=parseInt(t,10);let n=t<0;t=Math.abs(t);let s=Math.floor(t/86400),l=Math.floor(t%86400/3600),h=Math.floor(t%3600/60),f=Math.floor(t%60),v=n?"-":"";return s>0?v+=s+"d "+l.toString()+":"+h.toString().padStart(2,"0")+":"+f.toString().padStart(2,"0"):v+=l.toString()+":"+h.toString().padStart(2,"0")+":"+f.toString().padStart(2,"0"),v},"rad/s":function(t){return t},"deg/s":d.default.swiftConverter("rad/s","deg/s"),"deg/min":d.default.swiftConverter("rad/s","deg/min"),rpm:function(t){return t*60},Hz:function(t){return t},KHz:function(t){return t/1e3},MHz:function(t){return t/1e6},GHz:function(t){return t/1e9},rad:function(t){return t},deg:d.default.swiftConverter("rad","deg"),grad:d.default.swiftConverter("rad","grad"),percent:function(t){return t*100},percentraw:function(t){return t},ratio:function(t){return t},pdeg:function(t){return t},latitudeMin:function(t){let n=Math.trunc(t),s="N";t<0&&(s="S",n=n*-1);let l=t%1*60;return s=="S"&&(l=l*-1),n+"\xB0 "+l.toFixed(2).padStart(5,"0")+"' "+s},latitudeSec:function(t){let n=Math.trunc(t),s="N";t<0&&(s="S",n=n*-1);let l=t%1*60;s=="S"&&(l=l*-1);let h=Math.trunc(l),f=l%1*60;return n+"\xB0 "+h+"' "+f.toFixed(2).padStart(5,"0")+'" '+s},longitudeMin:function(t){let n=Math.trunc(t),s="E";t<0&&(s="W",n=n*-1);let l=t%1*60;return s=="W"&&(l=l*-1),n+"\xB0 "+l.toFixed(2).padStart(5,"0")+"' "+s},longitudeSec:function(t){let n=Math.trunc(t),s="E";t<0&&(s="W",n=n*-1);let l=t%1*60;s=="W"&&(l=l*-1);let h=Math.trunc(l),f=l%1*60;return n+"\xB0 "+h+"' "+f.toFixed(2).padStart(5,"0")+'" '+s}};convertToUnit(t,n){if(!(t in this.unitConversionFunctions)||n===null)return null;let s=+n;return this.unitConversionFunctions[t](s)}getDefaults(){return this._defaultUnits}getConversions(){return this._conversionList}getConversionsForPath(t){let n=this.data.getPathUnitType(t),s="unitless",l="unitless";if(n===null||n==="RFC 3339 (UTC)")return{base:s,conversions:this._conversionList};{let h=this._conversionList.filter(f=>f.group=="Position"&&(t.includes("position.latitude")||t.includes("position.longitude"))?!0:f.units.find(Y=>Y.measure==n)?(l=this._defaultUnits[f.group],!0):!1);return h.length>0?{base:l,conversions:h}:(console.log("[Units Service] Unit type: "+n+", found for path: "+t+`
2
+ but Kip does not support it.`),{base:s,conversions:this._conversionList})}}ngOnDestroy(){this._defaultUnitsSub?.unsubscribe()}static \u0275fac=function(n){return new(n||u)};static \u0275prov=ot({token:u,factory:u.\u0275fac})}return u})();var jr=["trigger"],Yr=["panel"],Jr=[[["mat-select-trigger"]],"*"],Xr=["mat-select-trigger","*"];function Qr(u,w){if(u&1&&(D(0,"span",4),Ee(1),U()),u&2){let t=G();q(),Ae(t.placeholder)}}function Zr(u,w){u&1&&Oe(0)}function $r(u,w){if(u&1&&(D(0,"span",11),Ee(1),U()),u&2){let t=G(2);q(),Ae(t.triggerValue)}}function ei(u,w){if(u&1&&(D(0,"span",5),ke(1,Zr,1,0)(2,$r,2,1,"span",11),U()),u&2){let t=G();q(),Se(t.customTrigger?1:2)}}function ti(u,w){if(u&1){let t=xe();D(0,"div",12,1),j("keydown",function(s){H(t);let l=G();return B(l._handleKeydown(s))}),Oe(2,1),U()}if(u&2){let t=G();bt(wt("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",t._getPanelTheme())),Te("mat-select-panel-animations-enabled",!t._animationsDisabled),Me("ngClass",t.panelClass),ne("id",t.id+"-panel")("aria-multiselectable",t.multiple)("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby())}}var Ne=new re("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let u=y(Ce);return()=>Fe(u)}});function rr(u){let w=y(Ce);return()=>Fe(w)}var ir=new re("MAT_SELECT_CONFIG"),nr={provide:Ne,deps:[],useFactory:rr},ar=new re("MatSelectTrigger"),le=class{source;value;constructor(w,t){this.source=w,this.value=t}},ri=(()=>{class u{_viewportRuler=y(Ft);_changeDetectorRef=y(St);_elementRef=y(dt);_dir=y(Dt,{optional:!0});_idGenerator=y(Tt);_renderer=y(pt);_parentFormField=y(Vt,{optional:!0});ngControl=y(Lt,{self:!0,optional:!0});_liveAnnouncer=y(Ot);_defaultOptions=y(ir,{optional:!0});_animationsDisabled=It();_initialized=new ee;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(t){let n=this.options.toArray()[t];if(n){let s=this.panel.nativeElement,l=Yt(t,this.options,this.optionGroups),h=n._getHostElement();t===0&&l===1?s.scrollTop=0:s.scrollTop=Jt(h.offsetTop,h.offsetHeight,s.scrollTop,s.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(t){return new le(this,t)}_scrollStrategyFactory=y(Ne);_panelOpen=!1;_compareWith=(t,n)=>t===n;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new ee;_errorStateTracker;stateChanges=new ee;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(t){this._disableRipple.set(t)}_disableRipple=ut(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(t){this._placeholder=t,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(Ut.required)??!1}set required(t){this._required=t,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(t){this._selectionModel,this._multiple=t}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(t){this._compareWith=t,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(t){this._assignValue(t)&&this._onChange(t)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(t){this._errorStateTracker.matcher=t}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(t){this._id=t||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(t){this._errorStateTracker.errorState=t}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=at(()=>{let t=this.options;return t?t.changes.pipe(be(t),we(()=>te(...t.map(n=>n.onSelectionChange)))):this._initialized.pipe(we(()=>this.optionSelectionChanges))});openedChange=new ie;_openedStream=this.openedChange.pipe(_e(t=>t),ve(()=>{}));_closedStream=this.openedChange.pipe(_e(t=>!t),ve(()=>{}));selectionChange=new ie;valueChange=new ie;constructor(){let t=y(Bt),n=y(zt,{optional:!0}),s=y(Kt,{optional:!0}),l=y(new kt("tabindex"),{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Gt(t,this.ngControl,s,n,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=l==null?0:parseInt(l)||0,this.id=this.id}ngOnInit(){this._selectionModel=new Xt(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(V(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(V(this._destroy)).subscribe(t=>{t.added.forEach(n=>n.select()),t.removed.forEach(n=>n.deselect())}),this.options.changes.pipe(be(null),V(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let t=this._getTriggerAriaLabelledby(),n=this.ngControl;if(t!==this._triggerAriaLabelledBy){let s=this._elementRef.nativeElement;this._triggerAriaLabelledBy=t,t?s.setAttribute("aria-labelledby",t):s.removeAttribute("aria-labelledby")}n&&(this._previousControl!==n.control&&(this._previousControl!==void 0&&n.disabled!==null&&n.disabled!==this.disabled&&(this.disabled=n.disabled),this._previousControl=n.control),this.updateErrorState())}ngOnChanges(t){(t.disabled||t.userAriaDescribedBy)&&this.stateChanges.next(),t.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(st(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let t=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let n=`${this.id}-panel`;this._trackedModal&&Re(this._trackedModal,"aria-owns",n),At(t,"aria-owns",n),this._trackedModal=t}_clearFromModal(){if(!this._trackedModal)return;let t=`${this.id}-panel`;Re(this._trackedModal,"aria-owns",t),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{n(),clearTimeout(s),this._cleanupDetach=void 0};let t=this.panel.nativeElement,n=this._renderer.listen(t,"animationend",l=>{l.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),s=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);t.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(t){this._assignValue(t)}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this.disabled=t,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let t=this._selectionModel.selected.map(n=>n.viewValue);return this._isRtl()&&t.reverse(),t.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(t){this.disabled||(this.panelOpen?this._handleOpenKeydown(t):this._handleClosedKeydown(t))}_handleClosedKeydown(t){let n=t.keyCode,s=n===40||n===38||n===37||n===39,l=n===13||n===32,h=this._keyManager;if(!h.isTyping()&&l&&!oe(t)||(this.multiple||t.altKey)&&s)t.preventDefault(),this.open();else if(!this.multiple){let f=this.selected;h.onKeydown(t);let v=this.selected;v&&f!==v&&this._liveAnnouncer.announce(v.viewValue,1e4)}}_handleOpenKeydown(t){let n=this._keyManager,s=t.keyCode,l=s===40||s===38,h=n.isTyping();if(l&&t.altKey)t.preventDefault(),this.close();else if(!h&&(s===13||s===32)&&n.activeItem&&!oe(t))t.preventDefault(),n.activeItem._selectViaInteraction();else if(!h&&this._multiple&&s===65&&t.ctrlKey){t.preventDefault();let f=this.options.some(v=>!v.disabled&&!v.selected);this.options.forEach(v=>{v.disabled||(f?v.select():v.deselect())})}else{let f=n.activeItemIndex;n.onKeydown(t),this._multiple&&l&&t.shiftKey&&n.activeItem&&n.activeItemIndex!==f&&n.activeItem._selectViaInteraction()}}_handleOverlayKeydown(t){t.keyCode===27&&!oe(t)&&(t.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(t){if(this.options.forEach(n=>n.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&t)Array.isArray(t),t.forEach(n=>this._selectOptionByValue(n)),this._sortValues();else{let n=this._selectOptionByValue(t);n?this._keyManager.updateActiveItem(n):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(t){let n=this.options.find(s=>{if(this._selectionModel.isSelected(s))return!1;try{return(s.value!=null||this.canSelectNullableOptions)&&this._compareWith(s.value,t)}catch{return!1}});return n&&this._selectionModel.select(n),n}_assignValue(t){return t!==this._value||this._multiple&&Array.isArray(t)?(this.options&&this._setSelectionByValue(t),this._value=t,!0):!1}_skipPredicate=t=>this.panelOpen?!1:t.disabled;_getOverlayWidth(t){return this.panelWidth==="auto"?(t instanceof Pe?t.elementRef:t||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Et(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let t=te(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(V(t)).subscribe(n=>{this._onSelect(n.source,n.isUserInput),n.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),te(...this.options.map(n=>n._stateChanges)).pipe(V(t)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(t,n){let s=this._selectionModel.isSelected(t);!this.canSelectNullableOptions&&t.value==null&&!this._multiple?(t.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(t.value)):(s!==t.selected&&(t.selected?this._selectionModel.select(t):this._selectionModel.deselect(t)),n&&this._keyManager.setActiveItem(t),this.multiple&&(this._sortValues(),n&&this.focus())),s!==this._selectionModel.isSelected(t)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let t=this.options.toArray();this._selectionModel.sort((n,s)=>this.sortComparator?this.sortComparator(n,s,t):t.indexOf(n)-t.indexOf(s)),this.stateChanges.next()}}_propagateChanges(t){let n;this.multiple?n=this.selected.map(s=>s.value):n=this.selected?this.selected.value:t,this._value=n,this.valueChange.emit(n),this._onChange(n),this.selectionChange.emit(this._getChangeEvent(n)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let t=-1;for(let n=0;n<this.options.length;n++)if(!this.options.get(n).disabled){t=n;break}this._keyManager.setActiveItem(t)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(t){this._elementRef.nativeElement.focus(t)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let t=this._parentFormField?.getLabelId()||null,n=t?t+" ":"";return this.ariaLabelledby?n+this.ariaLabelledby:t}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let t=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(t+=" "+this.ariaLabelledby),t||(t=this._valueId),t}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(t){t.length?this._elementRef.nativeElement.setAttribute("aria-describedby",t.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focus(),this.open()}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(n){return new(n||u)};static \u0275cmp=ht({type:u,selectors:[["mat-select"]],contentQueries:function(n,s,l){if(n&1&&(ae(l,ar,5),ae(l,Ue,5),ae(l,jt,5)),n&2){let h;L(h=z())&&(s.customTrigger=h.first),L(h=z())&&(s.options=h),L(h=z())&&(s.optionGroups=h)}},viewQuery:function(n,s){if(n&1&&(se(jr,5),se(Yr,5),se(qe,5)),n&2){let l;L(l=z())&&(s.trigger=l.first),L(l=z())&&(s.panel=l.first),L(l=z())&&(s._overlayDir=l.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:19,hostBindings:function(n,s){n&1&&j("keydown",function(h){return s._handleKeydown(h)})("focus",function(){return s._onFocus()})("blur",function(){return s._onBlur()}),n&2&&(ne("id",s.id)("tabindex",s.disabled?-1:s.tabIndex)("aria-controls",s.panelOpen?s.id+"-panel":null)("aria-expanded",s.panelOpen)("aria-label",s.ariaLabel||null)("aria-required",s.required.toString())("aria-disabled",s.disabled.toString())("aria-invalid",s.errorState)("aria-activedescendant",s._getAriaActiveDescendant()),Te("mat-mdc-select-disabled",s.disabled)("mat-mdc-select-invalid",s.errorState)("mat-mdc-select-required",s.required)("mat-mdc-select-empty",s.empty)("mat-mdc-select-multiple",s.multiple))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",I],disableRipple:[2,"disableRipple","disableRipple",I],tabIndex:[2,"tabIndex","tabIndex",t=>t==null?0:De(t)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",I],placeholder:"placeholder",required:[2,"required","required",I],multiple:[2,"multiple","multiple",I],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",I],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",De],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",I]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[Ct([{provide:Nt,useExisting:u},{provide:Wt,useExisting:u}]),mt],ngContentSelectors:Xr,decls:11,vars:9,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(n,s){if(n&1){let l=xe();vt(Jr),D(0,"div",2,0),j("click",function(){return H(l),B(s.open())}),D(3,"div",3),ke(4,Qr,2,1,"span",4)(5,ei,3,1,"span",5),U(),D(6,"div",6)(7,"div",7),ct(),D(8,"svg",8),yt(9,"path",9),U()()()(),gt(10,ti,3,10,"ng-template",10),j("detach",function(){return H(l),B(s.close())})("backdropClick",function(){return H(l),B(s.close())})("overlayKeydown",function(f){return H(l),B(s._handleOverlayKeydown(f))})}if(n&2){let l=_t(1);q(3),ne("id",s._valueId),q(),Se(s.empty?4:5),q(6),Me("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",s._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",s._scrollStrategy)("cdkConnectedOverlayOrigin",s._preferredOverlayOrigin||l)("cdkConnectedOverlayPositions",s._positions)("cdkConnectedOverlayWidth",s._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)}},dependencies:[Pe,qe,Mt],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-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-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
3
+ `],encapsulation:2,changeDetection:0})}return u})();var ii=(()=>{class u{static \u0275fac=function(n){return new(n||u)};static \u0275mod=ft({type:u});static \u0275inj=lt({providers:[nr],imports:[qt,Le,Ie,Pt,Ht,Le,Ie]})}return u})();export{ri as a,ii as b,li as c};