@mxtommy/kip 4.1.0-beta.2 → 4.1.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxtommy/kip",
3
- "version": "4.1.0-beta.2",
3
+ "version": "4.1.0-beta.4",
4
4
  "description": "An advanced and versatile marine instrumentation package to display Signal K data.",
5
5
  "license": "MIT",
6
6
  "author": {
package/plugin/index.js CHANGED
@@ -211,7 +211,7 @@ const start = (server) => {
211
211
  }
212
212
  });
213
213
  router.get(API_PATHS.DISPLAYS, (req, res) => {
214
- server.debug(`** GET ${API_PATHS.DISPLAYS}. Params: ${JSON.stringify(req.params)}`);
214
+ server.debug(`*** GET DISPLAY ${API_PATHS.DISPLAYS}. Params: ${JSON.stringify(req.params)}`);
215
215
  try {
216
216
  const displays = getAvailableDisplays();
217
217
  const items = displays && typeof displays === 'object'
@@ -233,7 +233,7 @@ const start = (server) => {
233
233
  }
234
234
  });
235
235
  router.get(`${API_PATHS.INSTANCE}`, (req, res) => {
236
- server.debug(`** GET ${API_PATHS.INSTANCE}. Params: ${JSON.stringify(req.params)}`);
236
+ server.debug(`*** GET INSTANCE ${API_PATHS.INSTANCE}. Params: ${JSON.stringify(req.params)}`);
237
237
  try {
238
238
  const displayId = req.displayId;
239
239
  if (!displayId) {
@@ -253,17 +253,17 @@ const start = (server) => {
253
253
  }
254
254
  });
255
255
  router.get(`${API_PATHS.ACTIVE_SCREEN}`, (req, res) => {
256
- server.debug(`** GET ${API_PATHS.ACTIVE_SCREEN}. Params: ${JSON.stringify(req.params)}`);
256
+ server.debug(`*** GET CHANGE_SCREEN ${API_PATHS.ACTIVE_SCREEN}. Params: ${JSON.stringify(req.params)}`);
257
257
  try {
258
258
  const displayId = req.displayId;
259
259
  if (!displayId) {
260
260
  return sendFail(res, 400, 'Missing displayId parameter');
261
261
  }
262
- const node = getDisplaySelfPath(displayId, 'activeScreen');
262
+ const node = getDisplaySelfPath(displayId, 'screenIndex');
263
263
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
264
264
  const idx = node?.value ?? null;
265
265
  if (idx === undefined) {
266
- return sendFail(res, 404, `Active screen for display ${displayId} not found`);
266
+ return sendFail(res, 404, `Active screen for display Id ${displayId} not found in path`);
267
267
  }
268
268
  return sendOk(res, idx);
269
269
  }
@@ -273,7 +273,7 @@ const start = (server) => {
273
273
  }
274
274
  });
275
275
  router.get(`${API_PATHS.CHANGE_SCREEN}`, (req, res) => {
276
- server.debug(`** GET ${API_PATHS.CHANGE_SCREEN}. Params: ${JSON.stringify(req.params)}`);
276
+ server.debug(`*** GET CHANGE_SCREEN ${API_PATHS.CHANGE_SCREEN}. Params: ${JSON.stringify(req.params)}`);
277
277
  try {
278
278
  const changeId = req.changeId;
279
279
  if (!changeId) {
@@ -283,7 +283,7 @@ const start = (server) => {
283
283
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
284
284
  const idx = node?.value ?? null;
285
285
  if (idx === undefined) {
286
- return sendFail(res, 404, `Active screen for display ${changeId} not found`);
286
+ return sendFail(res, 404, `Change display screen Id ${changeId} not found in path`);
287
287
  }
288
288
  return sendOk(res, idx);
289
289
  }
@@ -1,4 +1,4 @@
1
- import{A as _l,B as er,C as tr,D as ir,E as nr,F as Qn,G as wa,H as Ml,I as kl,J as $n,K as en,L as Tt,M as Zn,N as Xn,O as Kn,P as po,Q as go,R as Tl,S as Jn,T as ea,a as Bt,b as oi,c as ro,d as Cl,e as Sl,f as wl,g as xl,h as Qe,i as Xi,j as Ki,k as so,l as gn,m as Ca,n as pi,o as Ji,p as jt,q as lo,r as co,s as Yn,t as fn,u as mo,v as uo,w as gi,x as Jo,y as ho,z as Sa}from"./chunk-KITN4REV.js";import{a as yl,b as oo}from"./chunk-MHCWCMEF.js";import{a as ai,b as Zi,c as rt}from"./chunk-BRLXMYKY.js";import{a as ml,b as ul,c as hl,d as jn,e as pl,f as kt,g as gl,h as fl,i as bl,k as Al,m as ya,n as vl}from"./chunk-RVSQUIEX.js";import{a as ks,c as Ts,d as Es}from"./chunk-QL3G7CWF.js";import{a as Ft}from"./chunk-MVXIEN3D.js";import{a as dl,b as cl}from"./chunk-JWT2WFAW.js";import{A as bt,B as ni,a as ge,c as Gs,d as wi,e as Ks,f as Js,g as el,h as xi,i as _i,k as tl,l as Mi,m as ki,n as Ti,o as Hi,p as ei,r as ht,s as Qi,t as sl,u as $i,w as ll,y as pt,z as ii}from"./chunk-CWBDCB4U.js";import{A as qn,B as Ei,C as Di,D as Mt,E as ol,F as rl,G as ji,H as zn,I as Yi,J as ut,L as Hn,M as gt,N as ft,a as Ht,d as Ot,e as Ri,f as ws,i as xs,j as _s,k as Za,l as Ms,m as Gt,n as Bn,o as mt,q as xt,s as ot,t as _t,u as il,v as nl,w as ao,x as al,y as ti,z as Un}from"./chunk-MKKQCG3C.js";import{b as Bs,f as Us,g as qs,h as js,i as Ko,j as Ys,m as Qs,n as $s,o as Zs,s as Xs}from"./chunk-W4VRE5PG.js";import{$ as ss,$a as mi,$b as me,$d as Rt,A as $t,Aa as We,Ab as _e,Ac as W,Ad as Ps,Ba as Ui,Bb as Pn,Bc as le,Bd as Is,Be as zs,Ca as hs,Cb as ue,Cc as I,Ce as Hs,Da as at,Db as he,Dc as bs,E as is,Eb as T,F as ns,Fb as d,Fc as Ha,Ga as w,Gb as u,Gc as Xe,Gd as Ka,Hb as U,Hc as v,I as ga,Ib as M,Ic as ie,Id as Ln,J as Mn,Jb as k,Jd as Os,K as Gi,Ka as Xt,Kb as H,Kc as As,Kd as Rs,L as Ci,Lb as In,Lc as zt,Ld as Gn,Mb as On,Na as Oe,Nb as qa,Nc as qe,O as as,Ob as ae,Oc as Zo,Od as Ns,P as Fi,Pb as Oi,Qb as B,R as Bi,Rb as Aa,Rd as Vs,Sa as Fa,Sb as O,Sd as Si,T as os,Ta as fa,Tb as Rn,Td as Fn,U as rs,Ub as Nn,Ud as Ws,V as Na,Vb as cn,W as Va,Wb as Kt,Wd as Xo,Xa as g,Xb as Ct,Xd as Ja,Ya as ps,Yb as St,Yc as vs,Yd as Ls,Zc as ys,Zd as eo,_a as En,_b as te,_c as Cs,a as Ie,aa as ls,ac as It,ae as Ye,b as je,bc as re,bd as ja,be as Je,cb as Ba,cc as tt,cd as Ya,d as xm,da as ds,dc as Vn,e as Xr,ea as kn,ec as Ut,ed as Ss,f as nt,fa as Wa,fc as m,fe as hi,g as Li,ga as La,gc as ne,gd as Qa,hb as L,hc as ve,he as Jt,ia as Ga,ib as Lt,ic as zi,j as Yo,jb as dt,jd as $a,ka as cs,kb as Ua,kc as mn,lb as ba,lc as un,m as Vt,ma as Tn,mb as gs,mc as hn,na as lt,nb as qi,ne as to,o as _n,oa as Wt,ob as fs,od as Ke,oe as io,p as Kr,pb as yt,pd as Wn,pe as wt,qa as Zt,qb as Le,qc as ui,qe as no,ra as ms,rb as Dn,re as ct,s as Jr,sa as A,sc as pn,t as Qo,tc as va,te as Fs,u as es,ud as Xa,ue as et,va as us,vc as At,wc as qt,x as Ra,xa as q,xb as Q,xc as za,y as $o,ya as z,yb as G,z as ts,za as X,zb as F,zd as Ds}from"./chunk-PR5JLJLD.js";var ur=xm((Sx,Do)=>{(function(n){"use strict";function o(c){if(Array.isArray(c)){for(var l=0,p=Array(c.length);l<c.length;l++)p[l]=c[l];return p}return Array.from(c)}function e(c,l){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||typeof l!="object"&&typeof l!="function"?c:l}function t(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(c,l):c.__proto__=l)}function i(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function a(c,l){if(l||(l=typeof window>"u"?global:window),l[c]!==void 0)return l[c];if(Oa===null){var p=window.getComputedStyle(document.documentElement,"");Oa=(Array.prototype.slice.call(p).join("").match(/-(moz|webkit|ms)-/)||p.OLink===""&&["","o"]||["",""])[1]}if(Oa==="")return null;var y=c.charAt(0).toUpperCase()+c.substr(1),S=l[Oa+y];return S!==void 0?S:null}function r(c,l,p,y,S,x,D){if(typeof y!="function")throw new TypeError("Invalid animation rule:",y);var R=c-p,P=R/S,V=0;P>1&&(P=1),P!==1&&(V=y(P),isFinite(V)&&!isNaN(V)&&(P=V)),l&&l(P),R<S?D.frame=jr(function($){return r($,l,p,y,S,x,D)}):(x&&x(),D.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function h(c){if(!(c instanceof DOMException&&c.result===2152923147))throw c}function f(c,l){return l.replace(Cm,function(p,y){var S=c[y];return S!==void 0?S:p})}function b(c){return c.majorTicks instanceof Array||(c.majorTicks=c.majorTicks?[c.majorTicks]:[]),c.majorTicks.length||(c.majorTicks.push(oe.formatMajorTickNumber(c.minValue,c)),c.majorTicks.push(oe.formatMajorTickNumber(c.maxValue,c))),[c.tickSide!=="right",c.tickSide!=="left"]}function C(c,l,p,y,S,x){c.beginPath(),c.moveTo(l+x,p),c.lineTo(l+y-x,p),c.quadraticCurveTo(l+y,p,l+y,p+x),c.lineTo(l+y,p+S-x),c.quadraticCurveTo(l+y,p+S,l+y-x,p+S),c.lineTo(l+x,p+S),c.quadraticCurveTo(l,p+S,l,p+S-x),c.lineTo(l,p+x),c.quadraticCurveTo(l,p,l+x,p),c.closePath()}function _(c,l){var p=l.valueDec,y=l.valueInt,S=0,x=void 0,D=void 0,R=void 0;if(c=parseFloat(c),R=c<0,c=Math.abs(c),p>0){for(D=c.toFixed(p).toString().split("."),x=y-D[0].length;S<x;++S)D[0]="0"+D[0];D=(R?"-":"")+D[0]+"."+D[1]}else{for(D=Math.round(c).toString(),x=y-D.length;S<x;++S)D="0"+D;D=(R?"-":"")+D}return D}function N(c,l){var p=void 0,y=!1;return p=l.majorTicksDec===0?Math.round(c).toString():c.toFixed(l.majorTicksDec),l.majorTicksInt>1?(y=~p.indexOf("."),~p.indexOf("-")?"-"+[l.majorTicksInt+l.majorTicksDec+2+(y?1:0)-p.length].join("0")+p.replace("-",""):[l.majorTicksInt+l.majorTicksDec+1+(y?1:0)-p.length].join("0")+p):p}function E(c){return c*Math.PI/180}function j(c,l){return{x:-c*Math.sin(l),y:c*Math.cos(l)}}function Y(c,l,p,y){var S=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],x=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,D=c.createLinearGradient(S?0:x,S?x:0,S?0:y,S?y:0);return D.addColorStop(0,l),D.addColorStop(1,p),D}function K(c,l){l.needleShadow&&(c.shadowOffsetX=2,c.shadowOffsetY=2,c.shadowBlur=10,c.shadowColor=l.colorNeedleShadowDown)}function ee(c,l,p){return c["font"+l+"Style"]+" "+c["font"+l+"Weight"]+" "+c["font"+l+"Size"]*p+"px "+c["font"+l]}function se(c){c.shadowOffsetX=null,c.shadowOffsetY=null,c.shadowBlur=null,c.shadowColor="",c.strokeStyle=null,c.lineWidth=0,c.save()}function Re(c,l,p,y){l.valueTextShadow&&(c.shadowOffsetX=p,c.shadowOffsetY=p,c.shadowBlur=y,c.shadowColor=l.colorValueTextShadow)}function Te(c,l,p,y,S,x){if(l.valueBox){se(c);var D=l.valueDec?1+l.valueDec:0,R="9".repeat(Math.max.apply(null,[String(parseInt(p)).length+D].concat(l.majorTicks.map(function(Pe){return String(parseInt(Pe,10)).length+D})))),P=l.valueText||_(p,l),V=x/200,$=x/100,Z=.4*$,de=1.2*$;c.font=ee(l,"Value",V),Re(c,l,Z,de);var pe=c.measureText(l.valueText?P:"-"+_(Number(R),l)).width;se(c);var Ae=parseFloat(l.fontValueSize)*V+Z+de,Fe=$*parseFloat(l.valueBoxStroke),be=2*x-2*Fe,Ne=pe+10*$,Ve=1.1*Ae+Z+de,Be=$*l.valueBoxBorderRadius,ke=(parseFloat(l.valueBoxWidth)||0)/100*be;ke>Ne&&(Ne=ke),Ne>be&&(Ne=be);var De=y-Ne/2,we=S-Ve/2,fe=S-5.75*$;if(c.beginPath(),Be?C(c,De,we,Ne,Ve,Be):c.rect(De,we,Ne,Ve),Fe){var ye=c.createRadialGradient(y,fe,10*$,y,fe,20*$);ye.addColorStop(0,l.colorValueBoxRect),ye.addColorStop(1,l.colorValueBoxRectEnd),c.strokeStyle=ye,c.lineWidth=Fe,c.stroke()}l.colorValueBoxShadow&&(c.shadowBlur=1.2*$,c.shadowColor=l.colorValueBoxShadow),l.colorValueBoxBackground&&(c.fillStyle=l.colorValueBoxBackground,c.fill()),c.closePath(),c.restore(),Re(c,l,Z,de),c.fillStyle=l.colorValueText,c.textAlign="center",c.textBaseline="alphabetic",c.fillText(P,De+Ne/2,S+Ve/2-Ae/3),c.restore()}}function $e(c){var l=c.value,p=c.minValue,y=c.maxValue,S=.01*(y-p);return{normal:l<p?p:l>y?y:l,indented:l<p?p-S:l>y?y+S:l}}function Ee(c,l,p,y,S){p.beginPath(),p.arc(0,0,ci(c),0,2*ha,!0),p.lineWidth=l,p.strokeStyle=S?oe.linearGradient(p,y,S,c):y,p.stroke(),p.closePath()}function Ge(c,l){var p=di.pixelRatio;return c.maxRadius||(c.maxRadius=c.max-l.borderShadowWidth-l.borderOuterWidth*p-l.borderMiddleWidth*p-l.borderInnerWidth*p+(l.borderOuterWidth?.5:0)+(l.borderMiddleWidth?.5:0)+(l.borderInnerWidth?.5:0)),c.maxRadius}function Me(c,l){function p(Z,de,pe,Ae,Fe,be){return de&&(!be&&l.borderShadowWidth&&(pe.save(),pe.shadowBlur=l.borderShadowWidth,pe.shadowColor=l.colorBorderShadow),Ee(Z,de*y,pe,Ae,Fe),!be&&l.borderShadowWidth&&(be=!0,pe.restore())),be}var y=di.pixelRatio,S=l.borderShadowWidth*y,x=c.max-S-l.borderOuterWidth*y/2,D=x-l.borderOuterWidth*y/2-l.borderMiddleWidth*y/2+.5,R=D-l.borderMiddleWidth*y/2-l.borderInnerWidth*y/2+.5,P=Ge(c,l),V=void 0,$=!1;c.save(),$=p(x,l.borderOuterWidth,c,l.colorBorderOuter,l.colorBorderOuterEnd,$),$=p(D,l.borderMiddleWidth,c,l.colorBorderMiddle,l.colorBorderMiddleEnd,$),$=p(R,l.borderInnerWidth,c,l.colorBorderInner,l.colorBorderInnerEnd,$),!$&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),c.beginPath(),c.arc(0,0,ci(P),0,2*ha,!0),l.colorPlateEnd?(V=c.createRadialGradient(0,0,P/2,0,0,P),V.addColorStop(0,l.colorPlate),V.addColorStop(1,l.colorPlateEnd)):V=l.colorPlate,c.fillStyle=V,c.fill(),c.closePath(),c.restore()}function ze(c,l){if(l.highlights!=="false"&&l.highlights.length&&l.highlightsWidth!==0){var p=c.max*(parseFloat(l.highlightsWidth)||0)/100,y=ci(it(c,l)-p/2),S=l.highlights.length,x=(l.maxValue-l.minValue)/l.ticksAngle;c.save();for(var D=0;D<S;D++){var R=l.highlights[D];c.lineWidth=p,c.lineCap=l.highlightsLineCap,c.strokeStyle=R.color,c.beginPath(),c.rotate(jo),c.arc(0,0,y,oe.radians(l.startAngle+(R.from-l.minValue)/x),oe.radians(l.startAngle+(R.to-l.minValue)/x),!1),c.stroke(),c.closePath(),c.restore(),c.save()}c.restore()}}function He(c,l){var p=it(c,l),y=void 0,S=void 0,x=void 0,D=0,R=Math.abs(l.minorTicks)||0,P=l.ticksAngle/(l.maxValue-l.minValue);l.exactTicks?(S=l.maxValue-l.minValue,y=R?S/R:0,D=(yi.mod(l.majorTicks[0],R)||0)*P):y=R*(l.majorTicks.length-1),c.lineWidth=di.pixelRatio,c.strokeStyle=l.colorMinorTicks||l.colorStrokeTicks,c.save();for(var V=0;V<y;++V)(x=l.startAngle+D+V*(l.ticksAngle/y))<=l.ticksAngle+l.startAngle&&(c.rotate(oe.radians(x)),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.075*c.max),sn(c));c.restore()}function it(c,l){var p=c.max/100;return Ge(c,l)-5*p-(l.barWidth?2*(parseFloat(l.barStrokeWidth)||0)+((parseFloat(l.barWidth)||0)+5)*p:0)}function st(c,l){oe.prepareTicks(l);var p=ci(it(c,l)),y=void 0,S=l.majorTicks.length,x=di.pixelRatio;c.lineWidth=2*x,y=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(S).fill(l.colorStrokeTicks||l.colorMajorTicks);for(var D=0;D<S;++D)c.save(),c.strokeStyle=y[D],c.rotate(oe.radians(vt(l,l.exactTicks?l.majorTicks[D]:D,S))),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.15*c.max),c.stroke(),c.closePath(),c.restore();l.strokeTicks&&(c.save(),c.strokeStyle=l.colorStrokeTicks||y[0],c.rotate(jo),c.beginPath(),c.arc(0,0,p,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore())}function vt(c,l,p){if(c.exactTicks){var y=c.ticksAngle/(c.maxValue-c.minValue);return c.startAngle+y*(l-c.minValue)}return c.startAngle+l*(c.ticksAngle/(p-1))}function sn(c){c.stroke(),c.restore(),c.closePath(),c.save()}function Da(c,l){var p=it(c,l)-.15*c.max,y={},S=0,x=l.majorTicks.length,D=l.animationTarget!=="needle",R=l.colorNumbers instanceof Array?l.colorNumbers:new Array(x).fill(l.colorNumbers),P=D?-(l.value-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle:0;for(D&&(c.save(),c.rotate(-oe.radians(P))),c.font=oe.font(l,"Numbers",c.max/200),c.lineWidth=0,c.textAlign="center",c.textBaseline="middle";S<x;++S){var V=P+vt(l,l.exactTicks?l.majorTicks[S]:S,x),$=c.measureText(l.majorTicks[S]).width,Z=l.fontNumbersSize,de=Math.sqrt($*$+Z*Z)/2,pe=oe.radialPoint(p-de-l.numbersMargin/100*c.max,oe.radians(V));V===360&&(V=0),y[V]||(y[V]=!0,c.fillStyle=R[S],c.fillText(l.majorTicks[S],pe.x,pe.y))}D&&c.restore()}function Nr(c,l){l.title&&(c.save(),c.font=oe.font(l,"Title",c.max/200),c.fillStyle=l.colorTitle,c.textAlign="center",c.fillText(l.title,0,-c.max/4.25,.8*c.max),c.restore())}function Vr(c,l){l.units&&(c.save(),c.font=oe.font(l,"Units",c.max/200),c.fillStyle=l.colorUnits,c.textAlign="center",c.fillText(oe.formatContext(l,l.units),0,c.max/3.25,.8*c.max),c.restore())}function Wr(c,l){if(l.needle){var p=l.animationTarget!=="needle",y=l.ticksAngle<360?oe.normalizedValue(l).indented:l.value,S=p?l.startAngle:l.startAngle+(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle;l.barStartPosition==="right"&&(S=l.startAngle+l.ticksAngle-(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle);var x=Ge(c,l),D=ci(x/100*l.needleCircleSize),R=ci(x/100*l.needleCircleSize*.75),P=ci(x/100*l.needleEnd),V=ci(l.needleStart?x/100*l.needleStart:0),$=x/100*l.needleWidth,Z=x/100*l.needleWidth/2,de=di.pixelRatio;c.save(),oe.drawNeedleShadow(c,l),c.rotate(oe.radians(S)),c.fillStyle=oe.linearGradient(c,l.colorNeedle,l.colorNeedleEnd,P-V),l.needleType==="arrow"?(c.beginPath(),c.moveTo(-Z,-V),c.lineTo(-$,0),c.lineTo(-1*de,P),c.lineTo(de,P),c.lineTo($,0),c.lineTo(Z,-V),c.closePath(),c.fill(),c.beginPath(),c.lineTo(-.5*de,P),c.lineTo(-1*de,P),c.lineTo(-$,0),c.lineTo(-Z,-V),c.lineTo(Z/2*de-2*de,-V),c.closePath(),c.fillStyle=l.colorNeedleShadowUp,c.fill()):(c.beginPath(),c.moveTo(-Z,P),c.lineTo(-Z,V),c.lineTo(Z,V),c.lineTo(Z,P),c.closePath(),c.fill()),c.restore(),l.needleCircleSize&&(c.save(),oe.drawNeedleShadow(c,l),l.needleCircleOuter&&(c.beginPath(),c.arc(0,0,D,0,2*ha,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleOuter,l.colorNeedleCircleOuterEnd,D),c.fill(),c.closePath()),l.needleCircleInner&&(c.beginPath(),c.arc(0,0,R,0,2*ha,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleInner,l.colorNeedleCircleInnerEnd,R),c.fill(),c.closePath()),c.restore())}}function Lr(c,l,p){oe.drawValueBox(c,l,p,0,c.max-.33*c.max,c.max)}function im(c){var l=c.startAngle,p=c.startAngle+c.ticksAngle,y=l,S=l+(oe.normalizedValue(c).normal-c.minValue)/(c.maxValue-c.minValue)*c.ticksAngle;if(c.barStartPosition==="middle"){var x=.5*(c.minValue+c.maxValue);c.value<x?(y=180-(x-oe.normalizedValue(c).normal)/(c.maxValue-c.minValue)*c.ticksAngle,S=180):(y=180,S=180+(oe.normalizedValue(c).normal-x)/(c.maxValue-c.minValue)*c.ticksAngle)}else c.barStartPosition==="right"&&(y=p-S+l,S=p);return{startAngle:y,endAngle:S}}function Gr(c,l){var p=c.max/100,y=Ge(c,l)-5*p,S=parseFloat(l.barStrokeWidth+"")||0,x=(parseFloat(l.barWidth+"")||0)*p,D=y-2*S-x,R=(y-D)/2,P=D+R,V=S/P,$=l.startAngle,Z=l.startAngle+l.ticksAngle;if(c.save(),c.rotate(jo),S&&(c.beginPath(),c.arc(0,0,P,oe.radians($)-V,oe.radians(Z)+V,!1),c.strokeStyle=l.colorBarStroke,c.lineWidth=2*R,c.stroke(),c.closePath()),x&&(c.beginPath(),c.arc(0,0,P,oe.radians($),oe.radians(Z),!1),c.strokeStyle=l.colorBar,c.lineWidth=x,c.stroke(),c.closePath(),l.barShadow&&(c.save(),c.beginPath(),c.arc(0,0,y,oe.radians($),oe.radians(Z),!1),c.clip(),c.beginPath(),c.strokeStyle=l.colorBar,c.lineWidth=1,c.shadowBlur=l.barShadow,c.shadowColor=l.colorBarShadow,c.shadowOffsetX=0,c.shadowOffsetY=0,c.arc(0,0,y,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore()),l.barProgress)){var de=im(l),pe=de.startAngle,Ae=de.endAngle;c.beginPath(),c.arc(0,0,P,oe.radians(pe),oe.radians(Ae),!1),c.strokeStyle=l.colorBarProgress,c.lineWidth=x,c.stroke(),c.closePath()}c.restore()}function Fr(c){return c.options.animatedValue?c.options.value:c.value}function nm(c,l,p,y,S,x,D,R){c.beginPath(),c.fillStyle=R?oe.linearGradient(c,D,R,S>x?S:x,x>S,S>x?p:y):D,l>0?oe.roundRect(c,p,y,S,x,l):c.rect(p,y,S,x),c.fill(),c.closePath()}function am(c,l,p,y,S,x,D,R,P){c.beginPath(),c.lineWidth=l,c.strokeStyle=P?oe.linearGradient(c,R,P,D,!0,S):R,p>0?oe.roundRect(c,y,S,x,D,p):c.rect(y,S,x,D),c.stroke(),c.closePath()}function om(c,l,p,y,S,x){function D(Pe,Ue,Ze,Nt){return Pe&&(!Nt&&l.borderShadowWidth&&(c.save(),c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),am(c,Pe*R,P,p+Pe*R/2-fe,y+Pe*R/2-fe,V,pe,Ue,Ze),fe+=.5*R,!Nt&&l.borderShadowWidth&&(Nt=!0,c.restore())),Nt}var R=di.pixelRatio,P=l.borderRadius*R,V=S-l.borderShadowWidth-l.borderOuterWidth*R,$=V-l.borderOuterWidth*R-l.borderMiddleWidth*R,Z=$-l.borderMiddleWidth*R-l.borderInnerWidth*R,de=Z-l.borderInnerWidth*R,pe=x-l.borderShadowWidth-l.borderOuterWidth*R,Ae=pe-l.borderOuterWidth*R-l.borderMiddleWidth*R,Fe=Ae-l.borderMiddleWidth*R-l.borderInnerWidth*R,be=Fe-l.borderInnerWidth*R,Ne=p-($-V)/2,Ve=Ne-(Z-$)/2,Be=Ve-(de-Z)/2,ke=y-(Ae-pe)/2,De=ke-(Fe-Ae)/2,we=De-(be-Fe)/2,fe=0,ye=!1;return c.save(),ye=D(l.borderOuterWidth,l.colorBorderOuter,l.colorBorderOuterEnd,ye),ye=D(l.borderMiddleWidth,l.colorBorderMiddle,l.colorBorderMiddleEnd,ye),ye=D(l.borderInnerWidth,l.colorBorderInner,l.colorBorderInnerEnd,ye),!ye&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),nm(c,P,Be,we,de+2*fe,be+2*fe,l.colorPlate,l.colorPlateEnd),c.restore(),[Be,we,de,be]}function rm(c,l,p,y,S,x){var D=di.pixelRatio,R=x>=S,P=R?.85*S:x,V=R?x:S;p=R?Se(p+(S-P)/2):p;var $=!!l.title,Z=!!l.units,de=!!l.valueBox,pe=void 0,Ae=void 0,Fe=void 0;R?(Ae=Se(.05*V),pe=Se(.075*V),Fe=Se(.11*V),$&&(V-=pe,y+=pe),Z&&(V-=Ae),de&&(V-=Fe)):(Ae=pe=Se(.15*P),$&&(P-=pe,y+=pe),Z&&(P-=Ae));var be=2*l.barStrokeWidth,Ne=l.barBeginCircle?Se(P*l.barBeginCircle/200-be/2):0,Ve=Se(P*l.barWidth/100-be),Be=Se(V*l.barLength/100-be),ke=Se((V-Be)/2),De=Se(p+(R?P/2:ke+Ne)),we=Se(y+(R?V-ke-Ne+be/2:P/2)),fe=!R||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P,ye=R||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P;return c.barDimensions={isVertical:R,width:P,length:V,barWidth:Ve,barLength:Be,strokeWidth:be,barMargin:ke,radius:Ne,pixelRatio:D,barOffset:null,titleMargin:$?pe:0,unitsMargin:Z?Ae:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:p+fe,Y:y+ye,x0:De+fe,y0:we+ye,baseX:p,baseY:y,ticksPadding:l.ticksPadding/100},c.barDimensions}function Br(c,l,p,y,S,x,D){var R=rm(c,l,y,S,x,D),P=R.isVertical,V=R.width,$=R.barWidth,Z=R.barLength,de=R.strokeWidth,pe=R.barMargin,Ae=R.radius,Fe=R.x0,be=R.y0,Ne=R.X,Ve=R.Y,Be=Z;c.save(),c.beginPath();var ke=null;if(l.barBeginCircle){var De=oe.radians(P?270:0),we=Math.asin($/2/Ae),fe=Math.cos(we),ye=Math.sin(we),Pe=Fe+(P?Ae*ye:Ae*fe-de/2),Ue=P?be-Ae*fe:be+Ae*ye,Ze=ci(P?Ue-be:Pe-Fe);ke=Se(Ze+Ae);var Nt=P?Se(Fe-Ae*ye):Pe,Qt=P?Ue:Se(be-Ae*ye);p==="progress"&&(Z=ke+(Z-ke)*(oe.normalizedValue(l).normal-l.minValue)/(l.maxValue-l.minValue));var pa=Se(Pe+Z-ke+de/2),dn=Se(Ue-Z+ke-de/2);c.arc(Fe,be,Ae,De+we,De-we),P?(c.moveTo(Pe,Qt),c.lineTo(Pe,dn),c.lineTo(Nt,dn),c.lineTo(Nt,Qt)):(c.moveTo(Pe,Qt),c.lineTo(pa,Qt),c.lineTo(pa,Ue),c.lineTo(Pe,Ue))}else{var $r=Se(P?Ne+(V-$)/2:Ne+pe),Zr=Se(P?Ve+Z+pe:Ve+(V-$)/2);p==="progress"&&(Z*=(l.value-l.minValue)/(l.maxValue-l.minValue)),P?c.rect($r,Zr,$,-Z):c.rect($r,Zr,Z,$)}p!=="progress"&&l.barStrokeWidth&&(c.lineWidth=de,c.strokeStyle=l.colorBarStroke,c.stroke()),p!=="progress"&&l.colorBar?(c.fillStyle=l.colorBarEnd?oe.linearGradient(c,l.colorBar,l.colorBarEnd,Z,P,P?Ve:Ne):l.colorBar,c.fill()):p==="progress"&&l.colorBarProgress&&(c.fillStyle=l.colorBarProgressEnd?oe.linearGradient(c,l.colorBarProgress,l.colorBarProgressEnd,Be,P,P?Ve:Ne):l.colorBarProgress,c.fill()),c.closePath(),c.restore(),l.barBeginCircle&&(c.barDimensions.radius+=de),c.barDimensions.barOffset=ke,c.barDimensions.barWidth+=de,c.barDimensions.barLength+=de}function sm(c,l,p,y,S,x){Br(c,l,"",p,y,S,x)}function Ur(c,l){return l.needleSide!==c||l.tickSide!==c||l.numberSide!==c}function lm(c,l,p,y,S,x){l.barProgress&&Br(c,l,"progress",p,y,S,x)}function dm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,R=p.barOffset,P=p.barMargin,V=p.X,$=p.Y,Z=p.ticksLength,de=p.ticksPadding,pe=S*(parseFloat(l.highlightsWidth)||0)/100;if(l.highlights&&pe){var Ae=l.tickSide!=="right",Fe=l.tickSide!=="left",be=0,Ne=l.highlights.length,Ve=(S-D)/2,Be=l.maxValue-l.minValue,ke=Se(y?V+Ve:V+P+R),De=pe,we=y?$+x-P-R:$+Ve,fe=Se((l.ticksWidth/100+de)*S)+(pe-l.ticksWidth/100*S),ye=Se(D+de*S);for(c.save();be<Ne;be++){var Pe=l.highlights[be],Ue=Z*ci(l.minValue-Pe.from)/Be,Ze=Z*ci((Pe.to-Pe.from)/Be);c.beginPath(),c.fillStyle=Pe.color,y?(Ae&&c.rect(ke-fe,we-Ue,De,-Ze),Fe&&c.rect(ke+ye,we-Ue,De,-Ze)):(Ae&&c.rect(ke+Ue,we-fe,Ze,De),Fe&&c.rect(ke+Ue,we+ye,Ze,De)),c.fill(),c.closePath()}c.restore()}}function Pa(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function qr(c,l,p,y,S,x,D,R,P){var V=c.barDimensions,$=V.isVertical,Z=V.length,de=V.barWidth,pe=V.barOffset,Ae=V.barMargin,Fe=V.pixelRatio,be=V.width,Ne=V.X,Ve=V.Y,Be=V.ticksLength,ke=V.ticksPadding,De=(be-de)/2,we=void 0,fe=void 0,ye=0,Pe=p.length,Ue=void 0,Ze=P*be,Nt=De-ke*be,Qt=De+de+Ze+ke*be,pa=l instanceof Array?l:new Array(p.length).fill(l);c.save(),c.lineWidth=R*Fe;for(var dn=Be/(S-y);ye<Pe;ye++)Ue=p[ye],c.strokeStyle=pa[ye],$?(fe=Ve+Z-Ae-pe+(y-Ue)*dn,x&&(we=Ne+Nt,Pa(c,we,fe,Se(we-Ze),fe)),D&&(we=Ne+Qt,Pa(c,we,fe,Se(we-Ze),fe))):(we=Ne+Ae+pe-(y-Ue)*dn,x&&(fe=Ve+Nt,Pa(c,we,fe,we,Se(fe-Ze))),D&&(fe=Ve+Qt,Pa(c,we,Se(fe),we,fe-Ze)));c.restore()}function cm(c,l){var p=oe.prepareTicks(l),y=Hr(p,2),S=y[0],x=y[1],D=2,R=(l.maxValue-l.minValue)/(l.majorTicks.length-1),P=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(l.majorTicks.length).fill(l.colorStrokeTicks||l.colorMajorTicks);if(qr(c,P,l.exactTicks?l.majorTicks:l.majorTicks.map(function(Ze,Nt){return l.minValue+R*Nt}),l.minValue,l.maxValue,S,x,D,l.ticksWidth/100),l.strokeTicks){var V=c.barDimensions,$=V.isVertical,Z=V.length,de=V.width,pe=V.barWidth,Ae=V.barMargin,Fe=V.barOffset,be=V.X,Ne=V.Y,Ve=V.ticksLength,Be=V.pixelRatio,ke=V.ticksPadding,De=(de-pe)/2+pe+ke*de,we=(de-pe)/2-ke*de,fe=void 0,ye=void 0,Pe=void 0,Ue=void 0;c.strokeStyle=l.colorStrokeTicks||P[0],D*=Be,$?(ye=Ne+Z-Ae-Fe+D/2,Ue=ye-Ve-D,S&&(Pe=fe=Se(be+we),Ia(c,fe,ye,Pe,Ue)),x&&(Pe=fe=Se(be+De),Ia(c,fe,ye,Pe,Ue))):(fe=be+Ae+Fe-D/2,Pe=fe+Ve+D,S&&(Ue=ye=Se(Ne+we),Ia(c,fe,ye,Pe,Ue)),x&&(Ue=ye=Se(Ne+De),Ia(c,fe,ye,Pe,Ue)))}}function Ia(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function mm(c,l){var p=oe.prepareTicks(l),y=Hr(p,2),S=y[0],x=y[1],D=[],R=l.minValue,P=Math.abs(l.minorTicks)||0,V=P?(l.maxValue-l.minValue)/(P*(l.majorTicks.length-1)):0;if(P)if(l.exactTicks)for(var $=yi.mod(l.majorTicks[0],P)||0;R<l.maxValue;R+=P)$+R<l.maxValue&&D.push($+R);else for(;R<l.maxValue;R+=V)D.push(R);qr(c,l.colorMinorTicks||l.colorStrokeTicks,D,l.minValue,l.maxValue,S,x,1,l.ticksWidthMinor/100)}function um(c,l){var p=c.barDimensions,y=p.isVertical,S=p.length,x=p.width,D=p.barWidth,R=p.barMargin,P=p.barOffset,V=p.X,$=p.Y,Z=p.ticksLength,de=p.ticksPadding,pe=l.maxValue-l.minValue,Ae=pe/(l.majorTicks.length-1),Fe=l.exactTicks?l.majorTicks:l.majorTicks.map(function(pa,dn){return l.minValue+Ae*dn}),be=Fe.length,Ne=l.numberSide!=="right",Ve=l.numberSide!=="left",Be=l.fontNumbersSize*x/200,ke=0,De=(l.ticksWidth/100+2*de)*x,we=(x-D)/2-De,fe=(x-D)/2+D+De,ye=void 0,Pe=void 0,Ue=void 0,Ze=void 0,Nt=l.colorNumbers instanceof Array?l.colorNumbers:new Array(be).fill(l.colorNumbers),Qt=l.numbersMargin/100*x;for(c.font=oe.font(l,"Numbers",x/200),c.lineWidth=0,c.textAlign="center";ke<be;ke++)c.fillStyle=Nt[ke],Ze=l.majorTicks[ke],Ue=l.exactTicks?Z*((Fe[ke]-l.minValue)/pe):ke*Z/(be-1),y?(Pe=$+S-R-P-Ue+Be/3,Ne&&(c.textAlign="right",c.fillText(Ze,V+we-Qt,Pe)),Ve&&(c.textAlign="left",c.fillText(Ze,V+fe+Qt,Pe))):(c.measureText(Ze).width,ye=V+R+P+Ue,Ne&&c.fillText(Ze,ye,$+we-Qt),Ve&&c.fillText(Ze,ye,$+fe+Be+Qt))}function hm(c,l){if(l.title){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,R=p.baseY,P=p.titleMargin,V=l.fontTitleSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(R+P/2-(y?V:V/2)-.025*(y?x:S));c.save(),c.textAlign="center",c.fillStyle=l.colorTitle,c.font=oe.font(l,"Title",S/200),c.lineWidth=0,c.fillText(l.title,$,Z,y?S:x),c.restore()}}function pm(c,l){if(l.units){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,R=p.baseY,P=p.unitsMargin,V=l.fontUnitsSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(R+(y?x:S)+P/2-V/2);c.save(),c.textAlign="center",c.fillStyle=l.colorUnits,c.font=oe.font(l,"Units",S/200),c.lineWidth=0,c.fillText(oe.formatContext(l,l.units),$,Z,y?S:x),c.restore()}}function gm(c,l){if(l.needle){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,R=p.barOffset,P=p.barMargin,V=p.ticksLength,$=p.X,Z=p.Y,de=p.ticksPadding,pe=l.needleSide!=="right",Ae=l.needleSide!=="left",Fe=V*(oe.normalizedValue(l).indented-l.minValue)/(l.maxValue-l.minValue),be=(l.ticksWidth/100+de)*S,Ne=D/2+be,Ve=Ne*(l.needleEnd/100),Be=void 0,ke=void 0,De=void 0,we=void 0,fe=l.needleType.toLowerCase()==="arrow"?bm:fm,ye=(S-D)/2,Pe=Ne*(l.needleStart/100),Ue=ye-be-Pe,Ze=ye+D+be+Pe;c.save(),oe.drawNeedleShadow(c,l),y?(De=Se(Z+x-P-R-Fe),pe&&(Be=Se($+Ue),ke=Be+Ve,fe(c,l,Be,De,ke,De,Ve)),Ae&&(Be=Se($+Ze),ke=Be-Ve,fe(c,l,Be,De,ke,De,Ve,!0))):(Be=Se($+P+R+Fe),pe&&(De=Se(Z+Ue),we=De+Ve,fe(c,l,Be,De,Be,we,Ve)),Ae&&(De=Se(Z+Ze),we=De-Ve,fe(c,l,Be,De,Be,we,Ve,!0))),c.restore()}}function zr(c,l,p,y){return l.colorNeedleEnd?oe.linearGradient(c,y?l.colorNeedleEnd:l.colorNeedle,y?l.colorNeedle:l.colorNeedleEnd,p,!c.barDimensions.isVertical):l.colorNeedle}function fm(c,l,p,y,S,x,D,R){c.lineWidth=l.needleWidth,c.strokeStyle=zr(c,l,D,R),c.beginPath(),c.moveTo(p,y),c.lineTo(S,x),c.stroke(),c.closePath()}function bm(c,l,p,y,S,x,D,R){var P=Se(.4*D),V=D-P,$=p===S,Z=l.needleWidth/2;c.fillStyle=zr(c,l,D,R),c.beginPath(),$?(y>x&&(V*=-1),c.moveTo(p-Z,y),c.lineTo(p+Z,y),c.lineTo(p+Z,y+V),c.lineTo(p,x),c.lineTo(p-Z,y+V),c.lineTo(p-Z,y)):(p>S&&(V*=-1),c.moveTo(p,y-Z),c.lineTo(p,y+Z),c.lineTo(p+V,y+Z),c.lineTo(S,y),c.lineTo(p+V,y-Z),c.lineTo(p,y-Z)),c.fill(),c.closePath()}function Am(c,l,p,y,S,x,D){var R=(parseFloat(l.fontValueSize)||0)*x/200,P=(.11*D-R)/2;c.barDimensions.isVertical&&oe.drawValueBox(c,l,p,y+x/2,S+D-R-P,x)}var Hr=(function(){function c(l,p){var y=[],S=!0,x=!1,D=void 0;try{for(var R,P=l[Symbol.iterator]();!(S=(R=P.next()).done)&&(y.push(R.value),!p||y.length!==p);S=!0);}catch(V){x=!0,D=V}finally{try{!S&&P.return&&P.return()}finally{if(x)throw D}}return y}return function(l,p){if(Array.isArray(l))return l;if(Symbol.iterator in Object(l))return c(l,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),Uo=function c(l,p,y){l===null&&(l=Function.prototype);var S=Object.getOwnPropertyDescriptor(l,p);if(S===void 0){var x=Object.getPrototypeOf(l);return x===null?void 0:c(x,p,y)}if("value"in S)return S.value;var D=S.get;if(D!==void 0)return D.call(y)},vm=function c(l,p,y,S){var x=Object.getOwnPropertyDescriptor(l,p);if(x===void 0){var D=Object.getPrototypeOf(l);D!==null&&c(D,p,y,S)}else if("value"in x&&x.writable)x.value=y;else{var R=x.set;R!==void 0&&R.call(S,y)}return y},ln=(function(){function c(l,p){for(var y=0;y<p.length;y++){var S=p[y];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(l,S.key,S)}}return function(l,p,y){return p&&c(l.prototype,p),y&&c(l,y),l}})(),Oa=null,ym=(function(){function c(){i(this,c),this._events={},this.addListener=this.on,this.removeListener=this.off}return ln(c,[{key:"emit",value:function(l){if(this._events[l]){for(var p=0,y=this._events[l].length,S=arguments.length,x=Array(S>1?S-1:0),D=1;D<S;D++)x[D-1]=arguments[D];for(;p<y;p++)this._events[l][p]&&this._events[l][p].apply(this,x)}}},{key:"once",value:function(l){for(var p=arguments.length,y=Array(p>1?p-1:0),S=1;S<p;S++)y[S-1]=arguments[S];for(var x=0,D=y.length,R=this;x<D;x++)(function(){var P=y[x],V=function $(){R.off(l,$),P.apply(R,arguments)};y[x]=V})();this.on.apply(this,[l].concat(y))}},{key:"on",value:function(l){this._events[l]||(this._events[l]=[]);for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)this._events[l].push(arguments.length<=p+1?void 0:arguments[p+1])}},{key:"off",value:function(l){if(this._events[l])for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)for(var S=arguments.length<=p+1?void 0:arguments[p+1],x=void 0;~(x=this._events[l].indexOf(S));)this._events[l].splice(x,1)}},{key:"removeAllListeners",value:function(l){delete this._events[l]}},{key:"listeners",get:function(){return this._events}}]),c})(),jr=a("requestAnimationFrame")||function(c){return setTimeout(function(){return c(new Date().getTime())},1e3/60)},ma={linear:function(c){return c},quad:function(c){return Math.pow(c,2)},dequad:function(c){return 1-ma.quad(1-c)},quint:function(c){return Math.pow(c,5)},dequint:function(c){return 1-Math.pow(1-c,5)},cycle:function(c){return 1-Math.sin(Math.acos(c))},decycle:function(c){return Math.sin(Math.acos(1-c))},bounce:function(c){return 1-ma.debounce(1-c)},debounce:function(c){for(var l=0,p=1;;l+=p,p/=2)if(c>=(7-4*l)/11)return-Math.pow((11-6*l-11*c)/4,2)+Math.pow(p,2)},elastic:function(c){return 1-ma.delastic(1-c)},delastic:function(c){return Math.pow(2,10*(c-1))*Math.cos(20*Math.PI*1.5/3*c)}},qo=(function(){function c(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,c),this.duration=p,this.rule=l,this.draw=y,this.end=S,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",y);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",S)}return ln(c,[{key:"animate",value:function(l,p){var y=this;this.frame&&this.cancel();var S=window.performance&&window.performance.now?window.performance.now():a("animationStartTime")||Date.now();l=l||this.draw,p=p||this.end,this.draw=l,this.end=p,this.frame=jr(function(x){return r(x,l,S,ma[y.rule]||y.rule,y.duration,p,y)})}},{key:"cancel",value:function(){this.frame&&((a("cancelAnimationFrame")||function(l){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),c})();qo.rules=ma;var xn=(function(){function c(l,p,y){i(this,c),this.options=l,this.element=p.toLowerCase(),this.type=c.toDashed(y),this.Type=n[y],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||c.domReady(this.traverse.bind(this))}return ln(c,[{key:"isValidNode",value:function(l){return!(!l.tagName||l.tagName.toLowerCase()!==this.element||l.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var l=document.getElementsByTagName(this.element),p=0,y=l.length;p<y;p++)this.process(l[p]);this.isObservable&&!this.mutationsObserved&&(new MutationObserver(this.observe.bind(this)).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.mutationsObserved=!0)}},{key:"observe",value:function(l){for(var p=0,y=l.length;p<y;p++){var S=l[p];if(S.type==="attributes"&&S.attributeName==="data-type"&&this.isValidNode(S.target)&&S.oldValue!==this.type)setTimeout(this.process.bind(this,S.target));else if(S.addedNodes&&S.addedNodes.length)for(var x=0,D=S.addedNodes.length;x<D;x++)setTimeout(this.process.bind(this,S.addedNodes[x]))}}},{key:"process",value:function(l){var p=this;if(!this.isValidNode(l))return null;var y=void 0,S=JSON.parse(JSON.stringify(this.options)),x=null;for(y in S)if(S.hasOwnProperty(y)){var D=c.toAttributeName(y),R=c.parse(l.getAttribute(D));R!=null&&(S[y]=R)}return S.renderTo=l,x=new this.Type(S),x.draw&&x.draw(),this.isObservable&&(x.observer=new MutationObserver(function(P){P.forEach(function(V){if(V.type==="attributes"){var $=V.attributeName.toLowerCase(),Z=l.getAttribute($).toLowerCase();if($==="data-type"&&Z&&Z!==p.type)x.observer.disconnect(),delete x.observer,x.destroy&&x.destroy();else if($.substr(0,5)==="data-"){var de=$.substr(5).split("-").map(function(Ae,Fe){return Fe?Ae.charAt(0).toUpperCase()+Ae.substr(1):Ae}).join(""),pe={};pe[de]=c.parse(l.getAttribute(V.attributeName)),de==="value"?x&&(x.value=pe[de]):x.update&&x.update(pe)}}})}),x.observer.observe(l,{attributes:!0})),x}}],[{key:"parse",value:function(l){if(l==="true")return!0;if(l==="false")return!1;if(l!=="undefined"){if(l==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(l))return l.split(",");try{return JSON.parse(l)}catch{}return l}}},{key:"toDashed",value:function(l){for(var p=l.split(/(?=[A-Z])/),y=1,S=p.length,x=p[0].toLowerCase();y<S;y++)x+="-"+p[y].toLowerCase();return x}},{key:"toCamelCase",value:function(l){for(var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],y=l.split(/-/),S=0,x=y.length,D="";S<x;S++)D+=S||p?y[S][0].toUpperCase()+y[S].substr(1).toLowerCase():y[S].toLowerCase();return D}},{key:"toAttributeName",value:function(l){return"data-"+c.toDashed(l)}},{key:"domReady",value:function(l){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return l();window.addEventListener?window.addEventListener("DOMContentLoaded",l,!1):window.attachEvent&&window.attachEvent("onload",l)}}]),c})(),di=(function(){function c(l,p,y){i(this,c),c.collection.push(this),this.width=p||0,this.height=y||0,this.element=l,this.init()}return ln(c,[{key:"init",value:function(){var l=c.pixelRatio;this.element.width=this.width*l,this.element.height=this.height*l,this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.elementClone=this.element.cloneNode(!0),this.context=this.element.getContext("2d"),this.contextClone=this.elementClone.getContext("2d"),this.drawWidth=this.element.width,this.drawHeight=this.element.height,this.drawX=this.drawWidth/2,this.drawY=this.drawHeight/2,this.minSide=this.drawX<this.drawY?this.drawX:this.drawY,this.contextClone.translate(this.drawX,this.drawY),this.elementClone.initialized=!1,this.context.translate(this.drawX,this.drawY),this.context.max=this.contextClone.max=this.minSide,this.context.maxRadius=this.contextClone.maxRadius=null}},{key:"destroy",value:function(){var l=c.collection.indexOf(this);~l&&c.collection.splice(l,1),this.context.clearRect(-this.drawX,-this.drawY,this.drawWidth,this.drawHeight),this.context.max=null,delete this.context.max,this.context.maxRadius=null,delete this.context.maxRadius,this.context=null,this.contextClone=null,this.elementClone=null,this.element=null,this.onRedraw=null}},{key:"commit",value:function(){var l=c.pixelRatio;return l!==1&&this.contextClone.scale(l,l),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var l=0,p=c.collection.length;l<p;l++)c.collection[l].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),c})();di.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(di.redraw);var zo={renderTo:null,width:0,height:0,minValue:0,maxValue:100,value:0,units:!1,exactTicks:!1,majorTicks:[0,20,40,60,80,100],minorTicks:10,strokeTicks:!0,animatedValue:!1,animateOnInit:!1,title:!1,borders:!0,numbersMargin:1,listeners:null,valueInt:3,valueDec:2,majorTicksInt:1,majorTicksDec:0,animation:!0,animationDuration:500,animationRule:"cycle",colorPlate:"#fff",colorPlateEnd:"",colorMajorTicks:"#444",colorMinorTicks:"#666",colorStrokeTicks:"",colorTitle:"#888",colorUnits:"#888",colorNumbers:"#444",colorNeedle:"rgba(240,128,128,1)",colorNeedleEnd:"rgba(255,160,122,.9)",colorValueText:"#444",colorValueTextShadow:"rgba(0,0,0,0.3)",colorBorderShadow:"rgba(0,0,0,0.5)",colorBorderOuter:"#ddd",colorBorderOuterEnd:"#aaa",colorBorderMiddle:"#eee",colorBorderMiddleEnd:"#f0f0f0",colorBorderInner:"#fafafa",colorBorderInnerEnd:"#ccc",colorValueBoxRect:"#888",colorValueBoxRectEnd:"#666",colorValueBoxBackground:"#babab2",colorValueBoxShadow:"rgba(0,0,0,1)",colorNeedleShadowUp:"rgba(2,255,255,0.2)",colorNeedleShadowDown:"rgba(188,143,143,0.45)",colorBarStroke:"#222",colorBar:"#ccc",colorBarProgress:"#888",colorBarShadow:"#000",fontNumbers:"Arial",fontTitle:"Arial",fontUnits:"Arial",fontValue:"Arial",fontNumbersSize:20,fontTitleSize:24,fontUnitsSize:22,fontValueSize:26,fontNumbersStyle:"normal",fontTitleStyle:"normal",fontUnitsStyle:"normal",fontValueStyle:"normal",fontNumbersWeight:"normal",fontTitleWeight:"normal",fontUnitsWeight:"normal",fontValueWeight:"normal",needle:!0,needleShadow:!0,needleType:"arrow",needleStart:5,needleEnd:85,needleWidth:4,borderOuterWidth:3,borderMiddleWidth:3,borderInnerWidth:3,borderShadowWidth:3,valueBox:!0,valueBoxStroke:5,valueBoxWidth:0,valueText:"",valueTextShadow:!0,valueBoxBorderRadius:2.5,highlights:[{from:20,to:60,color:"#eee"},{from:60,to:80,color:"#ccc"},{from:80,to:100,color:"#999"}],highlightsWidth:15,highlightsLineCap:"butt",barWidth:20,barStrokeWidth:0,barProgress:!0,barShadow:0};s.prototype=Object.create(Array.prototype),s.prototype.constructor=s,s.prototype.get=function(c){if(typeof c=="string")for(var l=0,p=this.length;l<p;l++){var y=this[l].options.renderTo.tagName?this[l].options.renderTo:document.getElementById(this[l].options.renderTo||"");if(y.getAttribute("id")===c)return this[l]}else if(typeof c=="number")return this[c];return null};var Ho="2.2.1",Se=Math.round,ci=Math.abs,ua=new s;ua.version=Ho;var yi=(function(c){function l(p){i(this,l);var y=e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this)),S=y.constructor.name;if(S==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(ua.push(y),p.listeners&&Object.keys(p.listeners).forEach(function(D){(p.listeners[D]instanceof Array?p.listeners[D]:[p.listeners[D]]).forEach(function(R){y.on(D,R)})}),y.version=Ho,y.type=n[S]||l,y.initialized=!1,p.minValue=parseFloat(p.minValue),p.maxValue=parseFloat(p.maxValue),p.value=parseFloat(p.value)||0,p.borders||(p.borderInnerWidth=p.borderMiddleWidth=p.borderOuterWidth=0),!p.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var x=p.renderTo.tagName?p.renderTo:document.getElementById(p.renderTo);if(!(x instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return p.width=parseFloat(p.width)||0,p.height=parseFloat(p.height)||0,p.width&&p.height||(p.width||(p.width=x.parentNode?x.parentNode.offsetWidth:x.offsetWidth),p.height||(p.height=x.parentNode?x.parentNode.offsetHeight:x.offsetHeight)),y.options=p||{},y.options.animateOnInit&&(y._value=y.options.value,y.options.value=y.options.minValue),y.canvas=new di(x,p.width,p.height),y.canvas.onRedraw=y.draw.bind(y),y.animation=new qo(p.animationRule,p.animationDuration),y}return t(l,c),ln(l,[{key:"update",value:function(p){return Object.assign(this.options,this.type.configure(p||{})),this.canvas.width=this.options.width,this.canvas.height=this.options.height,this.animation.rule=this.options.animationRule,this.animation.duration=this.options.animationDuration,this.canvas.redraw(),this}},{key:"destroy",value:function(){var p=ua.indexOf(this);~p&&ua.splice(p,1),this.canvas.destroy(),this.canvas=null,this.animation.destroy(),this.animation=null,this.emit("destroy")}},{key:"draw",value:function(){return this.options.animateOnInit&&!this.initialized&&(this.value=this._value,this.initialized=!0,this.emit("init")),this.emit("render"),this}},{key:"value",set:function(p){var y=this;p=l.ensureValue(p,this.options.minValue);var S=this.options.value;if(p!==S)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===p))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=p),this.emit("animationStart"),this.animation.animate(function(x){var D=S+(p-S)*x;y.options.animatedValue&&y.emit("value",D,y.value),y.options.value=D,y.draw(),y.emit("animate",x,y.options.value)},function(){y._value!==void 0&&(y.emit("value",y._value,y.value),y.options.value=y._value,delete y._value),y.draw(),y.emit("animationEnd"),y.animation.frame=null})}else this.emit("value",p,this.value),this.options.value=p,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(p){return p}},{key:"initialize",value:function(p,y){return new xn(y,"canvas",p)}},{key:"fromElement",value:function(p){var y=xn.toCamelCase(p.getAttribute("data-type")),S=p.attributes,x=0,D=S.length,R={};if(y){for(/Gauge$/.test(y)||(y+="Gauge");x<D;x++)R[xn.toCamelCase(S[x].name.replace(/^data-/,""),!1)]=xn.parse(S[x].value);new xn(R,p.tagName,y).process(p)}}},{key:"ensureValue",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return p=parseFloat(p),!isNaN(p)&&isFinite(p)||(p=parseFloat(y)||0),p}},{key:"mod",value:function(p,y){return(p%y+y)%y}},{key:"version",get:function(){return Ho}}]),l})(ym);n!==void 0&&(n.BaseGauge=yi,n.gauges=(window.document||{}).gauges=ua);var Cm=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,oe={roundRect:C,padValue:_,formatMajorTickNumber:N,radians:E,radialPoint:j,linearGradient:Y,drawNeedleShadow:K,drawValueBox:Te,verifyError:h,prepareTicks:b,font:ee,normalizedValue:$e,formatContext:f},ha=Math.PI,jo=ha/2,Yr=Object.assign({},zo,{ticksAngle:270,startAngle:45,colorNeedleCircleOuter:"#f0f0f0",colorNeedleCircleOuterEnd:"#ccc",colorNeedleCircleInner:"#e8e8e8",colorNeedleCircleInnerEnd:"#f5f5f5",needleCircleSize:10,needleCircleInner:!0,needleCircleOuter:!0,needleStart:20,animationTarget:"needle",useMinPath:!1,barWidth:0,barStartPosition:"left"}),Sm=(function(c){function l(p){return i(this,l),p=Object.assign({},Yr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),ln(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],D=y[2],R=y[3],P=this.options;if(P.animationTarget==="needle"){if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,R),this.emit("beforePlate"),Me(V,P),this.emit("beforeHighlights"),ze(V,P),this.emit("beforeMinorTicks"),He(V,P),this.emit("beforeMajorTicks"),st(V,P),this.emit("beforeNumbers"),Da(V,P),this.emit("beforeTitle"),Nr(V,P),this.emit("beforeUnits"),Vr(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,R),p.context.drawImage(p.elementClone,S,x,D,R),this.emit("beforeProgressBar"),Gr(p.context,P),this.emit("beforeValueBox"),Lr(p.context,P,Fr(this)),this.emit("beforeNeedle"),Wr(p.context,P)}else{var $=-oe.radians((P.value-P.minValue)/(P.maxValue-P.minValue)*P.ticksAngle);if(p.context.clearRect(S,x,D,R),this.emit("beforePlate"),Me(p.context,P),p.context.rotate($),this.emit("beforeHighlights"),ze(p.context,P),this.emit("beforeMinorTicks"),He(p.context,P),this.emit("beforeMajorTicks"),st(p.context,P),this.emit("beforeNumbers"),Da(p.context,P),this.emit("beforeProgressBar"),Gr(p.context,P),p.context.rotate(-$),!p.elementClone.initialized){var Z=p.contextClone;Z.clearRect(S,x,D,R),this.emit("beforeTitle"),Nr(Z,P),this.emit("beforeUnits"),Vr(Z,P),this.emit("beforeNeedle"),Wr(Z,P),p.elementClone.initialized=!0}p.context.drawImage(p.elementClone,S,x,D,R)}this.emit("beforeValueBox"),Lr(p.context,P,Fr(this)),Uo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(de){oe.verifyError(de)}return this}},{key:"value",set:function(p){p=yi.ensureValue(p,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=p,p=this.options.value+((p-this.options.value)%360+540)%360-180),vm(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",p,this)},get:function(){return Uo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",this)}}],[{key:"configure",value:function(p){return p.barWidth>50&&(p.barWidth=50),isNaN(p.startAngle)&&(p.startAngle=45),isNaN(p.ticksAngle)&&(p.ticksAngle=270),p.ticksAngle>360&&(p.ticksAngle=360),p.ticksAngle<0&&(p.ticksAngle=0),p.startAngle<0&&(p.startAngle=0),p.startAngle>360&&(p.startAngle=360),p}}]),l})(yi);n!==void 0&&(n.RadialGauge=Sm),yi.initialize("RadialGauge",Yr);var Qr=Object.assign({},zo,{borderRadius:0,barBeginCircle:30,colorBarEnd:"",colorBarProgressEnd:"",needleWidth:6,tickSide:"both",needleSide:"both",numberSide:"both",ticksWidth:10,ticksWidthMinor:5,ticksPadding:5,barLength:85,fontTitleSize:26,highlightsWidth:10}),wm=(function(c){function l(p){return i(this,l),p=Object.assign({},Qr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),ln(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],D=y[2],R=y[3],P=this.options;if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,R),this.emit("beforePlate"),this.drawBox=om(V,P,S,x,D,R),this.emit("beforeBar"),sm.apply(void 0,[V,P].concat(o(this.drawBox))),p.contextClone.barDimensions=V.barDimensions,this.emit("beforeHighlights"),dm(V,P),this.emit("beforeMinorTicks"),mm(V,P),this.emit("beforeMajorTicks"),cm(V,P),this.emit("beforeNumbers"),um(V,P),this.emit("beforeTitle"),hm(V,P),this.emit("beforeUnits"),pm(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,R),p.context.drawImage(p.elementClone,S,x,D,R),this.emit("beforeProgressBar"),lm.apply(void 0,[p.context,P].concat(o(this.drawBox))),this.emit("beforeNeedle"),gm(p.context,P),this.emit("beforeValueBox"),Am.apply(void 0,[p.context,P,P.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),Uo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch($){oe.verifyError($)}return this}}],[{key:"configure",value:function(p){return p.barStrokeWidth>=p.barWidth&&(p.barStrokeWidth=Se(p.barWidth/2)),p.hasLeft=Ur("right",p),p.hasRight=Ur("left",p),p.value>p.maxValue&&(p.value=p.maxValue),p.value<p.minValue&&(p.value=p.minValue),yi.configure(p)}}]),l})(yi);n!==void 0&&(n.LinearGauge=wm),yi.initialize("LinearGauge",Qr),typeof Do<"u"&&Object.assign(n,{Collection:s,GenericOptions:zo,Animation:qo,BaseGauge:yi,drawings:oe,SmartCanvas:di,DomObserver:xn,vendorize:a})})(typeof Do<"u"?Do.exports:window)});var El=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var Et=(()=>{class n{_settings=A(Gt);_router=A(Ts);_destroyRef=A(at);dashboards=w([],{equal:Ri});activeDashboard=w(null);_widgetAction=new _n(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=w(!0);layoutEditSaved=w(0);layoutEditCanceled=w(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let i=El.map(a=>je(Ie({},a),{id:Ht.create()}));this.dashboards.set([...i])}else this.dashboards.set(e);let t=this.getRouteParam("id");if(t===null||t==="")this.setActiveDashboardIndex(0);else{let i=Number(t);isNaN(i)||this.setActiveDashboardIndex(i)}this._router.events.pipe(Ci(i=>i instanceof ks),$t(()=>this.getRouteParam("id")),Na(),Ke(this._destroyRef)).subscribe(i=>{if(i===null||i==="")return;let a=Number(i);isNaN(a)||this.setActiveDashboardIndex(a)}),I(()=>{let i=this.dashboards();W(()=>{this._settings.saveDashboards(i)})})}getRouteParam(e){let t=this._router.routerState.snapshot.root;for(;t;){if(t.paramMap.has(e))return t.paramMap.get(e);t=t.firstChild??null}return null}setActiveDashboardIndex(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?(this.activeDashboard.set(e),console.log(`[Dashboard Service] Active dashboard index set to ${e}`)):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,i,a){let r=0;return this.dashboards.update(s=>{let h=[...s,{id:Ht.create(),name:e,icon:i??"dashboard-dashboard",configuration:t,collapseSplitShell:a??!1}];return r=h.length-1,h}),r}update(e,t,i,a){this.dashboards.update(r=>r.map((s,h)=>h===e?je(Ie({},s),{name:t,icon:i??"dashboard-dashboard",collapseSplitShell:a??!1}):s))}delete(e){this.dashboards.update(t=>t.filter((i,a)=>a!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,i,a){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let r=this.dashboards()[e],s=Ot(r);s.id=Ht.create(),s.name=t,s.icon=i||"dashboard-dashboard",s.collapseSplitShell=a??!1,Array.isArray(s.configuration)?s.configuration.forEach(f=>{f&&f.input?.widgetProperties?(f.id=Ht.create(),f.input.widgetProperties.uuid=f.id):console.error("Dashboard Service] Widget configuration is missing required properties:",f)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",s.configuration),s.configuration=[]);let h=-1;return this.dashboards.update(f=>{let b=[...f,s];return h=b.length-1,b}),h}updateConfiguration(e,t){this.dashboards.update(i=>i.map((a,r)=>r===e?Ri(a.configuration,t)?a:je(Ie({},a),{configuration:t}):a))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=lt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Pi=(()=>{class n{appSettings=A(Gt);data=A(wi);_svcDatasetConfigs=[];_svcDataSource=[];_svcSubjectObserverRegistry=[];signedAnglePaths=new Set(["self.navigation.attitude.roll","self.navigation.attitude.pitch","self.navigation.attitude.yaw","self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater","self.steering.rudderAngle"]);constructor(){this._svcDatasetConfigs=this.appSettings.getDataSets(),this.cleanupDatasets(),this.startAll()}cleanupDatasets(){if(this.appSettings.configUpgrade()||this.appSettings.getAppConfig().configVersion<12)return;let t=this.appSettings.getDashboardConfig(),i=new Set;t.forEach(h=>{h.configuration?.length&&h.configuration?.forEach(f=>{f?.id&&i.add(f.id)})});function a(h){let f=h.match(/^(windtrends|speedtrends)-(.+)$/);return f?f[2]:null}let r=[],s=[];for(let h of this._svcDatasetConfigs){let f=h.label||"",b=!1;if(f.startsWith("windtrends-")||f.startsWith("speedtrends-")){let C=a(f);b=!!(C&&i.has(C))}else(f.startsWith("simple-chart-")||(f.match(/\|/g)||[]).length===4)&&(b=i.has(h.uuid));b?s.push(h):r.push(h)}r.length&&(r.forEach(h=>{console.warn(`[DatasetService] Cleaned dataset: uuid=${h.uuid}, label="${h.label}"`)}),this._svcDatasetConfigs=s,this.appSettings.saveDataSets(this._svcDatasetConfigs))}setupServiceSubjectRegistry(e,t){let i=this._svcSubjectObserverRegistry.findIndex(a=>a.datasetUuid==e);i>=0&&(this._svcSubjectObserverRegistry[i].rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(i,1)),this._svcSubjectObserverRegistry.push({datasetUuid:e,rxjsSubject:new Kr(t)})}createDataSourceConfiguration(e){let i={uuid:e.uuid,pathObserverSubscription:null,sampleTime:null,maxDataPoints:null,smoothingPeriod:null,historicalData:[]};switch(e.timeScaleFormat){case"Last 30 Minutes":i.maxDataPoints=120,i.sampleTime=15e3,i.smoothingPeriod=50;break;case"Last 5 Minutes":i.maxDataPoints=60,i.sampleTime=5e3,i.smoothingPeriod=25;break;case"Last Minute":i.maxDataPoints=60,i.sampleTime=1e3,i.smoothingPeriod=25;break;case"hour":i.maxDataPoints=e.period*120,i.sampleTime=3e4,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;case"minute":i.maxDataPoints=e.period*60,i.sampleTime=1e3,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;default:i.maxDataPoints=e.period*5,i.sampleTime=200,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break}return(!i.maxDataPoints||i.maxDataPoints<1)&&(i.maxDataPoints=1),i}startAll(){console.log("[Dataset Service] Auto Starting "+this._svcDatasetConfigs.length.toString()+" Datasets");for(let e of this._svcDatasetConfigs)this.start(e.uuid)}start(e){let t=this._svcDatasetConfigs.find(h=>h.uuid==e);if(!t){console.warn(`[Dataset Service] Dataset UUID:${e} not found`);return}let i=this.createDataSourceConfiguration(t);this.setupServiceSubjectRegistry(i.uuid,i.maxDataPoints);let a=this._svcDataSource[this._svcDataSource.push(i)-1];console.log(`[Dataset Service] Starting recording process: ${t.path}, Scale: ${t.timeScaleFormat}, Period: ${t.period}, Datapoints: ${i.maxDataPoints}`);function r(h){return f=>Mn(h).pipe(cs(f,(b,C)=>C))}let s=this.resolveAngleDomain(t.path,t.baseUnit);a.pathObserverSubscription=this.data.subscribePath(t.path,t.pathSource).pipe(r(i.sampleTime)).subscribe(h=>{if(h.data.value===null)return;a.maxDataPoints>0&&a.historicalData.length>=a.maxDataPoints&&a.historicalData.shift(),a.historicalData.push(h.data.value);let f=this.updateDataset(a,t.baseUnit,s);this._svcSubjectObserverRegistry.find(b=>b.datasetUuid===a.uuid).rxjsSubject.next(f)})}stop(e){let t=this._svcDataSource.findIndex(i=>i.uuid==e);console.log(`[Dataset Service] Stopping Dataset ${e} data capture`),this._svcDataSource[t].pathObserverSubscription.unsubscribe(),this._svcDataSource.splice(t,1)}list(){return Ot(this._svcDatasetConfigs)}getDatasetConfig(e){return this._svcDatasetConfigs.find(t=>t.uuid===e)}getDataSourceInfo(e){return this._svcDataSource.find(t=>t.uuid===e)}create(e,t,i,a,r,s=!0,h=!0,f){if(!e||!t||!i||!a||!r)return null;let b=f||Ht.create(),C={uuid:b,path:e,pathSource:t,baseUnit:this.data.getPathUnitType(e),timeScaleFormat:i,period:a,label:r,editable:h};return console.log(`[Dataset Service] Creating ${s?"":"non-"}persistent ${h?"":"hidden "}dataset: ${C.uuid}, Path: ${C.path}, Source: ${C.pathSource} Scale: ${C.timeScaleFormat}, Period: ${C.period}`),this._svcDatasetConfigs.push(C),this.start(b),s===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),b}edit(e,t=!0){let i=this._svcDatasetConfigs.find(a=>a.uuid===e.uuid);return i?JSON.stringify(i)===JSON.stringify(e)?(console.log(`[Dataset Service] No changes detected for Dataset ${e.uuid}.`),!1):(this.stop(e.uuid),console.log(`[Dataset Service] Updating Dataset: ${e.uuid}`),e.baseUnit=this.data.getPathUnitType(e.path),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(a=>a.uuid===e.uuid),1,e),this.start(e.uuid),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0):!1}remove(e,t=!0){return!e||e===""||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:(this.stop(e),console.log(`[Dataset Service] Removing ${t?"":"non-"}persistent Dataset: ${e}`),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(i=>i.uuid===e),1),this._svcSubjectObserverRegistry.find(i=>i.datasetUuid===e).rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(this._svcSubjectObserverRegistry.findIndex(i=>i.datasetUuid===e),1),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0)}getDatasetObservable(e){let t=this._svcSubjectObserverRegistry.find(i=>i.datasetUuid==e);return t?t.rxjsSubject.asObservable():null}getDatasetBatchThenLiveObservable(e){let t=this._svcSubjectObserverRegistry.find(h=>h.datasetUuid==e);if(!t)return null;let i=t.rxjsSubject,a=i._buffer?i._buffer.slice():[],r=Jr([a]),s=i.pipe(ds(a.length));return is(r,s)}updateDataset(e,t,i="scalar"){let a=null,r=null,s=null,h=null;if(t==="rad"){a=this.circularMeanRad(e.historicalData);let _=e.historicalData.slice(-e.smoothingPeriod);r=this.circularMeanRad(_);let{min:N,max:E}=this.circularMinMaxRad(e.historicalData);i==="direction"?(a=this.normalizeToDirection(a),r=this.normalizeToDirection(r),s=this.normalizeToDirection(N),h=this.normalizeToDirection(E)):i==="signed"?(a=this.normalizeToSigned(a),r=this.normalizeToSigned(r),s=this.normalizeToSigned(N),h=this.normalizeToSigned(E)):(s=N,h=E)}else a=b(e.historicalData),r=C(e.historicalData,e.smoothingPeriod),s=Math.min(...e.historicalData),h=Math.max(...e.historicalData);return{timestamp:Date.now(),data:{value:t==="rad"?i==="signed"?this.normalizeToSigned(e.historicalData[e.historicalData.length-1]):this.normalizeToDirection(e.historicalData[e.historicalData.length-1]):e.historicalData[e.historicalData.length-1],sma:r,ema:null,doubleEma:null,lastAverage:a,lastMinimum:s,lastMaximum:h}};function b(_){return _.length===0?null:_.reduce((E,j)=>E+j,0)/_.length}function C(_,N){_.length<N&&(N=_.length);let E=0;for(let j=_.length-N;j<_.length;j++)E+=_[j];return E/N}}circularMeanRad(e){if(e.length===0)return 0;let t=e.reduce((a,r)=>a+Math.sin(r),0),i=e.reduce((a,r)=>a+Math.cos(r),0);return Math.atan2(t/e.length,i/e.length)}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(h=>(h*180/Math.PI+360)%360).sort((h,f)=>h-f),i=0,a=0;for(let h=0;h<t.length;h++){let f=(h+1)%t.length,b=(t[f]-t[h]+360)%360;b>i&&(i=b,a=f)}let r=t[a]*Math.PI/180,s=t[(a-1+t.length)%t.length]*Math.PI/180;return{min:r,max:s}}resolveAngleDomain(e,t){if(t!=="rad")return"scalar";let i=this.normalizePathKey(e);for(let a of this.signedAnglePaths)if(i===this.normalizePathKey(a))return"signed";return"direction"}normalizePathKey(e){return e.replace(/^vessels\.self\./,"").replace(/^self\./,"")}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}removeIfExists(e,t=!0){return!e||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:this.remove(e,t)}ngOnDestroy(){[...this._svcDataSource].forEach(e=>{try{this.stop(e.uuid)}catch{}}),this._svcSubjectObserverRegistry.forEach(e=>e.rxjsSubject.complete()),this._svcSubjectObserverRegistry=[]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=lt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Dl=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new _n(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID===null&&(this.kipTimers[e].timeoutID=setInterval(()=>{this.kipTimers[e].currentValue.next(this.kipTimers[e].currentValue.value+1)},this.kipTimers[e].intervalMS))}stopTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&(this.stopTimer(e),this.kipTimers[e].currentValue.complete(),delete this.kipTimers[e])}isRunning(e){let t=!1;return e in this.kipTimers&&(t=this.kipTimers[e].timeoutID!==null),t}ngOnDestroy(){Object.keys(this.kipTimers).forEach(e=>{this.kipTimers[e].timeoutID&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null),this.kipTimers[e].currentValue.complete()}),this.kipTimers={}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=lt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Pl=(()=>{class n{sanitizer=A(Xa);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ua({name:"safe",type:n,pure:!0})}return n})();var _m={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function fo(n){let o=Ie(Ie({},_m),n);return`(() => {
1
+ import{A as _l,B as er,C as tr,D as ir,E as nr,F as Qn,G as wa,H as Ml,I as kl,J as $n,K as en,L as Tt,M as Zn,N as Xn,O as Kn,P as po,Q as go,R as Tl,S as Jn,T as ea,a as Bt,b as oi,c as ro,d as Cl,e as Sl,f as wl,g as xl,h as Qe,i as Xi,j as Ki,k as so,l as gn,m as Ca,n as pi,o as Ji,p as jt,q as lo,r as co,s as Yn,t as fn,u as mo,v as uo,w as gi,x as Jo,y as ho,z as Sa}from"./chunk-KITN4REV.js";import{a as yl,b as oo}from"./chunk-MHCWCMEF.js";import{a as ai,b as Zi,c as rt}from"./chunk-BRLXMYKY.js";import{a as ml,b as ul,c as hl,d as jn,e as pl,f as kt,g as gl,h as fl,i as bl,k as Al,m as ya,n as vl}from"./chunk-RVSQUIEX.js";import{a as ks,c as Ts,d as Es}from"./chunk-QL3G7CWF.js";import{a as Ft}from"./chunk-L7KYMDKT.js";import{a as dl,b as cl}from"./chunk-JWT2WFAW.js";import{A as bt,B as ni,a as ge,c as Gs,d as wi,e as Ks,f as Js,g as el,h as xi,i as _i,k as tl,l as Mi,m as ki,n as Ti,o as Hi,p as ei,r as ht,s as Qi,t as sl,u as $i,w as ll,y as pt,z as ii}from"./chunk-CWBDCB4U.js";import{A as qn,B as Ei,C as Di,D as Mt,E as ol,F as rl,G as ji,H as zn,I as Yi,J as ut,L as Hn,M as gt,N as ft,a as Ht,d as Ot,e as Ri,f as ws,i as xs,j as _s,k as Za,l as Ms,m as Gt,n as Bn,o as mt,q as xt,s as ot,t as _t,u as il,v as nl,w as ao,x as al,y as ti,z as Un}from"./chunk-MKKQCG3C.js";import{b as Bs,f as Us,g as qs,h as js,i as Ko,j as Ys,m as Qs,n as $s,o as Zs,s as Xs}from"./chunk-W4VRE5PG.js";import{$ as ss,$a as mi,$b as me,$d as Rt,A as $t,Aa as We,Ab as _e,Ac as W,Ad as Ps,Ba as Ui,Bb as Pn,Bc as le,Bd as Is,Be as zs,Ca as hs,Cb as ue,Cc as I,Ce as Hs,Da as at,Db as he,Dc as bs,E as is,Eb as T,F as ns,Fb as d,Fc as Ha,Ga as w,Gb as u,Gc as Xe,Gd as Ka,Hb as U,Hc as v,I as ga,Ib as M,Ic as ie,Id as Ln,J as Mn,Jb as k,Jd as Os,K as Gi,Ka as Xt,Kb as H,Kc as As,Kd as Rs,L as Ci,Lb as In,Lc as zt,Ld as Gn,Mb as On,Na as Oe,Nb as qa,Nc as qe,O as as,Ob as ae,Oc as Zo,Od as Ns,P as Fi,Pb as Oi,Qb as B,R as Bi,Rb as Aa,Rd as Vs,Sa as Fa,Sb as O,Sd as Si,T as os,Ta as fa,Tb as Rn,Td as Fn,U as rs,Ub as Nn,Ud as Ws,V as Na,Vb as cn,W as Va,Wb as Kt,Wd as Xo,Xa as g,Xb as Ct,Xd as Ja,Ya as ps,Yb as St,Yc as vs,Yd as Ls,Zc as ys,Zd as eo,_a as En,_b as te,_c as Cs,a as Ie,aa as ls,ac as It,ae as Ye,b as je,bc as re,bd as ja,be as Je,cb as Ba,cc as tt,cd as Ya,d as xm,da as ds,dc as Vn,e as Xr,ea as kn,ec as Ut,ed as Ss,f as nt,fa as Wa,fc as m,fe as hi,g as Li,ga as La,gc as ne,gd as Qa,hb as L,hc as ve,he as Jt,ia as Ga,ib as Lt,ic as zi,j as Yo,jb as dt,jd as $a,ka as cs,kb as Ua,kc as mn,lb as ba,lc as un,m as Vt,ma as Tn,mb as gs,mc as hn,na as lt,nb as qi,ne as to,o as _n,oa as Wt,ob as fs,od as Ke,oe as io,p as Kr,pb as yt,pd as Wn,pe as wt,qa as Zt,qb as Le,qc as ui,qe as no,ra as ms,rb as Dn,re as ct,s as Jr,sa as A,sc as pn,t as Qo,tc as va,te as Fs,u as es,ud as Xa,ue as et,va as us,vc as At,wc as qt,x as Ra,xa as q,xb as Q,xc as za,y as $o,ya as z,yb as G,z as ts,za as X,zb as F,zd as Ds}from"./chunk-PR5JLJLD.js";var ur=xm((Sx,Do)=>{(function(n){"use strict";function o(c){if(Array.isArray(c)){for(var l=0,p=Array(c.length);l<c.length;l++)p[l]=c[l];return p}return Array.from(c)}function e(c,l){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!l||typeof l!="object"&&typeof l!="function"?c:l}function t(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(c,l):c.__proto__=l)}function i(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function a(c,l){if(l||(l=typeof window>"u"?global:window),l[c]!==void 0)return l[c];if(Oa===null){var p=window.getComputedStyle(document.documentElement,"");Oa=(Array.prototype.slice.call(p).join("").match(/-(moz|webkit|ms)-/)||p.OLink===""&&["","o"]||["",""])[1]}if(Oa==="")return null;var y=c.charAt(0).toUpperCase()+c.substr(1),S=l[Oa+y];return S!==void 0?S:null}function r(c,l,p,y,S,x,D){if(typeof y!="function")throw new TypeError("Invalid animation rule:",y);var R=c-p,P=R/S,V=0;P>1&&(P=1),P!==1&&(V=y(P),isFinite(V)&&!isNaN(V)&&(P=V)),l&&l(P),R<S?D.frame=jr(function($){return r($,l,p,y,S,x,D)}):(x&&x(),D.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function h(c){if(!(c instanceof DOMException&&c.result===2152923147))throw c}function f(c,l){return l.replace(Cm,function(p,y){var S=c[y];return S!==void 0?S:p})}function b(c){return c.majorTicks instanceof Array||(c.majorTicks=c.majorTicks?[c.majorTicks]:[]),c.majorTicks.length||(c.majorTicks.push(oe.formatMajorTickNumber(c.minValue,c)),c.majorTicks.push(oe.formatMajorTickNumber(c.maxValue,c))),[c.tickSide!=="right",c.tickSide!=="left"]}function C(c,l,p,y,S,x){c.beginPath(),c.moveTo(l+x,p),c.lineTo(l+y-x,p),c.quadraticCurveTo(l+y,p,l+y,p+x),c.lineTo(l+y,p+S-x),c.quadraticCurveTo(l+y,p+S,l+y-x,p+S),c.lineTo(l+x,p+S),c.quadraticCurveTo(l,p+S,l,p+S-x),c.lineTo(l,p+x),c.quadraticCurveTo(l,p,l+x,p),c.closePath()}function _(c,l){var p=l.valueDec,y=l.valueInt,S=0,x=void 0,D=void 0,R=void 0;if(c=parseFloat(c),R=c<0,c=Math.abs(c),p>0){for(D=c.toFixed(p).toString().split("."),x=y-D[0].length;S<x;++S)D[0]="0"+D[0];D=(R?"-":"")+D[0]+"."+D[1]}else{for(D=Math.round(c).toString(),x=y-D.length;S<x;++S)D="0"+D;D=(R?"-":"")+D}return D}function N(c,l){var p=void 0,y=!1;return p=l.majorTicksDec===0?Math.round(c).toString():c.toFixed(l.majorTicksDec),l.majorTicksInt>1?(y=~p.indexOf("."),~p.indexOf("-")?"-"+[l.majorTicksInt+l.majorTicksDec+2+(y?1:0)-p.length].join("0")+p.replace("-",""):[l.majorTicksInt+l.majorTicksDec+1+(y?1:0)-p.length].join("0")+p):p}function E(c){return c*Math.PI/180}function j(c,l){return{x:-c*Math.sin(l),y:c*Math.cos(l)}}function Y(c,l,p,y){var S=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],x=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,D=c.createLinearGradient(S?0:x,S?x:0,S?0:y,S?y:0);return D.addColorStop(0,l),D.addColorStop(1,p),D}function K(c,l){l.needleShadow&&(c.shadowOffsetX=2,c.shadowOffsetY=2,c.shadowBlur=10,c.shadowColor=l.colorNeedleShadowDown)}function ee(c,l,p){return c["font"+l+"Style"]+" "+c["font"+l+"Weight"]+" "+c["font"+l+"Size"]*p+"px "+c["font"+l]}function se(c){c.shadowOffsetX=null,c.shadowOffsetY=null,c.shadowBlur=null,c.shadowColor="",c.strokeStyle=null,c.lineWidth=0,c.save()}function Re(c,l,p,y){l.valueTextShadow&&(c.shadowOffsetX=p,c.shadowOffsetY=p,c.shadowBlur=y,c.shadowColor=l.colorValueTextShadow)}function Te(c,l,p,y,S,x){if(l.valueBox){se(c);var D=l.valueDec?1+l.valueDec:0,R="9".repeat(Math.max.apply(null,[String(parseInt(p)).length+D].concat(l.majorTicks.map(function(Pe){return String(parseInt(Pe,10)).length+D})))),P=l.valueText||_(p,l),V=x/200,$=x/100,Z=.4*$,de=1.2*$;c.font=ee(l,"Value",V),Re(c,l,Z,de);var pe=c.measureText(l.valueText?P:"-"+_(Number(R),l)).width;se(c);var Ae=parseFloat(l.fontValueSize)*V+Z+de,Fe=$*parseFloat(l.valueBoxStroke),be=2*x-2*Fe,Ne=pe+10*$,Ve=1.1*Ae+Z+de,Be=$*l.valueBoxBorderRadius,ke=(parseFloat(l.valueBoxWidth)||0)/100*be;ke>Ne&&(Ne=ke),Ne>be&&(Ne=be);var De=y-Ne/2,we=S-Ve/2,fe=S-5.75*$;if(c.beginPath(),Be?C(c,De,we,Ne,Ve,Be):c.rect(De,we,Ne,Ve),Fe){var ye=c.createRadialGradient(y,fe,10*$,y,fe,20*$);ye.addColorStop(0,l.colorValueBoxRect),ye.addColorStop(1,l.colorValueBoxRectEnd),c.strokeStyle=ye,c.lineWidth=Fe,c.stroke()}l.colorValueBoxShadow&&(c.shadowBlur=1.2*$,c.shadowColor=l.colorValueBoxShadow),l.colorValueBoxBackground&&(c.fillStyle=l.colorValueBoxBackground,c.fill()),c.closePath(),c.restore(),Re(c,l,Z,de),c.fillStyle=l.colorValueText,c.textAlign="center",c.textBaseline="alphabetic",c.fillText(P,De+Ne/2,S+Ve/2-Ae/3),c.restore()}}function $e(c){var l=c.value,p=c.minValue,y=c.maxValue,S=.01*(y-p);return{normal:l<p?p:l>y?y:l,indented:l<p?p-S:l>y?y+S:l}}function Ee(c,l,p,y,S){p.beginPath(),p.arc(0,0,ci(c),0,2*ha,!0),p.lineWidth=l,p.strokeStyle=S?oe.linearGradient(p,y,S,c):y,p.stroke(),p.closePath()}function Ge(c,l){var p=di.pixelRatio;return c.maxRadius||(c.maxRadius=c.max-l.borderShadowWidth-l.borderOuterWidth*p-l.borderMiddleWidth*p-l.borderInnerWidth*p+(l.borderOuterWidth?.5:0)+(l.borderMiddleWidth?.5:0)+(l.borderInnerWidth?.5:0)),c.maxRadius}function Me(c,l){function p(Z,de,pe,Ae,Fe,be){return de&&(!be&&l.borderShadowWidth&&(pe.save(),pe.shadowBlur=l.borderShadowWidth,pe.shadowColor=l.colorBorderShadow),Ee(Z,de*y,pe,Ae,Fe),!be&&l.borderShadowWidth&&(be=!0,pe.restore())),be}var y=di.pixelRatio,S=l.borderShadowWidth*y,x=c.max-S-l.borderOuterWidth*y/2,D=x-l.borderOuterWidth*y/2-l.borderMiddleWidth*y/2+.5,R=D-l.borderMiddleWidth*y/2-l.borderInnerWidth*y/2+.5,P=Ge(c,l),V=void 0,$=!1;c.save(),$=p(x,l.borderOuterWidth,c,l.colorBorderOuter,l.colorBorderOuterEnd,$),$=p(D,l.borderMiddleWidth,c,l.colorBorderMiddle,l.colorBorderMiddleEnd,$),$=p(R,l.borderInnerWidth,c,l.colorBorderInner,l.colorBorderInnerEnd,$),!$&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),c.beginPath(),c.arc(0,0,ci(P),0,2*ha,!0),l.colorPlateEnd?(V=c.createRadialGradient(0,0,P/2,0,0,P),V.addColorStop(0,l.colorPlate),V.addColorStop(1,l.colorPlateEnd)):V=l.colorPlate,c.fillStyle=V,c.fill(),c.closePath(),c.restore()}function ze(c,l){if(l.highlights!=="false"&&l.highlights.length&&l.highlightsWidth!==0){var p=c.max*(parseFloat(l.highlightsWidth)||0)/100,y=ci(it(c,l)-p/2),S=l.highlights.length,x=(l.maxValue-l.minValue)/l.ticksAngle;c.save();for(var D=0;D<S;D++){var R=l.highlights[D];c.lineWidth=p,c.lineCap=l.highlightsLineCap,c.strokeStyle=R.color,c.beginPath(),c.rotate(jo),c.arc(0,0,y,oe.radians(l.startAngle+(R.from-l.minValue)/x),oe.radians(l.startAngle+(R.to-l.minValue)/x),!1),c.stroke(),c.closePath(),c.restore(),c.save()}c.restore()}}function He(c,l){var p=it(c,l),y=void 0,S=void 0,x=void 0,D=0,R=Math.abs(l.minorTicks)||0,P=l.ticksAngle/(l.maxValue-l.minValue);l.exactTicks?(S=l.maxValue-l.minValue,y=R?S/R:0,D=(yi.mod(l.majorTicks[0],R)||0)*P):y=R*(l.majorTicks.length-1),c.lineWidth=di.pixelRatio,c.strokeStyle=l.colorMinorTicks||l.colorStrokeTicks,c.save();for(var V=0;V<y;++V)(x=l.startAngle+D+V*(l.ticksAngle/y))<=l.ticksAngle+l.startAngle&&(c.rotate(oe.radians(x)),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.075*c.max),sn(c));c.restore()}function it(c,l){var p=c.max/100;return Ge(c,l)-5*p-(l.barWidth?2*(parseFloat(l.barStrokeWidth)||0)+((parseFloat(l.barWidth)||0)+5)*p:0)}function st(c,l){oe.prepareTicks(l);var p=ci(it(c,l)),y=void 0,S=l.majorTicks.length,x=di.pixelRatio;c.lineWidth=2*x,y=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(S).fill(l.colorStrokeTicks||l.colorMajorTicks);for(var D=0;D<S;++D)c.save(),c.strokeStyle=y[D],c.rotate(oe.radians(vt(l,l.exactTicks?l.majorTicks[D]:D,S))),c.beginPath(),c.moveTo(0,p),c.lineTo(0,p-.15*c.max),c.stroke(),c.closePath(),c.restore();l.strokeTicks&&(c.save(),c.strokeStyle=l.colorStrokeTicks||y[0],c.rotate(jo),c.beginPath(),c.arc(0,0,p,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore())}function vt(c,l,p){if(c.exactTicks){var y=c.ticksAngle/(c.maxValue-c.minValue);return c.startAngle+y*(l-c.minValue)}return c.startAngle+l*(c.ticksAngle/(p-1))}function sn(c){c.stroke(),c.restore(),c.closePath(),c.save()}function Da(c,l){var p=it(c,l)-.15*c.max,y={},S=0,x=l.majorTicks.length,D=l.animationTarget!=="needle",R=l.colorNumbers instanceof Array?l.colorNumbers:new Array(x).fill(l.colorNumbers),P=D?-(l.value-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle:0;for(D&&(c.save(),c.rotate(-oe.radians(P))),c.font=oe.font(l,"Numbers",c.max/200),c.lineWidth=0,c.textAlign="center",c.textBaseline="middle";S<x;++S){var V=P+vt(l,l.exactTicks?l.majorTicks[S]:S,x),$=c.measureText(l.majorTicks[S]).width,Z=l.fontNumbersSize,de=Math.sqrt($*$+Z*Z)/2,pe=oe.radialPoint(p-de-l.numbersMargin/100*c.max,oe.radians(V));V===360&&(V=0),y[V]||(y[V]=!0,c.fillStyle=R[S],c.fillText(l.majorTicks[S],pe.x,pe.y))}D&&c.restore()}function Nr(c,l){l.title&&(c.save(),c.font=oe.font(l,"Title",c.max/200),c.fillStyle=l.colorTitle,c.textAlign="center",c.fillText(l.title,0,-c.max/4.25,.8*c.max),c.restore())}function Vr(c,l){l.units&&(c.save(),c.font=oe.font(l,"Units",c.max/200),c.fillStyle=l.colorUnits,c.textAlign="center",c.fillText(oe.formatContext(l,l.units),0,c.max/3.25,.8*c.max),c.restore())}function Wr(c,l){if(l.needle){var p=l.animationTarget!=="needle",y=l.ticksAngle<360?oe.normalizedValue(l).indented:l.value,S=p?l.startAngle:l.startAngle+(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle;l.barStartPosition==="right"&&(S=l.startAngle+l.ticksAngle-(y-l.minValue)/(l.maxValue-l.minValue)*l.ticksAngle);var x=Ge(c,l),D=ci(x/100*l.needleCircleSize),R=ci(x/100*l.needleCircleSize*.75),P=ci(x/100*l.needleEnd),V=ci(l.needleStart?x/100*l.needleStart:0),$=x/100*l.needleWidth,Z=x/100*l.needleWidth/2,de=di.pixelRatio;c.save(),oe.drawNeedleShadow(c,l),c.rotate(oe.radians(S)),c.fillStyle=oe.linearGradient(c,l.colorNeedle,l.colorNeedleEnd,P-V),l.needleType==="arrow"?(c.beginPath(),c.moveTo(-Z,-V),c.lineTo(-$,0),c.lineTo(-1*de,P),c.lineTo(de,P),c.lineTo($,0),c.lineTo(Z,-V),c.closePath(),c.fill(),c.beginPath(),c.lineTo(-.5*de,P),c.lineTo(-1*de,P),c.lineTo(-$,0),c.lineTo(-Z,-V),c.lineTo(Z/2*de-2*de,-V),c.closePath(),c.fillStyle=l.colorNeedleShadowUp,c.fill()):(c.beginPath(),c.moveTo(-Z,P),c.lineTo(-Z,V),c.lineTo(Z,V),c.lineTo(Z,P),c.closePath(),c.fill()),c.restore(),l.needleCircleSize&&(c.save(),oe.drawNeedleShadow(c,l),l.needleCircleOuter&&(c.beginPath(),c.arc(0,0,D,0,2*ha,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleOuter,l.colorNeedleCircleOuterEnd,D),c.fill(),c.closePath()),l.needleCircleInner&&(c.beginPath(),c.arc(0,0,R,0,2*ha,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleInner,l.colorNeedleCircleInnerEnd,R),c.fill(),c.closePath()),c.restore())}}function Lr(c,l,p){oe.drawValueBox(c,l,p,0,c.max-.33*c.max,c.max)}function im(c){var l=c.startAngle,p=c.startAngle+c.ticksAngle,y=l,S=l+(oe.normalizedValue(c).normal-c.minValue)/(c.maxValue-c.minValue)*c.ticksAngle;if(c.barStartPosition==="middle"){var x=.5*(c.minValue+c.maxValue);c.value<x?(y=180-(x-oe.normalizedValue(c).normal)/(c.maxValue-c.minValue)*c.ticksAngle,S=180):(y=180,S=180+(oe.normalizedValue(c).normal-x)/(c.maxValue-c.minValue)*c.ticksAngle)}else c.barStartPosition==="right"&&(y=p-S+l,S=p);return{startAngle:y,endAngle:S}}function Gr(c,l){var p=c.max/100,y=Ge(c,l)-5*p,S=parseFloat(l.barStrokeWidth+"")||0,x=(parseFloat(l.barWidth+"")||0)*p,D=y-2*S-x,R=(y-D)/2,P=D+R,V=S/P,$=l.startAngle,Z=l.startAngle+l.ticksAngle;if(c.save(),c.rotate(jo),S&&(c.beginPath(),c.arc(0,0,P,oe.radians($)-V,oe.radians(Z)+V,!1),c.strokeStyle=l.colorBarStroke,c.lineWidth=2*R,c.stroke(),c.closePath()),x&&(c.beginPath(),c.arc(0,0,P,oe.radians($),oe.radians(Z),!1),c.strokeStyle=l.colorBar,c.lineWidth=x,c.stroke(),c.closePath(),l.barShadow&&(c.save(),c.beginPath(),c.arc(0,0,y,oe.radians($),oe.radians(Z),!1),c.clip(),c.beginPath(),c.strokeStyle=l.colorBar,c.lineWidth=1,c.shadowBlur=l.barShadow,c.shadowColor=l.colorBarShadow,c.shadowOffsetX=0,c.shadowOffsetY=0,c.arc(0,0,y,oe.radians(l.startAngle),oe.radians(l.startAngle+l.ticksAngle),!1),c.stroke(),c.closePath(),c.restore()),l.barProgress)){var de=im(l),pe=de.startAngle,Ae=de.endAngle;c.beginPath(),c.arc(0,0,P,oe.radians(pe),oe.radians(Ae),!1),c.strokeStyle=l.colorBarProgress,c.lineWidth=x,c.stroke(),c.closePath()}c.restore()}function Fr(c){return c.options.animatedValue?c.options.value:c.value}function nm(c,l,p,y,S,x,D,R){c.beginPath(),c.fillStyle=R?oe.linearGradient(c,D,R,S>x?S:x,x>S,S>x?p:y):D,l>0?oe.roundRect(c,p,y,S,x,l):c.rect(p,y,S,x),c.fill(),c.closePath()}function am(c,l,p,y,S,x,D,R,P){c.beginPath(),c.lineWidth=l,c.strokeStyle=P?oe.linearGradient(c,R,P,D,!0,S):R,p>0?oe.roundRect(c,y,S,x,D,p):c.rect(y,S,x,D),c.stroke(),c.closePath()}function om(c,l,p,y,S,x){function D(Pe,Ue,Ze,Nt){return Pe&&(!Nt&&l.borderShadowWidth&&(c.save(),c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),am(c,Pe*R,P,p+Pe*R/2-fe,y+Pe*R/2-fe,V,pe,Ue,Ze),fe+=.5*R,!Nt&&l.borderShadowWidth&&(Nt=!0,c.restore())),Nt}var R=di.pixelRatio,P=l.borderRadius*R,V=S-l.borderShadowWidth-l.borderOuterWidth*R,$=V-l.borderOuterWidth*R-l.borderMiddleWidth*R,Z=$-l.borderMiddleWidth*R-l.borderInnerWidth*R,de=Z-l.borderInnerWidth*R,pe=x-l.borderShadowWidth-l.borderOuterWidth*R,Ae=pe-l.borderOuterWidth*R-l.borderMiddleWidth*R,Fe=Ae-l.borderMiddleWidth*R-l.borderInnerWidth*R,be=Fe-l.borderInnerWidth*R,Ne=p-($-V)/2,Ve=Ne-(Z-$)/2,Be=Ve-(de-Z)/2,ke=y-(Ae-pe)/2,De=ke-(Fe-Ae)/2,we=De-(be-Fe)/2,fe=0,ye=!1;return c.save(),ye=D(l.borderOuterWidth,l.colorBorderOuter,l.colorBorderOuterEnd,ye),ye=D(l.borderMiddleWidth,l.colorBorderMiddle,l.colorBorderMiddleEnd,ye),ye=D(l.borderInnerWidth,l.colorBorderInner,l.colorBorderInnerEnd,ye),!ye&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),nm(c,P,Be,we,de+2*fe,be+2*fe,l.colorPlate,l.colorPlateEnd),c.restore(),[Be,we,de,be]}function rm(c,l,p,y,S,x){var D=di.pixelRatio,R=x>=S,P=R?.85*S:x,V=R?x:S;p=R?Se(p+(S-P)/2):p;var $=!!l.title,Z=!!l.units,de=!!l.valueBox,pe=void 0,Ae=void 0,Fe=void 0;R?(Ae=Se(.05*V),pe=Se(.075*V),Fe=Se(.11*V),$&&(V-=pe,y+=pe),Z&&(V-=Ae),de&&(V-=Fe)):(Ae=pe=Se(.15*P),$&&(P-=pe,y+=pe),Z&&(P-=Ae));var be=2*l.barStrokeWidth,Ne=l.barBeginCircle?Se(P*l.barBeginCircle/200-be/2):0,Ve=Se(P*l.barWidth/100-be),Be=Se(V*l.barLength/100-be),ke=Se((V-Be)/2),De=Se(p+(R?P/2:ke+Ne)),we=Se(y+(R?V-ke-Ne+be/2:P/2)),fe=!R||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P,ye=R||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P;return c.barDimensions={isVertical:R,width:P,length:V,barWidth:Ve,barLength:Be,strokeWidth:be,barMargin:ke,radius:Ne,pixelRatio:D,barOffset:null,titleMargin:$?pe:0,unitsMargin:Z?Ae:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:p+fe,Y:y+ye,x0:De+fe,y0:we+ye,baseX:p,baseY:y,ticksPadding:l.ticksPadding/100},c.barDimensions}function Br(c,l,p,y,S,x,D){var R=rm(c,l,y,S,x,D),P=R.isVertical,V=R.width,$=R.barWidth,Z=R.barLength,de=R.strokeWidth,pe=R.barMargin,Ae=R.radius,Fe=R.x0,be=R.y0,Ne=R.X,Ve=R.Y,Be=Z;c.save(),c.beginPath();var ke=null;if(l.barBeginCircle){var De=oe.radians(P?270:0),we=Math.asin($/2/Ae),fe=Math.cos(we),ye=Math.sin(we),Pe=Fe+(P?Ae*ye:Ae*fe-de/2),Ue=P?be-Ae*fe:be+Ae*ye,Ze=ci(P?Ue-be:Pe-Fe);ke=Se(Ze+Ae);var Nt=P?Se(Fe-Ae*ye):Pe,Qt=P?Ue:Se(be-Ae*ye);p==="progress"&&(Z=ke+(Z-ke)*(oe.normalizedValue(l).normal-l.minValue)/(l.maxValue-l.minValue));var pa=Se(Pe+Z-ke+de/2),dn=Se(Ue-Z+ke-de/2);c.arc(Fe,be,Ae,De+we,De-we),P?(c.moveTo(Pe,Qt),c.lineTo(Pe,dn),c.lineTo(Nt,dn),c.lineTo(Nt,Qt)):(c.moveTo(Pe,Qt),c.lineTo(pa,Qt),c.lineTo(pa,Ue),c.lineTo(Pe,Ue))}else{var $r=Se(P?Ne+(V-$)/2:Ne+pe),Zr=Se(P?Ve+Z+pe:Ve+(V-$)/2);p==="progress"&&(Z*=(l.value-l.minValue)/(l.maxValue-l.minValue)),P?c.rect($r,Zr,$,-Z):c.rect($r,Zr,Z,$)}p!=="progress"&&l.barStrokeWidth&&(c.lineWidth=de,c.strokeStyle=l.colorBarStroke,c.stroke()),p!=="progress"&&l.colorBar?(c.fillStyle=l.colorBarEnd?oe.linearGradient(c,l.colorBar,l.colorBarEnd,Z,P,P?Ve:Ne):l.colorBar,c.fill()):p==="progress"&&l.colorBarProgress&&(c.fillStyle=l.colorBarProgressEnd?oe.linearGradient(c,l.colorBarProgress,l.colorBarProgressEnd,Be,P,P?Ve:Ne):l.colorBarProgress,c.fill()),c.closePath(),c.restore(),l.barBeginCircle&&(c.barDimensions.radius+=de),c.barDimensions.barOffset=ke,c.barDimensions.barWidth+=de,c.barDimensions.barLength+=de}function sm(c,l,p,y,S,x){Br(c,l,"",p,y,S,x)}function Ur(c,l){return l.needleSide!==c||l.tickSide!==c||l.numberSide!==c}function lm(c,l,p,y,S,x){l.barProgress&&Br(c,l,"progress",p,y,S,x)}function dm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,R=p.barOffset,P=p.barMargin,V=p.X,$=p.Y,Z=p.ticksLength,de=p.ticksPadding,pe=S*(parseFloat(l.highlightsWidth)||0)/100;if(l.highlights&&pe){var Ae=l.tickSide!=="right",Fe=l.tickSide!=="left",be=0,Ne=l.highlights.length,Ve=(S-D)/2,Be=l.maxValue-l.minValue,ke=Se(y?V+Ve:V+P+R),De=pe,we=y?$+x-P-R:$+Ve,fe=Se((l.ticksWidth/100+de)*S)+(pe-l.ticksWidth/100*S),ye=Se(D+de*S);for(c.save();be<Ne;be++){var Pe=l.highlights[be],Ue=Z*ci(l.minValue-Pe.from)/Be,Ze=Z*ci((Pe.to-Pe.from)/Be);c.beginPath(),c.fillStyle=Pe.color,y?(Ae&&c.rect(ke-fe,we-Ue,De,-Ze),Fe&&c.rect(ke+ye,we-Ue,De,-Ze)):(Ae&&c.rect(ke+Ue,we-fe,Ze,De),Fe&&c.rect(ke+Ue,we+ye,Ze,De)),c.fill(),c.closePath()}c.restore()}}function Pa(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function qr(c,l,p,y,S,x,D,R,P){var V=c.barDimensions,$=V.isVertical,Z=V.length,de=V.barWidth,pe=V.barOffset,Ae=V.barMargin,Fe=V.pixelRatio,be=V.width,Ne=V.X,Ve=V.Y,Be=V.ticksLength,ke=V.ticksPadding,De=(be-de)/2,we=void 0,fe=void 0,ye=0,Pe=p.length,Ue=void 0,Ze=P*be,Nt=De-ke*be,Qt=De+de+Ze+ke*be,pa=l instanceof Array?l:new Array(p.length).fill(l);c.save(),c.lineWidth=R*Fe;for(var dn=Be/(S-y);ye<Pe;ye++)Ue=p[ye],c.strokeStyle=pa[ye],$?(fe=Ve+Z-Ae-pe+(y-Ue)*dn,x&&(we=Ne+Nt,Pa(c,we,fe,Se(we-Ze),fe)),D&&(we=Ne+Qt,Pa(c,we,fe,Se(we-Ze),fe))):(we=Ne+Ae+pe-(y-Ue)*dn,x&&(fe=Ve+Nt,Pa(c,we,fe,we,Se(fe-Ze))),D&&(fe=Ve+Qt,Pa(c,we,Se(fe),we,fe-Ze)));c.restore()}function cm(c,l){var p=oe.prepareTicks(l),y=Hr(p,2),S=y[0],x=y[1],D=2,R=(l.maxValue-l.minValue)/(l.majorTicks.length-1),P=l.colorMajorTicks instanceof Array?l.colorMajorTicks:new Array(l.majorTicks.length).fill(l.colorStrokeTicks||l.colorMajorTicks);if(qr(c,P,l.exactTicks?l.majorTicks:l.majorTicks.map(function(Ze,Nt){return l.minValue+R*Nt}),l.minValue,l.maxValue,S,x,D,l.ticksWidth/100),l.strokeTicks){var V=c.barDimensions,$=V.isVertical,Z=V.length,de=V.width,pe=V.barWidth,Ae=V.barMargin,Fe=V.barOffset,be=V.X,Ne=V.Y,Ve=V.ticksLength,Be=V.pixelRatio,ke=V.ticksPadding,De=(de-pe)/2+pe+ke*de,we=(de-pe)/2-ke*de,fe=void 0,ye=void 0,Pe=void 0,Ue=void 0;c.strokeStyle=l.colorStrokeTicks||P[0],D*=Be,$?(ye=Ne+Z-Ae-Fe+D/2,Ue=ye-Ve-D,S&&(Pe=fe=Se(be+we),Ia(c,fe,ye,Pe,Ue)),x&&(Pe=fe=Se(be+De),Ia(c,fe,ye,Pe,Ue))):(fe=be+Ae+Fe-D/2,Pe=fe+Ve+D,S&&(Ue=ye=Se(Ne+we),Ia(c,fe,ye,Pe,Ue)),x&&(Ue=ye=Se(Ne+De),Ia(c,fe,ye,Pe,Ue)))}}function Ia(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function mm(c,l){var p=oe.prepareTicks(l),y=Hr(p,2),S=y[0],x=y[1],D=[],R=l.minValue,P=Math.abs(l.minorTicks)||0,V=P?(l.maxValue-l.minValue)/(P*(l.majorTicks.length-1)):0;if(P)if(l.exactTicks)for(var $=yi.mod(l.majorTicks[0],P)||0;R<l.maxValue;R+=P)$+R<l.maxValue&&D.push($+R);else for(;R<l.maxValue;R+=V)D.push(R);qr(c,l.colorMinorTicks||l.colorStrokeTicks,D,l.minValue,l.maxValue,S,x,1,l.ticksWidthMinor/100)}function um(c,l){var p=c.barDimensions,y=p.isVertical,S=p.length,x=p.width,D=p.barWidth,R=p.barMargin,P=p.barOffset,V=p.X,$=p.Y,Z=p.ticksLength,de=p.ticksPadding,pe=l.maxValue-l.minValue,Ae=pe/(l.majorTicks.length-1),Fe=l.exactTicks?l.majorTicks:l.majorTicks.map(function(pa,dn){return l.minValue+Ae*dn}),be=Fe.length,Ne=l.numberSide!=="right",Ve=l.numberSide!=="left",Be=l.fontNumbersSize*x/200,ke=0,De=(l.ticksWidth/100+2*de)*x,we=(x-D)/2-De,fe=(x-D)/2+D+De,ye=void 0,Pe=void 0,Ue=void 0,Ze=void 0,Nt=l.colorNumbers instanceof Array?l.colorNumbers:new Array(be).fill(l.colorNumbers),Qt=l.numbersMargin/100*x;for(c.font=oe.font(l,"Numbers",x/200),c.lineWidth=0,c.textAlign="center";ke<be;ke++)c.fillStyle=Nt[ke],Ze=l.majorTicks[ke],Ue=l.exactTicks?Z*((Fe[ke]-l.minValue)/pe):ke*Z/(be-1),y?(Pe=$+S-R-P-Ue+Be/3,Ne&&(c.textAlign="right",c.fillText(Ze,V+we-Qt,Pe)),Ve&&(c.textAlign="left",c.fillText(Ze,V+fe+Qt,Pe))):(c.measureText(Ze).width,ye=V+R+P+Ue,Ne&&c.fillText(Ze,ye,$+we-Qt),Ve&&c.fillText(Ze,ye,$+fe+Be+Qt))}function hm(c,l){if(l.title){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,R=p.baseY,P=p.titleMargin,V=l.fontTitleSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(R+P/2-(y?V:V/2)-.025*(y?x:S));c.save(),c.textAlign="center",c.fillStyle=l.colorTitle,c.font=oe.font(l,"Title",S/200),c.lineWidth=0,c.fillText(l.title,$,Z,y?S:x),c.restore()}}function pm(c,l){if(l.units){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,R=p.baseY,P=p.unitsMargin,V=l.fontUnitsSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(R+(y?x:S)+P/2-V/2);c.save(),c.textAlign="center",c.fillStyle=l.colorUnits,c.font=oe.font(l,"Units",S/200),c.lineWidth=0,c.fillText(oe.formatContext(l,l.units),$,Z,y?S:x),c.restore()}}function gm(c,l){if(l.needle){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,R=p.barOffset,P=p.barMargin,V=p.ticksLength,$=p.X,Z=p.Y,de=p.ticksPadding,pe=l.needleSide!=="right",Ae=l.needleSide!=="left",Fe=V*(oe.normalizedValue(l).indented-l.minValue)/(l.maxValue-l.minValue),be=(l.ticksWidth/100+de)*S,Ne=D/2+be,Ve=Ne*(l.needleEnd/100),Be=void 0,ke=void 0,De=void 0,we=void 0,fe=l.needleType.toLowerCase()==="arrow"?bm:fm,ye=(S-D)/2,Pe=Ne*(l.needleStart/100),Ue=ye-be-Pe,Ze=ye+D+be+Pe;c.save(),oe.drawNeedleShadow(c,l),y?(De=Se(Z+x-P-R-Fe),pe&&(Be=Se($+Ue),ke=Be+Ve,fe(c,l,Be,De,ke,De,Ve)),Ae&&(Be=Se($+Ze),ke=Be-Ve,fe(c,l,Be,De,ke,De,Ve,!0))):(Be=Se($+P+R+Fe),pe&&(De=Se(Z+Ue),we=De+Ve,fe(c,l,Be,De,Be,we,Ve)),Ae&&(De=Se(Z+Ze),we=De-Ve,fe(c,l,Be,De,Be,we,Ve,!0))),c.restore()}}function zr(c,l,p,y){return l.colorNeedleEnd?oe.linearGradient(c,y?l.colorNeedleEnd:l.colorNeedle,y?l.colorNeedle:l.colorNeedleEnd,p,!c.barDimensions.isVertical):l.colorNeedle}function fm(c,l,p,y,S,x,D,R){c.lineWidth=l.needleWidth,c.strokeStyle=zr(c,l,D,R),c.beginPath(),c.moveTo(p,y),c.lineTo(S,x),c.stroke(),c.closePath()}function bm(c,l,p,y,S,x,D,R){var P=Se(.4*D),V=D-P,$=p===S,Z=l.needleWidth/2;c.fillStyle=zr(c,l,D,R),c.beginPath(),$?(y>x&&(V*=-1),c.moveTo(p-Z,y),c.lineTo(p+Z,y),c.lineTo(p+Z,y+V),c.lineTo(p,x),c.lineTo(p-Z,y+V),c.lineTo(p-Z,y)):(p>S&&(V*=-1),c.moveTo(p,y-Z),c.lineTo(p,y+Z),c.lineTo(p+V,y+Z),c.lineTo(S,y),c.lineTo(p+V,y-Z),c.lineTo(p,y-Z)),c.fill(),c.closePath()}function Am(c,l,p,y,S,x,D){var R=(parseFloat(l.fontValueSize)||0)*x/200,P=(.11*D-R)/2;c.barDimensions.isVertical&&oe.drawValueBox(c,l,p,y+x/2,S+D-R-P,x)}var Hr=(function(){function c(l,p){var y=[],S=!0,x=!1,D=void 0;try{for(var R,P=l[Symbol.iterator]();!(S=(R=P.next()).done)&&(y.push(R.value),!p||y.length!==p);S=!0);}catch(V){x=!0,D=V}finally{try{!S&&P.return&&P.return()}finally{if(x)throw D}}return y}return function(l,p){if(Array.isArray(l))return l;if(Symbol.iterator in Object(l))return c(l,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),Uo=function c(l,p,y){l===null&&(l=Function.prototype);var S=Object.getOwnPropertyDescriptor(l,p);if(S===void 0){var x=Object.getPrototypeOf(l);return x===null?void 0:c(x,p,y)}if("value"in S)return S.value;var D=S.get;if(D!==void 0)return D.call(y)},vm=function c(l,p,y,S){var x=Object.getOwnPropertyDescriptor(l,p);if(x===void 0){var D=Object.getPrototypeOf(l);D!==null&&c(D,p,y,S)}else if("value"in x&&x.writable)x.value=y;else{var R=x.set;R!==void 0&&R.call(S,y)}return y},ln=(function(){function c(l,p){for(var y=0;y<p.length;y++){var S=p[y];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(l,S.key,S)}}return function(l,p,y){return p&&c(l.prototype,p),y&&c(l,y),l}})(),Oa=null,ym=(function(){function c(){i(this,c),this._events={},this.addListener=this.on,this.removeListener=this.off}return ln(c,[{key:"emit",value:function(l){if(this._events[l]){for(var p=0,y=this._events[l].length,S=arguments.length,x=Array(S>1?S-1:0),D=1;D<S;D++)x[D-1]=arguments[D];for(;p<y;p++)this._events[l][p]&&this._events[l][p].apply(this,x)}}},{key:"once",value:function(l){for(var p=arguments.length,y=Array(p>1?p-1:0),S=1;S<p;S++)y[S-1]=arguments[S];for(var x=0,D=y.length,R=this;x<D;x++)(function(){var P=y[x],V=function $(){R.off(l,$),P.apply(R,arguments)};y[x]=V})();this.on.apply(this,[l].concat(y))}},{key:"on",value:function(l){this._events[l]||(this._events[l]=[]);for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)this._events[l].push(arguments.length<=p+1?void 0:arguments[p+1])}},{key:"off",value:function(l){if(this._events[l])for(var p=0,y=arguments.length<=1?0:arguments.length-1;p<y;p++)for(var S=arguments.length<=p+1?void 0:arguments[p+1],x=void 0;~(x=this._events[l].indexOf(S));)this._events[l].splice(x,1)}},{key:"removeAllListeners",value:function(l){delete this._events[l]}},{key:"listeners",get:function(){return this._events}}]),c})(),jr=a("requestAnimationFrame")||function(c){return setTimeout(function(){return c(new Date().getTime())},1e3/60)},ma={linear:function(c){return c},quad:function(c){return Math.pow(c,2)},dequad:function(c){return 1-ma.quad(1-c)},quint:function(c){return Math.pow(c,5)},dequint:function(c){return 1-Math.pow(1-c,5)},cycle:function(c){return 1-Math.sin(Math.acos(c))},decycle:function(c){return Math.sin(Math.acos(1-c))},bounce:function(c){return 1-ma.debounce(1-c)},debounce:function(c){for(var l=0,p=1;;l+=p,p/=2)if(c>=(7-4*l)/11)return-Math.pow((11-6*l-11*c)/4,2)+Math.pow(p,2)},elastic:function(c){return 1-ma.delastic(1-c)},delastic:function(c){return Math.pow(2,10*(c-1))*Math.cos(20*Math.PI*1.5/3*c)}},qo=(function(){function c(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,c),this.duration=p,this.rule=l,this.draw=y,this.end=S,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",y);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",S)}return ln(c,[{key:"animate",value:function(l,p){var y=this;this.frame&&this.cancel();var S=window.performance&&window.performance.now?window.performance.now():a("animationStartTime")||Date.now();l=l||this.draw,p=p||this.end,this.draw=l,this.end=p,this.frame=jr(function(x){return r(x,l,S,ma[y.rule]||y.rule,y.duration,p,y)})}},{key:"cancel",value:function(){this.frame&&((a("cancelAnimationFrame")||function(l){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),c})();qo.rules=ma;var xn=(function(){function c(l,p,y){i(this,c),this.options=l,this.element=p.toLowerCase(),this.type=c.toDashed(y),this.Type=n[y],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||c.domReady(this.traverse.bind(this))}return ln(c,[{key:"isValidNode",value:function(l){return!(!l.tagName||l.tagName.toLowerCase()!==this.element||l.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var l=document.getElementsByTagName(this.element),p=0,y=l.length;p<y;p++)this.process(l[p]);this.isObservable&&!this.mutationsObserved&&(new MutationObserver(this.observe.bind(this)).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.mutationsObserved=!0)}},{key:"observe",value:function(l){for(var p=0,y=l.length;p<y;p++){var S=l[p];if(S.type==="attributes"&&S.attributeName==="data-type"&&this.isValidNode(S.target)&&S.oldValue!==this.type)setTimeout(this.process.bind(this,S.target));else if(S.addedNodes&&S.addedNodes.length)for(var x=0,D=S.addedNodes.length;x<D;x++)setTimeout(this.process.bind(this,S.addedNodes[x]))}}},{key:"process",value:function(l){var p=this;if(!this.isValidNode(l))return null;var y=void 0,S=JSON.parse(JSON.stringify(this.options)),x=null;for(y in S)if(S.hasOwnProperty(y)){var D=c.toAttributeName(y),R=c.parse(l.getAttribute(D));R!=null&&(S[y]=R)}return S.renderTo=l,x=new this.Type(S),x.draw&&x.draw(),this.isObservable&&(x.observer=new MutationObserver(function(P){P.forEach(function(V){if(V.type==="attributes"){var $=V.attributeName.toLowerCase(),Z=l.getAttribute($).toLowerCase();if($==="data-type"&&Z&&Z!==p.type)x.observer.disconnect(),delete x.observer,x.destroy&&x.destroy();else if($.substr(0,5)==="data-"){var de=$.substr(5).split("-").map(function(Ae,Fe){return Fe?Ae.charAt(0).toUpperCase()+Ae.substr(1):Ae}).join(""),pe={};pe[de]=c.parse(l.getAttribute(V.attributeName)),de==="value"?x&&(x.value=pe[de]):x.update&&x.update(pe)}}})}),x.observer.observe(l,{attributes:!0})),x}}],[{key:"parse",value:function(l){if(l==="true")return!0;if(l==="false")return!1;if(l!=="undefined"){if(l==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(l))return l.split(",");try{return JSON.parse(l)}catch{}return l}}},{key:"toDashed",value:function(l){for(var p=l.split(/(?=[A-Z])/),y=1,S=p.length,x=p[0].toLowerCase();y<S;y++)x+="-"+p[y].toLowerCase();return x}},{key:"toCamelCase",value:function(l){for(var p=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],y=l.split(/-/),S=0,x=y.length,D="";S<x;S++)D+=S||p?y[S][0].toUpperCase()+y[S].substr(1).toLowerCase():y[S].toLowerCase();return D}},{key:"toAttributeName",value:function(l){return"data-"+c.toDashed(l)}},{key:"domReady",value:function(l){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return l();window.addEventListener?window.addEventListener("DOMContentLoaded",l,!1):window.attachEvent&&window.attachEvent("onload",l)}}]),c})(),di=(function(){function c(l,p,y){i(this,c),c.collection.push(this),this.width=p||0,this.height=y||0,this.element=l,this.init()}return ln(c,[{key:"init",value:function(){var l=c.pixelRatio;this.element.width=this.width*l,this.element.height=this.height*l,this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.elementClone=this.element.cloneNode(!0),this.context=this.element.getContext("2d"),this.contextClone=this.elementClone.getContext("2d"),this.drawWidth=this.element.width,this.drawHeight=this.element.height,this.drawX=this.drawWidth/2,this.drawY=this.drawHeight/2,this.minSide=this.drawX<this.drawY?this.drawX:this.drawY,this.contextClone.translate(this.drawX,this.drawY),this.elementClone.initialized=!1,this.context.translate(this.drawX,this.drawY),this.context.max=this.contextClone.max=this.minSide,this.context.maxRadius=this.contextClone.maxRadius=null}},{key:"destroy",value:function(){var l=c.collection.indexOf(this);~l&&c.collection.splice(l,1),this.context.clearRect(-this.drawX,-this.drawY,this.drawWidth,this.drawHeight),this.context.max=null,delete this.context.max,this.context.maxRadius=null,delete this.context.maxRadius,this.context=null,this.contextClone=null,this.elementClone=null,this.element=null,this.onRedraw=null}},{key:"commit",value:function(){var l=c.pixelRatio;return l!==1&&this.contextClone.scale(l,l),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var l=0,p=c.collection.length;l<p;l++)c.collection[l].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),c})();di.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(di.redraw);var zo={renderTo:null,width:0,height:0,minValue:0,maxValue:100,value:0,units:!1,exactTicks:!1,majorTicks:[0,20,40,60,80,100],minorTicks:10,strokeTicks:!0,animatedValue:!1,animateOnInit:!1,title:!1,borders:!0,numbersMargin:1,listeners:null,valueInt:3,valueDec:2,majorTicksInt:1,majorTicksDec:0,animation:!0,animationDuration:500,animationRule:"cycle",colorPlate:"#fff",colorPlateEnd:"",colorMajorTicks:"#444",colorMinorTicks:"#666",colorStrokeTicks:"",colorTitle:"#888",colorUnits:"#888",colorNumbers:"#444",colorNeedle:"rgba(240,128,128,1)",colorNeedleEnd:"rgba(255,160,122,.9)",colorValueText:"#444",colorValueTextShadow:"rgba(0,0,0,0.3)",colorBorderShadow:"rgba(0,0,0,0.5)",colorBorderOuter:"#ddd",colorBorderOuterEnd:"#aaa",colorBorderMiddle:"#eee",colorBorderMiddleEnd:"#f0f0f0",colorBorderInner:"#fafafa",colorBorderInnerEnd:"#ccc",colorValueBoxRect:"#888",colorValueBoxRectEnd:"#666",colorValueBoxBackground:"#babab2",colorValueBoxShadow:"rgba(0,0,0,1)",colorNeedleShadowUp:"rgba(2,255,255,0.2)",colorNeedleShadowDown:"rgba(188,143,143,0.45)",colorBarStroke:"#222",colorBar:"#ccc",colorBarProgress:"#888",colorBarShadow:"#000",fontNumbers:"Arial",fontTitle:"Arial",fontUnits:"Arial",fontValue:"Arial",fontNumbersSize:20,fontTitleSize:24,fontUnitsSize:22,fontValueSize:26,fontNumbersStyle:"normal",fontTitleStyle:"normal",fontUnitsStyle:"normal",fontValueStyle:"normal",fontNumbersWeight:"normal",fontTitleWeight:"normal",fontUnitsWeight:"normal",fontValueWeight:"normal",needle:!0,needleShadow:!0,needleType:"arrow",needleStart:5,needleEnd:85,needleWidth:4,borderOuterWidth:3,borderMiddleWidth:3,borderInnerWidth:3,borderShadowWidth:3,valueBox:!0,valueBoxStroke:5,valueBoxWidth:0,valueText:"",valueTextShadow:!0,valueBoxBorderRadius:2.5,highlights:[{from:20,to:60,color:"#eee"},{from:60,to:80,color:"#ccc"},{from:80,to:100,color:"#999"}],highlightsWidth:15,highlightsLineCap:"butt",barWidth:20,barStrokeWidth:0,barProgress:!0,barShadow:0};s.prototype=Object.create(Array.prototype),s.prototype.constructor=s,s.prototype.get=function(c){if(typeof c=="string")for(var l=0,p=this.length;l<p;l++){var y=this[l].options.renderTo.tagName?this[l].options.renderTo:document.getElementById(this[l].options.renderTo||"");if(y.getAttribute("id")===c)return this[l]}else if(typeof c=="number")return this[c];return null};var Ho="2.2.1",Se=Math.round,ci=Math.abs,ua=new s;ua.version=Ho;var yi=(function(c){function l(p){i(this,l);var y=e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this)),S=y.constructor.name;if(S==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(ua.push(y),p.listeners&&Object.keys(p.listeners).forEach(function(D){(p.listeners[D]instanceof Array?p.listeners[D]:[p.listeners[D]]).forEach(function(R){y.on(D,R)})}),y.version=Ho,y.type=n[S]||l,y.initialized=!1,p.minValue=parseFloat(p.minValue),p.maxValue=parseFloat(p.maxValue),p.value=parseFloat(p.value)||0,p.borders||(p.borderInnerWidth=p.borderMiddleWidth=p.borderOuterWidth=0),!p.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var x=p.renderTo.tagName?p.renderTo:document.getElementById(p.renderTo);if(!(x instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return p.width=parseFloat(p.width)||0,p.height=parseFloat(p.height)||0,p.width&&p.height||(p.width||(p.width=x.parentNode?x.parentNode.offsetWidth:x.offsetWidth),p.height||(p.height=x.parentNode?x.parentNode.offsetHeight:x.offsetHeight)),y.options=p||{},y.options.animateOnInit&&(y._value=y.options.value,y.options.value=y.options.minValue),y.canvas=new di(x,p.width,p.height),y.canvas.onRedraw=y.draw.bind(y),y.animation=new qo(p.animationRule,p.animationDuration),y}return t(l,c),ln(l,[{key:"update",value:function(p){return Object.assign(this.options,this.type.configure(p||{})),this.canvas.width=this.options.width,this.canvas.height=this.options.height,this.animation.rule=this.options.animationRule,this.animation.duration=this.options.animationDuration,this.canvas.redraw(),this}},{key:"destroy",value:function(){var p=ua.indexOf(this);~p&&ua.splice(p,1),this.canvas.destroy(),this.canvas=null,this.animation.destroy(),this.animation=null,this.emit("destroy")}},{key:"draw",value:function(){return this.options.animateOnInit&&!this.initialized&&(this.value=this._value,this.initialized=!0,this.emit("init")),this.emit("render"),this}},{key:"value",set:function(p){var y=this;p=l.ensureValue(p,this.options.minValue);var S=this.options.value;if(p!==S)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===p))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=p),this.emit("animationStart"),this.animation.animate(function(x){var D=S+(p-S)*x;y.options.animatedValue&&y.emit("value",D,y.value),y.options.value=D,y.draw(),y.emit("animate",x,y.options.value)},function(){y._value!==void 0&&(y.emit("value",y._value,y.value),y.options.value=y._value,delete y._value),y.draw(),y.emit("animationEnd"),y.animation.frame=null})}else this.emit("value",p,this.value),this.options.value=p,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(p){return p}},{key:"initialize",value:function(p,y){return new xn(y,"canvas",p)}},{key:"fromElement",value:function(p){var y=xn.toCamelCase(p.getAttribute("data-type")),S=p.attributes,x=0,D=S.length,R={};if(y){for(/Gauge$/.test(y)||(y+="Gauge");x<D;x++)R[xn.toCamelCase(S[x].name.replace(/^data-/,""),!1)]=xn.parse(S[x].value);new xn(R,p.tagName,y).process(p)}}},{key:"ensureValue",value:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return p=parseFloat(p),!isNaN(p)&&isFinite(p)||(p=parseFloat(y)||0),p}},{key:"mod",value:function(p,y){return(p%y+y)%y}},{key:"version",get:function(){return Ho}}]),l})(ym);n!==void 0&&(n.BaseGauge=yi,n.gauges=(window.document||{}).gauges=ua);var Cm=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,oe={roundRect:C,padValue:_,formatMajorTickNumber:N,radians:E,radialPoint:j,linearGradient:Y,drawNeedleShadow:K,drawValueBox:Te,verifyError:h,prepareTicks:b,font:ee,normalizedValue:$e,formatContext:f},ha=Math.PI,jo=ha/2,Yr=Object.assign({},zo,{ticksAngle:270,startAngle:45,colorNeedleCircleOuter:"#f0f0f0",colorNeedleCircleOuterEnd:"#ccc",colorNeedleCircleInner:"#e8e8e8",colorNeedleCircleInnerEnd:"#f5f5f5",needleCircleSize:10,needleCircleInner:!0,needleCircleOuter:!0,needleStart:20,animationTarget:"needle",useMinPath:!1,barWidth:0,barStartPosition:"left"}),Sm=(function(c){function l(p){return i(this,l),p=Object.assign({},Yr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),ln(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],D=y[2],R=y[3],P=this.options;if(P.animationTarget==="needle"){if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,R),this.emit("beforePlate"),Me(V,P),this.emit("beforeHighlights"),ze(V,P),this.emit("beforeMinorTicks"),He(V,P),this.emit("beforeMajorTicks"),st(V,P),this.emit("beforeNumbers"),Da(V,P),this.emit("beforeTitle"),Nr(V,P),this.emit("beforeUnits"),Vr(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,R),p.context.drawImage(p.elementClone,S,x,D,R),this.emit("beforeProgressBar"),Gr(p.context,P),this.emit("beforeValueBox"),Lr(p.context,P,Fr(this)),this.emit("beforeNeedle"),Wr(p.context,P)}else{var $=-oe.radians((P.value-P.minValue)/(P.maxValue-P.minValue)*P.ticksAngle);if(p.context.clearRect(S,x,D,R),this.emit("beforePlate"),Me(p.context,P),p.context.rotate($),this.emit("beforeHighlights"),ze(p.context,P),this.emit("beforeMinorTicks"),He(p.context,P),this.emit("beforeMajorTicks"),st(p.context,P),this.emit("beforeNumbers"),Da(p.context,P),this.emit("beforeProgressBar"),Gr(p.context,P),p.context.rotate(-$),!p.elementClone.initialized){var Z=p.contextClone;Z.clearRect(S,x,D,R),this.emit("beforeTitle"),Nr(Z,P),this.emit("beforeUnits"),Vr(Z,P),this.emit("beforeNeedle"),Wr(Z,P),p.elementClone.initialized=!0}p.context.drawImage(p.elementClone,S,x,D,R)}this.emit("beforeValueBox"),Lr(p.context,P,Fr(this)),Uo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(de){oe.verifyError(de)}return this}},{key:"value",set:function(p){p=yi.ensureValue(p,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=p,p=this.options.value+((p-this.options.value)%360+540)%360-180),vm(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",p,this)},get:function(){return Uo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",this)}}],[{key:"configure",value:function(p){return p.barWidth>50&&(p.barWidth=50),isNaN(p.startAngle)&&(p.startAngle=45),isNaN(p.ticksAngle)&&(p.ticksAngle=270),p.ticksAngle>360&&(p.ticksAngle=360),p.ticksAngle<0&&(p.ticksAngle=0),p.startAngle<0&&(p.startAngle=0),p.startAngle>360&&(p.startAngle=360),p}}]),l})(yi);n!==void 0&&(n.RadialGauge=Sm),yi.initialize("RadialGauge",Yr);var Qr=Object.assign({},zo,{borderRadius:0,barBeginCircle:30,colorBarEnd:"",colorBarProgressEnd:"",needleWidth:6,tickSide:"both",needleSide:"both",numberSide:"both",ticksWidth:10,ticksWidthMinor:5,ticksPadding:5,barLength:85,fontTitleSize:26,highlightsWidth:10}),wm=(function(c){function l(p){return i(this,l),p=Object.assign({},Qr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),ln(l,[{key:"draw",value:function(){try{var p=this.canvas,y=[-p.drawX,-p.drawY,p.drawWidth,p.drawHeight],S=y[0],x=y[1],D=y[2],R=y[3],P=this.options;if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,R),this.emit("beforePlate"),this.drawBox=om(V,P,S,x,D,R),this.emit("beforeBar"),sm.apply(void 0,[V,P].concat(o(this.drawBox))),p.contextClone.barDimensions=V.barDimensions,this.emit("beforeHighlights"),dm(V,P),this.emit("beforeMinorTicks"),mm(V,P),this.emit("beforeMajorTicks"),cm(V,P),this.emit("beforeNumbers"),um(V,P),this.emit("beforeTitle"),hm(V,P),this.emit("beforeUnits"),pm(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,R),p.context.drawImage(p.elementClone,S,x,D,R),this.emit("beforeProgressBar"),lm.apply(void 0,[p.context,P].concat(o(this.drawBox))),this.emit("beforeNeedle"),gm(p.context,P),this.emit("beforeValueBox"),Am.apply(void 0,[p.context,P,P.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),Uo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch($){oe.verifyError($)}return this}}],[{key:"configure",value:function(p){return p.barStrokeWidth>=p.barWidth&&(p.barStrokeWidth=Se(p.barWidth/2)),p.hasLeft=Ur("right",p),p.hasRight=Ur("left",p),p.value>p.maxValue&&(p.value=p.maxValue),p.value<p.minValue&&(p.value=p.minValue),yi.configure(p)}}]),l})(yi);n!==void 0&&(n.LinearGauge=wm),yi.initialize("LinearGauge",Qr),typeof Do<"u"&&Object.assign(n,{Collection:s,GenericOptions:zo,Animation:qo,BaseGauge:yi,drawings:oe,SmartCanvas:di,DomObserver:xn,vendorize:a})})(typeof Do<"u"?Do.exports:window)});var El=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var Et=(()=>{class n{_settings=A(Gt);_router=A(Ts);_destroyRef=A(at);dashboards=w([],{equal:Ri});activeDashboard=w(null);_widgetAction=new _n(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=w(!0);layoutEditSaved=w(0);layoutEditCanceled=w(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let i=El.map(a=>je(Ie({},a),{id:Ht.create()}));this.dashboards.set([...i])}else this.dashboards.set(e);let t=this.getRouteParam("id");if(t===null||t==="")this.setActiveDashboardIndex(0);else{let i=Number(t);isNaN(i)||this.setActiveDashboardIndex(i)}this._router.events.pipe(Ci(i=>i instanceof ks),$t(()=>this.getRouteParam("id")),Na(),Ke(this._destroyRef)).subscribe(i=>{if(i===null||i==="")return;let a=Number(i);isNaN(a)||this.setActiveDashboardIndex(a)}),I(()=>{let i=this.dashboards();W(()=>{this._settings.saveDashboards(i)})})}getRouteParam(e){let t=this._router.routerState.snapshot.root;for(;t;){if(t.paramMap.has(e))return t.paramMap.get(e);t=t.firstChild??null}return null}setActiveDashboardIndex(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?(this.activeDashboard.set(e),console.log(`[Dashboard Service] Active dashboard index set to ${e}`)):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,i,a){let r=0;return this.dashboards.update(s=>{let h=[...s,{id:Ht.create(),name:e,icon:i??"dashboard-dashboard",configuration:t,collapseSplitShell:a??!1}];return r=h.length-1,h}),r}update(e,t,i,a){this.dashboards.update(r=>r.map((s,h)=>h===e?je(Ie({},s),{name:t,icon:i??"dashboard-dashboard",collapseSplitShell:a??!1}):s))}delete(e){this.dashboards.update(t=>t.filter((i,a)=>a!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,i,a){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let r=this.dashboards()[e],s=Ot(r);s.id=Ht.create(),s.name=t,s.icon=i||"dashboard-dashboard",s.collapseSplitShell=a??!1,Array.isArray(s.configuration)?s.configuration.forEach(f=>{f&&f.input?.widgetProperties?(f.id=Ht.create(),f.input.widgetProperties.uuid=f.id):console.error("Dashboard Service] Widget configuration is missing required properties:",f)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",s.configuration),s.configuration=[]);let h=-1;return this.dashboards.update(f=>{let b=[...f,s];return h=b.length-1,b}),h}updateConfiguration(e,t){this.dashboards.update(i=>i.map((a,r)=>r===e?Ri(a.configuration,t)?a:je(Ie({},a),{configuration:t}):a))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=lt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Pi=(()=>{class n{appSettings=A(Gt);data=A(wi);_svcDatasetConfigs=[];_svcDataSource=[];_svcSubjectObserverRegistry=[];signedAnglePaths=new Set(["self.navigation.attitude.roll","self.navigation.attitude.pitch","self.navigation.attitude.yaw","self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater","self.steering.rudderAngle"]);constructor(){this._svcDatasetConfigs=this.appSettings.getDataSets(),this.cleanupDatasets(),this.startAll()}cleanupDatasets(){if(this.appSettings.configUpgrade()||this.appSettings.getAppConfig().configVersion<12)return;let t=this.appSettings.getDashboardConfig(),i=new Set;t.forEach(h=>{h.configuration?.length&&h.configuration?.forEach(f=>{f?.id&&i.add(f.id)})});function a(h){let f=h.match(/^(windtrends|speedtrends)-(.+)$/);return f?f[2]:null}let r=[],s=[];for(let h of this._svcDatasetConfigs){let f=h.label||"",b=!1;if(f.startsWith("windtrends-")||f.startsWith("speedtrends-")){let C=a(f);b=!!(C&&i.has(C))}else(f.startsWith("simple-chart-")||(f.match(/\|/g)||[]).length===4)&&(b=i.has(h.uuid));b?s.push(h):r.push(h)}r.length&&(r.forEach(h=>{console.warn(`[DatasetService] Cleaned dataset: uuid=${h.uuid}, label="${h.label}"`)}),this._svcDatasetConfigs=s,this.appSettings.saveDataSets(this._svcDatasetConfigs))}setupServiceSubjectRegistry(e,t){let i=this._svcSubjectObserverRegistry.findIndex(a=>a.datasetUuid==e);i>=0&&(this._svcSubjectObserverRegistry[i].rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(i,1)),this._svcSubjectObserverRegistry.push({datasetUuid:e,rxjsSubject:new Kr(t)})}createDataSourceConfiguration(e){let i={uuid:e.uuid,pathObserverSubscription:null,sampleTime:null,maxDataPoints:null,smoothingPeriod:null,historicalData:[]};switch(e.timeScaleFormat){case"Last 30 Minutes":i.maxDataPoints=120,i.sampleTime=15e3,i.smoothingPeriod=50;break;case"Last 5 Minutes":i.maxDataPoints=60,i.sampleTime=5e3,i.smoothingPeriod=25;break;case"Last Minute":i.maxDataPoints=60,i.sampleTime=1e3,i.smoothingPeriod=25;break;case"hour":i.maxDataPoints=e.period*120,i.sampleTime=3e4,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;case"minute":i.maxDataPoints=e.period*60,i.sampleTime=1e3,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break;default:i.maxDataPoints=e.period*5,i.sampleTime=200,i.smoothingPeriod=Math.floor(i.maxDataPoints*.25);break}return(!i.maxDataPoints||i.maxDataPoints<1)&&(i.maxDataPoints=1),i}startAll(){console.log("[Dataset Service] Auto Starting "+this._svcDatasetConfigs.length.toString()+" Datasets");for(let e of this._svcDatasetConfigs)this.start(e.uuid)}start(e){let t=this._svcDatasetConfigs.find(h=>h.uuid==e);if(!t){console.warn(`[Dataset Service] Dataset UUID:${e} not found`);return}let i=this.createDataSourceConfiguration(t);this.setupServiceSubjectRegistry(i.uuid,i.maxDataPoints);let a=this._svcDataSource[this._svcDataSource.push(i)-1];console.log(`[Dataset Service] Starting recording process: ${t.path}, Scale: ${t.timeScaleFormat}, Period: ${t.period}, Datapoints: ${i.maxDataPoints}`);function r(h){return f=>Mn(h).pipe(cs(f,(b,C)=>C))}let s=this.resolveAngleDomain(t.path,t.baseUnit);a.pathObserverSubscription=this.data.subscribePath(t.path,t.pathSource).pipe(r(i.sampleTime)).subscribe(h=>{if(h.data.value===null)return;a.maxDataPoints>0&&a.historicalData.length>=a.maxDataPoints&&a.historicalData.shift(),a.historicalData.push(h.data.value);let f=this.updateDataset(a,t.baseUnit,s);this._svcSubjectObserverRegistry.find(b=>b.datasetUuid===a.uuid).rxjsSubject.next(f)})}stop(e){let t=this._svcDataSource.findIndex(i=>i.uuid==e);console.log(`[Dataset Service] Stopping Dataset ${e} data capture`),this._svcDataSource[t].pathObserverSubscription.unsubscribe(),this._svcDataSource.splice(t,1)}list(){return Ot(this._svcDatasetConfigs)}getDatasetConfig(e){return this._svcDatasetConfigs.find(t=>t.uuid===e)}getDataSourceInfo(e){return this._svcDataSource.find(t=>t.uuid===e)}create(e,t,i,a,r,s=!0,h=!0,f){if(!e||!t||!i||!a||!r)return null;let b=f||Ht.create(),C={uuid:b,path:e,pathSource:t,baseUnit:this.data.getPathUnitType(e),timeScaleFormat:i,period:a,label:r,editable:h};return console.log(`[Dataset Service] Creating ${s?"":"non-"}persistent ${h?"":"hidden "}dataset: ${C.uuid}, Path: ${C.path}, Source: ${C.pathSource} Scale: ${C.timeScaleFormat}, Period: ${C.period}`),this._svcDatasetConfigs.push(C),this.start(b),s===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),b}edit(e,t=!0){let i=this._svcDatasetConfigs.find(a=>a.uuid===e.uuid);return i?JSON.stringify(i)===JSON.stringify(e)?(console.log(`[Dataset Service] No changes detected for Dataset ${e.uuid}.`),!1):(this.stop(e.uuid),console.log(`[Dataset Service] Updating Dataset: ${e.uuid}`),e.baseUnit=this.data.getPathUnitType(e.path),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(a=>a.uuid===e.uuid),1,e),this.start(e.uuid),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0):!1}remove(e,t=!0){return!e||e===""||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:(this.stop(e),console.log(`[Dataset Service] Removing ${t?"":"non-"}persistent Dataset: ${e}`),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(i=>i.uuid===e),1),this._svcSubjectObserverRegistry.find(i=>i.datasetUuid===e).rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(this._svcSubjectObserverRegistry.findIndex(i=>i.datasetUuid===e),1),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0)}getDatasetObservable(e){let t=this._svcSubjectObserverRegistry.find(i=>i.datasetUuid==e);return t?t.rxjsSubject.asObservable():null}getDatasetBatchThenLiveObservable(e){let t=this._svcSubjectObserverRegistry.find(h=>h.datasetUuid==e);if(!t)return null;let i=t.rxjsSubject,a=i._buffer?i._buffer.slice():[],r=Jr([a]),s=i.pipe(ds(a.length));return is(r,s)}updateDataset(e,t,i="scalar"){let a=null,r=null,s=null,h=null;if(t==="rad"){a=this.circularMeanRad(e.historicalData);let _=e.historicalData.slice(-e.smoothingPeriod);r=this.circularMeanRad(_);let{min:N,max:E}=this.circularMinMaxRad(e.historicalData);i==="direction"?(a=this.normalizeToDirection(a),r=this.normalizeToDirection(r),s=this.normalizeToDirection(N),h=this.normalizeToDirection(E)):i==="signed"?(a=this.normalizeToSigned(a),r=this.normalizeToSigned(r),s=this.normalizeToSigned(N),h=this.normalizeToSigned(E)):(s=N,h=E)}else a=b(e.historicalData),r=C(e.historicalData,e.smoothingPeriod),s=Math.min(...e.historicalData),h=Math.max(...e.historicalData);return{timestamp:Date.now(),data:{value:t==="rad"?i==="signed"?this.normalizeToSigned(e.historicalData[e.historicalData.length-1]):this.normalizeToDirection(e.historicalData[e.historicalData.length-1]):e.historicalData[e.historicalData.length-1],sma:r,ema:null,doubleEma:null,lastAverage:a,lastMinimum:s,lastMaximum:h}};function b(_){return _.length===0?null:_.reduce((E,j)=>E+j,0)/_.length}function C(_,N){_.length<N&&(N=_.length);let E=0;for(let j=_.length-N;j<_.length;j++)E+=_[j];return E/N}}circularMeanRad(e){if(e.length===0)return 0;let t=e.reduce((a,r)=>a+Math.sin(r),0),i=e.reduce((a,r)=>a+Math.cos(r),0);return Math.atan2(t/e.length,i/e.length)}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(h=>(h*180/Math.PI+360)%360).sort((h,f)=>h-f),i=0,a=0;for(let h=0;h<t.length;h++){let f=(h+1)%t.length,b=(t[f]-t[h]+360)%360;b>i&&(i=b,a=f)}let r=t[a]*Math.PI/180,s=t[(a-1+t.length)%t.length]*Math.PI/180;return{min:r,max:s}}resolveAngleDomain(e,t){if(t!=="rad")return"scalar";let i=this.normalizePathKey(e);for(let a of this.signedAnglePaths)if(i===this.normalizePathKey(a))return"signed";return"direction"}normalizePathKey(e){return e.replace(/^vessels\.self\./,"").replace(/^self\./,"")}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}removeIfExists(e,t=!0){return!e||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:this.remove(e,t)}ngOnDestroy(){[...this._svcDataSource].forEach(e=>{try{this.stop(e.uuid)}catch{}}),this._svcSubjectObserverRegistry.forEach(e=>e.rxjsSubject.complete()),this._svcSubjectObserverRegistry=[]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=lt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Dl=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new _n(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID===null&&(this.kipTimers[e].timeoutID=setInterval(()=>{this.kipTimers[e].currentValue.next(this.kipTimers[e].currentValue.value+1)},this.kipTimers[e].intervalMS))}stopTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&(this.stopTimer(e),this.kipTimers[e].currentValue.complete(),delete this.kipTimers[e])}isRunning(e){let t=!1;return e in this.kipTimers&&(t=this.kipTimers[e].timeoutID!==null),t}ngOnDestroy(){Object.keys(this.kipTimers).forEach(e=>{this.kipTimers[e].timeoutID&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null),this.kipTimers[e].currentValue.complete()}),this.kipTimers={}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=lt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Pl=(()=>{class n{sanitizer=A(Xa);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Ua({name:"safe",type:n,pure:!0})}return n})();var _m={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function fo(n){let o=Ie(Ie({},_m),n);return`(() => {
2
2
  if (window.__kipSwipeInit) return; window.__kipSwipeInit = true;
3
3
  const instanceId='${o.instanceId}';
4
4
  let pointerId=null; let startX=0; let startY=0; let startT=0; let peakPrimary=0; let peakCross=0; let cancelled=false;
@@ -1,4 +1,4 @@
1
- import"./chunk-F5X5MWHG.js";import{L as vt,U as bi,a as ot,c as gi,e as ui,f as _i,h as fi}from"./chunk-KITN4REV.js";import{b as yi}from"./chunk-2QCDSHYY.js";import{a as Ee,b as mi,c as pi}from"./chunk-BRLXMYKY.js";import{a as Si}from"./chunk-UDAYIL7R.js";import{f as Te,i as at,n as hi}from"./chunk-RVSQUIEX.js";import{d as Kt}from"./chunk-QL3G7CWF.js";import{a as vi}from"./chunk-D3OVXRDS.js";import{a as z}from"./chunk-MVXIEN3D.js";import{a as de}from"./chunk-JWT2WFAW.js";import{A as ke,B as nt,c as Jt,d as Je,k as ni,r as re,s as ci,y as le}from"./chunk-CWBDCB4U.js";import{A as j,D as et,G as tt,J as se,K as li,L as di,M as K,N as it,d as ft,h as Ht,i as Xt,j as qt,k as Ke,l as jt,m as B,n as $e,o as Me,p as ai,q as oi,s as X,t as q,v as si,w as ae,y as ri,z as oe}from"./chunk-MKKQCG3C.js";import{b as ei,f as ti,g as ii}from"./chunk-W4VRE5PG.js";import{$b as ye,$d as ge,Ab as ze,Bb as Ot,Bd as Ge,Ca as It,Cb as ee,Da as At,Db as te,Eb as h,Fb as a,Fc as qe,Ga as _e,Gb as s,Gd as Qe,Hb as u,Ib as He,Ic as ne,Id as Ce,Jb as gt,K as Tt,Ka as fe,Kb as Ft,Kc as Z,L as Ae,La as Rt,Lc as W,Ld as Ze,Na as G,Nc as M,Oa as Dt,Ob as P,Oc as D,Pb as Lt,Qb as b,R as Et,Sb as k,Sd as pe,Tb as me,Td as Gt,Ub as V,Vb as ve,Vd as Qt,Wb as O,Xa as m,Xb as I,Ya as Pt,Yb as A,Zd as Zt,_a as Re,_b as ie,ac as T,bc as Xe,cb as Nt,cc as U,dd as zt,ea as pt,ec as he,f as Fe,fc as r,fe as Ye,g as Le,gc as De,hb as x,hc as Ut,he as we,ib as $,ic as ut,jb as F,jc as _t,kc as v,ke as bt,lb as Be,lc as y,m as ce,ma as Ue,mc as S,me as Yt,nb as Vt,ne as Pe,oa as Y,od as Se,oe as xe,pb as E,pd as je,qa as R,qb as be,qe as $t,r as kt,re as H,sa as c,sc as N,tc as Q,vc as Wt,wc as Bt,xa as p,xb as L,ya as g,yb as C,za as We,zb as w}from"./chunk-PR5JLJLD.js";var Bi=(n,f)=>f.key,zi=(n,f)=>f.measure;function Hi(n,f){if(n&1&&(a(0,"mat-option",6),r(1),s()),n&2){let e=f.$implicit;h("value",e.measure),m(),De(e.description)}}function Xi(n,f){if(n&1&&(a(0,"mat-form-field")(1,"mat-label"),r(2),s(),a(3,"mat-select",5),ee(4,Hi,2,2,"mat-option",6,zi),s()()),n&2){let e=f.$implicit,i=k();m(2),De(e.key),m(),h("placeholder",e.key)("formControlName",e.key),m(),te(i.groupUnits[e.key])}}var Ci=(()=>{class n{units=c(pi);appSettingsService=c(B);appService=c(z);unitsFormGroup=new si({});groupUnits=[];ngOnInit(){let e=this.appSettingsService.getDefaultUnits(),i=this.units.getConversions();for(let t of i){if(t.group==="Position")continue;let o=[];for(let d of t.units)o.push(d);this.groupUnits[t.group]=o,this.unitsFormGroup.addControl(t.group,new ri(e[t.group]))}this.unitsFormGroup.updateValueAndValidity()}submitConfig(){this.appSettingsService.setDefaultUnits(this.unitsFormGroup.value),this.appService.sendSnackbarNotification("Configuration saved",3e3,!1)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(i,t){i&1&&(a(0,"form",0),b("ngSubmit",function(){return t.submitConfig()}),a(1,"p"),r(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),s(),a(3,"div",1),ee(4,Xi,6,3,"mat-form-field",null,Bi),Wt(6,"keyvalue"),s(),a(7,"div",2),u(8,"mat-divider",3),a(9,"button",4),r(10,"Save"),s()()()),i&2&&(h("formGroup",t.unitsFormGroup),m(4),te(Bt(6,2,t.unitsFormGroup.controls)),m(5),h("disabled",!t.unitsFormGroup.valid))},dependencies:[K,j,X,q,se,it,et,tt,le,re,Ee,Te,de,H,zt],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var yt=new R("CdkAccordion"),wi=(()=>{class n{_stateChanges=new ce;_openCloseAllActions=new ce;id=c(pe).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",M]},exportAs:["cdkAccordion"],features:[N([{provide:yt,useExisting:n}]),fe]})}return n})(),xi=(()=>{class n{accordion=c(yt,{optional:!0,skipSelf:!0});_changeDetectorRef=c(W);_expansionDispatcher=c(at);_openCloseAllSubscription=Le.EMPTY;closed=new E;opened=new E;destroyed=new E;expandedChange=new E;id=c(pe).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let i=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,i)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}_expanded=!1;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=_e(!1);_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,i)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===i&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e)})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",M],disabled:[2,"disabled","disabled",M]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[N([{provide:yt,useValue:void 0}])]})}return n})(),Mi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({})}return n})();var Ki=["body"],Gi=["bodyWrapper"],Qi=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],Zi=["mat-expansion-panel-header","*","mat-action-row"];function Ji(n,f){}var Yi=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],$i=["mat-panel-title","mat-panel-description","*"];function en(n,f){n&1&&(He(0,"span",1),We(),He(1,"svg",2),Ft(2,"path",3),gt()())}var St=new R("MAT_ACCORDION"),ki=new R("MAT_EXPANSION_PANEL"),tn=(()=>{class n{_template=c(Pt);_expansionPanel=c(ki,{optional:!0});constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Ti=new R("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),Ne=(()=>{class n extends xi{_viewContainerRef=c(Nt);_animationsDisabled=we();_document=c(It);_ngZone=c(be);_elementRef=c(G);_renderer=c(Re);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_togglePosition;afterExpand=new E;afterCollapse=new E;_inputChanges=new ce;accordion=c(St,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=c(pe).getId("mat-expansion-panel-header-");constructor(){super();let e=c(Ti,{optional:!0});this._expansionDispatcher=c(at),e&&(this.hideToggle=e.hideToggle)}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":!1}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(pt(null),Ae(()=>this.expanded&&!this._portal),Et(1)).subscribe(()=>{this._portal=new ei(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){let e=this._document.activeElement,i=this._body.nativeElement;return e===i||i.contains(e)}return!1}_transitionEndListener=({target:e,propertyName:i})=>{e===this._bodyWrapper?.nativeElement&&i==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(i,t,o){if(i&1&&ve(o,tn,5),i&2){let d;I(d=A())&&(t._lazyContent=d.first)}},viewQuery:function(i,t){if(i&1&&(O(Ki,5),O(Gi,5)),i&2){let o;I(o=A())&&(t._body=o.first),I(o=A())&&(t._bodyWrapper=o.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(i,t){i&2&&U("mat-expanded",t.expanded)("mat-expansion-panel-spacing",t._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",M],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[N([{provide:St,useValue:void 0},{provide:ki,useExisting:n}]),Be,fe],ngContentSelectors:Zi,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(i,t){i&1&&(me(Qi),V(0),a(1,"div",2,0)(3,"div",3,1)(5,"div",4),V(6,1),Vt(7,Ji,0,0,"ng-template",5),s(),V(8,2),s()()),i&2&&(m(),L("inert",t.expanded?null:""),m(2),h("id",t.id),L("aria-labelledby",t._headerId),m(4),h("cdkPortalOutlet",t._portal))},dependencies:[ti],styles:[`.mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:var(--mat-expansion-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}
1
+ import"./chunk-F5X5MWHG.js";import{L as vt,U as bi,a as ot,c as gi,e as ui,f as _i,h as fi}from"./chunk-KITN4REV.js";import{b as yi}from"./chunk-2QCDSHYY.js";import{a as Ee,b as mi,c as pi}from"./chunk-BRLXMYKY.js";import{a as Si}from"./chunk-UDAYIL7R.js";import{f as Te,i as at,n as hi}from"./chunk-RVSQUIEX.js";import{d as Kt}from"./chunk-QL3G7CWF.js";import{a as vi}from"./chunk-D3OVXRDS.js";import{a as z}from"./chunk-L7KYMDKT.js";import{a as de}from"./chunk-JWT2WFAW.js";import{A as ke,B as nt,c as Jt,d as Je,k as ni,r as re,s as ci,y as le}from"./chunk-CWBDCB4U.js";import{A as j,D as et,G as tt,J as se,K as li,L as di,M as K,N as it,d as ft,h as Ht,i as Xt,j as qt,k as Ke,l as jt,m as B,n as $e,o as Me,p as ai,q as oi,s as X,t as q,v as si,w as ae,y as ri,z as oe}from"./chunk-MKKQCG3C.js";import{b as ei,f as ti,g as ii}from"./chunk-W4VRE5PG.js";import{$b as ye,$d as ge,Ab as ze,Bb as Ot,Bd as Ge,Ca as It,Cb as ee,Da as At,Db as te,Eb as h,Fb as a,Fc as qe,Ga as _e,Gb as s,Gd as Qe,Hb as u,Ib as He,Ic as ne,Id as Ce,Jb as gt,K as Tt,Ka as fe,Kb as Ft,Kc as Z,L as Ae,La as Rt,Lc as W,Ld as Ze,Na as G,Nc as M,Oa as Dt,Ob as P,Oc as D,Pb as Lt,Qb as b,R as Et,Sb as k,Sd as pe,Tb as me,Td as Gt,Ub as V,Vb as ve,Vd as Qt,Wb as O,Xa as m,Xb as I,Ya as Pt,Yb as A,Zd as Zt,_a as Re,_b as ie,ac as T,bc as Xe,cb as Nt,cc as U,dd as zt,ea as pt,ec as he,f as Fe,fc as r,fe as Ye,g as Le,gc as De,hb as x,hc as Ut,he as we,ib as $,ic as ut,jb as F,jc as _t,kc as v,ke as bt,lb as Be,lc as y,m as ce,ma as Ue,mc as S,me as Yt,nb as Vt,ne as Pe,oa as Y,od as Se,oe as xe,pb as E,pd as je,qa as R,qb as be,qe as $t,r as kt,re as H,sa as c,sc as N,tc as Q,vc as Wt,wc as Bt,xa as p,xb as L,ya as g,yb as C,za as We,zb as w}from"./chunk-PR5JLJLD.js";var Bi=(n,f)=>f.key,zi=(n,f)=>f.measure;function Hi(n,f){if(n&1&&(a(0,"mat-option",6),r(1),s()),n&2){let e=f.$implicit;h("value",e.measure),m(),De(e.description)}}function Xi(n,f){if(n&1&&(a(0,"mat-form-field")(1,"mat-label"),r(2),s(),a(3,"mat-select",5),ee(4,Hi,2,2,"mat-option",6,zi),s()()),n&2){let e=f.$implicit,i=k();m(2),De(e.key),m(),h("placeholder",e.key)("formControlName",e.key),m(),te(i.groupUnits[e.key])}}var Ci=(()=>{class n{units=c(pi);appSettingsService=c(B);appService=c(z);unitsFormGroup=new si({});groupUnits=[];ngOnInit(){let e=this.appSettingsService.getDefaultUnits(),i=this.units.getConversions();for(let t of i){if(t.group==="Position")continue;let o=[];for(let d of t.units)o.push(d);this.groupUnits[t.group]=o,this.unitsFormGroup.addControl(t.group,new ri(e[t.group]))}this.unitsFormGroup.updateValueAndValidity()}submitConfig(){this.appSettingsService.setDefaultUnits(this.unitsFormGroup.value),this.appService.sendSnackbarNotification("Configuration saved",3e3,!1)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-units"]],decls:11,vars:4,consts:[[2,"height","100%",3,"ngSubmit","formGroup"],[1,"unit-grid"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"],["required","",3,"placeholder","formControlName"],[3,"value"]],template:function(i,t){i&1&&(a(0,"form",0),b("ngSubmit",function(){return t.submitConfig()}),a(1,"p"),r(2,"Configure your preferred default unit types. These defaults can be overridden within individual widget settings."),s(),a(3,"div",1),ee(4,Xi,6,3,"mat-form-field",null,Bi),Wt(6,"keyvalue"),s(),a(7,"div",2),u(8,"mat-divider",3),a(9,"button",4),r(10,"Save"),s()()()),i&2&&(h("formGroup",t.unitsFormGroup),m(4),te(Bt(6,2,t.unitsFormGroup.controls)),m(5),h("disabled",!t.unitsFormGroup.valid))},dependencies:[K,j,X,q,se,it,et,tt,le,re,Ee,Te,de,H,zt],styles:[".unit-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,auto));gap:10px}"]})}return n})();var yt=new R("CdkAccordion"),wi=(()=>{class n{_stateChanges=new ce;_openCloseAllActions=new ce;id=c(pe).getId("cdk-accordion-");multi=!1;openAll(){this.multi&&this._openCloseAllActions.next(!0)}closeAll(){this._openCloseAllActions.next(!1)}ngOnChanges(e){this._stateChanges.next(e)}ngOnDestroy(){this._stateChanges.complete(),this._openCloseAllActions.complete()}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion"],["","cdkAccordion",""]],inputs:{multi:[2,"multi","multi",M]},exportAs:["cdkAccordion"],features:[N([{provide:yt,useExisting:n}]),fe]})}return n})(),xi=(()=>{class n{accordion=c(yt,{optional:!0,skipSelf:!0});_changeDetectorRef=c(W);_expansionDispatcher=c(at);_openCloseAllSubscription=Le.EMPTY;closed=new E;opened=new E;destroyed=new E;expandedChange=new E;id=c(pe).getId("cdk-accordion-child-");get expanded(){return this._expanded}set expanded(e){if(this._expanded!==e){if(this._expanded=e,this.expandedChange.emit(e),e){this.opened.emit();let i=this.accordion?this.accordion.id:this.id;this._expansionDispatcher.notify(this.id,i)}else this.closed.emit();this._changeDetectorRef.markForCheck()}}_expanded=!1;get disabled(){return this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=_e(!1);_removeUniqueSelectionListener=()=>{};constructor(){}ngOnInit(){this._removeUniqueSelectionListener=this._expansionDispatcher.listen((e,i)=>{this.accordion&&!this.accordion.multi&&this.accordion.id===i&&this.id!==e&&(this.expanded=!1)}),this.accordion&&(this._openCloseAllSubscription=this._subscribeToOpenCloseAllActions())}ngOnDestroy(){this.opened.complete(),this.closed.complete(),this.destroyed.emit(),this.destroyed.complete(),this._removeUniqueSelectionListener(),this._openCloseAllSubscription.unsubscribe()}toggle(){this.disabled||(this.expanded=!this.expanded)}close(){this.disabled||(this.expanded=!1)}open(){this.disabled||(this.expanded=!0)}_subscribeToOpenCloseAllActions(){return this.accordion._openCloseAllActions.subscribe(e=>{this.disabled||(this.expanded=e)})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["cdk-accordion-item"],["","cdkAccordionItem",""]],inputs:{expanded:[2,"expanded","expanded",M],disabled:[2,"disabled","disabled",M]},outputs:{closed:"closed",opened:"opened",destroyed:"destroyed",expandedChange:"expandedChange"},exportAs:["cdkAccordionItem"],features:[N([{provide:yt,useValue:void 0}])]})}return n})(),Mi=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({})}return n})();var Ki=["body"],Gi=["bodyWrapper"],Qi=[[["mat-expansion-panel-header"]],"*",[["mat-action-row"]]],Zi=["mat-expansion-panel-header","*","mat-action-row"];function Ji(n,f){}var Yi=[[["mat-panel-title"]],[["mat-panel-description"]],"*"],$i=["mat-panel-title","mat-panel-description","*"];function en(n,f){n&1&&(He(0,"span",1),We(),He(1,"svg",2),Ft(2,"path",3),gt()())}var St=new R("MAT_ACCORDION"),ki=new R("MAT_EXPANSION_PANEL"),tn=(()=>{class n{_template=c(Pt);_expansionPanel=c(ki,{optional:!0});constructor(){}static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["ng-template","matExpansionPanelContent",""]]})}return n})(),Ti=new R("MAT_EXPANSION_PANEL_DEFAULT_OPTIONS"),Ne=(()=>{class n extends xi{_viewContainerRef=c(Nt);_animationsDisabled=we();_document=c(It);_ngZone=c(be);_elementRef=c(G);_renderer=c(Re);_cleanupTransitionEnd;get hideToggle(){return this._hideToggle||this.accordion&&this.accordion.hideToggle}set hideToggle(e){this._hideToggle=e}_hideToggle=!1;get togglePosition(){return this._togglePosition||this.accordion&&this.accordion.togglePosition}set togglePosition(e){this._togglePosition=e}_togglePosition;afterExpand=new E;afterCollapse=new E;_inputChanges=new ce;accordion=c(St,{optional:!0,skipSelf:!0});_lazyContent;_body;_bodyWrapper;_portal;_headerId=c(pe).getId("mat-expansion-panel-header-");constructor(){super();let e=c(Ti,{optional:!0});this._expansionDispatcher=c(at),e&&(this.hideToggle=e.hideToggle)}_hasSpacing(){return this.accordion?this.expanded&&this.accordion.displayMode==="default":!1}_getExpandedState(){return this.expanded?"expanded":"collapsed"}toggle(){this.expanded=!this.expanded}close(){this.expanded=!1}open(){this.expanded=!0}ngAfterContentInit(){this._lazyContent&&this._lazyContent._expansionPanel===this&&this.opened.pipe(pt(null),Ae(()=>this.expanded&&!this._portal),Et(1)).subscribe(()=>{this._portal=new ei(this._lazyContent._template,this._viewContainerRef)}),this._setupAnimationEvents()}ngOnChanges(e){this._inputChanges.next(e)}ngOnDestroy(){super.ngOnDestroy(),this._cleanupTransitionEnd?.(),this._inputChanges.complete()}_containsFocus(){if(this._body){let e=this._document.activeElement,i=this._body.nativeElement;return e===i||i.contains(e)}return!1}_transitionEndListener=({target:e,propertyName:i})=>{e===this._bodyWrapper?.nativeElement&&i==="grid-template-rows"&&this._ngZone.run(()=>{this.expanded?this.afterExpand.emit():this.afterCollapse.emit()})};_setupAnimationEvents(){this._ngZone.runOutsideAngular(()=>{this._animationsDisabled?(this.opened.subscribe(()=>this._ngZone.run(()=>this.afterExpand.emit())),this.closed.subscribe(()=>this._ngZone.run(()=>this.afterCollapse.emit()))):setTimeout(()=>{let e=this._elementRef.nativeElement;this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this._transitionEndListener),e.classList.add("mat-expansion-panel-animations-enabled")},200)})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-expansion-panel"]],contentQueries:function(i,t,o){if(i&1&&ve(o,tn,5),i&2){let d;I(d=A())&&(t._lazyContent=d.first)}},viewQuery:function(i,t){if(i&1&&(O(Ki,5),O(Gi,5)),i&2){let o;I(o=A())&&(t._body=o.first),I(o=A())&&(t._bodyWrapper=o.first)}},hostAttrs:[1,"mat-expansion-panel"],hostVars:4,hostBindings:function(i,t){i&2&&U("mat-expanded",t.expanded)("mat-expansion-panel-spacing",t._hasSpacing())},inputs:{hideToggle:[2,"hideToggle","hideToggle",M],togglePosition:"togglePosition"},outputs:{afterExpand:"afterExpand",afterCollapse:"afterCollapse"},exportAs:["matExpansionPanel"],features:[N([{provide:St,useValue:void 0},{provide:ki,useExisting:n}]),Be,fe],ngContentSelectors:Zi,decls:9,vars:4,consts:[["bodyWrapper",""],["body",""],[1,"mat-expansion-panel-content-wrapper"],["role","region",1,"mat-expansion-panel-content",3,"id"],[1,"mat-expansion-panel-body"],[3,"cdkPortalOutlet"]],template:function(i,t){i&1&&(me(Qi),V(0),a(1,"div",2,0)(3,"div",3,1)(5,"div",4),V(6,1),Vt(7,Ji,0,0,"ng-template",5),s(),V(8,2),s()()),i&2&&(m(),L("inert",t.expanded?null:""),m(2),h("id",t.id),L("aria-labelledby",t._headerId),m(4),h("cdkPortalOutlet",t._portal))},dependencies:[ti],styles:[`.mat-expansion-panel{box-sizing:content-box;display:block;margin:0;overflow:hidden;position:relative;background:var(--mat-expansion-container-background-color, var(--mat-sys-surface));color:var(--mat-expansion-container-text-color, var(--mat-sys-on-surface));border-radius:var(--mat-expansion-container-shape, 12px)}.mat-expansion-panel.mat-expansion-panel-animations-enabled{transition:margin 225ms cubic-bezier(0.4, 0, 0.2, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:var(--mat-expansion-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-accordion .mat-expansion-panel:not(.mat-expanded),.mat-accordion .mat-expansion-panel:not(.mat-expansion-panel-spacing){border-radius:0}.mat-accordion .mat-expansion-panel:first-of-type{border-top-right-radius:var(--mat-expansion-container-shape, 12px);border-top-left-radius:var(--mat-expansion-container-shape, 12px)}.mat-accordion .mat-expansion-panel:last-of-type{border-bottom-right-radius:var(--mat-expansion-container-shape, 12px);border-bottom-left-radius:var(--mat-expansion-container-shape, 12px)}@media(forced-colors: active){.mat-expansion-panel{outline:solid 1px}}.mat-expansion-panel-content-wrapper{display:grid;grid-template-rows:0fr;grid-template-columns:100%}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content-wrapper{transition:grid-template-rows 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{grid-template-rows:1fr}@supports not (grid-template-rows: 0fr){.mat-expansion-panel-content-wrapper{height:0}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper{height:auto}}.mat-expansion-panel-content{display:flex;flex-direction:column;overflow:visible;min-height:0;visibility:hidden;font-family:var(--mat-expansion-container-text-font, var(--mat-sys-body-large-font));font-size:var(--mat-expansion-container-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-expansion-container-text-weight, var(--mat-sys-body-large-weight));line-height:var(--mat-expansion-container-text-line-height, var(--mat-sys-body-large-line-height));letter-spacing:var(--mat-expansion-container-text-tracking, var(--mat-sys-body-large-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-content{transition:visibility 190ms linear}.mat-expansion-panel.mat-expanded>.mat-expansion-panel-content-wrapper>.mat-expansion-panel-content{visibility:visible}.mat-expansion-panel-body{padding:0 24px 16px}.mat-expansion-panel-spacing{margin:16px 0}.mat-accordion>.mat-expansion-panel-spacing:first-child,.mat-accordion>*:first-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-top:0}.mat-accordion>.mat-expansion-panel-spacing:last-child,.mat-accordion>*:last-child:not(.mat-expansion-panel) .mat-expansion-panel-spacing{margin-bottom:0}.mat-action-row{border-top-style:solid;border-top-width:1px;display:flex;flex-direction:row;justify-content:flex-end;padding:16px 8px 16px 24px;border-top-color:var(--mat-expansion-actions-divider-color, var(--mat-sys-outline))}.mat-action-row .mat-button-base,.mat-action-row .mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-action-row .mat-button-base,[dir=rtl] .mat-action-row .mat-mdc-button-base{margin-left:0;margin-right:8px}
2
2
  `],encapsulation:2,changeDetection:0})}return n})();var Ve=(()=>{class n{panel=c(Ne,{host:!0});_element=c(G);_focusMonitor=c(Qe);_changeDetectorRef=c(W);_parentChangeSubscription=Le.EMPTY;constructor(){c(Ce).load(xe);let e=this.panel,i=c(Ti,{optional:!0}),t=c(new qe("tabindex"),{optional:!0}),o=e.accordion?e.accordion._stateChanges.pipe(Ae(d=>!!(d.hideToggle||d.togglePosition))):kt;this.tabIndex=parseInt(t||"")||0,this._parentChangeSubscription=Tt(e.opened,e.closed,o,e._inputChanges.pipe(Ae(d=>!!(d.hideToggle||d.disabled||d.togglePosition)))).subscribe(()=>this._changeDetectorRef.markForCheck()),e.closed.pipe(Ae(()=>e._containsFocus())).subscribe(()=>this._focusMonitor.focusVia(this._element,"program")),i&&(this.expandedHeight=i.expandedHeight,this.collapsedHeight=i.collapsedHeight)}expandedHeight;collapsedHeight;tabIndex=0;get disabled(){return this.panel.disabled}_toggle(){this.disabled||this.panel.toggle()}_isExpanded(){return this.panel.expanded}_getExpandedState(){return this.panel._getExpandedState()}_getPanelId(){return this.panel.id}_getTogglePosition(){return this.panel.togglePosition}_showToggle(){return!this.panel.hideToggle&&!this.panel.disabled}_getHeaderHeight(){let e=this._isExpanded();return e&&this.expandedHeight?this.expandedHeight:!e&&this.collapsedHeight?this.collapsedHeight:null}_keydown(e){switch(e.keyCode){case 32:case 13:Gt(e)||(e.preventDefault(),this._toggle());break;default:this.panel.accordion&&this.panel.accordion._handleHeaderKeydown(e);return}}focus(e,i){e?this._focusMonitor.focusVia(this._element,e,i):this._element.nativeElement.focus(i)}ngAfterViewInit(){this._focusMonitor.monitor(this._element).subscribe(e=>{e&&this.panel.accordion&&this.panel.accordion._handleHeaderFocus(this)})}ngOnDestroy(){this._parentChangeSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._element)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-expansion-panel-header"]],hostAttrs:["role","button",1,"mat-expansion-panel-header","mat-focus-indicator"],hostVars:13,hostBindings:function(i,t){i&1&&b("click",function(){return t._toggle()})("keydown",function(d){return t._keydown(d)}),i&2&&(L("id",t.panel._headerId)("tabindex",t.disabled?-1:t.tabIndex)("aria-controls",t._getPanelId())("aria-expanded",t._isExpanded())("aria-disabled",t.panel.disabled),Xe("height",t._getHeaderHeight()),U("mat-expanded",t._isExpanded())("mat-expansion-toggle-indicator-after",t._getTogglePosition()==="after")("mat-expansion-toggle-indicator-before",t._getTogglePosition()==="before"))},inputs:{expandedHeight:"expandedHeight",collapsedHeight:"collapsedHeight",tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:D(e)]},ngContentSelectors:$i,decls:5,vars:3,consts:[[1,"mat-content"],[1,"mat-expansion-indicator"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 -960 960 960","aria-hidden","true","focusable","false"],["d","M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"]],template:function(i,t){i&1&&(me(Yi),He(0,"span",0),V(1),V(2,1),V(3,2),gt(),C(4,en,3,0,"span",1)),i&2&&(U("mat-content-hide-toggle",!t._showToggle()),m(4),w(t._showToggle()?4:-1))},styles:[`.mat-expansion-panel-header{display:flex;flex-direction:row;align-items:center;padding:0 24px;border-radius:inherit;height:var(--mat-expansion-header-collapsed-state-height, 48px);font-family:var(--mat-expansion-header-text-font, var(--mat-sys-title-medium-font));font-size:var(--mat-expansion-header-text-size, var(--mat-sys-title-medium-size));font-weight:var(--mat-expansion-header-text-weight, var(--mat-sys-title-medium-weight));line-height:var(--mat-expansion-header-text-line-height, var(--mat-sys-title-medium-line-height));letter-spacing:var(--mat-expansion-header-text-tracking, var(--mat-sys-title-medium-tracking))}.mat-expansion-panel-animations-enabled .mat-expansion-panel-header{transition:height 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header::before{border-radius:inherit}.mat-expansion-panel-header.mat-expanded{height:var(--mat-expansion-header-expanded-state-height, 64px)}.mat-expansion-panel-header[aria-disabled=true]{color:var(--mat-expansion-header-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-expansion-panel-header:not([aria-disabled=true]){cursor:pointer}.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-header-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}@media(hover: none){.mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled=true]):hover{background:var(--mat-expansion-container-background-color, var(--mat-sys-surface))}}.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-keyboard-focused,.mat-expansion-panel .mat-expansion-panel-header:not([aria-disabled=true]).cdk-program-focused{background:var(--mat-expansion-header-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}.mat-expansion-panel-header._mat-animation-noopable{transition:none}.mat-expansion-panel-header:focus,.mat-expansion-panel-header:hover{outline:none}.mat-expansion-panel-header.mat-expanded:focus,.mat-expansion-panel-header.mat-expanded:hover{background:inherit}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before{flex-direction:row-reverse}.mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 16px 0 0}[dir=rtl] .mat-expansion-panel-header.mat-expansion-toggle-indicator-before .mat-expansion-indicator{margin:0 0 0 16px}.mat-content{display:flex;flex:1;flex-direction:row;overflow:hidden}.mat-content.mat-content-hide-toggle{margin-right:8px}[dir=rtl] .mat-content.mat-content-hide-toggle{margin-right:0;margin-left:8px}.mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-left:24px;margin-right:0}[dir=rtl] .mat-expansion-toggle-indicator-before .mat-content.mat-content-hide-toggle{margin-right:24px;margin-left:0}.mat-expansion-panel-header-title{color:var(--mat-expansion-header-text-color, var(--mat-sys-on-surface))}.mat-expansion-panel-header-title,.mat-expansion-panel-header-description{display:flex;flex-grow:1;flex-basis:0;margin-right:16px;align-items:center}[dir=rtl] .mat-expansion-panel-header-title,[dir=rtl] .mat-expansion-panel-header-description{margin-right:0;margin-left:16px}.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-title,.mat-expansion-panel-header[aria-disabled=true] .mat-expansion-panel-header-description{color:inherit}.mat-expansion-panel-header-description{flex-grow:2;color:var(--mat-expansion-header-description-color, var(--mat-sys-on-surface-variant))}.mat-expansion-panel-animations-enabled .mat-expansion-indicator{transition:transform 225ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-expansion-panel-header.mat-expanded .mat-expansion-indicator{transform:rotate(180deg)}.mat-expansion-indicator::after{border-style:solid;border-width:0 2px 2px 0;content:"";padding:3px;transform:rotate(45deg);vertical-align:middle;color:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-legacy-header-indicator-display, none)}.mat-expansion-indicator svg{width:24px;height:24px;margin:0 -8px;vertical-align:middle;fill:var(--mat-expansion-header-indicator-color, var(--mat-sys-on-surface-variant));display:var(--mat-expansion-header-indicator-display, inline-block)}@media(forced-colors: active){.mat-expansion-panel-content{border-top:1px solid;border-top-left-radius:0;border-top-right-radius:0}}
3
3
  `],encapsulation:2,changeDetection:0})}return n})(),rt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["mat-panel-description"]],hostAttrs:[1,"mat-expansion-panel-header-description"]})}return n})(),lt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=F({type:n,selectors:[["mat-panel-title"]],hostAttrs:[1,"mat-expansion-panel-header-title"]})}return n})(),dt=(()=>{class n extends wi{_keyManager;_ownHeaders=new Dt;_headers;hideToggle=!1;displayMode="default";togglePosition="after";ngAfterContentInit(){this._headers.changes.pipe(pt(this._headers)).subscribe(e=>{this._ownHeaders.reset(e.filter(i=>i.panel.accordion===this)),this._ownHeaders.notifyOnChanges()}),this._keyManager=new Qt(this._ownHeaders).withWrap().withHomeAndEnd()}_handleHeaderKeydown(e){this._keyManager.onKeydown(e)}_handleHeaderFocus(e){this._keyManager.updateActiveItem(e)}ngOnDestroy(){super.ngOnDestroy(),this._keyManager?.destroy(),this._ownHeaders.destroy()}static \u0275fac=(()=>{let e;return function(t){return(e||(e=Rt(n)))(t||n)}})();static \u0275dir=F({type:n,selectors:[["mat-accordion"]],contentQueries:function(i,t,o){if(i&1&&ve(o,Ve,5),i&2){let d;I(d=A())&&(t._headers=d)}},hostAttrs:[1,"mat-accordion"],hostVars:2,hostBindings:function(i,t){i&2&&U("mat-accordion-multi",t.multi)},inputs:{hideToggle:[2,"hideToggle","hideToggle",M],displayMode:"displayMode",togglePosition:"togglePosition"},exportAs:["matAccordion"],features:[N([{provide:St,useExisting:n}]),Be]})}return n})(),ct=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({imports:[ge,Mi,ii]})}return n})();var nn=["switch"],an=["*"];function on(n,f){n&1&&(a(0,"span",10),We(),a(1,"svg",12),u(2,"path",13),s(),a(3,"svg",14),u(4,"path",15),s()())}var sn=new R("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),mt=class{source;checked;constructor(f,e){this.source=f,this.checked=e}},ue=(()=>{class n{_elementRef=c(G);_focusMonitor=c(Qe);_changeDetectorRef=c(W);defaults=c(sn);_onChange=e=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(e){return new mt(this,e)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations=we();_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(e){this._checked=e,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new E;toggleChange=new E;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){c(Ce).load(xe);let e=c(new qe("tabindex"),{optional:!0}),i=this.defaults;this.tabIndex=e==null?0:parseInt(e)||0,this.color=i.color||"accent",this.id=this._uniqueId=c(pe).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{e==="keyboard"||e==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):e||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(e){e.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(e){this.checked=!!e}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}validate(e){return this.required&&e.value!==!0?{required:!0}:null}registerOnValidatorChange(e){this._validatorOnChange=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new mt(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["mat-slide-toggle"]],viewQuery:function(i,t){if(i&1&&O(nn,5),i&2){let o;I(o=A())&&(t._switchElement=o.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,t){i&2&&(Lt("id",t.id),L("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),he(t.color?"mat-"+t.color:""),U("mat-mdc-slide-toggle-focused",t._focused)("mat-mdc-slide-toggle-checked",t.checked)("_mat-animation-noopable",t._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",M],color:"color",disabled:[2,"disabled","disabled",M],disableRipple:[2,"disableRipple","disableRipple",M],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:D(e)],checked:[2,"checked","checked",M],hideIcon:[2,"hideIcon","hideIcon",M],disabledInteractive:[2,"disabledInteractive","disabledInteractive",M]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[N([{provide:$e,useExisting:Ue(()=>n),multi:!0},{provide:ai,useExisting:n,multi:!0}]),fe],ngContentSelectors:an,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,t){if(i&1){let o=P();me(),a(0,"div",1)(1,"button",2,0),b("click",function(){return p(o),g(t._handleClick())}),u(3,"span",3),a(4,"span",4)(5,"span",5)(6,"span",6),u(7,"span",7),s(),a(8,"span",8),u(9,"span",9),s(),C(10,on,5,0,"span",10),s()()(),a(11,"label",11),b("click",function(l){return p(o),g(l.stopPropagation())}),V(12),s()()}if(i&2){let o=T(2);h("labelPosition",t.labelPosition),m(),U("mdc-switch--selected",t.checked)("mdc-switch--unselected",!t.checked)("mdc-switch--checked",t.checked)("mdc-switch--disabled",t.disabled)("mat-mdc-slide-toggle-disabled-interactive",t.disabledInteractive),h("tabIndex",t.disabled&&!t.disabledInteractive?-1:t.tabIndex)("disabled",t.disabled&&!t.disabledInteractive),L("id",t.buttonId)("name",t.name)("aria-label",t.ariaLabel)("aria-labelledby",t._getAriaLabelledBy())("aria-describedby",t.ariaDescribedby)("aria-required",t.required||null)("aria-checked",t.checked)("aria-disabled",t.disabled&&t.disabledInteractive?"true":null),m(8),h("matRippleTrigger",o)("matRippleDisabled",t.disableRipple||t.disabled)("matRippleCentered",!0),m(),w(t.hideIcon?-1:10),m(),h("for",t.buttonId),L("id",t._labelId)}},dependencies:[Pe,hi],styles:[`.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mat-slide-toggle-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mat-slide-toggle-track-height, 32px);border-radius:var(--mat-slide-toggle-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mat-slide-toggle-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-slide-toggle-track-outline-width, 2px);border-color:var(--mat-slide-toggle-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-slide-toggle-selected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-slide-toggle-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-slide-toggle-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mat-slide-toggle-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mat-slide-toggle-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mat-slide-toggle-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mat-slide-toggle-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-visible-track-opacity, 1);transition:var(--mat-slide-toggle-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-slide-toggle-hidden-track-opacity, 0);transition:var(--mat-slide-toggle-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mat-slide-toggle-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mat-slide-toggle-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mat-slide-toggle-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mat-slide-toggle-handle-width);height:var(--mat-slide-toggle-handle-height);border-radius:var(--mat-slide-toggle-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-slide-toggle-unselected-handle-size, 16px);height:var(--mat-slide-toggle-unselected-handle-size, 16px);margin:var(--mat-slide-toggle-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-slide-toggle-selected-handle-size, 24px);height:var(--mat-slide-toggle-selected-handle-size, 24px);margin:var(--mat-slide-toggle-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-slide-toggle-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-slide-toggle-with-icon-handle-size, 24px);height:var(--mat-slide-toggle-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-slide-toggle-pressed-handle-size, 28px);height:var(--mat-slide-toggle-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-slide-toggle-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-slide-toggle-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mat-slide-toggle-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mat-slide-toggle-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mat-slide-toggle-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mat-slide-toggle-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mat-slide-toggle-state-layer-size, 40px);height:var(--mat-slide-toggle-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-hover-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-focus-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mat-slide-toggle-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-hover-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-focus-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mat-slide-toggle-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mat-slide-toggle-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1;transform:translateZ(0)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mat-slide-toggle-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mat-slide-toggle-unselected-icon-size, 16px);height:var(--mat-slide-toggle-unselected-icon-size, 16px);fill:var(--mat-slide-toggle-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mat-slide-toggle-selected-icon-size, 16px);height:var(--mat-slide-toggle-selected-icon-size, 16px);fill:var(--mat-slide-toggle-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mat-slide-toggle-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-slide-toggle-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-slide-toggle-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-slide-toggle-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-slide-toggle-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-slide-toggle-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-slide-toggle-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mat-slide-toggle-disabled-label-text-color, var(--mat-sys-on-surface))}
4
4
  `],encapsulation:2,changeDetection:0})}return n})(),ht=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=$({type:n});static \u0275inj=Y({imports:[ue,ge,ge]})}return n})();var rn=["notificationsForm"],ln=["statePanel"],dn=["soundPanel"];function cn(n,f){n&1&&(a(0,"mat-panel-description"),r(1," Filter Notifications sidenav items "),s())}function mn(n,f){n&1&&(a(0,"mat-panel-description"),r(1," Override server defined methods "),s())}var Ai=(()=>{class n{app=c(z);settings=c(B);_responsive=c(Ze);isPhonePortrait;notificationsForm=ne("notificationsForm");statePanel=ne("statePanel");soundPanel=ne("soundPanel");notificationConfig;notificationDisabledExpandPanel=!1;constructor(){this.isPhonePortrait=je(this._responsive.observe(Ye.HandsetPortrait)),this.notificationConfig=ft(this.settings.getNotificationConfig())}saveAllSettings(){this.settings.setNotificationConfig(ft(this.notificationConfig)),this.notificationsForm().form.markAsPristine(),this.app.sendSnackbarNotification("Configuration saved",3e3,!1)}togglePanel(e){e.checked&&(this.notificationDisabledExpandPanel=!1,this.statePanel().close(),this.soundPanel().close())}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-notifications"]],viewQuery:function(i,t){i&1&&(ie(t.notificationsForm,rn,5),ie(t.statePanel,ln,5),ie(t.soundPanel,dn,5)),i&2&&ye(3)},decls:64,vars:17,consts:[["notificationsForm","ngForm"],["statePanel",""],["soundPanel",""],["id","notificationSetting",3,"ngSubmit"],["name","disableNotifications",3,"ngModelChange","ngModel"],["name","disableNotifications",3,"ngModelChange","change","ngModel"],[1,"notification-accordion"],[3,"disabled"],["name","showNormalState",3,"ngModelChange","ngModel"],["name","showNominalState",3,"ngModelChange","ngModel"],["name","muteAlert",3,"ngModelChange","ngModel","disabled"],["name","muteWarn",3,"ngModelChange","ngModel","disabled"],["name","muteAlarm",3,"ngModelChange","ngModel","disabled"],["name","muteEmergency",3,"ngModelChange","ngModel","disabled"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit",1,"formActionButton",3,"disabled"]],template:function(i,t){if(i&1){let o=P();a(0,"form",3,0),b("ngSubmit",function(){return p(o),g(t.saveAllSettings())}),a(2,"p"),r(3,"Configure audio and visual notification settings and stay informed of critical events."),s(),a(4,"mat-slide-toggle",4),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.disableSound,l)||(t.notificationConfig.sound.disableSound=l),g(l)}),r(5," Disable audio "),s(),u(6,"br")(7,"br"),a(8,"mat-slide-toggle",5),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.disableNotifications,l)||(t.notificationConfig.disableNotifications=l),g(l)}),b("change",function(l){return p(o),g(t.togglePanel(l))}),r(9," Disable Notifications "),s(),u(10,"br")(11,"br"),a(12,"div",6)(13,"mat-accordion")(14,"mat-expansion-panel",7,1)(16,"mat-expansion-panel-header")(17,"mat-panel-title"),r(18," States "),s(),C(19,cn,2,0,"mat-panel-description"),s(),a(20,"mat-checkbox",8),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.devices.showNormalState,l)||(t.notificationConfig.devices.showNormalState=l),g(l)}),r(21," Show "),a(22,"b"),r(23,"Normal"),s(),r(24," state "),s(),u(25,"br"),a(26,"mat-checkbox",9),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.devices.showNominalState,l)||(t.notificationConfig.devices.showNominalState=l),g(l)}),r(27," Show "),a(28,"b"),r(29,"Nominal"),s(),r(30," state "),s()(),a(31,"mat-expansion-panel",7,2)(33,"mat-expansion-panel-header")(34,"mat-panel-title"),r(35," Audio "),s(),C(36,mn,2,0,"mat-panel-description"),s(),a(37,"mat-checkbox",10),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteAlert,l)||(t.notificationConfig.sound.muteAlert=l),g(l)}),r(38," Mute "),a(39,"b"),r(40,"all Alert"),s(),r(41," state "),s(),u(42,"br"),a(43,"mat-checkbox",11),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteWarn,l)||(t.notificationConfig.sound.muteWarn=l),g(l)}),r(44," Mute "),a(45,"b"),r(46,"all Warn"),s(),r(47," state "),s(),u(48,"br"),a(49,"mat-checkbox",12),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteAlarm,l)||(t.notificationConfig.sound.muteAlarm=l),g(l)}),r(50," Mute "),a(51,"b"),r(52,"all Alarm"),s(),r(53," state "),s(),u(54,"br"),a(55,"mat-checkbox",13),S("ngModelChange",function(l){return p(o),y(t.notificationConfig.sound.muteEmergency,l)||(t.notificationConfig.sound.muteEmergency=l),g(l)}),r(56," Mute "),a(57,"b"),r(58,"all Emergency"),s(),r(59," state "),s()()()(),a(60,"div",14),u(61,"mat-divider",15),a(62,"button",16),r(63,"Save"),s()()()}if(i&2){let o=T(1);m(4),v("ngModel",t.notificationConfig.sound.disableSound),m(4),v("ngModel",t.notificationConfig.disableNotifications),m(6),h("disabled",t.notificationConfig.disableNotifications),m(5),w(t.isPhonePortrait().matches?-1:19),m(),v("ngModel",t.notificationConfig.devices.showNormalState),m(6),v("ngModel",t.notificationConfig.devices.showNominalState),m(5),h("disabled",t.notificationConfig.disableNotifications),m(5),w(t.isPhonePortrait().matches?-1:36),m(),v("ngModel",t.notificationConfig.sound.muteAlert),h("disabled",t.notificationConfig.sound.disableSound),m(6),v("ngModel",t.notificationConfig.sound.muteWarn),h("disabled",t.notificationConfig.sound.disableSound),m(6),v("ngModel",t.notificationConfig.sound.muteAlarm),h("disabled",t.notificationConfig.sound.disableSound),m(6),v("ngModel",t.notificationConfig.sound.muteEmergency),h("disabled",t.notificationConfig.sound.disableSound),m(7),h("disabled",!o.form.dirty)}},dependencies:[K,j,X,q,oe,ae,ot,ht,ue,ct,dt,Ne,Ve,lt,rt,de,H],styles:[".notification-accordion[_ngcontent-%COMP%]{margin-left:25px}"]})}return n})();vt.register(...bi);var Ri=vt;var hn=["activityGraph"],Ct=()=>({standalone:!1}),pn=()=>({standalone:!0}),Di=(()=>{class n{dialog=c(ni);appSettingsService=c(B);app=c(z);DataService=c(Je);signalKConnectionService=c(Xt);deltaService=c(Jt);connectionStateMachine=c(Ht);auth=c(Ke);destroyRef=c(At);canvasService=c(fi);activityGraph=ne("activityGraph");connectionConfig;isConnecting=!1;authToken;endpointServiceStatus;streamStatus;_chart=null;textColor;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.auth.authToken$.pipe(Se(this.destroyRef)).subscribe(e=>{e?this.authToken=e:this.authToken=null}),this.signalKConnectionService.getServiceEndpointStatusAsO().pipe(Se(this.destroyRef)).subscribe(e=>{this.endpointServiceStatus=e}),this.deltaService.getDataStreamStatusAsO().pipe(Se(this.destroyRef)).subscribe(e=>{this.streamStatus=e})}ngAfterViewInit(){this.textColor=window.getComputedStyle(this.activityGraph().nativeElement).color,this._chart?.destroy(),this.startChart(),this.DataService.getSignalkDeltaUpdateStatistics().pipe(Se(this.destroyRef)).subscribe(e=>{this._chart.data.datasets[0].data.push({x:e.timestamp,y:e.value}),this._chart.data.datasets[0].data.length>10&&this._chart.data.datasets[0].data.shift(),this._chart?.update("none")})}openUserCredentialModal(e){this.dialog.open(vi,{data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().pipe(Se(this.destroyRef)).subscribe(t=>{t&&(this.connectionConfig.loginName=t.user,this.connectionConfig.loginPassword=t.password,this.connectToServer())})}connectToServer(){return Fe(this,null,function*(){if(this.connectionConfig.useSharedConfig&&(!this.connectionConfig.loginName||!this.connectionConfig.loginPassword)){this.openUserCredentialModal("Credentials required");return}this.isConnecting=!0;try{console.log("[Settings-SignalK] Validating Signal K server before connecting..."),yield this.signalKConnectionService.validateSignalKUrl(this.connectionConfig.signalKUrl),console.log("[Settings-SignalK] Validation successful - proceeding with connection"),this.appSettingsService.setConnectionConfig(this.connectionConfig),this.connectionStateMachine.shutdown("Configuration changed - restarting app"),this.authToken&&!this.connectionConfig.useSharedConfig&&!this.authToken.isDeviceAccessToken&&this.auth.deleteToken(),window.__KIP_TEST__||location.reload()}catch(e){this.isConnecting=!1;let i=e?.message||"Unknown validation error";console.error("[Settings-SignalK] Server validation failed:",i),this.app.sendSnackbarNotification(`Connection failed: ${i}`,8e3,!1)}})}startChart(){this._chart=new Ri(this.activityGraph().nativeElement.getContext("2d"),{type:"line",data:{datasets:[{data:[],fill:!0,borderColor:this.textColor}]},options:{maintainAspectRatio:!1,animation:!1,parsing:!1,scales:{x:{type:"time",display:!0,time:{unit:"minute",minUnit:"second",round:"second",displayFormats:{hour:"k:mm''",minute:"mm''",second:'mm ss"',millisecond:"SSS"}},position:"bottom",ticks:{display:!1},grid:{display:!0}},y:{beginAtZero:!0,type:"linear",position:"right",title:{text:"Delta / Sec",display:!0}}},plugins:{legend:{display:!1,labels:{color:this.textColor}}}}})}useSharedConfigToggleClick(e){if(e.checked){let i=this.signalKConnectionService.serverVersion$.getValue();if(!qt(i,"1.46.2",">=")){this.app.sendSnackbarNotification("Configuration sharing requires Signal K version 1.46.2 or better",0),this.connectionConfig.useSharedConfig=!1;return}this.openUserCredentialModal(null)}}ngOnDestroy(){this._chart?.destroy();let e=this.activityGraph?.()?.nativeElement;this.canvasService.releaseCanvas(e,{clear:!0,removeFromDom:!0})}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=x({type:n,selectors:[["settings-signalk"]],viewQuery:function(i,t){i&1&&ie(t.activityGraph,hn,5),i&2&&ye()},decls:40,vars:22,consts:[["connectionForm","ngForm"],["useSharedConfigToggle",""],["activityGraph",""],["name","connectionForm",3,"ngSubmit"],[1,"connect-table"],[1,"url-cell"],[1,"connectUrlInput"],["type","url","matInput","","placeholder","Ex. http://192.168.0.1:3000","name","signalKURL","required","","pattern","https?://.+",3,"ngModelChange","ngModel","ngModelOptions"],[1,"connect-cell"],["mat-flat-button","","type","submit",1,"connect-btn",3,"disabled"],["colspan","2"],["name","useSharedConfigToggle","matTooltip","Activating authentication enables Signal K's user storage feature to save KIP configuration on the server. When authentication is not activated, KIP stores it's configuration locally in the Browser.",3,"ngModelChange","change","ngModel","ngModelOptions","disabled"],["mat-flat-button","","type","button","matTooltip","Configure Signal K user authentication credentials. The user must be a valid pre existing Signal K server user. It is strongly recommended not to use the default Signal K Admin user.",1,"credentials-btn",3,"click","disabled"],["name","signalKSubscribeAll",3,"ngModelChange","ngModel","ngModelOptions"],["name","isProxyEnabled",3,"ngModelChange","ngModel","ngModelOptions"],[1,"activity-container"],[1,"activity-graph-container"],[1,"activity-graph"],[1,"info-container"]],template:function(i,t){if(i&1){let o=P();a(0,"form",3,0),b("ngSubmit",function(){return p(o),g(t.connectToServer())}),u(2,"br"),a(3,"table",4)(4,"tr",4)(5,"td",5)(6,"mat-form-field",6)(7,"mat-label"),r(8,"Signal K URL"),s(),a(9,"input",7),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.signalKUrl,l)||(t.connectionConfig.signalKUrl=l),g(l)}),s(),a(10,"mat-error"),r(11,' Valid URL is required. Ex. "https://demo.signalK.org" or "http://my.server.com:3000" '),s()()(),a(12,"td",8)(13,"button",9),r(14),s()()(),a(15,"tr",4)(16,"td",10)(17,"mat-slide-toggle",11,1),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.useSharedConfig,l)||(t.connectionConfig.useSharedConfig=l),g(l)}),b("change",function(l){return p(o),g(t.useSharedConfigToggleClick(l))}),r(19," Login to server "),s(),a(20,"button",12),b("click",function(){return p(o),g(t.openUserCredentialModal(null))}),r(21," Set Credential "),s(),u(22,"br"),a(23,"mat-checkbox",13),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.signalKSubscribeAll,l)||(t.connectionConfig.signalKSubscribeAll=l),g(l)}),r(24,"Subscribe to remote sources messages such as AIS and DSC targets. "),a(25,"i"),r(26,"Warning: this maybe generate heavy traffic."),s()()()(),a(27,"tr",4)(28,"td",10)(29,"mat-checkbox",14),S("ngModelChange",function(l){return p(o),y(t.connectionConfig.proxyEnabled,l)||(t.connectionConfig.proxyEnabled=l),g(l)}),r(30,"Signal K server is behind a Proxy"),s()()()()(),a(31,"div",15)(32,"div",16),u(33,"canvas",17,2),s(),a(35,"div",18)(36,"pre"),r(37),u(38,"br"),r(39),s()()()}if(i&2){let o=T(1);m(9),v("ngModel",t.connectionConfig.signalKUrl),h("ngModelOptions",Q(18,Ct)),m(4),h("disabled",!o.form.valid||t.isConnecting),m(),Ut(" ",t.isConnecting?"Validating...":"Connect"," "),m(3),v("ngModel",t.connectionConfig.useSharedConfig),h("ngModelOptions",Q(19,pn))("disabled",!t.connectionConfig.signalKUrl),m(3),h("disabled",!t.connectionConfig.useSharedConfig),m(3),v("ngModel",t.connectionConfig.signalKSubscribeAll),h("ngModelOptions",Q(20,Ct)),m(6),v("ngModel",t.connectionConfig.proxyEnabled),h("ngModelOptions",Q(21,Ct)),m(8),_t("KIP: ",t.app.appVersion(),`
@@ -1 +1 @@
1
- import{a as c}from"./chunk-D3OVXRDS.js";import{a as g}from"./chunk-MVXIEN3D.js";import"./chunk-JWT2WFAW.js";import{k as l}from"./chunk-CWBDCB4U.js";import{k as a,m as r}from"./chunk-MKKQCG3C.js";import"./chunk-W4VRE5PG.js";import{hb as s,sa as t}from"./chunk-PR5JLJLD.js";var v=(()=>{class o{dialog=t(l);auth=t(a);appService=t(g);appSettingsService=t(r);connectionConfig=null;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option")}openUserCredentialModal(e){this.dialog.open(c,{disableClose:!0,data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().subscribe(i=>{i===void 0||!i||(this.connectionConfig.loginName=i.user,this.connectionConfig.loginPassword=i.password,this.appSettingsService.setConnectionConfig(this.connectionConfig),this.serverLogin())})}serverLogin(e){this.auth.login({usr:this.connectionConfig.loginName,pwd:this.connectionConfig.loginPassword,newUrl:e}).then(()=>{this.appSettingsService.reloadApp()}).catch(n=>{n.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==404?(this.appService.sendSnackbarNotification("Sign in failed: Login API not found at URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==0?(this.appService.sendSnackbarNotification("Sign in failed: Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+n.message)):(this.appService.sendSnackbarNotification("Unknown authentication failure: "+JSON.stringify(n),5e3,!1),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(n)))})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=s({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,i){},encapsulation:2})}return o})();export{v as WidgetLoginComponent};
1
+ import{a as c}from"./chunk-D3OVXRDS.js";import{a as g}from"./chunk-L7KYMDKT.js";import"./chunk-JWT2WFAW.js";import{k as l}from"./chunk-CWBDCB4U.js";import{k as a,m as r}from"./chunk-MKKQCG3C.js";import"./chunk-W4VRE5PG.js";import{hb as s,sa as t}from"./chunk-PR5JLJLD.js";var v=(()=>{class o{dialog=t(l);auth=t(a);appService=t(g);appSettingsService=t(r);connectionConfig=null;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option")}openUserCredentialModal(e){this.dialog.open(c,{disableClose:!0,data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().subscribe(i=>{i===void 0||!i||(this.connectionConfig.loginName=i.user,this.connectionConfig.loginPassword=i.password,this.appSettingsService.setConnectionConfig(this.connectionConfig),this.serverLogin())})}serverLogin(e){this.auth.login({usr:this.connectionConfig.loginName,pwd:this.connectionConfig.loginPassword,newUrl:e}).then(()=>{this.appSettingsService.reloadApp()}).catch(n=>{n.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==404?(this.appService.sendSnackbarNotification("Sign in failed: Login API not found at URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==0?(this.appService.sendSnackbarNotification("Sign in failed: Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+n.message)):(this.appService.sendSnackbarNotification("Unknown authentication failure: "+JSON.stringify(n),5e3,!1),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(n)))})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=s({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,i){},encapsulation:2})}return o})();export{v as WidgetLoginComponent};