var trio_glucoseGetLast;(()=>{var e={5941:e=>{function t(e){return e.date||Date.parse(e.display_time)||Date.parse(e.dateString)}e.exports=function(e){for(var r=(e=e.filter((function(e){return e.glucose||e.sgv})).map((function(e){if(e.glucose=e.glucose||e.sgv,null!==e.glucose)return e})))[0],o=t(r),n=[],u=[],a=[],l=0,c=1;c<e.length;c++){if(void 0!==e[c]&&"cal"===e[c].type){l=c;break}if(void 0!==e[c]&&e[c].glucose>38&&e[c].device===r.device){var s,i=e[c],d=t(i),g=0;void 0!==d&&void 0!==o?(s=Math.round((o-d)/6e4),g=(r.glucose-i.glucose)/s*5):console.error("Error: date field not found: cannot calculate avgdelta"),-2<s&&s<=2.5?(r.glucose=(r.glucose+i.glucose)/2,o=(o+d)/2):2.5<s&&s<=17.5?(u.push(g),2.5<s&&s<7.5&&n.push(g)):17.5<s&&s<42.5&&a.push(g)}}var v=0,h=0,f=0;return n.length>0&&(v=n.reduce((function(e,t){return e+t}))/n.length),u.length>0&&(h=u.reduce((function(e,t){return e+t}))/u.length),a.length>0&&(f=a.reduce((function(e,t){return e+t}))/a.length),{delta:Math.round(100*v)/100,glucose:Math.round(100*r.glucose)/100,noise:Math.round(r.noise),short_avgdelta:Math.round(100*h)/100,long_avgdelta:Math.round(100*f)/100,date:o,last_cal:l,device:r.device}}}},t={},r=function r(o){var n=t[o];if(void 0!==n)return n.exports;var u=t[o]={exports:{}};return e[o](u,u.exports,r),u.exports}(5941);trio_glucoseGetLast=r})();