diff --git a/demo/demo.html b/demo/demo.html new file mode 100644 index 0000000..8c60363 --- /dev/null +++ b/demo/demo.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + +

Latency to internet

+
+
+
+
+
+

Latency to modem

+
+
+
+
+
+

Latency to NAT

+
+
+
+
+
+ + diff --git a/demo/netgraph.js b/demo/netgraph.js new file mode 100644 index 0000000..f3bbf9d --- /dev/null +++ b/demo/netgraph.js @@ -0,0 +1,2 @@ +var netgraph;(()=>{"use strict";var t={784:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=i(182);Object.defineProperty(e,"Canvas",{enumerable:!0,get:function(){return n.Canvas}}),Object.defineProperty(e,"Region",{enumerable:!0,get:function(){return n.Region}});var r=i(917);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return r.GridLayout}});var s=i(679);Object.defineProperty(e,"Key",{enumerable:!0,get:function(){return s.Key}}),Object.defineProperty(e,"KeyParser",{enumerable:!0,get:function(){return s.KeyParser}}),Object.defineProperty(e,"KeyType",{enumerable:!0,get:function(){return s.KeyType}}),Object.defineProperty(e,"Modifier",{enumerable:!0,get:function(){return s.Modifier}});var o=i(665);Object.defineProperty(e,"Terminal",{enumerable:!0,get:function(){return o.Terminal}});var a=i(623);Object.defineProperty(e,"TextBuffer",{enumerable:!0,get:function(){return a.TextBuffer}});var u=i(595);Object.defineProperty(e,"get_color",{enumerable:!0,get:function(){return u.get_color}}),Object.defineProperty(e,"name_to_rgb",{enumerable:!0,get:function(){return u.name_to_rgb}}),Object.defineProperty(e,"rgb_to_xterm",{enumerable:!0,get:function(){return u.rgb_to_xterm}}),Object.defineProperty(e,"xterm_to_rgb",{enumerable:!0,get:function(){return u.xterm_to_rgb}})},182:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Region=e.Canvas=void 0;const n=i(546),r=i(665),s=i(623),o=i(595),a=4103;let u=1;e.Canvas=class{constructor(t,e){this.cols=t,this.rows=e,this.dirty=!0,this.forceAll=!1,this.dirtyDebounceDelay=0,this.nextBuffer=new s.TextBuffer(t,e),this.nextBuffer.clearBox(0,0,t,e,a),this.id=u++}toString(){return`Canvas(${this.nextBuffer.cols} x ${this.nextBuffer.rows}, cursor (${this.nextBuffer.cursorX}, ${this.nextBuffer.cursorY}), dirty=${this.dirty}`}get cursor(){return[this.nextBuffer.cursorX,this.nextBuffer.cursorY]}onDirty(t,e){this.dirtyListener=e,this.dirtyDebounceDelay=t}resize(t,e){this.nextBuffer.resize(t,e,a),delete this.currentBuffer,this.cols=t,this.rows=e,this._all&&this._all.resize(0,0,this.cols,this.rows)}redraw(){this.forceAll=!0,this.setDirty()}all(){return this._all||(this._all=new h(this,0,0,this.cols,this.rows)),this._all}clip(t,e,i,n){return this.all().clip(t,e,i,n)}setDirty(){this.dirty=!0,this.dirtyListener&&(this.dirtyTimer||(this.dirtyTimer=setTimeout((()=>{if(this.dirtyTimer=void 0,this.dirty&&this.dirtyListener)try{this.dirtyListener()}catch(t){}}),this.dirtyDebounceDelay)))}write(t,e,i,n){this.writeChars(t,e,i,[...n])}writeChars(t,e,i,n){var r;this.setDirty();for(let s=0;s=this.cols||e>=this.rows)return}}transform(t){this.nextBuffer.transform(t)}paint(){return void 0===this.currentBuffer&&(this.currentBuffer=new s.TextBuffer(this.cols,this.rows)),this.forceAll&&(this.forceAll=!1,this.currentBuffer=new s.TextBuffer(this.cols,this.rows),this.nextBuffer.pendingClear=a,this.nextBuffer.setAllDirty()),this.dirty=!1,""+n.computeDiff(this.currentBuffer,this.nextBuffer)}paintInline(){return[...Array(this.nextBuffer.rows).keys()].map((t=>{let e="",i=-1,n=-1;for(let s=0;s>8!=n&&(e+=r.Terminal.bg(o>>8)),(255&o)!=i&&(e+=r.Terminal.fg(255&o)),e+=String.fromCodePoint(this.nextBuffer.getChar(s,t)),i=255&o,n=o>>8}return e+=r.Terminal.noColor()+"\n",e})).join("")}};class h{constructor(t,e,i,n,r){this.canvas=t,this.x1=e,this.y1=i,this.x2=n,this.y2=r,this.resizeListeners=new Set,this.cursorX=0,this.cursorY=0,this.attr=4103}toString(){return`Region((${this.x1}, ${this.y1}) -> (${this.x2}, ${this.y2}) of Canvas ${this.canvas.id}, cursor (${this.cursorX}, ${this.cursorY}), attr=$${this.attr.toString(16)}, listeners=${this.resizeListeners.size})`}get cols(){return this.x2-this.x1}get rows(){return this.y2-this.y1}get parentOffset(){var t,e,i,n;return[this.x1-(null!==(e=null===(t=this.parent)||void 0===t?void 0:t.x1)&&void 0!==e?e:0),this.y1-(null!==(n=null===(i=this.parent)||void 0===i?void 0:i.y1)&&void 0!==n?n:0)]}offsetFrom(t){return[this.x1-t.x1,this.y1-t.y1]}onResize(t){this.resizeListeners.add(t)}removeOnResize(t){this.resizeListeners.delete(t)}all(){return this}clip(t,e,i,n){t=Math.max(this.x1,Math.min(this.x1+t,this.x2)),i=Math.max(this.x1,Math.min(this.x1+i,this.x2)),e=Math.max(this.y1,Math.min(this.y1+e,this.y2)),n=Math.max(this.y1,Math.min(this.y1+n,this.y2));const r=new h(this.canvas,t,e,i,n);return r.attr=this.attr,r.parent=this,r.at(this.cursorX-t,this.cursorY-e)}resize(t,e,i,n){var r,s,o,a,u,h,c,l;this.x1=t+(null!==(s=null===(r=this.parent)||void 0===r?void 0:r.x1)&&void 0!==s?s:0),this.y1=e+(null!==(a=null===(o=this.parent)||void 0===o?void 0:o.y1)&&void 0!==a?a:0),this.x2=i+(null!==(h=null===(u=this.parent)||void 0===u?void 0:u.x1)&&void 0!==h?h:0),this.y2=n+(null!==(l=null===(c=this.parent)||void 0===c?void 0:c.y1)&&void 0!==l?l:0),this.at(this.cursorX,this.cursorY);for(const t of[...this.resizeListeners])t()}color(t,e){if(void 0!==t){const e="string"==typeof t?o.get_color(t):t;this.attr=65280&this.attr|e}if(void 0!==e){const t="string"==typeof e?o.get_color(e):e;this.attr=255&this.attr|t<<8}return this}backgroundColor(t){return this.color(void 0,t)}at(t,e){return this.cursorX=Math.max(Math.min(t,this.cols-1),0),this.cursorY=Math.max(Math.min(e,this.rows-1),0),this}move(t,e){return this.at(this.cursorX+t,this.cursorY+e)}clear(){return this.canvas.nextBuffer.clearBox(this.x1,this.y1,this.x2,this.y2,this.attr),this.canvas.setDirty(),this}clearToEndOfLine(){return this.canvas.nextBuffer.clearToEndOfLine(this.x1+this.cursorX,this.y1+this.cursorY,this.attr),this.canvas.setDirty(),this}write(t){var e,i;const n=t.split("\n");for(this.writeLine(null!==(e=n.shift())&&void 0!==e?e:"");n.length>0;)this.lf(),this.writeLine(null!==(i=n.shift())&&void 0!==i?i:"");return this}writeLine(t){let e=[...t];for(;e.length>0;){this.cursorX>=this.cols&&this.lf();const t=this.cols-this.cursorX,i=e.slice(0,t);this.canvas.writeChars(this.x1+this.cursorX,this.y1+this.cursorY,this.attr,i),this.cursorX+=i.length,e=e.slice(i.length)}return this}lf(){this.cursorX=0,this.cursorY++,this.cursorY>=this.rows&&(this.scrollUp(),this.cursorY=this.rows-1)}draw(t){const e=this.cols-this.cursorX,i=this.rows-this.cursorY;(t.cols>e||t.rows>i)&&(t=t.clip(0,0,e,i));const n=this.x1+this.cursorX,r=this.y1+this.cursorY;return this.canvas.nextBuffer.putBox(n,r,t.canvas.nextBuffer,t.x1,t.y1,t.x2,t.y2),this.canvas.setDirty(),this}scrollUp(t=1){return this.canvas.nextBuffer.scrollUp(this.x1,this.y1,this.x2,this.y2,t,this.attr),this.canvas.setDirty(),this}scrollDown(t=1){return this.canvas.nextBuffer.scrollDown(this.x1,this.y1,this.x2,this.y2,t,this.attr),this.canvas.setDirty(),this}scrollLeft(t=1){return this.canvas.nextBuffer.scrollLeft(this.x1,this.y1,this.x2,this.y2,t,this.attr),this.canvas.setDirty(),this}scrollRight(t=1){return this.canvas.nextBuffer.scrollRight(this.x1,this.y1,this.x2,this.y2,t,this.attr),this.canvas.setDirty(),this}moveCursor(t=this.cursorX,e=this.cursorY){return this.canvas.nextBuffer.cursorX=this.x1+t,this.canvas.nextBuffer.cursorY=this.y1+e,this.canvas.setDirty(),this}}e.Region=h},546:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeDiff=void 0;const n=i(665);class r{constructor(t,e,i,n=-3,r=-3){this.attr=t,this.bg=e,this.x=i,this.score=n,this.chainScore=r}}class s{constructor(t,e){this.distance=t,this.clears=e}}function o(t,e,i,n=e){let o,a=0;const u=[],h=t=>{o&&t-o.x+1>=8&&u.push(o),o=void 0};for(const s of f(0,t.cols)){const c=i.isBlank(s,n),l=void 0===c?void 0:c>>8&255,f=i.isSame(s,n,t,e);if(f||a++,f)for(const t of u)t.bg!=l&&t.score--;if(void 0===c||void 0===l){h(s);continue}o&&o.bg==l||(h(s),o=new r(c,l,s));let d=!1;for(const t of u)t.bg==l?(t.chainScore++,d=!0):d&&t.chainScore--;if(o&&o.chainScore++,!f){for(const t of u)t.bg==l&&t.score++;o&&o.score++}}h(t.cols);let c=[];for(;u.length>0&&u[0].score<=0;)u.shift();if(u.length>0){c.push(u[0]),a-=u[0].score;const t=u.filter(((t,e)=>0==e||t.chainScore>0));for(const e of t.filter(((t,e)=>e>0&&u[e-1].bg!=t.bg)))c.push(e),a-=e.chainScore}return new s(a,c)}function a(t,e,i){const n=[];for(let r=0;r=0&&r-n[o][1]<5?n[o][1]=s:n.push([r,s]),r=s}return n}function u(t,e,i){let r=0;const s=d(f(i.top,i.bottom),(i=>o(t,i,e).distance));if(i.rows>0)r+=d(f(i.top,i.bottom-i.rows),(n=>o(t,n+i.rows,e,n).distance)),r+=d(f(i.bottom-i.rows,i.bottom),(t=>h(e,t,i.attr)));else{const n=-i.rows;r+=d(f(i.top+n,i.bottom),(i=>o(t,i-n,e,i).distance)),r+=d(f(i.top,i.top+n),(t=>h(e,t,i.attr)))}if(s-r<6)return"";let a=c(t,i.attr);return i.rows>0?(a+=n.Terminal.scrollUp(i.top,i.bottom,i.rows),t.scrollUp(0,i.top,t.cols,i.bottom,i.rows,t.attr)):(a+=n.Terminal.scrollDown(i.top,i.bottom,-i.rows),t.scrollDown(0,i.top,t.cols,i.bottom,-i.rows,t.attr)),t.cursorX=-1,t.cursorY=-1,a}function h(t,e,i){return d(f(0,t.cols),(n=>{const r=t.isBlank(n,e);return void 0===r||(65280&r)!=(65280&i)?1:0}))}function c(t,e,i=!0){if(-1==t.attr&&(t.attr=65535^e),e==t.attr)return"";i||(e=65280&e|255&t.attr);let r=255&e,s=e>>8&255;const o=255&t.attr,a=t.attr>>8&255;return t.attr=e,(o!=r?n.Terminal.fg(r):"")+(a!=s?n.Terminal.bg(s):"")}function l(t,e,i){const r=t.cursorX,s=t.cursorY;return t.cursorX=e,t.cursorY=i,r<0||s<0?n.Terminal.move(e,i):r==e&&s==i?"":r==e?n.Terminal.moveRelative(0,i-s):s==i&&re*i+t))}function d(t,e){return t.reduce(((t,i)=>t+e(i)),0)}e.computeDiff=function(t,e){let i="";e.pendingClear&&(i+=c(t,e.pendingClear)+n.Terminal.clearScreen(),t.clearBox(0,0,t.cols,t.rows,e.pendingClear),t.cursorX=0,t.cursorY=0);for(const n of e.pendingScrolls)i+=u(t,e,n);for(const r of f(0,t.rows)){if(!e.isDirty(r))continue;const s=o(t,r,e);for(const e of s.clears)t.clearToEndOfLine(e.x,r,e.attr);for(let[o,u]of a(t,e,r)){for(t.cursorY==r&&t.cursorX0&&s.clears[0].x0;){const e=s.clears[0];i+=l(t,e.x,r)+c(t,e.attr,!1)+n.Terminal.eraseLine(),s.clears.shift()}}return i+=l(t,e.cursorX,e.cursorY),e.clearDirty(),i}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.COLOR_NAMES=void 0,e.COLOR_NAMES={aqua:"0ff",black:"000",blue:"00f",brown:"a52a2a",cyan:"0ff",fuchsia:"f0f",gray:"808080",green:"008000",lime:"0f0",magenta:"f0f",maroon:"800000",navy:"000080",olive:"808000",orange:"ffa500",pink:"ffc0cb",purple:"800080",red:"f00",silver:"c0c0c0",tan:"d2b48c",teal:"008080",white:"fff",yellow:"ff0"}},917:(t,e)=>{function i(t){return t.reduce(((t,e)=>t+e),0)}function n(t,e){const n=t.map((t=>({constraint:t,possibleSize:0})));let r=e,s=!1;for(;!s;){s=!0;const t=i(n.filter((t=>void 0===t.size)).map((t=>t.constraint.factor)));for(const e of n)void 0===e.size&&(e.possibleSize=0==t?0:Math.floor(r*e.constraint.factor/t),e.possibleSizee.constraint.maximum&&(e.size=e.constraint.maximum,r-=e.size,s=!1))}let o=i(n.map((t=>{var e;return null!==(e=t.size)&&void 0!==e?e:t.possibleSize})));for(let t=0;o0&&void 0===n[t].size&&(n[t].possibleSize++,o++);return n.map((t=>{var e;return null!==(e=t.size)&&void 0!==e?e:t.possibleSize}))}Object.defineProperty(e,"__esModule",{value:!0}),e.GridLayout=void 0,e.GridLayout=class{constructor(t,e,i){this.region=t,this.colConstraints=e,this.rowConstraints=i,this.lefts=[],this.tops=[],this.resizeListeners=new Set,this.onResize=()=>this.resize(this.region.cols,this.region.rows),this.resize(t.cols,t.rows),t.onResize(this.onResize)}static fixed(t){return{minimum:t,factor:0}}static stretch(t){return{minimum:0,factor:t}}static stretchWithMinimum(t,e){return{minimum:e,factor:t}}static stretchWithMinMax(t,e,i){return{minimum:e,maximum:i,factor:t}}detach(){this.region.removeOnResize(this.onResize)}update(t,e){this.colConstraints=t,this.rowConstraints=e,this.resize(this.region.cols,this.region.rows)}adjustCol(t,e){this.colConstraints[t]=e,this.update(this.colConstraints,this.rowConstraints)}adjustRow(t,e){this.rowConstraints[t]=e,this.update(this.colConstraints,this.rowConstraints)}layout(t,e,i,n){const r=this.region.clip(this.lefts[t],this.tops[e],this.lefts[i],this.tops[n]);return this.resizeListeners.add((()=>{r.resize(this.lefts[t],this.tops[e],this.lefts[i],this.tops[n])})),r}layoutAt(t,e){return this.layout(t,e,t+1,e+1)}resize(t,e){const i=n(this.colConstraints,t),r=n(this.rowConstraints,e);let s=0,o=0;this.lefts=i.map((t=>(s+=t,s-t))),this.lefts.push(s),this.tops=r.map((t=>(o+=t,o-t))),this.tops.push(o);for(const t of[...this.resizeListeners])t()}static solveConstraints(t,e){return n(t,e)}}},679:(t,e)=>{var i,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),e.KeyParser=e.Key=e.KeyType=e.Modifier=void 0,function(t){t[t.Shift=1]="Shift",t[t.Alt=2]="Alt",t[t.Control=4]="Control",t[t.Meta=8]="Meta"}(i=e.Modifier||(e.Modifier={})),function(t){t[t.Normal=0]="Normal",t[t.Function=1]="Function",t[t.PasteBegin=2]="PasteBegin",t[t.PasteEnd=3]="PasteEnd",t[t.Backspace=4]="Backspace",t[t.Up=5]="Up",t[t.Down=6]="Down",t[t.Left=7]="Left",t[t.Right=8]="Right",t[t.PageUp=9]="PageUp",t[t.PageDown=10]="PageDown",t[t.Insert=11]="Insert",t[t.Delete=12]="Delete",t[t.Home=13]="Home",t[t.End=14]="End",t[t.Esc=15]="Esc",t[t.Tab=16]="Tab",t[t.Return=17]="Return"}(n=e.KeyType||(e.KeyType={}));class o{constructor(t,e,i=""){this.modifiers=t,this.type=e,this.key=i}static normal(t,e){return new o(t,n.Normal,e)}equals(t){return this.modifiers==t.modifiers&&this.type==t.type&&this.key==t.key}toString(){const t=[];switch(0!=(this.modifiers&(i.Meta|i.Alt))&&t.push("M"),this.modifiers&i.Shift&&t.push("S"),this.modifiers&i.Control&&t.push("C"),this.type){case n.Normal:t.push(this.key);break;case n.Function:t.push(`F${this.key}`);break;case n.PasteBegin:t.push("Paste");break;case n.PasteEnd:t.push("/Paste");break;default:t.push(n[this.type])}return t.join("-")}}e.Key=o,function(t){t[t.Normal=0]="Normal",t[t.Esc=1]="Esc",t[t.CSI=2]="CSI",t[t.SS3=3]="SS3"}(r||(r={})),function(t){t[t.BACKSPACE=8]="BACKSPACE",t[t.TAB=9]="TAB",t[t.CR=13]="CR",t[t.ESC=27]="ESC",t[t.ZERO="0".codePointAt(0)||0]="ZERO",t[t.SEMICOLON=";".codePointAt(0)||0]="SEMICOLON",t[t.O="O".codePointAt(0)||0]="O",t[t.P="P".codePointAt(0)||0]="P",t[t.S="S".codePointAt(0)||0]="S",t[t.LBRACKET="[".codePointAt(0)||0]="LBRACKET",t[t.SQUIGGLE="~".codePointAt(0)||0]="SQUIGGLE",t[t.DEL=127]="DEL"}(s||(s={})),e.KeyParser=class{constructor(t){this.emit=t,this.state=r.Normal,this.modifiers=0,this.buffer="",this.lastKey=Date.now()}feed(t){const e=[];let i=!1;for(let n of Array.from(t).map((t=>t.codePointAt(0)||0)))i=this.feedCodepoint(n,e);this.lastKey=Date.now(),e.length>0&&this.emit(e),i&&setTimeout((()=>{Date.now()-this.lastKey>=100&&this.emit([new o(this.modifiers,n.Esc)])}),100)}feedCodepoint(t,e){switch(this.state){case r.Normal:switch(t){case s.TAB:return e.push(new o(this.modifiers,n.Tab)),this.modifiers=0,!1;case s.CR:return e.push(new o(this.modifiers,n.Return)),this.modifiers=0,!1;case s.ESC:return this.state=r.Esc,!0;case s.BACKSPACE:case s.DEL:return e.push(new o(this.modifiers,n.Backspace)),this.modifiers=0,!1;default:return t<32&&(this.modifiers|=i.Control,t+=64),e.push(new o(this.modifiers,n.Normal,String.fromCodePoint(t))),this.modifiers=0,!1}case r.Esc:switch(t){case s.LBRACKET:return this.state=r.CSI,this.buffer="",!1;case s.O:return this.state=r.SS3,!1;default:return this.modifiers|=i.Meta,this.state=r.Normal,this.feedCodepoint(t,e)}case r.CSI:return t>=s.ZERO&&t<=s.SEMICOLON?(this.buffer+=String.fromCodePoint(t),!1):(this.parseCsi(e,String.fromCodePoint(t),this.buffer.split(/[;:]/).map((t=>parseInt(t,10)))),this.state=r.Normal,this.modifiers=0,!1);case r.SS3:return t>=s.P&&t<=s.S?(e.push(new o(this.modifiers,n.Function,(1+t-s.P).toString())),this.state=r.Normal,this.modifiers=0,!1):(e.push(new o(i.Meta,n.Normal,"O")),this.state=r.Normal,this.feedCodepoint(t,e))}}parseCsi(t,e,r){switch(1==r[0]&&r.length>=2&&(this.modifiers|=r[1]-1),e){case"A":t.push(new o(this.modifiers,n.Up));break;case"B":t.push(new o(this.modifiers,n.Down));break;case"C":t.push(new o(this.modifiers,n.Right));break;case"D":t.push(new o(this.modifiers,n.Left));break;case"H":t.push(new o(this.modifiers,n.Home));break;case"F":t.push(new o(this.modifiers,n.End));break;case"P":t.push(new o(this.modifiers,n.Function,"1"));break;case"Q":t.push(new o(this.modifiers,n.Function,"2"));break;case"R":t.push(new o(this.modifiers,n.Function,"3"));break;case"S":t.push(new o(this.modifiers,n.Function,"4"));break;case"Z":t.push(new o(i.Shift,n.Tab));break;case"~":switch(r.length>1&&(this.modifiers=this.modifiers|=r[1]-1),r[0]||0){case 1:t.push(new o(this.modifiers,n.Home));break;case 2:t.push(new o(this.modifiers,n.Insert));break;case 3:t.push(new o(this.modifiers,n.Delete));break;case 4:t.push(new o(this.modifiers,n.End));break;case 5:t.push(new o(this.modifiers,n.PageUp));break;case 6:t.push(new o(this.modifiers,n.PageDown));break;case 11:t.push(new o(this.modifiers,n.Function,"1"));break;case 12:t.push(new o(this.modifiers,n.Function,"2"));break;case 13:t.push(new o(this.modifiers,n.Function,"3"));break;case 14:t.push(new o(this.modifiers,n.Function,"4"));break;case 15:t.push(new o(this.modifiers,n.Function,"5"));break;case 17:t.push(new o(this.modifiers,n.Function,"6"));break;case 18:t.push(new o(this.modifiers,n.Function,"7"));break;case 19:t.push(new o(this.modifiers,n.Function,"8"));break;case 20:t.push(new o(this.modifiers,n.Function,"9"));break;case 21:t.push(new o(this.modifiers,n.Function,"10"));break;case 23:t.push(new o(this.modifiers,n.Function,"11"));break;case 24:t.push(new o(this.modifiers,n.Function,"12"));break;case 200:t.push(new o(this.modifiers,n.PasteBegin));break;case 201:t.push(new o(this.modifiers,n.PasteEnd))}break;default:t.push(new o(i.Meta,n.Normal,"[")),t.push(new o(0,n.Normal,e))}}}},665:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;class i{static moveX(t){return 0==t?"":t>0?1==t?"":`[${t}C`:-1==t?"":`[${-t}D`}static moveY(t){return 0==t?"":t>0?1==t?"":`[${t}B`:-1==t?"":`[${-t}A`}static moveRelative(t,e){return i.moveX(t)+i.moveY(e)}static move(t,e){return 0==t?0==e?"":`[${e+1}H`:`[${e+1};${t+1}H`}static clearScreen(){return""}static eraseLine(){return""}static fg(t){return t<8?`[3${t}m`:`[38;5;${t}m`}static bg(t){return t<8?`[4${t}m`:`[48;5;${t}m`}static noColor(){return""}static scrollUp(t,e,i){return`[${t+1};${e}r[${i}S`}static scrollDown(t,e,i){return`[${t+1};${e}r[${i}T`}}e.Terminal=i},623:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextBuffer=e.ScrollRegion=void 0;class i{constructor(t,e,i,n){this.top=t,this.bottom=e,this.rows=i,this.attr=n}}e.ScrollRegion=i,e.TextBuffer=class{constructor(t,e){this.cols=t,this.rows=e,this.pendingScrolls=[],this.alloc(t,e),this.cursorX=0,this.cursorY=0,this.attr=-1}resize(t,e,i){const n=this.chars,r=this.attrs,s=this.cols,o=this.rows;this.alloc(t,e),this.clearBox(0,0,t,e,i);for(let t=0;t32767)throw new Error(`Invalid terminal size ${t} x ${e}`);this.chars=new Uint32Array(e*t),this.attrs=new Uint16Array(e*t),this.dirty=new Uint8Array(Math.ceil(e/8)),this.cols=t,this.rows=e}put(t,e,i,n){const r=this.cols*e+t;this.chars[r]=n,this.attrs[r]=i,this.setDirty(e)}getAttr(t,e){const i=this.cols*e+t,n=this.attrs[i];return n>=256?n:4096|n}getBackground(t,e){const i=this.getAttr(t,e)>>8&255;return 0==i?16:i}getChar(t,e){const i=this.cols*e+t;return this.chars[i]}set(t){this.chars.set(t.chars),this.attrs.set(t.attrs),this.cursorX=t.cursorX,this.cursorY=t.cursorY,this.attr=t.attr}setSpan(t,e,i,n){const r=this.cols*e+t,s=this.cols*e+i;for(let t=r;t0?n+s-o-1:e+s+o,u=s>0?n-o-1:e+o;this.copySegment(t+r,a,t,u,i-t)}}putBox(t,e,i,n,r,s,o){let a=this.cols*e+t,u=i.cols*r+n;for(let t=0;t3;)this.pendingScrolls.pop()}scrollDown(t,e,n,r,s,o){this.copyBox(t,e,n,r-s,0,s);for(let i=e;i3;)this.pendingScrolls.pop()}scrollLeft(t,e,i,n,r,s){this.copyBox(t+r,e,i,n,-r,0);for(let t=e;t0;)this.pendingScrolls.pop()}setAllDirty(){for(let t=0;t>8&255,u=t(255&s,a,o,r,n),h=u[0]|(null!==(e=u[1])&&void 0!==e?e:a)<<8;this.put(r,n,h,null!==(i=u[2])&&void 0!==i?i:o)}}}},595:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.nearest_ansi=e.nearest_gray=e.nearest_color_cube=e.nearest_color=e.color_from_r_g_b=e.rgb_to_xterm=e.color_from_hex=e.xterm_to_rgb=e.name_to_rgb=e.get_color=void 0;const n=i(243),r=[0,95,135,175,215,255],s=[8,18,28,38,48,58,68,78,88,98,108,118,128,138,148,158,168,178,188,198,208,218,228,238],o=[[0,0,0],[128,0,0],[0,128,0],[128,128,0],[0,0,128],[128,0,128],[0,128,128],[192,192,192],[128,128,128],[255,0,0],[0,255,0],[255,255,0],[0,0,255],[255,0,255],[0,255,255],[255,255,255]],a=/^[\da-fA-F]{3}([\da-fA-F]{3})?$/,u={};function h(t){if(3==t.length)return h(t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const[e,i,n]=[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)];return e<<16|i<<8|n}function c(t){if(null!=u[t])return u[t];if(3==t.length)return c(t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const[e,i,n]=[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)],r=l(e,i,n);return u[t]=r,r}function l(t,e,i){let n=f(t,e,i);return 0==n&&(n=16),n}function f(t,e,i){const[n,r]=d(t,e,i),[s,o]=m(t,e,i),[a,u]=p(t,e,i);return rg(n,r,s,t,e,i))),r=y(0,n);return[r,n[r]]}function g(t,e,i,n,r,s){return(t-n)*(t-n)+(e-r)*(e-r)+(i-s)*(i-s)}function y(t,e){let i=0,n=Math.abs(e[i]-t);for(let r=1;r255)return 0;if(t<16){const[e,i,n]=o[t];return 65536*e+256*i+n}return t<232?65536*r[Math.floor((t-16)/36)]+256*r[Math.floor((t-16)%36/6)]+r[(t-16)%6]:65793*s[t-232]},e.color_from_hex=c,e.rgb_to_xterm=function(t){return l(t>>16&255,t>>8&255,255&t)},e.color_from_r_g_b=l,e.nearest_color=f,e.nearest_color_cube=d,e.nearest_gray=m,e.nearest_ansi=p},915:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.toBinarySI=e.toSI=e.floorToCurrency=e.ceilToCurrency=e.roundToCurrency=e.floorToPrecision=e.ceilToPrecision=e.roundToPrecision=void 0;var i="afpnum KMGTPE",n=Math.log(10),r=Math.pow(10,1/3);function s(t,e,i){if(0==t)return 0;var r=e-Math.floor(Math.log(t)/n)-1;return i(t*Math.pow(10,r))*Math.pow(10,-r)}function o(t,e){return s(t,e,Math.round)}function a(t,e){if(0==t)return 0;var i=Math.floor(Math.log(t)/n);return Math.pow(10,i)*e(Math.pow(10,-i)*t)}function u(t,e){void 0===e&&(e=1e3);for(var n=i.indexOf(" "),r=Math.abs(t);r>=e&&n0;)r*=e,n--;var s=i[n];" "==s?s="":r=r<10?o(r,2):Math.round(r);for(var a=r.toString().slice(0,4);a.indexOf(".")>0&&"0"==a[a.length-1];)a=a.slice(0,-1);return(t<0?"-":"")+a+s}Math.log(r),e.roundToPrecision=o,e.ceilToPrecision=function(t,e){return s(t,e,Math.ceil)},e.floorToPrecision=function(t,e){return s(t,e,Math.floor)},e.roundToCurrency=function(t){return a(t,(function(t){return t>5?5*Math.round(t/5):t>2?3*Math.round((t-2)/3)+2:Math.round(t)}))},e.ceilToCurrency=function(t){return a(t,(function(t){return t>5?10:t>2?5:t>1?2:1}))},e.floorToCurrency=function(t){return a(t,(function(t){return t>=5?5:t>=2?2:1}))},e.toSI=u,e.toBinarySI=function(t){return u(t,1024)}},490:(t,e)=>{function i(t,e){for(var i=0;it.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[e++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(e=t[Symbol.iterator]()).next.bind(e)}Object.defineProperty(e,"__esModule",{value:!0});var f=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e}(h(Error)),d=function(t){function e(e){return t.call(this,"Invalid DateTime: "+e.toMessage())||this}return r(e,t),e}(f),m=function(t){function e(e){return t.call(this,"Invalid Interval: "+e.toMessage())||this}return r(e,t),e}(f),p=function(t){function e(e){return t.call(this,"Invalid Duration: "+e.toMessage())||this}return r(e,t),e}(f),g=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e}(f),y=function(t){function e(e){return t.call(this,"Invalid unit "+e)||this}return r(e,t),e}(f),v=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e}(f),w=function(t){function e(){return t.call(this,"Zone is an abstract class")||this}return r(e,t),e}(f),b="numeric",x="short",S="long",T={year:b,month:b,day:b},k={year:b,month:x,day:b},M={year:b,month:x,day:b,weekday:x},O={year:b,month:S,day:b},E={year:b,month:S,day:b,weekday:S},L={hour:b,minute:b},C={hour:b,minute:b,second:b},D={hour:b,minute:b,second:b,timeZoneName:x},A={hour:b,minute:b,second:b,timeZoneName:S},N={hour:b,minute:b,hour12:!1},I={hour:b,minute:b,second:b,hour12:!1},P={hour:b,minute:b,second:b,hour12:!1,timeZoneName:x},_={hour:b,minute:b,second:b,hour12:!1,timeZoneName:S},B={year:b,month:b,day:b,hour:b,minute:b},F={year:b,month:b,day:b,hour:b,minute:b,second:b},R={year:b,month:x,day:b,hour:b,minute:b},j={year:b,month:x,day:b,hour:b,minute:b,second:b},z={year:b,month:x,day:b,weekday:x,hour:b,minute:b},H={year:b,month:S,day:b,hour:b,minute:b,timeZoneName:x},V={year:b,month:S,day:b,hour:b,minute:b,second:b,timeZoneName:x},$={year:b,month:S,day:b,weekday:S,hour:b,minute:b,timeZoneName:S},Y={year:b,month:S,day:b,weekday:S,hour:b,minute:b,second:b,timeZoneName:S};function U(t){return void 0===t}function W(t){return"number"==typeof t}function Z(t){return"number"==typeof t&&t%1==0}function X(){try{return"undefined"!=typeof Intl&&Intl.DateTimeFormat}catch(t){return!1}}function G(){return!U(Intl.DateTimeFormat.prototype.formatToParts)}function q(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(t){return!1}}function J(t,e,i){if(0!==t.length)return t.reduce((function(t,n){var r=[e(n),n];return t&&i(t[0],r[0])===t[0]?t:r}),null)[1]}function K(t,e){return e.reduce((function(e,i){return e[i]=t[i],e}),{})}function Q(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function tt(t,e,i){return Z(t)&&t>=e&&t<=i}function et(t,e){void 0===e&&(e=2);var i=t<0?"-":"",n=i?-1*t:t;return""+i+(n.toString().length=0&&(e=new Date(e)).setUTCFullYear(e.getUTCFullYear()-1900),+e}function ht(t){var e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,i=t-1,n=(i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400))%7;return 4===e||3===n?53:52}function ct(t){return t>99?t:t>60?1900+t:2e3+t}function lt(t,e,i,n){void 0===n&&(n=null);var r=new Date(t),s={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);var o=Object.assign({timeZoneName:e},s),a=X();if(a&&G()){var u=new Intl.DateTimeFormat(i,o).formatToParts(r).find((function(t){return"timezonename"===t.type.toLowerCase()}));return u?u.value:null}if(a){var h=new Intl.DateTimeFormat(i,s).format(r);return new Intl.DateTimeFormat(i,o).format(r).substring(h.length).replace(/^[, \u200e]+/,"")}return null}function ft(t,e){var i=parseInt(t,10);Number.isNaN(i)&&(i=0);var n=parseInt(e,10)||0;return 60*i+(i<0||Object.is(i,-0)?-n:n)}function dt(t){var e=Number(t);if("boolean"==typeof t||""===t||Number.isNaN(e))throw new v("Invalid unit value "+t);return e}function mt(t,e,i){var n={};for(var r in t)if(Q(t,r)){if(i.indexOf(r)>=0)continue;var s=t[r];if(null==s)continue;n[e(r)]=dt(s)}return n}function pt(t,e){var i=Math.trunc(Math.abs(t/60)),n=Math.trunc(Math.abs(t%60)),r=t>=0?"+":"-";switch(e){case"short":return""+r+et(i,2)+":"+et(n,2);case"narrow":return""+r+i+(n>0?":"+n:"");case"techie":return""+r+et(i,2)+et(n,2);default:throw new RangeError("Value format "+e+" is out of range for property format")}}function gt(t){return K(t,["hour","minute","second","millisecond"])}var yt=/[A-Za-z_+-]{1,256}(:?\/[A-Za-z_+-]{1,256}(\/[A-Za-z_+-]{1,256})?)?/;function vt(t){return JSON.stringify(t,Object.keys(t).sort())}var wt=["January","February","March","April","May","June","July","August","September","October","November","December"],bt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xt=["J","F","M","A","M","J","J","A","S","O","N","D"];function St(t){switch(t){case"narrow":return xt;case"short":return bt;case"long":return wt;case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var Tt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],kt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Mt=["M","T","W","T","F","S","S"];function Ot(t){switch(t){case"narrow":return Mt;case"short":return kt;case"long":return Tt;case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var Et=["AM","PM"],Lt=["Before Christ","Anno Domini"],Ct=["BC","AD"],Dt=["B","A"];function At(t){switch(t){case"narrow":return Dt;case"short":return Ct;case"long":return Lt;default:return null}}function Nt(t,e){for(var i,n="",r=l(t);!(i=r()).done;){var s=i.value;s.literal?n+=s.val:n+=e(s.val)}return n}var It={D:T,DD:k,DDD:O,DDDD:E,t:L,tt:C,ttt:D,tttt:A,T:N,TT:I,TTT:P,TTTT:_,f:B,ff:R,fff:H,ffff:$,F,FF:j,FFF:V,FFFF:Y},Pt=function(){function t(t,e){this.opts=e,this.loc=t,this.systemLoc=null}t.create=function(e,i){return void 0===i&&(i={}),new t(e,i)},t.parseFormat=function(t){for(var e=null,i="",n=!1,r=[],s=0;s0&&r.push({literal:n,val:i}),e=null,i="",n=!n):n||o===e?i+=o:(i.length>0&&r.push({literal:!1,val:i}),i=o,e=o)}return i.length>0&&r.push({literal:n,val:i}),r},t.macroTokenToFormatOpts=function(t){return It[t]};var e=t.prototype;return e.formatWithSystemDefault=function(t,e){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,Object.assign({},this.opts,e)).format()},e.formatDateTime=function(t,e){return void 0===e&&(e={}),this.loc.dtFormatter(t,Object.assign({},this.opts,e)).format()},e.formatDateTimeParts=function(t,e){return void 0===e&&(e={}),this.loc.dtFormatter(t,Object.assign({},this.opts,e)).formatToParts()},e.resolvedOptions=function(t,e){return void 0===e&&(e={}),this.loc.dtFormatter(t,Object.assign({},this.opts,e)).resolvedOptions()},e.num=function(t,e){if(void 0===e&&(e=0),this.opts.forceSimple)return et(t,e);var i=Object.assign({},this.opts);return e>0&&(i.padTo=e),this.loc.numberFormatter(i).format(t)},e.formatDateTimeFromString=function(e,i){var n=this,r="en"===this.loc.listingMode(),s=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar&&G(),o=function(t,i){return n.loc.extract(e,t,i)},a=function(t){return e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):""},u=function(t,i){return r?function(t,e){return St(e)[t.month-1]}(e,t):o(i?{month:t}:{month:t,day:"numeric"},"month")},h=function(t,i){return r?function(t,e){return Ot(e)[t.weekday-1]}(e,t):o(i?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday")},c=function(t){return r?function(t,e){return At(e)[t.year<0?0:1]}(e,t):o({era:t},"era")};return Nt(t.parseFormat(i),(function(i){switch(i){case"S":return n.num(e.millisecond);case"u":case"SSS":return n.num(e.millisecond,3);case"s":return n.num(e.second);case"ss":return n.num(e.second,2);case"m":return n.num(e.minute);case"mm":return n.num(e.minute,2);case"h":return n.num(e.hour%12==0?12:e.hour%12);case"hh":return n.num(e.hour%12==0?12:e.hour%12,2);case"H":return n.num(e.hour);case"HH":return n.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:n.opts.allowZ});case"ZZ":return a({format:"short",allowZ:n.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:n.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:n.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:n.loc.locale});case"z":return e.zoneName;case"a":return r?function(t){return Et[t.hour<12?0:1]}(e):o({hour:"numeric",hour12:!0},"dayperiod");case"d":return s?o({day:"numeric"},"day"):n.num(e.day);case"dd":return s?o({day:"2-digit"},"day"):n.num(e.day,2);case"c":return n.num(e.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"E":return n.num(e.weekday);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return s?o({month:"numeric",day:"numeric"},"month"):n.num(e.month);case"LL":return s?o({month:"2-digit",day:"numeric"},"month"):n.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return s?o({month:"numeric"},"month"):n.num(e.month);case"MM":return s?o({month:"2-digit"},"month"):n.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return s?o({year:"numeric"},"year"):n.num(e.year);case"yy":return s?o({year:"2-digit"},"year"):n.num(e.year.toString().slice(-2),2);case"yyyy":return s?o({year:"numeric"},"year"):n.num(e.year,4);case"yyyyyy":return s?o({year:"numeric"},"year"):n.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return n.num(e.weekYear.toString().slice(-2),2);case"kkkk":return n.num(e.weekYear,4);case"W":return n.num(e.weekNumber);case"WW":return n.num(e.weekNumber,2);case"o":return n.num(e.ordinal);case"ooo":return n.num(e.ordinal,3);case"q":return n.num(e.quarter);case"qq":return n.num(e.quarter,2);case"X":return n.num(Math.floor(e.ts/1e3));case"x":return n.num(e.ts);default:return function(i){var r=t.macroTokenToFormatOpts(i);return r?n.formatWithSystemDefault(e,r):i}(i)}}))},e.formatDurationFromString=function(e,i){var n,r=this,s=function(t){switch(t[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"M":return"month";case"y":return"year";default:return null}},o=t.parseFormat(i),a=o.reduce((function(t,e){var i=e.literal,n=e.val;return i?t:t.concat(n)}),[]),u=e.shiftTo.apply(e,a.map(s).filter((function(t){return t})));return Nt(o,(n=u,function(t){var e=s(t);return e?r.num(n.get(e),t.length):t}))},t}(),_t=function(){function t(t,e){this.reason=t,this.explanation=e}return t.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},t}(),Bt=function(){function t(){}var e=t.prototype;return e.offsetName=function(t,e){throw new w},e.formatOffset=function(t,e){throw new w},e.offset=function(t){throw new w},e.equals=function(t){throw new w},n(t,[{key:"type",get:function(){throw new w}},{key:"name",get:function(){throw new w}},{key:"universal",get:function(){throw new w}},{key:"isValid",get:function(){throw new w}}]),t}(),Ft=null,Rt=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var i=e.prototype;return i.offsetName=function(t,e){return lt(t,e.format,e.locale)},i.formatOffset=function(t,e){return pt(this.offset(t),e)},i.offset=function(t){return-new Date(t).getTimezoneOffset()},i.equals=function(t){return"local"===t.type},n(e,[{key:"type",get:function(){return"local"}},{key:"name",get:function(){return X()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:"local"}},{key:"universal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===Ft&&(Ft=new e),Ft}}]),e}(Bt),jt=RegExp("^"+yt.source+"$"),zt={},Ht={year:0,month:1,day:2,hour:3,minute:4,second:5},Vt={},$t=function(t){function e(i){var n;return(n=t.call(this)||this).zoneName=i,n.valid=e.isValidZone(i),n}r(e,t),e.create=function(t){return Vt[t]||(Vt[t]=new e(t)),Vt[t]},e.resetCache=function(){Vt={},zt={}},e.isValidSpecifier=function(t){return!(!t||!t.match(jt))},e.isValidZone=function(t){try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch(t){return!1}},e.parseGMTOffset=function(t){if(t){var e=t.match(/^Etc\/GMT([+-]\d{1,2})$/i);if(e)return-60*parseInt(e[1])}return null};var i=e.prototype;return i.offsetName=function(t,e){return lt(t,e.format,e.locale,this.name)},i.formatOffset=function(t,e){return pt(this.offset(t),e)},i.offset=function(t){var e,i=new Date(t),n=(e=this.name,zt[e]||(zt[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),zt[e]),r=n.formatToParts?function(t,e){for(var i=t.formatToParts(e),n=[],r=0;r=0?c:1e3+c))/6e4},i.equals=function(t){return"iana"===t.type&&t.name===this.name},n(e,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"universal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),e}(Bt),Yt=null,Ut=function(t){function e(e){var i;return(i=t.call(this)||this).fixed=e,i}r(e,t),e.instance=function(t){return 0===t?e.utcInstance:new e(t)},e.parseSpecifier=function(t){if(t){var i=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new e(ft(i[1],i[2]))}return null},n(e,null,[{key:"utcInstance",get:function(){return null===Yt&&(Yt=new e(0)),Yt}}]);var i=e.prototype;return i.offsetName=function(){return this.name},i.formatOffset=function(t,e){return pt(this.fixed,e)},i.offset=function(){return this.fixed},i.equals=function(t){return"fixed"===t.type&&t.fixed===this.fixed},n(e,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+pt(this.fixed,"narrow")}},{key:"universal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}]),e}(Bt),Wt=function(t){function e(e){var i;return(i=t.call(this)||this).zoneName=e,i}r(e,t);var i=e.prototype;return i.offsetName=function(){return null},i.formatOffset=function(){return""},i.offset=function(){return NaN},i.equals=function(){return!1},n(e,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"universal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),e}(Bt);function Zt(t,e){var i;if(U(t)||null===t)return e;if(t instanceof Bt)return t;if("string"==typeof t){var n=t.toLowerCase();return"local"===n?e:"utc"===n||"gmt"===n?Ut.utcInstance:null!=(i=$t.parseGMTOffset(t))?Ut.instance(i):$t.isValidSpecifier(n)?$t.create(t):Ut.parseSpecifier(n)||new Wt(t)}return W(t)?Ut.instance(t):"object"==typeof t&&t.offset&&"number"==typeof t.offset?t:new Wt(t)}var Xt=function(){return Date.now()},Gt=null,qt=null,Jt=null,Kt=null,Qt=!1,te=function(){function t(){}return t.resetCaches=function(){ce.resetCache(),$t.resetCache()},n(t,null,[{key:"now",get:function(){return Xt},set:function(t){Xt=t}},{key:"defaultZoneName",get:function(){return t.defaultZone.name},set:function(t){Gt=t?Zt(t):null}},{key:"defaultZone",get:function(){return Gt||Rt.instance}},{key:"defaultLocale",get:function(){return qt},set:function(t){qt=t}},{key:"defaultNumberingSystem",get:function(){return Jt},set:function(t){Jt=t}},{key:"defaultOutputCalendar",get:function(){return Kt},set:function(t){Kt=t}},{key:"throwOnInvalid",get:function(){return Qt},set:function(t){Qt=t}}]),t}(),ee={};function ie(t,e){void 0===e&&(e={});var i=JSON.stringify([t,e]),n=ee[i];return n||(n=new Intl.DateTimeFormat(t,e),ee[i]=n),n}var ne={},re={};var se=null;function oe(t,e,i,n,r){var s=t.listingMode(i);return"error"===s?null:"en"===s?n(e):r(e)}var ae=function(){function t(t,e,i){if(this.padTo=i.padTo||0,this.floor=i.floor||!1,!e&&X()){var n={useGrouping:!1};i.padTo>0&&(n.minimumIntegerDigits=i.padTo),this.inf=function(t,e){void 0===e&&(e={});var i=JSON.stringify([t,e]),n=ne[i];return n||(n=new Intl.NumberFormat(t,e),ne[i]=n),n}(t,n)}}return t.prototype.format=function(t){if(this.inf){var e=this.floor?Math.floor(t):t;return this.inf.format(e)}return et(this.floor?Math.floor(t):rt(t,3),this.padTo)},t}(),ue=function(){function t(t,e,i){var n;if(this.opts=i,this.hasIntl=X(),t.zone.universal&&this.hasIntl){var r=t.offset/60*-1;r>=-14&&r<=12&&r%1==0?(n=r>=0?"Etc/GMT+"+r:"Etc/GMT"+r,this.dt=t):(n="UTC",i.timeZoneName?this.dt=t:this.dt=0===t.offset?t:un.fromMillis(t.ts+60*t.offset*1e3))}else"local"===t.zone.type?this.dt=t:(this.dt=t,n=t.zone.name);if(this.hasIntl){var s=Object.assign({},this.opts);n&&(s.timeZone=n),this.dtf=ie(e,s)}}var e=t.prototype;return e.format=function(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());var t=function(t){var e="EEEE, LLLL d, yyyy, h:mm a";switch(vt(K(t,["weekday","era","year","month","day","hour","minute","second","timeZoneName","hour12"]))){case vt(T):return"M/d/yyyy";case vt(k):return"LLL d, yyyy";case vt(M):return"EEE, LLL d, yyyy";case vt(O):return"LLLL d, yyyy";case vt(E):return"EEEE, LLLL d, yyyy";case vt(L):return"h:mm a";case vt(C):return"h:mm:ss a";case vt(D):case vt(A):return"h:mm a";case vt(N):return"HH:mm";case vt(I):return"HH:mm:ss";case vt(P):case vt(_):return"HH:mm";case vt(B):return"M/d/yyyy, h:mm a";case vt(R):return"LLL d, yyyy, h:mm a";case vt(H):return"LLLL d, yyyy, h:mm a";case vt($):return e;case vt(F):return"M/d/yyyy, h:mm:ss a";case vt(j):return"LLL d, yyyy, h:mm:ss a";case vt(z):return"EEE, d LLL yyyy, h:mm a";case vt(V):return"LLLL d, yyyy, h:mm:ss a";case vt(Y):return"EEEE, LLLL d, yyyy, h:mm:ss a";default:return e}}(this.opts),e=ce.create("en-US");return Pt.create(e).formatDateTimeFromString(this.dt,t)},e.formatToParts=function(){return this.hasIntl&&G()?this.dtf.formatToParts(this.dt.toJSDate()):[]},e.resolvedOptions=function(){return this.hasIntl?this.dtf.resolvedOptions():{locale:"en-US",numberingSystem:"latn",outputCalendar:"gregory"}},t}(),he=function(){function t(t,e,i){this.opts=Object.assign({style:"long"},i),!e&&q()&&(this.rtf=function(t,e){void 0===e&&(e={});var i=e,n=(i.base,function(t,e){if(null==t)return{};var i,n,r={},s=Object.keys(t);for(n=0;n=0||(r[i]=t[i]);return r}(i,["base"])),r=JSON.stringify([t,n]),s=re[r];return s||(s=new Intl.RelativeTimeFormat(t,e),re[r]=s),s}(t,i))}var e=t.prototype;return e.format=function(t,e){return this.rtf?this.rtf.format(t,e):function(t,e,i,n){void 0===i&&(i="always"),void 0===n&&(n=!1);var r={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(t);if("auto"===i&&s){var o="days"===t;switch(e){case 1:return o?"tomorrow":"next "+r[t][0];case-1:return o?"yesterday":"last "+r[t][0];case 0:return o?"today":"this "+r[t][0]}}var a=Object.is(e,-0)||e<0,u=Math.abs(e),h=1===u,c=r[t],l=n?h?c[1]:c[2]||c[1]:h?r[t][0]:t;return a?u+" "+l+" ago":"in "+u+" "+l}(e,t,this.opts.numeric,"long"!==this.opts.style)},e.formatToParts=function(t,e){return this.rtf?this.rtf.formatToParts(t,e):[]},t}(),ce=function(){function t(t,e,i,n){var r=function(t){var e=t.indexOf("-u-");if(-1===e)return[t];var i,n=t.substring(0,e);try{i=ie(t).resolvedOptions()}catch(t){i=ie(n).resolvedOptions()}var r=i;return[n,r.numberingSystem,r.calendar]}(t),s=r[0],o=r[1],a=r[2];this.locale=s,this.numberingSystem=e||o||null,this.outputCalendar=i||a||null,this.intl=function(t,e,i){return X()?i||e?(t+="-u",i&&(t+="-ca-"+i),e&&(t+="-nu-"+e),t):t:[]}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}t.fromOpts=function(e){return t.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)},t.create=function(e,i,n,r){void 0===r&&(r=!1);var s=e||te.defaultLocale;return new t(s||(r?"en-US":function(){if(se)return se;if(X()){var t=(new Intl.DateTimeFormat).resolvedOptions().locale;return se=t&&"und"!==t?t:"en-US"}return se="en-US"}()),i||te.defaultNumberingSystem,n||te.defaultOutputCalendar,s)},t.resetCache=function(){se=null,ee={},ne={},re={}},t.fromObject=function(e){var i=void 0===e?{}:e,n=i.locale,r=i.numberingSystem,s=i.outputCalendar;return t.create(n,r,s)};var e=t.prototype;return e.listingMode=function(t){void 0===t&&(t=!0);var e=X()&&G(),i=this.isEnglish(),n=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e||i&&n||t?!e||i&&n?"en":"intl":"error"},e.clone=function(e){return e&&0!==Object.getOwnPropertyNames(e).length?t.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this},e.redefaultToEN=function(t){return void 0===t&&(t={}),this.clone(Object.assign({},t,{defaultToEN:!0}))},e.redefaultToSystem=function(t){return void 0===t&&(t={}),this.clone(Object.assign({},t,{defaultToEN:!1}))},e.months=function(t,e,i){var n=this;return void 0===e&&(e=!1),void 0===i&&(i=!0),oe(this,t,i,St,(function(){var i=e?{month:t,day:"numeric"}:{month:t},r=e?"format":"standalone";return n.monthsCache[r][t]||(n.monthsCache[r][t]=function(t){for(var e=[],i=1;i<=12;i++){var n=un.utc(2016,i,1);e.push(t(n))}return e}((function(t){return n.extract(t,i,"month")}))),n.monthsCache[r][t]}))},e.weekdays=function(t,e,i){var n=this;return void 0===e&&(e=!1),void 0===i&&(i=!0),oe(this,t,i,Ot,(function(){var i=e?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},r=e?"format":"standalone";return n.weekdaysCache[r][t]||(n.weekdaysCache[r][t]=function(t){for(var e=[],i=1;i<=7;i++){var n=un.utc(2016,11,13+i);e.push(t(n))}return e}((function(t){return n.extract(t,i,"weekday")}))),n.weekdaysCache[r][t]}))},e.meridiems=function(t){var e=this;return void 0===t&&(t=!0),oe(this,void 0,t,(function(){return Et}),(function(){if(!e.meridiemCache){var t={hour:"numeric",hour12:!0};e.meridiemCache=[un.utc(2016,11,13,9),un.utc(2016,11,13,19)].map((function(i){return e.extract(i,t,"dayperiod")}))}return e.meridiemCache}))},e.eras=function(t,e){var i=this;return void 0===e&&(e=!0),oe(this,t,e,At,(function(){var e={era:t};return i.eraCache[t]||(i.eraCache[t]=[un.utc(-40,1,1),un.utc(2017,1,1)].map((function(t){return i.extract(t,e,"era")}))),i.eraCache[t]}))},e.extract=function(t,e,i){var n=this.dtFormatter(t,e).formatToParts().find((function(t){return t.type.toLowerCase()===i}));return n?n.value:null},e.numberFormatter=function(t){return void 0===t&&(t={}),new ae(this.intl,t.forceSimple||this.fastNumbers,t)},e.dtFormatter=function(t,e){return void 0===e&&(e={}),new ue(t,this.intl,e)},e.relFormatter=function(t){return void 0===t&&(t={}),new he(this.intl,this.isEnglish(),t)},e.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||X()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},e.equals=function(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar},n(t,[{key:"fastNumbers",get:function(){var t;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(t=this).numberingSystem||"latn"===t.numberingSystem)&&("latn"===t.numberingSystem||!t.locale||t.locale.startsWith("en")||X()&&"latn"===new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),t}();function le(){for(var t=arguments.length,e=new Array(t),i=0;i1?e-1:0),n=1;n3?Tt.indexOf(t)+1:kt.indexOf(t)+1),a}var Ie=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Pe(t){var e,i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=Ne(i,s,r,n,o,a,u);return e=h?Ae[h]:c?0:ft(l,f),[d,new Ut(e)]}var _e=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Be=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Fe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Re(t){var e=t[1],i=t[2],n=t[3];return[Ne(e,t[4],n,i,t[5],t[6],t[7]),Ut.utcInstance]}function je(t){var e=t[1],i=t[2],n=t[3],r=t[4],s=t[5],o=t[6];return[Ne(e,t[7],i,n,r,s,o),Ut.utcInstance]}var ze=le(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ve),He=le(/(\d{4})-?W(\d\d)(?:-?(\d))?/,ve),Ve=le(/(\d{4})-?(\d{3})/,ve),$e=le(ye),Ye=fe(ke,Me,Oe),Ue=fe(we,Me,Oe),We=fe(be,Me),Ze=fe(Me,Oe),Xe=fe(Me),Ge=le(/(\d{4})-(\d\d)-(\d\d)/,Se),qe=le(xe),Je=fe(ke,Me,Oe,Ee),Ke=fe(Me,Oe,Ee),Qe={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},ti=Object.assign({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Qe),ei=Object.assign({years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Qe),ii=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],ni=ii.slice(0).reverse();function ri(t,e,i){void 0===i&&(i=!1);var n={values:i?e.values:Object.assign({},t.values,e.values||{}),loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy};return new oi(n)}function si(t,e,i,n,r){var s=t[r][i],o=e[i]/s,a=Math.sign(o)!==Math.sign(n[r])&&0!==n[r]&&Math.abs(o)<=1?function(t){return t<0?Math.floor(t):Math.ceil(t)}(o):Math.trunc(o);n[r]+=a,e[i]-=a*s}var oi=function(){function t(t){var e="longterm"===t.conversionAccuracy||!1;this.values=t.values,this.loc=t.loc||ce.create(),this.conversionAccuracy=e?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=e?ei:ti,this.isLuxonDuration=!0}t.fromMillis=function(e,i){return t.fromObject(Object.assign({milliseconds:e},i))},t.fromObject=function(e){if(null==e||"object"!=typeof e)throw new v("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new t({values:mt(e,t.normalizeUnit,["locale","numberingSystem","conversionAccuracy","zone"]),loc:ce.fromObject(e),conversionAccuracy:e.conversionAccuracy})},t.fromISO=function(e,i){var n=function(t){return de(t,[Ce,De])}(e)[0];if(n){var r=Object.assign(n,i);return t.fromObject(r)}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.fromISOTime=function(e,i){var n=function(t){return de(t,[Le,Xe])}(e)[0];if(n){var r=Object.assign(n,i);return t.fromObject(r)}return t.invalid("unparsable",'the input "'+e+"\" can't be parsed as ISO 8601")},t.invalid=function(e,i){if(void 0===i&&(i=null),!e)throw new v("need to specify a reason the Duration is invalid");var n=e instanceof _t?e:new _t(e,i);if(te.throwOnInvalid)throw new p(n);return new t({invalid:n})},t.normalizeUnit=function(t){var e={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t?t.toLowerCase():t];if(!e)throw new y(t);return e},t.isDuration=function(t){return t&&t.isLuxonDuration||!1};var e=t.prototype;return e.toFormat=function(t,e){void 0===e&&(e={});var i=Object.assign({},e,{floor:!1!==e.round&&!1!==e.floor});return this.isValid?Pt.create(this.loc,i).formatDurationFromString(this,t):"Invalid Duration"},e.toObject=function(t){if(void 0===t&&(t={}),!this.isValid)return{};var e=Object.assign({},this.values);return t.includeConfig&&(e.conversionAccuracy=this.conversionAccuracy,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e},e.toISO=function(){if(!this.isValid)return null;var t="P";return 0!==this.years&&(t+=this.years+"Y"),0===this.months&&0===this.quarters||(t+=this.months+3*this.quarters+"M"),0!==this.weeks&&(t+=this.weeks+"W"),0!==this.days&&(t+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(t+="T"),0!==this.hours&&(t+=this.hours+"H"),0!==this.minutes&&(t+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(t+=rt(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===t&&(t+="T0S"),t},e.toISOTime=function(t){if(void 0===t&&(t={}),!this.isValid)return null;var e=this.toMillis();if(e<0||e>=864e5)return null;t=Object.assign({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},t);var i=this.shiftTo("hours","minutes","seconds","milliseconds"),n="basic"===t.format?"hhmm":"hh:mm";t.suppressSeconds&&0===i.seconds&&0===i.milliseconds||(n+="basic"===t.format?"ss":":ss",t.suppressMilliseconds&&0===i.milliseconds||(n+=".SSS"));var r=i.toFormat(n);return t.includePrefix&&(r="T"+r),r},e.toJSON=function(){return this.toISO()},e.toString=function(){return this.toISO()},e.toMillis=function(){return this.as("milliseconds")},e.valueOf=function(){return this.toMillis()},e.plus=function(t){if(!this.isValid)return this;for(var e,i=ai(t),n={},r=l(ii);!(e=r()).done;){var s=e.value;(Q(i.values,s)||Q(this.values,s))&&(n[s]=i.get(s)+this.get(s))}return ri(this,{values:n},!0)},e.minus=function(t){if(!this.isValid)return this;var e=ai(t);return this.plus(e.negate())},e.mapUnits=function(t){if(!this.isValid)return this;for(var e={},i=0,n=Object.keys(this.values);i=0){r=c;var f=0;for(var d in a)f+=this.matrix[d][c]*a[d],a[d]=0;W(u[c])&&(f+=u[c]);var m=Math.trunc(f);for(var p in o[c]=m,a[c]=f-m,u)ii.indexOf(p)>ii.indexOf(c)&&si(this.matrix,u,p,o,c)}else W(u[c])&&(a[c]=u[c])}for(var g in a)0!==a[g]&&(o[r]+=g===r?a[g]:a[g]/this.matrix[r][g]);return ri(this,{values:o},!0).normalize()},e.negate=function(){if(!this.isValid)return this;for(var t={},e=0,i=Object.keys(this.values);et},e.isBefore=function(t){return!!this.isValid&&this.e<=t},e.contains=function(t){return!!this.isValid&&this.s<=t&&this.e>t},e.set=function(e){var i=void 0===e?{}:e,n=i.start,r=i.end;return this.isValid?t.fromDateTimes(n||this.s,r||this.e):this},e.splitAt=function(){var e=this;if(!this.isValid)return[];for(var i=arguments.length,n=new Array(i),r=0;r+this.e?this.e:h;o.push(t.fromDateTimes(a,c)),a=c,u+=1}return o},e.splitBy=function(e){var i=ai(e);if(!this.isValid||!i.isValid||0===i.as("milliseconds"))return[];for(var n,r,s=this.s,o=[];s+this.e?this.e:n,o.push(t.fromDateTimes(s,r)),s=r;return o},e.divideEqually=function(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]},e.overlaps=function(t){return this.e>t.s&&this.s=t.e},e.equals=function(t){return!(!this.isValid||!t.isValid)&&this.s.equals(t.s)&&this.e.equals(t.e)},e.intersection=function(e){if(!this.isValid)return this;var i=this.s>e.s?this.s:e.s,n=this.en?null:t.fromDateTimes(i,n)},e.union=function(e){if(!this.isValid)return this;var i=this.se.e?this.e:e.e;return t.fromDateTimes(i,n)},t.merge=function(t){var e=t.sort((function(t,e){return t.s-e.s})).reduce((function(t,e){var i=t[0],n=t[1];return n?n.overlaps(e)||n.abutsStart(e)?[i,n.union(e)]:[i.concat([n]),e]:[i,e]}),[[],null]),i=e[0],n=e[1];return n&&i.push(n),i},t.xor=function(e){for(var i,n,r=null,s=0,o=[],a=e.map((function(t){return[{time:t.s,type:"s"},{time:t.e,type:"e"}]})),u=l((i=Array.prototype).concat.apply(i,a).sort((function(t,e){return t.time-e.time})));!(n=u()).done;){var h=n.value;1===(s+="s"===h.type?1:-1)?r=h.time:(r&&+r!=+h.time&&o.push(t.fromDateTimes(r,h.time)),r=null)}return t.merge(o)},e.difference=function(){for(var e=this,i=arguments.length,n=new Array(i),r=0;r=o&&n<=a&&(e+=n-o)}}return parseInt(e,10)}return e}(i))}}}var vi="( |"+String.fromCharCode(160)+")",wi=new RegExp(vi,"g");function bi(t){return t.replace(/\./g,"\\.?").replace(wi,vi)}function xi(t){return t.replace(/\./g,"").replace(wi," ").toLowerCase()}function Si(t,e){return null===t?null:{regex:RegExp(t.map(bi).join("|")),deser:function(i){var n=i[0];return t.findIndex((function(t){return xi(n)===xi(t)}))+e}}}function Ti(t,e){return{regex:t,deser:function(t){return ft(t[1],t[2])},groups:e}}function ki(t){return{regex:t,deser:function(t){return t[0]}}}var Mi={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}},Oi=null;function Ei(t,e,i){var n=function(t,e){var i;return(i=Array.prototype).concat.apply(i,t.map((function(t){return function(t,e){if(t.literal)return t;var i=Pt.macroTokenToFormatOpts(t.val);if(!i)return t;var n=Pt.create(e,i).formatDateTimeParts((Oi||(Oi=un.fromMillis(1555555555555)),Oi)).map((function(t){return function(t,e,i){var n=t.type,r=t.value;if("literal"===n)return{literal:!0,val:r};var s=i[n],o=Mi[n];return"object"==typeof o&&(o=o[s]),o?{literal:!1,val:o}:void 0}(t,0,i)}));return n.includes(void 0)?t:n}(t,e)})))}(Pt.parseFormat(i),t),r=n.map((function(e){return i=e,r=gi(n=t),s=gi(n,"{2}"),o=gi(n,"{3}"),a=gi(n,"{4}"),u=gi(n,"{6}"),h=gi(n,"{1,2}"),c=gi(n,"{1,3}"),l=gi(n,"{1,6}"),f=gi(n,"{1,9}"),d=gi(n,"{2,4}"),m=gi(n,"{4,6}"),p=function(t){return{regex:RegExp((e=t.val,e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(t){return t[0]},literal:!0};var e},(g=function(t){if(i.literal)return p(t);switch(t.val){case"G":return Si(n.eras("short",!1),0);case"GG":return Si(n.eras("long",!1),0);case"y":return yi(l);case"yy":return yi(d,ct);case"yyyy":return yi(a);case"yyyyy":return yi(m);case"yyyyyy":return yi(u);case"M":return yi(h);case"MM":return yi(s);case"MMM":return Si(n.months("short",!0,!1),1);case"MMMM":return Si(n.months("long",!0,!1),1);case"L":return yi(h);case"LL":return yi(s);case"LLL":return Si(n.months("short",!1,!1),1);case"LLLL":return Si(n.months("long",!1,!1),1);case"d":return yi(h);case"dd":return yi(s);case"o":return yi(c);case"ooo":return yi(o);case"HH":return yi(s);case"H":return yi(h);case"hh":return yi(s);case"h":return yi(h);case"mm":return yi(s);case"m":case"q":return yi(h);case"qq":return yi(s);case"s":return yi(h);case"ss":return yi(s);case"S":return yi(c);case"SSS":return yi(o);case"u":return ki(f);case"a":return Si(n.meridiems(),0);case"kkkk":return yi(a);case"kk":return yi(d,ct);case"W":return yi(h);case"WW":return yi(s);case"E":case"c":return yi(r);case"EEE":return Si(n.weekdays("short",!1,!1),1);case"EEEE":return Si(n.weekdays("long",!1,!1),1);case"ccc":return Si(n.weekdays("short",!0,!1),1);case"cccc":return Si(n.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ti(new RegExp("([+-]"+h.source+")(?::("+s.source+"))?"),2);case"ZZZ":return Ti(new RegExp("([+-]"+h.source+")("+s.source+")?"),2);case"z":return ki(/[a-z_+-/]{1,256}?/i);default:return p(t)}}(i)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"}).token=i,g;var i,n,r,s,o,a,u,h,c,l,f,d,m,p,g})),s=r.find((function(t){return t.invalidReason}));if(s)return{input:e,tokens:n,invalidReason:s.invalidReason};var o=function(t){return["^"+t.map((function(t){return t.regex})).reduce((function(t,e){return t+"("+e.source+")"}),"")+"$",t]}(r),a=o[0],u=o[1],h=RegExp(a,"i"),c=function(t,e,i){var n=t.match(e);if(n){var r={},s=1;for(var o in i)if(Q(i,o)){var a=i[o],u=a.groups?a.groups+1:1;!a.literal&&a.token&&(r[a.token.val[0]]=a.deser(n.slice(s,s+u))),s+=u}return[n,r]}return[n,{}]}(e,h,u),l=c[0],f=c[1],d=f?function(t){var e;return e=U(t.Z)?U(t.z)?null:$t.create(t.z):new Ut(t.Z),U(t.q)||(t.M=3*(t.q-1)+1),U(t.h)||(t.h<12&&1===t.a?t.h+=12:12===t.h&&0===t.a&&(t.h=0)),0===t.G&&t.y&&(t.y=-t.y),U(t.u)||(t.S=nt(t.u)),[Object.keys(t).reduce((function(e,i){var n=function(t){switch(t){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(i);return n&&(e[n]=t[i]),e}),{}),e]}(f):[null,null],m=d[0],p=d[1];if(Q(f,"a")&&Q(f,"H"))throw new g("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:n,regex:h,rawMatches:l,matches:f,result:m,zone:p}}var Li=[0,31,59,90,120,151,181,212,243,273,304,334],Ci=[0,31,60,91,121,152,182,213,244,274,305,335];function Di(t,e){return new _t("unit out of range","you specified "+e+" (of type "+typeof e+") as a "+t+", which is invalid")}function Ai(t,e,i){var n=new Date(Date.UTC(t,e-1,i)).getUTCDay();return 0===n?7:n}function Ni(t,e,i){return i+(st(t)?Ci:Li)[e-1]}function Ii(t,e){var i=st(t)?Ci:Li,n=i.findIndex((function(t){return tht(i)?(e=i+1,a=1):e=i,Object.assign({weekYear:e,weekNumber:a,weekday:o},gt(t))}function _i(t){var e,i=t.weekYear,n=t.weekNumber,r=t.weekday,s=Ai(i,1,4),o=ot(i),a=7*n+r-s-3;a<1?a+=ot(e=i-1):a>o?(e=i+1,a-=ot(i)):e=i;var u=Ii(e,a),h=u.month,c=u.day;return Object.assign({year:e,month:h,day:c},gt(t))}function Bi(t){var e=t.year,i=Ni(e,t.month,t.day);return Object.assign({year:e,ordinal:i},gt(t))}function Fi(t){var e=t.year,i=Ii(e,t.ordinal),n=i.month,r=i.day;return Object.assign({year:e,month:n,day:r},gt(t))}function Ri(t){var e=Z(t.year),i=tt(t.month,1,12),n=tt(t.day,1,at(t.year,t.month));return e?i?!n&&Di("day",t.day):Di("month",t.month):Di("year",t.year)}function ji(t){var e=t.hour,i=t.minute,n=t.second,r=t.millisecond,s=tt(e,0,23)||24===e&&0===i&&0===n&&0===r,o=tt(i,0,59),a=tt(n,0,59),u=tt(r,0,999);return s?o?a?!u&&Di("millisecond",r):Di("second",n):Di("minute",i):Di("hour",e)}var zi="Invalid DateTime",Hi=864e13;function Vi(t){return new _t("unsupported zone",'the zone "'+t.name+'" is not supported')}function $i(t){return null===t.weekData&&(t.weekData=Pi(t.c)),t.weekData}function Yi(t,e){var i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new un(Object.assign({},i,e,{old:i}))}function Ui(t,e,i){var n=t-60*e*1e3,r=i.offset(n);if(e===r)return[n,e];n-=60*(r-e)*1e3;var s=i.offset(n);return r===s?[n,r]:[t-60*Math.min(r,s)*1e3,Math.max(r,s)]}function Wi(t,e){var i=new Date(t+=60*e*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Zi(t,e,i){return Ui(ut(t),e,i)}function Xi(t,e){var i=t.o,n=t.c.year+Math.trunc(e.years),r=t.c.month+Math.trunc(e.months)+3*Math.trunc(e.quarters),s=Object.assign({},t.c,{year:n,month:r,day:Math.min(t.c.day,at(n,r))+Math.trunc(e.days)+7*Math.trunc(e.weeks)}),o=oi.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),a=Ui(ut(s),i,t.zone),u=a[0],h=a[1];return 0!==o&&(u+=o,h=t.zone.offset(u)),{ts:u,o:h}}function Gi(t,e,i,n,r){var s=i.setZone,o=i.zone;if(t&&0!==Object.keys(t).length){var a=e||o,u=un.fromObject(Object.assign(t,i,{zone:a,setZone:void 0}));return s?u:u.setZone(o)}return un.invalid(new _t("unparsable",'the input "'+r+"\" can't be parsed as "+n))}function qi(t,e,i){return void 0===i&&(i=!0),t.isValid?Pt.create(ce.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Ji(t,e){var i=e.suppressSeconds,n=void 0!==i&&i,r=e.suppressMilliseconds,s=void 0!==r&&r,o=e.includeOffset,a=e.includePrefix,u=void 0!==a&&a,h=e.includeZone,c=void 0!==h&&h,l=e.spaceZone,f=void 0!==l&&l,d=e.format,m=void 0===d?"extended":d,p="basic"===m?"HHmm":"HH:mm";n&&0===t.second&&0===t.millisecond||(p+="basic"===m?"ss":":ss",s&&0===t.millisecond||(p+=".SSS")),(c||o)&&f&&(p+=" "),c?p+="z":o&&(p+="basic"===m?"ZZZ":"ZZ");var g=qi(t,p);return u&&(g="T"+g),g}var Ki={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Qi={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},tn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},en=["year","month","day","hour","minute","second","millisecond"],nn=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],rn=["year","ordinal","hour","minute","second","millisecond"];function sn(t){var e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new y(t);return e}function on(t,e){for(var i,n=l(en);!(i=n()).done;){var r=i.value;U(t[r])&&(t[r]=Ki[r])}var s=Ri(t)||ji(t);if(s)return un.invalid(s);var o=te.now(),a=Zi(t,e.offset(o),e),u=a[0],h=a[1];return new un({ts:u,zone:e,o:h})}function an(t,e,i){var n=!!U(i.round)||i.round,r=function(t,r){return t=rt(t,n||i.calendary?0:2,!0),e.loc.clone(i).relFormatter(i).format(t,r)},s=function(n){return i.calendary?e.hasSame(t,n)?0:e.startOf(n).diff(t.startOf(n),n).get(n):e.diff(t,n).get(n)};if(i.unit)return r(s(i.unit),i.unit);for(var o,a=l(i.units);!(o=a()).done;){var u=o.value,h=s(u);if(Math.abs(h)>=1)return r(h,u)}return r(0,i.units[i.units.length-1])}var un=function(){function t(t){var e=t.zone||te.defaultZone,i=t.invalid||(Number.isNaN(t.ts)?new _t("invalid input"):null)||(e.isValid?null:Vi(e));this.ts=U(t.ts)?te.now():t.ts;var n=null,r=null;if(!i)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(e)){var s=[t.old.c,t.old.o];n=s[0],r=s[1]}else{var o=e.offset(this.ts);n=Wi(this.ts,o),n=(i=Number.isNaN(n.year)?new _t("invalid input"):null)?null:n,r=i?null:o}this._zone=e,this.loc=t.loc||ce.create(),this.invalid=i,this.weekData=null,this.c=n,this.o=r,this.isLuxonDateTime=!0}t.now=function(){return new t({})},t.local=function(e,i,n,r,s,o,a){return U(e)?new t({}):on({year:e,month:i,day:n,hour:r,minute:s,second:o,millisecond:a},te.defaultZone)},t.utc=function(e,i,n,r,s,o,a){return U(e)?new t({ts:te.now(),zone:Ut.utcInstance}):on({year:e,month:i,day:n,hour:r,minute:s,second:o,millisecond:a},Ut.utcInstance)},t.fromJSDate=function(e,i){void 0===i&&(i={});var n,r=(n=e,"[object Date]"===Object.prototype.toString.call(n)?e.valueOf():NaN);if(Number.isNaN(r))return t.invalid("invalid input");var s=Zt(i.zone,te.defaultZone);return s.isValid?new t({ts:r,zone:s,loc:ce.fromObject(i)}):t.invalid(Vi(s))},t.fromMillis=function(e,i){if(void 0===i&&(i={}),W(e))return e<-Hi||e>Hi?t.invalid("Timestamp out of range"):new t({ts:e,zone:Zt(i.zone,te.defaultZone),loc:ce.fromObject(i)});throw new v("fromMillis requires a numerical input, but received a "+typeof e+" with value "+e)},t.fromSeconds=function(e,i){if(void 0===i&&(i={}),W(e))return new t({ts:1e3*e,zone:Zt(i.zone,te.defaultZone),loc:ce.fromObject(i)});throw new v("fromSeconds requires a numerical input")},t.fromObject=function(e){var i=Zt(e.zone,te.defaultZone);if(!i.isValid)return t.invalid(Vi(i));var n=te.now(),r=i.offset(n),s=mt(e,sn,["zone","locale","outputCalendar","numberingSystem"]),o=!U(s.ordinal),a=!U(s.year),u=!U(s.month)||!U(s.day),h=a||u,c=s.weekYear||s.weekNumber,f=ce.fromObject(e);if((h||o)&&c)throw new g("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&o)throw new g("Can't mix ordinal dates with month/day");var d,m,p=c||s.weekday&&!h,y=Wi(n,r);p?(d=nn,m=Qi,y=Pi(y)):o?(d=rn,m=tn,y=Bi(y)):(d=en,m=Ki);for(var v,w=!1,b=l(d);!(v=b()).done;){var x=v.value;U(s[x])?s[x]=w?m[x]:y[x]:w=!0}var S=(p?function(t){var e=Z(t.weekYear),i=tt(t.weekNumber,1,ht(t.weekYear)),n=tt(t.weekday,1,7);return e?i?!n&&Di("weekday",t.weekday):Di("week",t.week):Di("weekYear",t.weekYear)}(s):o?function(t){var e=Z(t.year),i=tt(t.ordinal,1,ot(t.year));return e?!i&&Di("ordinal",t.ordinal):Di("year",t.year)}(s):Ri(s))||ji(s);if(S)return t.invalid(S);var T=Zi(p?_i(s):o?Fi(s):s,r,i),k=new t({ts:T[0],zone:i,o:T[1],loc:f});return s.weekday&&h&&e.weekday!==k.weekday?t.invalid("mismatched weekday","you can't specify both a weekday of "+s.weekday+" and a date of "+k.toISO()):k},t.fromISO=function(t,e){void 0===e&&(e={});var i=function(t){return de(t,[ze,Ye],[He,Ue],[Ve,We],[$e,Ze])}(t);return Gi(i[0],i[1],e,"ISO 8601",t)},t.fromRFC2822=function(t,e){void 0===e&&(e={});var i=function(t){return de(function(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(t),[Ie,Pe])}(t);return Gi(i[0],i[1],e,"RFC 2822",t)},t.fromHTTP=function(t,e){void 0===e&&(e={});var i=function(t){return de(t,[_e,Re],[Be,Re],[Fe,je])}(t);return Gi(i[0],i[1],e,"HTTP",e)},t.fromFormat=function(e,i,n){if(void 0===n&&(n={}),U(e)||U(i))throw new v("fromFormat requires an input string and a format");var r=n,s=r.locale,o=void 0===s?null:s,a=r.numberingSystem,u=void 0===a?null:a,h=function(t,e,i){var n=Ei(t,e,i);return[n.result,n.zone,n.invalidReason]}(ce.fromOpts({locale:o,numberingSystem:u,defaultToEN:!0}),e,i),c=h[0],l=h[1],f=h[2];return f?t.invalid(f):Gi(c,l,n,"format "+i,e)},t.fromString=function(e,i,n){return void 0===n&&(n={}),t.fromFormat(e,i,n)},t.fromSQL=function(t,e){void 0===e&&(e={});var i=function(t){return de(t,[Ge,Je],[qe,Ke])}(t);return Gi(i[0],i[1],e,"SQL",t)},t.invalid=function(e,i){if(void 0===i&&(i=null),!e)throw new v("need to specify a reason the DateTime is invalid");var n=e instanceof _t?e:new _t(e,i);if(te.throwOnInvalid)throw new d(n);return new t({invalid:n})},t.isDateTime=function(t){return t&&t.isLuxonDateTime||!1};var e=t.prototype;return e.get=function(t){return this[t]},e.resolvedLocaleOpts=function(t){void 0===t&&(t={});var e=Pt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:e.locale,numberingSystem:e.numberingSystem,outputCalendar:e.calendar}},e.toUTC=function(t,e){return void 0===t&&(t=0),void 0===e&&(e={}),this.setZone(Ut.instance(t),e)},e.toLocal=function(){return this.setZone(te.defaultZone)},e.setZone=function(e,i){var n=void 0===i?{}:i,r=n.keepLocalTime,s=void 0!==r&&r,o=n.keepCalendarTime,a=void 0!==o&&o;if((e=Zt(e,te.defaultZone)).equals(this.zone))return this;if(e.isValid){var u=this.ts;if(s||a){var h=e.offset(this.ts);u=Zi(this.toObject(),h,e)[0]}return Yi(this,{ts:u,zone:e})}return t.invalid(Vi(e))},e.reconfigure=function(t){var e=void 0===t?{}:t,i=e.locale,n=e.numberingSystem,r=e.outputCalendar;return Yi(this,{loc:this.loc.clone({locale:i,numberingSystem:n,outputCalendar:r})})},e.setLocale=function(t){return this.reconfigure({locale:t})},e.set=function(t){if(!this.isValid)return this;var e,i=mt(t,sn,[]);U(i.weekYear)&&U(i.weekNumber)&&U(i.weekday)?U(i.ordinal)?(e=Object.assign(this.toObject(),i),U(i.day)&&(e.day=Math.min(at(e.year,e.month),e.day))):e=Fi(Object.assign(Bi(this.c),i)):e=_i(Object.assign(Pi(this.c),i));var n=Zi(e,this.o,this.zone);return Yi(this,{ts:n[0],o:n[1]})},e.plus=function(t){return this.isValid?Yi(this,Xi(this,ai(t))):this},e.minus=function(t){return this.isValid?Yi(this,Xi(this,ai(t).negate())):this},e.startOf=function(t){if(!this.isValid)return this;var e={},i=oi.normalizeUnit(t);switch(i){case"years":e.month=1;case"quarters":case"months":e.day=1;case"weeks":case"days":e.hour=0;case"hours":e.minute=0;case"minutes":e.second=0;case"seconds":e.millisecond=0}if("weeks"===i&&(e.weekday=1),"quarters"===i){var n=Math.ceil(this.month/3);e.month=3*(n-1)+1}return this.set(e)},e.endOf=function(t){var e;return this.isValid?this.plus((e={},e[t]=1,e)).startOf(t).minus(1):this},e.toFormat=function(t,e){return void 0===e&&(e={}),this.isValid?Pt.create(this.loc.redefaultToEN(e)).formatDateTimeFromString(this,t):zi},e.toLocaleString=function(t){return void 0===t&&(t=T),this.isValid?Pt.create(this.loc.clone(t),t).formatDateTime(this):zi},e.toLocaleParts=function(t){return void 0===t&&(t={}),this.isValid?Pt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]},e.toISO=function(t){return void 0===t&&(t={}),this.isValid?this.toISODate(t)+"T"+this.toISOTime(t):null},e.toISODate=function(t){var e=(void 0===t?{}:t).format,i="basic"===(void 0===e?"extended":e)?"yyyyMMdd":"yyyy-MM-dd";return this.year>9999&&(i="+"+i),qi(this,i)},e.toISOWeekDate=function(){return qi(this,"kkkk-'W'WW-c")},e.toISOTime=function(t){var e=void 0===t?{}:t,i=e.suppressMilliseconds,n=void 0!==i&&i,r=e.suppressSeconds,s=void 0!==r&&r,o=e.includeOffset,a=void 0===o||o,u=e.includePrefix,h=void 0!==u&&u,c=e.format;return Ji(this,{suppressSeconds:s,suppressMilliseconds:n,includeOffset:a,includePrefix:h,format:void 0===c?"extended":c})},e.toRFC2822=function(){return qi(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},e.toHTTP=function(){return qi(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},e.toSQLDate=function(){return qi(this,"yyyy-MM-dd")},e.toSQLTime=function(t){var e=void 0===t?{}:t,i=e.includeOffset,n=void 0===i||i,r=e.includeZone;return Ji(this,{includeOffset:n,includeZone:void 0!==r&&r,spaceZone:!0})},e.toSQL=function(t){return void 0===t&&(t={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(t):null},e.toString=function(){return this.isValid?this.toISO():zi},e.valueOf=function(){return this.toMillis()},e.toMillis=function(){return this.isValid?this.ts:NaN},e.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},e.toJSON=function(){return this.toISO()},e.toBSON=function(){return this.toJSDate()},e.toObject=function(t){if(void 0===t&&(t={}),!this.isValid)return{};var e=Object.assign({},this.c);return t.includeConfig&&(e.outputCalendar=this.outputCalendar,e.numberingSystem=this.loc.numberingSystem,e.locale=this.loc.locale),e},e.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},e.diff=function(t,e,i){if(void 0===e&&(e="milliseconds"),void 0===i&&(i={}),!this.isValid||!t.isValid)return oi.invalid(this.invalid||t.invalid,"created by diffing an invalid DateTime");var n,r=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},i),s=(n=e,Array.isArray(n)?n:[n]).map(oi.normalizeUnit),o=t.valueOf()>this.valueOf(),a=function(t,e,i,n){var r,s=function(t,e,i){for(var n,r,s={},o=0,a=[["years",function(t,e){return e.year-t.year}],["quarters",function(t,e){return e.quarter-t.quarter}],["months",function(t,e){return e.month-t.month+12*(e.year-t.year)}],["weeks",function(t,e){var i=fi(t,e);return(i-i%7)/7}],["days",fi]];o=0){var l;n=h;var f,d=c(t,e);(r=t.plus(((l={})[h]=d,l)))>e?(t=t.plus(((f={})[h]=d-1,f)),d-=1):t=r,s[h]=d}}return[t,s,r,n]}(t,e,i),o=s[0],a=s[1],u=s[2],h=s[3],c=e-o,l=i.filter((function(t){return["hours","minutes","seconds","milliseconds"].indexOf(t)>=0}));0===l.length&&(u0?(f=oi.fromMillis(c,n)).shiftTo.apply(f,l).plus(d):d}(o?this:t,o?t:this,s,r);return o?a.negate():a},e.diffNow=function(e,i){return void 0===e&&(e="milliseconds"),void 0===i&&(i={}),this.diff(t.now(),e,i)},e.until=function(t){return this.isValid?ci.fromDateTimes(this,t):this},e.hasSame=function(t,e){if(!this.isValid)return!1;var i=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(e)<=i&&i<=n.endOf(e)},e.equals=function(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)},e.toRelative=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var i=e.base||t.fromObject({zone:this.zone}),n=e.padding?thisthis.set({month:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return st(this.year)}},{key:"daysInMonth",get:function(){return at(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?ot(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?ht(this.weekYear):NaN}}],[{key:"DATE_SHORT",get:function(){return T}},{key:"DATE_MED",get:function(){return k}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return M}},{key:"DATE_FULL",get:function(){return O}},{key:"DATE_HUGE",get:function(){return E}},{key:"TIME_SIMPLE",get:function(){return L}},{key:"TIME_WITH_SECONDS",get:function(){return C}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return D}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return A}},{key:"TIME_24_SIMPLE",get:function(){return N}},{key:"TIME_24_WITH_SECONDS",get:function(){return I}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return P}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return _}},{key:"DATETIME_SHORT",get:function(){return B}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return F}},{key:"DATETIME_MED",get:function(){return R}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return j}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return z}},{key:"DATETIME_FULL",get:function(){return H}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return V}},{key:"DATETIME_HUGE",get:function(){return $}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return Y}}]),t}();function hn(t){if(un.isDateTime(t))return t;if(t&&t.valueOf&&W(t.valueOf()))return un.fromJSDate(t);if(t&&"object"==typeof t)return un.fromObject(t);throw new v("Unknown datetime argument: "+t+", of type "+typeof t)}e.DateTime=un,e.Duration=oi,e.FixedOffsetZone=Ut,e.IANAZone=$t,e.Info=li,e.Interval=ci,e.InvalidZone=Wt,e.LocalZone=Rt,e.Settings=te,e.VERSION="1.26.0",e.Zone=Bt},276:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fetchXHR=void 0;let i=0;e.fetchXHR=function(t,e=2e3){const n=++i,r=Date.now();console.log(`XHR ${n}: GET ${t}`);const s=new XMLHttpRequest;return s.open("GET",t,!0),s.timeout=e,new Promise(((t,e)=>{s.ontimeout=()=>{console.log(`XHR ${n}: Timeout: ${Date.now()-r} msec`),e(new Error("Timeout"))},s.onerror=t=>{console.log(`XHR ${n}:`,t),e(new Error("Unknown error"))},s.onload=()=>{const i=s.response,o=i.byteLength,a=Date.now()-r;console.log(`XHR ${n}: ${s.status} ${s.statusText} (${o} bytes; ${a} msec)`),s.status>=400?e(new Error(`${s.status} ${s.statusText}`)):t(i)},s.responseType="arraybuffer",s.send()}))}},362:function(t,e,i){var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{u(n.next(t))}catch(t){s(t)}}function a(t){try{u(n.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(130),s=i(276),o=36e5,a=new Map;window.addEventListener("DOMContentLoaded",(()=>n(void 0,void 0,void 0,(function*(){const t=Date.now(),e=document.getElementsByTagName("head")[0];if(e){const t=document.createElement("style");t.setAttribute("type","text/css"),t.media="screen",t.innerHTML="\n.netgraph-tooltip {\n position: absolute;\n font-family: monospace;\n border: solid 2px #aaa;\n border-radius: 0.5em;\n background: #eee;\n padding: 1em;\n display: none;\n}\n\n.netgraph-tooltip-row {\n display: flex;\n flex-flow: row nowrap;\n align-items: baseline;\n}\n\n.netgraph-tooltip-box {\n width: 0.75em;\n height: 0.75em;\n border: solid 1px black;\n display: inline-block;\n margin-right: 0.5em;\n}\n\n.netgraph-tooltip-value {\n flex: 1;\n text-align: left;\n}\n",e.prepend(t)}else console.log("*** Page has no so there will be no styling.");const i=[...document.querySelectorAll("rrd")],u=new Map(i.map((t=>[t.getAttribute("path"),t.getAttribute("timeout")]))),h=new Map;yield Promise.all([...u].map((([t,e])=>n(void 0,void 0,void 0,(function*(){try{if(!t)throw new Error("Missing rrd path");const i=yield s.fetchXHR(t,e?parseInt(e,10):void 0);h.set(t,new r.RrdFile(new DataView(i)))}catch(e){console.log("Failed to load: "+t)}}))))),i.forEach((t=>{var e,i,n;a.set(null!==(e=t.getAttribute("name"))&&void 0!==e?e:"",{rrd:h.get(null!==(i=t.getAttribute("path"))&&void 0!==i?i:""),key:null!==(n=t.getAttribute("data"))&&void 0!==n?n:""})})),[...document.querySelectorAll(".netgraph-group")].forEach((e=>n(void 0,void 0,void 0,(function*(){[...e.querySelectorAll(".netgraph")].forEach((i=>n(void 0,void 0,void 0,(function*(){function s(t){return i.hasAttribute(t)||e.hasAttribute(t)}function u(t,n){var r,s;return null!==(s=null!==(r=i.getAttribute(t))&&void 0!==r?r:e.getAttribute(t))&&void 0!==s?s:n}let h=u("line","").split(/\s*,\s*/).filter((t=>t.length>0)),c=u("error","").split(/\s*,\s*/).filter((t=>t.length>0)),l=parseFloat(u("error-threshold","0.0")),f=new Date(u("time",new Date(t).toISOString())).getTime(),d=f;switch(u("timespan","hour")){case"week":d=f-6048e5;break;case"day":d=f-864e5;break;case"hour":default:d=f-o}const m={unit:u("unit","ms"),maxValue:s("max")?parseInt(u("max",""),10):void 0,fill:s("fill"),colors:s("colors")?u("colors","").split(/\s*,\s*/):void 0,errorColor:u("error-color","#ff3333"),errorOpacity:parseFloat(u("error-opacity","0.3")),showHighlight:!s("no-highlight"),showTooltip:!s("no-tooltip")};yield function(t,e,i,s,o,u,h){return n(this,void 0,void 0,(function*(){let n=!1;const c=new r.TimeSeriesList(e.map((t=>{const e=a.get(t);return e&&e.rrd?e.rrd.getTimeSeries(e.key,o/1e3,u/1e3):(console.log("*** No RRD data for key: "+t),n=!0,r.TimeSeries.fromArrays(a.get(t).key,[],[]))}))),l=new r.TimeSeriesList(i.map((t=>{const e=a.get(t);return e&&e.rrd?e.rrd.getTimeSeries(e.key,o/1e3,u/1e3):(console.log("*** No RRD data for key: "+t),n=!0,r.TimeSeries.fromArrays(a.get(t).key,[],[]))}))),f=t.clientWidth,d=t.clientHeight,m=new r.SvgGraph(c,{graphBackgroundColor:n?"#ffeeee":"#ffffff",showLegend:!1,showTopYLabel:!1,showBottomYLabel:!1,aspectRatio:f/d,fill:h.fill,colors:h.colors,maxY:h.maxValue,padding:0,fontSize:18,yAxisLabelFormat:t=>`${Math.round(100*t)/100}${h.unit}`,highlights:l.list.map((t=>({color:h.errorColor,opacity:h.errorOpacity,threshold:(e,i)=>{var n;return(null!==(n=t.interpolate(e))&&void 0!==n?n:0)>s}})))}),p=document.createElement("img");for(p.style.width="100%",p.style.height="100%",p.src="data:image/svg+xml;base64,"+btoa(m.draw());t.firstChild;)t.removeChild(t.firstChild);if(t.appendChild(p),h.showHighlight){const e=document.createElement("div");e.className="netgraph-tooltip",t.appendChild(e),p.addEventListener("mousemove",(i=>{const n=i.offsetX/p.clientWidth,r=i.offsetY/p.clientHeight,s=m.nearestToMouse(n,r);m.setFocus(s),p.src="data:image/svg+xml;base64,"+btoa(m.draw()),s?h.showTooltip&&function(t,e,i,n,r){const s=n.getMouseGraphBox(),o=t.offsetTop+(s.y+s.height/2)*t.clientHeight,a=t.offsetLeft+(s.x+.25*s.width)*t.clientWidth,u=t.offsetLeft+(s.x+.75*s.width)*t.clientWidth,h=i.xPercent<.5?u:a,c=i.values.map(((t,e)=>[t,e]));c.sort((([t,e],[i,n])=>(null!=i?i:0)-(null!=t?t:0)));const l=n.formatTimestamp(i.timestamp,"L/dd HH:mm"),f="
%title%
".replace("%title%",l),d=c.filter((([t,e])=>void 0!==t)).map((([t,e])=>'\n
\n
\n
%value%
\n
\n'.replace("%color%",n.config.colors[e]).replace("%value%",void 0===t?"(none)":(Math.round(100*t)/100).toString()+r.unit)));e.innerHTML=[f,...d].join("\n"),e.style.display="block",e.style.left=h-e.clientWidth/2+"px",e.style.top=o-e.clientHeight/2+"px"}(t,e,s,m,h):e.style.display="none"})),p.addEventListener("mouseleave",(t=>{e.style.display="none",m.setFocus(),p.src="data:image/svg+xml;base64,"+btoa(m.draw())}))}}))}(i,h,c,l,d,f,m)}))))}))))}))))},216:(t,e)=>{function i(t){return Array.prototype.concat.apply([],t)}function n(t,e,i=1){return[...Array(Math.ceil((e-t)/i)).keys()].map((e=>e*i+t))}Object.defineProperty(e,"__esModule",{value:!0}),e.generate=e.range=e.partition=e.groupBy=e.flatten=e.flatMap=e.binarySearch=e.average=e.arrayGrouped=void 0,e.arrayGrouped=function(t,e){return n(0,t.length,e).map((i=>t.slice(i,i+e)))},e.average=function(t){return t.reduce(((t,e)=>t+e))/t.length},e.binarySearch=function(t,e){let i=-1,n=t.length;for(;i+1>1);e(t[r])?n=r:i=r}return n},e.flatMap=function(t,e){return i(t.map(e))},e.flatten=i,e.groupBy=function(t,e){const i={};return t.forEach((t=>{const n=e(t);void 0===i[n]&&(i[n]=[]),i[n].push(t)})),i},e.partition=function(t,e){const i=[],n=[];return t.forEach((t=>(e(t)?i:n).push(t))),[i,n]},e.range=n,e.generate=function(t,e,i){const n=[];let r=t;do{n.push(r),r=e(r)}while(i(r,n.length));return n}},406:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.quantize4to2=e.RGB=void 0;const n=i(784),r=1/3;class s{constructor(t,e,i){this.red=t,this.green=e,this.blue=i}static from(t){return new s(t>>>16&255,t>>>8&255,255&t)}static named(t){return s.from(n.name_to_rgb(t))}number(){return(this.red<<16)+(this.green<<8)+this.blue}approximateLuma(){return 3*this.red+4*this.green+this.blue>>3}correctLuma(t){const e=t/this.approximateLuma();return new s(Math.round(this.red*e),Math.round(this.green*e),Math.round(this.blue*e))}toHex(){return("000000"+this.number().toString(16)).slice(-6)}toXterm(){return n.get_color(this.toHex())}blend(t,e){const i=1-e;return new s(a(Math.ceil(this.red*e+t.red*i)),a(Math.ceil(this.green*e+t.green*i)),a(Math.ceil(this.blue*e+t.blue*i)))}mix3(t,e){return new s(a(Math.round(this.red*r+t.red*r+e.red*r)),a(Math.round(this.green*r+t.green*r+e.green*r)),a(Math.round(this.blue*r+t.blue*r+e.blue*r)))}distance(t){return Math.sqrt(Math.pow(this.red-t.red,2)+Math.pow(this.green-t.green,2)+Math.pow(this.blue-t.blue,2))}}e.RGB=s;const o=[[0,1,1],[0,2,2],[0,3,2.2],[1,2,2.2],[1,3,2],[2,3,1]];function a(t){return Math.max(Math.min(255,t),0)}e.quantize4to2=function(t){const e=o.map((([e,i,n])=>[e,i,t[e].distance(t[i])*n])).sort(((t,e)=>t[2]-e[2])).slice(0,2),i=t.slice();let n;if(e[0][0]==e[1][0]||e[0][1]==e[1][0])n=[e[0][0],e[0][1],e[1][1]];else{if(e[0][0]!=e[1][1]&&e[0][1]!=e[1][1]){const n=t[e[0][0]].blend(t[e[0][1]],.5),r=t[e[1][0]].blend(t[e[1][1]],.5);return i[e[0][0]]=i[e[0][1]]=n,i[e[1][0]]=i[e[1][1]]=r,i}n=[e[0][0],e[0][1],e[1][0]]}return n[0],n[1],n[2],i[n[0]]=i[n[1]]=i[n[2]]=t[n[0]].mix3(t[n[1]],t[n[2]]),i}},116:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RrdFile=void 0;const n=i(216),r=i(987),s=8.642135e130;e.RrdFile=class{constructor(t){this.data=t,this.offset=0,this.version="",this.littleEndian=!0,this.floatAlign=0,this.intAlign=0,this.intIs64=!1,this.dsCount=0,this.archiveCount=0,this.pdpStep=0,this.lastUpdate=0,this.dataSources=[],this.archives=[],this.validate(),this.readHeader(),this.parse()}toString(){const t=parseInt(this.version,10),e=this.littleEndian?"LE":"BE",i=this.intIs64?64:32;return`RrdFile(${e}, version=${t}, sources=${this.dsCount}, archives=${this.archiveCount}, lastUpdate=${this.lastUpdate}, step=${this.pdpStep}, int=${i}:${this.intAlign}, float=64:${this.floatAlign})`}getKeys(){return[].concat(...this.dataSources.map((t=>this.archives.filter((t=>1==t.stepCount)).map((e=>`${t.name}:${e.name}`)))))}validate(){if(this.data.byteLength<16)throw new Error("Truncated RRD");if(this.offset=0,"RRD"!=this.readAscii(4))throw new Error("Not an RRD file");if(this.version=this.readAscii(5),["0001","0003","0004"].indexOf(this.version)<0)throw new Error(`Unknown RRD version ${this.version}`)}readHeader(){if(0==this.data.getUint32(12,this.littleEndian)){if(this.floatAlign=8,this.offset=16,this.data.getFloat64(this.offset,!0)==s)this.littleEndian=!0;else{if(this.data.getFloat64(this.offset,!1)!=s)throw new Error("RRD is missing magic float");this.littleEndian=!1}0==this.data.getInt32(this.offset+8+4,this.littleEndian)?(this.intAlign=8,this.intIs64=!0):(this.intAlign=4,this.intIs64=!1)}else if(this.floatAlign=4,this.offset=12,this.intAlign=4,this.intIs64=!1,this.data.getFloat64(this.offset,!0)==s)this.littleEndian=!0;else{if(this.data.getFloat64(this.offset,!1)!=s)throw new Error("RRD is missing magic float");this.littleEndian=!1}if(this.offset+=8,this.dsCount=this.readInt(),this.archiveCount=this.readInt(),this.pdpStep=this.readInt(),this.alignFloat(),this.offset+=80,0==this.dsCount||0==this.archiveCount||0==this.pdpStep)throw new Error("RRD file is corrupted")}parse(){this.dataSources=n.range(0,this.dsCount).map((t=>{const e=this.readAscii(20),i=this.readAscii(20);return this.alignFloat(),this.offset+=80,{index:t,name:e,type:i}})),this.archives=n.range(0,this.archiveCount).map((t=>{const e=this.readAscii(20),i=this.readInt(),n=this.readInt();return this.alignFloat(),this.offset+=80,{index:t,name:e,rows:i,stepCount:n,currentRow:0,offset:-1,startTime:-1}})),this.lastUpdate=this.readInt(),this.lastUpdate+=this.readInt()/Math.pow(10,6),this.lastUpdate=Math.floor(this.lastUpdate/this.pdpStep)*this.pdpStep,this.offset+=112*this.dsCount,this.offset+=this.dsCount*this.archiveCount*8*10,this.archives.forEach((t=>{t.currentRow=this.readInt()})),this.archives.forEach((t=>{t.offset=this.offset,this.offset+=8*t.rows*this.dsCount,t.startTime=this.lastUpdate-t.stepCount*this.pdpStep*(t.rows-1)}))}getTimeSeries(t,e,i,s){const[o,a]=t.split(":"),u=this.dataSources.filter((t=>t.name==o))[0],h=this.archives.filter((t=>t.name==a)).sort(((t,e)=>e.startTime-t.startTime));if(null==u||0==h.length)return new r.TimeSeries(null!=s?s:t);const c=h.filter((t=>t.startTimethis.lastUpdate&&(i=this.lastUpdate+l);const f=this.lastUpdate-e;e=this.lastUpdate-Math.floor(f/l)*l;const d=this.lastUpdate-i;i=this.lastUpdate-Math.ceil(d/l)*l;let m=(e-c.startTime)/l+c.currentRow+1;m>=c.rows&&(m-=c.rows);const p=8*this.dsCount,g=n.range(e,i,l),y=n.range(0,g.length).map((t=>{m+t>=c.rows&&(m-=c.rows);const e=c.offset+(m+t)*p,i=this.data.getFloat64(e,this.littleEndian);return isNaN(i)?void 0:i}));return r.TimeSeries.fromArrays(null!=s?s:t,g,y)}readAscii(t){let e="",i=this.offset;const n=this.offset+t;for(;n>i&&0!=this.data.getUint8(i);)e+=String.fromCharCode(this.data.getUint8(i)),i++;return this.offset+=t,e}readInt(){if(this.alignInt(),this.intIs64){const t=this.littleEndian?this.data.getUint32(this.offset,!0):this.data.getUint32(this.offset+4,!1);return this.offset+=8,t}const t=this.data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat(){this.alignFloat();const t=this.data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}alignInt(){0!=(this.offset&this.intAlign-1)&&(this.offset=Math.ceil(this.offset/this.intAlign)*this.intAlign)}alignFloat(){0!=(this.offset&this.floatAlign-1)&&(this.offset=Math.ceil(this.offset/this.floatAlign)*this.floatAlign)}}},261:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.buildSvg=e.ClipPath=e.Text=e.Line=e.Rect=e.Circle=void 0;const n=i(216);e.Circle=class{constructor(t,e,i={}){this.center=t,this.radius=e,this.options=i}toXml(t){const e=[];this.options.stroke&&e.push(`stroke="${this.options.stroke}"`),this.options.strokeWidth&&e.push(`stroke-width="${h(this.options.strokeWidth)}"`),this.options.fill&&e.push(`fill="${this.options.fill}"`);const i=e.join(" ");return[``]}};class r{constructor(t,e={}){this.box=t,this.options=e}toXml(t){const e=[`x="${h(this.box.x)}"`,`y="${h(this.box.y)}"`,`width="${h(this.box.width)}"`,`height="${h(this.box.height)}"`];return this.options.stroke&&e.push(`stroke="${this.options.stroke}"`),this.options.strokeWidth&&e.push(`stroke-width="${h(this.options.strokeWidth)}"`),this.options.fill&&e.push(`fill="${this.options.fill}"`),this.options.opacity&&e.push(`opacity="${h(this.options.opacity)}"`),[``]}}e.Rect=r,e.Line=class{constructor(t,e={}){this.points=t,this.options=e}toPath(){let t=!0,e="";for(const i of this.points)i?(e+=`${t?"M":"L"} ${h(i.x)} ${h(i.y)} `,t=!1):t=!0;return e=e.trim(),this.options.closeLoop&&(e+=" Z"),e}toXml(t){const e=[];return this.options.stroke&&e.push(`stroke="${this.options.stroke}"`),this.options.strokeWidth&&e.push(`stroke-width="${h(this.options.strokeWidth)}"`),this.options.strokeLineCap&&e.push(`stroke-linecap="${this.options.strokeLineCap}"`),this.options.strokeLineJoin&&e.push(`stroke-linejoin="${this.options.strokeLineJoin}"`),this.options.fill&&e.push(`fill="${this.options.fill}"`),void 0!==this.options.fillOpacity&&e.push(`fill-opacity="${h(this.options.fillOpacity)}"`),this.options.clipPath&&e.push(`clip-path="url(#${this.options.clipPath})"`),[``]}},e.Text=class{constructor(t,e,i={}){this.location=t,this.text=e,this.options=i}toXml(t){const e=[];return this.options.fontFamily&&e.push(`font-family="${this.options.fontFamily}"`),this.options.fontSize&&e.push(`font-size="${h(this.options.fontSize)}"`),this.options.fontWeight&&e.push(`font-weight="${this.options.fontWeight}"`),this.options.fill&&e.push(`fill="${this.options.fill}"`),this.options.textAnchor&&e.push(`text-anchor="${this.options.textAnchor}"`),this.options.clipPath&&e.push(`clip-path="url(#${this.options.clipPath})"`),[`${this.text}`]}};class s{constructor(t,e){this.name=t,this.rect=e}toXml(t){return[`${this.rect.toXml(0).join("")}`]}}e.ClipPath=s;class o{constructor(t){this.elements=t,this.elements=t.slice()}toXml(t){return n.flatten(this.elements.map((e=>e.toXml(t+1)))).map((e=>function(t,e){return u.slice(0,2*t)+e}(t,e)))}}class a{constructor(t){this.elements=t,this.content=new o(t)}toXml(t){return this.elements.length>0?["",...this.content.toXml(1),""]:[]}}e.buildSvg=function(t,e={}){var i,n,u,h,c;const l=null!==(i=e.viewWidth)&&void 0!==i?i:100,f=null!==(n=e.viewHeight)&&void 0!==n?n:100,d=null!==(u=e.pixelWidth)&&void 0!==u?u:800,m=null!==(h=e.pixelHeight)&&void 0!==h?h:800,p=null!==(c=e.description)&&void 0!==c?c:"(none)",g=new a(t.filter((t=>t instanceof s))),y=[];return e.backgroundColor&&y.push(new r({x:0,y:0,width:d,height:m},{stroke:e.backgroundColor,fill:e.backgroundColor})),`\n\n\n ${p}\n${new o([g,...y,...t.filter((t=>!(t instanceof s)))]).toXml(1).join("\n")}\n\n`};const u=" ";function h(t){return(Math.round(100*t)/100).toString()}},688:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SvgGraph=e.buildSvgGraph=void 0;const n=i(915),r=i(490),s=i(216),o=i(261),a=i(347),u=i(226),h=Object.assign({},a.LIGHT_THEME,{showLegend:!0,scaleToZero:!0,showTopYLabel:!0,showBottomYLabel:!0,viewWidth:120,pixelWidth:800,aspectRatio:16/9,yLines:5,lineWidth:3,dotWidth:8,fill:!1,font:"monospace",fontSize:20,titleFont:"sans-serif",titleFontSize:24,titleFontWeight:"bold",xAxisLabelFormat:u.defaultTimeLabel,yAxisLabelFormat:n.toSI,xAxisLabelWidthPt:5,yAxisLabelWidthPt:4,highlights:[],graphBackgroundColor:"#eeeeff",padding:20,innerPadding:10,legendPadding:5});e.buildSvgGraph=function(t,e={}){return new c(t,e).draw()};class c{constructor(t,e={}){var i;this.lines=t,this.options=e,this.config=Object.assign({},h,e),e.pixelHeight?(this.pixelHeight=e.pixelHeight,this.config.aspectRatio=this.config.pixelWidth/this.pixelHeight):this.pixelHeight=Math.round(this.config.pixelWidth/this.config.aspectRatio),this.viewHeight=Math.round(this.config.viewWidth/this.config.aspectRatio),this.top=null!==(i=this.options.maxY)&&void 0!==i?i:n.ceilToPrecision(1.1*this.lines.maxY,2),this.bottom=this.config.scaleToZero?0:n.floorToPrecision(this.lines.minY,2),this.left=this.lines.minX,this.right=this.lines.maxX;const r=Math.ceil(this.lines.list.length/2),s=1.25*this.config.titleFontSize,o=this.config.yAxisLabelWidthPt*this.config.fontSize,a=1.25*this.config.fontSize,u=(r+.25)*this.config.fontSize+(r-1)*this.config.legendPadding,c=this.config.padding+o+this.config.innerPadding;let l=this.config.padding;void 0!==this.options.title&&(l+=s+this.config.innerPadding),this.graphBox={x:c,y:l,width:this.config.pixelWidth-this.config.padding-c,height:this.pixelHeight-this.config.padding-a-this.config.innerPadding-l},this.config.showLegend&&(this.graphBox.height-=this.config.padding+u),this.titleBox={x:this.graphBox.x,y:this.config.padding,width:this.graphBox.width,height:s},this.yLabelBox={x:this.config.padding,y:this.graphBox.y,width:o,height:this.graphBox.height},this.xLabelBox={x:this.graphBox.x,y:this.graphBox.y+this.graphBox.height+this.config.innerPadding,width:this.graphBox.width,height:a},this.legendBox={x:this.graphBox.x,y:this.pixelHeight-this.config.padding-u,width:this.graphBox.width,height:u}}formatTimestamp(t,e){return r.DateTime.fromSeconds(t,{zone:this.config.timezone}).toFormat(e)}getMouseGraphBox(){return{x:this.graphBox.x/this.config.pixelWidth,y:this.graphBox.y/this.pixelHeight,width:this.graphBox.width/this.config.pixelWidth,height:this.graphBox.height/this.pixelHeight}}nearestToMouse(t,e){const i=this.config.pixelWidth*t,n=this.pixelHeight*e;if(nthis.graphBox.y+this.graphBox.height)return;const r=this.pixelToX(i);return void 0!==r?this.nearestInstant(r):void 0}nearestInstant(t){const e=this.lines.list[0].getNearestTime(t);if(null==e)return;const i=this.xToPixel(e),n=(i-this.graphBox.x)/this.graphBox.width;return{timestamp:e,xOffset:i,xPercent:n,values:this.lines.list.map((t=>t.interpolate(e)))}}setFocus(t){this.focus=t}draw(){if(void 0===this.cachedSvg){const t=this.computeYLines(),e=this.computeXLines();let i=[];i.push(new o.Rect(this.graphBox,{stroke:this.config.gridColor,strokeWidth:1,fill:this.config.graphBackgroundColor})),i.push(new o.ClipPath("clip-graph-box",new o.Rect(this.graphBox))),void 0!==this.options.title&&i.push(this.drawTitle(this.options.title));for(const t of this.config.highlights)i.push(...this.drawHighlight(t));i.push(...this.drawYLabels(t),...this.drawYLines(t),...this.drawXLabels(e),...this.drawXLines(e)),this.lines.list.forEach(((t,e)=>{const n=this.config.colors[e%this.config.colors.length];if(i.push(this.drawTimeSeries(t,n)),this.config.showLegend)for(const r of this.drawLegend(this.legendBox,e,t.name,n,this.config.legendPadding))i.push(r)})),this.cachedSvg=i}return o.buildSvg(this.cachedSvg.concat(this.drawFocus()),{viewWidth:this.config.viewWidth,viewHeight:this.viewHeight,pixelWidth:this.config.pixelWidth,pixelHeight:this.pixelHeight,backgroundColor:this.options.backgroundColor})}drawTitle(t){return new o.Text({x:this.titleBox.x+this.titleBox.width/2,y:this.titleBox.y+this.config.fontSize},t,{fontFamily:this.config.titleFont,fontSize:this.config.titleFontSize,fill:this.config.titleColor,fontWeight:this.config.titleFontWeight,textAnchor:"middle"})}drawYLabels(t){const e=Math.round(this.config.fontSize/3);return t.map((t=>{const i=this.yLabelBox.x+this.yLabelBox.width,n=this.yToPixel(t)+e,r={fontFamily:this.config.font,fontSize:this.config.fontSize,fill:this.config.labelColor,textAnchor:"end"};return new o.Text({x:i,y:n},this.config.yAxisLabelFormat(t),r)}))}drawYLines(t){return t.map((t=>{const e=[{x:this.graphBox.x,y:this.yToPixel(t)},{x:this.graphBox.x+this.graphBox.width,y:this.yToPixel(t)}];return new o.Line(e,{stroke:this.config.gridColor,strokeWidth:1,fill:"none"})}))}drawXLabels(t){const e=t[1]-t[0];let i=e>=u.YEAR?u.TimeScale.YEARS:e>=u.DAY?u.TimeScale.DAYS:u.TimeScale.MINUTES;const n={fontFamily:this.config.font,fontSize:this.config.fontSize,fill:this.config.labelColor,textAnchor:"middle"},s=this.config.xAxisLabelWidthPt*this.config.fontSize/2;return t.filter((t=>!this.config.showBottomYLabel||this.xToPixel(t)>=this.xLabelBox.x+s)).map((t=>{const e=this.xToPixel(t),s=this.xLabelBox.y+this.config.fontSize,a=r.DateTime.fromSeconds(t,{zone:this.options.timezone});return new o.Text({x:e,y:s},this.config.xAxisLabelFormat(a,i),n)}))}drawXLines(t){return t.map((t=>{const e=[{x:this.xToPixel(t),y:this.graphBox.y},{x:this.xToPixel(t),y:this.graphBox.y+this.graphBox.height}];return new o.Line(e,{stroke:this.config.gridColor,strokeWidth:1,fill:"none"})}))}drawHighlight(t){let e,i=0;const n=[];for(let r=this.lines.minX;r<=this.lines.maxX;r+=this.lines.interval)t.threshold(r,this)?(e=null!=e?e:Math.max(this.xToPixel(r-this.lines.interval/2),this.graphBox.x),i=Math.min(this.xToPixel(r+this.lines.interval/2),this.graphBox.x+this.graphBox.width)):void 0!==e&&(n.push([e,i]),e=void 0);return void 0!==e&&n.push([e,i]),n.map((([e,i])=>new o.Rect({x:e,y:this.graphBox.y,width:i-e,height:this.graphBox.height},{fill:t.color,opacity:t.opacity})))}drawTimeSeries(t,e){const i=t.toPoints().map((t=>null==t.value?void 0:{x:this.xToPixel(t.timestamp),y:this.yToPixel(t.value)}));let n="none",r=!1;this.config.fill&&(i.unshift({x:this.graphBox.x,y:this.graphBox.y+this.graphBox.height}),i.push({x:this.graphBox.x+this.graphBox.width,y:this.graphBox.y+this.graphBox.height}),n=e,r=!0);const s={stroke:e,strokeWidth:this.config.lineWidth,strokeLineCap:"round",strokeLineJoin:"round",fill:n,fillOpacity:.5,closeLoop:r,clipPath:"clip-graph-box"};return new o.Line(i,s)}drawLegend(t,e,i,n,r=0){const s=Math.ceil(this.lines.list.length/2),a=t.y+(this.config.fontSize+r)*(e%s),u=t.x+t.width/2*Math.floor(e/s),h=.75*this.config.fontSize,c={x:u,y:a+this.config.fontSize-h,width:h,height:h},l=new o.Rect(c,{stroke:this.config.gridColor,strokeWidth:1,fill:n}),f=u+c.width+this.config.innerPadding,d=a+this.config.fontSize,m=t.width/2-this.config.innerPadding-this.config.padding-c.width,p=1.25*this.config.fontSize,g=new o.ClipPath(`clip${e}`,new o.Rect({x:f,y:a,width:m,height:p}));return[l,new o.Text({x:f,y:d},i,{fontFamily:this.config.font,fontSize:this.config.fontSize,fill:this.config.legendColor,clipPath:`clip${e}`}),g]}drawFocus(){if(!this.focus)return[];const t=this.xToPixel(this.focus.timestamp),e=[];return this.focus.values.forEach(((i,n)=>{if(void 0===i)return;const r=this.config.colors[n%this.config.colors.length],s={fill:r,stroke:r,strokeWidth:1};e.push(new o.Circle({x:t,y:this.yToPixel(i)},this.config.dotWidth/2,s))})),e}yToPixel(t){const e=1-(t-this.bottom)/(this.top-this.bottom);return this.graphBox.y+e*this.graphBox.height}xToPixel(t){return this.graphBox.x+(t-this.left)/(this.right-this.left)*this.graphBox.width}pixelToX(t){if(!(t=this.graphBox.x+this.graphBox.width))return(t-this.graphBox.x)/this.graphBox.width*(this.right-this.left)+this.left}computeYLines(){if(0==this.config.yLines)return[];const t=n.ceilToCurrency((this.top-this.bottom)/this.config.yLines),e=n.floorToPrecision(this.bottom,1),i=[];return this.config.showBottomYLabel&&i.push(this.bottom),this.config.showTopYLabel&&i.push(this.top),i.concat(s.range(0,this.config.yLines).map((i=>e+(i+1)*t)).filter((t=>t>this.bottom&&t{Object.defineProperty(e,"__esModule",{value:!0}),e.TextGraph=e.buildTextGraph=e.TextGraphResolution=void 0;const n=i(784),r=i(915),s=i(490),o=i(216),a=i(406),u=i(347),h=i(226);var c;!function(t){t[t.FULL=0]="FULL",t[t.HALF=1]="HALF",t[t.QUARTER=2]="QUARTER"}(c=e.TextGraphResolution||(e.TextGraphResolution={}));const l=Object.assign({},u.LIGHT_THEME,{showLegend:!0,scaleToZero:!0,showTopYLabel:!0,showBottomYLabel:!0,width:78,height:24,yLines:5,fill:!1,xAxisLabelFormat:h.defaultTimeLabel,yAxisLabelFormat:r.toSI,xAxisLabelWidth:7,yAxisLabelWidth:6,resolution:c.QUARTER,padding:1,sideMargin:1}),f=["▀","▄"],d=[" ","▗","▖","▄","▝","▐","▞","▟","▘","▚","▌","▙","▀","▜","▛","█"];e.buildTextGraph=function(t,e={}){return new m(t,e).draw()};class m{constructor(t,e={}){var i;this.lines=t,this.options=e,this.config=Object.assign({},l,e),this.top=null!==(i=this.options.maxY)&&void 0!==i?i:r.ceilToPrecision(1.1*this.lines.maxY,2),this.bottom=this.config.scaleToZero?0:r.floorToPrecision(this.lines.minY,2),this.left=this.lines.minX,this.right=this.lines.maxX;const n=this.config.showLegend?Math.ceil(this.lines.list.length/2):0;this.graphX=this.config.yAxisLabelWidth+1+this.config.sideMargin,this.graphY=this.config.padding+(void 0!==this.config.title?1:0),this.graphWidth=this.config.width-this.graphX-this.config.sideMargin,this.graphHeight=this.config.height-n-2-this.graphY-this.config.padding,this.graphRight=this.graphX+this.graphWidth,this.graphBottom=this.graphY+this.graphHeight}draw(){let t=new n.Canvas(this.config.width,this.config.height);const e=t.clip(0,0,this.config.width,this.config.height);e.backgroundColor(this.config.backgroundColor).clear();const i=this.computeYLines(),r=this.computeXLines();if(this.config.title){const t=Math.round((this.config.width-this.config.title.length)/2);e.color(this.config.titleColor,this.config.backgroundColor).at(t,0).write(this.config.title)}e.color(this.config.gridColor);for(const t of o.range(this.graphY,this.graphBottom))e.at(this.graphX-1,t).write("│");for(const t of o.range(this.graphX,this.graphRight))e.at(t,this.graphBottom).write("─");e.at(this.graphX-1,this.graphBottom).write("└");for(const t of r)e.at(this.graphX+this.xToCell(t),this.graphBottom).write("┴");e.color(this.config.labelColor);for(const t of i){const i=v(this.config.yAxisLabelFormat(t),this.config.yAxisLabelWidth);e.at(this.config.sideMargin,this.graphY+this.yToCell(t)).write(i)}const a=r[1]-r[0];let u=a>=h.YEAR?h.TimeScale.YEARS:a>=h.DAY?h.TimeScale.DAYS:h.TimeScale.MINUTES;for(const t of r){const i=s.DateTime.fromSeconds(t,{zone:this.options.timezone});let n=this.config.xAxisLabelFormat(i,u);const r=Math.max(0,this.graphX+this.xToCell(t)-Math.floor(n.length/2));n.length>this.config.width-r&&(n=n.slice(0,this.config.width-r)),e.at(r,this.graphY+this.graphHeight+1).write(n)}const l=t.clip(this.graphX,this.graphY,this.graphX+this.graphWidth,this.graphY+this.graphHeight);l.backgroundColor(this.config.graphBackgroundColor).clear(),l.color(this.config.gridColor);for(const t of r)for(const e of o.range(0,this.graphHeight))l.at(this.xToCell(t),e).write("│");const f=this.config.resolution==c.FULL?1:2,d=this.config.resolution==c.QUARTER?2:1,m=Array(this.graphWidth*this.graphHeight*f*d),p=Math.ceil(this.lines.list.length/2);switch(this.lines.list.forEach(((t,i)=>{const n=this.config.colors[i%this.config.colors.length];if(this.drawTimeSeries(t,n,m,this.graphWidth*d,this.graphHeight*f),this.config.showLegend){let r=this.graphX+Math.round(this.graphWidth/2)*Math.floor(i/p),s=this.graphBottom+2+i%p+this.config.padding;const o=(" "+t.name).slice(0,Math.round(this.graphWidth/2)-4);e.at(r,s).backgroundColor(n).write(" "),e.backgroundColor(this.config.backgroundColor).color(this.config.labelColor).write(o)}})),this.config.resolution){case c.FULL:this.render(l,m);break;case c.HALF:this.render2x(l,m);break;case c.QUARTER:this.render4x(l,m)}return t.paintInline()}computeYLines(){if(0==this.config.yLines)return[];const t=r.ceilToCurrency((this.top-this.bottom)/this.config.yLines),e=r.floorToPrecision(this.bottom,1),i=[];return this.config.showBottomYLabel&&i.push(this.bottom),this.config.showTopYLabel&&i.push(this.top),i.concat(o.range(0,this.config.yLines).map((i=>e+(i+1)*t)).filter((t=>t>this.bottom&&t(t==i[1]?1:0)<<3-e)).reduce(((t,e)=>t|e),0);t.at(s,r).backgroundColor(i[0].toXterm()).color(i[1].toXterm()).write(d[n])}}}yToCell(t){const e=1-(t-this.bottom)/(this.top-this.bottom);return Math.min(Math.floor(e*this.graphHeight),this.graphHeight-1)}xToCell(t){return Math.min(Math.floor((t-this.left)/(this.right-this.left)*this.graphWidth),this.graphWidth-1)}}e.TextGraph=m;const p=" ",g=[p,p,p].join(""),y=[g,g,g,g].join(""),v=(t,e)=>(y+t).slice(-e)},347:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DARK_THEME=e.LIGHT_THEME=void 0,e.LIGHT_THEME={backgroundColor:"#eeeeff",graphBackgroundColor:"#eeeeff",gridColor:"#555555",titleColor:"#660099",labelColor:"#555555",legendColor:"#555555",colors:["red","blue","orange","#3c3","#c6c","yellow"]},e.DARK_THEME={backgroundColor:"#333355",graphBackgroundColor:"#333355",gridColor:"#999999",titleColor:"#ccccff",labelColor:"#77cccc",legendColor:"#77cccc",colors:["red","blue","orange","#080","#c6c","yellow"]}},226:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultTimeLabel=e.TimeBuddy=e.YEAR=e.QUARTER=e.MONTH=e.WEEK=e.DAY=e.HOUR=e.MINUTE=e.TimeScale=void 0;const n=i(915),r=i(490),s=i(216);var o;!function(t){t[t.MINUTES=0]="MINUTES",t[t.DAYS=1]="DAYS",t[t.YEARS=2]="YEARS"}(o=e.TimeScale||(e.TimeScale={})),e.MINUTE=60,e.HOUR=60*e.MINUTE,e.DAY=24*e.HOUR,e.WEEK=7*e.DAY,e.MONTH=30*e.DAY,e.QUARTER=90*e.DAY,e.YEAR=365*e.DAY;const a=[{interval:1,start:t=>t,next:t=>t.plus({second:1})},{interval:5,start:t=>t.plus({second:u(t.toSeconds(),5)}),next:t=>t.plus({second:5})},{interval:15,start:t=>t.plus({second:u(t.toSeconds(),15)}),next:t=>t.plus({second:15})},{interval:e.MINUTE,start:t=>t.plus({second:u(t.toSeconds(),e.MINUTE)}),next:t=>t.plus({minute:1})},{interval:5*e.MINUTE,start:t=>t.plus({second:u(t.toSeconds(),5*e.MINUTE)}),next:t=>t.plus({minute:5})},{interval:15*e.MINUTE,start:t=>t.plus({second:u(t.toSeconds(),15*e.MINUTE)}),next:t=>t.plus({minute:15})},{interval:e.HOUR,start:t=>t.plus({second:u(t.toSeconds(),e.HOUR)}),next:t=>t.plus({hour:1})},{interval:4*e.HOUR,start:t=>h(t,(t=>u(t,4))),next:t=>t.hour<20?t.set({hour:t.hour+4}):t.plus({day:1}).startOf("day")},{interval:e.DAY,start:t=>h(t,(t=>u(t,24))),next:t=>t.plus({day:1})},{interval:e.WEEK,start:c,next:t=>c(t.plus({seconds:1}))},{interval:e.MONTH,start:function(t){let e=t.startOf("month").startOf("day");return e.toSeconds()==t.toSeconds()&&1==t.day?t:e.plus({month:1})},next:t=>t.plus({month:1})},{interval:e.QUARTER,start:function(t){let e=t.startOf("month").startOf("day");if(e.toSeconds()==t.toSeconds()&&1==t.day&&t.month%4==1)return t;do{e=e.plus({month:1})}while(e.month%4!=1);return e},next:t=>t.plus({month:4})},{interval:e.YEAR,start:l,next:t=>t.plus({year:1})}];function u(t,e){const i=t%e;return 0==i?0:e-i}function h(t,i){const n=t.plus({second:u(t.toSeconds(),e.HOUR)});return n.plus({hour:i(n.hour)})}function c(t){let e=t.startOf("day");if(e.toSeconds()==t.toSeconds()&&1==t.weekday)return t;do{e=e.plus({days:1})}while(1!=e.weekday);return e}function l(t,e=1){let i=t.startOf("year").startOf("day");if(i.toSeconds()==t.toSeconds()&&t.year%e==0)return t;do{i=i.plus({year:1})}while(i.year%e!=0);return i}function f(t){return("00"+t.toString()).slice(-2)}e.TimeBuddy=class{constructor(t){this.timezone=t}toLuxon(t){return r.DateTime.fromSeconds(t,{zone:this.timezone})}timeGranularityFor(t,e,i){const r=(e-t)/(i+1),o=(t,n)=>t<=e&&n<=i+1;for(const e of a){if(r>e.interval)continue;const n=e.start(this.toLuxon(t)),a=s.generate(n.toSeconds(),(t=>e.next(this.toLuxon(t)).toSeconds()),o);if(a.length<=i)return a}let u=1;for(;;){const e=l(this.toLuxon(t),u),r=s.generate(e.toSeconds(),(t=>this.toLuxon(t).plus({year:u}).toSeconds()),o);if(r.length<=i)return r;u=n.ceilToCurrency(2*u)}}},e.defaultTimeLabel=function(t,e){switch(e){case o.YEARS:return t.year.toString();case o.DAYS:return`${t.month}/${f(t.day)}`;default:return`${t.hour}:${f(t.minute)}`}}},987:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeSeries=e.Point=void 0;const n=i(216);class r{constructor(t,e){this.timestamp=t,this.value=e}toString(){return`(${this.timestamp}, ${this.value})`}}e.Point=r;class s{constructor(t){this.name=t,this.timestamps=[],this.values=[]}static fromArrays(t,e,i){if(e.length!=i.length)throw new Error("timestamps and values must have the same length");const n=new s(t);return n.timestamps=e,n.values=i,n}static fromGraphite(t){const e=new s(t.target);return e.addGraphitePoints(t.datapoints),e}static fromPrometheus(t){const e=new s(t.metric.__name__);return e.addPoints(t.values.map((([t,e])=>{const i=parseFloat(e);return[t,isNaN(i)?void 0:i]}))),e}addPoints(t){for(const[e,i]of t)this.timestamps.push(e),this.values.push(i)}addGraphitePoints(t){for(const[e,i]of t)this.timestamps.push(i),this.values.push(e)}min(){return Math.min(...this.values.filter((t=>void 0!==t)))}max(){return Math.max(...this.values.filter((t=>void 0!==t)))}sort(){const t=this.timestamps.map(((t,e)=>[t,e]));t.sort(((t,e)=>t[0]-e[0])),this.timestamps=t.map((([t,e])=>t)),this.values=t.map((([t,e])=>this.values[e]))}minInterval(){if(this.timestamps.length<=1)return;const t=n.range(1,this.timestamps.length).map((t=>this.timestamps[t]-this.timestamps[t-1]));return t.sort(((t,e)=>t-e)),t[0]}normalize(t,e,i){var n;if(!(this.timestamps.length<=1)){this.sort(),void 0!==t&&this.timestamps[0]>t&&(this.timestamps.unshift(t),this.values.unshift(void 0)),void 0!==e&&this.timestamps[this.timestamps.length-1]100*i)throw new Error("Data points are too distant on the time scale");this.timestamps.splice(t,0,this.timestamps[t-1]+i),this.values.splice(t,0,void 0)}}}}toPoints(){return n.range(0,this.timestamps.length).map((t=>new r(this.timestamps[t],this.values[t])))}toVector(){return this.toPoints().map((t=>[t.timestamp,t.value]))}toInterval(t,e=this.timestamps[0],i=this.timestamps[this.timestamps.length-1]+t,r=n.average){this.sort();const o=n.range(e,i,t),a=o.map((t=>this.interpolate(t)));return s.fromArrays(this.name,o,a)}antialias(t,e,i=this.max(),r=0,s,u){this.sort();const h=null!=s?s:this.timestamps[0],c=((null!=u?u:this.timestamps[this.timestamps.length-1])-h)/t,l=(i-r)/e,f=t=>void 0===t?void 0:(t-r)/l,d=t=>t*c+h,m=this.timestamps.map((t=>(t-h)/c)),p=this.values.map(f);let g,y,v=0;for(const e of n.range(0,t)){for(;m[v]Math.round(1e3*t)/1e3)),fillPercent:b.map((t=>Math.round(1e3*t)/1e3))}}interpolate(t,e=!1){let i=n.binarySearch(this.timestamps,(e=>e>=t)),r=i-1;if(e){for(;r>=0&&void 0===this.values[r];)r--;for(;i=this.timestamps.length)return;const s=this.values[r],a=this.values[i];return void 0!==s&&void 0!==a?o(this.timestamps[r],this.timestamps[i],s,a,t):void 0}getNearestTime(t){let e=n.binarySearch(this.timestamps,(e=>e>=t)),i=e-1;if(i<0)return this.timestamps[e];if(e>=this.timestamps.length)return this.timestamps[i];const r=this.timestamps[i],s=this.timestamps[e];return Math.abs(r-t)<=Math.abs(s-t)?r:s}}function o(t,e,i,n,r){return i+(r-t)/(e-t)*(n-i)}function a(t){return Math.floor(function(t){return Math.round(t*Math.pow(2,32))/Math.pow(2,32)}(t))}e.TimeSeries=s},166:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeSeriesList=void 0,e.TimeSeriesList=class{constructor(t){this.list=t;const e=t.filter((t=>t.timestamps.length>0));this.minX=Math.min(...e.map((t=>Math.min(...t.timestamps)))),this.maxX=Math.max(...e.map((t=>Math.max(...t.timestamps)))),this.minY=Math.min(...e.map((t=>t.min()))),this.maxY=Math.max(...e.map((t=>t.max()))),this.interval=Math.min(...e.map((t=>{var e;return null!==(e=t.minInterval())&&void 0!==e?e:1/0}))),this.interval!==1/0&&t.forEach((t=>t.normalize(this.minX,this.maxX,this.interval)))}toCsv(){return[["timestamp"].concat(this.list.map((t=>t.name)))].concat(this.list[0].timestamps.map(((t,e)=>[t.toString()].concat(this.list.map((t=>{var i,n;return null!==(n=null===(i=t.values[e])||void 0===i?void 0:i.toString())&&void 0!==n?n:"null"})))))).map((t=>t.join(","))).join("\n")+"\n"}}},130:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=i(384);Object.defineProperty(e,"TextGraph",{enumerable:!0,get:function(){return n.TextGraph}}),Object.defineProperty(e,"TextGraphResolution",{enumerable:!0,get:function(){return n.TextGraphResolution}}),Object.defineProperty(e,"buildTextGraph",{enumerable:!0,get:function(){return n.buildTextGraph}});var r=i(216);Object.defineProperty(e,"range",{enumerable:!0,get:function(){return r.range}});var s=i(116);Object.defineProperty(e,"RrdFile",{enumerable:!0,get:function(){return s.RrdFile}});var o=i(688);Object.defineProperty(e,"buildSvgGraph",{enumerable:!0,get:function(){return o.buildSvgGraph}}),Object.defineProperty(e,"SvgGraph",{enumerable:!0,get:function(){return o.SvgGraph}});var a=i(347);Object.defineProperty(e,"DARK_THEME",{enumerable:!0,get:function(){return a.DARK_THEME}}),Object.defineProperty(e,"LIGHT_THEME",{enumerable:!0,get:function(){return a.LIGHT_THEME}});var u=i(226);Object.defineProperty(e,"defaultTimeLabel",{enumerable:!0,get:function(){return u.defaultTimeLabel}}),Object.defineProperty(e,"TimeBuddy",{enumerable:!0,get:function(){return u.TimeBuddy}});var h=i(987);Object.defineProperty(e,"Point",{enumerable:!0,get:function(){return h.Point}}),Object.defineProperty(e,"TimeSeries",{enumerable:!0,get:function(){return h.TimeSeries}});var c=i(166);Object.defineProperty(e,"TimeSeriesList",{enumerable:!0,get:function(){return c.TimeSeriesList}})}},e={},i=function i(n){var r=e[n];if(void 0!==r)return r.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,i),s.exports}(362);netgraph=i})(); +//# sourceMappingURL=netgraph.js.map \ No newline at end of file diff --git a/demo/ping-demo-internet.rrd b/demo/ping-demo-internet.rrd new file mode 100644 index 0000000..55cc12d Binary files /dev/null and b/demo/ping-demo-internet.rrd differ diff --git a/demo/ping-demo-modem.rrd b/demo/ping-demo-modem.rrd new file mode 100644 index 0000000..e61e8ac Binary files /dev/null and b/demo/ping-demo-modem.rrd differ diff --git a/demo/ping-demo-nat.rrd b/demo/ping-demo-nat.rrd new file mode 100644 index 0000000..88001a0 Binary files /dev/null and b/demo/ping-demo-nat.rrd differ diff --git a/demo/ping_droprate-demo-internet.rrd b/demo/ping_droprate-demo-internet.rrd new file mode 100644 index 0000000..54e2453 Binary files /dev/null and b/demo/ping_droprate-demo-internet.rrd differ diff --git a/demo/ping_droprate-demo-modem.rrd b/demo/ping_droprate-demo-modem.rrd new file mode 100644 index 0000000..21d253e Binary files /dev/null and b/demo/ping_droprate-demo-modem.rrd differ diff --git a/demo/ping_droprate-demo-nat.rrd b/demo/ping_droprate-demo-nat.rrd new file mode 100644 index 0000000..ed6c700 Binary files /dev/null and b/demo/ping_droprate-demo-nat.rrd differ