function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]==null?{}:arguments[r];r%2?e(Object(i),!0).forEach(function(e){n(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function n(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){var t=i(e,`string`);return typeof t==`symbol`?t:t+``}function i(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var a=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),o=a((e,t)=>{function n(){}n.prototype={on:function(e,t,n){var r=this.e||={};return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||={})[e]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||={},r=n[e],i=[];if(r&&t)for(var a=0,o=r.length;a<o;a++)r[a].fn!==t&&r[a].fn._!==t&&i.push(r[a]);return i.length?n[e]=i:delete n[e],this}},t.exports=n,t.exports.TinyEmitter=n})();/*!
* tiny-popup-menu - v1.0.10
* https://github.com/GastonZalba/tiny-popup-menu#readme
* Built: Sat Aug 03 2024 15:18:36 GMT-0300 (Argentina Standard Time)
*/function s(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n=[...arguments].slice(2);if(typeof e==`function`)return e(t,n);let r=e===null?new DocumentFragment:document.createElement(e);Object.entries(t||{}).forEach(e=>{let[t,n]=e;n!=null&&(t.startsWith(`on`)&&t.toLowerCase()in window?r.addEventListener(t.toLowerCase().substr(2),n):t===`className`?r.setAttribute(`class`,n.toString()):t===`htmlFor`?r.setAttribute(`for`,n.toString()):r.setAttribute(t,n.toString()))});for(let e of n)e&&(Array.isArray(e)?r.append(...e):e.nodeType===void 0?r.innerHTML+=e:r.appendChild(e));return r}var c;(function(e){e.Top=`top`,e.Bottom=`bottom`})(c||={});var l;(function(e){e.Left=`left`,e.Right=`right`})(l||={});const u={position:c.Bottom,className:``,autoClose:!0,arrow:!0,margin:void 0,offset:{x:0,y:0},menuItems:[],stopClick:!0};function d(){return new DOMParser().parseFromString(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="768" height="768" viewBox="0 0 768 768">\r
<path d="M493.5 531l-45 45-192-192 192-192 45 45-147 147z"></path>\r
</svg>\r
`,`image/svg+xml`).firstChild}function ee(){return new DOMParser().parseFromString(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="768" height="768" viewBox="0 0 768 768">\r
<path d="M274.5 531l147-147-147-147 45-45 192 192-192 192z"></path>\r
</svg>\r
`,`image/svg+xml`).firstChild}const te=`popup-menu`,ne=`popup-menu--active`;let f=1;const p=function(e){return[...arguments].slice(1).forEach(t=>{Object.keys(t).forEach(n=>{let r=t[n],i=e[n];e[n]=i&&r&&typeof i==`object`&&typeof r==`object`&&!Array.isArray(i)?p(i,r):r})}),e};var m=class extends o.TinyEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;super(),this._isOpen=!1,this._containerMenu=s(`div`,{id:`${te}-${f}`}),this._instanceOptions=e,f++}open(e){if(this._options=this._parseOptions(e),this.isOpen()&&(this.close(),e.event.currentTarget===this._toggler)){this._options.stopClick&&(e.event.preventDefault(),e.event.stopPropagation());return}let{event:t,menuItems:n,autoClose:r,stopClick:i}=this._options;this._toggler=t.currentTarget;let a=!1;this._menuItemsList=n.map(e=>e===`-`?s(`span`,{className:`popup-menu--item-separator`}):`items`in e?(a=!0,this._processSubMenu(e,r)):this._processMenuItem(e,r)),this._isOpen=!0,this.updatePosition(),a&&this._updateSubmenusPosition(),setTimeout(()=>{this.addEventListeners()}),this.emit(`open`),i&&(t.preventDefault(),t.stopPropagation())}close(){this.isOpen()&&(this._containerMenu.innerHTML=``,this._containerMenu.remove(),this._toggler.classList.remove(ne),this.removeEventListeners(),this._isOpen=!1,this.emit(`close`))}updatePosition(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=()=>{if(a===c.Top){if(l.top-p-f-o<=0)return c.Bottom}else if(a===c.Bottom&&l.top+p+f+u+o>=document.documentElement.offsetHeight)return c.Top;return a};if(!this.isOpen())return;let{offset:n,className:r,arrow:i,position:a,margin:o}=this._options;this._containerMenu.style.position=`fixed`,this._containerMenu.className=r,this._containerMenu.classList.add(te),i&&this._containerMenu.classList.add(`popup-menu--show-arrow`),this._containerMenu.innerHTML=``,this._containerMenu.append(s(`div`,{className:`popup-menu--container`},...this._menuItemsList)),document.body.append(this._containerMenu);let l=this._toggler.getBoundingClientRect(),u=this._toggler.offsetHeight,d=this._toggler.offsetWidth,ee=n?.x||0,f=n?.y||0,p=this._containerMenu.offsetHeight,m=this._containerMenu.offsetWidth,h=t(),g=0;switch(h){case c.Bottom:g=f+u+o;break;case c.Top:g=-p-o;break}let re=-m/2+d/2,_=window.innerWidth,v=l.left+ee+re,y=0;v<0?y=0-v+o:v+m>_&&(y=_-(v+m)-o),this._containerMenu.style.left=v+y+`px`,this._containerMenu.style.top=l.top+g+`px`,this._toggler.classList.add(ne),i&&(y=y>0?Math.min(m/2-8-3,y):Math.max(-(m/2-22),y),this._containerMenu.style.setProperty(`--ofx`,`${y+8}px`),this._evaluateArrowPosition(h)),e||this.emit(`updateposition`)}addToggler(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(arguments.length>2&&arguments[2]!==void 0?arguments[2]:`click`)===`contextmenu`?e.addEventListener(`contextmenu`,e=>this.open(Object.assign(Object.assign({},t),{event:e}))):e.addEventListener(`click`,e=>this.open(Object.assign(Object.assign({},t),{event:e})))}isOpen(){return this._isOpen}_parseOptions(e){let t=p({},u,this._instanceOptions||{},e||{});return t.margin===void 0&&(t.margin=!(`arrow`in t)||t.arrow?10:2),t}_processSubMenu(e,t){return s(`div`,{className:`popup-menu--submenu `+(e.className||``),id:e.id,style:e.style,"data-position":e.position||l.Right},s(`span`,null,e.content),s(`div`,{className:`popup-menu--submenu-arrow`}),s(`div`,{className:`popup-menu--submenu-content`},e.items.map(e=>this._processMenuItem(e,t))))}_processMenuItem(e,t){return s(`div`,{className:`popup-menu--item `+(e.className||``),onClick:e.callback?n=>{e.callback(n),t&&this.close()}:null,id:e.id,style:e.style},e.content)}_updateSubmenusPosition(){this._containerMenu.querySelectorAll(`.popup-menu--submenu`).forEach(e=>{let t=e.dataset.position,n=e.querySelector(`.popup-menu--submenu-content`),r=n.getBoundingClientRect(),i=n.offsetWidth,a=(()=>{if(t===l.Left){if(r.right-i<=0)return l.Right}else if(t===l.Right&&r.right+i>=document.documentElement.offsetWidth)return l.Left;return t})();e.classList.add(`popup-menu--submenu-`+a);let o=e.querySelector(`.popup-menu--submenu-arrow`);o.innerHTML=``,a===l.Left?o.append(d()):t===l.Right&&o.append(ee())})}_evaluateArrowPosition(e){let t=``;switch(e){case c.Bottom:t=`popup-menu--show-arrow-top`;break;case c.Top:t=`popup-menu--show-arrow-bottom`;break}this._containerMenu.classList.add(t)}addEventListeners(){this._closeListener=e=>{this._containerMenu.contains(e.target)||this.close()},this._resizeListener=()=>{this.isOpen()&&this.updatePosition(!1)},this._scrollListener=e=>{this.isOpen()&&e.target.contains(this._toggler)&&this.updatePosition(!1)},document.addEventListener(`click`,this._closeListener),window.addEventListener(`resize`,this._resizeListener),window.addEventListener(`scroll`,this._scrollListener,!0)}removeEventListeners(){document.removeEventListener(`click`,this._closeListener),window.removeEventListener(`resize`,this._resizeListener),window.removeEventListener(`scroll`,this._scrollListener)}},h;(function(e){e[e.FRC6328=0]=`FRC6328`,e[e.WPILib=1]=`WPILib`,e[e.Lite=2]=`Lite`,e[e.LiteDS=3]=`LiteDS`})(h||={});const g=h.Lite;g===h.Lite||h.LiteDS;var re=a((e,t)=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}),_=a((e,t)=>{let n=re(),r={};for(let e of Object.keys(n))r[n[e]]=e;let i={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};t.exports=i;for(let e of Object.keys(i)){if(!(`channels`in i[e]))throw Error(`missing channels property: `+e);if(!(`labels`in i[e]))throw Error(`missing channel labels property: `+e);if(i[e].labels.length!==i[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},i.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},i.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],a=i.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,o*100,r*100]},i.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function a(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=r[e];if(t)return t;let i=1/0,o;for(let t of Object.keys(n)){let r=n[t],s=a(e,r);s<i&&(i=s,o=t)}return o},i.keyword.rgb=function(e){return n[e]},i.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),n=t[0],r=t[1],a=t[2];return n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*r-16,500*(n-r),200*(r-a)]},i.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},i.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},i.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},i.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},i.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},i.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},i.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},i.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},i.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},i.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},i.rgb.ansi16=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,[n,r,a]=e,o=t===null?i.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},i.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},i.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},i.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},i.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},i.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},i.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},i.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},i.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}),v=a((e,t)=>{let n=_();function r(){let e={},t=Object.keys(n);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function i(e){let t=r(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],o=t[n];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,i.unshift(n))}}return t}function a(e,t){return function(n){return t(e(n))}}function o(e,t){let r=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),i=a(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=r,i}t.exports=function(e){let t=i(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=o(e,t))}return n}}),y=a((e,t)=>{let n=_(),r=v(),i={},a=Object.keys(n);function o(e){let t=function(){var t=[...arguments];let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function s(e){let t=function(){var t=[...arguments];let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}a.forEach(e=>{i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});let t=r(e);Object.keys(t).forEach(n=>{let r=t[n];i[e][n]=s(r),i[e][n].raw=o(r)})}),t.exports=i})();function ie(e,t){t===void 0&&(t=window.matchMedia(`(prefers-color-scheme: dark)`).matches);let n=y.hex.hsl(e.slice(1));return t?n[2]=Math.max(n[2],65):n[2]=Math.min(n[2],45),`#`+y.hsl.hex(n)}var ae;(function(e){e[e.None=0]=`None`,e[e.Differentiate=1]=`Differentiate`,e[e.Integrate=2]=`Integrate`})(ae||={});var b=ae;const x={theme:`system`,robotAddress:`10.00.00.2`,remotePath:`/U/logs`,liveMode:`nt4`,liveSubscribeMode:`low-bandwidth`,liveDiscard:1200,publishFilter:``,rlogPort:5800,coordinateSystem:`automatic`,field3dModeAc:`standard`,field3dModeBattery:``,field3dAntialiasing:!0,tbaApiKey:``,userAssetsFolder:null,skipHootNonProWarning:!1,ctreLicenseAccepted:!1,systemcoreStaticAddress:``,hasScrolledLineGraph:!1,hasScrolledTimeline:!1,revTelemetryPort:8080,revTelemetryHost:``,revTelemetryKey:`REV`},oe=Object.assign({},x,{remotePath:``,liveSubscribeMode:`logging`});function se(e){switch(e){case`nt4`:return`NetworkTables`;case`nt4-akit`:return`NetworkTables (AdvantageKit)`;case`nt4-systemcore`:return`Systemcore Diagnostics`;case`phoenix`:return`Phoenix Diagnostics`;case`rlog`:return`RLOG Server`;case`ftcdashboard`:return`FTC Dashboard`;case`rev`:return`REV Dashboard`}}const ce=[`nt4`,`nt4-akit`,`nt4-systemcore`,`ftcdashboard`,`rev`];function S(e,t){`theme`in t&&(t.theme===`light`||t.theme===`dark`||t.theme===`system`)&&(e.theme=t.theme),`address`in t&&typeof t.address==`string`&&(e.robotAddress=t.address),`rioAddress`in t&&typeof t.rioAddress==`string`&&(e.robotAddress=t.rioAddress),`robotAddress`in t&&typeof t.robotAddress==`string`&&(e.robotAddress=t.robotAddress),`rioPath`in t&&typeof t.rioPath==`string`&&(e.remotePath=t.rioPath),`remotePath`in t&&typeof t.remotePath==`string`&&(e.remotePath=t.remotePath),`liveMode`in t&&(t.liveMode===`nt4`||t.liveMode===`nt4-akit`||t.liveMode===`nt4-systemcore`||t.liveMode===`phoenix`||t.liveMode===`rlog`||t.liveMode===`ftcdashboard`||t.liveMode===`rev`)&&(e.liveMode=t.liveMode),`liveSubscribeMode`in t&&(t.liveSubscribeMode===`low-bandwidth`||t.liveSubscribeMode===`logging`)&&(e.liveSubscribeMode=t.liveSubscribeMode),`liveDiscard`in t&&typeof t.liveDiscard==`number`&&(e.liveDiscard=t.liveDiscard),`publishFilter`in t&&typeof t.publishFilter==`string`&&(e.publishFilter=t.publishFilter),`rlogPort`in t&&typeof t.rlogPort==`number`&&(e.rlogPort=t.rlogPort),`revTelemetryPort`in t&&typeof t.revTelemetryPort==`number`&&(e.revTelemetryPort=t.revTelemetryPort),`revTelemetryHost`in t&&typeof t.revTelemetryHost==`string`&&(e.revTelemetryHost=t.revTelemetryHost),`revTelemetryKey`in t&&typeof t.revTelemetryKey==`string`&&(e.revTelemetryKey=t.revTelemetryKey),`coordinateSystem`in t&&(t.coordinateSystem===`automatic`||t.coordinateSystem===`wall-alliance`||t.coordinateSystem===`wall-blue`||t.coordinateSystem===`center-rotated`||t.coordinateSystem===`center-red`)&&(e.coordinateSystem=t.coordinateSystem),`threeDimensionModeAc`in t&&(t.threeDimensionModeAc===`cinematic`||t.threeDimensionModeAc===`standard`||t.threeDimensionModeAc===`low-power`)&&(e.field3dModeAc=t.threeDimensionModeAc),`threeDimensionModeBattery`in t&&(t.threeDimensionModeBattery===``||t.threeDimensionModeBattery===`cinematic`||t.threeDimensionModeBattery===`standard`||t.threeDimensionModeBattery===`low-power`)&&(e.field3dModeBattery=t.threeDimensionModeBattery),`field3dModeAc`in t&&(t.field3dModeAc===`cinematic`||t.field3dModeAc===`standard`||t.field3dModeAc===`low-power`)&&(e.field3dModeAc=t.field3dModeAc),`field3dModeBattery`in t&&(t.field3dModeBattery===``||t.field3dModeBattery===`cinematic`||t.field3dModeBattery===`standard`||t.field3dModeBattery===`low-power`)&&(e.field3dModeBattery=t.field3dModeBattery),`field3dAntialiasing`in t&&typeof t.field3dAntialiasing==`boolean`&&(e.field3dAntialiasing=t.field3dAntialiasing),`tbaApiKey`in t&&typeof t.tbaApiKey==`string`&&(e.tbaApiKey=t.tbaApiKey),`userAssetsFolder`in t&&typeof t.userAssetsFolder==`string`&&(e.userAssetsFolder=t.userAssetsFolder),`skipHootNonProWarning`in t&&typeof t.skipHootNonProWarning==`boolean`&&(e.skipHootNonProWarning=t.skipHootNonProWarning),`ctreLicenseAccepted`in t&&typeof t.ctreLicenseAccepted==`boolean`&&(e.ctreLicenseAccepted=t.ctreLicenseAccepted),`systemcoreStaticAddress`in t&&(t.systemcoreStaticAddress===``||t.systemcoreStaticAddress===`usb`||t.systemcoreStaticAddress===`wifi`)&&(e.systemcoreStaticAddress=t.systemcoreStaticAddress),`hasScrolledLineGraph`in t&&typeof t.hasScrolledLineGraph==`boolean`&&(e.hasScrolledLineGraph=t.hasScrolledLineGraph),`hasScrolledTimeline`in t&&typeof t.hasScrolledTimeline==`boolean`&&(e.hasScrolledTimeline=t.hasScrolledTimeline)}var C;(function(e){e[e.Documentation=0]=`Documentation`,e[e.LineGraph=1]=`LineGraph`,e[e.Field2d=2]=`Field2d`,e[e.Field3d=3]=`Field3d`,e[e.Table=4]=`Table`,e[e.Console=5]=`Console`,e[e.Statistics=6]=`Statistics`,e[e.Video=7]=`Video`,e[e.Joysticks=8]=`Joysticks`,e[e.Swerve=9]=`Swerve`,e[e.Mechanism=10]=`Mechanism`,e[e.Points=11]=`Points`,e[e.Metadata=12]=`Metadata`})(C||={});function w(){return Object.values(C).filter(e=>typeof e==`number`)}const T=g===h.Lite?[C.Documentation,C.LineGraph,C.Field2d,C.Field3d,C.Table,C.Console,C.Statistics,C.Joysticks,C.Swerve,C.Mechanism,C.Points,C.Metadata]:[C.LineGraph,C.Table,C.Console,C.Statistics,C.Joysticks];function le(e){switch(e){case C.Documentation:return``;case C.LineGraph:return`Line Graph`;case C.Field2d:return`2D Field`;case C.Field3d:return`3D Field`;case C.Table:return`Table`;case C.Console:return`Console`;case C.Statistics:return`Statistics`;case C.Video:return`Video`;case C.Joysticks:return`Joysticks`;case C.Swerve:return`Swerve`;case C.Mechanism:return`Mechanism`;case C.Points:return`Points`;case C.Metadata:return`Metadata`;default:return``}}function ue(e){switch(e){case C.Documentation:return`📖`;case C.LineGraph:return`📉`;case C.Field2d:return`🗺`;case C.Field3d:return`👀`;case C.Table:return`🔢`;case C.Console:return`💬`;case C.Statistics:return`📊`;case C.Video:return`🎬`;case C.Joysticks:return`🎮`;case C.Swerve:return`🦀`;case C.Mechanism:return`⚙️`;case C.Points:return`📍`;case C.Metadata:return`🔍`;default:return``}}function E(e){return e===C.Documentation?``:`Alt+`+(()=>{switch(e){case C.LineGraph:return`G`;case C.Field2d:return`2`;case C.Field3d:return`3`;case C.Table:return`T`;case C.Console:return`C`;case C.Statistics:return`S`;case C.Video:return`V`;case C.Joysticks:return`J`;case C.Swerve:return`D`;case C.Mechanism:return`M`;case C.Points:return`P`;case C.Metadata:return`I`;default:return``}})()}function D(e,t){return Array.isArray(e)?e.every(e=>typeof e===t):!1}function de(e,t){let n=e.charAt(t);return n===n.toUpperCase()}var O;(function(e){e.UNIT_GROUPS={length:{meters:{value:1,suffix:`m`,pluralizeSuffix:!1,names:[`m`,`meter`,`meters`]},inches:{value:1/.0254,suffix:`in`,pluralizeSuffix:!1,names:[`in`,`inch`,`inches`]},millimeters:{value:1e3,suffix:`mm`,pluralizeSuffix:!1,names:[`mm`,`millimeter`,`millimeters`]},centimeters:{value:100,suffix:`cm`,pluralizeSuffix:!1,names:[`cm`,`centimeter`,`centimeters`]},kilometers:{value:.001,suffix:`km`,pluralizeSuffix:!1,names:[`km`,`kilometer`,`kilometers`]},feet:{value:1/(.0254*12),suffix:`ft`,pluralizeSuffix:!1,names:[`ft`,`foot`,`feet`]},yards:{value:1/(.0254*12*3),suffix:`yd`,pluralizeSuffix:!1,names:[`yd`,`yard`,`yards`]},miles:{value:1/(.0254*12*3*1760),suffix:`mi`,pluralizeSuffix:!1,names:[`mi`,`mile`,`miles`]}},angle:{radians:{value:1,suffix:`rad`,pluralizeSuffix:!0,names:[`rad`,`rads`,`radian`,`radians`]},degrees:{value:180/Math.PI,suffix:`°`,pluralizeSuffix:!1,names:[`°`,`deg`,`degs`,`degree`,`degrees`]},rotations:{value:1/(Math.PI*2),suffix:`rot`,pluralizeSuffix:!0,names:[`rot`,`rots`,`rotation`,`rotations`]}},velocity:{"meters/second":{value:1,suffix:`m/s`,pluralizeSuffix:!1,names:[`mps`,`meterpersec`,`meter per sec`,`meterspersec`,`meters per sec`,`meterpersecond`,`meter per second`,`meterspersecond`,`meters per second`]},"inches/second":{value:1/.0254,suffix:`in/s`,pluralizeSuffix:!1,names:[`inch per sec`,`inches per sec`,`inch per second`,`inches per second`,`in per sec`,`in per second`]},"feet/second":{value:1/(.0254*12),suffix:`ft/s`,pluralizeSuffix:!1,names:[`fps`,`ftps`,`foot per sec`,`feet per sec`,`foot per second`,`feet per second`,`ft per sec`,`ft per second`]},"miles/hour":{value:3600/(.0254*12*3*1760),suffix:`mph`,pluralizeSuffix:!1,names:[`mph`,`mile per hour`,`miles per hour`,`mi per hour`]},"kilometers/hour":{value:3600/1e3,suffix:`kph`,pluralizeSuffix:!1,names:[`kph`,`kilometer per hour`,`kilometers per hour`,`ki per hour`]}},"angular velocity":{"radians/second":{value:1,suffix:`rad/s`,pluralizeSuffix:!1,names:[`radian per sec`,`radians per sec`,`radian per second`,`radians per second`,`rad per sec`,`rad per second`,`rads per sec`,`rads per second`]},"degrees/second":{value:180/Math.PI,suffix:`°/s`,pluralizeSuffix:!1,names:[`dps`,`degree per sec`,`degrees per sec`,`degree per second`,`degrees per second`,`deg per sec`,`deg per second`,`degs per sec`,`degs per second`]},"rotations/second":{value:1/(Math.PI*2),suffix:`rps`,pluralizeSuffix:!1,names:[`rps`,`rotation per sec`,`rotations per sec`,`rotation per second`,`rotations per second`,`rot per sec`,`rot per second`,`rots per sec`,`rots per second`]},"rotations/minute":{value:60/(Math.PI*2),suffix:`rpm`,pluralizeSuffix:!1,names:[`rpm`,`rotation per min`,`rotations per min`,`rotation per minute`,`rotations per minute`,`rot per min`,`rot per minute`,`rots per min`,`rots per minute`]}},acceleration:{"meters/second²":{value:1,suffix:`m/s²`,pluralizeSuffix:!1,names:[`mps 2`,`mps2`,`mps²`,`meter per sec 2`,`meters per sec 2`,`meter per sec2`,`meters per sec2`,`meter per sec²`,`meters per sec²`,`meter per sec squared`,`meters per sec squared`,`meter per sec per sec`,`meters per sec per sec`,`meter per second 2`,`meters per second 2`,`meter per second2`,`meters per second2`,`meter per second²`,`meters per second²`,`meter per second squared`,`meters per second squared`,`meter per second per second`,`meters per second per second`]},"inches/second²":{value:1/.0254,suffix:`in/s²`,pluralizeSuffix:!1,names:`ips 2.ips2.ips².inch per sec 2.inches per sec 2.inch per sec2.inches per sec2.inch per sec².inches per sec².inch per sec squared.inches per sec squared.inch per sec per sec.inches per sec per sec.in per sec 2.in per sec2.in per sec².in per sec squared.in per sec per sec.inch per second 2.inches per second 2.inch per second2.inches per second2.inch per second².inches per second².inch per second squared.inches per second squared.inch per second per second.inches per second per second.in per second 2.in per second2.in per second².in per second squared.in per second per second`.split(`.`)},"feet/second²":{value:1/(.0254*12),suffix:`ft/s²`,pluralizeSuffix:!1,names:`fps 2.fps2.fps².foot per sec 2.feet per sec 2.foot per sec2.feet per sec2.foot per sec².feet per sec².foot per sec squared.feet per sec squared.foot per sec per sec.feet per sec per sec.ft per sec 2.ft per sec2.ft per sec².ft per sec squared.ft per sec per sec.foot per second 2.feet per second 2.foot per second2.feet per second2.foot per second².feet per second².foot per second squared.feet per second squared.foot per second per second.feet per second per second.ft per second 2.ft per second2.ft per second².ft per second squared.ft per second per second`.split(`.`)},"standard gravity":{value:1/9.80665,suffix:`g`,pluralizeSuffix:!1,names:[`g`,`gravity`,`gs`]}},"angular acceleration":{"radians/second²":{value:1,suffix:`rad/s²`,pluralizeSuffix:!1,names:`radian per sec 2.radians per sec 2.radian per sec2.radians per sec2.radian per sec².radians per sec².radian per sec squared.radians per sec squared.radian per sec per sec.radians per sec per sec.rad per sec 2.rad per sec2.rad per sec².rad per sec squared.rad per sec per sec.rads per sec 2.rads per sec2.rads per sec².rads per sec squared.rads per sec per sec.radian per second 2.radians per second 2.radian per second2.radians per second2.radian per second².radians per second².radian per second squared.radians per second squared.radian per second per second.radians per second per second.rad per second 2.rad per second2.rad per second².rad per second squared.rad per second per second.rads per second 2.rads per second2.rads per second².rads per second squared.rads per second per second`.split(`.`)},"degrees/second²":{value:180/Math.PI,suffix:`°/s²`,pluralizeSuffix:!1,names:`dps 2.dps2.dps².degree per sec 2.degrees per sec 2.degree per sec2.degrees per sec2.degree per sec².degrees per sec².degree per sec squared.degrees per sec squared.degree per sec per sec.degrees per sec per sec.deg per sec 2.deg per sec2.deg per sec².deg per sec squared.deg per sec per sec.degs per sec 2.degs per sec2.degs per sec².degs per sec squared.degs per sec per sec.degree per second 2.degrees per second 2.degree per second2.degrees per second2.degree per second².degrees per second².degree per second squared.degrees per second squared.degree per second per second.degrees per second per second.deg per second 2.deg per second2.deg per second².deg per second squared.deg per second per second.degs per second 2.degs per second2.degs per second².degs per second squared.degs per second per second`.split(`.`)},"rotations/second²":{value:1/(Math.PI*2),suffix:`rot/s²`,pluralizeSuffix:!1,names:`rps 2.rps2.rps².rotation per sec 2.rotations per sec 2.rotation per sec2.rotations per sec2.rotation per sec².rotations per sec².rotation per sec squared.rotations per sec squared.rotation per sec per sec.rotations per sec per sec.rot per sec 2.rot per sec2.rot per sec².rot per sec squared.rot per sec per sec.rots per sec 2.rots per sec2.rots per sec².rots per sec squared.rots per sec per sec.rotation per second 2.rotations per second 2.rotation per second2.rotations per second2.rotation per second².rotations per second².rotation per second squared.rotations per second squared.rotation per second per second.rotations per second per second.rot per second 2.rot per second2.rot per second².rot per second squared.rot per second per second.rots per second 2.rots per second2.rots per second².rots per second squared.rots per second per second`.split(`.`)}},time:{seconds:{value:1,suffix:`s`,pluralizeSuffix:!1,names:[`s`,`sec`,`secs`,`second`,`seconds`]},milliseconds:{value:1e3,suffix:`ms`,pluralizeSuffix:!1,names:[`ms`,`msec`,`msecs`,`milli`,`millis`,`millisecond`,`milliseconds`]},microseconds:{value:1e6,suffix:`μs`,pluralizeSuffix:!1,names:[`us`,`usec`,`usecs`,`micro`,`micros`,`microsecond`,`microseconds`]},nanoseconds:{value:1e9,suffix:`ns`,pluralizeSuffix:!1,names:[`ns`,`nsec`,`nsecs`,`nano`,`nanos`,`nanosecond`,`nanoseconds`]},minutes:{value:1/60,suffix:`min`,pluralizeSuffix:!0,names:[`min`,`mins`,`minute`,`minutes`]},hours:{value:1/3600,suffix:`hr`,pluralizeSuffix:!0,names:[`hr`,`hrs`,`hour`,`hours`]},days:{value:1/86400,suffix:`day`,pluralizeSuffix:!0,names:[`day`,`days`]}},bytes:{bytes:{value:1,suffix:`B`,pluralizeSuffix:!1,names:[`byte`,`bytes`]},kilobytes:{value:1/1024,suffix:`KB`,pluralizeSuffix:!1,names:[`kb`,`kilobyte`,`kilobytes`]},megabytes:{value:1/(1024*1024),suffix:`MB`,pluralizeSuffix:!1,names:[`mb`,`megabyte`,`megabytes`]},gigabytes:{value:1/(1024*1024*1024),suffix:`GB`,pluralizeSuffix:!1,names:[`gb`,`gigabyte`,`gigabytes`]},terabytes:{value:1/(1024*1024*1024*1024),suffix:`TB`,pluralizeSuffix:!1,names:[`tb`,`terabyte`,`terabytes`]}},bandwidth:{"bits/second":{value:1,suffix:`b/s`,pluralizeSuffix:!1,names:[`bps`,`bit per second`,`bits per second`]},"bytes/second":{value:1/8,suffix:`B/s`,pluralizeSuffix:!1,names:[`Bps`,`byte per second`,`bytes per second`]},"kilobits/second":{value:1/1024,suffix:`kb/s`,pluralizeSuffix:!1,names:[`Kbps`,`kilobit per second`,`kilobits per second`]},"kilobytes/second":{value:1/(1024*8),suffix:`KB/s`,pluralizeSuffix:!1,names:[`KBps`,`kilobyte per second`,`kilobytes per second`]},"megabits/second":{value:1/(1024*1024),suffix:`Mb/s`,pluralizeSuffix:!1,names:[`Mbps`,`megabit per second`,`megabits per second`]},"megabytes/second":{value:1/(1024*1024*8),suffix:`MB/s`,pluralizeSuffix:!1,names:[`MBps`,`megabyte per second`,`megabytes per second`]},"gigabits/second":{value:1/(1024*1024*1024),suffix:`Gb/s`,pluralizeSuffix:!1,names:[`Gbps`,`gigabit per second`,`gigabits per second`]},"gigabytes/second":{value:1/(1024*1024*1024*8),suffix:`GB/s`,pluralizeSuffix:!1,names:[`GBps`,`gigabyte per second`,`gigabytes per second`]},"terabits/second":{value:1/(1024*1024*1024*1024),suffix:`Tb/s`,pluralizeSuffix:!1,names:[`Tbps`,`terabit per second`,`terabits per second`]},"terabytes/second":{value:1/(1024*1024*1024*1024*8),suffix:`TB/s`,pluralizeSuffix:!1,names:[`TBps`,`terabyte per second`,`terabytes per second`]}},frequency:{hertz:{value:1,suffix:`Hz`,pluralizeSuffix:!1,names:[`hz`,`hertz`,`frequency`]},kilohertz:{value:.001,suffix:`kHz`,pluralizeSuffix:!1,names:[`khz`,`kilohertz`]},megahertz:{value:1e-6,suffix:`MHz`,pluralizeSuffix:!1,names:[`mhz`,`megahertz`]}},temperature:{celsius:{value:1,suffix:`°C`,pluralizeSuffix:!1,names:[`c`,`°c`,`℃`,`celsius`,`celcius`]},fahrenheit:{value:1,suffix:`°F`,pluralizeSuffix:!1,names:[`f`,`°f`,`℉`,`fahrenheit`]},kelvin:{value:1,suffix:`K`,pluralizeSuffix:!1,names:[`k`,`K`,`kelvin`]}},voltage:{volts:{value:1,suffix:`V`,pluralizeSuffix:!1,names:[`v`,`volt`,`volts`,`voltage`]},millivolts:{value:1e3,suffix:`mV`,pluralizeSuffix:!1,names:[`mv`,`millivolt`,`millivolts`]}},current:{amps:{value:1,suffix:`A`,pluralizeSuffix:!1,names:[`amp`,`amps`,`amperage`,`current`]},milliamps:{value:1e3,suffix:`mA`,pluralizeSuffix:!1,names:[`ma`,`milliamp`,`milliamps`]}},energy:{joule:{value:1,suffix:`J`,pluralizeSuffix:!1,names:[`j`,`joule`,`joules`]},"watt hour":{value:1/3600,suffix:`Wh`,pluralizeSuffix:!1,names:[`wh`,`watt hour`,`watt hours`]},calorie:{value:1/4.184,suffix:`cal`,pluralizeSuffix:!0,names:[`cal`,`calorie`,`calories`]},potato:{value:1/4.184/1e3/110,suffix:`pot`,pluralizeSuffix:!1,names:[`pot`,`potato`,`potatoes`]}}},e.STRUCT_UNITS={Rotation2d:{value:`radians`},Translation2d:{x:`meters`,y:`meters`},Translation3d:{x:`meters`,y:`meters`,z:`meters`},Twist2d:{dx:`meters`,dy:`meters`,dtheta:`radians`},Twist3d:{dx:`meters`,dy:`meters`,dz:`meters`,rx:`radians`,ry:`radians`,rz:`radians`},ChassisVelocities:{vx:`meters/second`,vy:`meters/second`,omega:`radians/second`},ChassisSpeeds:{vx:`meters/second`,vy:`meters/second`,omega:`radians/second`},ChassisAccelerations:{ax:`meters/second²`,ay:`meters/second²`,alpha:`radians/second²`},DifferentialDriveKinematics:{track_width:`meters`},DifferentialDriveWheelPositions:{left:`meters`,right:`meters`},DifferentialDriveWheelVelocities:{left:`meters/second`,right:`meters/second`},DifferentialDriveWheelSpeeds:{left:`meters/second`,right:`meters/second`},DifferentialDriveWheelAccelerations:{left:`meters/second²`,right:`meters/second²`},DifferentialDriveWheelVoltages:{left:`volts`,right:`volts`},MecanumDriveWheelPositions:{front_left:`meters`,front_right:`meters`,rear_left:`meters`,rear_right:`meters`},MecanumDriveWheelVelocities:{front_left:`meters/second`,front_right:`meters/second`,rear_left:`meters/second`,rear_right:`meters/second`},MecanumDriveWheelSpeeds:{front_left:`meters/second`,front_right:`meters/second`,rear_left:`meters/second`,rear_right:`meters/second`},MecanumDriveWheelAccelerations:{front_left:`meters/second²`,front_right:`meters/second²`,rear_left:`meters/second²`,rear_right:`meters/second²`},SwerveModulePosition:{distance:`meters`},SwerveModuleVelocity:{speed:`meters/second`},SwerveModuleState:{speed:`meters/second`},SwerveModuleAcceleration:{speed:`meters/second²`},ArmFeedforward:{dt:`seconds`},ElevatorFeedforward:{dt:`seconds`},SimpleMotorFeedforward:{dt:`seconds`},DCMotor:{nominal_voltage:`volts`,stall_current:`amps`,free_current:`amps`,free_speed:`radians/second`}},e.ALL_UNITS=Object.assign({},...Object.values(e.UNIT_GROUPS));function t(t,n,r){if(!(n in e.ALL_UNITS&&r in e.ALL_UNITS))throw`Invalid unit provided`;let i;return i=n===`fahrenheit`?(t-32)/1.8:n==`kelvin`?t-273.15:t/e.ALL_UNITS[n].value,r===`fahrenheit`?i*1.8+32:r===`kelvin`?i+273.15:i*e.ALL_UNITS[r].value}e.convert=t;function n(e,n){return n.type===null&&n.factor===1?e:n.from===void 0||n.to===void 0?e*n.factor:t(e,n.from,n.to)*n.factor}e.convertWithPreset=n;function r(e,t){switch(t){case b.Differentiate:return e.endsWith(`²`)?e.slice(0,-1)+`³`:e.endsWith(`ps`)||e.endsWith(`/s`)?e+`²`:e+`/s`;case b.Integrate:return e.endsWith(`²`)?e.slice(0,-1):e.endsWith(`/s`)?e.slice(0,-2):e+`·s`;default:return e}}e.getSuffixForFilter=r,e.NoopUnitConversion={type:null,factor:1},e.MAX_RECENT_UNITS=5,e.GROUP_BY_UNIT=(()=>{let t={};return Object.entries(e.UNIT_GROUPS).forEach(e=>{let[n,r]=e;Object.keys(r).forEach(e=>{t[e]=n})}),t})(),e.UNIT_SUFFIXES=(()=>{let t={};return Object.entries(e.ALL_UNITS).forEach(e=>{let[n,r]=e;r.names.forEach(e=>{e.length!==0&&(t[e]=n,t[` `+e]=n,t[`_`+e]=n,e.includes(` `)&&(t[e.replaceAll(` `,``)]=n,t[e.replaceAll(` `,`_`)]=n),e.includes(` per `)&&(t[e.replaceAll(` per `,`/`)]=n,t[e.replaceAll(` per `,`/`).replaceAll(` `,``)]=n,t[e.replaceAll(` per `,`/`).replaceAll(` `,`_`)]=n))})}),t})();function i(t){let n=t.toLowerCase(),r=Object.keys(e.UNIT_SUFFIXES).filter(e=>!e.includes(`/`)&&t.length>e.length&&n.endsWith(e.toLowerCase())&&!n.endsWith(`/`+e.toLowerCase())&&(e.startsWith(`_`)||e.startsWith(` `)||de(t,t.length-e.length)));if(r.length===0)return null;let i=r.reduce((e,t)=>Math.max(e,t.length),0),a=r.filter(e=>e.length===i);if(a.length===1)return e.UNIT_SUFFIXES[a[0]];let o=a[0],s=0;for(let e=0;e<a.length;e++){let n=0;for(let r=0;r<a[e].length;r++)t[t.length-a[e].length+r]===a[e][r]&&n++;n>s&&(o=a[e],s=n)}return e.UNIT_SUFFIXES[o]}e.getUnitForField=i})(O||={});const k=O.convert(54,`feet`,`meters`),fe=O.convert(27,`feet`,`meters`),A=O.convert(12,`feet`,`meters`),j=O.convert(12,`feet`,`meters`),M=O.convert(69,`inches`,`meters`),pe=[[k/2,-M],[k/2,0],[k/2,M],[-k/2,M],[-k/2,0],[-k/2,-M]],N=A/2+O.convert(39,`inches`,`meters`),me=[[N,-j/6],[N,j/6],[-N,j/6],[-N,-j/6]];O.convert(k,`meters`,`inches`),O.convert(fe,`meters`,`inches`),O.convert(A,`meters`,`inches`),O.convert(j,`meters`,`inches`),O.convert(k,`meters`,`inches`),O.convert(fe,`meters`,`inches`),O.convert(A,`meters`,`inches`),O.convert(j,`meters`,`inches`);function he(e){if(typeof e!=`object`||!e)return`invalid`;let t={name:``,path:``,id:``,isFTC:!1,useGrid:!0,coordinateSystem:`center-red`,topLeft:[-1,-1],bottomRight:[-1,-1],widthInches:0,heightInches:0};if(`name`in e&&typeof e.name==`string`&&(t.name=e.name),`isFTC`in e&&typeof e.isFTC==`boolean`)t.isFTC=e.isFTC;else return`skip`;return`coordinateSystem`in e&&typeof e.coordinateSystem==`string`&&(e.coordinateSystem===`wall-alliance`||e.coordinateSystem===`wall-blue`||e.coordinateSystem===`center-rotated`||e.coordinateSystem===`center-red`)&&(t.coordinateSystem=e.coordinateSystem),`useGrid`in e&&typeof e.useGrid==`boolean`&&(t.useGrid=e.useGrid),`sourceUrl`in e&&typeof e.sourceUrl==`string`&&(t.sourceUrl=e.sourceUrl),`topLeft`in e&&D(e.topLeft,`number`)&&e.topLeft.length===2&&(t.topLeft=e.topLeft),`bottomRight`in e&&D(e.bottomRight,`number`)&&e.bottomRight.length===2&&(t.bottomRight=e.bottomRight),`widthInches`in e&&typeof e.widthInches==`number`&&(t.widthInches=e.widthInches),`heightInches`in e&&typeof e.heightInches==`number`&&(t.heightInches=e.heightInches),t.name.length>0&&t.topLeft[0]>=0&&t.topLeft[1]>=0&&t.bottomRight[0]>=0&&t.bottomRight[1]>=0&&t.widthInches>0&&t.heightInches>0?(t.id=(t.isFTC?`FTC`:`FRC`)+`:`+t.name,t):`invalid`}function ge(e){if(typeof e!=`object`||!e)return`invalid`;let t={name:``,path:``,id:``,isFTC:!1,coordinateSystem:`center-red`,useGrid:!0,rotations:[],position:[0,0,0],widthInches:0,heightInches:0,driverStations:pe,gamePieces:[],aprilTags:[]};if(`name`in e&&typeof e.name==`string`&&(t.name=e.name),`isFTC`in e&&typeof e.isFTC==`boolean`)t.isFTC=e.isFTC,t.isFTC&&(t.driverStations=me);else return`skip`;return`coordinateSystem`in e&&typeof e.coordinateSystem==`string`&&(e.coordinateSystem===`wall-alliance`||e.coordinateSystem===`wall-blue`||e.coordinateSystem===`center-rotated`||e.coordinateSystem===`center-red`)&&(t.coordinateSystem=e.coordinateSystem),`useGrid`in e&&typeof e.useGrid==`boolean`&&(t.useGrid=e.useGrid),`rotations`in e&&Array.isArray(e.rotations)&&e.rotations.every(e=>typeof e==`object`&&`axis`in e&&(e.axis===`x`||e.axis===`y`||e.axis===`z`)&&`degrees`in e&&typeof e.degrees==`number`)&&(t.rotations=e.rotations),`position`in e&&D(e.position,`number`)&&e.position.length===3&&(t.position=e.position),`widthInches`in e&&typeof e.widthInches==`number`&&(t.widthInches=e.widthInches),`heightInches`in e&&typeof e.heightInches==`number`&&(t.heightInches=e.heightInches),`driverStations`in e&&Array.isArray(e.driverStations)&&e.driverStations.length===(t.isFTC?4:6)&&e.driverStations.every(e=>D(e,`number`)&&e.length===2)&&(t.driverStations=e.driverStations),`gamePieces`in e&&Array.isArray(e.gamePieces)&&e.gamePieces.forEach(e=>{let n={name:``,rotations:[],position:[0,0,0],stagedObjects:[]};t.gamePieces.push(n),`name`in e&&typeof e.name==`string`&&(n.name=e.name),`rotations`in e&&Array.isArray(e.rotations)&&e.rotations.every(e=>typeof e==`object`&&`axis`in e&&(e.axis===`x`||e.axis===`y`||e.axis===`z`)&&`degrees`in e&&typeof e.degrees==`number`)&&(n.rotations=e.rotations),`position`in e&&D(e.position,`number`)&&e.position.length===3&&(n.position=e.position),`stagedObjects`in e&&D(e.stagedObjects,`string`)&&(n.stagedObjects=e.stagedObjects)}),`aprilTags`in e&&Array.isArray(e.aprilTags)&&e.aprilTags.forEach(e=>{let n={variant:`36h11-6.5in`,id:0,rotations:[],position:[0,0,0]};if(`variant`in e&&typeof e.variant==`string`){let t=e.variant;switch(t){case`frc-36h11`:t=`36h11-6.5in`;break;case`frc-16h5`:t=`16h5-6in`;break;case`ftc-2in`:t=`36h11-2in`;break;case`ftc-3in`:t=`36h11-3in`;break;case`ftc-4in`:t=`36h11-4in`;break;case`ftc-5in`:t=`36h11-5in`;break}let r=t.split(`-`);if(r.length===2&&(r[0]===`36h11`||r[0]===`16h5`)&&r[1].endsWith(`in`)&&!isNaN(parseFloat(r[1].slice(0,-2))))n.variant=t;else return}else return;`id`in e&&typeof e.id==`number`&&(n.id=e.id),`rotations`in e&&Array.isArray(e.rotations)&&e.rotations.every(e=>typeof e==`object`&&`axis`in e&&(e.axis===`x`||e.axis===`y`||e.axis===`z`)&&`degrees`in e&&typeof e.degrees==`number`)&&(n.rotations=e.rotations),`position`in e&&D(e.position,`number`)&&e.position.length===3&&(n.position=e.position),t.aprilTags.push(n)}),t.name.length>0&&t.widthInches>0&&t.heightInches>0?(t.id=(t.isFTC?`FTC`:`FRC`)+`:`+t.name,t):`invalid`}function _e(e){if(typeof e!=`object`||!e)return`invalid`;let t={name:``,path:``,isFTC:!1,rotations:[],position:[0,0,0],cameras:[],components:[],disableSimplification:!1};return`name`in e&&typeof e.name==`string`&&(t.name=e.name),`isFTC`in e&&typeof e.isFTC==`boolean`&&(t.isFTC=e.isFTC),`disableSimplification`in e&&typeof e.disableSimplification==`boolean`&&(t.disableSimplification=e.disableSimplification),`rotations`in e&&Array.isArray(e.rotations)&&e.rotations.every(e=>typeof e==`object`&&`axis`in e&&(e.axis===`x`||e.axis===`y`||e.axis===`z`)&&`degrees`in e&&typeof e.degrees==`number`)&&(t.rotations=e.rotations),`position`in e&&D(e.position,`number`)&&e.position.length===3&&(t.position=e.position),`cameras`in e&&Array.isArray(e.cameras)&&e.cameras.forEach(e=>{let n={name:``,rotations:[],position:[0,0,0],resolution:[200,100],fov:90};t.cameras.push(n),`name`in e&&typeof e.name==`string`&&(n.name=e.name),`rotations`in e&&Array.isArray(e.rotations)&&e.rotations.every(e=>typeof e==`object`&&`axis`in e&&(e.axis===`x`||e.axis===`y`||e.axis===`z`)&&`degrees`in e&&typeof e.degrees==`number`)&&(n.rotations=e.rotations),`position`in e&&D(e.position,`number`)&&e.position.length===3&&(n.position=e.position),`resolution`in e&&D(e.resolution,`number`)&&e.resolution.length===2&&(n.resolution=e.resolution),`fov`in e&&typeof e.fov==`number`&&(n.fov=e.fov)}),`components`in e&&Array.isArray(e.components)&&e.components.forEach(e=>{let n={zeroedRotations:[],zeroedPosition:[0,0,0]};t.components.push(n),`zeroedRotations`in e&&Array.isArray(e.zeroedRotations)&&e.zeroedRotations.every(e=>typeof e==`object`&&`axis`in e&&(e.axis===`x`||e.axis===`y`||e.axis===`z`)&&`degrees`in e&&typeof e.degrees==`number`)&&(n.zeroedRotations=e.zeroedRotations),`zeroedPosition`in e&&D(e.zeroedPosition,`number`)&&e.zeroedPosition.length===3&&(n.zeroedPosition=e.zeroedPosition)}),t.name.length>0&&t.cameras.every(e=>e.name.length>0)?t:`invalid`}function ve(e){if(typeof e!=`object`||!e)return`invalid`;let t={name:``,path:``,components:[]};return`name`in e&&typeof e.name==`string`&&(t.name=e.name),`components`in e&&Array.isArray(e.components)&&e.components.forEach(e=>{let n=!1;`isYellow`in e&&typeof e.isYellow==`boolean`&&(n=e.isYellow);let r=[0,0];if(`centerPx`in e&&D(e.centerPx,`number`)&&e.centerPx.length===2&&(r=e.centerPx),`type`in e&&typeof e.type==`string`)switch(e.type){case`button`:let i={type:`button`,isYellow:n,isEllipse:!1,centerPx:r,sizePx:[0,0]};`isEllipse`in e&&typeof e.isEllipse==`boolean`&&(i.isEllipse=e.isEllipse),`sizePx`in e&&D(e.sizePx,`number`)&&e.sizePx.length===2&&(i.sizePx=e.sizePx),`sdlSourceIndex`in e&&typeof e.sdlSourceIndex==`number`&&(i.sdlSourceIndex=e.sdlSourceIndex),`sdlSourcePov`in e&&typeof e.sdlSourcePov==`string`&&(e.sdlSourcePov===`up`||e.sdlSourcePov===`right`||e.sdlSourcePov===`down`||e.sdlSourcePov===`left`)&&(i.sdlSourcePov=e.sdlSourcePov),`niSourceIndex`in e&&typeof e.niSourceIndex==`number`?i.niSourceIndex=e.niSourceIndex:`sourceIndex`in e&&typeof e.sourceIndex==`number`&&(i.niSourceIndex=e.sourceIndex),`niSourcePov`in e&&typeof e.niSourcePov==`string`&&(e.niSourcePov===`up`||e.niSourcePov===`right`||e.niSourcePov===`down`||e.niSourcePov===`left`)?i.niSourcePov=e.niSourcePov:`sourcePov`in e&&typeof e.sourcePov==`string`&&(e.sourcePov===`up`||e.sourcePov===`right`||e.sourcePov===`down`||e.sourcePov===`left`)&&(i.niSourcePov=e.sourcePov),t.components.push(i);break;case`joystick`:let a={type:`joystick`,isYellow:n,centerPx:r,radiusPx:0};`radiusPx`in e&&typeof e.radiusPx==`number`&&(a.radiusPx=e.radiusPx),`sdlXSourceIndex`in e&&typeof e.sdlXSourceIndex==`number`&&(a.sdlXSourceIndex=e.sdlXSourceIndex),`sdlXSourceInverted`in e&&typeof e.sdlXSourceInverted==`boolean`&&(a.sdlXSourceInverted=e.sdlXSourceInverted),`sdlYSourceIndex`in e&&typeof e.sdlYSourceIndex==`number`&&(a.sdlYSourceIndex=e.sdlYSourceIndex),`sdlYSourceInverted`in e&&typeof e.sdlYSourceInverted==`boolean`&&(a.sdlYSourceInverted=e.sdlYSourceInverted),`sdlButtonSourceIndex`in e&&typeof e.sdlButtonSourceIndex==`number`&&(a.sdlButtonSourceIndex=e.sdlButtonSourceIndex),`niXSourceIndex`in e&&typeof e.niXSourceIndex==`number`?a.niXSourceIndex=e.niXSourceIndex:`xSourceIndex`in e&&typeof e.xSourceIndex==`number`&&(a.niXSourceIndex=e.xSourceIndex),`niXSourceInverted`in e&&typeof e.niXSourceInverted==`boolean`?a.niXSourceInverted=e.niXSourceInverted:`xSourceInverted`in e&&typeof e.xSourceInverted==`boolean`&&(a.niXSourceInverted=e.xSourceInverted),`niYSourceIndex`in e&&typeof e.niYSourceIndex==`number`?a.niYSourceIndex=e.niYSourceIndex:`ySourceIndex`in e&&typeof e.ySourceIndex==`number`&&(a.niYSourceIndex=e.ySourceIndex),`niYSourceInverted`in e&&typeof e.niYSourceInverted==`boolean`?a.niYSourceInverted=e.niYSourceInverted:`ySourceInverted`in e&&typeof e.ySourceInverted==`boolean`&&(a.niYSourceInverted=e.ySourceInverted),`niButtonSourceIndex`in e&&typeof e.niButtonSourceIndex==`number`?a.niButtonSourceIndex=e.niButtonSourceIndex:`buttonSourceIndex`in e&&typeof e.buttonSourceIndex==`number`&&(a.niButtonSourceIndex=e.buttonSourceIndex),t.components.push(a);break;case`axis`:let o={type:`axis`,isYellow:n,centerPx:r,sizePx:[0,0]};`sizePx`in e&&D(e.sizePx,`number`)&&e.sizePx.length===2&&(o.sizePx=e.sizePx),`sdlSourceIndex`in e&&typeof e.sdlSourceIndex==`number`&&(o.sdlSourceIndex=e.sdlSourceIndex),`sdlSourceRange`in e&&D(e.sdlSourceRange,`number`)&&e.sdlSourceRange.length===2&&(o.sdlSourceRange=e.sdlSourceRange),`niSourceIndex`in e&&typeof e.niSourceIndex==`number`?o.niSourceIndex=e.niSourceIndex:`sourceIndex`in e&&typeof e.sourceIndex==`number`&&(o.niSourceIndex=e.sourceIndex),`niSourceRange`in e&&D(e.niSourceRange,`number`)&&e.niSourceRange.length===2?o.niSourceRange=e.niSourceRange:`sourceRange`in e&&D(e.sourceRange,`number`)&&e.sourceRange.length===2&&(o.niSourceRange=e.sourceRange),t.components.push(o);break;case`touchpad`:let s={type:`touchpad`,isYellow:n,centerPx:r,sizePx:[0,0],sdlSourceIndex:-1};`sizePx`in e&&D(e.sizePx,`number`)&&e.sizePx.length===2&&(s.sizePx=e.sizePx),`sdlSourceIndex`in e&&typeof e.sdlSourceIndex==`number`&&(s.sdlSourceIndex=e.sdlSourceIndex),t.components.push(s);break}}),t.name.length>0&&t.components.every(e=>{switch(e.type){case`button`:return e.sizePx[0]>0&&e.sizePx[1]>0&&(e.sdlSourceIndex!==void 0||e.niSourceIndex!==void 0);case`joystick`:return e.radiusPx>0&&(e.sdlXSourceIndex!==void 0&&e.sdlYSourceIndex!==void 0||e.niXSourceIndex!==void 0&&e.niYSourceIndex!==void 0);case`axis`:return e.sizePx[0]>0&&e.sizePx[1]>0&&(e.sdlSourceIndex!==void 0||e.niSourceIndex!==void 0);case`touchpad`:return e.sizePx[0]>0&&e.sizePx[1]>0&&e.sdlSourceIndex>=0}})?t:`invalid`}function ye(e){let t={field2ds:[],field3ds:[],robots:[],joysticks:[],loadFailures:e.loadFailures};return e.field2ds.forEach(e=>{t.field2ds.find(t=>t.id===e.id)===void 0&&t.field2ds.push(e)}),e.field3ds.forEach(e=>{t.field3ds.find(t=>t.id===e.id)===void 0&&t.field3ds.push(e)}),e.robots.forEach(e=>{t.robots.find(t=>t.name===e.name)===void 0&&t.robots.push(e)}),e.joysticks.forEach(e=>{t.joysticks.find(t=>t.name===e.name)===void 0&&t.joysticks.push(e)}),t.field2ds.sort((e,t)=>e.name===`Evergreen`?1:t.name===`Evergreen`||e.name>t.name?-1:+(t.name>e.name)),t.field3ds.sort((e,t)=>e.name>t.name?-1:+(t.name>e.name)),t.robots.sort((e,t)=>/^\d/.test(e.name)&&/^\d/.test(t.name)?-e.name.localeCompare(t.name,void 0,{numeric:!0}):e.name.localeCompare(t.name,void 0,{numeric:!0})),t.joysticks.sort((e,t)=>e.name>t.name?-1:+(t.name>e.name)),t.loadFailures.sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0})),t}async function P(){let e={field2ds:[],field3ds:[],robots:[],joysticks:[],loadFailures:[]},t=await(await fetch(`assets`)).json(),n=window.location.pathname,r=Object.keys(t).filter(e=>e.endsWith(`config.json`)).sort((e,t)=>e<t?1:e>t?-1:0);for(let i of r){let r=i.split(`/`)[0],a=t[i];if(e.loadFailures.push(r),a===null)try{a=await(await fetch(`assets/${i}`)).json()}catch{continue}let o=r.startsWith(`Field2d_`),s=r.startsWith(`Field3d_`),c=r.startsWith(`Robot_`),l=r.startsWith(`Joystick_`);if(o){let i=he(a);if(i===`skip`){e.loadFailures.splice(e.loadFailures.indexOf(r),1);continue}else if(i===`invalid`)continue;i.path=n+`assets/${encodeURIComponent(r)}/image.png`,`${r}/image.png`in t&&(e.field2ds.push(i),e.loadFailures.splice(e.loadFailures.indexOf(r),1))}else if(s){let i=ge(a);if(i===`skip`){e.loadFailures.splice(e.loadFailures.indexOf(r),1);continue}else if(i===`invalid`)continue;i.path=n+`assets/${encodeURIComponent(r)}/model.glb`,`${r}/model.glb`in t&&i.gamePieces.every((e,n)=>`${r}/model_${n}.glb`in t)&&(e.field3ds.push(i),e.loadFailures.splice(e.loadFailures.indexOf(r),1))}else if(c){let i=_e(a);if(i===`invalid`)continue;i.path=n+`assets/${encodeURIComponent(r)}/model.glb`,`${r}/model.glb`in t&&i.components.every((e,n)=>`${r}/model_${n}.glb`in t)&&(e.robots.push(i),e.loadFailures.splice(e.loadFailures.indexOf(r),1))}else if(l){let i=ve(a);if(i===`invalid`)continue;i.path=n+`assets/${encodeURIComponent(r)}/image.png`,`${r}/image.png`in t&&(e.joysticks.push(i),e.loadFailures.splice(e.loadFailures.indexOf(r),1))}}return ye(e)}const F={year:`2027`,isAlpha:!0,expiration:new Date(2027,0,9),surveyUrl:null};var I;(function(e){let t=g===h.LiteDS?`AdvantageScopeLiteDS/`:`AdvantageScopeLite/`;e.STATE=t+`27.0.0-alpha-5/state`,e.PREFS=t+`prefs`,e.TYPE_MEMORY=t+`type-memory`,e.RECENT_UNITS=t+`recent-units`,e.BETA_STATE=t+`beta-`+(F===null?`NA`:F.year)})(I||={});function L(){if(R()){let e=structuredClone(we),t=localStorage.getItem(I.BETA_STATE);return t!==null&&Object.assign(e,JSON.parse(t)),e}else return null}function R(){return F!==null}function be(){let e=L();return e===null?!0:e.welcomeComplete}function xe(){return R()&&F.isAlpha}function Se(){let e=L();e!==null&&(e.welcomeComplete=!0,localStorage.setItem(I.BETA_STATE,JSON.stringify(e)))}function Ce(){return F===null?!1:new Date>F.expiration}const we={welcomeComplete:!1},Te={sidebar:{width:300,expanded:[`/Control`,`/Status`]},tabs:{selected:0,tabs:[{type:5,title:`Console`,controller:`DS:/Dscomm/Console`,controllerUUID:`0`,renderer:{highlight:!0},controlsHeight:0},{type:1,title:`Communication`,controller:{leftSources:[{type:`stepped`,logKey:`DS:/Dscomm/Status/Rtt`,logType:`Number`,visible:!0,options:{color:`#3b875a`,size:`normal`}}],rightSources:[{type:`stepped`,logKey:`DS:/Dscomm/Status/LostPackets`,logType:`Number`,visible:!0,options:{color:`#e5b31b`,size:`normal`}}],discreteSources:[{type:`stripes`,logKey:`DS:/Dscomm/Status/HasTcpConn`,logType:`Boolean`,visible:!0,options:{color:`#2b66a2`}},{type:`stripes`,logKey:`DS:/Dscomm/Status/HasUserCode`,logType:`Boolean`,visible:!0,options:{color:`#80588e`}},{type:`stripes`,logKey:`DS:/Dscomm/Status/HasUserCodeReady`,logType:`Boolean`,visible:!0,options:{color:`#e48b32`}}],leftLockedRange:null,rightLockedRange:null,leftUnitConversion:{autoTarget:null,preset:null},rightUnitConversion:{autoTarget:null,preset:null},leftFilter:0,rightFilter:0,showRobotMode:!0},controllerUUID:`1`,renderer:null,controlsHeight:200},{type:1,title:`Power`,controller:{leftSources:[{type:`stepped`,logKey:`DS:/Dscomm/Status/Battery`,logType:`Number`,visible:!0,options:{color:`#e5b31b`,size:`normal`}}],rightSources:[],discreteSources:[],leftLockedRange:null,rightLockedRange:null,leftUnitConversion:{autoTarget:null,preset:null},rightUnitConversion:{autoTarget:null,preset:null},leftFilter:0,rightFilter:0,showRobotMode:!0},controllerUUID:`2`,renderer:null,controlsHeight:200},{type:1,title:`CPU`,controller:{leftSources:[{type:`stepped`,logKey:`DS:/Dscomm/Status/CPU`,logType:`Number`,visible:!0,options:{color:`#af2437`,size:`bold`}},{type:`stepped`,logKey:`DS:/Dscomm/Status/DsCpuUtilization`,logType:`Number`,visible:!0,options:{color:`#80588e`,size:`normal`}}],rightSources:[],discreteSources:[],leftLockedRange:null,rightLockedRange:null,leftUnitConversion:{autoTarget:null,preset:null},rightUnitConversion:{autoTarget:null,preset:null},leftFilter:0,rightFilter:0,showRobotMode:!0},controllerUUID:`3`,renderer:null,controlsHeight:200},{type:8,title:`Joysticks`,controller:[`Generic Joystick`,`None`,`None`,`None`,`None`,`None`],controllerUUID:`4`,renderer:null,controlsHeight:85}]}};let z,B,V,H,Ee,U,W=null,G=new m,De,K=null,Oe=!1;function q(e,t){U.style.left=e.x.toString()+`px`,U.style.top=e.y.toString()+`px`,U.style.width=e.width.toString()+`px`,U.style.height=e.height.toString()+`px`,U.onclick=n=>{G.open({event:n,position:e.y+e.height/2>window.innerHeight/2?`top`:`bottom`,menuItems:t})},U.click()}window.addEventListener(`resize`,()=>G.close()),G.on(`open`,()=>{V.hidden=!1}),G.on(`close`,()=>{V.hidden=!0});function J(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return new Promise(a=>{Oe=i,K!==null&&window.clearInterval(K),B.style.width=t[0].toString()+(n===`pixels`?`px`:`%`),B.style.height=t[1].toString()+(n===`pixels`?`px`:`%`),B.onload=()=>{var e,t;B.hidden=!1,z.classList.add(`background`);let n=new MessageChannel;if((e=B.contentWindow)==null||e.postMessage(`port`,`*`,[n.port1]),r!==void 0&&n.port2.addEventListener(`message`,e=>{r(e.data,n.port2)}),n.port2.start(),a(n.port2),!i){var o;window.onclick=()=>Y(),(o=B.contentWindow)==null||o.addEventListener(`keydown`,e=>{e.code===`Escape`?Y():$(e)},{capture:!0})}(t=B.contentWindow)==null||t.focus()},B.src=e})}function Y(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Oe&&!e||(window.onclick=null,B.onload=null,B.hidden=!0,B.src=``,z.classList.remove(`background`),window.focus(),K!==null&&window.clearInterval(K))}function X(e,t,n){try{e?.postMessage({name:t,data:n})}catch{return!1}return!0}function Z(e){J(`www/sourceListHelp.html`,[30,65],`percent`).then(t=>{X(t,`set-config`,e)})}function ke(){J(`www/preferences.html`,[400,399],`pixels`,e=>{Y(),X(W,`set-preferences`,e),localStorage.setItem(I.PREFS,JSON.stringify(e))}).then(e=>{let t=x,n=localStorage.getItem(I.PREFS);n!==null&&S(t,JSON.parse(n)),e.postMessage({platform:`lite`,prefs:t})})}function Ae(){J(`www/download.html`,[35,65],`percent`,(e,t)=>{switch(e.name){case`start`:let n=e.data.path,r=async()=>{let e;try{e=await fetch(`logs?folder=${encodeURIComponent(n)}`)}catch{X(t,`show-error`,`Fetch failed`);return}e.ok?X(t,`set-list`,await e.json()):e.status===404?X(t,`show-error`,`No such file`):X(t,`show-error`,e.statusText)};r(),K=window.setInterval(()=>r(),3e3);break;case`close`:Y();break;case`save`:Y(),X(W,`open-files`,{files:e.data,merge:!1});break}}).then(e=>{let t=x,n=localStorage.getItem(I.PREFS);n!==null&&S(t,JSON.parse(n)),X(e,`set-platform`,`lite`),X(e,`set-preferences`,t)})}async function je(){(await J(`www/uploadAsset.html`,[360,120],`pixels`,async()=>{Y(),X(W,`set-assets`,await P())})).postMessage(null)}async function Q(){var e,t,n,r,i;let a=new MessageChannel;(e=z.contentWindow)==null||e.postMessage(`port`,`*`,[a.port1]),W=a.port2,W.addEventListener(`message`,e=>{Me(e.data)}),W.start(),X(W,`set-version`,{platform:`lite`,platformRelease:``,platformArch:``,appVersion:`27.0.0-alpha-5`}),X(W,`show-feedback-button`,R());let o=g===h.LiteDS?oe:x,s=localStorage.getItem(I.PREFS);s!==null&&S(o,JSON.parse(s)),X(W,`set-preferences`,o),X(W,`set-assets`,await De);let c=localStorage.getItem(I.TYPE_MEMORY);c!==null&&X(W,`restore-type-memory`,JSON.parse(c));let l=null,u=localStorage.getItem(I.STATE);u===null?g===h.LiteDS&&(l=Te):l=JSON.parse(u),l!==null&&X(W,`restore-state`,l),X(W,`show-when-ready`),(t=z.contentWindow)==null||t.addEventListener(`contextmenu`,e=>{e.preventDefault()}),(n=z.contentWindow)==null||n.addEventListener(`mousedown`,e=>{e.target!==null&&typeof e.target==`object`&&`tagName`in e.target&&typeof e.target.tagName==`string`&&(e.target.tagName.toLowerCase()===`input`||e.target.tagName.toLowerCase()===`select`)||e.preventDefault()}),(r=z.contentWindow)==null||r.addEventListener(`mousemove`,e=>e.preventDefault()),(i=z.contentWindow)==null||i.addEventListener(`keydown`,e=>$(e),{capture:!0})}async function Me(e){switch(e.name){case`show`:z.style.opacity=`100%`;break;case`alert`:case`error`:window.alert(e.data.content);break;case`save-state`:localStorage.setItem(I.STATE,JSON.stringify(e.data));break;case`save-type-memory`:let n=localStorage.getItem(I.TYPE_MEMORY),r=n===null?{}:JSON.parse(n),i=JSON.stringify(r);Object.entries(e.data).forEach(e=>{let[n,i]=e;n in r?r[n]=t(t({},r[n]),i):r[n]=i});let a=JSON.stringify(r);(n===null||i)!==a&&localStorage.setItem(I.TYPE_MEMORY,JSON.stringify(r));break;case`update-preferences`:{let t=g===h.LiteDS?oe:x,n=localStorage.getItem(I.PREFS);n!==null&&S(t,JSON.parse(n)),S(t,e.data),localStorage.setItem(I.PREFS,JSON.stringify(t)),X(W,`set-preferences`,t)}break;case`open-feedback`:window.open(`https://github.com/Mechanical-Advantage/AdvantageScope/issues/new/choose`,`_blank`);break;case`historical-start`:{let t=e.data.uuid,n=e.data.path,r=x,i=localStorage.getItem(I.PREFS);i!==null&&S(r,JSON.parse(i));let a=await(await fetch(`logs/${encodeURIComponent(n)}?folder=${encodeURIComponent(r.remotePath)}`)).arrayBuffer(),o=new Uint8Array(a);X(W,`historical-data`,{files:[o],error:null,uuid:t})}break;case`open-link`:window.open(e.data,`_blank`);break;case`ask-open-sidebar-context-menu`:break;case`open-app-menu`:{let t=[],n=navigator.userAgent.includes(`Macintosh`)?`⌘`:`Ctrl`;switch(e.data.index){case 0:t=[{content:`About AdvantageScope Lite`,callback(){let e=[];e.push(`Version: 27.0.0-alpha-5`),e.push(`Distribution: `+(g===h.Lite?`Lite`:`Lite (Driver Station)`)),e.push(`Build Date: 2026-07-09T22:05:27.600Z`),e.push(`User Agent: `+navigator.userAgent);let t=e.join(`
`);window.alert(`======= AdvantageScope Lite =======
Copyright © 2021-2026 Littleton Robotics

`+t)}},...g===h.LiteDS?[]:[{content:`Show Preferences (⇧ ${n} ,)`,callback(){ke()}}],{content:`Show Licenses`,callback(){J(`www/licenses.html`,[50,75],`percent`)}}];break;case 1:let e=x,r=localStorage.getItem(I.PREFS);r!==null&&S(e,JSON.parse(r)),t=[{content:`Open Log (⇧ ${n} O)`,callback(){Ae()}},{content:`Connect Live (${n} K)`,callback(){X(W,`start-live`,g===h.LiteDS?`ds`:`robot`)}},...g===h.LiteDS?[]:[{content:`Set Live Mode`,items:ce.map(t=>({content:(e.liveMode===t?`✔ `:``)+se(t),callback(){e.liveMode=t,localStorage.setItem(I.PREFS,JSON.stringify(e)),X(W,`set-preferences`,e),X(W,`start-live`,`robot`)}}))},{content:`Upload Asset`,callback(){je()}}]];break;case 2:t=[{content:`Zoom to Enabled Range (${n} \\ )`,callback(){X(W,`zoom-enabled`)}},`-`,{content:`Toggle Sidebar (${n} . )`,callback(){X(W,`toggle-sidebar`)}},{content:`Toggle Controls (${n} / )`,callback(){X(W,`toggle-controls`)}}];break;case 3:t=[{content:`New Tab`,items:w().slice(1).filter(e=>T.includes(e)).map(e=>({content:`${ue(e)} ${le(e)} (${E(e).replace(`Alt+`,`⌥ `)})`,callback(){X(W,`new-tab`,e)}}))},...g===h.LiteDS?[{content:`Reset Layout`,callback(){X(W,`restore-state`,Te)}}]:[],`-`,{content:`Previous Tab (${n} ← )`,callback(){X(W,`move-tab`,-1)}},{content:`Next Tab (${n} → )`,callback(){X(W,`move-tab`,1)}},`-`,{content:`Shift Left (${n} [ )`,callback(){X(W,`shift-tab`,-1)}},{content:`Shift Right (${n} ] )`,callback(){X(W,`shift-tab`,1)}},`-`,{content:`Close Tab (${n} E)`,callback(){X(W,`close-tab`,!1)}}];break;case 5:t=[{content:`Report a Problem`,callback(){window.open(`https://github.com/Mechanical-Advantage/AdvantageScope/issues`,`_blank`)}},{content:`Contact Us`,callback(){window.open(`mailto:software@team6328.org`)}},{content:`GitHub Repository`,callback(){window.open(`https://github.com/Mechanical-Advantage/AdvantageScope`,`_blank`)}},...g===h.LiteDS?[`-`,{content:`AdvantageScope Documentation`,callback(){window.open(`https://docs.advantagescope.org`,`_blank`)}},{content:`Driver Station Documentation`,callback(){window.open(`https://github.com/wpilibsuite/FirstDriverStation-Public`,`_blank`)}}]:[],{content:`WPILib Documentation`,callback(){window.open(`https://docs.wpilib.org`,`_blank`)}},...g===h.LiteDS?[`-`]:[],{content:`Littleton Robotics`,callback(){window.open(`https://littletonrobotics.org`,`_blank`)}}];break}let r=e.data.rect;q(r,t)}break;case`close-app-menu`:G.close();break;case`ask-playback-options`:let o=[];[.25,.5,1,1.5,2,4,8].forEach(t=>{o.push({content:(t===e.data.speed?`✔ `:``)+(t*100).toString()+`%`,callback(){X(W,`set-playback-options`,{speed:t,looping:e.data.looping})}})}),o.push(`-`),o.push({content:(e.data.looping?`✔ `:``)+`Loop Visible Range`,callback(){X(W,`set-playback-options`,{speed:e.data.speed,looping:!e.data.looping})}}),q(e.data.rect,o);break;case`ask-new-tab`:q(e.data,w().slice(1).filter(e=>T.includes(e)).map(e=>({content:`${ue(e)} ${le(e)} (${E(e).replace(`Alt+`,`⌥ `)})`,callback(){X(W,`new-tab`,e)}})));break;case`source-list-type-prompt`:{let t=e.data.uuid,n=e.data.config,r=e.data.state,i=e.data.rect,a=[],o=()=>{X(W,`source-list-type-response`,{uuid:t,state:r})},s=e=>{if(e.startsWith(`#`)){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches;return`color: ${ie(e,t)};`}else return``},c=n.types.find(e=>e.key===r.type);if(c.options.length===1){let e=c.options[0];e.values.forEach(t=>{a.push({content:(t.key===r.options[e.key]?`✔ `:``)+t.display,style:s(t.key),callback(){r.options[e.key]=t.key,o()}})})}else c.options.forEach(e=>{a.push({content:e.display,items:e.values.map(t=>({content:(t.key===r.options[e.key]?`✔ `:``)+t.display,style:s(t.key),callback(){r.options[e.key]=t.key,o()}}))})});let l=n.types.filter(e=>e.sourceTypes.includes(r.logType)&&e.childOf===c.childOf);l.length>1&&(a.length>0&&a.push(`-`),l.forEach(e=>{let t=r.type===e.key,n=t?void 0:e.options.find(t=>t.key===e.initialSelectionOption);n===void 0?a.push({content:(t?`✔ `:``)+e.display,callback(){r.type=e.key;let t={};e.options.forEach(e=>{e.key in r.options&&e.values.map(e=>e.key).includes(r.options[e.key])?t[e.key]=r.options[e.key]:t[e.key]=e.values[0].key}),r.options=t,o()}}):a.push({content:(t?`✔ `:``)+e.display,items:n.values.map(t=>({content:t.display,style:s(t.key),callback(){r.type=e.key;let n={};e.options.forEach(e=>{e.key in r.options&&e.values.map(e=>e.key).includes(r.options[e.key])?n[e.key]=r.options[e.key]:n[e.key]=e.values[0].key}),r.options=n,r.options[e.initialSelectionOption]=t.key,o()}}))})})),a.length===0&&a.push({content:`No Options`,className:`disabled`}),a.push(`-`),a.push({content:`Help`,callback(){Z(n)}}),q(i,a)}break;case`source-list-clear-prompt`:q(e.data.rect,[{content:`Clear All`,callback(){X(W,`source-list-clear-response`,{uuid:e.data.uuid})}}]);break;case`source-list-help`:Z(e.data);break;case`ask-edit-axis`:{let t=e.data.legend,n=[];if(t===`discrete`){let t=e.data.showRobotMode;n.push({content:(t?`✔ `:``)+`Show Robot Mode`,callback(){X(W,`set-robot-mode-visible`,{showRobotMode:!t})}})}else{let r=e.data.lockedRange,i=e.data.autoUnitGroup,a=e.data.autoUnitSelected,o=e.data.autoUnitDefault,s=e.data.unitConversion,c=e.data.filter;n.push({content:(r===null?``:`✔ `)+`Lock Axis`,callback(){X(W,`edit-axis`,{legend:t,lockedRange:r===null?[null,null]:null,unitConversion:s,filter:c})}}),n.push({content:`Edit Range`,className:r===null?`disabled`:``,async callback(){(await J(`www/editRange.html`,[300,108],`pixels`,e=>{Y(),X(W,`edit-axis`,{legend:t,lockedRange:e,unitConversion:s,filter:c})})).postMessage(r)}}),n.push(`-`);let l=e=>{let t=JSON.stringify(e);if(t!==JSON.stringify(O.NoopUnitConversion)){let n=localStorage.getItem(I.RECENT_UNITS),r=n===null?[]:JSON.parse(n);for(r=r.filter(e=>JSON.stringify(e)!==t),r.splice(0,0,e);r.length>O.MAX_RECENT_UNITS;)r.pop();localStorage.setItem(I.RECENT_UNITS,JSON.stringify(r))}};switch(i){case`none`:n.push({content:`(No Unit Metadata)`,className:`disabled`});break;case`inconsistent`:n.push({content:`(Inconsistent Units)`,className:`disabled`});break;default:Object.keys(O.UNIT_GROUPS[i]).forEach(e=>{n.push({content:(a===e?`✔ `:``)+e.charAt(0).toUpperCase()+e.slice(1)+(e===o?` [Default]`:``),callback(){s.autoTarget=e,s.preset=null,X(W,`edit-axis`,{legend:t,lockedRange:r,unitConversion:s,filter:c})}})});break}let u=localStorage.getItem(I.RECENT_UNITS),d=u===null?[]:JSON.parse(u);n.push({content:`Manual Units`,items:[{content:`Edit Conversion`,async callback(){(await J(`www/unitConversion.html`,[300,162],`pixels`,e=>{Y(),e!==null&&(s.autoTarget=null,s.preset=e,X(W,`edit-axis`,{legend:t,lockedRange:r,unitConversion:s,filter:c}),l(s.preset))})).postMessage(s.preset??O.NoopUnitConversion)}},{content:(s.preset===null?``:`✔ `)+`Disable Automatic Units`,callback(){s.autoTarget=null,s.preset===null?s.preset=O.NoopUnitConversion:s.preset=null,X(W,`edit-axis`,{legend:t,lockedRange:r,unitConversion:s,filter:c})}},{content:`Reset Units`,className:s.preset!==null&&JSON.stringify(s.preset)!==JSON.stringify(O.NoopUnitConversion)?``:`disabled`,callback(){s.autoTarget=null,s.preset=O.NoopUnitConversion,X(W,`edit-axis`,{legend:t,lockedRange:r,unitConversion:s,filter:c})}},...d.length>0?[{content:`— Recent Presets —`,className:`disabled`}]:[],...d.map(e=>{let n=e.from===void 0||e.to===void 0?``:e.from?.replace(/(^\w|\s\w|\/\w)/g,e=>e.toUpperCase())+` → `+e.to?.replace(/(^\w|\s\w|\/\w)/g,e=>e.toUpperCase()),i=e.factor===1?``:`x`+e.factor.toString();return{content:n+(n.length>0&&i.length>0?`, `:``)+i,callback(){s.autoTarget=null,s.preset=e,X(W,`edit-axis`,{legend:t,lockedRange:r,unitConversion:s,filter:c}),l(e)}}})]}),n.push(`-`),n.push({content:(c===b.Differentiate?`✔ `:``)+`Differentiate`,callback(){X(W,`edit-axis`,{legend:t,lockedRange:r,unitConversion:s,filter:c===b.Differentiate?b.None:b.Differentiate})}}),n.push({content:(c===b.Integrate?`✔ `:``)+`Integrate`,callback(){X(W,`edit-axis`,{legend:t,lockedRange:r,unitConversion:s,filter:c===b.Integrate?b.None:b.Integrate})}}),n.push(`-`)}n.push({content:`Help`,callback(){Z(e.data.config)}}),n.push({content:`Clear All`,callback(){X(W,`clear-axis`,t)}});let r=e.data.rect;q(r,n)}break;case`ask-rename-tab`:{let t=e.data.rect;q(t,[{content:`Rename Tab`,async callback(){(await J(`www/renameTab.html`,[300,81],`pixels`,t=>{Y();let n=t;X(W,`rename-tab`,{index:e.data.index,name:n})})).postMessage(e.data.name)}}])}break;case`ask-3d-camera`:{let t=e.data.position,n=e.data.options,r=e.data.selectedIndex,i=e.data.fov,a=e.data.isFTC,o=[{content:(r===-1?`✔ `:``)+`Orbit Field`,callback(){X(W,`set-3d-camera`,-1)}},{content:(r===-2?`✔ `:``)+`Orbit Robot`,callback(){X(W,`set-3d-camera`,-2)}},{content:a?`Driver View`:`Driver Station`,items:a?[{content:(r===-4?`✔ `:``)+`Blue Left`,callback(){X(W,`set-3d-camera`,-4)}},{content:(r===-5?`✔ `:``)+`Blue Right`,callback(){X(W,`set-3d-camera`,-5)}},{content:(r===-6?`✔ `:``)+`Red Left`,callback(){X(W,`set-3d-camera`,-6)}},{content:(r===-7?`✔ `:``)+`Red Right`,callback(){X(W,`set-3d-camera`,-7)}}]:[{content:(r===-3?`✔ `:``)+`Auto`,callback(){X(W,`set-3d-camera`,-3)}},{content:(r===-4?`✔ `:``)+`Blue 1`,callback(){X(W,`set-3d-camera`,-4)}},{content:(r===-5?`✔ `:``)+`Blue 2`,callback(){X(W,`set-3d-camera`,-5)}},{content:(r===-6?`✔ `:``)+`Blue 3`,callback(){X(W,`set-3d-camera`,-6)}},{content:(r===-7?`✔ `:``)+`Red 1`,callback(){X(W,`set-3d-camera`,-7)}},{content:(r===-8?`✔ `:``)+`Red 2`,callback(){X(W,`set-3d-camera`,-8)}},{content:(r===-9?`✔ `:``)+`Red 3`,callback(){X(W,`set-3d-camera`,-9)}}]},{content:`Set FOV`,async callback(){(await J(`www/editFov.html`,[300,81],`pixels`,e=>{Y(),X(W,`edit-fov`,e)})).postMessage(i)}}];n.length>0&&o.push(`-`),n.forEach((e,t)=>{o.push({content:(t===r?`✔ `:``)+e,callback(){X(W,`set-3d-camera`,t)}})}),q({x:t[0],y:t[1],width:0,height:0},o)}break;default:console.warn(`Unknown message from hub`,e);break}}function $(e){let t=!0,n=e.metaKey||e.ctrlKey,r=e.key.toLowerCase();return e.shiftKey&&n&&r===`o`?Ae():!e.shiftKey&&n&&r===`k`?X(W,`start-live`,!1):!e.shiftKey&&n&&r===`\\`?X(W,`zoom-enabled`):!e.shiftKey&&n&&r===`.`?X(W,`toggle-sidebar`):!e.shiftKey&&n&&r===`/`?X(W,`toggle-controls`):!e.shiftKey&&n&&r===`arrowleft`?X(W,`move-tab`,-1):!e.shiftKey&&n&&r===`arrowright`?X(W,`move-tab`,1):!e.shiftKey&&n&&r===`[`?X(W,`shift-tab`,-1):!e.shiftKey&&n&&r===`]`?X(W,`shift-tab`,1):!e.shiftKey&&n&&r===`e`?X(W,`close-tab`,!1):e.shiftKey&&n&&r===`,`&&g!==h.LiteDS?ke():!e.shiftKey&&!n&&e.altKey&&!e.code.startsWith(`Alt`)?(t=!1,w().filter(e=>T.includes(e)).forEach(n=>{let r=E(n).replace(`Alt+`,``).toLowerCase();r.length>0&&e.code.slice(-1).toLowerCase()===r&&(X(W,`new-tab`,n),t=!0)})):e.code===`Escape`?Y():t=!1,t&&e.preventDefault(),t}window.addEventListener(`load`,()=>{g===h.LiteDS&&(document.title=`AdvantageScope Lite (DS)`),De=P(),z=document.getElementsByClassName(`hub-frame`)[0],B=document.getElementsByClassName(`popup-frame`)[0],V=document.getElementsByClassName(`pointer-block`)[0],H=document.getElementsByClassName(`too-small`)[0],Ee=H.getElementsByClassName(`mobile-warning`)[0],U=document.getElementsByClassName(`menu-anchor`)[0];let e=()=>{H.hidden=window.innerWidth>=800&&window.innerHeight>=400;let e=navigator.userAgent.toLowerCase();Ee.hidden=!e.includes(`iphone`)&&!e.includes(`android`)&&!e.includes(`mobile`)};window.addEventListener(`resize`,()=>e()),e(),V.addEventListener(`click`,()=>{G.close()}),document.addEventListener(`mousedown`,e=>e.preventDefault()),document.addEventListener(`mousemove`,e=>e.preventDefault()),window.addEventListener(`keydown`,e=>{var t;$(e)||(t=z.contentWindow)==null||t.dispatchEvent(new KeyboardEvent(`keydown`,{key:e.key,code:e.code,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey}))},{capture:!0}),window.addEventListener(`keyup`,e=>{var t;(t=z.contentWindow)==null||t.dispatchEvent(new KeyboardEvent(`keyup`,{key:e.key,code:e.code,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey}))},{capture:!0}),z.contentWindow?.document.readyState===`complete`?Q():z.addEventListener(`load`,()=>{Q()}),R()&&(Ce()?g!=h.LiteDS&&confirm(`The AdvantageScope Lite ${xe()?`alpha`:`beta`} is complete. Please follow the instructions in the documentation to update to the latest stable release.`)&&(location.href=`http://`+location.hostname):be()||J(`www/betaWelcome.html`,[450,490],`pixels`,()=>{Y(!0),Se()},!0).then(e=>{e.postMessage(xe())})),window.hubWindow=z.contentWindow});