@mxtommy/kip 4.0.7 → 4.0.8-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/package.json +1 -1
- package/plugin/index.js +10 -6
- package/public/{chunk-KZW5Z46K.js → chunk-23GQYVQ6.js} +1 -1
- package/public/{chunk-4NJ3ZL5U.js → chunk-3Y7WDZKI.js} +1 -1
- package/public/{chunk-JCVEDDSQ.js → chunk-AA2M4OWK.js} +1 -1
- package/public/{chunk-35577QTX.js → chunk-SLMCWOKC.js} +1 -1
- package/public/chunk-VJ4U7HHN.js +1 -0
- package/public/{chunk-BISZS3TE.js → chunk-WADRUSMB.js} +1 -1
- package/public/{chunk-ROD2YZ6L.js → chunk-YIXYV2MV.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-NJAW6UFC.js → main-HG5TDMOB.js} +1 -1
- package/rm-npmjs-beta.sh +50 -0
- package/public/chunk-DADLXEYG.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as wl,B as Jo,C as er,D as tr,E as ir,F as jn,G as Ca,H as xl,I as _l,J as Yn,K as Ji,L as Et,M as Qn,N as $n,O as Zn,P as ho,Q as po,R as Ml,S as Xn,T as Kn,a as Gt,b as ni,c as oo,d as vl,e as yl,f as Cl,g as Sl,h as Ye,i as Zi,j as Xi,k as ro,l as pn,m as va,n as ui,o as Ki,p as zt,q as so,r as lo,s as Hn,t as gn,u as co,v as mo,w as hi,x as Ko,y as uo,z as ya}from"./chunk-QVCMARCU.js";import{a as Al,b as ao}from"./chunk-RYHOAWDD.js";import{a as ii,b as $i,c as ot}from"./chunk-PKKBBIJK.js";import{a as dl,b as cl,c as ml,d as zn,e as ul,f as Tt,g as hl,h as pl,i as gl,k as fl,m as Aa,n as bl}from"./chunk-HIADZ4BV.js";import{a as wt,b as Lt}from"./chunk-DADLXEYG.js";import{a as sl,b as ll}from"./chunk-OQULS6SV.js";import{A as bt,B as ti,a as ge,c as Ws,d as Ci,e as Zs,f as Xs,g as Ks,h as Si,i as wi,k as Js,l as xi,m as _i,n as Mi,o as zi,p as Kt,r as ut,s as Yi,t as ol,u as Qi,w as rl,y as ht,z as ei}from"./chunk-QLTN6G6E.js";import{A as Bn,B as ki,C as Ti,D as kt,E as nl,F as al,G as Hi,H as Un,I as ji,J as mt,L as qn,M as gt,N as ft,a as qi,d as qt,e as Nn,f as ws,i as xs,j as _s,k as $a,l as Ms,m as Zt,n as Gn,o as ct,q as _t,s as at,t as Mt,u as el,v as tl,w as no,x as il,y as Jt,z as Fn}from"./chunk-XDPHEQEO.js";import{b as Gs,f as Fs,g as Bs,h as zs,i as Xo,j as Hs,m as js,n as Ys,o as Qs,s as $s}from"./chunk-SZ2GUIT5.js";import{$ as cs,$b as Bt,Ab as Ct,Ad as Zo,Ba as La,Bb as St,Bc as za,Bd as Ka,C as ha,Ca as pa,Cc as Ha,Cd as Vs,D as xn,Db as te,Dd as Ja,E as Vi,Eb as me,Ec as Ss,F as Wi,Fa as g,Fb as It,Fd as Ot,Ga as ps,Gb as re,Gc as ja,Gd as je,Hb as et,Hd as Ke,I as ns,Ia as kn,Ib as Rn,Ic as Ya,J as Li,Ja as di,Jb as Ft,K as Gi,Kb as m,La as Ga,Lb as ne,Ld as mi,M as as,Mb as ve,N as os,Nb as Ui,Nc as tt,Nd as Xt,O as rs,Oa as L,Oc as Qa,P as Ra,Pa as Wt,Pb as cn,Qa as lt,Qb as mn,R as ss,Ra as Fa,Rb as un,S as ls,Sa as ga,Sc as Za,Ta as gs,Td as eo,U as ds,Ua as Bi,Ud as to,V as _n,Va as fs,Vb as ci,Vd as xt,W as Na,Wa as yt,Wd as io,X as Va,Xa as We,Xb as hn,Xc as ks,Xd as dt,Ya as Tn,Yb as ba,Z as Wa,Zd as Ls,_b as At,_d as Je,a as Be,ab as Q,ac as Ua,b as Xe,ba as Mn,bb as G,ca as pt,cb as F,cc as W,d as Cm,da as Vt,db as _e,dc as le,dd as Ts,e as Zr,ea as Yt,eb as En,ec as R,ed as Es,f as nt,fa as ms,fb as ue,fc as bs,fd as Ds,fe as Us,g as Ni,ga as A,gb as he,ge as qs,hb as T,hc as qa,i as jo,ia as us,ib as d,ic as Ze,j as Nt,ja as q,jb as u,jc as v,ka as z,kb as U,kc as ie,kd as Xa,l as Ia,la as X,lb as M,m as Xr,ma as Ve,mb as k,mc as As,md as Vn,na as Fi,nb as H,nc as Ut,nd as Ps,oa as hs,ob as Dn,od as Is,p as Kr,pa as st,pb as Pn,pc as qe,pd as Wn,q as Yo,qb as Ba,qc as $o,r as Jr,ra as w,rb as ae,sb as Pi,sd as Os,t as Oa,tb as B,u as Qo,ua as Qt,ub as fa,v as es,vb as I,vd as Rs,w as vi,wa as Ie,wb as In,wc as vs,wd as yi,xb as On,xc as ys,xd as Ln,y as ts,yb as dn,yc as Cs,yd as Ns,z as is,zb as $t}from"./chunk-OB3QLUH6.js";var mr=Cm((ox,Eo)=>{(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(Pa===null){var p=window.getComputedStyle(document.documentElement,"");Pa=(Array.prototype.slice.call(p).join("").match(/-(moz|webkit|ms)-/)||p.OLink===""&&["","o"]||["",""])[1]}if(Pa==="")return null;var y=c.charAt(0).toUpperCase()+c.substr(1),S=l[Pa+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 O=c-p,P=O/S,V=0;P>1&&(P=1),P!==1&&(V=y(P),isFinite(V)&&!isNaN(V)&&(P=V)),l&&l(P),O<S?D.frame=Hr(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(Am,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,O=void 0;if(c=parseFloat(c),O=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=(O?"-":"")+D[0]+"."+D[1]}else{for(D=Math.round(c).toString(),x=y-D.length;S<x;++S)D="0"+D;D=(O?"-":"")+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 J(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 Oe(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,O="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=J(l,"Value",V),Oe(c,l,Z,de);var pe=c.measureText(l.valueText?P:"-"+_(Number(O),l)).width;se(c);var Ae=parseFloat(l.fontValueSize)*V+Z+de,Ge=$*parseFloat(l.valueBoxStroke),be=2*x-2*Ge,Re=pe+10*$,Ne=1.1*Ae+Z+de,Fe=$*l.valueBoxBorderRadius,ke=(parseFloat(l.valueBoxWidth)||0)/100*be;ke>Re&&(Re=ke),Re>be&&(Re=be);var De=y-Re/2,we=S-Ne/2,fe=S-5.75*$;if(c.beginPath(),Fe?C(c,De,we,Re,Ne,Fe):c.rect(De,we,Re,Ne),Ge){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=Ge,c.stroke()}l.colorValueBoxShadow&&(c.shadowBlur=1.2*$,c.shadowColor=l.colorValueBoxShadow),l.colorValueBoxBackground&&(c.fillStyle=l.colorValueBoxBackground,c.fill()),c.closePath(),c.restore(),Oe(c,l,Z,de),c.fillStyle=l.colorValueText,c.textAlign="center",c.textBaseline="alphabetic",c.fillText(P,De+Re/2,S+Ne/2-Ae/3),c.restore()}}function Qe(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,li(c),0,2*ma,!0),p.lineWidth=l,p.strokeStyle=S?oe.linearGradient(p,y,S,c):y,p.stroke(),p.closePath()}function Le(c,l){var p=si.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,Ge,be){return de&&(!be&&l.borderShadowWidth&&(pe.save(),pe.shadowBlur=l.borderShadowWidth,pe.shadowColor=l.colorBorderShadow),Ee(Z,de*y,pe,Ae,Ge),!be&&l.borderShadowWidth&&(be=!0,pe.restore())),be}var y=si.pixelRatio,S=l.borderShadowWidth*y,x=c.max-S-l.borderOuterWidth*y/2,D=x-l.borderOuterWidth*y/2-l.borderMiddleWidth*y/2+.5,O=D-l.borderMiddleWidth*y/2-l.borderInnerWidth*y/2+.5,P=Le(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(O,l.borderInnerWidth,c,l.colorBorderInner,l.colorBorderInnerEnd,$),!$&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),c.beginPath(),c.arc(0,0,li(P),0,2*ma,!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=li(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 O=l.highlights[D];c.lineWidth=p,c.lineCap=l.highlightsLineCap,c.strokeStyle=O.color,c.beginPath(),c.rotate(Ho),c.arc(0,0,y,oe.radians(l.startAngle+(O.from-l.minValue)/x),oe.radians(l.startAngle+(O.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,O=Math.abs(l.minorTicks)||0,P=l.ticksAngle/(l.maxValue-l.minValue);l.exactTicks?(S=l.maxValue-l.minValue,y=O?S/O:0,D=(Ai.mod(l.majorTicks[0],O)||0)*P):y=O*(l.majorTicks.length-1),c.lineWidth=si.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),rn(c));c.restore()}function it(c,l){var p=c.max/100;return Le(c,l)-5*p-(l.barWidth?2*(parseFloat(l.barStrokeWidth)||0)+((parseFloat(l.barWidth)||0)+5)*p:0)}function rt(c,l){oe.prepareTicks(l);var p=li(it(c,l)),y=void 0,S=l.majorTicks.length,x=si.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(Ho),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 rn(c){c.stroke(),c.restore(),c.closePath(),c.save()}function Ta(c,l){var p=it(c,l)-.15*c.max,y={},S=0,x=l.majorTicks.length,D=l.animationTarget!=="needle",O=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=O[S],c.fillText(l.majorTicks[S],pe.x,pe.y))}D&&c.restore()}function Rr(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 Nr(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 Vr(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=Le(c,l),D=li(x/100*l.needleCircleSize),O=li(x/100*l.needleCircleSize*.75),P=li(x/100*l.needleEnd),V=li(l.needleStart?x/100*l.needleStart:0),$=x/100*l.needleWidth,Z=x/100*l.needleWidth/2,de=si.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*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleOuter,l.colorNeedleCircleOuterEnd,D),c.fill(),c.closePath()),l.needleCircleInner&&(c.beginPath(),c.arc(0,0,O,0,2*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleInner,l.colorNeedleCircleInnerEnd,O),c.fill(),c.closePath()),c.restore())}}function Wr(c,l,p){oe.drawValueBox(c,l,p,0,c.max-.33*c.max,c.max)}function Jc(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 Lr(c,l){var p=c.max/100,y=Le(c,l)-5*p,S=parseFloat(l.barStrokeWidth+"")||0,x=(parseFloat(l.barWidth+"")||0)*p,D=y-2*S-x,O=(y-D)/2,P=D+O,V=S/P,$=l.startAngle,Z=l.startAngle+l.ticksAngle;if(c.save(),c.rotate(Ho),S&&(c.beginPath(),c.arc(0,0,P,oe.radians($)-V,oe.radians(Z)+V,!1),c.strokeStyle=l.colorBarStroke,c.lineWidth=2*O,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=Jc(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 Gr(c){return c.options.animatedValue?c.options.value:c.value}function em(c,l,p,y,S,x,D,O){c.beginPath(),c.fillStyle=O?oe.linearGradient(c,D,O,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 tm(c,l,p,y,S,x,D,O,P){c.beginPath(),c.lineWidth=l,c.strokeStyle=P?oe.linearGradient(c,O,P,D,!0,S):O,p>0?oe.roundRect(c,y,S,x,D,p):c.rect(y,S,x,D),c.stroke(),c.closePath()}function im(c,l,p,y,S,x){function D(Pe,Ue,$e,Rt){return Pe&&(!Rt&&l.borderShadowWidth&&(c.save(),c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),tm(c,Pe*O,P,p+Pe*O/2-fe,y+Pe*O/2-fe,V,pe,Ue,$e),fe+=.5*O,!Rt&&l.borderShadowWidth&&(Rt=!0,c.restore())),Rt}var O=si.pixelRatio,P=l.borderRadius*O,V=S-l.borderShadowWidth-l.borderOuterWidth*O,$=V-l.borderOuterWidth*O-l.borderMiddleWidth*O,Z=$-l.borderMiddleWidth*O-l.borderInnerWidth*O,de=Z-l.borderInnerWidth*O,pe=x-l.borderShadowWidth-l.borderOuterWidth*O,Ae=pe-l.borderOuterWidth*O-l.borderMiddleWidth*O,Ge=Ae-l.borderMiddleWidth*O-l.borderInnerWidth*O,be=Ge-l.borderInnerWidth*O,Re=p-($-V)/2,Ne=Re-(Z-$)/2,Fe=Ne-(de-Z)/2,ke=y-(Ae-pe)/2,De=ke-(Ge-Ae)/2,we=De-(be-Ge)/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),em(c,P,Fe,we,de+2*fe,be+2*fe,l.colorPlate,l.colorPlateEnd),c.restore(),[Fe,we,de,be]}function nm(c,l,p,y,S,x){var D=si.pixelRatio,O=x>=S,P=O?.85*S:x,V=O?x:S;p=O?Se(p+(S-P)/2):p;var $=!!l.title,Z=!!l.units,de=!!l.valueBox,pe=void 0,Ae=void 0,Ge=void 0;O?(Ae=Se(.05*V),pe=Se(.075*V),Ge=Se(.11*V),$&&(V-=pe,y+=pe),Z&&(V-=Ae),de&&(V-=Ge)):(Ae=pe=Se(.15*P),$&&(P-=pe,y+=pe),Z&&(P-=Ae));var be=2*l.barStrokeWidth,Re=l.barBeginCircle?Se(P*l.barBeginCircle/200-be/2):0,Ne=Se(P*l.barWidth/100-be),Fe=Se(V*l.barLength/100-be),ke=Se((V-Fe)/2),De=Se(p+(O?P/2:ke+Re)),we=Se(y+(O?V-ke-Re+be/2:P/2)),fe=!O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P,ye=O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P;return c.barDimensions={isVertical:O,width:P,length:V,barWidth:Ne,barLength:Fe,strokeWidth:be,barMargin:ke,radius:Re,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 Fr(c,l,p,y,S,x,D){var O=nm(c,l,y,S,x,D),P=O.isVertical,V=O.width,$=O.barWidth,Z=O.barLength,de=O.strokeWidth,pe=O.barMargin,Ae=O.radius,Ge=O.x0,be=O.y0,Re=O.X,Ne=O.Y,Fe=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=Ge+(P?Ae*ye:Ae*fe-de/2),Ue=P?be-Ae*fe:be+Ae*ye,$e=li(P?Ue-be:Pe-Ge);ke=Se($e+Ae);var Rt=P?Se(Ge-Ae*ye):Pe,jt=P?Ue:Se(be-Ae*ye);p==="progress"&&(Z=ke+(Z-ke)*(oe.normalizedValue(l).normal-l.minValue)/(l.maxValue-l.minValue));var ua=Se(Pe+Z-ke+de/2),ln=Se(Ue-Z+ke-de/2);c.arc(Ge,be,Ae,De+we,De-we),P?(c.moveTo(Pe,jt),c.lineTo(Pe,ln),c.lineTo(Rt,ln),c.lineTo(Rt,jt)):(c.moveTo(Pe,jt),c.lineTo(ua,jt),c.lineTo(ua,Ue),c.lineTo(Pe,Ue))}else{var Qr=Se(P?Re+(V-$)/2:Re+pe),$r=Se(P?Ne+Z+pe:Ne+(V-$)/2);p==="progress"&&(Z*=(l.value-l.minValue)/(l.maxValue-l.minValue)),P?c.rect(Qr,$r,$,-Z):c.rect(Qr,$r,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?Ne:Re):l.colorBar,c.fill()):p==="progress"&&l.colorBarProgress&&(c.fillStyle=l.colorBarProgressEnd?oe.linearGradient(c,l.colorBarProgress,l.colorBarProgressEnd,Fe,P,P?Ne:Re):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 am(c,l,p,y,S,x){Fr(c,l,"",p,y,S,x)}function Br(c,l){return l.needleSide!==c||l.tickSide!==c||l.numberSide!==c}function om(c,l,p,y,S,x){l.barProgress&&Fr(c,l,"progress",p,y,S,x)}function rm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,O=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",Ge=l.tickSide!=="left",be=0,Re=l.highlights.length,Ne=(S-D)/2,Fe=l.maxValue-l.minValue,ke=Se(y?V+Ne:V+P+O),De=pe,we=y?$+x-P-O:$+Ne,fe=Se((l.ticksWidth/100+de)*S)+(pe-l.ticksWidth/100*S),ye=Se(D+de*S);for(c.save();be<Re;be++){var Pe=l.highlights[be],Ue=Z*li(l.minValue-Pe.from)/Fe,$e=Z*li((Pe.to-Pe.from)/Fe);c.beginPath(),c.fillStyle=Pe.color,y?(Ae&&c.rect(ke-fe,we-Ue,De,-$e),Ge&&c.rect(ke+ye,we-Ue,De,-$e)):(Ae&&c.rect(ke+Ue,we-fe,$e,De),Ge&&c.rect(ke+Ue,we+ye,$e,De)),c.fill(),c.closePath()}c.restore()}}function Ea(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function Ur(c,l,p,y,S,x,D,O,P){var V=c.barDimensions,$=V.isVertical,Z=V.length,de=V.barWidth,pe=V.barOffset,Ae=V.barMargin,Ge=V.pixelRatio,be=V.width,Re=V.X,Ne=V.Y,Fe=V.ticksLength,ke=V.ticksPadding,De=(be-de)/2,we=void 0,fe=void 0,ye=0,Pe=p.length,Ue=void 0,$e=P*be,Rt=De-ke*be,jt=De+de+$e+ke*be,ua=l instanceof Array?l:new Array(p.length).fill(l);c.save(),c.lineWidth=O*Ge;for(var ln=Fe/(S-y);ye<Pe;ye++)Ue=p[ye],c.strokeStyle=ua[ye],$?(fe=Ne+Z-Ae-pe+(y-Ue)*ln,x&&(we=Re+Rt,Ea(c,we,fe,Se(we-$e),fe)),D&&(we=Re+jt,Ea(c,we,fe,Se(we-$e),fe))):(we=Re+Ae+pe-(y-Ue)*ln,x&&(fe=Ne+Rt,Ea(c,we,fe,we,Se(fe-$e))),D&&(fe=Ne+jt,Ea(c,we,Se(fe),we,fe-$e)));c.restore()}function sm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],D=2,O=(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(Ur(c,P,l.exactTicks?l.majorTicks:l.majorTicks.map(function($e,Rt){return l.minValue+O*Rt}),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,Ge=V.barOffset,be=V.X,Re=V.Y,Ne=V.ticksLength,Fe=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*=Fe,$?(ye=Re+Z-Ae-Ge+D/2,Ue=ye-Ne-D,S&&(Pe=fe=Se(be+we),Da(c,fe,ye,Pe,Ue)),x&&(Pe=fe=Se(be+De),Da(c,fe,ye,Pe,Ue))):(fe=be+Ae+Ge-D/2,Pe=fe+Ne+D,S&&(Ue=ye=Se(Re+we),Da(c,fe,ye,Pe,Ue)),x&&(Ue=ye=Se(Re+De),Da(c,fe,ye,Pe,Ue)))}}function Da(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function lm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],D=[],O=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 $=Ai.mod(l.majorTicks[0],P)||0;O<l.maxValue;O+=P)$+O<l.maxValue&&D.push($+O);else for(;O<l.maxValue;O+=V)D.push(O);Ur(c,l.colorMinorTicks||l.colorStrokeTicks,D,l.minValue,l.maxValue,S,x,1,l.ticksWidthMinor/100)}function dm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.length,x=p.width,D=p.barWidth,O=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),Ge=l.exactTicks?l.majorTicks:l.majorTicks.map(function(ua,ln){return l.minValue+Ae*ln}),be=Ge.length,Re=l.numberSide!=="right",Ne=l.numberSide!=="left",Fe=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,$e=void 0,Rt=l.colorNumbers instanceof Array?l.colorNumbers:new Array(be).fill(l.colorNumbers),jt=l.numbersMargin/100*x;for(c.font=oe.font(l,"Numbers",x/200),c.lineWidth=0,c.textAlign="center";ke<be;ke++)c.fillStyle=Rt[ke],$e=l.majorTicks[ke],Ue=l.exactTicks?Z*((Ge[ke]-l.minValue)/pe):ke*Z/(be-1),y?(Pe=$+S-O-P-Ue+Fe/3,Re&&(c.textAlign="right",c.fillText($e,V+we-jt,Pe)),Ne&&(c.textAlign="left",c.fillText($e,V+fe+jt,Pe))):(c.measureText($e).width,ye=V+O+P+Ue,Re&&c.fillText($e,ye,$+we-jt),Ne&&c.fillText($e,ye,$+fe+Fe+jt))}function cm(c,l){if(l.title){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,O=p.baseY,P=p.titleMargin,V=l.fontTitleSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(O+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 mm(c,l){if(l.units){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,O=p.baseY,P=p.unitsMargin,V=l.fontUnitsSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(O+(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 um(c,l){if(l.needle){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,O=p.barOffset,P=p.barMargin,V=p.ticksLength,$=p.X,Z=p.Y,de=p.ticksPadding,pe=l.needleSide!=="right",Ae=l.needleSide!=="left",Ge=V*(oe.normalizedValue(l).indented-l.minValue)/(l.maxValue-l.minValue),be=(l.ticksWidth/100+de)*S,Re=D/2+be,Ne=Re*(l.needleEnd/100),Fe=void 0,ke=void 0,De=void 0,we=void 0,fe=l.needleType.toLowerCase()==="arrow"?pm:hm,ye=(S-D)/2,Pe=Re*(l.needleStart/100),Ue=ye-be-Pe,$e=ye+D+be+Pe;c.save(),oe.drawNeedleShadow(c,l),y?(De=Se(Z+x-P-O-Ge),pe&&(Fe=Se($+Ue),ke=Fe+Ne,fe(c,l,Fe,De,ke,De,Ne)),Ae&&(Fe=Se($+$e),ke=Fe-Ne,fe(c,l,Fe,De,ke,De,Ne,!0))):(Fe=Se($+P+O+Ge),pe&&(De=Se(Z+Ue),we=De+Ne,fe(c,l,Fe,De,Fe,we,Ne)),Ae&&(De=Se(Z+$e),we=De-Ne,fe(c,l,Fe,De,Fe,we,Ne,!0))),c.restore()}}function qr(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 hm(c,l,p,y,S,x,D,O){c.lineWidth=l.needleWidth,c.strokeStyle=qr(c,l,D,O),c.beginPath(),c.moveTo(p,y),c.lineTo(S,x),c.stroke(),c.closePath()}function pm(c,l,p,y,S,x,D,O){var P=Se(.4*D),V=D-P,$=p===S,Z=l.needleWidth/2;c.fillStyle=qr(c,l,D,O),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 gm(c,l,p,y,S,x,D){var O=(parseFloat(l.fontValueSize)||0)*x/200,P=(.11*D-O)/2;c.barDimensions.isVertical&&oe.drawValueBox(c,l,p,y+x/2,S+D-O-P,x)}var zr=(function(){function c(l,p){var y=[],S=!0,x=!1,D=void 0;try{for(var O,P=l[Symbol.iterator]();!(S=(O=P.next()).done)&&(y.push(O.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")}})(),Bo=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)},fm=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 O=x.set;O!==void 0&&O.call(S,y)}return y},sn=(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}})(),Pa=null,bm=(function(){function c(){i(this,c),this._events={},this.addListener=this.on,this.removeListener=this.off}return sn(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,O=this;x<D;x++)(function(){var P=y[x],V=function $(){O.off(l,$),P.apply(O,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})(),Hr=a("requestAnimationFrame")||function(c){return setTimeout(function(){return c(new Date().getTime())},1e3/60)},da={linear:function(c){return c},quad:function(c){return Math.pow(c,2)},dequad:function(c){return 1-da.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-da.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-da.delastic(1-c)},delastic:function(c){return Math.pow(2,10*(c-1))*Math.cos(20*Math.PI*1.5/3*c)}},Uo=(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 sn(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=Hr(function(x){return r(x,l,S,da[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})();Uo.rules=da;var wn=(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 sn(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),O=c.parse(l.getAttribute(D));O!=null&&(S[y]=O)}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,Ge){return Ge?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})(),si=(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 sn(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})();si.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(si.redraw);var qo={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 zo="2.2.1",Se=Math.round,li=Math.abs,ca=new s;ca.version=zo;var Ai=(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(ca.push(y),p.listeners&&Object.keys(p.listeners).forEach(function(D){(p.listeners[D]instanceof Array?p.listeners[D]:[p.listeners[D]]).forEach(function(O){y.on(D,O)})}),y.version=zo,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 si(x,p.width,p.height),y.canvas.onRedraw=y.draw.bind(y),y.animation=new Uo(p.animationRule,p.animationDuration),y}return t(l,c),sn(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=ca.indexOf(this);~p&&ca.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 wn(y,"canvas",p)}},{key:"fromElement",value:function(p){var y=wn.toCamelCase(p.getAttribute("data-type")),S=p.attributes,x=0,D=S.length,O={};if(y){for(/Gauge$/.test(y)||(y+="Gauge");x<D;x++)O[wn.toCamelCase(S[x].name.replace(/^data-/,""),!1)]=wn.parse(S[x].value);new wn(O,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 zo}}]),l})(bm);n!==void 0&&(n.BaseGauge=Ai,n.gauges=(window.document||{}).gauges=ca);var Am=/{([_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:J,normalizedValue:Qe,formatContext:f},ma=Math.PI,Ho=ma/2,jr=Object.assign({},qo,{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"}),vm=(function(c){function l(p){return i(this,l),p=Object.assign({},jr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),sn(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],O=y[3],P=this.options;if(P.animationTarget==="needle"){if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,O),this.emit("beforePlate"),Me(V,P),this.emit("beforeHighlights"),ze(V,P),this.emit("beforeMinorTicks"),He(V,P),this.emit("beforeMajorTicks"),rt(V,P),this.emit("beforeNumbers"),Ta(V,P),this.emit("beforeTitle"),Rr(V,P),this.emit("beforeUnits"),Nr(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,O),p.context.drawImage(p.elementClone,S,x,D,O),this.emit("beforeProgressBar"),Lr(p.context,P),this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),this.emit("beforeNeedle"),Vr(p.context,P)}else{var $=-oe.radians((P.value-P.minValue)/(P.maxValue-P.minValue)*P.ticksAngle);if(p.context.clearRect(S,x,D,O),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"),rt(p.context,P),this.emit("beforeNumbers"),Ta(p.context,P),this.emit("beforeProgressBar"),Lr(p.context,P),p.context.rotate(-$),!p.elementClone.initialized){var Z=p.contextClone;Z.clearRect(S,x,D,O),this.emit("beforeTitle"),Rr(Z,P),this.emit("beforeUnits"),Nr(Z,P),this.emit("beforeNeedle"),Vr(Z,P),p.elementClone.initialized=!0}p.context.drawImage(p.elementClone,S,x,D,O)}this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(de){oe.verifyError(de)}return this}},{key:"value",set:function(p){p=Ai.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),fm(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",p,this)},get:function(){return Bo(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})(Ai);n!==void 0&&(n.RadialGauge=vm),Ai.initialize("RadialGauge",jr);var Yr=Object.assign({},qo,{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}),ym=(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),sn(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],O=y[3],P=this.options;if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,O),this.emit("beforePlate"),this.drawBox=im(V,P,S,x,D,O),this.emit("beforeBar"),am.apply(void 0,[V,P].concat(o(this.drawBox))),p.contextClone.barDimensions=V.barDimensions,this.emit("beforeHighlights"),rm(V,P),this.emit("beforeMinorTicks"),lm(V,P),this.emit("beforeMajorTicks"),sm(V,P),this.emit("beforeNumbers"),dm(V,P),this.emit("beforeTitle"),cm(V,P),this.emit("beforeUnits"),mm(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,O),p.context.drawImage(p.elementClone,S,x,D,O),this.emit("beforeProgressBar"),om.apply(void 0,[p.context,P].concat(o(this.drawBox))),this.emit("beforeNeedle"),um(p.context,P),this.emit("beforeValueBox"),gm.apply(void 0,[p.context,P,P.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),Bo(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=Br("right",p),p.hasRight=Br("left",p),p.value>p.maxValue&&(p.value=p.maxValue),p.value<p.minValue&&(p.value=p.minValue),Ai.configure(p)}}]),l})(Ai);n!==void 0&&(n.LinearGauge=ym),Ai.initialize("LinearGauge",Yr),typeof Eo<"u"&&Object.assign(n,{Collection:s,GenericOptions:qo,Animation:Uo,BaseGauge:Ai,drawings:oe,SmartCanvas:si,DomObserver:wn,vendorize:a})})(typeof Eo<"u"?Eo.exports:window)});var Ei=(()=>{class n{appSettings=A(Zt);data=A(Ci);_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 Xr(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=>xn(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 qt(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||qi.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=Kr([a]),s=i.pipe(ds(a.length));return ts(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=pt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var kl=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new Ia(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=pt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Tl=(()=>{class n{sanitizer=A(Za);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Fa({name:"safe",type:n,pure:!0})}return n})();var Sm={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function go(n){let o=Be(Be({},Sm),n);return`(() => {
|
|
1
|
+
import{A as wl,B as Jo,C as er,D as tr,E as ir,F as jn,G as Ca,H as xl,I as _l,J as Yn,K as Ji,L as Et,M as Qn,N as $n,O as Zn,P as ho,Q as po,R as Ml,S as Xn,T as Kn,a as Gt,b as ni,c as oo,d as vl,e as yl,f as Cl,g as Sl,h as Ye,i as Zi,j as Xi,k as ro,l as pn,m as va,n as ui,o as Ki,p as zt,q as so,r as lo,s as Hn,t as gn,u as co,v as mo,w as hi,x as Ko,y as uo,z as ya}from"./chunk-QVCMARCU.js";import{a as Al,b as ao}from"./chunk-RYHOAWDD.js";import{a as ii,b as $i,c as ot}from"./chunk-PKKBBIJK.js";import{a as dl,b as cl,c as ml,d as zn,e as ul,f as Tt,g as hl,h as pl,i as gl,k as fl,m as Aa,n as bl}from"./chunk-HIADZ4BV.js";import{a as wt,b as Lt}from"./chunk-VJ4U7HHN.js";import{a as sl,b as ll}from"./chunk-OQULS6SV.js";import{A as bt,B as ti,a as ge,c as Ws,d as Ci,e as Zs,f as Xs,g as Ks,h as Si,i as wi,k as Js,l as xi,m as _i,n as Mi,o as zi,p as Kt,r as ut,s as Yi,t as ol,u as Qi,w as rl,y as ht,z as ei}from"./chunk-QLTN6G6E.js";import{A as Bn,B as ki,C as Ti,D as kt,E as nl,F as al,G as Hi,H as Un,I as ji,J as mt,L as qn,M as gt,N as ft,a as qi,d as qt,e as Nn,f as ws,i as xs,j as _s,k as $a,l as Ms,m as Zt,n as Gn,o as ct,q as _t,s as at,t as Mt,u as el,v as tl,w as no,x as il,y as Jt,z as Fn}from"./chunk-XDPHEQEO.js";import{b as Gs,f as Fs,g as Bs,h as zs,i as Xo,j as Hs,m as js,n as Ys,o as Qs,s as $s}from"./chunk-SZ2GUIT5.js";import{$ as cs,$b as Bt,Ab as Ct,Ad as Zo,Ba as La,Bb as St,Bc as za,Bd as Ka,C as ha,Ca as pa,Cc as Ha,Cd as Vs,D as xn,Db as te,Dd as Ja,E as Vi,Eb as me,Ec as Ss,F as Wi,Fa as g,Fb as It,Fd as Ot,Ga as ps,Gb as re,Gc as ja,Gd as je,Hb as et,Hd as Ke,I as ns,Ia as kn,Ib as Rn,Ic as Ya,J as Li,Ja as di,Jb as Ft,K as Gi,Kb as m,La as Ga,Lb as ne,Ld as mi,M as as,Mb as ve,N as os,Nb as Ui,Nc as tt,Nd as Xt,O as rs,Oa as L,Oc as Qa,P as Ra,Pa as Wt,Pb as cn,Qa as lt,Qb as mn,R as ss,Ra as Fa,Rb as un,S as ls,Sa as ga,Sc as Za,Ta as gs,Td as eo,U as ds,Ua as Bi,Ud as to,V as _n,Va as fs,Vb as ci,Vd as xt,W as Na,Wa as yt,Wd as io,X as Va,Xa as We,Xb as hn,Xc as ks,Xd as dt,Ya as Tn,Yb as ba,Z as Wa,Zd as Ls,_b as At,_d as Je,a as Be,ab as Q,ac as Ua,b as Xe,ba as Mn,bb as G,ca as pt,cb as F,cc as W,d as Cm,da as Vt,db as _e,dc as le,dd as Ts,e as Zr,ea as Yt,eb as En,ec as R,ed as Es,f as nt,fa as ms,fb as ue,fc as bs,fd as Ds,fe as Us,g as Ni,ga as A,gb as he,ge as qs,hb as T,hc as qa,i as jo,ia as us,ib as d,ic as Ze,j as Nt,ja as q,jb as u,jc as v,ka as z,kb as U,kc as ie,kd as Xa,l as Ia,la as X,lb as M,m as Xr,ma as Ve,mb as k,mc as As,md as Vn,na as Fi,nb as H,nc as Ut,nd as Ps,oa as hs,ob as Dn,od as Is,p as Kr,pa as st,pb as Pn,pc as qe,pd as Wn,q as Yo,qb as Ba,qc as $o,r as Jr,ra as w,rb as ae,sb as Pi,sd as Os,t as Oa,tb as B,u as Qo,ua as Qt,ub as fa,v as es,vb as I,vd as Rs,w as vi,wa as Ie,wb as In,wc as vs,wd as yi,xb as On,xc as ys,xd as Ln,y as ts,yb as dn,yc as Cs,yd as Ns,z as is,zb as $t}from"./chunk-OB3QLUH6.js";var mr=Cm((ox,Eo)=>{(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(Pa===null){var p=window.getComputedStyle(document.documentElement,"");Pa=(Array.prototype.slice.call(p).join("").match(/-(moz|webkit|ms)-/)||p.OLink===""&&["","o"]||["",""])[1]}if(Pa==="")return null;var y=c.charAt(0).toUpperCase()+c.substr(1),S=l[Pa+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 O=c-p,P=O/S,V=0;P>1&&(P=1),P!==1&&(V=y(P),isFinite(V)&&!isNaN(V)&&(P=V)),l&&l(P),O<S?D.frame=Hr(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(Am,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,O=void 0;if(c=parseFloat(c),O=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=(O?"-":"")+D[0]+"."+D[1]}else{for(D=Math.round(c).toString(),x=y-D.length;S<x;++S)D="0"+D;D=(O?"-":"")+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 J(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 Oe(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,O="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=J(l,"Value",V),Oe(c,l,Z,de);var pe=c.measureText(l.valueText?P:"-"+_(Number(O),l)).width;se(c);var Ae=parseFloat(l.fontValueSize)*V+Z+de,Ge=$*parseFloat(l.valueBoxStroke),be=2*x-2*Ge,Re=pe+10*$,Ne=1.1*Ae+Z+de,Fe=$*l.valueBoxBorderRadius,ke=(parseFloat(l.valueBoxWidth)||0)/100*be;ke>Re&&(Re=ke),Re>be&&(Re=be);var De=y-Re/2,we=S-Ne/2,fe=S-5.75*$;if(c.beginPath(),Fe?C(c,De,we,Re,Ne,Fe):c.rect(De,we,Re,Ne),Ge){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=Ge,c.stroke()}l.colorValueBoxShadow&&(c.shadowBlur=1.2*$,c.shadowColor=l.colorValueBoxShadow),l.colorValueBoxBackground&&(c.fillStyle=l.colorValueBoxBackground,c.fill()),c.closePath(),c.restore(),Oe(c,l,Z,de),c.fillStyle=l.colorValueText,c.textAlign="center",c.textBaseline="alphabetic",c.fillText(P,De+Re/2,S+Ne/2-Ae/3),c.restore()}}function Qe(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,li(c),0,2*ma,!0),p.lineWidth=l,p.strokeStyle=S?oe.linearGradient(p,y,S,c):y,p.stroke(),p.closePath()}function Le(c,l){var p=si.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,Ge,be){return de&&(!be&&l.borderShadowWidth&&(pe.save(),pe.shadowBlur=l.borderShadowWidth,pe.shadowColor=l.colorBorderShadow),Ee(Z,de*y,pe,Ae,Ge),!be&&l.borderShadowWidth&&(be=!0,pe.restore())),be}var y=si.pixelRatio,S=l.borderShadowWidth*y,x=c.max-S-l.borderOuterWidth*y/2,D=x-l.borderOuterWidth*y/2-l.borderMiddleWidth*y/2+.5,O=D-l.borderMiddleWidth*y/2-l.borderInnerWidth*y/2+.5,P=Le(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(O,l.borderInnerWidth,c,l.colorBorderInner,l.colorBorderInnerEnd,$),!$&&l.borderShadowWidth&&(c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),c.beginPath(),c.arc(0,0,li(P),0,2*ma,!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=li(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 O=l.highlights[D];c.lineWidth=p,c.lineCap=l.highlightsLineCap,c.strokeStyle=O.color,c.beginPath(),c.rotate(Ho),c.arc(0,0,y,oe.radians(l.startAngle+(O.from-l.minValue)/x),oe.radians(l.startAngle+(O.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,O=Math.abs(l.minorTicks)||0,P=l.ticksAngle/(l.maxValue-l.minValue);l.exactTicks?(S=l.maxValue-l.minValue,y=O?S/O:0,D=(Ai.mod(l.majorTicks[0],O)||0)*P):y=O*(l.majorTicks.length-1),c.lineWidth=si.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),rn(c));c.restore()}function it(c,l){var p=c.max/100;return Le(c,l)-5*p-(l.barWidth?2*(parseFloat(l.barStrokeWidth)||0)+((parseFloat(l.barWidth)||0)+5)*p:0)}function rt(c,l){oe.prepareTicks(l);var p=li(it(c,l)),y=void 0,S=l.majorTicks.length,x=si.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(Ho),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 rn(c){c.stroke(),c.restore(),c.closePath(),c.save()}function Ta(c,l){var p=it(c,l)-.15*c.max,y={},S=0,x=l.majorTicks.length,D=l.animationTarget!=="needle",O=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=O[S],c.fillText(l.majorTicks[S],pe.x,pe.y))}D&&c.restore()}function Rr(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 Nr(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 Vr(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=Le(c,l),D=li(x/100*l.needleCircleSize),O=li(x/100*l.needleCircleSize*.75),P=li(x/100*l.needleEnd),V=li(l.needleStart?x/100*l.needleStart:0),$=x/100*l.needleWidth,Z=x/100*l.needleWidth/2,de=si.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*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleOuter,l.colorNeedleCircleOuterEnd,D),c.fill(),c.closePath()),l.needleCircleInner&&(c.beginPath(),c.arc(0,0,O,0,2*ma,!0),c.fillStyle=oe.linearGradient(c,l.colorNeedleCircleInner,l.colorNeedleCircleInnerEnd,O),c.fill(),c.closePath()),c.restore())}}function Wr(c,l,p){oe.drawValueBox(c,l,p,0,c.max-.33*c.max,c.max)}function Jc(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 Lr(c,l){var p=c.max/100,y=Le(c,l)-5*p,S=parseFloat(l.barStrokeWidth+"")||0,x=(parseFloat(l.barWidth+"")||0)*p,D=y-2*S-x,O=(y-D)/2,P=D+O,V=S/P,$=l.startAngle,Z=l.startAngle+l.ticksAngle;if(c.save(),c.rotate(Ho),S&&(c.beginPath(),c.arc(0,0,P,oe.radians($)-V,oe.radians(Z)+V,!1),c.strokeStyle=l.colorBarStroke,c.lineWidth=2*O,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=Jc(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 Gr(c){return c.options.animatedValue?c.options.value:c.value}function em(c,l,p,y,S,x,D,O){c.beginPath(),c.fillStyle=O?oe.linearGradient(c,D,O,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 tm(c,l,p,y,S,x,D,O,P){c.beginPath(),c.lineWidth=l,c.strokeStyle=P?oe.linearGradient(c,O,P,D,!0,S):O,p>0?oe.roundRect(c,y,S,x,D,p):c.rect(y,S,x,D),c.stroke(),c.closePath()}function im(c,l,p,y,S,x){function D(Pe,Ue,$e,Rt){return Pe&&(!Rt&&l.borderShadowWidth&&(c.save(),c.shadowBlur=l.borderShadowWidth,c.shadowColor=l.colorBorderShadow),tm(c,Pe*O,P,p+Pe*O/2-fe,y+Pe*O/2-fe,V,pe,Ue,$e),fe+=.5*O,!Rt&&l.borderShadowWidth&&(Rt=!0,c.restore())),Rt}var O=si.pixelRatio,P=l.borderRadius*O,V=S-l.borderShadowWidth-l.borderOuterWidth*O,$=V-l.borderOuterWidth*O-l.borderMiddleWidth*O,Z=$-l.borderMiddleWidth*O-l.borderInnerWidth*O,de=Z-l.borderInnerWidth*O,pe=x-l.borderShadowWidth-l.borderOuterWidth*O,Ae=pe-l.borderOuterWidth*O-l.borderMiddleWidth*O,Ge=Ae-l.borderMiddleWidth*O-l.borderInnerWidth*O,be=Ge-l.borderInnerWidth*O,Re=p-($-V)/2,Ne=Re-(Z-$)/2,Fe=Ne-(de-Z)/2,ke=y-(Ae-pe)/2,De=ke-(Ge-Ae)/2,we=De-(be-Ge)/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),em(c,P,Fe,we,de+2*fe,be+2*fe,l.colorPlate,l.colorPlateEnd),c.restore(),[Fe,we,de,be]}function nm(c,l,p,y,S,x){var D=si.pixelRatio,O=x>=S,P=O?.85*S:x,V=O?x:S;p=O?Se(p+(S-P)/2):p;var $=!!l.title,Z=!!l.units,de=!!l.valueBox,pe=void 0,Ae=void 0,Ge=void 0;O?(Ae=Se(.05*V),pe=Se(.075*V),Ge=Se(.11*V),$&&(V-=pe,y+=pe),Z&&(V-=Ae),de&&(V-=Ge)):(Ae=pe=Se(.15*P),$&&(P-=pe,y+=pe),Z&&(P-=Ae));var be=2*l.barStrokeWidth,Re=l.barBeginCircle?Se(P*l.barBeginCircle/200-be/2):0,Ne=Se(P*l.barWidth/100-be),Fe=Se(V*l.barLength/100-be),ke=Se((V-Fe)/2),De=Se(p+(O?P/2:ke+Re)),we=Se(y+(O?V-ke-Re+be/2:P/2)),fe=!O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P,ye=O||l.hasLeft&&l.hasRight?0:(l.hasRight?-1:1)*l.ticksWidth/100*P;return c.barDimensions={isVertical:O,width:P,length:V,barWidth:Ne,barLength:Fe,strokeWidth:be,barMargin:ke,radius:Re,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 Fr(c,l,p,y,S,x,D){var O=nm(c,l,y,S,x,D),P=O.isVertical,V=O.width,$=O.barWidth,Z=O.barLength,de=O.strokeWidth,pe=O.barMargin,Ae=O.radius,Ge=O.x0,be=O.y0,Re=O.X,Ne=O.Y,Fe=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=Ge+(P?Ae*ye:Ae*fe-de/2),Ue=P?be-Ae*fe:be+Ae*ye,$e=li(P?Ue-be:Pe-Ge);ke=Se($e+Ae);var Rt=P?Se(Ge-Ae*ye):Pe,jt=P?Ue:Se(be-Ae*ye);p==="progress"&&(Z=ke+(Z-ke)*(oe.normalizedValue(l).normal-l.minValue)/(l.maxValue-l.minValue));var ua=Se(Pe+Z-ke+de/2),ln=Se(Ue-Z+ke-de/2);c.arc(Ge,be,Ae,De+we,De-we),P?(c.moveTo(Pe,jt),c.lineTo(Pe,ln),c.lineTo(Rt,ln),c.lineTo(Rt,jt)):(c.moveTo(Pe,jt),c.lineTo(ua,jt),c.lineTo(ua,Ue),c.lineTo(Pe,Ue))}else{var Qr=Se(P?Re+(V-$)/2:Re+pe),$r=Se(P?Ne+Z+pe:Ne+(V-$)/2);p==="progress"&&(Z*=(l.value-l.minValue)/(l.maxValue-l.minValue)),P?c.rect(Qr,$r,$,-Z):c.rect(Qr,$r,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?Ne:Re):l.colorBar,c.fill()):p==="progress"&&l.colorBarProgress&&(c.fillStyle=l.colorBarProgressEnd?oe.linearGradient(c,l.colorBarProgress,l.colorBarProgressEnd,Fe,P,P?Ne:Re):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 am(c,l,p,y,S,x){Fr(c,l,"",p,y,S,x)}function Br(c,l){return l.needleSide!==c||l.tickSide!==c||l.numberSide!==c}function om(c,l,p,y,S,x){l.barProgress&&Fr(c,l,"progress",p,y,S,x)}function rm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,O=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",Ge=l.tickSide!=="left",be=0,Re=l.highlights.length,Ne=(S-D)/2,Fe=l.maxValue-l.minValue,ke=Se(y?V+Ne:V+P+O),De=pe,we=y?$+x-P-O:$+Ne,fe=Se((l.ticksWidth/100+de)*S)+(pe-l.ticksWidth/100*S),ye=Se(D+de*S);for(c.save();be<Re;be++){var Pe=l.highlights[be],Ue=Z*li(l.minValue-Pe.from)/Fe,$e=Z*li((Pe.to-Pe.from)/Fe);c.beginPath(),c.fillStyle=Pe.color,y?(Ae&&c.rect(ke-fe,we-Ue,De,-$e),Ge&&c.rect(ke+ye,we-Ue,De,-$e)):(Ae&&c.rect(ke+Ue,we-fe,$e,De),Ge&&c.rect(ke+Ue,we+ye,$e,De)),c.fill(),c.closePath()}c.restore()}}function Ea(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function Ur(c,l,p,y,S,x,D,O,P){var V=c.barDimensions,$=V.isVertical,Z=V.length,de=V.barWidth,pe=V.barOffset,Ae=V.barMargin,Ge=V.pixelRatio,be=V.width,Re=V.X,Ne=V.Y,Fe=V.ticksLength,ke=V.ticksPadding,De=(be-de)/2,we=void 0,fe=void 0,ye=0,Pe=p.length,Ue=void 0,$e=P*be,Rt=De-ke*be,jt=De+de+$e+ke*be,ua=l instanceof Array?l:new Array(p.length).fill(l);c.save(),c.lineWidth=O*Ge;for(var ln=Fe/(S-y);ye<Pe;ye++)Ue=p[ye],c.strokeStyle=ua[ye],$?(fe=Ne+Z-Ae-pe+(y-Ue)*ln,x&&(we=Re+Rt,Ea(c,we,fe,Se(we-$e),fe)),D&&(we=Re+jt,Ea(c,we,fe,Se(we-$e),fe))):(we=Re+Ae+pe-(y-Ue)*ln,x&&(fe=Ne+Rt,Ea(c,we,fe,we,Se(fe-$e))),D&&(fe=Ne+jt,Ea(c,we,Se(fe),we,fe-$e)));c.restore()}function sm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],D=2,O=(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(Ur(c,P,l.exactTicks?l.majorTicks:l.majorTicks.map(function($e,Rt){return l.minValue+O*Rt}),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,Ge=V.barOffset,be=V.X,Re=V.Y,Ne=V.ticksLength,Fe=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*=Fe,$?(ye=Re+Z-Ae-Ge+D/2,Ue=ye-Ne-D,S&&(Pe=fe=Se(be+we),Da(c,fe,ye,Pe,Ue)),x&&(Pe=fe=Se(be+De),Da(c,fe,ye,Pe,Ue))):(fe=be+Ae+Ge-D/2,Pe=fe+Ne+D,S&&(Ue=ye=Se(Re+we),Da(c,fe,ye,Pe,Ue)),x&&(Ue=ye=Se(Re+De),Da(c,fe,ye,Pe,Ue)))}}function Da(c,l,p,y,S){c.beginPath(),c.moveTo(l,p),c.lineTo(y,S),c.stroke(),c.closePath()}function lm(c,l){var p=oe.prepareTicks(l),y=zr(p,2),S=y[0],x=y[1],D=[],O=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 $=Ai.mod(l.majorTicks[0],P)||0;O<l.maxValue;O+=P)$+O<l.maxValue&&D.push($+O);else for(;O<l.maxValue;O+=V)D.push(O);Ur(c,l.colorMinorTicks||l.colorStrokeTicks,D,l.minValue,l.maxValue,S,x,1,l.ticksWidthMinor/100)}function dm(c,l){var p=c.barDimensions,y=p.isVertical,S=p.length,x=p.width,D=p.barWidth,O=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),Ge=l.exactTicks?l.majorTicks:l.majorTicks.map(function(ua,ln){return l.minValue+Ae*ln}),be=Ge.length,Re=l.numberSide!=="right",Ne=l.numberSide!=="left",Fe=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,$e=void 0,Rt=l.colorNumbers instanceof Array?l.colorNumbers:new Array(be).fill(l.colorNumbers),jt=l.numbersMargin/100*x;for(c.font=oe.font(l,"Numbers",x/200),c.lineWidth=0,c.textAlign="center";ke<be;ke++)c.fillStyle=Rt[ke],$e=l.majorTicks[ke],Ue=l.exactTicks?Z*((Ge[ke]-l.minValue)/pe):ke*Z/(be-1),y?(Pe=$+S-O-P-Ue+Fe/3,Re&&(c.textAlign="right",c.fillText($e,V+we-jt,Pe)),Ne&&(c.textAlign="left",c.fillText($e,V+fe+jt,Pe))):(c.measureText($e).width,ye=V+O+P+Ue,Re&&c.fillText($e,ye,$+we-jt),Ne&&c.fillText($e,ye,$+fe+Fe+jt))}function cm(c,l){if(l.title){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,O=p.baseY,P=p.titleMargin,V=l.fontTitleSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(O+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 mm(c,l){if(l.units){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.baseX,O=p.baseY,P=p.unitsMargin,V=l.fontUnitsSize*S/200,$=Se(D+(y?S:x)/2),Z=Se(O+(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 um(c,l){if(l.needle){var p=c.barDimensions,y=p.isVertical,S=p.width,x=p.length,D=p.barWidth,O=p.barOffset,P=p.barMargin,V=p.ticksLength,$=p.X,Z=p.Y,de=p.ticksPadding,pe=l.needleSide!=="right",Ae=l.needleSide!=="left",Ge=V*(oe.normalizedValue(l).indented-l.minValue)/(l.maxValue-l.minValue),be=(l.ticksWidth/100+de)*S,Re=D/2+be,Ne=Re*(l.needleEnd/100),Fe=void 0,ke=void 0,De=void 0,we=void 0,fe=l.needleType.toLowerCase()==="arrow"?pm:hm,ye=(S-D)/2,Pe=Re*(l.needleStart/100),Ue=ye-be-Pe,$e=ye+D+be+Pe;c.save(),oe.drawNeedleShadow(c,l),y?(De=Se(Z+x-P-O-Ge),pe&&(Fe=Se($+Ue),ke=Fe+Ne,fe(c,l,Fe,De,ke,De,Ne)),Ae&&(Fe=Se($+$e),ke=Fe-Ne,fe(c,l,Fe,De,ke,De,Ne,!0))):(Fe=Se($+P+O+Ge),pe&&(De=Se(Z+Ue),we=De+Ne,fe(c,l,Fe,De,Fe,we,Ne)),Ae&&(De=Se(Z+$e),we=De-Ne,fe(c,l,Fe,De,Fe,we,Ne,!0))),c.restore()}}function qr(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 hm(c,l,p,y,S,x,D,O){c.lineWidth=l.needleWidth,c.strokeStyle=qr(c,l,D,O),c.beginPath(),c.moveTo(p,y),c.lineTo(S,x),c.stroke(),c.closePath()}function pm(c,l,p,y,S,x,D,O){var P=Se(.4*D),V=D-P,$=p===S,Z=l.needleWidth/2;c.fillStyle=qr(c,l,D,O),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 gm(c,l,p,y,S,x,D){var O=(parseFloat(l.fontValueSize)||0)*x/200,P=(.11*D-O)/2;c.barDimensions.isVertical&&oe.drawValueBox(c,l,p,y+x/2,S+D-O-P,x)}var zr=(function(){function c(l,p){var y=[],S=!0,x=!1,D=void 0;try{for(var O,P=l[Symbol.iterator]();!(S=(O=P.next()).done)&&(y.push(O.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")}})(),Bo=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)},fm=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 O=x.set;O!==void 0&&O.call(S,y)}return y},sn=(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}})(),Pa=null,bm=(function(){function c(){i(this,c),this._events={},this.addListener=this.on,this.removeListener=this.off}return sn(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,O=this;x<D;x++)(function(){var P=y[x],V=function $(){O.off(l,$),P.apply(O,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})(),Hr=a("requestAnimationFrame")||function(c){return setTimeout(function(){return c(new Date().getTime())},1e3/60)},da={linear:function(c){return c},quad:function(c){return Math.pow(c,2)},dequad:function(c){return 1-da.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-da.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-da.delastic(1-c)},delastic:function(c){return Math.pow(2,10*(c-1))*Math.cos(20*Math.PI*1.5/3*c)}},Uo=(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 sn(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=Hr(function(x){return r(x,l,S,da[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})();Uo.rules=da;var wn=(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 sn(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),O=c.parse(l.getAttribute(D));O!=null&&(S[y]=O)}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,Ge){return Ge?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})(),si=(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 sn(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})();si.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(si.redraw);var qo={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 zo="2.2.1",Se=Math.round,li=Math.abs,ca=new s;ca.version=zo;var Ai=(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(ca.push(y),p.listeners&&Object.keys(p.listeners).forEach(function(D){(p.listeners[D]instanceof Array?p.listeners[D]:[p.listeners[D]]).forEach(function(O){y.on(D,O)})}),y.version=zo,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 si(x,p.width,p.height),y.canvas.onRedraw=y.draw.bind(y),y.animation=new Uo(p.animationRule,p.animationDuration),y}return t(l,c),sn(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=ca.indexOf(this);~p&&ca.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 wn(y,"canvas",p)}},{key:"fromElement",value:function(p){var y=wn.toCamelCase(p.getAttribute("data-type")),S=p.attributes,x=0,D=S.length,O={};if(y){for(/Gauge$/.test(y)||(y+="Gauge");x<D;x++)O[wn.toCamelCase(S[x].name.replace(/^data-/,""),!1)]=wn.parse(S[x].value);new wn(O,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 zo}}]),l})(bm);n!==void 0&&(n.BaseGauge=Ai,n.gauges=(window.document||{}).gauges=ca);var Am=/{([_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:J,normalizedValue:Qe,formatContext:f},ma=Math.PI,Ho=ma/2,jr=Object.assign({},qo,{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"}),vm=(function(c){function l(p){return i(this,l),p=Object.assign({},jr,p||{}),e(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l.configure(p)))}return t(l,c),sn(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],O=y[3],P=this.options;if(P.animationTarget==="needle"){if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,O),this.emit("beforePlate"),Me(V,P),this.emit("beforeHighlights"),ze(V,P),this.emit("beforeMinorTicks"),He(V,P),this.emit("beforeMajorTicks"),rt(V,P),this.emit("beforeNumbers"),Ta(V,P),this.emit("beforeTitle"),Rr(V,P),this.emit("beforeUnits"),Nr(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,O),p.context.drawImage(p.elementClone,S,x,D,O),this.emit("beforeProgressBar"),Lr(p.context,P),this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),this.emit("beforeNeedle"),Vr(p.context,P)}else{var $=-oe.radians((P.value-P.minValue)/(P.maxValue-P.minValue)*P.ticksAngle);if(p.context.clearRect(S,x,D,O),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"),rt(p.context,P),this.emit("beforeNumbers"),Ta(p.context,P),this.emit("beforeProgressBar"),Lr(p.context,P),p.context.rotate(-$),!p.elementClone.initialized){var Z=p.contextClone;Z.clearRect(S,x,D,O),this.emit("beforeTitle"),Rr(Z,P),this.emit("beforeUnits"),Nr(Z,P),this.emit("beforeNeedle"),Vr(Z,P),p.elementClone.initialized=!0}p.context.drawImage(p.elementClone,S,x,D,O)}this.emit("beforeValueBox"),Wr(p.context,P,Gr(this)),Bo(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"draw",this).call(this)}catch(de){oe.verifyError(de)}return this}},{key:"value",set:function(p){p=Ai.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),fm(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"value",p,this)},get:function(){return Bo(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})(Ai);n!==void 0&&(n.RadialGauge=vm),Ai.initialize("RadialGauge",jr);var Yr=Object.assign({},qo,{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}),ym=(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),sn(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],O=y[3],P=this.options;if(!p.elementClone.initialized){var V=p.contextClone;V.clearRect(S,x,D,O),this.emit("beforePlate"),this.drawBox=im(V,P,S,x,D,O),this.emit("beforeBar"),am.apply(void 0,[V,P].concat(o(this.drawBox))),p.contextClone.barDimensions=V.barDimensions,this.emit("beforeHighlights"),rm(V,P),this.emit("beforeMinorTicks"),lm(V,P),this.emit("beforeMajorTicks"),sm(V,P),this.emit("beforeNumbers"),dm(V,P),this.emit("beforeTitle"),cm(V,P),this.emit("beforeUnits"),mm(V,P),p.elementClone.initialized=!0}this.canvas.commit(),p.context.clearRect(S,x,D,O),p.context.drawImage(p.elementClone,S,x,D,O),this.emit("beforeProgressBar"),om.apply(void 0,[p.context,P].concat(o(this.drawBox))),this.emit("beforeNeedle"),um(p.context,P),this.emit("beforeValueBox"),gm.apply(void 0,[p.context,P,P.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),Bo(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=Br("right",p),p.hasRight=Br("left",p),p.value>p.maxValue&&(p.value=p.maxValue),p.value<p.minValue&&(p.value=p.minValue),Ai.configure(p)}}]),l})(Ai);n!==void 0&&(n.LinearGauge=ym),Ai.initialize("LinearGauge",Yr),typeof Eo<"u"&&Object.assign(n,{Collection:s,GenericOptions:qo,Animation:Uo,BaseGauge:Ai,drawings:oe,SmartCanvas:si,DomObserver:wn,vendorize:a})})(typeof Eo<"u"?Eo.exports:window)});var Ei=(()=>{class n{appSettings=A(Zt);data=A(Ci);_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 Xr(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=>xn(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 qt(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||qi.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=Kr([a]),s=i.pipe(ds(a.length));return ts(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=pt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var kl=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new Ia(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=pt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Tl=(()=>{class n{sanitizer=A(Za);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Fa({name:"safe",type:n,pure:!0})}return n})();var Sm={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function go(n){let o=Be(Be({},Sm),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;
|
package/public/index.html
CHANGED
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
</div>
|
|
63
63
|
</app-root>
|
|
64
64
|
</div>
|
|
65
|
-
<link rel="modulepreload" href="chunk-
|
|
65
|
+
<link rel="modulepreload" href="chunk-WADRUSMB.js"><link rel="modulepreload" href="chunk-YIXYV2MV.js"><link rel="modulepreload" href="chunk-F5X5MWHG.js"><link rel="modulepreload" href="chunk-QVCMARCU.js"><link rel="modulepreload" href="chunk-52M2PJJL.js"><link rel="modulepreload" href="chunk-IJ22WXFB.js"><link rel="modulepreload" href="chunk-RYHOAWDD.js"><link rel="modulepreload" href="chunk-BMDGKBYM.js"><link rel="modulepreload" href="chunk-AB255PKD.js"><link rel="modulepreload" href="chunk-PKKBBIJK.js"><script src="polyfills-HMJGV7SQ.js" type="module"></script><script src="scripts-7HSGK5LZ.js" defer></script><script src="main-HG5TDMOB.js" type="module"></script></body>
|
|
66
66
|
</html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k,b as ne,c as Vi,d as hn,e as Ee,f as Et,g as Ye,h as vn}from"./chunk-BISZS3TE.js";import{a as Ei,b as Nt,e as tr,h as nr,j as ir,k as xt,m as rr,n as or,o as Ot}from"./chunk-ROD2YZ6L.js";import"./chunk-F5X5MWHG.js";import"./chunk-QVCMARCU.js";import{a as pr,b as hr,c as _r,d as gr,e as yr,f as vr}from"./chunk-52M2PJJL.js";import{a as ur}from"./chunk-IJ22WXFB.js";import{c as ar,f as sr,g as lr,h as cr}from"./chunk-RYHOAWDD.js";import{b as br,g as Sr}from"./chunk-BMDGKBYM.js";import{a as dr,b as fr,c as mr}from"./chunk-AB255PKD.js";import{c as er}from"./chunk-PKKBBIJK.js";import"./chunk-HIADZ4BV.js";import{a as Re,b as Ct}from"./chunk-DADLXEYG.js";import{a as Ji}from"./chunk-OQULS6SV.js";import{a as ke,b as Le,c as Be,d as Ve,j as Yi,x as Zi}from"./chunk-QLTN6G6E.js";import{a as pn,b as Ci,c as Mi,e as We,h as De,i as wt,k as ge,l as At,m as de}from"./chunk-XDPHEQEO.js";import{a as Ze,b as Ui,c as ji,f as gn,j as Qi,k as Pt,n as Gi,o as Wi,p as Xi,s as yn}from"./chunk-SZ2GUIT5.js";import{Ab as ln,Bb as cn,Db as yt,Eb as vt,F as dt,Fa as x,Fb as vi,Fc as ki,Ga as mi,Gd as Fe,Ha as pi,Hb as bt,Hd as ve,Jc as Pi,Kb as M,Kc as Ni,Lb as je,Lc as xi,Ld as Mt,Ma as hi,Mb as Qe,Nc as Xe,Nd as _n,O as oi,Oa as J,Oc as te,Pb as un,Pc as Oi,Qa as pt,Qb as dn,Qc as Ii,Rb as fn,Rc as Di,Sa as _i,Tc as Tt,Ua as gi,V as ai,Vc as Ri,Vd as qi,Wc as ye,X as si,Xa as ht,Xd as Ke,Ya as an,Yc as Fi,Yd as $i,Zc as Li,_a as yi,_b as bi,_c as Bi,_d as pe,a as X,aa as N,ab as _t,ac as Si,b as ei,bb as $,c as ti,ca as H,cb as U,d as Vo,db as gt,dc as wi,e as ni,ea as rn,ec as Ge,f as nn,fa as ft,fb as Oe,fd as Ki,ga as y,gb as Ie,ha as li,hb as ue,ib as b,j as Ae,ja as I,jb as T,jc as Ai,ka as D,kb as ee,kc as St,l as ut,mc as mn,na as Te,nc as Ti,oa as mt,pa as ci,pd as kt,q as ii,ra as ui,rb as K,tb as F,ud as zi,va as di,vb as L,w as xe,wa as fi,wd as Hi,x as ri,za as on,zb as sn}from"./chunk-OB3QLUH6.js";var bn=Vo(Dt=>{(function(){"use strict";var o=function(){this.init()};o.prototype={init:function(){var i=this||t;return i._counter=1e3,i._html5AudioPool=[],i.html5PoolSize=10,i._codecs={},i._howls=[],i._muted=!1,i._volume=1,i._canPlayEvent="canplaythrough",i._navigator=typeof window<"u"&&window.navigator?window.navigator:null,i.masterGain=null,i.noAudio=!1,i.usingWebAudio=!0,i.autoSuspend=!0,i.ctx=null,i.autoUnlock=!0,i._setup(),i},volume:function(i){var a=this||t;if(i=parseFloat(i),a.ctx||_(),typeof i<"u"&&i>=0&&i<=1){if(a._volume=i,a._muted)return a;a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.volume=h._volume*i)}return a}return a._volume},mute:function(i){var a=this||t;a.ctx||_(),a._muted=i,a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i?0:a._volume,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.muted=i?!0:h._muted)}return a},stop:function(){for(var i=this||t,a=0;a<i._howls.length;a++)i._howls[a].stop();return i},unload:function(){for(var i=this||t,a=i._howls.length-1;a>=0;a--)i._howls[a].unload();return i.usingWebAudio&&i.ctx&&typeof i.ctx.close<"u"&&(i.ctx.close(),i.ctx=null,_()),i},codecs:function(i){return(this||t)._codecs[i.replace(/^x-/,"")]},_setup:function(){var i=this||t;if(i.state=i.ctx&&i.ctx.state||"suspended",i._autoSuspend(),!i.usingWebAudio)if(typeof Audio<"u")try{var a=new Audio;typeof a.oncanplaythrough>"u"&&(i._canPlayEvent="canplay")}catch{i.noAudio=!0}else i.noAudio=!0;try{var a=new Audio;a.muted&&(i.noAudio=!0)}catch{}return i.noAudio||i._setupCodecs(),i},_setupCodecs:function(){var i=this||t,a=null;try{a=typeof Audio<"u"?new Audio:null}catch{return i}if(!a||typeof a.canPlayType!="function")return i;var c=a.canPlayType("audio/mpeg;").replace(/^no$/,""),f=i._navigator?i._navigator.userAgent:"",m=f.match(/OPR\/(\d+)/g),h=m&&parseInt(m[0].split("/")[1],10)<33,p=f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1,g=f.match(/Version\/(.*?) /),w=p&&g&&parseInt(g[1],10)<15;return i._codecs={mp3:!!(!h&&(c||a.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!c,opus:!!a.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(a.canPlayType('audio/wav; codecs="1"')||a.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!a.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!a.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(a.canPlayType("audio/x-m4b;")||a.canPlayType("audio/m4b;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(a.canPlayType("audio/x-mp4;")||a.canPlayType("audio/mp4;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!a.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(a.canPlayType("audio/x-flac;")||a.canPlayType("audio/flac;")).replace(/^no$/,"")},i},_unlockAudio:function(){var i=this||t;if(!(i._audioUnlocked||!i.ctx)){i._audioUnlocked=!1,i.autoUnlock=!1,!i._mobileUnloaded&&i.ctx.sampleRate!==44100&&(i._mobileUnloaded=!0,i.unload()),i._scratchBuffer=i.ctx.createBuffer(1,1,22050);var a=function(c){for(;i._html5AudioPool.length<i.html5PoolSize;)try{var f=new Audio;f._unlocked=!0,i._releaseHtml5Audio(f)}catch{i.noAudio=!0;break}for(var m=0;m<i._howls.length;m++)if(!i._howls[m]._webAudio)for(var h=i._howls[m]._getSoundIds(),p=0;p<h.length;p++){var g=i._howls[m]._soundById(h[p]);g&&g._node&&!g._node._unlocked&&(g._node._unlocked=!0,g._node.load())}i._autoResume();var w=i.ctx.createBufferSource();w.buffer=i._scratchBuffer,w.connect(i.ctx.destination),typeof w.start>"u"?w.noteOn(0):w.start(0),typeof i.ctx.resume=="function"&&i.ctx.resume(),w.onended=function(){w.disconnect(0),i._audioUnlocked=!0,document.removeEventListener("touchstart",a,!0),document.removeEventListener("touchend",a,!0),document.removeEventListener("click",a,!0),document.removeEventListener("keydown",a,!0);for(var C=0;C<i._howls.length;C++)i._howls[C]._emit("unlock")}};return document.addEventListener("touchstart",a,!0),document.addEventListener("touchend",a,!0),document.addEventListener("click",a,!0),document.addEventListener("keydown",a,!0),i}},_obtainHtml5Audio:function(){var i=this||t;if(i._html5AudioPool.length)return i._html5AudioPool.pop();var a=new Audio().play();return a&&typeof Promise<"u"&&(a instanceof Promise||typeof a.then=="function")&&a.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(i){var a=this||t;return i._unlocked&&a._html5AudioPool.push(i),a},_autoSuspend:function(){var i=this;if(!(!i.autoSuspend||!i.ctx||typeof i.ctx.suspend>"u"||!t.usingWebAudio)){for(var a=0;a<i._howls.length;a++)if(i._howls[a]._webAudio){for(var c=0;c<i._howls[a]._sounds.length;c++)if(!i._howls[a]._sounds[c]._paused)return i}return i._suspendTimer&&clearTimeout(i._suspendTimer),i._suspendTimer=setTimeout(function(){if(i.autoSuspend){i._suspendTimer=null,i.state="suspending";var f=function(){i.state="suspended",i._resumeAfterSuspend&&(delete i._resumeAfterSuspend,i._autoResume())};i.ctx.suspend().then(f,f)}},3e4),i}},_autoResume:function(){var i=this;if(!(!i.ctx||typeof i.ctx.resume>"u"||!t.usingWebAudio))return i.state==="running"&&i.ctx.state!=="interrupted"&&i._suspendTimer?(clearTimeout(i._suspendTimer),i._suspendTimer=null):i.state==="suspended"||i.state==="running"&&i.ctx.state==="interrupted"?(i.ctx.resume().then(function(){i.state="running";for(var a=0;a<i._howls.length;a++)i._howls[a]._emit("resume")}),i._suspendTimer&&(clearTimeout(i._suspendTimer),i._suspendTimer=null)):i.state==="suspending"&&(i._resumeAfterSuspend=!0),i}};var t=new o,e=function(i){var a=this;if(!i.src||i.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}a.init(i)};e.prototype={init:function(i){var a=this;return t.ctx||_(),a._autoplay=i.autoplay||!1,a._format=typeof i.format!="string"?i.format:[i.format],a._html5=i.html5||!1,a._muted=i.mute||!1,a._loop=i.loop||!1,a._pool=i.pool||5,a._preload=typeof i.preload=="boolean"||i.preload==="metadata"?i.preload:!0,a._rate=i.rate||1,a._sprite=i.sprite||{},a._src=typeof i.src!="string"?i.src:[i.src],a._volume=i.volume!==void 0?i.volume:1,a._xhr={method:i.xhr&&i.xhr.method?i.xhr.method:"GET",headers:i.xhr&&i.xhr.headers?i.xhr.headers:null,withCredentials:i.xhr&&i.xhr.withCredentials?i.xhr.withCredentials:!1},a._duration=0,a._state="unloaded",a._sounds=[],a._endTimers={},a._queue=[],a._playLock=!1,a._onend=i.onend?[{fn:i.onend}]:[],a._onfade=i.onfade?[{fn:i.onfade}]:[],a._onload=i.onload?[{fn:i.onload}]:[],a._onloaderror=i.onloaderror?[{fn:i.onloaderror}]:[],a._onplayerror=i.onplayerror?[{fn:i.onplayerror}]:[],a._onpause=i.onpause?[{fn:i.onpause}]:[],a._onplay=i.onplay?[{fn:i.onplay}]:[],a._onstop=i.onstop?[{fn:i.onstop}]:[],a._onmute=i.onmute?[{fn:i.onmute}]:[],a._onvolume=i.onvolume?[{fn:i.onvolume}]:[],a._onrate=i.onrate?[{fn:i.onrate}]:[],a._onseek=i.onseek?[{fn:i.onseek}]:[],a._onunlock=i.onunlock?[{fn:i.onunlock}]:[],a._onresume=[],a._webAudio=t.usingWebAudio&&!a._html5,typeof t.ctx<"u"&&t.ctx&&t.autoUnlock&&t._unlockAudio(),t._howls.push(a),a._autoplay&&a._queue.push({event:"play",action:function(){a.play()}}),a._preload&&a._preload!=="none"&&a.load(),a},load:function(){var i=this,a=null;if(t.noAudio){i._emit("loaderror",null,"No audio support.");return}typeof i._src=="string"&&(i._src=[i._src]);for(var c=0;c<i._src.length;c++){var f,m;if(i._format&&i._format[c])f=i._format[c];else{if(m=i._src[c],typeof m!="string"){i._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}f=/^data:audio\/([^;,]+);/i.exec(m),f||(f=/\.([^.]+)$/.exec(m.split("?",1)[0])),f&&(f=f[1].toLowerCase())}if(f||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),f&&t.codecs(f)){a=i._src[c];break}}if(!a){i._emit("loaderror",null,"No codec support for selected audio sources.");return}return i._src=a,i._state="loading",window.location.protocol==="https:"&&a.slice(0,5)==="http:"&&(i._html5=!0,i._webAudio=!1),new n(i),i._webAudio&&s(i),i},play:function(i,a){var c=this,f=null;if(typeof i=="number")f=i,i=null;else{if(typeof i=="string"&&c._state==="loaded"&&!c._sprite[i])return null;if(typeof i>"u"&&(i="__default",!c._playLock)){for(var m=0,h=0;h<c._sounds.length;h++)c._sounds[h]._paused&&!c._sounds[h]._ended&&(m++,f=c._sounds[h]._id);m===1?i=null:f=null}}var p=f?c._soundById(f):c._inactiveSound();if(!p)return null;if(f&&!i&&(i=p._sprite||"__default"),c._state!=="loaded"){p._sprite=i,p._ended=!1;var g=p._id;return c._queue.push({event:"play",action:function(){c.play(g)}}),g}if(f&&!p._paused)return a||c._loadQueue("play"),p._id;c._webAudio&&t._autoResume();var w=Math.max(0,p._seek>0?p._seek:c._sprite[i][0]/1e3),C=Math.max(0,(c._sprite[i][0]+c._sprite[i][1])/1e3-w),O=C*1e3/Math.abs(p._rate),G=c._sprite[i][0]/1e3,q=(c._sprite[i][0]+c._sprite[i][1])/1e3;p._sprite=i,p._ended=!1;var B=function(){p._paused=!1,p._seek=w,p._start=G,p._stop=q,p._loop=!!(p._loop||c._sprite[i][2])};if(w>=q){c._ended(p);return}var E=p._node;if(c._webAudio){var ae=function(){c._playLock=!1,B(),c._refreshBuffer(p);var le=p._muted||c._muted?0:p._volume;E.gain.setValueAtTime(le,t.ctx.currentTime),p._playStart=t.ctx.currentTime,typeof E.bufferSource.start>"u"?p._loop?E.bufferSource.noteGrainOn(0,w,86400):E.bufferSource.noteGrainOn(0,w,C):p._loop?E.bufferSource.start(0,w,86400):E.bufferSource.start(0,w,C),O!==1/0&&(c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O)),a||setTimeout(function(){c._emit("play",p._id),c._loadQueue()},0)};t.state==="running"&&t.ctx.state!=="interrupted"?ae():(c._playLock=!0,c.once("resume",ae),c._clearTimer(p._id))}else{var me=function(){E.currentTime=w,E.muted=p._muted||c._muted||t._muted||E.muted,E.volume=p._volume*t.volume(),E.playbackRate=p._rate;try{var le=E.play();if(le&&typeof Promise<"u"&&(le instanceof Promise||typeof le.then=="function")?(c._playLock=!0,B(),le.then(function(){c._playLock=!1,E._unlocked=!0,a?c._loadQueue():c._emit("play",p._id)}).catch(function(){c._playLock=!1,c._emit("playerror",p._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),p._ended=!0,p._paused=!0})):a||(c._playLock=!1,B(),c._emit("play",p._id)),E.playbackRate=p._rate,E.paused){c._emit("playerror",p._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}i!=="__default"||p._loop?c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O):(c._endTimers[p._id]=function(){c._ended(p),E.removeEventListener("ended",c._endTimers[p._id],!1)},E.addEventListener("ended",c._endTimers[p._id],!1))}catch(lt){c._emit("playerror",p._id,lt)}};E.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(E.src=c._src,E.load());var st=window&&window.ejecta||!E.readyState&&t._navigator.isCocoonJS;if(E.readyState>=3||st)me();else{c._playLock=!0,c._state="loading";var se=function(){c._state="loaded",me(),E.removeEventListener(t._canPlayEvent,se,!1)};E.addEventListener(t._canPlayEvent,se,!1),c._clearTimer(p._id)}}return p._id},pause:function(i){var a=this;if(a._state!=="loaded"||a._playLock)return a._queue.push({event:"pause",action:function(){a.pause(i)}}),a;for(var c=a._getSoundIds(i),f=0;f<c.length;f++){a._clearTimer(c[f]);var m=a._soundById(c[f]);if(m&&!m._paused&&(m._seek=a.seek(c[f]),m._rateSeek=0,m._paused=!0,a._stopFade(c[f]),m._node))if(a._webAudio){if(!m._node.bufferSource)continue;typeof m._node.bufferSource.stop>"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),a._cleanBuffer(m._node)}else(!isNaN(m._node.duration)||m._node.duration===1/0)&&m._node.pause();arguments[1]||a._emit("pause",m?m._id:null)}return a},stop:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"stop",action:function(){c.stop(i)}}),c;for(var f=c._getSoundIds(i),m=0;m<f.length;m++){c._clearTimer(f[m]);var h=c._soundById(f[m]);h&&(h._seek=h._start||0,h._rateSeek=0,h._paused=!0,h._ended=!0,c._stopFade(f[m]),h._node&&(c._webAudio?h._node.bufferSource&&(typeof h._node.bufferSource.stop>"u"?h._node.bufferSource.noteOff(0):h._node.bufferSource.stop(0),c._cleanBuffer(h._node)):(!isNaN(h._node.duration)||h._node.duration===1/0)&&(h._node.currentTime=h._start||0,h._node.pause(),h._node.duration===1/0&&c._clearSound(h._node))),a||c._emit("stop",h._id))}return c},mute:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"mute",action:function(){c.mute(i,a)}}),c;if(typeof a>"u")if(typeof i=="boolean")c._muted=i;else return c._muted;for(var f=c._getSoundIds(a),m=0;m<f.length;m++){var h=c._soundById(f[m]);h&&(h._muted=i,h._interval&&c._stopFade(h._id),c._webAudio&&h._node?h._node.gain.setValueAtTime(i?0:h._volume,t.ctx.currentTime):h._node&&(h._node.muted=t._muted?!0:i),c._emit("mute",h._id))}return c},volume:function(){var i=this,a=arguments,c,f;if(a.length===0)return i._volume;if(a.length===1||a.length===2&&typeof a[1]>"u"){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length>=2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c<"u"&&c>=0&&c<=1){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"volume",action:function(){i.volume.apply(i,a)}}),i;typeof f>"u"&&(i._volume=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)p=i._soundById(f[g]),p&&(p._volume=c,a[2]||i._stopFade(f[g]),i._webAudio&&p._node&&!p._muted?p._node.gain.setValueAtTime(c,t.ctx.currentTime):p._node&&!p._muted&&(p._node.volume=c*t.volume()),i._emit("volume",p._id))}else return p=f?i._soundById(f):i._sounds[0],p?p._volume:0;return i},fade:function(i,a,c,f){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"fade",action:function(){m.fade(i,a,c,f)}}),m;i=Math.min(Math.max(0,parseFloat(i)),1),a=Math.min(Math.max(0,parseFloat(a)),1),c=parseFloat(c),m.volume(i,f);for(var h=m._getSoundIds(f),p=0;p<h.length;p++){var g=m._soundById(h[p]);if(g){if(f||m._stopFade(h[p]),m._webAudio&&!g._muted){var w=t.ctx.currentTime,C=w+c/1e3;g._volume=i,g._node.gain.setValueAtTime(i,w),g._node.gain.linearRampToValueAtTime(a,C)}m._startFadeInterval(g,i,a,c,h[p],typeof f>"u")}}return m},_startFadeInterval:function(i,a,c,f,m,h){var p=this,g=a,w=c-a,C=Math.abs(w/.01),O=Math.max(4,C>0?f/C:f),G=Date.now();i._fadeTo=c,i._interval=setInterval(function(){var q=(Date.now()-G)/f;G=Date.now(),g+=w*q,g=Math.round(g*100)/100,w<0?g=Math.max(c,g):g=Math.min(c,g),p._webAudio?i._volume=g:p.volume(g,i._id,!0),h&&(p._volume=g),(c<a&&g<=c||c>a&&g>=c)&&(clearInterval(i._interval),i._interval=null,i._fadeTo=null,p.volume(c,i._id),p._emit("fade",i._id))},O)},_stopFade:function(i){var a=this,c=a._soundById(i);return c&&c._interval&&(a._webAudio&&c._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(c._interval),c._interval=null,a.volume(c._fadeTo,i),c._fadeTo=null,a._emit("fade",i)),a},loop:function(){var i=this,a=arguments,c,f,m;if(a.length===0)return i._loop;if(a.length===1)if(typeof a[0]=="boolean")c=a[0],i._loop=c;else return m=i._soundById(parseInt(a[0],10)),m?m._loop:!1;else a.length===2&&(c=a[0],f=parseInt(a[1],10));for(var h=i._getSoundIds(f),p=0;p<h.length;p++)m=i._soundById(h[p]),m&&(m._loop=c,i._webAudio&&m._node&&m._node.bufferSource&&(m._node.bufferSource.loop=c,c&&(m._node.bufferSource.loopStart=m._start||0,m._node.bufferSource.loopEnd=m._stop,i.playing(h[p])&&(i.pause(h[p],!0),i.play(h[p],!0)))));return i},rate:function(){var i=this,a=arguments,c,f;if(a.length===0)f=i._sounds[0]._id;else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c=="number"){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"rate",action:function(){i.rate.apply(i,a)}}),i;typeof f>"u"&&(i._rate=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)if(p=i._soundById(f[g]),p){i.playing(f[g])&&(p._rateSeek=i.seek(f[g]),p._playStart=i._webAudio?t.ctx.currentTime:p._playStart),p._rate=c,i._webAudio&&p._node&&p._node.bufferSource?p._node.bufferSource.playbackRate.setValueAtTime(c,t.ctx.currentTime):p._node&&(p._node.playbackRate=c);var w=i.seek(f[g]),C=(i._sprite[p._sprite][0]+i._sprite[p._sprite][1])/1e3-w,O=C*1e3/Math.abs(p._rate);(i._endTimers[f[g]]||!p._paused)&&(i._clearTimer(f[g]),i._endTimers[f[g]]=setTimeout(i._ended.bind(i,p),O)),i._emit("rate",p._id)}}else return p=i._soundById(f),p?p._rate:i._rate;return i},seek:function(){var i=this,a=arguments,c,f;if(a.length===0)i._sounds.length&&(f=i._sounds[0]._id);else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):i._sounds.length&&(f=i._sounds[0]._id,c=parseFloat(a[0]))}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));if(typeof f>"u")return 0;if(typeof c=="number"&&(i._state!=="loaded"||i._playLock))return i._queue.push({event:"seek",action:function(){i.seek.apply(i,a)}}),i;var p=i._soundById(f);if(p)if(typeof c=="number"&&c>=0){var g=i.playing(f);g&&i.pause(f,!0),p._seek=c,p._ended=!1,i._clearTimer(f),!i._webAudio&&p._node&&!isNaN(p._node.duration)&&(p._node.currentTime=c);var w=function(){g&&i.play(f,!0),i._emit("seek",f)};if(g&&!i._webAudio){var C=function(){i._playLock?setTimeout(C,0):w()};setTimeout(C,0)}else w()}else if(i._webAudio){var O=i.playing(f)?t.ctx.currentTime-p._playStart:0,G=p._rateSeek?p._rateSeek-p._seek:0;return p._seek+(G+O*Math.abs(p._rate))}else return p._node.currentTime;return i},playing:function(i){var a=this;if(typeof i=="number"){var c=a._soundById(i);return c?!c._paused:!1}for(var f=0;f<a._sounds.length;f++)if(!a._sounds[f]._paused)return!0;return!1},duration:function(i){var a=this,c=a._duration,f=a._soundById(i);return f&&(c=a._sprite[f._sprite][1]/1e3),c},state:function(){return this._state},unload:function(){for(var i=this,a=i._sounds,c=0;c<a.length;c++)a[c]._paused||i.stop(a[c]._id),i._webAudio||(i._clearSound(a[c]._node),a[c]._node.removeEventListener("error",a[c]._errorFn,!1),a[c]._node.removeEventListener(t._canPlayEvent,a[c]._loadFn,!1),a[c]._node.removeEventListener("ended",a[c]._endFn,!1),t._releaseHtml5Audio(a[c]._node)),delete a[c]._node,i._clearTimer(a[c]._id);var f=t._howls.indexOf(i);f>=0&&t._howls.splice(f,1);var m=!0;for(c=0;c<t._howls.length;c++)if(t._howls[c]._src===i._src||i._src.indexOf(t._howls[c]._src)>=0){m=!1;break}return r&&m&&delete r[i._src],t.noAudio=!1,i._state="unloaded",i._sounds=[],i=null,null},on:function(i,a,c,f){var m=this,h=m["_on"+i];return typeof a=="function"&&h.push(f?{id:c,fn:a,once:f}:{id:c,fn:a}),m},off:function(i,a,c){var f=this,m=f["_on"+i],h=0;if(typeof a=="number"&&(c=a,a=null),a||c)for(h=0;h<m.length;h++){var p=c===m[h].id;if(a===m[h].fn&&p||!a&&p){m.splice(h,1);break}}else if(i)f["_on"+i]=[];else{var g=Object.keys(f);for(h=0;h<g.length;h++)g[h].indexOf("_on")===0&&Array.isArray(f[g[h]])&&(f[g[h]]=[])}return f},once:function(i,a,c){var f=this;return f.on(i,a,c,1),f},_emit:function(i,a,c){for(var f=this,m=f["_on"+i],h=m.length-1;h>=0;h--)(!m[h].id||m[h].id===a||i==="load")&&(setTimeout((function(p){p.call(this,a,c)}).bind(f,m[h].fn),0),m[h].once&&f.off(i,m[h].fn,m[h].id));return f._loadQueue(i),f},_loadQueue:function(i){var a=this;if(a._queue.length>0){var c=a._queue[0];c.event===i&&(a._queue.shift(),a._loadQueue()),i||c.action()}return a},_ended:function(i){var a=this,c=i._sprite;if(!a._webAudio&&i._node&&!i._node.paused&&!i._node.ended&&i._node.currentTime<i._stop)return setTimeout(a._ended.bind(a,i),100),a;var f=!!(i._loop||a._sprite[c][2]);if(a._emit("end",i._id),!a._webAudio&&f&&a.stop(i._id,!0).play(i._id),a._webAudio&&f){a._emit("play",i._id),i._seek=i._start||0,i._rateSeek=0,i._playStart=t.ctx.currentTime;var m=(i._stop-i._start)*1e3/Math.abs(i._rate);a._endTimers[i._id]=setTimeout(a._ended.bind(a,i),m)}return a._webAudio&&!f&&(i._paused=!0,i._ended=!0,i._seek=i._start||0,i._rateSeek=0,a._clearTimer(i._id),a._cleanBuffer(i._node),t._autoSuspend()),!a._webAudio&&!f&&a.stop(i._id,!0),a},_clearTimer:function(i){var a=this;if(a._endTimers[i]){if(typeof a._endTimers[i]!="function")clearTimeout(a._endTimers[i]);else{var c=a._soundById(i);c&&c._node&&c._node.removeEventListener("ended",a._endTimers[i],!1)}delete a._endTimers[i]}return a},_soundById:function(i){for(var a=this,c=0;c<a._sounds.length;c++)if(i===a._sounds[c]._id)return a._sounds[c];return null},_inactiveSound:function(){var i=this;i._drain();for(var a=0;a<i._sounds.length;a++)if(i._sounds[a]._ended)return i._sounds[a].reset();return new n(i)},_drain:function(){var i=this,a=i._pool,c=0,f=0;if(!(i._sounds.length<a)){for(f=0;f<i._sounds.length;f++)i._sounds[f]._ended&&c++;for(f=i._sounds.length-1;f>=0;f--){if(c<=a)return;i._sounds[f]._ended&&(i._webAudio&&i._sounds[f]._node&&i._sounds[f]._node.disconnect(0),i._sounds.splice(f,1),c--)}}},_getSoundIds:function(i){var a=this;if(typeof i>"u"){for(var c=[],f=0;f<a._sounds.length;f++)c.push(a._sounds[f]._id);return c}else return[i]},_refreshBuffer:function(i){var a=this;return i._node.bufferSource=t.ctx.createBufferSource(),i._node.bufferSource.buffer=r[a._src],i._panner?i._node.bufferSource.connect(i._panner):i._node.bufferSource.connect(i._node),i._node.bufferSource.loop=i._loop,i._loop&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop||0),i._node.bufferSource.playbackRate.setValueAtTime(i._rate,t.ctx.currentTime),a},_cleanBuffer:function(i){var a=this,c=t._navigator&&t._navigator.vendor.indexOf("Apple")>=0;if(!i.bufferSource)return a;if(t._scratchBuffer&&i.bufferSource&&(i.bufferSource.onended=null,i.bufferSource.disconnect(0),c))try{i.bufferSource.buffer=t._scratchBuffer}catch{}return i.bufferSource=null,a},_clearSound:function(i){var a=/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent);a||(i.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(i){this._parent=i,this.init()};n.prototype={init:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,a._sounds.push(i),i.create(),i},create:function(){var i=this,a=i._parent,c=t._muted||i._muted||i._parent._muted?0:i._volume;return a._webAudio?(i._node=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),i._node.gain.setValueAtTime(c,t.ctx.currentTime),i._node.paused=!0,i._node.connect(t.masterGain)):t.noAudio||(i._node=t._obtainHtml5Audio(),i._errorFn=i._errorListener.bind(i),i._node.addEventListener("error",i._errorFn,!1),i._loadFn=i._loadListener.bind(i),i._node.addEventListener(t._canPlayEvent,i._loadFn,!1),i._endFn=i._endListener.bind(i),i._node.addEventListener("ended",i._endFn,!1),i._node.src=a._src,i._node.preload=a._preload===!0?"auto":a._preload,i._node.volume=c*t.volume(),i._node.load()),i},reset:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._rateSeek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,i},_errorListener:function(){var i=this;i._parent._emit("loaderror",i._id,i._node.error?i._node.error.code:0),i._node.removeEventListener("error",i._errorFn,!1)},_loadListener:function(){var i=this,a=i._parent;a._duration=Math.ceil(i._node.duration*10)/10,Object.keys(a._sprite).length===0&&(a._sprite={__default:[0,a._duration*1e3]}),a._state!=="loaded"&&(a._state="loaded",a._emit("load"),a._loadQueue()),i._node.removeEventListener(t._canPlayEvent,i._loadFn,!1)},_endListener:function(){var i=this,a=i._parent;a._duration===1/0&&(a._duration=Math.ceil(i._node.duration*10)/10,a._sprite.__default[1]===1/0&&(a._sprite.__default[1]=a._duration*1e3),a._ended(i)),i._node.removeEventListener("ended",i._endFn,!1)}};var r={},s=function(i){var a=i._src;if(r[a]){i._duration=r[a].duration,d(i);return}if(/^data:[^;]+;base64,/.test(a)){for(var c=atob(a.split(",")[1]),f=new Uint8Array(c.length),m=0;m<c.length;++m)f[m]=c.charCodeAt(m);u(f.buffer,i)}else{var h=new XMLHttpRequest;h.open(i._xhr.method,a,!0),h.withCredentials=i._xhr.withCredentials,h.responseType="arraybuffer",i._xhr.headers&&Object.keys(i._xhr.headers).forEach(function(p){h.setRequestHeader(p,i._xhr.headers[p])}),h.onload=function(){var p=(h.status+"")[0];if(p!=="0"&&p!=="2"&&p!=="3"){i._emit("loaderror",null,"Failed loading audio file with status: "+h.status+".");return}u(h.response,i)},h.onerror=function(){i._webAudio&&(i._html5=!0,i._webAudio=!1,i._sounds=[],delete r[a],i.load())},l(h)}},l=function(i){try{i.send()}catch{i.onerror()}},u=function(i,a){var c=function(){a._emit("loaderror",null,"Decoding audio data failed.")},f=function(m){m&&a._sounds.length>0?(r[a._src]=m,d(a,m)):c()};typeof Promise<"u"&&t.ctx.decodeAudioData.length===1?t.ctx.decodeAudioData(i).then(f).catch(c):t.ctx.decodeAudioData(i,f,c)},d=function(i,a){a&&!i._duration&&(i._duration=a.duration),Object.keys(i._sprite).length===0&&(i._sprite={__default:[0,i._duration*1e3]}),i._state!=="loaded"&&(i._state="loaded",i._emit("load"),i._loadQueue())},_=function(){if(t.usingWebAudio){try{typeof AudioContext<"u"?t.ctx=new AudioContext:typeof webkitAudioContext<"u"?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch{t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var i=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),a=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),c=a?parseInt(a[1],10):null;if(i&&c&&c<9){var f=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!f&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:t,Howl:e}}),typeof Dt<"u"&&(Dt.Howler=t,Dt.Howl=e),typeof global<"u"?(global.HowlerGlobal=o,global.Howler=t,global.Howl=e,global.Sound=n):typeof window<"u"&&(window.HowlerGlobal=o,window.Howler=t,window.Howl=e,window.Sound=n)})();(function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var n=e._howls.length-1;n>=0;n--)e._howls[n].stereo(t);return e},HowlerGlobal.prototype.pos=function(t,e,n){var r=this;if(!r.ctx||!r.ctx.listener)return r;if(e=typeof e!="number"?r._pos[1]:e,n=typeof n!="number"?r._pos[2]:n,typeof t=="number")r._pos=[t,e,n],typeof r.ctx.listener.positionX<"u"?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]);else return r._pos;return r},HowlerGlobal.prototype.orientation=function(t,e,n,r,s,l){var u=this;if(!u.ctx||!u.ctx.listener)return u;var d=u._orientation;if(e=typeof e!="number"?d[1]:e,n=typeof n!="number"?d[2]:n,r=typeof r!="number"?d[3]:r,s=typeof s!="number"?d[4]:s,l=typeof l!="number"?d[5]:l,typeof t=="number")u._orientation=[t,e,n,r,s,l],typeof u.ctx.listener.forwardX<"u"?(u.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),u.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),u.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),u.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),u.ctx.listener.upY.setTargetAtTime(s,Howler.ctx.currentTime,.1),u.ctx.listener.upZ.setTargetAtTime(l,Howler.ctx.currentTime,.1)):u.ctx.listener.setOrientation(t,e,n,r,s,l);else return d;return u},Howl.prototype.init=(function(t){return function(e){var n=this;return n._orientation=e.orientation||[1,0,0],n._stereo=e.stereo||null,n._pos=e.pos||null,n._pannerAttr={coneInnerAngle:typeof e.coneInnerAngle<"u"?e.coneInnerAngle:360,coneOuterAngle:typeof e.coneOuterAngle<"u"?e.coneOuterAngle:360,coneOuterGain:typeof e.coneOuterGain<"u"?e.coneOuterGain:0,distanceModel:typeof e.distanceModel<"u"?e.distanceModel:"inverse",maxDistance:typeof e.maxDistance<"u"?e.maxDistance:1e4,panningModel:typeof e.panningModel<"u"?e.panningModel:"HRTF",refDistance:typeof e.refDistance<"u"?e.refDistance:1,rolloffFactor:typeof e.rolloffFactor<"u"?e.rolloffFactor:1},n._onstereo=e.onstereo?[{fn:e.onstereo}]:[],n._onpos=e.onpos?[{fn:e.onpos}]:[],n._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}})(Howl.prototype.init),Howl.prototype.stereo=function(t,e){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(t,e)}}),n;var r=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof t=="number")n._stereo=t,n._pos=[t,0,0];else return n._stereo;for(var s=n._getSoundIds(e),l=0;l<s.length;l++){var u=n._soundById(s[l]);if(u)if(typeof t=="number")u._stereo=t,u._pos=[t,0,0],u._node&&(u._pannerAttr.panningModel="equalpower",(!u._panner||!u._panner.pan)&&o(u,r),r==="spatial"?typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):u._panner.setPosition(t,0,0):u._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",u._id);else return u._stereo}return n},Howl.prototype.pos=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"pos",action:function(){s.pos(t,e,n,r)}}),s;if(e=typeof e!="number"?0:e,n=typeof n!="number"?-.5:n,typeof r>"u")if(typeof t=="number")s._pos=[t,e,n];else return s._pos;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._pos=[t,e,n],d._node&&((!d._panner||d._panner.pan)&&o(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setPosition(t,e,n)),s._emit("pos",d._id);else return d._pos}return s},Howl.prototype.orientation=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"orientation",action:function(){s.orientation(t,e,n,r)}}),s;if(e=typeof e!="number"?s._orientation[1]:e,n=typeof n!="number"?s._orientation[2]:n,typeof r>"u")if(typeof t=="number")s._orientation=[t,e,n];else return s._orientation;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._orientation=[t,e,n],d._node&&(d._panner||(d._pos||(d._pos=s._pos||[0,0,-.5]),o(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setOrientation(t,e,n)),s._emit("orientation",d._id);else return d._orientation}return s},Howl.prototype.pannerAttr=function(){var t=this,e=arguments,n,r,s;if(!t._webAudio)return t;if(e.length===0)return t._pannerAttr;if(e.length===1)if(typeof e[0]=="object")n=e[0],typeof r>"u"&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),t._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:t._panningModel});else return s=t._soundById(parseInt(e[0],10)),s?s._pannerAttr:t._pannerAttr;else e.length===2&&(n=e[0],r=parseInt(e[1],10));for(var l=t._getSoundIds(r),u=0;u<l.length;u++)if(s=t._soundById(l[u]),s){var d=s._pannerAttr;d={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:d.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:d.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:d.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:d.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:d.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:d.panningModel};var _=s._panner;_||(s._pos||(s._pos=t._pos||[0,0,-.5]),o(s,"spatial"),_=s._panner),_.coneInnerAngle=d.coneInnerAngle,_.coneOuterAngle=d.coneOuterAngle,_.coneOuterGain=d.coneOuterGain,_.distanceModel=d.distanceModel,_.maxDistance=d.maxDistance,_.refDistance=d.refDistance,_.rolloffFactor=d.rolloffFactor,_.panningModel=d.panningModel}return t},Sound.prototype.init=(function(t){return function(){var e=this,n=e._parent;e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,t.call(this),e._stereo?n.stereo(e._stereo):e._pos&&n.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}})(Sound.prototype.init),Sound.prototype.reset=(function(t){return function(){var e=this,n=e._parent;return e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,e._stereo?n.stereo(e._stereo):e._pos?n.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,n._refreshBuffer(e)),t.call(this)}})(Sound.prototype.reset);var o=function(t,e){e=e||"spatial",e==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()});var It=(o,t)=>{let e=y(de),n=y(ye),r=e.getSplitShellEnabled(),s="/"+t.map(d=>d.path).join("/"),l=s.startsWith("/chartplotter"),u=s.startsWith("/dashboard");if(r&&u&&!l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["chartplotter",d??""])}if(!r&&l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["dashboard",d??""])}return!0};var wr=[{path:"dashboard/:id",component:vn,canMatch:[It]},{path:"chartplotter/:id",loadComponent:()=>import("./chunk-4NJ3ZL5U.js").then(o=>o.SplitShellComponent),canMatch:[It]},{path:"settings",loadComponent:()=>import("./chunk-JCVEDDSQ.js").then(o=>o.SettingsComponent),title:"KIP - Settings"},{path:"options",loadComponent:()=>import("./chunk-35577QTX.js").then(o=>o.TabsComponent),title:"KIP - Options"},{path:"remote",loadComponent:()=>import("./chunk-NDOR4O4J.js").then(o=>o.RemoteControlComponent),title:"KIP - Remote Control"},{path:"help",loadComponent:()=>import("./chunk-TIWUK3AU.js").then(o=>o.AppHelpComponent),title:"KIP - Help"},{path:"data",loadComponent:()=>import("./chunk-2DBQEP6W.js").then(o=>o.DataInspectorComponent),title:"KIP - Data Inspector"},{path:"login",loadComponent:()=>import("./chunk-KZW5Z46K.js").then(o=>o.WidgetLoginComponent),title:"Login"},{path:"**",component:vn,canMatch:[It]}];var Ar={production:!0};var Ir=ni(bn());function Ho(o,t){if(o&1){let e=K();b(0,"div",1)(1,"button",2),F("click",function(){I(e);let r=L();return D(r.action())}),M(2),T()()}if(o&2){let e=L();x(2),Qe(" ",e.data.action," ")}}var qo=["label"];function $o(o,t){}var Uo=Math.pow(2,31)-1,Je=class{_overlayRef;instance;containerInstance;_afterDismissed=new Ae;_afterOpened=new Ae;_onAction=new Ae;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,Uo))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Tr=new rn("MatSnackBarData"),ze=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Qo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Go=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),Wo=(()=>{class o{snackBarRef=y(Je);data=y(Tr);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(n,r){n&1&&(b(0,"div",0),M(1),T(),$(2,Ho,3,1,"div",1)),n&2&&(x(),Qe(" ",r.data.message,`
|
|
1
|
+
import{a as k,b as ne,c as Vi,d as hn,e as Ee,f as Et,g as Ye,h as vn}from"./chunk-WADRUSMB.js";import{a as Ei,b as Nt,e as tr,h as nr,j as ir,k as xt,m as rr,n as or,o as Ot}from"./chunk-YIXYV2MV.js";import"./chunk-F5X5MWHG.js";import"./chunk-QVCMARCU.js";import{a as pr,b as hr,c as _r,d as gr,e as yr,f as vr}from"./chunk-52M2PJJL.js";import{a as ur}from"./chunk-IJ22WXFB.js";import{c as ar,f as sr,g as lr,h as cr}from"./chunk-RYHOAWDD.js";import{b as br,g as Sr}from"./chunk-BMDGKBYM.js";import{a as dr,b as fr,c as mr}from"./chunk-AB255PKD.js";import{c as er}from"./chunk-PKKBBIJK.js";import"./chunk-HIADZ4BV.js";import{a as Re,b as Ct}from"./chunk-VJ4U7HHN.js";import{a as Ji}from"./chunk-OQULS6SV.js";import{a as ke,b as Le,c as Be,d as Ve,j as Yi,x as Zi}from"./chunk-QLTN6G6E.js";import{a as pn,b as Ci,c as Mi,e as We,h as De,i as wt,k as ge,l as At,m as de}from"./chunk-XDPHEQEO.js";import{a as Ze,b as Ui,c as ji,f as gn,j as Qi,k as Pt,n as Gi,o as Wi,p as Xi,s as yn}from"./chunk-SZ2GUIT5.js";import{Ab as ln,Bb as cn,Db as yt,Eb as vt,F as dt,Fa as x,Fb as vi,Fc as ki,Ga as mi,Gd as Fe,Ha as pi,Hb as bt,Hd as ve,Jc as Pi,Kb as M,Kc as Ni,Lb as je,Lc as xi,Ld as Mt,Ma as hi,Mb as Qe,Nc as Xe,Nd as _n,O as oi,Oa as J,Oc as te,Pb as un,Pc as Oi,Qa as pt,Qb as dn,Qc as Ii,Rb as fn,Rc as Di,Sa as _i,Tc as Tt,Ua as gi,V as ai,Vc as Ri,Vd as qi,Wc as ye,X as si,Xa as ht,Xd as Ke,Ya as an,Yc as Fi,Yd as $i,Zc as Li,_a as yi,_b as bi,_c as Bi,_d as pe,a as X,aa as N,ab as _t,ac as Si,b as ei,bb as $,c as ti,ca as H,cb as U,d as Vo,db as gt,dc as wi,e as ni,ea as rn,ec as Ge,f as nn,fa as ft,fb as Oe,fd as Ki,ga as y,gb as Ie,ha as li,hb as ue,ib as b,j as Ae,ja as I,jb as T,jc as Ai,ka as D,kb as ee,kc as St,l as ut,mc as mn,na as Te,nc as Ti,oa as mt,pa as ci,pd as kt,q as ii,ra as ui,rb as K,tb as F,ud as zi,va as di,vb as L,w as xe,wa as fi,wd as Hi,x as ri,za as on,zb as sn}from"./chunk-OB3QLUH6.js";var bn=Vo(Dt=>{(function(){"use strict";var o=function(){this.init()};o.prototype={init:function(){var i=this||t;return i._counter=1e3,i._html5AudioPool=[],i.html5PoolSize=10,i._codecs={},i._howls=[],i._muted=!1,i._volume=1,i._canPlayEvent="canplaythrough",i._navigator=typeof window<"u"&&window.navigator?window.navigator:null,i.masterGain=null,i.noAudio=!1,i.usingWebAudio=!0,i.autoSuspend=!0,i.ctx=null,i.autoUnlock=!0,i._setup(),i},volume:function(i){var a=this||t;if(i=parseFloat(i),a.ctx||_(),typeof i<"u"&&i>=0&&i<=1){if(a._volume=i,a._muted)return a;a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.volume=h._volume*i)}return a}return a._volume},mute:function(i){var a=this||t;a.ctx||_(),a._muted=i,a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i?0:a._volume,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.muted=i?!0:h._muted)}return a},stop:function(){for(var i=this||t,a=0;a<i._howls.length;a++)i._howls[a].stop();return i},unload:function(){for(var i=this||t,a=i._howls.length-1;a>=0;a--)i._howls[a].unload();return i.usingWebAudio&&i.ctx&&typeof i.ctx.close<"u"&&(i.ctx.close(),i.ctx=null,_()),i},codecs:function(i){return(this||t)._codecs[i.replace(/^x-/,"")]},_setup:function(){var i=this||t;if(i.state=i.ctx&&i.ctx.state||"suspended",i._autoSuspend(),!i.usingWebAudio)if(typeof Audio<"u")try{var a=new Audio;typeof a.oncanplaythrough>"u"&&(i._canPlayEvent="canplay")}catch{i.noAudio=!0}else i.noAudio=!0;try{var a=new Audio;a.muted&&(i.noAudio=!0)}catch{}return i.noAudio||i._setupCodecs(),i},_setupCodecs:function(){var i=this||t,a=null;try{a=typeof Audio<"u"?new Audio:null}catch{return i}if(!a||typeof a.canPlayType!="function")return i;var c=a.canPlayType("audio/mpeg;").replace(/^no$/,""),f=i._navigator?i._navigator.userAgent:"",m=f.match(/OPR\/(\d+)/g),h=m&&parseInt(m[0].split("/")[1],10)<33,p=f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1,g=f.match(/Version\/(.*?) /),w=p&&g&&parseInt(g[1],10)<15;return i._codecs={mp3:!!(!h&&(c||a.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!c,opus:!!a.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(a.canPlayType('audio/wav; codecs="1"')||a.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!a.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!a.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(a.canPlayType("audio/x-m4b;")||a.canPlayType("audio/m4b;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(a.canPlayType("audio/x-mp4;")||a.canPlayType("audio/mp4;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!a.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(a.canPlayType("audio/x-flac;")||a.canPlayType("audio/flac;")).replace(/^no$/,"")},i},_unlockAudio:function(){var i=this||t;if(!(i._audioUnlocked||!i.ctx)){i._audioUnlocked=!1,i.autoUnlock=!1,!i._mobileUnloaded&&i.ctx.sampleRate!==44100&&(i._mobileUnloaded=!0,i.unload()),i._scratchBuffer=i.ctx.createBuffer(1,1,22050);var a=function(c){for(;i._html5AudioPool.length<i.html5PoolSize;)try{var f=new Audio;f._unlocked=!0,i._releaseHtml5Audio(f)}catch{i.noAudio=!0;break}for(var m=0;m<i._howls.length;m++)if(!i._howls[m]._webAudio)for(var h=i._howls[m]._getSoundIds(),p=0;p<h.length;p++){var g=i._howls[m]._soundById(h[p]);g&&g._node&&!g._node._unlocked&&(g._node._unlocked=!0,g._node.load())}i._autoResume();var w=i.ctx.createBufferSource();w.buffer=i._scratchBuffer,w.connect(i.ctx.destination),typeof w.start>"u"?w.noteOn(0):w.start(0),typeof i.ctx.resume=="function"&&i.ctx.resume(),w.onended=function(){w.disconnect(0),i._audioUnlocked=!0,document.removeEventListener("touchstart",a,!0),document.removeEventListener("touchend",a,!0),document.removeEventListener("click",a,!0),document.removeEventListener("keydown",a,!0);for(var C=0;C<i._howls.length;C++)i._howls[C]._emit("unlock")}};return document.addEventListener("touchstart",a,!0),document.addEventListener("touchend",a,!0),document.addEventListener("click",a,!0),document.addEventListener("keydown",a,!0),i}},_obtainHtml5Audio:function(){var i=this||t;if(i._html5AudioPool.length)return i._html5AudioPool.pop();var a=new Audio().play();return a&&typeof Promise<"u"&&(a instanceof Promise||typeof a.then=="function")&&a.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(i){var a=this||t;return i._unlocked&&a._html5AudioPool.push(i),a},_autoSuspend:function(){var i=this;if(!(!i.autoSuspend||!i.ctx||typeof i.ctx.suspend>"u"||!t.usingWebAudio)){for(var a=0;a<i._howls.length;a++)if(i._howls[a]._webAudio){for(var c=0;c<i._howls[a]._sounds.length;c++)if(!i._howls[a]._sounds[c]._paused)return i}return i._suspendTimer&&clearTimeout(i._suspendTimer),i._suspendTimer=setTimeout(function(){if(i.autoSuspend){i._suspendTimer=null,i.state="suspending";var f=function(){i.state="suspended",i._resumeAfterSuspend&&(delete i._resumeAfterSuspend,i._autoResume())};i.ctx.suspend().then(f,f)}},3e4),i}},_autoResume:function(){var i=this;if(!(!i.ctx||typeof i.ctx.resume>"u"||!t.usingWebAudio))return i.state==="running"&&i.ctx.state!=="interrupted"&&i._suspendTimer?(clearTimeout(i._suspendTimer),i._suspendTimer=null):i.state==="suspended"||i.state==="running"&&i.ctx.state==="interrupted"?(i.ctx.resume().then(function(){i.state="running";for(var a=0;a<i._howls.length;a++)i._howls[a]._emit("resume")}),i._suspendTimer&&(clearTimeout(i._suspendTimer),i._suspendTimer=null)):i.state==="suspending"&&(i._resumeAfterSuspend=!0),i}};var t=new o,e=function(i){var a=this;if(!i.src||i.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}a.init(i)};e.prototype={init:function(i){var a=this;return t.ctx||_(),a._autoplay=i.autoplay||!1,a._format=typeof i.format!="string"?i.format:[i.format],a._html5=i.html5||!1,a._muted=i.mute||!1,a._loop=i.loop||!1,a._pool=i.pool||5,a._preload=typeof i.preload=="boolean"||i.preload==="metadata"?i.preload:!0,a._rate=i.rate||1,a._sprite=i.sprite||{},a._src=typeof i.src!="string"?i.src:[i.src],a._volume=i.volume!==void 0?i.volume:1,a._xhr={method:i.xhr&&i.xhr.method?i.xhr.method:"GET",headers:i.xhr&&i.xhr.headers?i.xhr.headers:null,withCredentials:i.xhr&&i.xhr.withCredentials?i.xhr.withCredentials:!1},a._duration=0,a._state="unloaded",a._sounds=[],a._endTimers={},a._queue=[],a._playLock=!1,a._onend=i.onend?[{fn:i.onend}]:[],a._onfade=i.onfade?[{fn:i.onfade}]:[],a._onload=i.onload?[{fn:i.onload}]:[],a._onloaderror=i.onloaderror?[{fn:i.onloaderror}]:[],a._onplayerror=i.onplayerror?[{fn:i.onplayerror}]:[],a._onpause=i.onpause?[{fn:i.onpause}]:[],a._onplay=i.onplay?[{fn:i.onplay}]:[],a._onstop=i.onstop?[{fn:i.onstop}]:[],a._onmute=i.onmute?[{fn:i.onmute}]:[],a._onvolume=i.onvolume?[{fn:i.onvolume}]:[],a._onrate=i.onrate?[{fn:i.onrate}]:[],a._onseek=i.onseek?[{fn:i.onseek}]:[],a._onunlock=i.onunlock?[{fn:i.onunlock}]:[],a._onresume=[],a._webAudio=t.usingWebAudio&&!a._html5,typeof t.ctx<"u"&&t.ctx&&t.autoUnlock&&t._unlockAudio(),t._howls.push(a),a._autoplay&&a._queue.push({event:"play",action:function(){a.play()}}),a._preload&&a._preload!=="none"&&a.load(),a},load:function(){var i=this,a=null;if(t.noAudio){i._emit("loaderror",null,"No audio support.");return}typeof i._src=="string"&&(i._src=[i._src]);for(var c=0;c<i._src.length;c++){var f,m;if(i._format&&i._format[c])f=i._format[c];else{if(m=i._src[c],typeof m!="string"){i._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}f=/^data:audio\/([^;,]+);/i.exec(m),f||(f=/\.([^.]+)$/.exec(m.split("?",1)[0])),f&&(f=f[1].toLowerCase())}if(f||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),f&&t.codecs(f)){a=i._src[c];break}}if(!a){i._emit("loaderror",null,"No codec support for selected audio sources.");return}return i._src=a,i._state="loading",window.location.protocol==="https:"&&a.slice(0,5)==="http:"&&(i._html5=!0,i._webAudio=!1),new n(i),i._webAudio&&s(i),i},play:function(i,a){var c=this,f=null;if(typeof i=="number")f=i,i=null;else{if(typeof i=="string"&&c._state==="loaded"&&!c._sprite[i])return null;if(typeof i>"u"&&(i="__default",!c._playLock)){for(var m=0,h=0;h<c._sounds.length;h++)c._sounds[h]._paused&&!c._sounds[h]._ended&&(m++,f=c._sounds[h]._id);m===1?i=null:f=null}}var p=f?c._soundById(f):c._inactiveSound();if(!p)return null;if(f&&!i&&(i=p._sprite||"__default"),c._state!=="loaded"){p._sprite=i,p._ended=!1;var g=p._id;return c._queue.push({event:"play",action:function(){c.play(g)}}),g}if(f&&!p._paused)return a||c._loadQueue("play"),p._id;c._webAudio&&t._autoResume();var w=Math.max(0,p._seek>0?p._seek:c._sprite[i][0]/1e3),C=Math.max(0,(c._sprite[i][0]+c._sprite[i][1])/1e3-w),O=C*1e3/Math.abs(p._rate),G=c._sprite[i][0]/1e3,q=(c._sprite[i][0]+c._sprite[i][1])/1e3;p._sprite=i,p._ended=!1;var B=function(){p._paused=!1,p._seek=w,p._start=G,p._stop=q,p._loop=!!(p._loop||c._sprite[i][2])};if(w>=q){c._ended(p);return}var E=p._node;if(c._webAudio){var ae=function(){c._playLock=!1,B(),c._refreshBuffer(p);var le=p._muted||c._muted?0:p._volume;E.gain.setValueAtTime(le,t.ctx.currentTime),p._playStart=t.ctx.currentTime,typeof E.bufferSource.start>"u"?p._loop?E.bufferSource.noteGrainOn(0,w,86400):E.bufferSource.noteGrainOn(0,w,C):p._loop?E.bufferSource.start(0,w,86400):E.bufferSource.start(0,w,C),O!==1/0&&(c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O)),a||setTimeout(function(){c._emit("play",p._id),c._loadQueue()},0)};t.state==="running"&&t.ctx.state!=="interrupted"?ae():(c._playLock=!0,c.once("resume",ae),c._clearTimer(p._id))}else{var me=function(){E.currentTime=w,E.muted=p._muted||c._muted||t._muted||E.muted,E.volume=p._volume*t.volume(),E.playbackRate=p._rate;try{var le=E.play();if(le&&typeof Promise<"u"&&(le instanceof Promise||typeof le.then=="function")?(c._playLock=!0,B(),le.then(function(){c._playLock=!1,E._unlocked=!0,a?c._loadQueue():c._emit("play",p._id)}).catch(function(){c._playLock=!1,c._emit("playerror",p._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),p._ended=!0,p._paused=!0})):a||(c._playLock=!1,B(),c._emit("play",p._id)),E.playbackRate=p._rate,E.paused){c._emit("playerror",p._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}i!=="__default"||p._loop?c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O):(c._endTimers[p._id]=function(){c._ended(p),E.removeEventListener("ended",c._endTimers[p._id],!1)},E.addEventListener("ended",c._endTimers[p._id],!1))}catch(lt){c._emit("playerror",p._id,lt)}};E.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(E.src=c._src,E.load());var st=window&&window.ejecta||!E.readyState&&t._navigator.isCocoonJS;if(E.readyState>=3||st)me();else{c._playLock=!0,c._state="loading";var se=function(){c._state="loaded",me(),E.removeEventListener(t._canPlayEvent,se,!1)};E.addEventListener(t._canPlayEvent,se,!1),c._clearTimer(p._id)}}return p._id},pause:function(i){var a=this;if(a._state!=="loaded"||a._playLock)return a._queue.push({event:"pause",action:function(){a.pause(i)}}),a;for(var c=a._getSoundIds(i),f=0;f<c.length;f++){a._clearTimer(c[f]);var m=a._soundById(c[f]);if(m&&!m._paused&&(m._seek=a.seek(c[f]),m._rateSeek=0,m._paused=!0,a._stopFade(c[f]),m._node))if(a._webAudio){if(!m._node.bufferSource)continue;typeof m._node.bufferSource.stop>"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),a._cleanBuffer(m._node)}else(!isNaN(m._node.duration)||m._node.duration===1/0)&&m._node.pause();arguments[1]||a._emit("pause",m?m._id:null)}return a},stop:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"stop",action:function(){c.stop(i)}}),c;for(var f=c._getSoundIds(i),m=0;m<f.length;m++){c._clearTimer(f[m]);var h=c._soundById(f[m]);h&&(h._seek=h._start||0,h._rateSeek=0,h._paused=!0,h._ended=!0,c._stopFade(f[m]),h._node&&(c._webAudio?h._node.bufferSource&&(typeof h._node.bufferSource.stop>"u"?h._node.bufferSource.noteOff(0):h._node.bufferSource.stop(0),c._cleanBuffer(h._node)):(!isNaN(h._node.duration)||h._node.duration===1/0)&&(h._node.currentTime=h._start||0,h._node.pause(),h._node.duration===1/0&&c._clearSound(h._node))),a||c._emit("stop",h._id))}return c},mute:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"mute",action:function(){c.mute(i,a)}}),c;if(typeof a>"u")if(typeof i=="boolean")c._muted=i;else return c._muted;for(var f=c._getSoundIds(a),m=0;m<f.length;m++){var h=c._soundById(f[m]);h&&(h._muted=i,h._interval&&c._stopFade(h._id),c._webAudio&&h._node?h._node.gain.setValueAtTime(i?0:h._volume,t.ctx.currentTime):h._node&&(h._node.muted=t._muted?!0:i),c._emit("mute",h._id))}return c},volume:function(){var i=this,a=arguments,c,f;if(a.length===0)return i._volume;if(a.length===1||a.length===2&&typeof a[1]>"u"){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length>=2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c<"u"&&c>=0&&c<=1){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"volume",action:function(){i.volume.apply(i,a)}}),i;typeof f>"u"&&(i._volume=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)p=i._soundById(f[g]),p&&(p._volume=c,a[2]||i._stopFade(f[g]),i._webAudio&&p._node&&!p._muted?p._node.gain.setValueAtTime(c,t.ctx.currentTime):p._node&&!p._muted&&(p._node.volume=c*t.volume()),i._emit("volume",p._id))}else return p=f?i._soundById(f):i._sounds[0],p?p._volume:0;return i},fade:function(i,a,c,f){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"fade",action:function(){m.fade(i,a,c,f)}}),m;i=Math.min(Math.max(0,parseFloat(i)),1),a=Math.min(Math.max(0,parseFloat(a)),1),c=parseFloat(c),m.volume(i,f);for(var h=m._getSoundIds(f),p=0;p<h.length;p++){var g=m._soundById(h[p]);if(g){if(f||m._stopFade(h[p]),m._webAudio&&!g._muted){var w=t.ctx.currentTime,C=w+c/1e3;g._volume=i,g._node.gain.setValueAtTime(i,w),g._node.gain.linearRampToValueAtTime(a,C)}m._startFadeInterval(g,i,a,c,h[p],typeof f>"u")}}return m},_startFadeInterval:function(i,a,c,f,m,h){var p=this,g=a,w=c-a,C=Math.abs(w/.01),O=Math.max(4,C>0?f/C:f),G=Date.now();i._fadeTo=c,i._interval=setInterval(function(){var q=(Date.now()-G)/f;G=Date.now(),g+=w*q,g=Math.round(g*100)/100,w<0?g=Math.max(c,g):g=Math.min(c,g),p._webAudio?i._volume=g:p.volume(g,i._id,!0),h&&(p._volume=g),(c<a&&g<=c||c>a&&g>=c)&&(clearInterval(i._interval),i._interval=null,i._fadeTo=null,p.volume(c,i._id),p._emit("fade",i._id))},O)},_stopFade:function(i){var a=this,c=a._soundById(i);return c&&c._interval&&(a._webAudio&&c._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(c._interval),c._interval=null,a.volume(c._fadeTo,i),c._fadeTo=null,a._emit("fade",i)),a},loop:function(){var i=this,a=arguments,c,f,m;if(a.length===0)return i._loop;if(a.length===1)if(typeof a[0]=="boolean")c=a[0],i._loop=c;else return m=i._soundById(parseInt(a[0],10)),m?m._loop:!1;else a.length===2&&(c=a[0],f=parseInt(a[1],10));for(var h=i._getSoundIds(f),p=0;p<h.length;p++)m=i._soundById(h[p]),m&&(m._loop=c,i._webAudio&&m._node&&m._node.bufferSource&&(m._node.bufferSource.loop=c,c&&(m._node.bufferSource.loopStart=m._start||0,m._node.bufferSource.loopEnd=m._stop,i.playing(h[p])&&(i.pause(h[p],!0),i.play(h[p],!0)))));return i},rate:function(){var i=this,a=arguments,c,f;if(a.length===0)f=i._sounds[0]._id;else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c=="number"){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"rate",action:function(){i.rate.apply(i,a)}}),i;typeof f>"u"&&(i._rate=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)if(p=i._soundById(f[g]),p){i.playing(f[g])&&(p._rateSeek=i.seek(f[g]),p._playStart=i._webAudio?t.ctx.currentTime:p._playStart),p._rate=c,i._webAudio&&p._node&&p._node.bufferSource?p._node.bufferSource.playbackRate.setValueAtTime(c,t.ctx.currentTime):p._node&&(p._node.playbackRate=c);var w=i.seek(f[g]),C=(i._sprite[p._sprite][0]+i._sprite[p._sprite][1])/1e3-w,O=C*1e3/Math.abs(p._rate);(i._endTimers[f[g]]||!p._paused)&&(i._clearTimer(f[g]),i._endTimers[f[g]]=setTimeout(i._ended.bind(i,p),O)),i._emit("rate",p._id)}}else return p=i._soundById(f),p?p._rate:i._rate;return i},seek:function(){var i=this,a=arguments,c,f;if(a.length===0)i._sounds.length&&(f=i._sounds[0]._id);else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):i._sounds.length&&(f=i._sounds[0]._id,c=parseFloat(a[0]))}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));if(typeof f>"u")return 0;if(typeof c=="number"&&(i._state!=="loaded"||i._playLock))return i._queue.push({event:"seek",action:function(){i.seek.apply(i,a)}}),i;var p=i._soundById(f);if(p)if(typeof c=="number"&&c>=0){var g=i.playing(f);g&&i.pause(f,!0),p._seek=c,p._ended=!1,i._clearTimer(f),!i._webAudio&&p._node&&!isNaN(p._node.duration)&&(p._node.currentTime=c);var w=function(){g&&i.play(f,!0),i._emit("seek",f)};if(g&&!i._webAudio){var C=function(){i._playLock?setTimeout(C,0):w()};setTimeout(C,0)}else w()}else if(i._webAudio){var O=i.playing(f)?t.ctx.currentTime-p._playStart:0,G=p._rateSeek?p._rateSeek-p._seek:0;return p._seek+(G+O*Math.abs(p._rate))}else return p._node.currentTime;return i},playing:function(i){var a=this;if(typeof i=="number"){var c=a._soundById(i);return c?!c._paused:!1}for(var f=0;f<a._sounds.length;f++)if(!a._sounds[f]._paused)return!0;return!1},duration:function(i){var a=this,c=a._duration,f=a._soundById(i);return f&&(c=a._sprite[f._sprite][1]/1e3),c},state:function(){return this._state},unload:function(){for(var i=this,a=i._sounds,c=0;c<a.length;c++)a[c]._paused||i.stop(a[c]._id),i._webAudio||(i._clearSound(a[c]._node),a[c]._node.removeEventListener("error",a[c]._errorFn,!1),a[c]._node.removeEventListener(t._canPlayEvent,a[c]._loadFn,!1),a[c]._node.removeEventListener("ended",a[c]._endFn,!1),t._releaseHtml5Audio(a[c]._node)),delete a[c]._node,i._clearTimer(a[c]._id);var f=t._howls.indexOf(i);f>=0&&t._howls.splice(f,1);var m=!0;for(c=0;c<t._howls.length;c++)if(t._howls[c]._src===i._src||i._src.indexOf(t._howls[c]._src)>=0){m=!1;break}return r&&m&&delete r[i._src],t.noAudio=!1,i._state="unloaded",i._sounds=[],i=null,null},on:function(i,a,c,f){var m=this,h=m["_on"+i];return typeof a=="function"&&h.push(f?{id:c,fn:a,once:f}:{id:c,fn:a}),m},off:function(i,a,c){var f=this,m=f["_on"+i],h=0;if(typeof a=="number"&&(c=a,a=null),a||c)for(h=0;h<m.length;h++){var p=c===m[h].id;if(a===m[h].fn&&p||!a&&p){m.splice(h,1);break}}else if(i)f["_on"+i]=[];else{var g=Object.keys(f);for(h=0;h<g.length;h++)g[h].indexOf("_on")===0&&Array.isArray(f[g[h]])&&(f[g[h]]=[])}return f},once:function(i,a,c){var f=this;return f.on(i,a,c,1),f},_emit:function(i,a,c){for(var f=this,m=f["_on"+i],h=m.length-1;h>=0;h--)(!m[h].id||m[h].id===a||i==="load")&&(setTimeout((function(p){p.call(this,a,c)}).bind(f,m[h].fn),0),m[h].once&&f.off(i,m[h].fn,m[h].id));return f._loadQueue(i),f},_loadQueue:function(i){var a=this;if(a._queue.length>0){var c=a._queue[0];c.event===i&&(a._queue.shift(),a._loadQueue()),i||c.action()}return a},_ended:function(i){var a=this,c=i._sprite;if(!a._webAudio&&i._node&&!i._node.paused&&!i._node.ended&&i._node.currentTime<i._stop)return setTimeout(a._ended.bind(a,i),100),a;var f=!!(i._loop||a._sprite[c][2]);if(a._emit("end",i._id),!a._webAudio&&f&&a.stop(i._id,!0).play(i._id),a._webAudio&&f){a._emit("play",i._id),i._seek=i._start||0,i._rateSeek=0,i._playStart=t.ctx.currentTime;var m=(i._stop-i._start)*1e3/Math.abs(i._rate);a._endTimers[i._id]=setTimeout(a._ended.bind(a,i),m)}return a._webAudio&&!f&&(i._paused=!0,i._ended=!0,i._seek=i._start||0,i._rateSeek=0,a._clearTimer(i._id),a._cleanBuffer(i._node),t._autoSuspend()),!a._webAudio&&!f&&a.stop(i._id,!0),a},_clearTimer:function(i){var a=this;if(a._endTimers[i]){if(typeof a._endTimers[i]!="function")clearTimeout(a._endTimers[i]);else{var c=a._soundById(i);c&&c._node&&c._node.removeEventListener("ended",a._endTimers[i],!1)}delete a._endTimers[i]}return a},_soundById:function(i){for(var a=this,c=0;c<a._sounds.length;c++)if(i===a._sounds[c]._id)return a._sounds[c];return null},_inactiveSound:function(){var i=this;i._drain();for(var a=0;a<i._sounds.length;a++)if(i._sounds[a]._ended)return i._sounds[a].reset();return new n(i)},_drain:function(){var i=this,a=i._pool,c=0,f=0;if(!(i._sounds.length<a)){for(f=0;f<i._sounds.length;f++)i._sounds[f]._ended&&c++;for(f=i._sounds.length-1;f>=0;f--){if(c<=a)return;i._sounds[f]._ended&&(i._webAudio&&i._sounds[f]._node&&i._sounds[f]._node.disconnect(0),i._sounds.splice(f,1),c--)}}},_getSoundIds:function(i){var a=this;if(typeof i>"u"){for(var c=[],f=0;f<a._sounds.length;f++)c.push(a._sounds[f]._id);return c}else return[i]},_refreshBuffer:function(i){var a=this;return i._node.bufferSource=t.ctx.createBufferSource(),i._node.bufferSource.buffer=r[a._src],i._panner?i._node.bufferSource.connect(i._panner):i._node.bufferSource.connect(i._node),i._node.bufferSource.loop=i._loop,i._loop&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop||0),i._node.bufferSource.playbackRate.setValueAtTime(i._rate,t.ctx.currentTime),a},_cleanBuffer:function(i){var a=this,c=t._navigator&&t._navigator.vendor.indexOf("Apple")>=0;if(!i.bufferSource)return a;if(t._scratchBuffer&&i.bufferSource&&(i.bufferSource.onended=null,i.bufferSource.disconnect(0),c))try{i.bufferSource.buffer=t._scratchBuffer}catch{}return i.bufferSource=null,a},_clearSound:function(i){var a=/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent);a||(i.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(i){this._parent=i,this.init()};n.prototype={init:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,a._sounds.push(i),i.create(),i},create:function(){var i=this,a=i._parent,c=t._muted||i._muted||i._parent._muted?0:i._volume;return a._webAudio?(i._node=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),i._node.gain.setValueAtTime(c,t.ctx.currentTime),i._node.paused=!0,i._node.connect(t.masterGain)):t.noAudio||(i._node=t._obtainHtml5Audio(),i._errorFn=i._errorListener.bind(i),i._node.addEventListener("error",i._errorFn,!1),i._loadFn=i._loadListener.bind(i),i._node.addEventListener(t._canPlayEvent,i._loadFn,!1),i._endFn=i._endListener.bind(i),i._node.addEventListener("ended",i._endFn,!1),i._node.src=a._src,i._node.preload=a._preload===!0?"auto":a._preload,i._node.volume=c*t.volume(),i._node.load()),i},reset:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._rateSeek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,i},_errorListener:function(){var i=this;i._parent._emit("loaderror",i._id,i._node.error?i._node.error.code:0),i._node.removeEventListener("error",i._errorFn,!1)},_loadListener:function(){var i=this,a=i._parent;a._duration=Math.ceil(i._node.duration*10)/10,Object.keys(a._sprite).length===0&&(a._sprite={__default:[0,a._duration*1e3]}),a._state!=="loaded"&&(a._state="loaded",a._emit("load"),a._loadQueue()),i._node.removeEventListener(t._canPlayEvent,i._loadFn,!1)},_endListener:function(){var i=this,a=i._parent;a._duration===1/0&&(a._duration=Math.ceil(i._node.duration*10)/10,a._sprite.__default[1]===1/0&&(a._sprite.__default[1]=a._duration*1e3),a._ended(i)),i._node.removeEventListener("ended",i._endFn,!1)}};var r={},s=function(i){var a=i._src;if(r[a]){i._duration=r[a].duration,d(i);return}if(/^data:[^;]+;base64,/.test(a)){for(var c=atob(a.split(",")[1]),f=new Uint8Array(c.length),m=0;m<c.length;++m)f[m]=c.charCodeAt(m);u(f.buffer,i)}else{var h=new XMLHttpRequest;h.open(i._xhr.method,a,!0),h.withCredentials=i._xhr.withCredentials,h.responseType="arraybuffer",i._xhr.headers&&Object.keys(i._xhr.headers).forEach(function(p){h.setRequestHeader(p,i._xhr.headers[p])}),h.onload=function(){var p=(h.status+"")[0];if(p!=="0"&&p!=="2"&&p!=="3"){i._emit("loaderror",null,"Failed loading audio file with status: "+h.status+".");return}u(h.response,i)},h.onerror=function(){i._webAudio&&(i._html5=!0,i._webAudio=!1,i._sounds=[],delete r[a],i.load())},l(h)}},l=function(i){try{i.send()}catch{i.onerror()}},u=function(i,a){var c=function(){a._emit("loaderror",null,"Decoding audio data failed.")},f=function(m){m&&a._sounds.length>0?(r[a._src]=m,d(a,m)):c()};typeof Promise<"u"&&t.ctx.decodeAudioData.length===1?t.ctx.decodeAudioData(i).then(f).catch(c):t.ctx.decodeAudioData(i,f,c)},d=function(i,a){a&&!i._duration&&(i._duration=a.duration),Object.keys(i._sprite).length===0&&(i._sprite={__default:[0,i._duration*1e3]}),i._state!=="loaded"&&(i._state="loaded",i._emit("load"),i._loadQueue())},_=function(){if(t.usingWebAudio){try{typeof AudioContext<"u"?t.ctx=new AudioContext:typeof webkitAudioContext<"u"?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch{t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var i=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),a=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),c=a?parseInt(a[1],10):null;if(i&&c&&c<9){var f=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!f&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:t,Howl:e}}),typeof Dt<"u"&&(Dt.Howler=t,Dt.Howl=e),typeof global<"u"?(global.HowlerGlobal=o,global.Howler=t,global.Howl=e,global.Sound=n):typeof window<"u"&&(window.HowlerGlobal=o,window.Howler=t,window.Howl=e,window.Sound=n)})();(function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var n=e._howls.length-1;n>=0;n--)e._howls[n].stereo(t);return e},HowlerGlobal.prototype.pos=function(t,e,n){var r=this;if(!r.ctx||!r.ctx.listener)return r;if(e=typeof e!="number"?r._pos[1]:e,n=typeof n!="number"?r._pos[2]:n,typeof t=="number")r._pos=[t,e,n],typeof r.ctx.listener.positionX<"u"?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]);else return r._pos;return r},HowlerGlobal.prototype.orientation=function(t,e,n,r,s,l){var u=this;if(!u.ctx||!u.ctx.listener)return u;var d=u._orientation;if(e=typeof e!="number"?d[1]:e,n=typeof n!="number"?d[2]:n,r=typeof r!="number"?d[3]:r,s=typeof s!="number"?d[4]:s,l=typeof l!="number"?d[5]:l,typeof t=="number")u._orientation=[t,e,n,r,s,l],typeof u.ctx.listener.forwardX<"u"?(u.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),u.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),u.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),u.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),u.ctx.listener.upY.setTargetAtTime(s,Howler.ctx.currentTime,.1),u.ctx.listener.upZ.setTargetAtTime(l,Howler.ctx.currentTime,.1)):u.ctx.listener.setOrientation(t,e,n,r,s,l);else return d;return u},Howl.prototype.init=(function(t){return function(e){var n=this;return n._orientation=e.orientation||[1,0,0],n._stereo=e.stereo||null,n._pos=e.pos||null,n._pannerAttr={coneInnerAngle:typeof e.coneInnerAngle<"u"?e.coneInnerAngle:360,coneOuterAngle:typeof e.coneOuterAngle<"u"?e.coneOuterAngle:360,coneOuterGain:typeof e.coneOuterGain<"u"?e.coneOuterGain:0,distanceModel:typeof e.distanceModel<"u"?e.distanceModel:"inverse",maxDistance:typeof e.maxDistance<"u"?e.maxDistance:1e4,panningModel:typeof e.panningModel<"u"?e.panningModel:"HRTF",refDistance:typeof e.refDistance<"u"?e.refDistance:1,rolloffFactor:typeof e.rolloffFactor<"u"?e.rolloffFactor:1},n._onstereo=e.onstereo?[{fn:e.onstereo}]:[],n._onpos=e.onpos?[{fn:e.onpos}]:[],n._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}})(Howl.prototype.init),Howl.prototype.stereo=function(t,e){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(t,e)}}),n;var r=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof t=="number")n._stereo=t,n._pos=[t,0,0];else return n._stereo;for(var s=n._getSoundIds(e),l=0;l<s.length;l++){var u=n._soundById(s[l]);if(u)if(typeof t=="number")u._stereo=t,u._pos=[t,0,0],u._node&&(u._pannerAttr.panningModel="equalpower",(!u._panner||!u._panner.pan)&&o(u,r),r==="spatial"?typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):u._panner.setPosition(t,0,0):u._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",u._id);else return u._stereo}return n},Howl.prototype.pos=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"pos",action:function(){s.pos(t,e,n,r)}}),s;if(e=typeof e!="number"?0:e,n=typeof n!="number"?-.5:n,typeof r>"u")if(typeof t=="number")s._pos=[t,e,n];else return s._pos;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._pos=[t,e,n],d._node&&((!d._panner||d._panner.pan)&&o(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setPosition(t,e,n)),s._emit("pos",d._id);else return d._pos}return s},Howl.prototype.orientation=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"orientation",action:function(){s.orientation(t,e,n,r)}}),s;if(e=typeof e!="number"?s._orientation[1]:e,n=typeof n!="number"?s._orientation[2]:n,typeof r>"u")if(typeof t=="number")s._orientation=[t,e,n];else return s._orientation;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._orientation=[t,e,n],d._node&&(d._panner||(d._pos||(d._pos=s._pos||[0,0,-.5]),o(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setOrientation(t,e,n)),s._emit("orientation",d._id);else return d._orientation}return s},Howl.prototype.pannerAttr=function(){var t=this,e=arguments,n,r,s;if(!t._webAudio)return t;if(e.length===0)return t._pannerAttr;if(e.length===1)if(typeof e[0]=="object")n=e[0],typeof r>"u"&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),t._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:t._panningModel});else return s=t._soundById(parseInt(e[0],10)),s?s._pannerAttr:t._pannerAttr;else e.length===2&&(n=e[0],r=parseInt(e[1],10));for(var l=t._getSoundIds(r),u=0;u<l.length;u++)if(s=t._soundById(l[u]),s){var d=s._pannerAttr;d={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:d.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:d.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:d.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:d.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:d.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:d.panningModel};var _=s._panner;_||(s._pos||(s._pos=t._pos||[0,0,-.5]),o(s,"spatial"),_=s._panner),_.coneInnerAngle=d.coneInnerAngle,_.coneOuterAngle=d.coneOuterAngle,_.coneOuterGain=d.coneOuterGain,_.distanceModel=d.distanceModel,_.maxDistance=d.maxDistance,_.refDistance=d.refDistance,_.rolloffFactor=d.rolloffFactor,_.panningModel=d.panningModel}return t},Sound.prototype.init=(function(t){return function(){var e=this,n=e._parent;e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,t.call(this),e._stereo?n.stereo(e._stereo):e._pos&&n.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}})(Sound.prototype.init),Sound.prototype.reset=(function(t){return function(){var e=this,n=e._parent;return e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,e._stereo?n.stereo(e._stereo):e._pos?n.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,n._refreshBuffer(e)),t.call(this)}})(Sound.prototype.reset);var o=function(t,e){e=e||"spatial",e==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()});var It=(o,t)=>{let e=y(de),n=y(ye),r=e.getSplitShellEnabled(),s="/"+t.map(d=>d.path).join("/"),l=s.startsWith("/chartplotter"),u=s.startsWith("/dashboard");if(r&&u&&!l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["chartplotter",d??""])}if(!r&&l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["dashboard",d??""])}return!0};var wr=[{path:"dashboard/:id",component:vn,canMatch:[It]},{path:"chartplotter/:id",loadComponent:()=>import("./chunk-3Y7WDZKI.js").then(o=>o.SplitShellComponent),canMatch:[It]},{path:"settings",loadComponent:()=>import("./chunk-AA2M4OWK.js").then(o=>o.SettingsComponent),title:"KIP - Settings"},{path:"options",loadComponent:()=>import("./chunk-SLMCWOKC.js").then(o=>o.TabsComponent),title:"KIP - Options"},{path:"remote",loadComponent:()=>import("./chunk-NDOR4O4J.js").then(o=>o.RemoteControlComponent),title:"KIP - Remote Control"},{path:"help",loadComponent:()=>import("./chunk-TIWUK3AU.js").then(o=>o.AppHelpComponent),title:"KIP - Help"},{path:"data",loadComponent:()=>import("./chunk-2DBQEP6W.js").then(o=>o.DataInspectorComponent),title:"KIP - Data Inspector"},{path:"login",loadComponent:()=>import("./chunk-23GQYVQ6.js").then(o=>o.WidgetLoginComponent),title:"Login"},{path:"**",component:vn,canMatch:[It]}];var Ar={production:!0};var Ir=ni(bn());function Ho(o,t){if(o&1){let e=K();b(0,"div",1)(1,"button",2),F("click",function(){I(e);let r=L();return D(r.action())}),M(2),T()()}if(o&2){let e=L();x(2),Qe(" ",e.data.action," ")}}var qo=["label"];function $o(o,t){}var Uo=Math.pow(2,31)-1,Je=class{_overlayRef;instance;containerInstance;_afterDismissed=new Ae;_afterOpened=new Ae;_onAction=new Ae;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,Uo))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Tr=new rn("MatSnackBarData"),ze=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Qo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Go=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),Wo=(()=>{class o{snackBarRef=y(Je);data=y(Tr);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(n,r){n&1&&(b(0,"div",0),M(1),T(),$(2,Ho,3,1,"div",1)),n&2&&(x(),Qe(" ",r.data.message,`
|
|
2
2
|
`),x(),U(r.hasAction?2:-1))},dependencies:[Ke,jo,Qo,Go],styles:[`.mat-mdc-simple-snack-bar{display:flex}
|
|
3
3
|
`],encapsulation:2,changeDetection:0})}return o})(),Sn="_mat-snack-bar-enter",wn="_mat-snack-bar-exit",Xo=(()=>{class o extends ji{_ngZone=y(ht);_elementRef=y(fi);_changeDetectorRef=y(Ti);_platform=y(Ki);_animationsDisabled=_n();snackBarConfig=y(ze);_document=y(mt);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=y(Te);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new Ae;_onExit=new Ae;_onEnter=new Ae;_animationState="void";_live;_label;_role;_liveElementId=y(Hi).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let n=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),n}attachTemplatePortal(e){this._assertNotAttached();let n=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),n}attachDomPortal=e=>{this._assertNotAttached();let n=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),n};onAnimationEnd(e){e===wn?this._completeExit():e===Sn&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?an(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Sn)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(Sn)},200)))}exit(){return this._destroyed?ii(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?an(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(wn)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(wn),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,n=this.snackBarConfig.panelClass;n&&(Array.isArray(n)?n.forEach(l=>e.classList.add(l)):e.classList.add(n)),this._exposeToModals();let r=this._label.nativeElement,s="mdc-snackbar__label";r.classList.toggle(s,!r.querySelector(`.${s}`))}_exposeToModals(){let e=this._liveElementId,n=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let r=0;r<n.length;r++){let s=n[r],l=s.getAttribute("aria-owns");this._trackedModals.add(s),l?l.indexOf(e)===-1&&s.setAttribute("aria-owns",l+" "+e):s.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let n=e.getAttribute("aria-owns");if(n){let r=n.replace(this._liveElementId,"").trim();r.length>0?e.setAttribute("aria-owns",r):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,n=e.querySelector("[aria-hidden]"),r=e.querySelector("[aria-live]");if(n&&r){let s=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&n.contains(document.activeElement)&&(s=document.activeElement),n.removeAttribute("aria-hidden"),r.appendChild(n),s?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["mat-snack-bar-container"]],viewQuery:function(n,r){if(n&1&&(sn(gn,7),sn(qo,7)),n&2){let s;ln(s=cn())&&(r._portalOutlet=s.first),ln(s=cn())&&(r._label=s.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(n,r){n&1&&F("animationend",function(l){return r.onAnimationEnd(l.animationName)})("animationcancel",function(l){return r.onAnimationEnd(l.animationName)}),n&2&&bt("mat-snack-bar-container-enter",r._animationState==="visible")("mat-snack-bar-container-exit",r._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!r._animationsDisabled)},features:[_i],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(n,r){n&1&&(b(0,"div",1)(1,"div",2,0)(3,"div",3),gi(4,$o,0,0,"ng-template",4),T(),ee(5,"div"),T()()),n&2&&(x(5),_t("aria-live",r._live)("role",r._role)("id",r._liveElementId))},dependencies:[gn],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
|
|
4
4
|
`],encapsulation:2})}return o})();function Yo(){return new ze}var Zo=new rn("mat-snack-bar-default-options",{providedIn:"root",factory:Yo}),Er=(()=>{class o{_live=y(zi);_injector=y(Te);_breakpointObserver=y(kt);_parentSnackBar=y(o,{optional:!0,skipSelf:!0});_defaultConfig=y(Zo);_animationsDisabled=_n();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=Wo;snackBarContainerComponent=Xo;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,n){return this._attach(e,n)}openFromTemplate(e,n){return this._attach(e,n)}open(e,n="",r){let s=X(X({},this._defaultConfig),r);return s.data={message:e,action:n},s.announcementMessage===e&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,n){let r=n&&n.viewContainerRef&&n.viewContainerRef.injector,s=Te.create({parent:r||this._injector,providers:[{provide:ze,useValue:n}]}),l=new Ze(this.snackBarContainerComponent,n.viewContainerRef,s),u=e.attach(l);return u.instance.snackBarConfig=n,u.instance}_attach(e,n){let r=X(X(X({},new ze),this._defaultConfig),n),s=this._createOverlay(r),l=this._attachSnackBarContainer(s,r),u=new Je(l,s);if(e instanceof mi){let d=new Ui(e,null,{$implicit:r.data,snackBarRef:u});u.instance=l.attachTemplatePortal(d)}else{let d=this._createInjector(r,u),_=new Ze(e,void 0,d),i=l.attachComponentPortal(_);u.instance=i.instance}return this._breakpointObserver.observe(Mt.HandsetPortrait).pipe(si(s.detachments())).subscribe(d=>{s.overlayElement.classList.toggle(this.handsetCssClass,d.matches)}),r.announcementMessage&&l._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(u,r),this._openedSnackBarRef=u,this._openedSnackBarRef}_animateSnackBar(e,n){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),n.announcementMessage&&this._live.clear()}),n.duration&&n.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(n.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let n=new Qi;n.direction=e.direction;let r=Gi(this._injector),s=e.direction==="rtl",l=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!s||e.horizontalPosition==="end"&&s,u=!l&&e.horizontalPosition!=="center";return l?r.left("0"):u?r.right("0"):r.centerHorizontally(),e.verticalPosition==="top"?r.top("0"):r.bottom("0"),n.positionStrategy=r,n.disableAnimations=this._animationsDisabled,Wi(this._injector,n)}_createInjector(e,n){let r=e&&e.viewContainerRef&&e.viewContainerRef.injector;return Te.create({parent:r||this._injector,providers:[{provide:Je,useValue:n},{provide:Tr,useValue:e.data}]})}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var kr=ni(bn());var Jo={1e3:"notification",1001:"alert",1002:"warn",1003:"alarm",1004:"emergency"},be=(()=>{class o{settings=y(de);data=y(Ve);requests=y(tr);static ALARM_SEVERITIES={normal:{sound:0,visual:0},nominal:{sound:0,visual:0},alert:{sound:1,visual:0},warn:{sound:2,visual:1},alarm:{sound:3,visual:2},emergency:{sound:4,visual:2}};_notificationSettingsSubscription=null;_notificationDataStreamSubscription=null;_notificationMetaStreamSubscription=null;_resetServiceSubscription=null;_notificationConfig;_notificationConfig$=new ut(Ci);_notifications=[];_notifications$=new ut([]);_alarmsInfo$=new ut({audioSev:0,visualSev:0,alarmCount:0,isMuted:!1});_players=new Map;_activeAlarmSoundtrack=null;_activeHowlId=null;_isHowlIdMuted=!1;_lastEmittedValue=null;constructor(){this._notificationSettingsSubscription=this.settings.getNotificationServiceConfigAsO().subscribe(e=>{this._notificationConfig=e,this.reset(),this._notificationConfig$.next(e),this._notificationConfig.disableNotifications&&!this._notificationDataStreamSubscription?.closed&&this.stopNotificationStream(),!this._notificationConfig.disableNotifications&&(this._notificationDataStreamSubscription===null||this._notificationDataStreamSubscription?.closed)&&this.startNotificationStream(),this._notificationConfig.sound.disableSound?this.playAlarm(1e3):this.updateNotificationsState()}),this._resetServiceSubscription=this.data.isResetService().subscribe(e=>{e&&this.reset()}),this.getPlayer(1e3)}startNotificationStream(){this._notificationDataStreamSubscription=this.data.getNotificationMsgObservable().subscribe(e=>this.processNotificationDeltaMsg(e)),this._notificationMetaStreamSubscription=this.data.getNotificationMetaObservable().subscribe(e=>this.processNotificationDeltaMeta(e))}stopNotificationStream(){this._notificationDataStreamSubscription?.unsubscribe(),this._notificationMetaStreamSubscription?.unsubscribe(),this.reset()}reset(){this._notificationConfig.disableNotifications&&(this._notifications=[],this._notifications$.next([])),this.updateNotificationsState()}observeNotifications(){return this._notifications$}addValue(e){this._notifications.push({path:e.path,value:e.value}),this.updateNotificationsState(),this._notifications$.next(this._notifications)}updateValue(e){let n=this._notifications.find(r=>r.path==e.path);n?(n.value=X({},e.value),this.updateNotificationsState(),this._notifications$.next(this._notifications)):console.log("[Notification Service] Update path not found for: "+e.path)}deleteValue(e){let n=this._notifications.find(r=>r.path==e);n?(delete n.value,this.updateNotificationsState(),this._notifications$.next(this._notifications)):console.log("[Notification Service] Notification to delete not found for: "+e)}updateNotificationsState(){let e=0,n=0,r=0;for(let l of this._notifications){if(!l.value||!("method"in l.value)||l.value.method.length===0||l.value.state===ke.Normal&&!this._notificationConfig.devices.showNormalState||l.value.state===ke.Nominal&&!this._notificationConfig.devices.showNominalState)continue;r++;let{aSev:u,vSev:d}=this.getNotificationSeverity(l);e=Math.max(e,u),n=Math.max(n,d)}this._notificationConfig.sound.disableSound||this.playAlarm(1e3+e);let s={audioSev:e,visualSev:n,alarmCount:r,isMuted:this._isHowlIdMuted};We(s,this._lastEmittedValue)||(this._alarmsInfo$.next(s),this._lastEmittedValue=s)}processNotificationDeltaMsg(e){if(!e.path.startsWith("notifications.security"))if(e.value===null)this.deleteValue(e.path);else{let n=this._notifications.find(r=>r.path==e.path);n?(!n.value||n.value.state!==e.value.state||n.value.message!==e.value.message||!We(n.value.method,e.value.method))&&this.updateValue(e):this.addValue(e)}}processNotificationDeltaMeta(e){let n=this._notifications.find(r=>r.path==e.path);n?n.meta=e.meta:this._notifications.push({path:e.path,meta:e.meta}),this._notifications$.next(this._notifications)}getNotificationSeverity(e){let n=e.value.state,r=o.ALARM_SEVERITIES[n];if(!r)return console.log(`[Notification Service] Unknown Notification State
|