diff --git a/CHANGELOG.md b/CHANGELOG.md index 50df714d..c94cc576 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -## [2.2.0](https://github.com/NASA-AMMOS/AIT-GUI/compare/2.1.0...2.2.0) +## [2.2.1](https://github.com/NASA-AMMOS/AIT-GUI/compare/2.2.0...2.2.1) + +### Merged + +- Issue #187 - Fix broken Search component [`#188`](https://github.com/NASA-AMMOS/AIT-GUI/pull/188) +- Issue #185 - Fix broken field formatting [`#186`](https://github.com/NASA-AMMOS/AIT-GUI/pull/186) +- Issue #183 - Minor typo fix in static directory warn [`#184`](https://github.com/NASA-AMMOS/AIT-GUI/pull/184) +- Issue #181 - Drop old notification test scripts [`#182`](https://github.com/NASA-AMMOS/AIT-GUI/pull/182) + +## [2.2.0](https://github.com/NASA-AMMOS/AIT-GUI/compare/2.1.0...2.2.0) - 2020-12-16 ### Merged @@ -21,6 +30,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Implement counter method for checking packet delta order on frontend (#105) [`62b97e4`](https://github.com/NASA-AMMOS/AIT-GUI/commit/62b97e41e93a5bba21e68d56c26f5fd1c7002e56) - Remove packet class from frontend (#105) [`11855c9`](https://github.com/NASA-AMMOS/AIT-GUI/commit/11855c9988b909a82c1caf564ca9e2c29cc59962) - Upate GUI static files to latest [`c7bea1d`](https://github.com/NASA-AMMOS/AIT-GUI/commit/c7bea1dbdffc917b52ced227101d66f11b1df407) +- Prep for 2.2.0 release [`a0c8d77`](https://github.com/NASA-AMMOS/AIT-GUI/commit/a0c8d77935c1fbd8ec90034d9c3e447c975934a5) - Issue #105 - Send packet as JSON to frontend [`ebd3d67`](https://github.com/NASA-AMMOS/AIT-GUI/commit/ebd3d67a67c31d071a43370680f783b932f8115d) - Modularize getting packet definition and name (#105) [`7fddbf8`](https://github.com/NASA-AMMOS/AIT-GUI/commit/7fddbf8b6de6df77106f70405a554002ab0e3139) - Request full packet from backend on page refresh [`8841588`](https://github.com/NASA-AMMOS/AIT-GUI/commit/8841588c87bfe9dd07e8f90976c4c624874ad2e6) @@ -34,8 +44,8 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Update backend endpoint for returning latest packet states (#105) [`96d223d`](https://github.com/NASA-AMMOS/AIT-GUI/commit/96d223d487a527f150ee2d1dd75b4f3d853b1ec8) - Add tracking of dntoeu states on frontend (#105) [`2bde078`](https://github.com/NASA-AMMOS/AIT-GUI/commit/2bde0783f3cd6f05bd1bc1675ec0561ce44d5fcb) - Issue #138 - set HTMLRoot.User to Static [`54d8fa9`](https://github.com/NASA-AMMOS/AIT-GUI/commit/54d8fa9a74af41e368f76c495cad606852b6c805) -- Update uttlity method (#105) [`d8c568f`](https://github.com/NASA-AMMOS/AIT-GUI/commit/d8c568f54642f6a9e711ac77808b3bbe60bc7ca6) - Get latest packet state from backend on frontend initialization (#105) [`7740371`](https://github.com/NASA-AMMOS/AIT-GUI/commit/7740371a9bf1d626a3b807d9e3d06d17033b1cfb) +- Update uttlity method (#105) [`d8c568f`](https://github.com/NASA-AMMOS/AIT-GUI/commit/d8c568f54642f6a9e711ac77808b3bbe60bc7ca6) - Store deltas in queue per session (#105) [`9175608`](https://github.com/NASA-AMMOS/AIT-GUI/commit/9175608c1e261197e7902359c34689640bdf0551) - Issue #138 - make AITGUIPlugin to call HTMLRoot [`a949935`](https://github.com/NASA-AMMOS/AIT-GUI/commit/a949935d6bff428d90afc9bb614f0fd2204ca2f3) - Add getPacket utility method [`21c8c91`](https://github.com/NASA-AMMOS/AIT-GUI/commit/21c8c91fab6f0e7165b059bc2a20bd55b91a6658) @@ -45,19 +55,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Issue #105 - Update highcharts plot function for JSON formatted packet [`9f48361`](https://github.com/NASA-AMMOS/AIT-GUI/commit/9f4836191143d145e61f862b0a6c741cc6efa058) - Encode datetimes as ISO formatted strings for sending to frontend (#105) [`ab010e2`](https://github.com/NASA-AMMOS/AIT-GUI/commit/ab010e28949c9b63b6cc5b8376716bfd2c0f7121) - Add max 32 bit int as max packet counter (#105) [`58d6801`](https://github.com/NASA-AMMOS/AIT-GUI/commit/58d6801eaa81537259dedd0f7b8977b1631c0a17) -- Update dict.iteritems to dict.items (#169) [`a437eec`](https://github.com/NASA-AMMOS/AIT-GUI/commit/a437eec55c61ff448a31849751e054a20c59cd40) - Deep copy packet state for inserting into ait.packets so fields update (#105) [`e277c42`](https://github.com/NASA-AMMOS/AIT-GUI/commit/e277c42fdd6939c2bdb6c7ed0c6f453c3bff37d7) -- Remove unecessary changes (debug prints, etc.) (#105) [`1e7be37`](https://github.com/NASA-AMMOS/AIT-GUI/commit/1e7be377e34a80ed6d297aeb7833c6406001d227) +- Update dict.iteritems to dict.items (#169) [`a437eec`](https://github.com/NASA-AMMOS/AIT-GUI/commit/a437eec55c61ff448a31849751e054a20c59cd40) - Issue #138 - pull static file location from config.yaml [`3e63f04`](https://github.com/NASA-AMMOS/AIT-GUI/commit/3e63f04ff43d87c5ddd53c9a184e67ebcfe61486) +- Remove unecessary changes (debug prints, etc.) (#105) [`1e7be37`](https://github.com/NASA-AMMOS/AIT-GUI/commit/1e7be377e34a80ed6d297aeb7833c6406001d227) - Use new function for getting pkt defn in openmct endpoint (#105) [`a074583`](https://github.com/NASA-AMMOS/AIT-GUI/commit/a07458364d5270807667d382f701af6fcdfb7254) - Use getPacket utility method [`610d47a`](https://github.com/NASA-AMMOS/AIT-GUI/commit/610d47ad8e065358bbb737b34dfbcb18aeaf01ac) -- Apply getPacket utility method (#105) [`4a5bf0e`](https://github.com/NASA-AMMOS/AIT-GUI/commit/4a5bf0e2ced13d8231afcd2049af44bc718a0b43) - Check if field exists in dntoeu (#105) [`dd52c2a`](https://github.com/NASA-AMMOS/AIT-GUI/commit/dd52c2adbf04ade3ada58101a7bb818f441e7f65) -- Add digitsAfterDecimal option to legend (#105) [`b89e233`](https://github.com/NASA-AMMOS/AIT-GUI/commit/b89e233c9aade6cbb5ade28ca905fa3df0fc1b50) +- Apply getPacket utility method (#105) [`4a5bf0e`](https://github.com/NASA-AMMOS/AIT-GUI/commit/4a5bf0e2ced13d8231afcd2049af44bc718a0b43) - add log info [`28bc4e6`](https://github.com/NASA-AMMOS/AIT-GUI/commit/28bc4e6662e9adb17e8376cc202881aa62578062) -- Fix bug in adding delta to packet state on frontend (#105) [`3b7ce2d`](https://github.com/NASA-AMMOS/AIT-GUI/commit/3b7ce2dab385904e7afda212b35361281ceb921f) +- Add digitsAfterDecimal option to legend (#105) [`b89e233`](https://github.com/NASA-AMMOS/AIT-GUI/commit/b89e233c9aade6cbb5ade28ca905fa3df0fc1b50) - Remove spaces [`c2007a1`](https://github.com/NASA-AMMOS/AIT-GUI/commit/c2007a1eaa1c39d3e9ecbd1102756c307cd87a19) - Issue #138 - change Static to HTMLRoot.Static [`476c62e`](https://github.com/NASA-AMMOS/AIT-GUI/commit/476c62ed281a5e946f8b0e848de5bbe793bbcc24) +- Fix bug in adding delta to packet state on frontend (#105) [`3b7ce2d`](https://github.com/NASA-AMMOS/AIT-GUI/commit/3b7ce2dab385904e7afda212b35361281ceb921f) - Issue #138 - add static directory config setup example [`66dfe59`](https://github.com/NASA-AMMOS/AIT-GUI/commit/66dfe5953e5bb4b19834bcf6388eae82a81b5cd9) - Issue #138 - remove pass [`a6a5ab0`](https://github.com/NASA-AMMOS/AIT-GUI/commit/a6a5ab03dcf51b7fdf195b874c3506b19b394233) diff --git a/ait/gui/static/build/ait.bundle.js b/ait/gui/static/build/ait.bundle.js index ad0d24a4..0934657f 100644 --- a/ait/gui/static/build/ait.bundle.js +++ b/ait/gui/static/build/ait.bundle.js @@ -1,5 +1,5 @@ !function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t){return t&&t.__esModule?t:{default:t}}var o=n(1),a=r(o),s=n(6),l=i(s),u=n(237);r(u);n(263),window.ait=l,window.m=a.default,l.gui.init()},function(t,e,n){(function(t,e,n){!function(){"use strict";function i(t,e,n,i,r,o){return{tag:t,key:e,attrs:n,children:i,text:r,dom:o,domSize:void 0,state:void 0,_state:void 0,events:void 0,instance:void 0,skip:!1}}function r(t){for(var e in t)if(d.call(t,e))return!1;return!0}function o(t){for(var e,n="div",i=[],r={};e=u.exec(t);){var o=e[1],a=e[2];if(""===o&&""!==a)n=a;else if("#"===o)r.id=a;else if("."===o)i.push(a);else if("["===e[3][0]){var s=e[6];s&&(s=s.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?i.push(s):r[e[4]]=""===s?s:s||!0}}return i.length>0&&(r.className=i.join(" ")),c[t]={tag:n,attrs:r}}function a(t,e,n){var o,a,s=!1,l=e.className||e.class;if(!r(t.attrs)&&!r(e)){var u={};for(var c in e)d.call(e,c)&&(u[c]=e[c]);e=u}for(var c in t.attrs)d.call(t.attrs,c)&&(e[c]=t.attrs[c]);void 0!==l&&(void 0!==e.class&&(e.class=void 0,e.className=l),null!=t.attrs.className&&(e.className=t.attrs.className+" "+l));for(var c in e)if(d.call(e,c)&&"key"!==c){s=!0;break}return Array.isArray(n)&&1===n.length&&null!=n[0]&&"#"===n[0].tag?a=n[0].children:o=n,i(t.tag,e.key,s?e:void 0,o,a)}function s(t){var e,n=arguments[1],r=2;if(null==t||"string"!=typeof t&&"function"!=typeof t&&"function"!=typeof t.view)throw Error("The selector must be either a string or a component.");if("string"==typeof t)var s=c[t]||o(t);if(null==n?n={}:("object"!=typeof n||null!=n.tag||Array.isArray(n))&&(n={},r=1),arguments.length===r+1)e=arguments[r],Array.isArray(e)||(e=[e]);else for(e=[];r=e?(n=o,t()):null===i&&(i=r(function(){i=null,t(),n=Date.now()},e-(o-n)))}}i.normalize=function(t){return Array.isArray(t)?i("[",void 0,void 0,i.normalizeChildren(t),void 0,void 0):null!=t&&"object"!=typeof t?i("#",void 0,void 0,t===!1?"":t,void 0,void 0):t},i.normalizeChildren=function(t){for(var e=0;e0||t(e)}}var n=0,i=e(l);try{t(e(s),i)}catch(t){i(t)}}if(!(this instanceof f))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var r=this,o=[],a=[],s=n(o,!0),l=n(a,!1),u=r._instance={resolvers:o,rejectors:a},c="function"==typeof t?t:setTimeout;i(e)};if(f.prototype.then=function(t,e){function n(t,e,n,o){e.push(function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(t){r&&r(t)}}),"function"==typeof a.retry&&o===a.state&&a.retry()}var i,r,o=this,a=o._instance,s=new f(function(t,e){i=t,r=e});return n(t,a.resolvers,i,!0),n(e,a.rejectors,r,!1),s},f.prototype.catch=function(t){return this.then(null,t)},f.resolve=function(t){return t instanceof f?t:new f(function(e){e(t)})},f.reject=function(t){return new f(function(e,n){n(t)})},f.all=function(t){return new f(function(e,n){var i=t.length,r=0,o=[];if(0===t.length)e([]);else for(var a=0;a=200&&o.status<300||304===o.status||g.test(n.url))e(d(n.type,t));else{var r=new Error(o.responseText);for(var s in t)r[s]=t[s];i(r)}}catch(t){i(t)}},r&&null!=n.data?o.send(n.data):o.send()});return n.background===!0?h:a(h)}function a(n,o){var a=i();n=r(n,o);var u=new e(function(e,i){var r=n.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+f++,o=t.document.createElement("script");t[r]=function(i){o.parentNode.removeChild(o),e(d(n.type,i)),delete t[r]},o.onerror=function(){o.parentNode.removeChild(o),i(new Error("JSONP request failed")),delete t[r]},null==n.data&&(n.data={}),n.url=s(n.url,n.data),n.data[n.callbackKey||"callback"]=r,o.src=l(n.url,n.data),t.document.documentElement.appendChild(o)});return n.background===!0?u:a(u)}function s(t,e){if(null==e)return t;for(var n=t.match(/:[^\/]+/gi)||[],i=0;i=p&&m>=g;){var y=e[p],C=n[g];if(y!==C||i)if(null==y)p++;else if(null==C)g++;else if(y.key===C.key){var k=null!=d&&p>=e.length-d.length||null==d&&i;p++,g++,f(t,y,C,a,w(e,p,s),k,l),i&&y.tag===C.tag&&S(t,x(y),s)}else{var y=e[v];if(y!==C||i)if(null==y)v--;else if(null==C)g++;else{if(y.key!==C.key)break;var k=null!=d&&v>=e.length-d.length||null==d&&i;f(t,y,C,a,w(e,v+1,s),k,l),(i||g=p&&m>=g;){var y=e[v],C=n[m];if(y!==C||i)if(null==y)v--;else if(null==C)m--;else if(y.key===C.key){var k=null!=d&&v>=e.length-d.length||null==d&&i;f(t,y,C,a,w(e,v+1,s),k,l),i&&y.tag===C.tag&&S(t,x(y),s),null!=y.dom&&(s=y.dom),v--,m--}else{if(h||(h=_(e,v)),null!=C){var A=h[C.key];if(null!=A){var D=e[A],k=null!=d&&A>=e.length-d.length||null==d&&i;f(t,D,C,a,w(e,v+1,s),i,l),S(t,x(D),s),e[A].skip=!0,null!=D.dom&&(s=D.dom)}else{var O=o(t,C,a,l,s);s=O}}m--}else v--,m--;if(m0){for(var i=t.dom;--e;)n.appendChild(i.nextSibling);n.insertBefore(i,n.firstChild)}return n}return t.dom}function w(t,e,n){for(;e1)for(var o=t.dom;--n;)A(o.nextSibling);A(t.dom),null==e||null!=t.domSize||R(t.attrs)||"string"!=typeof t.tag||(e.pool?e.pool.push(t):e.pool=[t])}}var i=1,r=0;if(t.attrs&&"function"==typeof t.attrs.onbeforeremove){var o=t.attrs.onbeforeremove.call(t.state,t);null!=o&&"function"==typeof o.then&&(i++,o.then(n,n))}if("string"!=typeof t.tag&&"function"==typeof t._state.onbeforeremove){var o=t._state.onbeforeremove.call(t.state,t);null!=o&&"function"==typeof o.then&&(i++,o.then(n,n))}n()}function A(t){var e=t.parentNode;null!=e&&e.removeChild(t)}function D(t){if(t.attrs&&"function"==typeof t.attrs.onremove&&t.attrs.onremove.call(t.state,t),"string"!=typeof t.tag)"function"==typeof t._state.onremove&&t._state.onremove.call(t.state,t),null!=t.instance&&D(t.instance);else{var e=t.children;if(Array.isArray(e))for(var n=0;n-1&&"xlink"===e.substr(0,a))o.setAttributeNS("http://www.w3.org/1999/xlink",e.slice(a+1),i);else if("o"===e[0]&&"n"===e[1]&&"function"==typeof i)j(t,e,i);else if("style"===e)H(o,n,i);else if(e in o&&!I(e)&&void 0===r&&!F(t)){if("value"===e){var s=""+i;if(("input"===t.tag||"textarea"===t.tag)&&t.dom.value===s&&t.dom===q.activeElement)return;if("select"===t.tag)if(null===i){if(t.dom.selectedIndex===-1&&t.dom===q.activeElement)return}else if(null!==n&&t.dom.value===s&&t.dom===q.activeElement)return;if("option"===t.tag&&null!=n&&t.dom.value===s)return}if("input"===t.tag&&"type"===e)return void o.setAttribute(e,i);o[e]=i}else"boolean"==typeof i?i?o.setAttribute(e,""):o.removeAttribute(e):o.setAttribute("className"===e?"class":e,i)}}function E(t){var e=t.attrs;"select"===t.tag&&null!=e&&("value"in e&&L(t,"value",null,e.value,void 0),"selectedIndex"in e&&L(t,"selectedIndex",null,e.selectedIndex,void 0))}function M(t,e,n,i){if(null!=n)for(var r in n)L(t,r,e&&e[r],n[r],i);if(null!=e)for(var r in e)null!=n&&r in n||("className"===r&&(r="class"),"o"!==r[0]||"n"!==r[1]||P(r)?"key"!==r&&t.dom.removeAttribute(r):j(t,r,void 0))}function N(t,e){return"value"===e||"checked"===e||"selectedIndex"===e||"selected"===e&&t.dom===q.activeElement}function P(t){return"oninit"===t||"oncreate"===t||"onupdate"===t||"onremove"===t||"onbeforeremove"===t||"onbeforeupdate"===t}function I(t){return"href"===t||"list"===t||"form"===t||"width"===t||"height"===t}function F(t){return t.attrs.is||t.tag.indexOf("-")>-1}function R(t){return null!=t&&(t.oncreate||t.onupdate||t.onbeforeremove||t.onremove)}function H(t,e,n){if(e===n&&(t.style.cssText="",e=null),null==n)t.style.cssText="";else if("string"==typeof n)t.style.cssText=n;else{"string"==typeof e&&(t.style.cssText="");for(var i in n)t.style[i]=n[i];if(null!=e&&"string"!=typeof e)for(var i in e)i in n||(t.style[i]="")}}function j(t,e,n){var i=t.dom,r="function"!=typeof Y?n:function(t){var e=n.call(i,t);return Y.call(i,t),e};if(e in i)i[e]="function"==typeof n?r:null;else{var o=e.slice(2);if(void 0===t.events&&(t.events={}),t.events[e]===r)return;null!=t.events[e]&&i.removeEventListener(o,t.events[e],!1),"function"==typeof n&&(t.events[e]=r,i.addEventListener(o,t.events[e],!1))}}function W(t,e,n){"function"==typeof t.oninit&&t.oninit.call(e.state,e),"function"==typeof t.oncreate&&n.push(t.oncreate.bind(e.state,e))}function B(t,e,n){"function"==typeof t.onupdate&&n.push(t.onupdate.bind(e.state,e))}function z(t,e){var n,i;return null!=t.attrs&&"function"==typeof t.attrs.onbeforeupdate&&(n=t.attrs.onbeforeupdate.call(t.state,t,e)),"string"!=typeof t.tag&&"function"==typeof t._state.onbeforeupdate&&(i=t._state.onbeforeupdate.call(t.state,t,e)),!(void 0===n&&void 0===i||n||i)&&(t.dom=e.dom,t.domSize=e.domSize,t.instance=e.instance,!0)}function $(t,e){if(!t)throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var n=[],r=q.activeElement,o=t.namespaceURI;null==t.vnodes&&(t.textContent=""),Array.isArray(e)||(e=[e]),h(t,t.vnodes,i.normalizeChildren(e),!1,n,null,"http://www.w3.org/1999/xhtml"===o?void 0:o),t.vnodes=e,null!=r&&q.activeElement!==r&&r.focus();for(var a=0;a-1&&o.splice(e,2)}function i(){for(var t=1;t-1&&l.pop();for(var c=0;c-1?i:r>-1?r:t.length;if(i>-1){var a=r>-1?r:t.length,s=S(t.slice(i+1,a));for(var l in s)e[l]=s[l]}if(r>-1){var u=S(t.slice(r+1));for(var l in u)n[l]=u[l]}return t.slice(0,o)}var o,a="function"==typeof e.history.pushState,s="function"==typeof t?t:setTimeout,l={prefix:"#!"};return l.getPath=function(){var t=l.prefix.charAt(0);switch(t){case"#":return n("hash").slice(l.prefix.length);case"?":return n("search").slice(l.prefix.length)+n("hash");default:return n("pathname").slice(l.prefix.length)+n("search")+n("hash")}},l.setPath=function(t,n,i){var o={},s={};if(t=r(t,o,s),null!=n){for(var u in n)o[u]=n[u];t=t.replace(/:([^\/]+)/g,function(t,e){return delete o[e],n[e]})}var c=p(o);c&&(t+="?"+c);var d=p(s);if(d&&(t+="#"+d),a){var h=i?i.state:null,f=i?i.title:null;e.onpopstate(),i&&i.replace?e.history.replaceState(h,f,l.prefix+t):e.history.pushState(h,f,l.prefix+t)}else e.location.href=l.prefix+t},l.defineRoutes=function(t,n,o){function s(){var i=l.getPath(),a={},s=r(i,a,a),u=e.history.state;if(null!=u)for(var c in u)a[c]=u[c];for(var d in t){var h=new RegExp("^"+d.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(h.test(s))return void s.replace(h,function(){for(var e=d.match(/:[^\/]+/g)||[],r=[].slice.call(arguments,1,-2),o=0;o=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(3),e.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(e,function(){return this}())},function(t,e,n){(function(t,e){!function(t,n){"use strict";function i(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:600;n(this,t),this._buffer=new Array(e),this.flush()}return i(t,[{key:"_index",value:function(t){return(this._start+this._length+t)%this._buffer.length}},{key:"flush",value:function(){this._length=0,this._start=0,this._buffer.fill(void 0)}},{key:"get",value:function(t){var e=this._start+this._length-1,n=(e-t)%this._buffer.length;return this._buffer[n]}},{key:"insert",value:function(t){this._length+1>this._buffer.length&&this.remove();var e=this._start+this._length,n=e%this._buffer.length;this._buffer[n]=t,this._length+=1}},{key:"remove",value:function(){var t=this._buffer[this._start];return this._start=(this._start+1)%this._buffer.length,this._length-=1,t}},{key:"capacity",get:function(){return this._capacity}},{key:"length",get:function(){return this._length}}]),t}(),o=function(){function t(){n(this,t)}return i(t,[{key:"create",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:600,n=!1;return void 0===this[t]&&(this[t]=new r(e),n=!0),n}},{key:"insert",value:function(t,e){void 0===this[t]&&this.create(t),this[t].insert(e)}}]),t}();e.default=new o},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n1&&(f=h.slice(0,h.length-1));var g=i[f.toLowerCase()],v=void 0,m=u;if("s"!==p){m=u+g;var y=(0,a.sprintf)(r[p.toLowerCase()],8*g);1===g&&y.indexOf("MSB_")!==-1&&(y=y.slice(4,y.length)),v=new l.PrimitiveType(y).decode(n,u)}else m=e.indexOf(0,u),v=t.slice(u,m).map(function(t){return String.fromCharCode(t)}).join("");c.push(v),u=m,"s"===h&&(u+=1),h.length>1&&(d=d.replace("%"+h,"%"+p))}return c.length>0&&(d=(0,a.vsprintf)(d,c)),d}},{key:"desc",get:function(){return this._desc}},{key:"name",get:function(){return this._name}},{key:"code",get:function(){return this._code}},{key:"msg",get:function(){return this._msg}}],[{key:"parse",value:function(e){return"string"==typeof e&&(e=JSON.parse(e)),new t(e)}}]),t}();e.EVRDictionary=u,e.EVRDefinition=c},function(t,e,n){!function(t){function n(){var t=arguments[0],e=n.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=n.parse(t)),n.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function r(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};n.format=function(t,e){var a,s,l,u,c,d,h,f=1,p=t.length,g="",v=[],m=!0,y="";for(s=0;s=0),u[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,u[6]?parseInt(u[6]):0);break;case"e":a=u[7]?a.toExponential(u[7]):a.toExponential();break;case"f":a=u[7]?parseFloat(a).toFixed(u[7]):parseFloat(a);break;case"g":a=u[7]?parseFloat(a).toPrecision(u[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&u[7]?a.substring(0,u[7]):a;break;case"u":a>>>=0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}o.json.test(u[8])?v[v.length]=a:(!o.number.test(u[8])||m&&!u[3]?y="":(y=m?"+":"-",a=a.toString().replace(o.sign,"")),d=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",h=u[6]-(y+a).length,c=u[6]&&h>0?r(d,h):"",v[v.length]=u[5]?y+a+c:"0"===d?y+c+a:c+y+a)}return v.join("")},n.cache={},n.parse=function(t){for(var e=t,n=[],i=[],r=0;e;){if(null!==(n=o.text.exec(e)))i[i.length]=n[0];else if(null!==(n=o.modulo.exec(e)))i[i.length]="%";else{if(null===(n=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){r|=1;var a=[],s=n[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}n[2]=a}else r|=2;if(3===r)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=n}e=e.substring(n[0].length)}return i};var a=function(t,e,i){return i=(e||[]).slice(0),i.splice(0,0,t),n.apply(null,i)};e.sprintf=n,e.vsprintf=a}("undefined"==typeof window?this:window)},function(t,e){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){return n+e<=t.byteLength}function a(t){var e=void 0;return t in y?e=y[t]:t.startsWith("ArrayType")&&(e=new d(t)),e}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,2,e))return null;var n=ait.cmd.dict,i=t.getUint16(e,!1);return n?n.getByOpcode(i):i}},{key:"isTime",get:function(){return!1}}]),t}(),c=function(){function t(e){r(this,t),this._name=e}return s(t,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,2,e))return null;var n=ait.evr.dict,i=t.getUint16(e,!1);return n?n.getByCode(i):i}},{key:"isTime",get:function(){return!1}}]),t}(),d=function(){function t(e){r(this,t),this._elem_type=e.slice(11,e.indexOf("[")),this._prim_type=y[this._elem_type],this._num_elems=parseInt(e.slice(e.indexOf("[")+1,e.indexOf("]"))),this._name=e.slice(11,e.length-2),this._nbytes=this._num_elems*this._prim_type._nbytes}return s(t,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,this._nbytes,e))return null;for(var n=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return this._decode&&o(t,this._nbytes,e)?this._decode(t,e):null}},{key:"isTime",get:function(){return!1}}]),t}(),f=function(){function t(e){r(this,t),this._name=e}return s(t,[{key:"isTime",get:function(){return!0}}]),t}(),p=function(t){function e(){return r(this,e),n(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),s(e,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o(t,1,e)?t.getUint8(e,!1)/256:null}}]),e}(f),g=function(t){function e(){return r(this,e),n(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),s(e,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,4,e))return null;var n=t.getUint32(e,!1);return new Date(l+1e3*n)}}]),e}(f),v=function(t){function e(){return r(this,e),n(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),s(e,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,8,e))return null;var n=t.getUint32(e,!1),i=t.getUint32(e+4,!1);return new Date(l+1e3*n+i/1e6)}}]),e}(f),m={I8:function(t,e){return t.getUint8(e)},U8:function(t,e){return t.getUint8(e)},LSB_I16:function(t,e){return t.getInt16(e,!0)},MSB_I16:function(t,e){return t.getInt16(e,!1)},LSB_U16:function(t,e){return t.getUint16(e,!0)},MSB_U16:function(t,e){return t.getUint16(e,!1)},LSB_I32:function(t,e){return t.getInt32(e,!0)},MSB_I32:function(t,e){return t.getInt32(e,!1)},LSB_U32:function(t,e){return t.getUint32(e,!0)},MSB_U32:function(t,e){return t.getUint32(e,!1)},LSB_F32:function(t,e){return t.getFloat32(e,!0)},MSB_F32:function(t,e){return t.getFloat32(e,!1)},LSB_D64:function(t,e){return t.getFloat64(e,!0)},MSB_D64:function(t,e){return t.getFloat64(e,!1)}},y={};Object.keys(m).map(function(t){y[t]=new h(t)}),y.CMD16=new u("CMD16"),y.EVR16=new c("EVR16"),y.TIME8=new p("TIME8"),y.TIME32=new g("TIME32"),y.TIME64=new v("TIME64"),e.PrimitiveType=h,e.get=a},function(t,e,n){"use strict";function i(t,e){var n=e.gps,i=void 0===n||n,r=(e.utc,e.utc_gps_offset),o=void 0===r?0:r;if(i){var s=a(t);s.setSeconds(s.getSeconds()+o)}}function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.doy,i=void 0!==n&&n,r=e.gps,o=void 0===r||r,u=e.utc,c=void 0!==u&&u,h=void 0,f=void 0,p=void 0,g=void 0,v=a(t);return o||c?(h=v.getUTCFullYear(),f=v.getUTCMonth(),p=v.getUTCDate()):(h=v.getFullYear(),f=v.getMonth(),p=v.getDate()),g=i?h+"-"+l((0,d.DOY)(h,f,p)):h+"-"+s(f+1)+"-"+s(p)}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(t,e)+" "+u(t,e)+" "+c(t,e)}function a(t){var e=t;return"string"==typeof t?e=Date.parse(t):"number"==typeof t&&(e=new Date(t)),e}function s(t){return t<10?"0"+t:t}function l(t){return t<100?"0"+s(t):t}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.h24,i=void 0===n||n,r=e.gps,o=void 0===r||r,l=e.utc,u=void 0!==l&&l,c=void 0,d=void 0,h=void 0,f=void 0,p=" AM",g=a(t);return o||u?(c=g.getUTCHours(),d=g.getUTCMinutes(),h=g.getUTCSeconds()):(c=g.getHours(),d=g.getMinutes(),h=g.getSeconds()),!i&&c>12&&(c-=12,p=" PM"),f=s(c)+":"+s(d)+":"+s(h),i||(f+=p),f}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.utc,i=void 0!==n&&n,r=e.gps,o=void 0===r||r,a=e.local,s=void 0!==a&&a;return o?"GPS":i?"UTC":s?"Local Time":(0,d.timezone)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.adjustUTCtoGPS=e.tz=e.time=e.datetime=e.date=void 0;var d=n(14);e.date=r,e.datetime=o,e.time=u,e.tz=c,e.adjustUTCtoGPS=i},function(t,e){"use strict";function n(t,e,n){var r=[0,31,59,90,120,151,181,212,243,273,304,334],o=r[e]+n;return i(t)&&e>=2&&(o+=1),o}function i(t){return t%4===0&&t%100!==0||t%400===0}function r(t){var e=/\((\w+)\)$/.exec(t.toString());return Array.isArray(e)&&e.length>1?e[1]:""}Object.defineProperty(e,"__esModule",{value:!0}),e.DOY=n,e.isLeap=i,e.timezone=r},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t){for(var e={},n=0;nHistory'}},{name:"cmd-dict",limit:10,source:ait.cmd.typeahead.dict,templates:{header:'

Dictionary

'}}).bind("typeahead:select",function(t,e){n._typeaheadEventHandler(t,e)}).bind("typeahead:autocomplete",function(t,e){n._typeaheadEventHandler(t,e)}).bind("typeahead:close",function(t,e){n._typeaheadEventHandler(t,e)}).bind("typeahead:cursorchange",function(t,e){clearTimeout(n._user_input_timer),n._validating=!1,n._validation_msgs=[],n._cmd_valid=!1})})},view:function(e){var n=this,i="Send",r={class:"btn btn-success",type:"submit"};this._cmding_disabled&&(r.disabled="disabled"),!this._validating&&this._cmd_valid||(r.class="btn btn-danger",r.disabled="disabled",this._validating&&(i=m("span",{class:"glyphicon glyphicon-refresh right-spin"})));var o="";if(0!==this._validation_msgs.length){var a={class:"alert alert-danger alert-dismissible error_display"};o=m("div",a,[m("div",[m("button",{type:"button",class:"close","data-dimiss":"alert",onclick:function(){n._validation_msgs=[]}},m("span","×")),m("span",{class:"glyphicon glyphicon-info-sign"}),m("strong"," Command Validation Errors")]),(0,f.default)(this._validation_msgs,function(t){return m("p",t)})])}return m("ait-commandinput",[m("form",{class:"form-horizontal",role:"form",method:"POST",action:"/cmd",onsubmit:function(e){e.preventDefault();var n=e.currentTarget.getAttribute("action"),i=new FormData;i.append("command",e.currentTarget.elements.command.value),m.request({method:"POST",url:n,data:i}),t(e.currentTarget.elements.command).typeahead("val","").focus()}},[m("label","Send Command:"),m("div",{class:"input-group"},[m("input",{class:"typeahead form-control",type:"text",name:"command",placeholder:"Select Command ...",oninput:function(t){n._cmd_valid=!1,n._validating=!0,n._validation_msgs=[],clearTimeout(n._user_input_timer);var e=t.target.closest("form");""!==e.elements.command.value?n._user_input_timer=setTimeout(function(){n._validateCommand(e)},1e3):n._validating=!1},onkeyup:function(t){17==t.keyCode&&(n._cntrl_toggled=!1)},onkeydown:function(t){return 17==t.keyCode&&(n._cntrl_toggled=!0),!(13==t.keyCode&&!n._cntrl_toggled||13==t.keyCode&&!n._cmd_valid||n.cmding_disabled)||(t.preventDefault(),!1)}}),m("span",{class:"input-group-btn"},m("button",r,i))]),m("span",{class:"help-block"},"Ctrl + Enter to send command")]),o])},_typeaheadEventHandler:function(t,e){var n=this;if(""!==e&&void 0!==e){var i=t.target.closest("form");this._cmd_valid=!1,this._validating=!0,this._validation_msgs=[],clearTimeout(this._user_input_timer),this._user_input_timer=setTimeout(function(){n._validateCommand(i)},1e3),m.redraw()}},_validateCommand:function(t){var e=this,n=t.elements.command.value,i=new FormData;i.append("command",n),m.request({method:"POST",url:"/cmd/validate",data:i}).then(function(){e._cmd_valid=!0,e._validating=!1}).catch(function(t){e._cmd_valid=!1,e._validating=!1,e._validation_msgs=t.msgs})}},b={activeCommand:null},_={groupedCommands:{},commandFilter:"",oninit:function(t){var e=this;ait.cmd.promise.then(function(){e.groupedCommands=ait.cmd.dict.bySubsystem})},oncreate:function(e){t(function(){t('[data-toggle="popover"]').popover()})},view:function(e){var n=this,i="";if(Object.keys(this.groupedCommands).length>0){var r=this.groupedCommands;if(0!==this.commandFilter.length){var a={};(0,o.default)(r,function(t,e){a[e]=(0,s.default)(t,function(t){return t.name.toLowerCase().includes(n.commandFilter.toLowerCase())})}),r=a}var l=Object.keys(r).sort();i=(0,f.default)(l,function(t){var e=r[t];if(0===e.length)return[];e=e.sort(function(t,e){return t.name"))))),m("div",{class:"row"},m("div",{class:"col-lg-10 col-lg-offset-1"},m("div",this.generateCommandArgumentsForm(b.activeCommand))))]):m("div",{class:"row"},m("div",{class:"col-lg-6 col-lg-offset-3 alert alert-info command_selection_help",role:"alert"},[m("span",{class:"glyphicon glyphicon-info-sign"})," Please select a command to configure"])),m("ait-commandconfigure",e)},generateCommandArgumentsForm:function(t){var e=this,n=Object.keys(t.arguments).map(function(e){return t.arguments[e]}).filter(function(t){return t.fixed!==!0});n.sort(function(t,e){var n=void 0,i=null;return n=Array.isArray(t.bytes)?t.bytes[0]:t.bytes,i=Array.isArray(e.bytes)?e.bytes[0]:e.bytes,n1&&(f=h.slice(0,h.length-1));var g=i[f.toLowerCase()],v=void 0,m=u;if("s"!==p){m=u+g;var y=(0,a.sprintf)(r[p.toLowerCase()],8*g);1===g&&y.indexOf("MSB_")!==-1&&(y=y.slice(4,y.length)),v=new l.PrimitiveType(y).decode(n,u)}else m=e.indexOf(0,u),v=t.slice(u,m).map(function(t){return String.fromCharCode(t)}).join("");c.push(v),u=m,"s"===h&&(u+=1),h.length>1&&(d=d.replace("%"+h,"%"+p))}return c.length>0&&(d=(0,a.vsprintf)(d,c)),d}},{key:"desc",get:function(){return this._desc}},{key:"name",get:function(){return this._name}},{key:"code",get:function(){return this._code}},{key:"msg",get:function(){return this._msg}}],[{key:"parse",value:function(e){return"string"==typeof e&&(e=JSON.parse(e)),new t(e)}}]),t}();e.EVRDictionary=u,e.EVRDefinition=c},function(t,e,n){!function(t){function n(){var t=arguments[0],e=n.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=n.parse(t)),n.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function r(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};n.format=function(t,e){var a,s,l,u,c,d,h,f=1,p=t.length,g="",v=[],m=!0,y="";for(s=0;s=0),u[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,u[6]?parseInt(u[6]):0);break;case"e":a=u[7]?a.toExponential(u[7]):a.toExponential();break;case"f":a=u[7]?parseFloat(a).toFixed(u[7]):parseFloat(a);break;case"g":a=u[7]?parseFloat(a).toPrecision(u[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&u[7]?a.substring(0,u[7]):a;break;case"u":a>>>=0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}o.json.test(u[8])?v[v.length]=a:(!o.number.test(u[8])||m&&!u[3]?y="":(y=m?"+":"-",a=a.toString().replace(o.sign,"")),d=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",h=u[6]-(y+a).length,c=u[6]&&h>0?r(d,h):"",v[v.length]=u[5]?y+a+c:"0"===d?y+c+a:c+y+a)}return v.join("")},n.cache={},n.parse=function(t){for(var e=t,n=[],i=[],r=0;e;){if(null!==(n=o.text.exec(e)))i[i.length]=n[0];else if(null!==(n=o.modulo.exec(e)))i[i.length]="%";else{if(null===(n=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){r|=1;var a=[],s=n[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}n[2]=a}else r|=2;if(3===r)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=n}e=e.substring(n[0].length)}return i};var a=function(t,e,i){return i=(e||[]).slice(0),i.splice(0,0,t),n.apply(null,i)};e.sprintf=n,e.vsprintf=a}("undefined"==typeof window?this:window)},function(t,e){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){return n+e<=t.byteLength}function a(t){var e=void 0;return t in y?e=y[t]:t.startsWith("ArrayType")&&(e=new d(t)),e}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,2,e))return null;var n=ait.cmd.dict,i=t.getUint16(e,!1);return n?n.getByOpcode(i):i}},{key:"isTime",get:function(){return!1}}]),t}(),c=function(){function t(e){r(this,t),this._name=e}return s(t,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,2,e))return null;var n=ait.evr.dict,i=t.getUint16(e,!1);return n?n.getByCode(i):i}},{key:"isTime",get:function(){return!1}}]),t}(),d=function(){function t(e){r(this,t),this._elem_type=e.slice(11,e.indexOf("[")),this._prim_type=y[this._elem_type],this._num_elems=parseInt(e.slice(e.indexOf("[")+1,e.indexOf("]"))),this._name=e.slice(11,e.length-2),this._nbytes=this._num_elems*this._prim_type._nbytes}return s(t,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,this._nbytes,e))return null;for(var n=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return this._decode&&o(t,this._nbytes,e)?this._decode(t,e):null}},{key:"isTime",get:function(){return!1}}]),t}(),f=function(){function t(e){r(this,t),this._name=e}return s(t,[{key:"isTime",get:function(){return!0}}]),t}(),p=function(t){function e(){return r(this,e),n(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),s(e,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return o(t,1,e)?t.getUint8(e,!1)/256:null}}]),e}(f),g=function(t){function e(){return r(this,e),n(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),s(e,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,4,e))return null;var n=t.getUint32(e,!1);return new Date(l+1e3*n)}}]),e}(f),v=function(t){function e(){return r(this,e),n(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),s(e,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!o(t,8,e))return null;var n=t.getUint32(e,!1),i=t.getUint32(e+4,!1);return new Date(l+1e3*n+i/1e6)}}]),e}(f),m={I8:function(t,e){return t.getUint8(e)},U8:function(t,e){return t.getUint8(e)},LSB_I16:function(t,e){return t.getInt16(e,!0)},MSB_I16:function(t,e){return t.getInt16(e,!1)},LSB_U16:function(t,e){return t.getUint16(e,!0)},MSB_U16:function(t,e){return t.getUint16(e,!1)},LSB_I32:function(t,e){return t.getInt32(e,!0)},MSB_I32:function(t,e){return t.getInt32(e,!1)},LSB_U32:function(t,e){return t.getUint32(e,!0)},MSB_U32:function(t,e){return t.getUint32(e,!1)},LSB_F32:function(t,e){return t.getFloat32(e,!0)},MSB_F32:function(t,e){return t.getFloat32(e,!1)},LSB_D64:function(t,e){return t.getFloat64(e,!0)},MSB_D64:function(t,e){return t.getFloat64(e,!1)}},y={};Object.keys(m).map(function(t){y[t]=new h(t)}),y.CMD16=new u("CMD16"),y.EVR16=new c("EVR16"),y.TIME8=new p("TIME8"),y.TIME32=new g("TIME32"),y.TIME64=new v("TIME64"),e.PrimitiveType=h,e.get=a},function(t,e,n){"use strict";function i(t,e){var n=e.gps,i=void 0===n||n,r=(e.utc,e.utc_gps_offset),o=void 0===r?0:r;if(i){var s=a(t);s.setSeconds(s.getSeconds()+o)}}function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.doy,i=void 0!==n&&n,r=e.gps,o=void 0===r||r,u=e.utc,c=void 0!==u&&u,h=void 0,f=void 0,p=void 0,g=void 0,v=a(t);return o||c?(h=v.getUTCFullYear(),f=v.getUTCMonth(),p=v.getUTCDate()):(h=v.getFullYear(),f=v.getMonth(),p=v.getDate()),g=i?h+"-"+l((0,d.DOY)(h,f,p)):h+"-"+s(f+1)+"-"+s(p)}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(t,e)+" "+u(t,e)+" "+c(t,e)}function a(t){var e=t;return"string"==typeof t?e=Date.parse(t):"number"==typeof t&&(e=new Date(t)),e}function s(t){return t<10?"0"+t:t}function l(t){return t<100?"0"+s(t):t}function u(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.h24,i=void 0===n||n,r=e.gps,o=void 0===r||r,l=e.utc,u=void 0!==l&&l,c=void 0,d=void 0,h=void 0,f=void 0,p=" AM",g=a(t);return o||u?(c=g.getUTCHours(),d=g.getUTCMinutes(),h=g.getUTCSeconds()):(c=g.getHours(),d=g.getMinutes(),h=g.getSeconds()),!i&&c>12&&(c-=12,p=" PM"),f=s(c)+":"+s(d)+":"+s(h),i||(f+=p),f}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.utc,i=void 0!==n&&n,r=e.gps,o=void 0===r||r,a=e.local,s=void 0!==a&&a;return o?"GPS":i?"UTC":s?"Local Time":(0,d.timezone)(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.adjustUTCtoGPS=e.tz=e.time=e.datetime=e.date=void 0;var d=n(14);e.date=r,e.datetime=o,e.time=u,e.tz=c,e.adjustUTCtoGPS=i},function(t,e){"use strict";function n(t,e,n){var r=[0,31,59,90,120,151,181,212,243,273,304,334],o=r[e]+n;return i(t)&&e>=2&&(o+=1),o}function i(t){return t%4===0&&t%100!==0||t%400===0}function r(t){var e=/\((\w+)\)$/.exec(t.toString());return Array.isArray(e)&&e.length>1?e[1]:""}Object.defineProperty(e,"__esModule",{value:!0}),e.DOY=n,e.isLeap=i,e.timezone=r},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t){for(var e={},n=0;nHistory'}},{name:"cmd-dict",limit:10,source:ait.cmd.typeahead.dict,templates:{header:'

Dictionary

'}}).bind("typeahead:select",function(t,e){n._typeaheadEventHandler(t,e)}).bind("typeahead:autocomplete",function(t,e){n._typeaheadEventHandler(t,e)}).bind("typeahead:close",function(t,e){n._typeaheadEventHandler(t,e)}).bind("typeahead:cursorchange",function(t,e){clearTimeout(n._user_input_timer),n._validating=!1,n._validation_msgs=[],n._cmd_valid=!1})})},view:function(e){var n=this,i="Send",r={class:"btn btn-success",type:"submit"};this._cmding_disabled&&(r.disabled="disabled"),!this._validating&&this._cmd_valid||(r.class="btn btn-danger",r.disabled="disabled",this._validating&&(i=m("span",{class:"glyphicon glyphicon-refresh right-spin"})));var o="";if(0!==this._validation_msgs.length){var a={class:"alert alert-danger alert-dismissible error_display"};o=m("div",a,[m("div",[m("button",{type:"button",class:"close","data-dimiss":"alert",onclick:function(){n._validation_msgs=[]}},m("span","×")),m("span",{class:"glyphicon glyphicon-info-sign"}),m("strong"," Command Validation Errors")]),(0,f.default)(this._validation_msgs,function(t){return m("p",t)})])}return m("ait-commandinput",[m("form",{class:"form-horizontal",role:"form",method:"POST",action:"/cmd",onsubmit:function(e){e.preventDefault();var n=e.currentTarget.getAttribute("action"),i=new FormData;i.append("command",e.currentTarget.elements.command.value),m.request({method:"POST",url:n,data:i}),t(e.currentTarget.elements.command).typeahead("val","").focus()}},[m("label","Send Command:"),m("div",{class:"input-group"},[m("input",{class:"typeahead form-control",type:"text",name:"command",placeholder:"Select Command ...",oninput:function(t){n._cmd_valid=!1,n._validating=!0,n._validation_msgs=[],clearTimeout(n._user_input_timer);var e=t.target.closest("form");""!==e.elements.command.value?n._user_input_timer=setTimeout(function(){n._validateCommand(e)},1e3):n._validating=!1},onkeyup:function(t){17==t.keyCode&&(n._cntrl_toggled=!1)},onkeydown:function(t){return 17==t.keyCode&&(n._cntrl_toggled=!0),!(13==t.keyCode&&!n._cntrl_toggled||13==t.keyCode&&!n._cmd_valid||n.cmding_disabled)||(t.preventDefault(),!1)}}),m("span",{class:"input-group-btn"},m("button",r,i))]),m("span",{class:"help-block"},"Ctrl + Enter to send command")]),o])},_typeaheadEventHandler:function(t,e){var n=this;if(""!==e&&void 0!==e){var i=t.target.closest("form");this._cmd_valid=!1,this._validating=!0,this._validation_msgs=[],clearTimeout(this._user_input_timer),this._user_input_timer=setTimeout(function(){n._validateCommand(i)},1e3),m.redraw()}},_validateCommand:function(t){var e=this,n=t.elements.command.value,i=new FormData;i.append("command",n),m.request({method:"POST",url:"/cmd/validate",data:i}).then(function(){e._cmd_valid=!0,e._validating=!1}).catch(function(t){e._cmd_valid=!1,e._validating=!1,e._validation_msgs=t.msgs})}},b={activeCommand:null},_={groupedCommands:{},commandFilter:"",oninit:function(t){var e=this;ait.cmd.promise.then(function(){e.groupedCommands=ait.cmd.dict.bySubsystem})},oncreate:function(e){t(function(){t('[data-toggle="popover"]').popover()})},view:function(e){var n=this,i="";if(Object.keys(this.groupedCommands).length>0){var r=this.groupedCommands;if(0!==this.commandFilter.length){var a={};(0,o.default)(r,function(t,e){a[e]=(0,s.default)(t,function(t){return t.name.toLowerCase().includes(n.commandFilter.toLowerCase())})}),r=a}var l=Object.keys(r).sort();i=(0,f.default)(l,function(t){var e=r[t];if(0===e.length)return[];e=e.sort(function(t,e){return t.name"))))),m("div",{class:"row"},m("div",{class:"col-lg-10 col-lg-offset-1"},m("div",this.generateCommandArgumentsForm(b.activeCommand))))]):m("div",{class:"row"},m("div",{class:"col-lg-6 col-lg-offset-3 alert alert-info command_selection_help",role:"alert"},[m("span",{class:"glyphicon glyphicon-info-sign"})," Please select a command to configure"])),m("ait-commandconfigure",e)},generateCommandArgumentsForm:function(t){var e=this,n=Object.keys(t.arguments).map(function(e){return t.arguments[e]}).filter(function(t){return t.fixed!==!0});n.sort(function(t,e){var n=void 0,i=null;return n=Array.isArray(t.bytes)?t.bytes[0]:t.bytes,i=Array.isArray(e.bytes)?e.bytes[0]:e.bytes,n=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new r(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new i}}),e.mixin(i.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),n}(),o=function(){"use strict";function n(t,n){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+e.escapeRegExChars(this.prefix)),this.ls=n||s,!this.ls&&this._noop()}function i(){return(new Date).getTime()}function r(t){return JSON.stringify(e.isUndefined(t)?null:t)}function o(e){return t.parseJSON(e)}function a(t){var e,n,i=[],r=s.length;for(e=0;en)}}),n}(),a=function(){"use strict";function n(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=t.cache===!1?new r(0):s}var i=0,o={},a=6,s=new r(10);return n.setMaxPendingRequests=function(t){a=t},n.resetCache=function(){s.reset()},e.mixin(n.prototype,{_fingerprint:function(e){return e=e||{},e.url+e.type+t.param(e.data||{})},_get:function(t,e){function n(t){e(null,t),c._cache.set(l,t)}function r(){e(!0)}function s(){i--,delete o[l],c.onDeckRequestArgs&&(c._get.apply(c,c.onDeckRequestArgs),c.onDeckRequestArgs=null)}var l,u,c=this;l=this._fingerprint(t),this.cancelled||l!==this.lastReq||((u=o[l])?u.done(n).fail(r):ie[i]?i++:(r.push(t[n]),n++,i++);return r}var s="c",l="i";return e.mixin(n.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var n=this;t=e.isArray(t)?t:[t],e.each(t,function(t){var o,a;n.datums[o=n.identify(t)]=t,a=i(n.datumTokenizer(t)),e.each(a,function(t){var e,i,a;for(e=n.trie,i=t.split("");a=i.shift();)e=e[s][a]||(e[s][a]=r()),e[l].push(o)})})},get:function(t){var n=this;return e.map(t,function(t){return n.datums[t]})},search:function(t){var n,r,u=this;return n=i(this.queryTokenizer(t)),e.each(n,function(t){var e,n,i,o;if(r&&0===r.length)return!1;for(e=u.trie,n=t.split("");e&&(i=n.shift());)e=e[s][i];return e&&0===n.length?(o=e[l].slice(0),void(r=r?a(r,o):o)):(r=[],!1)}),r?e.map(o(r),function(t){return u.datums[t]}):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=r()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),l=function(){"use strict";function t(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new o(t.cacheKey)}var n;return n={data:"data",protocol:"protocol",thumbprint:"thumbprint"},e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(n.data,t,this.ttl),this.storage.set(n.protocol,location.protocol,this.ttl),this.storage.set(n.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var t,e={};return this.cache?(e.data=this.storage.get(n.data),e.protocol=this.storage.get(n.protocol),e.thumbprint=this.storage.get(n.thumbprint),t=e.thumbprint!==this.thumbprint||e.protocol!==location.protocol,e.data&&!t?e.data:null):null},fromNetwork:function(t){function e(){t(!0)}function n(e){t(null,r.transform(e))}var i,r=this;t&&(i=this.prepare(this._settings()),this.transport(i).fail(e).done(n))},clear:function(){return this.storage.clear(),this}}),t}(),u=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new a({cache:t.cache,limiter:t.limiter,transport:t.transport})}return e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){function n(t,n){e(t?[]:r.transform(n))}var i,r=this;if(e)return t=t||"",i=this.prepare(t,this._settings()),this.transport.get(i,n)},cancelLastRequest:function(){this.transport.cancel()}}),t}(),c=function(){"use strict";function i(i){var r;return i?(r={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:e.identity,transform:e.identity,transport:null},i=e.isString(i)?{url:i}:i,i=e.mixin(r,i),!i.url&&t.error("prefetch requires url to be set"),i.transform=i.filter||i.transform,i.cacheKey=i.cacheKey||i.url,i.thumbprint=n+i.thumbprint,i.transport=i.transport?s(i.transport):t.ajax,i):null}function r(n){var i;if(n)return i={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:e.identity,transport:null},n=e.isString(n)?{url:n}:n,n=e.mixin(i,n),!n.url&&t.error("remote requires url to be set"),n.transform=n.filter||n.transform,n.prepare=o(n),n.limiter=a(n),n.transport=n.transport?s(n.transport):t.ajax,delete n.replace,delete n.wildcard,delete n.rateLimitBy,delete n.rateLimitWait,n}function o(t){function e(t,e){return e.url=o(e.url,t),e}function n(t,e){return e.url=e.url.replace(a,encodeURIComponent(t)),e}function i(t,e){return e}var r,o,a;return r=t.prepare,o=t.replace,a=t.wildcard,r?r:r=o?e:t.wildcard?n:i}function a(t){function n(t){return function(n){return e.debounce(n,t)}}function i(t){return function(n){return e.throttle(n,t)}}var r,o,a;return r=t.limiter,o=t.rateLimitBy,a=t.rateLimitWait,r||(r=/^throttle$/i.test(o)?i(a):n(a)),r}function s(n){return function(i){function r(t){e.defer(function(){a.resolve(t)})}function o(t){e.defer(function(){a.reject(t)})}var a=t.Deferred();return n(i,r,o),a}}return function(n){var o,a;return o={initialize:!0,identify:e.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},n=e.mixin(o,n||{}),!n.datumTokenizer&&t.error("datumTokenizer is required"),!n.queryTokenizer&&t.error("queryTokenizer is required"),a=n.sorter,n.sorter=a?function(t){return t.sort(a)}:e.identity,n.local=e.isFunction(n.local)?n.local():n.local,n.prefetch=i(n.prefetch),n.remote=r(n.remote),n}}(),d=function(){"use strict";function n(t){t=c(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new u(t.remote):null,this.prefetch=t.prefetch?new l(t.prefetch):null,this.index=new s({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),t.initialize!==!1&&this.initialize()}var r;return r=window&&window.Bloodhound,n.noConflict=function(){return window&&(window.Bloodhound=r),n},n.tokenizers=i,e.mixin(n.prototype,{__ttAdapter:function(){function t(t,e,i){return n.search(t,e,i)}function e(t,e){return n.search(t,e)}var n=this;return this.remote?t:e},_loadPrefetch:function(){function e(t,e){return t?n.reject():(r.add(e),r.prefetch.store(r.index.serialize()),void n.resolve())}var n,i,r=this;return n=t.Deferred(),this.prefetch?(i=this.prefetch.fromCache())?(this.index.bootstrap(i),n.resolve()):this.prefetch.fromNetwork(e):n.resolve(),n.promise()},_initialize:function(){function t(){e.add(e.local)}var e=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(t),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=e.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,n,i){function r(t){var n=[];e.each(t,function(t){!e.some(o,function(e){return a.identify(t)===a.identify(e)})&&n.push(t)}),i&&i(n)}var o,a=this;return o=this.sorter(this.index.search(t)),n(this.remote?o.slice():o),this.remote&&o.length1&&void 0!==arguments[1]&&arguments[1];return!e&&t&&this._fname in t.dntoeu?t&&t.dntoeu[this._fname]:t&&t.raw[this._fname]},hasChanged:function(){var t=this.getPacket();return this._cached.packet!==t&&this._cached.val!==this.getValue(t,this._raw)},hasLimitCheck:function(){if(null===this._limits){if("undefined"==typeof ait.limits)return!1;var t=this._pname+"."+this._fname;t in ait.limits.dict?this._limits=ait.limits.dict[this._pname+"."+this._fname]:this._limits=!1}return this._limits},valueIsInErrorRange:function(t){var e=!1;return"value"in this._limits&&"error"in this._limits.value?e="string"==typeof this._limits.value.error?t===this._limits.value.error:this._limits.value.error.includes(t):("upper"in this._limits&&"error"in this._limits.upper&&(e=t>this._limits.upper.error),"lower"in this._limits&&"error"in this._limits.lower&&(e=tthis._limits.upper.warn),"lower"in this._limits&&"warn"in this._limits.lower&&(e=t×',r=function(){t(e.dom).popover("hide")};!n._fieldDefn||"disable-tlm-popover"in e.attrs||t(e.dom).popover({content:function(){return n.createPopoverContent()},title:i,html:!0,placement:"auto right",container:"body"}).on("shown.bs.popover",function(n){var i=n.currentTarget.attributes["aria-describedby"].value,o=document.getElementById(i).getElementsByClassName("popover-title")[0],a=o.getElementsByTagName("span")[0];a.addEventListener("click",function(){t(e.dom).popover("hide")}),document.body.addEventListener("click",r),document.getElementById(i).addEventListener("click",function(t){t.stopPropagation()})}).on("hide.bs.popover",function(t){document.body.removeEventListener("click",r)}).on("hidden.bs.popover",function(e){t(e.target).data("bs.popover").inState.click=!1})})},createPopoverContent:function(){var t=this._fieldDefn.desc?this._fieldDefn.desc:"None",e=this._fieldDefn.type?this._fieldDefn.type._name:"Unknown",n="object"===o(this._fieldDefn.bytes)?this._fieldDefn.bytes[0]+" - "+this._fieldDefn.bytes[1]:this._fieldDefn.bytes,i=2;"object"===o(this._fieldDefn.bytes)&&(i=2*(this._fieldDefn.bytes[1]-this._fieldDefn.bytes[0]+1));var r=this._fieldDefn.mask?"0x"+(0,l.sprintf)("%0"+i+"X",this._fieldDefn.mask):"None",a="\n

Description: "+t+"

\n

Data Type: "+e+"

\n

Byte(s) in Packet: "+n+"

\n

Bit Mask: "+r+"

\n ";if(this._fieldDefn.enum){var s="",u=this._fieldDefn.enum;for(var c in u)s+="
"+c+"
"+u[c];a+="Enumerated Values:
"+s+"
"}if(this._fieldDefn.dntoeu){var d="",h=this._fieldDefn.dntoeu;for(var f in h)d+="
"+f+"
"+h[f];a+="DN-to-EU:
"+d+"
"}if(this._fieldDefn.aliases){var p="",g=this._fieldDefn.aliases;for(var v in g)p+="
"+v+"
"+g[v];a+="Aliases:
"+p+"
"}return""+a+""},onbeforeupdate:function(t,e){return this.hasChanged()},view:function(t){var e=this.getPacket(),n=this.getValue(e,this._raw);if(this.cache(e),void 0===n||null===n)n="N/A";else if(n instanceof d.CommandDefinition)n=n.name?n.name:n.opcode?n.opcode:"Unidentified Cmd";else if(n instanceof h.EVRDefinition)n=n.name?n.name:n.code?n.code:"Unidentified EVR";else if(Array.isArray(n)){var i=2*this._fieldDefn.type._nbytes/this._fieldDefn.type._num_elems,r="",o="0x%0"+i+"X ",a=!0,u=!1,f=void 0;try{for(var p,g=n[Symbol.iterator]();!(a=(p=g.next()).done);a=!0){var v=p.value;r+=(0,l.sprintf)(o,v)}}catch(t){u=!0,f=t}finally{try{!a&&g.return&&g.return()}finally{if(u)throw f}}n=r}else if(t.attrs.format){var m=e._defn.fields[this._fname],y=m&&m.type;n=y&&y.isTime?c.utc()(t.attrs.format,n):(0,l.sprintf)(t.attrs.format,n)}else isNaN(n)||Number.isInteger(n)||(n=Number(n).toFixed(5));if(this.hasLimitCheck()){var b=this._raw?this.getValue(e,!1):n;"class"in t.attrs||(t.attrs.class=""),this.valueIsInErrorRange(b)?(this._limitOut=!0,t.attrs.class+="alert-danger",ait.events.emit("field:limitOut",{field:this._pname+"_"+this._fname,type:"error"})):this.valueIsInWarnRange(b)?(this._limitOut=!0,t.attrs.class+="alert-warning",ait.events.emit("field:limitOut",{field:this._pname+"_"+this._fname,type:"warning"})):this._limitOut&&(this._limitOut=!1,ait.events.emit("field:limitIn",this._pname+"_"+this._fname))}var _="";return t.attrs.display_name&&(_=t.attrs.display_name+": "),(0,s.default)("ait-field",t.attrs,[(0,s.default)("name",_),(0,s.default)("value",n)])}},p=Object.assign(Object.create(f),{oninit:function(t){var e=this;this._fname=t.attrs.name,this._pname=t.attrs.packet,this._raw=t.attrs.raw===!0,this._cached={packet:null,val:null},this._data_fields=[],t.children.forEach(function(t){"ait-evrdata"===t.tag&&e._data_fields.push(t.attrs.name)})},createPopoverContent:function(){var t=this._fieldDefn.desc?this._fieldDefn.desc:"None",e=this._fieldDefn.type?this._fieldDefn.type._name:"Unknown",n="object"===o(this._fieldDefn.bytes)?this._fieldDefn.bytes[0]+" - "+this._fieldDefn.bytes[1]:this._fieldDefn.bytes,i=2;"object"===o(this._fieldDefn.bytes)&&(i=2*(this._fieldDefn.bytes[1]-this._fieldDefn.bytes[0]+1));var r=this._fieldDefn.mask?"0x"+(0,l.sprintf)("%0"+i+"X",this._fieldDefn.mask):"None",a="\n

Description: "+t+"

\n

Data Type: "+e+"

\n

Byte(s) in Packet: "+n+"

\n

Bit Mask: "+r+"

\n ";if(this._cached.val&&this._cached.val.msg){var s=[];if(this._cached.packet){var u=!0,c=!1,d=void 0;try{for(var h,f=this._data_fields[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var p=h.value;s.push(this._cached.packet.__get__(p,!0))}}catch(t){c=!0,d=t}finally{try{!u&&f.return&&f.return()}finally{if(c)throw d}}}var g=this._cached.val?this._cached.val.formatMessage(s):"";a+="

EVR Message: "+g+"

"}return""+a+""},view:function(t){var e=this.getPacket(),n=this.getValue(e,this._raw);return this.cache(e),n=void 0===n||null===n?"N/A":n.name?n.name:n.code?n.code:"Unidentified EVR",(0,s.default)("ait-field",t.attrs,n)}});e.default={Field:f,EVRField:p},e.Field=f,e.EVRField=p}).call(e,n(18))},function(t,e){!function(){function e(t,u,h){function f(t,e){var n;if(e){if(n=e.getTime(),y){var i=s(e);if(e=new Date(n+i+m),s(e)!==i){var r=s(e);e=new Date(n+r+m)}}}else{var o=Date.now();o>b?(b=o,g=new Date(b),n=b,y&&(g=new Date(b+s(g)+m))):n=b,e=g}return p(t,e,v,n)}function p(t,e,s,u){for(var c="",d=null,h=!1,f=t.length,g=!1,v=0;v9?t:(null==e&&(e="0"),e+t)}function i(t){return t>99?t:t>9?"0"+t:"00"+t}function r(t){return 0===t?12:t>12?t-12:t}function o(t,e){e=e||"sunday";var n=t.getDay();"monday"===e&&(0===n?n=6:n--);var i=Date.UTC(t.getFullYear(),0,1),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),o=Math.floor((r-i)/864e5),a=(o+7-n)/7;return Math.floor(a)}function a(t){var e=t%10,n=t%100;if(n>=11&&n<=13||0===e||e>=4)return"th";switch(e){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function s(t){return 6e4*(t.getTimezoneOffset()||0)}function l(t){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t)}var u,c={de_DE:{days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre"," diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{days:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],shortDays:["dom","lun","mar","mer","gio","ven","sab"],months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortMonths:["pr","mag","giu","lug","ago","set","ott","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{days:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],shortDays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shortDays:["Paz","Pzt","Sal","Çrş","Prş","Cum","Cts"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],shortMonths:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["日","一","二","三","四","五","六"],months:["一月份","二月份","三月份","四月份","五月份","六月份","七月份","八月份","九月份","十月份","十一月份","十二月份"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],AM:"上午",PM:"下午",am:"上午",pm:"下午",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},d=c.en_US,h=new e(d,0,!1),f="undefined"!=typeof t;f?u=t.exports=h:(u=function(){return this||(0,eval)("this")}(),u.strftime=h),"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},function(t,e,n){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Messages=void 0;var o=n(1),a=r(o),s=n(13),l=i(s),u={_messages:[],_source:null,_scrollTop:0,_updateScroll:!0,add:function(t){this._messages.push(this.normalizeMessage(t)),a.default.redraw()},normalizeMessage:function(t){return{timestamp:Date.parse(t.timestamp),severity:t.msgid,message:t.msg}},oninit:function(t){var e=this;this._source=new EventSource("/messages"),this._source.onmessage=function(t){e.add(JSON.parse(t.data))}},onupdate:function(t){var e=t.dom.getElementsByClassName("entry_container")[0];this._updateScroll&&(this._scrollTop=e.scrollHeight),e.scrollTop=this._scrollTop},view:function(t){var e=this,n=this._messages.map(function(t){return(0,a.default)("div",{class:"entry entry--"+t.severity.toLowerCase()},[(0,a.default)("div",{class:"timestamp"},l.datetime(t.timestamp,{utc:!0,gps:!1})),(0,a.default)("div",{class:"severity"},t.severity),(0,a.default)("div",{class:"message"},t.message)])}),i=[(0,a.default)("div",{class:"timestamp"},"Timestamp"),(0,a.default)("div",{class:"severity"},"Severity"),(0,a.default)("div",{class:"message"},"Message")];this._updateScroll||i.push((0,a.default)("div",{class:"scroll-reset",onclick:function(t){e._updateScroll=!0}},(0,a.default)("span",{class:"glyphicon glyphicon-chevron-down"})));var r=(0,a.default)("div",{class:"entry entry--header"},i);return(0,a.default)("ait-messages",[r,(0,a.default)("div",{class:"entry_container",onscroll:function(n){var i=t.dom.getElementsByClassName("entry_container")[0];i.scrollTop==i.scrollHeight-i.clientHeight?e._updateScroll=!0:(e._updateScroll=!1,e._scrollTop=i.scrollTop)}},n)])}};e.default=u,e.Messages=u},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{ -default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Playback=void 0;var r=n(1),o=i(r),a=n(148),s=i(a),l=(n(164),{_range:[],_packet:null,_start_time:null,_end_time:null,_validation_errors:{},_slider:null,_current_time:null,_timer:null,_first_click:!0,oninit:function(t){var e=this;o.default.request({method:"GET",url:"/playback/range"}).then(function(t){e._range=t}),this._minute=this.getCurrentMinute(),this._slider=(0,o.default)("input",{class:"slider",type:"range",min:"0",max:"1",value:"0",oninput:function(n){var i=t.dom.getElementsByClassName("slider")[0].value,r=new Date(100*i).toISOString().substring(0,21)+"Z";e._current_time=(0,o.default)("div",{class:"timeline-current"},"Current time: "+r)}})},getCurrentMinute:function(){var t=new Date;return t.getMinutes()},onupdate:function(t){var e=this;this.getCurrentMinute()!=this._minute&&(this._minute=this.getCurrentMinute(),o.default.request({method:"GET",url:"/playback/range"}).then(function(t){e._range=t}))},view:function(t){var e=this,n=(0,o.default)("div",{class:"form-group"},[(0,o.default)("label","Time ranges available"),(0,o.default)("div",{class:"alert alert-warning"},"No time ranges found. Is your database connection configured?")]);this._range.length>0&&(n=(0,o.default)("div",{class:"form-group"},[(0,o.default)("label","Time ranges available"),this._range.map(function(t){return(0,o.default)("div",t[0]+": "+t[1]+" to "+t[2])})]));var i=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("label","Telemetry packet:"),(0,o.default)("select",{class:"form-control",name:"packet"},[(0,o.default)("option",{disabled:"disabled",selected:"selected"},"Select an option")].concat((0,s.default)(this._range,function(t){return(0,o.default)("option",{value:t[0]},t[0])})))]);this._validation_errors.packet&&(i.attrs.className+=" has-error");var r=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("label","Start time:"),(0,o.default)("input",{class:"form-control",placeholder:"YYYY-MM-DDTHH:MM:SSZ",name:"startTime"})]);this._validation_errors.startTime&&(r.attrs.className+=" has-error");var a=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("label","End time:"),(0,o.default)("input",{class:"form-control",placeholder:"YYYY-MM-DDTHH:MM:SSZ",name:"endTime"})]);this._validation_errors.endTime&&(a.attrs.className+=" has-error");var l=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("div",{style:"height: 25px"}),(0,o.default)("button",{class:"btn btn-success query",type:"submit"},"Query")]),u=(0,o.default)("form",{class:"form-row",onsubmit:function(n){n.preventDefault();var i=n.currentTarget,r=new FormData;return!!e._validate_form(i)&&(e._packet=i.elements.packet.value,e._start_time=i.elements.startTime.value.substr(0,19)+".0Z",e._end_time=i.elements.endTime.value.substr(0,19)+".0Z",r.append("packet",e._packet),r.append("startTime",e._start_time),r.append("endTime",e._end_time),o.default.request({url:"/playback/query",method:"POST",data:r}),t.dom.getElementsByClassName("slider")[0].min=Date.parse(e._start_time)/100,t.dom.getElementsByClassName("slider")[0].max=Date.parse(e._end_time)/100,t.dom.getElementsByClassName("slider")[0].value=0,e._current_time=(0,o.default)("div",{class:"timeline-current"},"Current time: "+e._start_time),t.dom.getElementsByClassName("timeline")[0].style.display="block",t.dom.getElementsByClassName("controls")[0].style.display="block",t.dom.getElementsByClassName("play")[0].style.display="inline-block",t.dom.getElementsByClassName("pause")[0].style.display="none",t.dom.getElementsByClassName("query")[0].style.display="none",void(e._first_click=!0))}},[i,r,a,l]),c=(0,o.default)("div",{class:"timeline",style:"display:none"},[this._slider,(0,o.default)("div",{class:"timeline-start"},this._start_time),(0,o.default)("div",{class:"timeline-end"},this._end_time),this._current_time]),d=(0,o.default)("button",{class:"btn btn-success play",style:"display: none",onclick:function(n){e._first_click&&(ait.events.emit("ait:playback:on"),o.default.request({url:"/playback/on",method:"PUT"}),e._first_click=!1),e.start_slider(t,e._end_time),t.dom.getElementsByClassName("play")[0].style.display="none",t.dom.getElementsByClassName("pause")[0].style.display="inline-block"}},"Play"),h=(0,o.default)("button",{class:"btn btn-success pause",style:"display: none",onclick:function(n){e.stop_slider(),t.dom.getElementsByClassName("pause")[0].style.display="none",t.dom.getElementsByClassName("play")[0].style.display="inline-block"}},"Pause"),f=(0,o.default)("button",{class:"btn btn-danger",style:"display: inline-block",onclick:function(n){t.dom.getElementsByClassName("timeline")[0].style.display="none",t.dom.getElementsByClassName("controls")[0].style.display="none",t.dom.getElementsByClassName("query")[0].style.display="inline-block",0==e._first_click&&(ait.events.emit("ait:playback:off"),e.stop_slider(),o.default.request({url:"/playback/abort",method:"PUT"}))}},"Abort"),p=(0,o.default)("div",{class:"controls",style:"display: none"},[d,h,f]);return(0,o.default)("ait-playback",t.attrs,[n,u,c,p])},start_slider:function(t,e){if(!this._timer){var n=Date.now(),i=0;this._timer=setInterval(function(){var r=Math.floor((Date.now()-n)/100);if(r>i){i=r;var a=++t.dom.getElementsByClassName("slider")[0].value,s=new Date(100*a).toISOString().substring(0,21)+"Z";if(s<=e){t.dom.getElementsByClassName("timeline-current")[0].innerHTML="Current time: "+s;var l=new FormData;l.append("timestamp",s),o.default.request({url:"/playback/send",method:"POST",data:l})}}},10)}},stop_slider:function(){clearInterval(this._timer),this._timer=null},_validate_form:function(t){this._validation_errors={},0===t.elements.packet.selectedIndex&&(this._validation_errors.packet=!0);var e=/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):[0-5]\d:[0-5]\dZ$/;return e.test(t.elements.startTime.value)||(this._validation_errors.startTime=!0),e.test(t.elements.endTime.value)||(this._validation_errors.endTime=!0),0===Object.keys(this._validation_errors).length}});e.default=l,e.Playback=l},function(t,e,n){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryStream=e.TelemetryDictionary=e.PacketScope=e.PacketDefinition=e.FieldDefinition=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n>=1}return a(t,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.type&&(n=this.type.decode(t,this.offset),void 0!==this.mask&&null!==this.mask&&(n&=this.mask),this.shift>0&&(n>>=this.shift),e||void 0===this.enum||(n=this.enum[n])),n}}]),t}(),c=function(){function t(e){r(this,t),this._constants=e.constants,this._desc=e.desc,this._fields={},this._functions=e.functions,this._history=e.history,this._name=e.name,this._scope=new d(this),this._uid=e.uid;for(var n in e.fields)this._fields[n]=new u(e.fields[n])}return a(t,[{key:"constants",get:function(){return this._constants}},{key:"fields",get:function(){return this._fields}},{key:"functions",get:function(){return this._functions}},{key:"name",get:function(){return this._name}},{key:"scope",get:function(){return this._scope}},{key:"uid",get:function(){return this._uid}}],[{key:"parse",value:function(e){return"string"==typeof e&&(e=JSON.parse(e)),new t(e)}}]),t}(),d=function(){function t(e){r(this,t),this._defn=e,this._scope=new Function("\n eval('"+this.toCode()+"')\n return {\n 'eval': function(packet, expr) {\n var raw = packet.__clone__(packet._data, true)\n try {\n return eval(expr)\n } catch (e) {\n return null\n }\n }\n }\n ").call()}return a(t,[{key:"_sanitize",value:function(t){return t.replace("≤","<=").replace("≥",">=")}},{key:"_toBinaryCond",value:function(t){var e=/==|!=|<=|>=|<|>/g,n=t.match(e),i=t.split(e);return 2===n.length&&3===i.length?"("+i[0]+" "+n[0]+" "+i[1]+") && ("+i[1]+" "+n[1]+" "+i[2]+")":t}},{key:"eval",value:function(t,e){return this._scope.eval(t,e)}},{key:"toCode",value:function(){var t="";for(var e in this._defn.constants)t+="var "+e+" = "+this._defn.constants[e]+"; ";for(var n in this._defn.functions){var i=this._defn.functions[n];if(t+="function "+n+" { ","string"==typeof i)t+="return ("+i+") ";else if("object"===("undefined"==typeof i?"undefined":o(i)))for(var r in i){var a=this._toBinaryCond(this._sanitize(r));t+="if ("+a+") { return ("+i[r]+") } "}t+="};"}return t}}]),t}(),h=function(){function t(){r(this,t)}return a(t,[{key:"add",value:function(t){t instanceof c&&(this[t.name]=t)}}],[{key:"parse",value:function(e){var n=new t;"string"==typeof e&&(e=JSON.parse(e));for(var i in e)n.add(new c(e[i]));return n}}]),t}(),f=function(){function t(e,n){var i=this;r(this,t),this._dict={},this._interval=0,this._socket=new WebSocket(e),this._stale=0,this._url=e,this.getFullPacketStates(),console.log(this._pkt_states),console.log(this._counters);for(var o in n){var a=n[o];this._dict[a.uid]=a}this._socket.binaryType="arraybuffer",this._socket.onclose=function(t){return i.onClose(t)},this._socket.onmessage=function(t){return i.onMessage(t)},this._socket.onopen=function(t){return i.onOpen(t)}}return a(t,[{key:"_emit",value:function(t,e){ait.events.emit("ait:tlm:"+t,e)}},{key:"onClose",value:function(t){clearInterval(this._interval),this._emit("close",this)}},{key:"getFullPacketStates",value:function(){var t=this;m.request({url:"/tlm/latest"}).then(function(e){console.log("requesting latest tlm"),console.log(e),t._pkt_states=e.states,t._counters=e.counters})}},{key:"checkCounter",value:function(t,e){var n=this._counters[t];return e==n+1||(n==Math.pow(2,31)-1&&0==e||(console.log("counter mismatch: had "+n+" , got "+e),!1))}},{key:"onMessage",value:function(t){if("string"==typeof t.data){var e=(Date.now(),JSON.parse(t.data)),n=e.packet,i=e.data,r=e.dntoeus,o=e.counter;if(n in this._pkt_states){var a=this.checkCounter(n,o);if(a){if(0!==Object.keys(i).length){console.log("adding delta to pkt state");for(var s in i)this._pkt_states[n].raw[s]=i[s];for(var s in r)this._pkt_states[n].dntoeu[s]=r[s]}this._counters[n]=o}else this.getFullPacketStates()}else console.log("new packet type"),0==Object.keys(i).length?this.getFullPacketStates():(this._pkt_states[n]={},this._pkt_states[n].raw=i,this._pkt_states[n].dntoeu=r,this._counters[n]=o);console.log("counter: ",this._counters[n]),clearInterval(this._interval),this._stale=0,this._interval=setInterval(this.onStale.bind(this),5e3);var l=JSON.parse(JSON.stringify(this._pkt_states[n]));ait.packets.insert(n,l),this._emit("packet",{packet:n,data:this._pkt_states[n]})}}},{key:"onOpen",value:function(t){this._interval=setInterval(this.onStale.bind(this),5e3),this._stale=0,this._emit("open",this)}},{key:"onStale",value:function(){this._stale++,this._emit("stale",this)}}]),t}();e.FieldDefinition=u,e.PacketDefinition=c,e.PacketScope=d,e.TelemetryDictionary=h,e.TelemetryStream=f},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Plot=void 0;var o=function(){function t(t,e){for(var n=0;nthis._plotrange&&this._plot._data.shift(),this._plot.shouldRedraw()&&this.redraw()}}},{key:"redraw",value:function(){this._plot._chart.updateOptions({file:this._plot._data})}}]),t}(),h=function(){function t(e){r(this,t),this._plot=e}return o(t,[{key:"addSeries",value:function(t,e){this._plot._options.series.push({id:t,name:e.caption||t,color:e.color,data:[],tooltip:{valueDecimals:2},type:e.type,showInNavigator:!0,boostThreshold:1,cropThreshold:1,turboThreshold:1})}},{key:"createChart",value:function(t,e){return new Highcharts.StockChart(t.dom,e)}},{key:"createOptions",value:function(t){return{credits:{enabled:!1},legend:{enabled:!0},boost:{seriesThreshold:1},rangeSelector:{buttons:[{count:1,text:"1m",type:"minute"},{count:10,text:"10m",type:"minute"},{count:30,text:"30m",type:"minute"},{count:1,text:"1h",type:"hour"},{count:6,text:"6h",type:"hour"},{count:12,text:"12h",type:"hour"},{count:1,text:"1d",type:"day"}],inputEnabled:!1},series:[],title:{text:t.title},xAxis:{title:{text:"Time (UTC)"}},yAxis:{title:{text:t["y-title"]}}}}},{key:"handleOptionsOverride",value:function(t,e){Object.assign(t,e)}},{key:"plot",value:function(t,e){var n=this,i=t.packet,r=(0,c.getFieldType)(t.data,e),o=this._plot._packets[i];o&&(o.forEach(function(t){var e=n._plot._chart.get(i+"."+t);if(e){var o=n._plot._time.get(r).getTime(),a=r[t];if(e.addPoint([o,a],!1),n._plot._initZoom===!1){var s=n._plot._chart.axes[0].getExtremes(),l=(s.max-s.min)/1e3;l>=60&&(n._plot._chart.rangeSelector.clickButton(0,!0),n._plot._initZoom=!0)}}}),this._plot.shouldRedraw()&&this.redraw())}},{key:"redraw",value:function(){this._plot._chart.redraw()}}]),t}(),f={plot:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._backend.plot(t,e)},processTag:function(t){if("ait-plotconfig"===t.tag)try{this._backend.handleOptionsOverride(this._options,JSON.parse(t.text))}catch(t){t instanceof SyntaxError&&console.error("Error parsing plot config. Printing trace back and reverting to default options."),console.error(t)}else"ait-plotseries"===t.tag?this.processTagSeries(t):"ait-plottime"===t.tag&&this.processTagTime(t)},processTagSeries:function(t){var e=t.attrs.name,n=t.attrs.packet,i=(t.attrs.type,n+"."+e);this._backend.addSeries(i,t.attrs),this._packets[n]=this._packets[n]||[],this._packets[n].push(e),this._raw=t.attrs.raw},processTagTime:function(t){this._time=new p(t.attrs.packet,t.attrs.name)},shouldRedraw:function(){var t=Date.now(),e=(t-this._lastRedrawTime)/1e3;return e>this._redrawDelta&&(this._lastRedrawTime=t,!0)},oninit:function(t){var e=this;this._backend=window.Highcharts?new h(this):new d(this),this._data=[],this._options=this._backend.createOptions(t.attrs),this._packets={},this._time=null,this._initZoom=!1,this._redrawFrequency=parseInt(t.attrs["redraw-frequency"])||10;var n=parseInt(t.attrs["redraw-frequency-variation-min"])||-2,i=parseInt(t.attrs["redraw-frequency-variation-max"])||2,r="redraw-frequency-variation"in t.attrs&&t.attrs["redraw-frequency-variation"]===!0;this._redrawDelta=this._redrawFrequency+(r?Math.random()*(i-n)+n:0),this._lastRedrawTime=Date.now(),t.children.forEach(function(t){return e.processTag(t)}),null===this._time&&(this._time=new p),ait.events.on("ait:tlm:packet",function(t){return e.plot(t,e._raw)}),ait.events.on("ait:playback:on",function(){return e.redraw()}),ait.events.on("ait:playback:off",function(){return e.redraw()})},oncreate:function(t){this._chart=this._backend.createChart(t,this._options)},view:function(t){if(window.Highcharts)return(0,s.default)("ait-plot",t.attrs);var e=[(0,s.default)("div")];return this._backend._user_specified_label||e.push((0,s.default)("div",{id:this._backend._plot_id,class:"dygraph-legend",style:"width: "+this._options.width+"px;"})),(0,s.default)("ait-plot",t.attrs,e)},redraw:function(){this._data=[],this._backend.redraw()}},p=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,t),this._pname=e,this._fname=n}return o(t,[{key:"get",value:function(t){var e=this.hasTime(t)?t.__get__(this._fname):null;return e instanceof Date||(e="number"!=typeof e?new Date:new Date(e)),e}},{key:"hasTime",value:function(t){var e=t&&t._defn;return e&&this._pname===e.name&&this._fname in e.fields}}]),t}();e.default=f,e.Plot=f},function(t,e,n){t.exports=n(167)},function(t,e,n){(function(i){/** +!function(o,a){i=[n(18)],r=function(t){return o.Bloodhound=a(t)}.apply(e,i),!(void 0!==r&&(t.exports=r))}(this,function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return"undefined"==typeof t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,n){function i(t,e){return n(e,t)}t.each(e,i)},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,function(t,r){if(!(i=n.call(null,r,t,e)))return!1}),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,function(t,r){if(i=n.call(null,r,t,e))return!1}),!!i):i},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){function n(){return String(e)}return t.isFunction(e)?e:n},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,r;return function(){var o,a,s=this,l=arguments;return o=function(){i=null,n||(r=t.apply(s,l))},a=n&&!i,clearTimeout(i),i=setTimeout(o,e),a&&(r=t.apply(s,l)),r}},throttle:function(t,e){var n,i,r,o,a,s;return a=0,s=function(){a=new Date,r=null,o=t.apply(n,i)},function(){var l=new Date,u=e-(l-a);return n=this,i=arguments,u<=0?(clearTimeout(r),r=null,a=l,o=t.apply(n,i)):r||(r=setTimeout(s,u)),o}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n="0.11.1",i=function(){"use strict";function t(t){return t=e.toStr(t),t?t.split(/\s+/):[]}function n(t){return t=e.toStr(t),t?t.split(/\W+/):[]}function i(t){return function(n){return n=e.isArray(n)?n:[].slice.call(arguments,0),function(i){var r=[];return e.each(n,function(n){r=r.concat(t(e.toStr(i[n])))}),r}}}return{nonword:n,whitespace:t,obj:{nonword:i(n),whitespace:i(t)}}}(),r=function(){"use strict";function n(n){this.maxSize=e.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=t.noop)}function i(){this.head=this.tail=null}function r(t,e){this.key=t,this.val=e,this.prev=this.next=null}return e.mixin(n.prototype,{set:function(t,e){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new r(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new i}}),e.mixin(i.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),n}(),o=function(){"use strict";function n(t,n){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+e.escapeRegExChars(this.prefix)),this.ls=n||s,!this.ls&&this._noop()}function i(){return(new Date).getTime()}function r(t){return JSON.stringify(e.isUndefined(t)?null:t)}function o(e){return t.parseJSON(e)}function a(t){var e,n,i=[],r=s.length;for(e=0;en)}}),n}(),a=function(){"use strict";function n(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=t.cache===!1?new r(0):s}var i=0,o={},a=6,s=new r(10);return n.setMaxPendingRequests=function(t){a=t},n.resetCache=function(){s.reset()},e.mixin(n.prototype,{_fingerprint:function(e){return e=e||{},e.url+e.type+t.param(e.data||{})},_get:function(t,e){function n(t){e(null,t),c._cache.set(l,t)}function r(){e(!0)}function s(){i--,delete o[l],c.onDeckRequestArgs&&(c._get.apply(c,c.onDeckRequestArgs),c.onDeckRequestArgs=null)}var l,u,c=this;l=this._fingerprint(t),this.cancelled||l!==this.lastReq||((u=o[l])?u.done(n).fail(r):ie[i]?i++:(r.push(t[n]),n++,i++);return r}var s="c",l="i";return e.mixin(n.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var n=this;t=e.isArray(t)?t:[t],e.each(t,function(t){var o,a;n.datums[o=n.identify(t)]=t,a=i(n.datumTokenizer(t)),e.each(a,function(t){var e,i,a;for(e=n.trie,i=t.split("");a=i.shift();)e=e[s][a]||(e[s][a]=r()),e[l].push(o)})})},get:function(t){var n=this;return e.map(t,function(t){return n.datums[t]})},search:function(t){var n,r,u=this;return n=i(this.queryTokenizer(t)),e.each(n,function(t){var e,n,i,o;if(r&&0===r.length)return!1;for(e=u.trie,n=t.split("");e&&(i=n.shift());)e=e[s][i];return e&&0===n.length?(o=e[l].slice(0),void(r=r?a(r,o):o)):(r=[],!1)}),r?e.map(o(r),function(t){return u.datums[t]}):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=r()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),l=function(){"use strict";function t(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new o(t.cacheKey)}var n;return n={data:"data",protocol:"protocol",thumbprint:"thumbprint"},e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(t){this.cache&&(this.storage.set(n.data,t,this.ttl),this.storage.set(n.protocol,location.protocol,this.ttl),this.storage.set(n.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var t,e={};return this.cache?(e.data=this.storage.get(n.data),e.protocol=this.storage.get(n.protocol),e.thumbprint=this.storage.get(n.thumbprint),t=e.thumbprint!==this.thumbprint||e.protocol!==location.protocol,e.data&&!t?e.data:null):null},fromNetwork:function(t){function e(){t(!0)}function n(e){t(null,r.transform(e))}var i,r=this;t&&(i=this.prepare(this._settings()),this.transport(i).fail(e).done(n))},clear:function(){return this.storage.clear(),this}}),t}(),u=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new a({cache:t.cache,limiter:t.limiter,transport:t.transport})}return e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){function n(t,n){e(t?[]:r.transform(n))}var i,r=this;if(e)return t=t||"",i=this.prepare(t,this._settings()),this.transport.get(i,n)},cancelLastRequest:function(){this.transport.cancel()}}),t}(),c=function(){"use strict";function i(i){var r;return i?(r={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:e.identity,transform:e.identity,transport:null},i=e.isString(i)?{url:i}:i,i=e.mixin(r,i),!i.url&&t.error("prefetch requires url to be set"),i.transform=i.filter||i.transform,i.cacheKey=i.cacheKey||i.url,i.thumbprint=n+i.thumbprint,i.transport=i.transport?s(i.transport):t.ajax,i):null}function r(n){var i;if(n)return i={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:e.identity,transport:null},n=e.isString(n)?{url:n}:n,n=e.mixin(i,n),!n.url&&t.error("remote requires url to be set"),n.transform=n.filter||n.transform,n.prepare=o(n),n.limiter=a(n),n.transport=n.transport?s(n.transport):t.ajax,delete n.replace,delete n.wildcard,delete n.rateLimitBy,delete n.rateLimitWait,n}function o(t){function e(t,e){return e.url=o(e.url,t),e}function n(t,e){return e.url=e.url.replace(a,encodeURIComponent(t)),e}function i(t,e){return e}var r,o,a;return r=t.prepare,o=t.replace,a=t.wildcard,r?r:r=o?e:t.wildcard?n:i}function a(t){function n(t){return function(n){return e.debounce(n,t)}}function i(t){return function(n){return e.throttle(n,t)}}var r,o,a;return r=t.limiter,o=t.rateLimitBy,a=t.rateLimitWait,r||(r=/^throttle$/i.test(o)?i(a):n(a)),r}function s(n){return function(i){function r(t){e.defer(function(){a.resolve(t)})}function o(t){e.defer(function(){a.reject(t)})}var a=t.Deferred();return n(i,r,o),a}}return function(n){var o,a;return o={initialize:!0,identify:e.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},n=e.mixin(o,n||{}),!n.datumTokenizer&&t.error("datumTokenizer is required"),!n.queryTokenizer&&t.error("queryTokenizer is required"),a=n.sorter,n.sorter=a?function(t){return t.sort(a)}:e.identity,n.local=e.isFunction(n.local)?n.local():n.local,n.prefetch=i(n.prefetch),n.remote=r(n.remote),n}}(),d=function(){"use strict";function n(t){t=c(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new u(t.remote):null,this.prefetch=t.prefetch?new l(t.prefetch):null,this.index=new s({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),t.initialize!==!1&&this.initialize()}var r;return r=window&&window.Bloodhound,n.noConflict=function(){return window&&(window.Bloodhound=r),n},n.tokenizers=i,e.mixin(n.prototype,{__ttAdapter:function(){function t(t,e,i){return n.search(t,e,i)}function e(t,e){return n.search(t,e)}var n=this;return this.remote?t:e},_loadPrefetch:function(){function e(t,e){return t?n.reject():(r.add(e),r.prefetch.store(r.index.serialize()),void n.resolve())}var n,i,r=this;return n=t.Deferred(),this.prefetch?(i=this.prefetch.fromCache())?(this.index.bootstrap(i),n.resolve()):this.prefetch.fromNetwork(e):n.resolve(),n.promise()},_initialize:function(){function t(){e.add(e.local)}var e=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(t),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=e.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,n,i){function r(t){var n=[];e.each(t,function(t){!e.some(o,function(e){return a.identify(t)===a.identify(e)})&&n.push(t)}),i&&i(n)}var o,a=this;return o=this.sorter(this.index.search(t)),n(this.remote?o.slice():o),this.remote&&o.length1&&void 0!==arguments[1]&&arguments[1];return!e&&t&&this._fname in t.dntoeu?t&&t.dntoeu[this._fname]:t&&t.raw[this._fname]},hasChanged:function(){var t=this.getPacket();return this._cached.packet!==t&&this._cached.val!==this.getValue(t,this._raw)},hasLimitCheck:function(){if(null===this._limits){if("undefined"==typeof ait.limits)return!1;var t=this._pname+"."+this._fname;t in ait.limits.dict?this._limits=ait.limits.dict[this._pname+"."+this._fname]:this._limits=!1}return this._limits},valueIsInErrorRange:function(t){var e=!1;return"value"in this._limits&&"error"in this._limits.value?e="string"==typeof this._limits.value.error?t===this._limits.value.error:this._limits.value.error.includes(t):("upper"in this._limits&&"error"in this._limits.upper&&(e=t>this._limits.upper.error),"lower"in this._limits&&"error"in this._limits.lower&&(e=tthis._limits.upper.warn),"lower"in this._limits&&"warn"in this._limits.lower&&(e=t×',r=function(){t(e.dom).popover("hide")};!n._fieldDefn||"disable-tlm-popover"in e.attrs||t(e.dom).popover({content:function(){return n.createPopoverContent()},title:i,html:!0,placement:"auto right",container:"body"}).on("shown.bs.popover",function(n){var i=n.currentTarget.attributes["aria-describedby"].value,o=document.getElementById(i).getElementsByClassName("popover-title")[0],a=o.getElementsByTagName("span")[0];a.addEventListener("click",function(){t(e.dom).popover("hide")}),document.body.addEventListener("click",r),document.getElementById(i).addEventListener("click",function(t){t.stopPropagation()})}).on("hide.bs.popover",function(t){document.body.removeEventListener("click",r)}).on("hidden.bs.popover",function(e){t(e.target).data("bs.popover").inState.click=!1})})},createPopoverContent:function(){var t=this._fieldDefn.desc?this._fieldDefn.desc:"None",e=this._fieldDefn.type?this._fieldDefn.type._name:"Unknown",n="object"===o(this._fieldDefn.bytes)?this._fieldDefn.bytes[0]+" - "+this._fieldDefn.bytes[1]:this._fieldDefn.bytes,i=2;"object"===o(this._fieldDefn.bytes)&&(i=2*(this._fieldDefn.bytes[1]-this._fieldDefn.bytes[0]+1));var r=this._fieldDefn.mask?"0x"+(0,l.sprintf)("%0"+i+"X",this._fieldDefn.mask):"None",a="\n

Description: "+t+"

\n

Data Type: "+e+"

\n

Byte(s) in Packet: "+n+"

\n

Bit Mask: "+r+"

\n ";if(this._fieldDefn.enum){var s="",u=this._fieldDefn.enum;for(var c in u)s+="
"+c+"
"+u[c];a+="Enumerated Values:
"+s+"
"}if(this._fieldDefn.dntoeu){var d="",h=this._fieldDefn.dntoeu;for(var f in h)d+="
"+f+"
"+h[f];a+="DN-to-EU:
"+d+"
"}if(this._fieldDefn.aliases){var p="",g=this._fieldDefn.aliases;for(var v in g)p+="
"+v+"
"+g[v];a+="Aliases:
"+p+"
"}return""+a+""},onbeforeupdate:function(t,e){return this.hasChanged()},view:function(t){var e=this.getPacket(),n=this.getValue(e,this._raw);if(this.cache(e),void 0===n||null===n)n="N/A";else if(n instanceof d.CommandDefinition)n=n.name?n.name:n.opcode?n.opcode:"Unidentified Cmd";else if(n instanceof h.EVRDefinition)n=n.name?n.name:n.code?n.code:"Unidentified EVR";else if(Array.isArray(n)){var i=2*this._fieldDefn.type._nbytes/this._fieldDefn.type._num_elems,r="",o="0x%0"+i+"X ",a=!0,u=!1,f=void 0;try{for(var p,g=n[Symbol.iterator]();!(a=(p=g.next()).done);a=!0){var v=p.value;r+=(0,l.sprintf)(o,v)}}catch(t){u=!0,f=t}finally{try{!a&&g.return&&g.return()}finally{if(u)throw f}}n=r}else if(t.attrs.format){var m=ait.tlm.dict[this._pname]._fields[this._fname],y=m&&m.type;n=y&&y.isTime?c.utc()(t.attrs.format,n):(0,l.sprintf)(t.attrs.format,n)}else isNaN(n)||Number.isInteger(n)||(n=Number(n).toFixed(5));if(this.hasLimitCheck()){var b=this._raw?this.getValue(e,!1):n;"class"in t.attrs||(t.attrs.class=""),this.valueIsInErrorRange(b)?(this._limitOut=!0,t.attrs.class+="alert-danger",ait.events.emit("field:limitOut",{field:this._pname+"_"+this._fname,type:"error"})):this.valueIsInWarnRange(b)?(this._limitOut=!0,t.attrs.class+="alert-warning",ait.events.emit("field:limitOut",{field:this._pname+"_"+this._fname,type:"warning"})):this._limitOut&&(this._limitOut=!1,ait.events.emit("field:limitIn",this._pname+"_"+this._fname))}var _="";return t.attrs.display_name&&(_=t.attrs.display_name+": "),(0,s.default)("ait-field",t.attrs,[(0,s.default)("name",_),(0,s.default)("value",n)])}},p=Object.assign(Object.create(f),{oninit:function(t){var e=this;this._fname=t.attrs.name,this._pname=t.attrs.packet,this._raw=t.attrs.raw===!0,this._cached={packet:null,val:null},this._data_fields=[],t.children.forEach(function(t){"ait-evrdata"===t.tag&&e._data_fields.push(t.attrs.name)})},createPopoverContent:function(){var t=this._fieldDefn.desc?this._fieldDefn.desc:"None",e=this._fieldDefn.type?this._fieldDefn.type._name:"Unknown",n="object"===o(this._fieldDefn.bytes)?this._fieldDefn.bytes[0]+" - "+this._fieldDefn.bytes[1]:this._fieldDefn.bytes,i=2;"object"===o(this._fieldDefn.bytes)&&(i=2*(this._fieldDefn.bytes[1]-this._fieldDefn.bytes[0]+1));var r=this._fieldDefn.mask?"0x"+(0,l.sprintf)("%0"+i+"X",this._fieldDefn.mask):"None",a="\n

Description: "+t+"

\n

Data Type: "+e+"

\n

Byte(s) in Packet: "+n+"

\n

Bit Mask: "+r+"

\n ";if(this._cached.val&&this._cached.val.msg){var s=[];if(this._cached.packet){var u=!0,c=!1,d=void 0;try{for(var h,f=this._data_fields[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var p=h.value;s.push(this._cached.packet.__get__(p,!0))}}catch(t){c=!0,d=t}finally{try{!u&&f.return&&f.return()}finally{if(c)throw d}}}var g=this._cached.val?this._cached.val.formatMessage(s):"";a+="

EVR Message: "+g+"

"}return""+a+""},view:function(t){var e=this.getPacket(),n=this.getValue(e,this._raw);return this.cache(e),n=void 0===n||null===n?"N/A":n.name?n.name:n.code?n.code:"Unidentified EVR",(0,s.default)("ait-field",t.attrs,n)}});e.default={Field:f,EVRField:p},e.Field=f,e.EVRField=p}).call(e,n(18))},function(t,e){!function(){function e(t,u,h){function f(t,e){var n;if(e){if(n=e.getTime(),y){var i=s(e);if(e=new Date(n+i+m),s(e)!==i){var r=s(e);e=new Date(n+r+m)}}}else{var o=Date.now();o>b?(b=o,g=new Date(b),n=b,y&&(g=new Date(b+s(g)+m))):n=b,e=g}return p(t,e,v,n)}function p(t,e,s,u){for(var c="",d=null,h=!1,f=t.length,g=!1,v=0;v9?t:(null==e&&(e="0"),e+t)}function i(t){return t>99?t:t>9?"0"+t:"00"+t}function r(t){return 0===t?12:t>12?t-12:t}function o(t,e){e=e||"sunday";var n=t.getDay();"monday"===e&&(0===n?n=6:n--);var i=Date.UTC(t.getFullYear(),0,1),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),o=Math.floor((r-i)/864e5),a=(o+7-n)/7;return Math.floor(a)}function a(t){var e=t%10,n=t%100;if(n>=11&&n<=13||0===e||e>=4)return"th";switch(e){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function s(t){return 6e4*(t.getTimezoneOffset()||0)}function l(t){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t)}var u,c={de_DE:{days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],shortDays:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],shortMonths:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d.%m.%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},en_CA:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},en_US:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ordinalSuffixes:["st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%m/%d/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}},es_MX:{days:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],shortDays:["dom","lun","mar","mié","jue","vie","sáb"],months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre"," diciembre"],shortMonths:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},fr_FR:{days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],shortDays:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortMonths:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.","déc."],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},it_IT:{days:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],shortDays:["dom","lun","mar","mer","gio","ven","sab"],months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortMonths:["pr","mag","giu","lug","ago","set","ott","nov","dic"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},nl_NL:{days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],shortDays:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortMonths:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},pt_BR:{days:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],shortDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],months:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},ru_RU:{days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],shortDays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],shortMonths:["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек"],AM:"AM",PM:"PM",am:"am",pm:"pm",formats:{c:"%a %d %b %Y %X",D:"%d.%m.%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},tr_TR:{days:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],shortDays:["Paz","Pzt","Sal","Çrş","Prş","Cum","Cts"],months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],shortMonths:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],AM:"ÖÖ",PM:"ÖS",am:"ÖÖ",pm:"ÖS",formats:{c:"%a %d %b %Y %X %Z",D:"%d-%m-%Y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%T",x:"%D"}},zh_CN:{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],shortDays:["日","一","二","三","四","五","六"],months:["一月份","二月份","三月份","四月份","五月份","六月份","七月份","八月份","九月份","十月份","十一月份","十二月份"],shortMonths:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],AM:"上午",PM:"下午",am:"上午",pm:"下午",formats:{c:"%a %d %b %Y %X %Z",D:"%d/%m/%y",F:"%Y-%m-%d",R:"%H:%M",r:"%I:%M:%S %p",T:"%H:%M:%S",v:"%e-%b-%Y",X:"%r",x:"%D"}}},d=c.en_US,h=new e(d,0,!1),f="undefined"!=typeof t;f?u=t.exports=h:(u=function(){return this||(0,eval)("this")}(),u.strftime=h),"function"!=typeof Date.now&&(Date.now=function(){return+new Date})}()},function(t,e,n){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Messages=void 0;var o=n(1),a=r(o),s=n(13),l=i(s),u={_messages:[],_source:null,_scrollTop:0,_updateScroll:!0,add:function(t){this._messages.push(this.normalizeMessage(t)),a.default.redraw()},normalizeMessage:function(t){return{timestamp:Date.parse(t.timestamp),severity:t.msgid,message:t.msg}},oninit:function(t){var e=this;this._source=new EventSource("/messages"),this._source.onmessage=function(t){e.add(JSON.parse(t.data))}},onupdate:function(t){var e=t.dom.getElementsByClassName("entry_container")[0];this._updateScroll&&(this._scrollTop=e.scrollHeight),e.scrollTop=this._scrollTop},view:function(t){var e=this,n=this._messages.map(function(t){return(0,a.default)("div",{class:"entry entry--"+t.severity.toLowerCase()},[(0,a.default)("div",{class:"timestamp"},l.datetime(t.timestamp,{utc:!0,gps:!1})),(0,a.default)("div",{class:"severity"},t.severity),(0,a.default)("div",{class:"message"},t.message)])}),i=[(0,a.default)("div",{class:"timestamp"},"Timestamp"),(0,a.default)("div",{class:"severity"},"Severity"),(0,a.default)("div",{class:"message"},"Message")];this._updateScroll||i.push((0,a.default)("div",{class:"scroll-reset",onclick:function(t){e._updateScroll=!0}},(0,a.default)("span",{class:"glyphicon glyphicon-chevron-down"})));var r=(0,a.default)("div",{class:"entry entry--header"},i);return(0,a.default)("ait-messages",[r,(0,a.default)("div",{class:"entry_container",onscroll:function(n){var i=t.dom.getElementsByClassName("entry_container")[0];i.scrollTop==i.scrollHeight-i.clientHeight?e._updateScroll=!0:(e._updateScroll=!1,e._scrollTop=i.scrollTop)}},n)])}};e.default=u,e.Messages=u},function(t,e,n){"use strict"; +function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Playback=void 0;var r=n(1),o=i(r),a=n(148),s=i(a),l=(n(164),{_range:[],_packet:null,_start_time:null,_end_time:null,_validation_errors:{},_slider:null,_current_time:null,_timer:null,_first_click:!0,oninit:function(t){var e=this;o.default.request({method:"GET",url:"/playback/range"}).then(function(t){e._range=t}),this._minute=this.getCurrentMinute(),this._slider=(0,o.default)("input",{class:"slider",type:"range",min:"0",max:"1",value:"0",oninput:function(n){var i=t.dom.getElementsByClassName("slider")[0].value,r=new Date(100*i).toISOString().substring(0,21)+"Z";e._current_time=(0,o.default)("div",{class:"timeline-current"},"Current time: "+r)}})},getCurrentMinute:function(){var t=new Date;return t.getMinutes()},onupdate:function(t){var e=this;this.getCurrentMinute()!=this._minute&&(this._minute=this.getCurrentMinute(),o.default.request({method:"GET",url:"/playback/range"}).then(function(t){e._range=t}))},view:function(t){var e=this,n=(0,o.default)("div",{class:"form-group"},[(0,o.default)("label","Time ranges available"),(0,o.default)("div",{class:"alert alert-warning"},"No time ranges found. Is your database connection configured?")]);this._range.length>0&&(n=(0,o.default)("div",{class:"form-group"},[(0,o.default)("label","Time ranges available"),this._range.map(function(t){return(0,o.default)("div",t[0]+": "+t[1]+" to "+t[2])})]));var i=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("label","Telemetry packet:"),(0,o.default)("select",{class:"form-control",name:"packet"},[(0,o.default)("option",{disabled:"disabled",selected:"selected"},"Select an option")].concat((0,s.default)(this._range,function(t){return(0,o.default)("option",{value:t[0]},t[0])})))]);this._validation_errors.packet&&(i.attrs.className+=" has-error");var r=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("label","Start time:"),(0,o.default)("input",{class:"form-control",placeholder:"YYYY-MM-DDTHH:MM:SSZ",name:"startTime"})]);this._validation_errors.startTime&&(r.attrs.className+=" has-error");var a=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("label","End time:"),(0,o.default)("input",{class:"form-control",placeholder:"YYYY-MM-DDTHH:MM:SSZ",name:"endTime"})]);this._validation_errors.endTime&&(a.attrs.className+=" has-error");var l=(0,o.default)("div",{class:"form-group col-xs-3"},[(0,o.default)("div",{style:"height: 25px"}),(0,o.default)("button",{class:"btn btn-success query",type:"submit"},"Query")]),u=(0,o.default)("form",{class:"form-row",onsubmit:function(n){n.preventDefault();var i=n.currentTarget,r=new FormData;return!!e._validate_form(i)&&(e._packet=i.elements.packet.value,e._start_time=i.elements.startTime.value.substr(0,19)+".0Z",e._end_time=i.elements.endTime.value.substr(0,19)+".0Z",r.append("packet",e._packet),r.append("startTime",e._start_time),r.append("endTime",e._end_time),o.default.request({url:"/playback/query",method:"POST",data:r}),t.dom.getElementsByClassName("slider")[0].min=Date.parse(e._start_time)/100,t.dom.getElementsByClassName("slider")[0].max=Date.parse(e._end_time)/100,t.dom.getElementsByClassName("slider")[0].value=0,e._current_time=(0,o.default)("div",{class:"timeline-current"},"Current time: "+e._start_time),t.dom.getElementsByClassName("timeline")[0].style.display="block",t.dom.getElementsByClassName("controls")[0].style.display="block",t.dom.getElementsByClassName("play")[0].style.display="inline-block",t.dom.getElementsByClassName("pause")[0].style.display="none",t.dom.getElementsByClassName("query")[0].style.display="none",void(e._first_click=!0))}},[i,r,a,l]),c=(0,o.default)("div",{class:"timeline",style:"display:none"},[this._slider,(0,o.default)("div",{class:"timeline-start"},this._start_time),(0,o.default)("div",{class:"timeline-end"},this._end_time),this._current_time]),d=(0,o.default)("button",{class:"btn btn-success play",style:"display: none",onclick:function(n){e._first_click&&(ait.events.emit("ait:playback:on"),o.default.request({url:"/playback/on",method:"PUT"}),e._first_click=!1),e.start_slider(t,e._end_time),t.dom.getElementsByClassName("play")[0].style.display="none",t.dom.getElementsByClassName("pause")[0].style.display="inline-block"}},"Play"),h=(0,o.default)("button",{class:"btn btn-success pause",style:"display: none",onclick:function(n){e.stop_slider(),t.dom.getElementsByClassName("pause")[0].style.display="none",t.dom.getElementsByClassName("play")[0].style.display="inline-block"}},"Pause"),f=(0,o.default)("button",{class:"btn btn-danger",style:"display: inline-block",onclick:function(n){t.dom.getElementsByClassName("timeline")[0].style.display="none",t.dom.getElementsByClassName("controls")[0].style.display="none",t.dom.getElementsByClassName("query")[0].style.display="inline-block",0==e._first_click&&(ait.events.emit("ait:playback:off"),e.stop_slider(),o.default.request({url:"/playback/abort",method:"PUT"}))}},"Abort"),p=(0,o.default)("div",{class:"controls",style:"display: none"},[d,h,f]);return(0,o.default)("ait-playback",t.attrs,[n,u,c,p])},start_slider:function(t,e){if(!this._timer){var n=Date.now(),i=0;this._timer=setInterval(function(){var r=Math.floor((Date.now()-n)/100);if(r>i){i=r;var a=++t.dom.getElementsByClassName("slider")[0].value,s=new Date(100*a).toISOString().substring(0,21)+"Z";if(s<=e){t.dom.getElementsByClassName("timeline-current")[0].innerHTML="Current time: "+s;var l=new FormData;l.append("timestamp",s),o.default.request({url:"/playback/send",method:"POST",data:l})}}},10)}},stop_slider:function(){clearInterval(this._timer),this._timer=null},_validate_form:function(t){this._validation_errors={},0===t.elements.packet.selectedIndex&&(this._validation_errors.packet=!0);var e=/^\d{4}-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):[0-5]\d:[0-5]\dZ$/;return e.test(t.elements.startTime.value)||(this._validation_errors.startTime=!0),e.test(t.elements.endTime.value)||(this._validation_errors.endTime=!0),0===Object.keys(this._validation_errors).length}});e.default=l,e.Playback=l},function(t,e,n){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryStream=e.TelemetryDictionary=e.PacketScope=e.PacketDefinition=e.FieldDefinition=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n>=1}return a(t,[{key:"decode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.type&&(n=this.type.decode(t,this.offset),void 0!==this.mask&&null!==this.mask&&(n&=this.mask),this.shift>0&&(n>>=this.shift),e||void 0===this.enum||(n=this.enum[n])),n}}]),t}(),c=function(){function t(e){r(this,t),this._constants=e.constants,this._desc=e.desc,this._fields={},this._functions=e.functions,this._history=e.history,this._name=e.name,this._scope=new d(this),this._uid=e.uid;for(var n in e.fields)this._fields[n]=new u(e.fields[n])}return a(t,[{key:"constants",get:function(){return this._constants}},{key:"fields",get:function(){return this._fields}},{key:"functions",get:function(){return this._functions}},{key:"name",get:function(){return this._name}},{key:"scope",get:function(){return this._scope}},{key:"uid",get:function(){return this._uid}}],[{key:"parse",value:function(e){return"string"==typeof e&&(e=JSON.parse(e)),new t(e)}}]),t}(),d=function(){function t(e){r(this,t),this._defn=e,this._scope=new Function("\n eval('"+this.toCode()+"')\n return {\n 'eval': function(packet, expr) {\n var raw = packet.__clone__(packet._data, true)\n try {\n return eval(expr)\n } catch (e) {\n return null\n }\n }\n }\n ").call()}return a(t,[{key:"_sanitize",value:function(t){return t.replace("≤","<=").replace("≥",">=")}},{key:"_toBinaryCond",value:function(t){var e=/==|!=|<=|>=|<|>/g,n=t.match(e),i=t.split(e);return 2===n.length&&3===i.length?"("+i[0]+" "+n[0]+" "+i[1]+") && ("+i[1]+" "+n[1]+" "+i[2]+")":t}},{key:"eval",value:function(t,e){return this._scope.eval(t,e)}},{key:"toCode",value:function(){var t="";for(var e in this._defn.constants)t+="var "+e+" = "+this._defn.constants[e]+"; ";for(var n in this._defn.functions){var i=this._defn.functions[n];if(t+="function "+n+" { ","string"==typeof i)t+="return ("+i+") ";else if("object"===("undefined"==typeof i?"undefined":o(i)))for(var r in i){var a=this._toBinaryCond(this._sanitize(r));t+="if ("+a+") { return ("+i[r]+") } "}t+="};"}return t}}]),t}(),h=function(){function t(){r(this,t)}return a(t,[{key:"add",value:function(t){t instanceof c&&(this[t.name]=t)}}],[{key:"parse",value:function(e){var n=new t;"string"==typeof e&&(e=JSON.parse(e));for(var i in e)n.add(new c(e[i]));return n}}]),t}(),f=function(){function t(e,n){var i=this;r(this,t),this._dict={},this._interval=0,this._socket=new WebSocket(e),this._stale=0,this._url=e,this.getFullPacketStates();for(var o in n){var a=n[o];this._dict[a.uid]=a}this._socket.binaryType="arraybuffer",this._socket.onclose=function(t){return i.onClose(t)},this._socket.onmessage=function(t){return i.onMessage(t)},this._socket.onopen=function(t){return i.onOpen(t)}}return a(t,[{key:"_emit",value:function(t,e){ait.events.emit("ait:tlm:"+t,e)}},{key:"onClose",value:function(t){clearInterval(this._interval),this._emit("close",this)}},{key:"getFullPacketStates",value:function(){var t=this;m.request({url:"/tlm/latest"}).then(function(e){t._pkt_states=e.states,t._counters=e.counters})}},{key:"checkCounter",value:function(t,e){var n=this._counters[t];return e==n+1||(n==Math.pow(2,31)-1&&0==e||(console.log("counter mismatch: had "+n+" , got "+e),!1))}},{key:"onMessage",value:function(t){if("string"==typeof t.data){var e=(Date.now(),JSON.parse(t.data)),n=e.packet,i=e.data,r=e.dntoeus,o=e.counter;if(n in this._pkt_states){var a=this.checkCounter(n,o);if(a){if(0!==Object.keys(i).length){for(var s in i)this._pkt_states[n].raw[s]=i[s];for(var s in r)this._pkt_states[n].dntoeu[s]=r[s]}this._counters[n]=o}else this.getFullPacketStates()}else 0==Object.keys(i).length?this.getFullPacketStates():(this._pkt_states[n]={},this._pkt_states[n].raw=i,this._pkt_states[n].dntoeu=r,this._counters[n]=o);clearInterval(this._interval),this._stale=0,this._interval=setInterval(this.onStale.bind(this),5e3);var l=JSON.parse(JSON.stringify(this._pkt_states[n]));ait.packets.insert(n,l),this._emit("packet",{packet:n,data:this._pkt_states[n]})}}},{key:"onOpen",value:function(t){this._interval=setInterval(this.onStale.bind(this),5e3),this._stale=0,this._emit("open",this)}},{key:"onStale",value:function(){this._stale++,this._emit("stale",this)}}]),t}();e.FieldDefinition=u,e.PacketDefinition=c,e.PacketScope=d,e.TelemetryDictionary=h,e.TelemetryStream=f},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Plot=void 0;var o=function(){function t(t,e){for(var n=0;nthis._plotrange&&this._plot._data.shift(),this._plot.shouldRedraw()&&this.redraw()}}},{key:"redraw",value:function(){this._plot._chart.updateOptions({file:this._plot._data})}}]),t}(),h=function(){function t(e){r(this,t),this._plot=e}return o(t,[{key:"addSeries",value:function(t,e){this._plot._options.series.push({id:t,name:e.caption||t,color:e.color,data:[],tooltip:{valueDecimals:2},type:e.type,showInNavigator:!0,boostThreshold:1,cropThreshold:1,turboThreshold:1})}},{key:"createChart",value:function(t,e){return new Highcharts.StockChart(t.dom,e)}},{key:"createOptions",value:function(t){return{credits:{enabled:!1},legend:{enabled:!0},boost:{seriesThreshold:1},rangeSelector:{buttons:[{count:1,text:"1m",type:"minute"},{count:10,text:"10m",type:"minute"},{count:30,text:"30m",type:"minute"},{count:1,text:"1h",type:"hour"},{count:6,text:"6h",type:"hour"},{count:12,text:"12h",type:"hour"},{count:1,text:"1d",type:"day"}],inputEnabled:!1},series:[],title:{text:t.title},xAxis:{title:{text:"Time (UTC)"}},yAxis:{title:{text:t["y-title"]}}}}},{key:"handleOptionsOverride",value:function(t,e){Object.assign(t,e)}},{key:"plot",value:function(t,e){var n=this,i=t.packet,r=(0,c.getFieldType)(t.data,e),o=this._plot._packets[i];o&&(o.forEach(function(t){var e=n._plot._chart.get(i+"."+t);if(e){var o=n._plot._time.get(r).getTime(),a=r[t];if(e.addPoint([o,a],!1),n._plot._initZoom===!1){var s=n._plot._chart.axes[0].getExtremes(),l=(s.max-s.min)/1e3;l>=60&&(n._plot._chart.rangeSelector.clickButton(0,!0),n._plot._initZoom=!0)}}}),this._plot.shouldRedraw()&&this.redraw())}},{key:"redraw",value:function(){this._plot._chart.redraw()}}]),t}(),f={plot:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._backend.plot(t,e)},processTag:function(t){if("ait-plotconfig"===t.tag)try{this._backend.handleOptionsOverride(this._options,JSON.parse(t.text))}catch(t){t instanceof SyntaxError&&console.error("Error parsing plot config. Printing trace back and reverting to default options."),console.error(t)}else"ait-plotseries"===t.tag?this.processTagSeries(t):"ait-plottime"===t.tag&&this.processTagTime(t)},processTagSeries:function(t){var e=t.attrs.name,n=t.attrs.packet,i=(t.attrs.type,n+"."+e);this._backend.addSeries(i,t.attrs),this._packets[n]=this._packets[n]||[],this._packets[n].push(e),this._raw=t.attrs.raw},processTagTime:function(t){this._time=new p(t.attrs.packet,t.attrs.name)},shouldRedraw:function(){var t=Date.now(),e=(t-this._lastRedrawTime)/1e3;return e>this._redrawDelta&&(this._lastRedrawTime=t,!0)},oninit:function(t){var e=this;this._backend=window.Highcharts?new h(this):new d(this),this._data=[],this._options=this._backend.createOptions(t.attrs),this._packets={},this._time=null,this._initZoom=!1,this._redrawFrequency=parseInt(t.attrs["redraw-frequency"])||10;var n=parseInt(t.attrs["redraw-frequency-variation-min"])||-2,i=parseInt(t.attrs["redraw-frequency-variation-max"])||2,r="redraw-frequency-variation"in t.attrs&&t.attrs["redraw-frequency-variation"]===!0;this._redrawDelta=this._redrawFrequency+(r?Math.random()*(i-n)+n:0),this._lastRedrawTime=Date.now(),t.children.forEach(function(t){return e.processTag(t)}),null===this._time&&(this._time=new p),ait.events.on("ait:tlm:packet",function(t){return e.plot(t,e._raw)}),ait.events.on("ait:playback:on",function(){return e.redraw()}),ait.events.on("ait:playback:off",function(){return e.redraw()})},oncreate:function(t){this._chart=this._backend.createChart(t,this._options)},view:function(t){if(window.Highcharts)return(0,s.default)("ait-plot",t.attrs);var e=[(0,s.default)("div")];return this._backend._user_specified_label||e.push((0,s.default)("div",{id:this._backend._plot_id,class:"dygraph-legend",style:"width: "+this._options.width+"px;"})),(0,s.default)("ait-plot",t.attrs,e)},redraw:function(){this._data=[],this._backend.redraw()}},p=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;r(this,t),this._pname=e,this._fname=n}return o(t,[{key:"get",value:function(t){var e=this.hasTime(t)?t.__get__(this._fname):null;return e instanceof Date||(e="number"!=typeof e?new Date:new Date(e)),e}},{key:"hasTime",value:function(t){var e=t&&t._defn;return e&&this._pname===e.name&&this._fname in e.fields}}]),t}();e.default=f,e.Plot=f},function(t,e,n){t.exports=n(167)},function(t,e,n){(function(i){/** * @license * Copyright 2006 Dan Vanderkam (danvdk@gmail.com) * MIT-licensed (http://opensource.org/licenses/MIT) @@ -152,8 +152,8 @@ this.attrs_.labels=["X"],e=1;ee)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)es&>(t.doc,e)r.viewFrom?_i(t):(r.viewFrom+=i,r.viewTo+=i);else if(e<=r.viewFrom&&n>=r.viewTo)_i(t);else if(e<=r.viewFrom){var o=xi(t,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):_i(t)}else if(n>=r.viewTo){var a=xi(t,e,e,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):_i(t)}else{var s=xi(t,e,e,-1),l=xi(t,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(me(t,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):_i(t)}var u=r.externalMeasured;u&&(n=r.lineN&&e=i.viewTo)){var o=i.view[An(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);h(a,n)==-1&&a.push(n)}}}function _i(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function xi(t,e,n,i){var r,o=An(t,e),a=t.display.view;if(!es||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(o==a.length-1)return null;r=s+a[o].size-e,o++}else r=s-e;e+=r,n+=r}for(;gt(t.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function wi(t,e,n){var i=t.display,r=i.view;0==r.length||e>=i.viewTo||n<=i.viewFrom?(i.view=me(t,e,n),i.viewFrom=e):(i.viewFrom>e?i.view=me(t,e,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,An(t,n)))),i.viewTo=n}function Si(t){for(var e=t.display.view,n=0,i=0;i=t.display.viewTo)){var n=+new Date+t.options.workTime,i=Kt(t,e.highlightFrontier),r=[];e.iter(i.line,Math.min(e.first+e.size,t.display.viewTo+500),function(o){if(i.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?Vt(e.mode,i.state):null,l=Gt(t,o,i,!0);s&&(i.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!d&&hn)return Ci(t,t.options.workDelay),!0}),e.highlightFrontier=i.line,e.modeFrontier=Math.max(e.modeFrontier,i.line),r.length&&pi(t,function(){for(var e=0;e=i.viewFrom&&n.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==Si(t))return!1;zn(t)&&(_i(t),n.dims=wn(t));var o=r.first+r.size,a=Math.max(n.visible.from-t.options.viewportMargin,r.first),s=Math.min(o,n.visible.to+t.options.viewportMargin);i.viewFroms&&i.viewTo-s<20&&(s=Math.min(o,i.viewTo)),es&&(a=gt(t.doc,a),s=vt(t.doc,s));var l=a!=i.viewFrom||s!=i.viewTo||i.lastWrapHeight!=n.wrapperHeight||i.lastWrapWidth!=n.wrapperWidth;wi(t,a,s),i.viewOffset=bt(A(t.doc,i.viewFrom)),t.display.mover.style.top=i.viewOffset+"px";var u=Si(t);if(!l&&0==u&&!n.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var c=Ai(t);return u>4&&(i.lineDiv.style.display="none"),Mi(t,i.updateLineNumbers,n.dims),u>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Di(c),e(i.cursorDiv),e(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,l&&(i.lastWrapHeight=n.wrapperHeight,i.lastWrapWidth=n.wrapperWidth,Ci(t,400)),i.updateLineNumbers=null,!0}function Li(t,e){for(var n=e.viewport,i=!0;(i&&t.options.lineWrapping&&e.oldDisplayWidth!=Be(t)||(n&&null!=n.top&&(n={top:Math.min(t.doc.height+He(t.display)-ze(t),n.top)}),e.visible=Wn(t.display,t.doc,n),!(e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)))&&Oi(t,e);i=!1){Hn(t);var r=ni(t);Dn(t),ii(t,r),Pi(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Ei(t,e){var n=new Os(t,e);if(Oi(t,n)){Hn(t),Li(t,n);var i=ni(t);Dn(t),ii(t,i),Pi(t,i),n.finish()}}function Mi(t,n,i){function r(e){var n=e.nextSibling;return Ca&&Pa&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var o=t.display,a=t.options.lineNumbers,s=o.lineDiv,l=s.firstChild,u=o.view,c=o.viewFrom,d=0;d-1&&(p=!1),Se(t,f,c,i)),p&&(e(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(P(t.options,c)))),l=f.node.nextSibling}else{var g=Ee(t,f,c,i);s.insertBefore(g,l)}c+=f.size}for(;l;)l=r(l)}function Ni(t){var e=t.display.gutters.offsetWidth;t.display.sizer.style.marginLeft=e+"px"}function Pi(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+We(t)+"px"}function Ii(t){var n=t.display.gutters,r=t.options.gutters;e(n);for(var o=0;o-1&&!t.lineNumbers&&(t.gutters=t.gutters.slice(0),t.gutters.splice(e,1))}function Ri(t){var e=t.wheelDeltaX,n=t.wheelDeltaY;return null==e&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(e=t.detail),null==n&&t.detail&&t.axis==t.VERTICAL_AXIS?n=t.detail:null==n&&(n=t.wheelDelta),{x:e,y:n}}function Hi(t){var e=Ri(t);return e.x*=Es,e.y*=Es,e}function ji(t,e){var n=Ri(e),i=n.x,r=n.y,o=t.display,a=o.scroller,s=a.scrollWidth>a.clientWidth,l=a.scrollHeight>a.clientHeight;if(i&&s||r&&l){if(r&&Pa&&Ca)t:for(var u=e.target,c=o.view;u!=a;u=u.parentNode)for(var d=0;d0:l>=0){var u=W(s.from(),a.from()),c=j(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new Ns(d?c:u,d?u:c))}}return new Ms(e,n)}function Bi(t,e){return new Ms([new Ns(t,e||t)],0)}function zi(t){return t.text?I(t.from.line+t.text.length-1,g(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function $i(t,e){if(F(t,e.from)<0)return t;if(F(t,e.to)<=0)return zi(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,i=t.ch;return t.line==e.to.line&&(i+=zi(e).ch-e.to.ch),I(n,i)}function Yi(t,e){for(var n=[],i=0;i1&&t.remove(s.line+1,p-1),t.insert(s.line+1,y)}xe(t,"change",t,e)}function Ki(t,e,n){function i(t,r,o){if(t.linked)for(var a=0;a1&&!t.done[t.done.length-2].ranges?(t.done.pop(),g(t.done)):void 0}function or(t,e,n,i){var r=t.history;r.undone.length=0;var o,a,s=+new Date;if((r.lastOp==i||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=rr(r,r.lastOp==i)))a=g(o.changes),0==F(e.from,e.to)&&0==F(e.from,a.to)?a.to=zi(e):o.changes.push(nr(t,e));else{var l=g(r.done);for(l&&l.ranges||lr(t.sel,r.done),o={changes:[nr(t,e)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=e.origin,a||At(t,"historyAdded")}function ar(t,e,n,i){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function sr(t,e,n,i){var r=t.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||ar(t,o,g(r.done),e))?r.done[r.done.length-1]=e:lr(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&i.clearRedo!==!1&&ir(r.undone)}function lr(t,e){var n=g(e);n&&n.ranges&&n.equals(t)||e.push(t)}function ur(t,e,n,i){var r=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,i),function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[o]=n.markedSpans),++o})}function cr(t){if(!t)return null;for(var e,n=0;n-1&&(g(s)[d]=u[d],delete u[d])}}}return i}function pr(t,e,n,i){if(i){var r=t.anchor;if(n){var o=F(e,r)<0;o!=F(n,r)<0?(r=e,e=n):o!=F(e,n)<0&&(e=n)}return new Ns(r,e)}return new Ns(n||e,e)}function gr(t,e,n,i,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),xr(t,new Ms([pr(t.sel.primary(),e,n,r)],0),i)}function vr(t,e,n){for(var i=[],r=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(r&&(At(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var u=l.find(i<0?1:-1),c=void 0;if((i<0?l.inclusiveRight:l.inclusiveLeft)&&(u=Dr(t,u,-i,u&&u.line==e.line?o:null)),u&&u.line==e.line&&(c=F(u,n))&&(i<0?c<0:c>0))return kr(t,u,e,i,r)}var d=l.find(i<0?-1:1);return(i<0?l.inclusiveLeft:l.inclusiveRight)&&(d=Dr(t,d,i,d.line==e.line?o:null)),d?kr(t,d,e,i,r):null}}return e}function Ar(t,e,n,i,r){var o=i||1,a=kr(t,e,n,o,r)||!r&&kr(t,e,n,o,!0)||kr(t,e,n,-o,r)||!r&&kr(t,e,n,-o,!0);return a?a:(t.cantEdit=!0,I(t.first,0))}function Dr(t,e,n,i){return n<0&&0==e.ch?e.line>t.first?z(t,I(e.line-1)):null:n>0&&e.ch==(i||A(t,e.line)).text.length?e.line=0;--r)Mr(t,{from:i[r].from,to:i[r].to,text:r?[""]:e.text,origin:e.origin});else Mr(t,e)}}function Mr(t,e){if(1!=e.text.length||""!=e.text[0]||0!=F(e.from,e.to)){var n=Yi(t,e);or(t,e,n,t.cm?t.cm.curOp.id:NaN),Ir(t,e,n,Q(t,e));var i=[];Ki(t,function(t,n){n||h(i,t.history)!=-1||(Wr(t.history,e),i.push(t.history)),Ir(t,e,null,Q(t,e))})}}function Nr(t,e,n){var i=t.cm&&t.cm.state.suppressEdits;if(!i||n){for(var r,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u=0;--p){var v=f(p);if(v)return v.v}}}}function Pr(t,e){if(0!=e&&(t.first+=e,t.sel=new Ms(v(t.sel.ranges,function(t){return new Ns(I(t.anchor.line+e,t.anchor.ch),I(t.head.line+e,t.head.ch))}),t.sel.primIndex),t.cm)){yi(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,i=n.viewFrom;it.lastLine())){if(e.from.lineo&&(e={from:e.from,to:I(o,A(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=D(t,e.from,e.to),n||(n=Yi(t,e)),t.cm?Fr(t.cm,e,i):Zi(t,e,i),wr(t,n,Xa)}}function Fr(t,e,n){var i=t.doc,r=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=E(ht(A(i,o.line))),i.iter(l,a.line+1,function(t){if(t==r.maxLine)return s=!0,!0})),i.sel.contains(e.from,e.to)>-1&&Ot(t),Zi(i,e,n,Cn(t)),t.options.lineWrapping||(i.iter(l,o.line+e.text.length,function(t){var e=_t(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,s=!1)}),s&&(t.curOp.updateMaxLine=!0)),oe(i,o.line),Ci(t,400);var u=e.text.length-(a.line-o.line)-1;e.full?yi(t):o.line!=a.line||1!=e.text.length||Gi(t.doc,e)?yi(t,o.line,a.line+1,u):bi(t,o.line,"text");var c=Lt(t,"changes"),d=Lt(t,"change");if(d||c){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};d&&xe(t,"change",t,h),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}function Rr(t,e,n,i,r){var o;i||(i=n),F(i,n)<0&&(o=[i,n],n=o[0],i=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Er(t,{from:n,to:i,text:e,origin:r})}function Hr(t,e,n,i){n0||0==s&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=r("span",[a.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(dt(t,e.line,e,n,a)||e.line!=n.line&&dt(t,n.line,e,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");V()}a.addToHistory&&or(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var l,u=e.line,d=t.cm;if(t.iter(u,n.line+1,function(t){d&&a.collapsed&&!d.options.lineWrapping&&ht(t)==d.display.maxLine&&(l=!0),a.collapsed&&u!=e.line&&L(t,0),Z(t,new U(a,u==e.line?e.ch:null,u==n.line?n.ch:null)),++u}),a.collapsed&&t.iter(e.line,n.line+1,function(e){mt(t,e)&&L(e,0)}),a.clearOnEnter&&os(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(q(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),a.collapsed&&(a.id=++Is,a.atomic=!0),d){if(l&&(d.curOp.updateMaxLine=!0),a.collapsed)yi(d,e.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var h=e.line;h<=n.line;h++)bi(d,h,"text");a.atomic&&Cr(d.doc),xe(d,"markerAdded",d,a)}return a}function Ur(t,e,n,i,r){i=c(i),i.shared=!1;var o=[Vr(t,e,n,i,r)],a=o[0],s=i.widgetNode;return Ki(t,function(t){s&&(i.widgetNode=s.cloneNode(!0)),o.push(Vr(t,z(t,e),z(t,n),i,r));for(var l=0;l-1)return e.state.draggingText(t),void setTimeout(function(){return e.display.input.focus()},20);try{var u=t.dataTransfer.getData("Text");if(u){var c;if(e.state.draggingText&&!e.state.draggingText.copy&&(c=e.listSelections()),wr(e.doc,Bi(n,n)),c)for(var d=0;d=0;e--)Rr(t.doc,"",i[e].from,i[e].to,"+delete");Xn(t)})}function po(t,e,n){var i=C(t.text,e+n,n);return i<0||i>t.text.length?null:i}function go(t,e,n){var i=po(t,e.ch,n);return null==i?null:new I(e.line,i,n<0?"after":"before")}function vo(t,e,n,i,r){if(t){var o=Ct(n,e.doc.direction);if(o){var a,s=r<0?g(o):o[0],l=r<0==(1==s.level),u=l?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=Xe(e,n);a=r<0?n.text.length-1:0;var d=Ge(e,c,a).top;a=T(function(t){return Ge(e,c,t).top==d},r<0==(1==s.level)?s.from:s.to-1,a),"before"==u&&(a=po(n,a,1))}else a=r<0?s.to:s.from;return new I(i,a,u)}}return new I(i,r<0?n.text.length:0,r<0?"before":"after")}function mo(t,e,n,i){var r=Ct(e,t.doc.direction);if(!r)return go(e,n,i);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=St(r,n.ch,n.sticky),a=r[o];if("ltr"==t.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from=a.from&&h>=c.begin)){var f=d?"before":"after";return new I(n.line,h,f)}}var p=function(t,e,i){for(var o=function(t,e){return e?new I(n.line,l(t,1),"before"):new I(n.line,t,"after")};t>=0&&t0==(1!=a.level),u=s?i.begin:l(i.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==v||i>0&&v==e.text.length||!(g=p(i>0?0:r.length-1,i,u(v)))?null:g}function yo(t,e){var n=A(t.doc,e),i=ht(n);return i!=n&&(e=E(i)),vo(!0,t,i,e,1)}function bo(t,e){var n=A(t.doc,e),i=ft(n);return i!=n&&(e=E(i)),vo(!0,t,n,e,-1)}function _o(t,e){var n=yo(t,e.line),i=A(t.doc,n.line),r=Ct(i,t.doc.direction);if(!r||0==r[0].level){var o=Math.max(0,i.text.search(/\S/)),a=e.line==n.line&&e.ch<=o&&e.ch;return I(n.line,a?0:o,n.sticky)}return n}function xo(t,e,n){if("string"==typeof e&&(e=Us[e],!e))return!1;t.display.input.ensurePolled();var i=t.display.shift,r=!1;try{t.isReadOnly()&&(t.state.suppressEdits=!0),n&&(t.display.shift=!1),r=e(t)!=Ua}finally{t.display.shift=i,t.state.suppressEdits=!1}return r}function wo(t,e,n){for(var i=0;i-1&&(F((r=s.ranges[r]).from(),e)<0||e.xRel>0)&&(F(r.to(),e)>0||e.xRel<0)?Fo(t,i,e,o):Ho(t,i,e,o)}function Fo(t,e,n,i){var r=t.display,o=!1,a=gi(t,function(e){Ca&&(r.scroller.draggable=!1),t.state.draggingText=!1,kt(r.wrapper.ownerDocument,"mouseup",a),kt(r.wrapper.ownerDocument,"mousemove",s),kt(r.scroller,"dragstart",l),kt(r.scroller,"drop",a),o||(Mt(e),i.addNew||gr(t.doc,n,null,null,i.extend),Ca||wa&&9==Sa?setTimeout(function(){r.wrapper.ownerDocument.body.focus(),r.input.focus()},20):r.input.focus())}),s=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},l=function(){return o=!0};Ca&&(r.scroller.draggable=!0),t.state.draggingText=a,a.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),os(r.wrapper.ownerDocument,"mouseup",a),os(r.wrapper.ownerDocument,"mousemove",s),os(r.scroller,"dragstart",l),os(r.scroller,"drop",a),In(t),setTimeout(function(){return r.input.focus()},20)}function Ro(t,e,n){if("char"==n)return new Ns(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new Ns(I(e.line,0),z(t.doc,I(e.line+1,0)));var i=n(t,e);return new Ns(i.from,i.to)}function Ho(t,e,n,i){function r(e){if(0!=F(m,e))if(m=e,"rectangle"==i.unit){for(var r=[],o=t.options.tabSize,a=d(A(u,n.line).text,n.ch,o),s=d(A(u,e.line).text,e.ch,o),l=Math.min(a,s),g=Math.max(a,s),v=Math.min(n.line,e.line),y=Math.min(t.lastLine(),Math.max(n.line,e.line));v<=y;v++){var b=A(u,v).text,_=f(b,l,o);l==g?r.push(new Ns(I(v,_),I(v,_))):b.length>_&&r.push(new Ns(I(v,_),I(v,f(b,g,o))))}r.length||r.push(new Ns(n,n)),xr(u,Wi(t,p.ranges.slice(0,h).concat(r),h),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var x,w=c,S=Ro(t,e,i.unit),C=w.anchor;F(S.anchor,C)>0?(x=S.head,C=W(w.from(),S.anchor)):(x=S.anchor,C=j(w.to(),S.head));var T=p.ranges.slice(0);T[h]=jo(t,new Ns(z(u,C),x)),xr(u,Wi(t,T,h),Ga)}}function o(e){var n=++b,s=kn(t,e,!0,"rectangle"==i.unit);if(s)if(0!=F(s,m)){t.curOp.focus=a(),r(s);var c=Wn(l,u);(s.line>=c.to||s.liney.bottom?20:0;d&&setTimeout(gi(t,function(){b==n&&(l.scroller.scrollTop+=d,o(e))}),50)}}function s(e){t.state.selectingText=!1,b=1/0,Mt(e),l.input.focus(),kt(l.wrapper.ownerDocument,"mousemove",_),kt(l.wrapper.ownerDocument,"mouseup",x),u.history.lastSelOrigin=null}var l=t.display,u=t.doc;Mt(e);var c,h,p=u.sel,g=p.ranges;if(i.addNew&&!i.extend?(h=u.sel.contains(n),c=h>-1?g[h]:new Ns(n,n)):(c=u.sel.primary(),h=u.sel.primIndex),"rectangle"==i.unit)i.addNew||(c=new Ns(n,n)),n=kn(t,e,!0,!0),h=-1;else{var v=Ro(t,n,i.unit);c=i.extend?pr(c,v.anchor,v.head,i.extend):v}i.addNew?h==-1?(h=g.length,xr(u,Wi(t,g.concat([c]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"char"==i.unit&&!i.extend?(xr(u,Wi(t,g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):mr(u,h,c,Ga):(h=0,xr(u,new Ms([c],0),Ga),p=u.sel);var m=n,y=l.wrapper.getBoundingClientRect(),b=0,_=gi(t,function(t){0!==t.buttons&&Rt(t)?o(t):s(t)}),x=gi(t,s);t.state.selectingText=x,os(l.wrapper.ownerDocument,"mousemove",_),os(l.wrapper.ownerDocument,"mouseup",x)}function jo(t,e){var n=e.anchor,i=e.head,r=A(t.doc,n.line);if(0==F(n,i)&&n.sticky==i.sticky)return e;var o=Ct(r);if(!o)return e;var a=St(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return e;var u;if(i.line!=n.line)u=(i.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=St(o,i.ch,i.sticky),d=c-a||(i.ch-n.ch)*(1==s.level?-1:1);u=c==l-1||c==l?d<0:d>0}var h=o[l+(u?-1:0)],f=u==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new Ns(new I(n.line,p,g),i)}function Wo(t,e,n,i){var r,o;if(e.touches)r=e.touches[0].clientX,o=e.touches[0].clientY;else try{r=e.clientX,o=e.clientY}catch(t){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;i&&Mt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Lt(t,n))return Pt(e);o-=s.top-a.viewOffset;for(var l=0;l=r){var c=M(t.doc,o),d=t.options.gutters[l];return At(t,n,t,c,d,e),Pt(e)}}}function Bo(t,e){return Wo(t,e,"gutterClick",!0)}function zo(t,e){Fe(t.display,e)||$o(t,e)||Dt(t,e,"contextmenu")||Wa||t.display.input.onContextMenu(e)}function $o(t,e){return!!Lt(t,"gutterContextMenu")&&Wo(t,e,"gutterContextMenu",!1)}function Yo(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),nn(t)}function qo(t){function e(e,i,r,o){t.defaults[e]=i,r&&(n[e]=o?function(t,e,n){n!=tl&&r(t,e,n)}:r)}var n=t.optionHandlers;t.defineOption=e,t.Init=tl,e("value","",function(t,e){return t.setValue(e)},!0),e("mode",null,function(t,e){t.doc.modeOption=e,Ui(t)},!0),e("indentUnit",2,Ui,!0),e("indentWithTabs",!1),e("smartIndent",!0),e("tabSize",4,function(t){Xi(t),nn(t),yi(t)},!0),e("lineSeparator",null,function(t,e){if(t.doc.lineSep=e,e){var n=[],i=t.doc.first;t.doc.iter(function(t){for(var r=0;;){var o=t.text.indexOf(e,r);if(o==-1)break;r=o+e.length,n.push(I(i,o))}i++});for(var r=n.length-1;r>=0;r--)Rr(t.doc,e,n[r],I(n[r].line,n[r].ch+e.length))}}),e("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=tl&&t.refresh()}),e("specialCharPlaceholder",ce,function(t){return t.refresh()},!0),e("electricChars",!0),e("inputStyle",Na?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),e("spellcheck",!1,function(t,e){return t.getInputField().spellcheck=e},!0),e("rtlMoveVisually",!Fa),e("wholeLineUpdateBefore",!0),e("theme","default",function(t){Yo(t),Vo(t)},!0),e("keyMap","default",function(t,e,n){var i=ho(e),r=n!=tl&&ho(n);r&&r.detach&&r.detach(t,i),i.attach&&i.attach(t,r||null)}),e("extraKeys",null),e("configureMouse",null),e("lineWrapping",!1,Xo,!0),e("gutters",[],function(t){Fi(t.options),Vo(t)},!0),e("fixedGutter",!0,function(t,e){t.display.gutters.style.left=e?Sn(t.display)+"px":"0",t.refresh()},!0),e("coverGutterNextToScrollbar",!1,function(t){return ii(t)},!0),e("scrollbarStyle","native",function(t){oi(t),ii(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)},!0),e("lineNumbers",!1,function(t){Fi(t.options),Vo(t)},!0),e("firstLineNumber",1,Vo,!0),e("lineNumberFormatter",function(t){return t},Vo,!0),e("showCursorWhenSelecting",!1,Dn,!0),e("resetSelectionOnContextMenu",!0),e("lineWiseCopyCut",!0),e("pasteLinesPerSelection",!0),e("selectionsMayTouch",!1),e("readOnly",!1,function(t,e){"nocursor"==e&&(Rn(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)}),e("disableInput",!1,function(t,e){e||t.display.input.reset()},!0),e("dragDrop",!0,Uo),e("allowDropFileTypes",null),e("cursorBlinkRate",530),e("cursorScrollMargin",0),e("cursorHeight",1,Dn,!0),e("singleCursorHeightPerLine",!0,Dn,!0),e("workTime",100),e("workDelay",100),e("flattenSpans",!0,Xi,!0),e("addModeClass",!1,Xi,!0),e("pollInterval",100),e("undoDepth",200,function(t,e){return t.doc.history.undoDepth=e}),e("historyEventDelay",1250),e("viewportMargin",10,function(t){return t.refresh()},!0),e("maxHighlightLength",1e4,Xi,!0),e("moveInputWithCursor",!0,function(t,e){e||t.display.input.resetPosition()}),e("tabindex",null,function(t,e){return t.display.input.getField().tabIndex=e||""}),e("autofocus",null),e("direction","ltr",function(t,e){return t.doc.setDirection(e)},!0),e("phrases",null)}function Vo(t){Ii(t),yi(t),Bn(t)}function Uo(t,e,n){var i=n&&n!=tl;if(!e!=!i){var r=t.display.dragFunctions,o=e?os:kt;o(t.display.scroller,"dragstart",r.start),o(t.display.scroller,"dragenter",r.enter),o(t.display.scroller,"dragover",r.over),o(t.display.scroller,"dragleave",r.leave),o(t.display.scroller,"drop",r.drop)}}function Xo(t){t.options.lineWrapping?(s(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(Ba(t.display.wrapper,"CodeMirror-wrap"),xt(t)),Tn(t),yi(t),nn(t),setTimeout(function(){return ii(t)},100)}function Go(t,e){var n=this;if(!(this instanceof Go))return new Go(t,e);this.options=e=e?c(e):{},c(el,e,!1),Fi(e);var i=e.value;"string"==typeof i?i=new js(i,e.mode,null,e.lineSeparator,e.direction):e.mode&&(i.modeOption=e.mode),this.doc=i;var r=new Go.inputStyles[e.inputStyle](this),o=this.display=new k(t,i,r);o.wrapper.CodeMirror=this,Ii(this),Yo(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),oi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new $a,keySeq:null,specialChars:null},e.autofocus&&!Na&&o.input.focus(),wa&&Sa<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Zo(this),no(),ai(this),this.curOp.forceUpdate=!0,Ji(this,i),e.autofocus&&!Na||this.hasFocus()?setTimeout(u(Fn,this),20):Rn(this);for(var a in nl)nl.hasOwnProperty(a)&&nl[a](n,e[a],tl);zn(this),e.finishInit&&e.finishInit(this);for(var s=0;s400}var r=t.display;os(r.scroller,"mousedown",gi(t,Mo)),wa&&Sa<11?os(r.scroller,"dblclick",gi(t,function(e){if(!Dt(t,e)){var n=kn(t,e);if(n&&!Bo(t,e)&&!Fe(t.display,e)){Mt(e);var i=t.findWordAt(n);gr(t.doc,i.anchor,i.head)}}})):os(r.scroller,"dblclick",function(e){return Dt(t,e)||Mt(e)}),os(r.scroller,"contextmenu",function(e){return zo(t,e)});var o,a={end:0};os(r.scroller,"touchstart",function(e){if(!Dt(t,e)&&!n(e)&&!Bo(t,e)){r.input.ensurePolled(),clearTimeout(o);var i=+new Date;r.activeTouch={start:i,moved:!1,prev:i-a.end<=300?a:null},1==e.touches.length&&(r.activeTouch.left=e.touches[0].pageX,r.activeTouch.top=e.touches[0].pageY)}}),os(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),os(r.scroller,"touchend",function(n){var o=r.activeTouch;if(o&&!Fe(r,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,s=t.coordsChar(r.activeTouch,"page");a=!o.prev||i(o,o.prev)?new Ns(s,s):!o.prev.prev||i(o,o.prev.prev)?t.findWordAt(s):new Ns(I(s.line,0),z(t.doc,I(s.line+1,0))),t.setSelection(a.anchor,a.head),t.focus(),Mt(n)}e()}),os(r.scroller,"touchcancel",e),os(r.scroller,"scroll",function(){r.scroller.clientHeight&&(Qn(t,r.scroller.scrollTop),ei(t,r.scroller.scrollLeft,!0),At(t,"scroll",t))}),os(r.scroller,"mousewheel",function(e){return ji(t,e)}),os(r.scroller,"DOMMouseScroll",function(e){return ji(t,e)}),os(r.wrapper,"scroll",function(){return r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(e){Dt(t,e)||It(e)},over:function(e){Dt(t,e)||(Qr(t,e),It(e))},start:function(e){return Jr(t,e)},drop:gi(t,Kr),leave:function(e){Dt(t,e)||to(t)}};var s=r.input.getField();os(s,"keyup",function(e){return Oo.call(t,e)}),os(s,"keydown",gi(t,Ao)),os(s,"keypress",gi(t,Lo)),os(s,"focus",function(e){return Fn(t,e)}),os(s,"blur",function(e){return Rn(t,e)})}function Ko(t,e,n,i){var r,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=Kt(t,e).state:n="prev");var a=t.options.tabSize,s=A(o,e),l=d(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&(u=o.mode.indent(r,s.text.slice(c.length),s.text),u==Ua||u>150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?d(A(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",f=0;if(t.options.indentWithTabs)for(var g=Math.floor(u/a);g;--g)f+=a,h+="\t";if(f1)if(rl&&rl.text.join("\n")==e){if(i.ranges.length%rl.text.length==0){l=[];for(var u=0;u=0;d--){var h=i.ranges[d],f=h.from(),p=h.to();h.empty()&&(n&&n>0?f=I(f.line,f.ch-n):t.state.overwrite&&!a?p=I(p.line,Math.min(A(o,p.line).text.length,p.ch+g(s).length)):a&&rl&&rl.lineWise&&rl.text.join("\n")==e&&(f=p=I(f.line,0)));var m={from:f,to:p,text:l?l[d%l.length]:s,origin:r||(a?"paste":t.state.cutIncoming?"cut":"+input")};Er(t.doc,m),xe(t,"inputRead",t,m)}e&&!a&&ea(t,e),Xn(t),t.curOp.updateInput<2&&(t.curOp.updateInput=c),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=!1}function ta(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||pi(e,function(){return Qo(e,n,0,null,"paste")}),!0}function ea(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=t.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Ko(t,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(A(t.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Ko(t,r.head.line,"smart"));a&&xe(t,"electricInput",t,r.head.line)}}}function na(t){for(var e=[],n=[],i=0;ii&&(Ko(e,o.head.line,t,!0),i=o.head.line,r==e.doc.sel.primIndex&&Xn(e));else{var a=o.from(),s=o.to(),l=Math.max(i,a.line);i=Math.min(e.lastLine(),s.line-(s.ch?0:1))+1;for(var u=l;u0&&mr(e.doc,r,new Ns(a,c[r].to()),Xa)}}}),getTokenAt:function(t,e){return ee(this,t,e)},getLineTokens:function(t,e){return ee(this,I(t),e,!0)},getTokenTypeAt:function(t){t=z(this.doc,t);var e,n=Zt(this,A(this.doc,t.line)),i=0,r=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]o&&(t=o,r=!0),i=A(this.doc,t)}else i=t;return sn(this,i,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-bt(i):0)},defaultTextHeight:function(){return _n(this.display)},defaultCharWidth:function(){return xn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,i,r){var o=this.display;t=cn(this,z(this.doc,t));var a=t.bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==i)a=t.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==r?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&qn(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:vi(Ao),triggerOnKeyPress:vi(Lo),triggerOnKeyUp:Oo,triggerOnMouseDown:vi(Mo),execCommand:function(t){if(Us.hasOwnProperty(t))return Us[t].call(null,this)},triggerElectric:vi(function(t){ea(this,t)}),findPosH:function(t,e,n,i){var r=this,o=1;e<0&&(o=-1,e=-e);for(var a=z(this.doc,t),s=0;s0&&s(n.charAt(i-1));)--i;for(;r.5)&&Tn(this),At(this,"refresh",this)}),swapDoc:vi(function(t){var e=this.doc;return e.cm=null,Ji(this,t),nn(this),this.display.input.reset(),Gn(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,xe(this,"swapDoc",this,e),e}),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Et(t),t.registerHelper=function(e,i,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][i]=r},t.registerGlobalHelper=function(e,i,r,o){t.registerHelper(e,i,o),n[e]._global.push({pred:r,val:o})}}function aa(t,e,n,i,r){function o(){var i=e.line+n;return!(i=t.first+t.size)&&(e=new I(i,e.ch,e.sticky),u=A(t,i))}function a(i){var a;if(a=r?mo(t.cm,u,e,n):go(u,e,n),null==a){if(i||!o())return!1;e=vo(r,t.cm,u,e.line,n)}else e=a;return!0}var s=e,l=n,u=A(t,e.line);if("char"==i)a();else if("column"==i)a(!0);else if("word"==i||"group"==i)for(var c=null,d="group"==i,h=t.cm&&t.cm.getHelper(e,"wordChars"),f=!0;!(n<0)||a(!f);f=!1){var p=u.text.charAt(e.ch)||"\n",g=x(p,h)?"w":d&&"\n"==p?"n":!d||/\s/.test(p)?null:"p";if(!d||f||g||(g="s"),c&&c!=g){n<0&&(n=1,a(),e.sticky="after");break}if(g&&(c=g),n>0&&!a(!f))break}var v=Ar(t,e,s,l,!0);return R(s,v)&&(v.hitSide=!0),v}function sa(t,e,n,i){var r,o=t.doc,a=e.left;if("page"==i){var s=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*_n(t.display),3);r=(n>0?e.bottom:e.top)+n*l}else"line"==i&&(r=n>0?e.bottom+3:e.top-3);for(var u;u=fn(t,a,r),u.outside;){if(n<0?r<=0:r>=o.height){u.hitSide=!0;break}r+=5*n}return u}function la(t,e){var n=Ue(t,e.line);if(!n||n.hidden)return null;var i=A(t.doc,e.line),r=Ye(n,i,e.line),o=Ct(i,t.doc.direction),a="left";if(o){var s=St(o,e.ch);a=s%2?"right":"left"}var l=Ze(r.map,e.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function ua(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function ca(t,e){return e&&(t.bad=!0),t}function da(t,e,n,i,r){function o(t){return function(e){return e.id==t}}function a(){c&&(u+=d,h&&(u+=d),c=h=!1)}function s(t){t&&(a(),u+=t)}function l(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void s(n);var u,f=e.getAttribute("cm-marker");if(f){var p=t.findMarks(I(i,0),I(r+1,0),o(+f));return void(p.length&&(u=p[0].find(0))&&s(D(t.doc,u.from,u.to).join(d)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&a();for(var v=0;v=15&&(Aa=!1,Ca=!0);var Ha,ja=Pa&&(Ta||Aa&&(null==Ra||Ra<12.11)),Wa=ya||wa&&Sa>=9,Ba=function(e,n){var i=e.className,r=t(n).exec(i);if(r){var o=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(o?r[1]+o:"")}};Ha=document.createRange?function(t,e,n,i){var r=document.createRange();return r.setEnd(i||t,n),r.setStart(t,e),r}:function(t,e,n){var i=document.body.createTextRange();try{i.moveToElementText(t.parentNode)}catch(t){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",e),i};var za=function(t){t.select()};Ea?za=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:wa&&(za=function(t){try{t.select()}catch(t){}});var $a=function(){this.id=null};$a.prototype.set=function(t,e){clearTimeout(this.id),this.id=setTimeout(e,t)};var Ya,qa,Va=30,Ua={toString:function(){return"CodeMirror.Pass"}},Xa={scroll:!1},Ga={origin:"*mouse"},Za={origin:"+move"},Ka=[""],Ja=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Qa=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,ts=!1,es=!1,ns=null,is=function(){function t(t){return t<=247?n.charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1785?i.charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L"}function e(t,e,n){this.level=t,this.from=e,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",i="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/;return function(n,i){var u="ltr"==i?"L":"R";if(0==n.length||"ltr"==i&&!r.test(n))return!1;for(var c=n.length,d=[],h=0;h=this.string.length},ps.prototype.sol=function(){return this.pos==this.lineStart},ps.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ps.prototype.next=function(){if(this.pose},ps.prototype.eatSpace=function(){for(var t=this,e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++t.pos;return this.pos>e},ps.prototype.skipToEnd=function(){this.pos=this.string.length},ps.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},ps.prototype.backUp=function(t){this.pos-=t},ps.prototype.column=function(){return this.lastColumnPos0?null:(i&&e!==!1&&(this.pos+=i[0].length),i)}var r=function(t){return n?t.toLowerCase():t},o=this.string.substr(this.pos,t.length);if(r(o)==r(t))return e!==!1&&(this.pos+=t.length),!0},ps.prototype.current=function(){return this.string.slice(this.start,this.pos)},ps.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},ps.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},ps.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var gs=function(t,e){this.state=t,this.lookAhead=e},vs=function(t,e,n,i){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};vs.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},vs.prototype.baseToken=function(t){var e=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)e.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},vs.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vs.fromSaved=function(t,e,n){return e instanceof gs?new vs(t,Vt(t.mode,e.state),n,e.lookAhead):new vs(t,Vt(t.mode,e),n)},vs.prototype.save=function(t){var e=t!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gs(e,this.maxLookAhead):e};var ms=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n},ys=function(t,e,n){this.text=t,it(this,e),this.height=n?n(this):1};ys.prototype.lineNo=function(){return E(this)},Et(ys);var bs,_s={},xs={},ws=null,Ss=null,Cs={left:0,right:0,top:0,bottom:0},Ts=function(t,e,n){this.cm=n;var r=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=o.tabIndex=-1,t(r),t(o),os(r,"scroll",function(){r.clientHeight&&e(r.scrollTop,"vertical")}),os(o,"scroll",function(){o.clientWidth&&e(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,wa&&Sa<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ts.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,i=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?i+"px":"0";var r=t.viewHeight-(e?i:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:e?i:0}},Ts.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ts.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ts.prototype.zeroWidthHack=function(){var t=Pa&&!Oa?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $a,this.disableVert=new $a},Ts.prototype.enableZeroWidthBar=function(t,e,n){function i(){var r=t.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=t?t.style.pointerEvents="none":e.set(1e3,i)}t.style.pointerEvents="auto",e.set(1e3,i)},Ts.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var ks=function(){};ks.prototype.update=function(){return{bottom:0,right:0}},ks.prototype.setScrollLeft=function(){},ks.prototype.setScrollTop=function(){},ks.prototype.clear=function(){};var As={native:Ts,null:ks},Ds=0,Os=function(t,e,n){var i=t.display;this.viewport=e,this.visible=Wn(i,t.doc,e),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Be(t),this.force=n,this.dims=wn(t),this.events=[]};Os.prototype.signal=function(t,e){Lt(t,e)&&this.events.push(arguments)},Os.prototype.finish=function(){for(var t=this,e=0;e=0&&F(t,r.to())<=0)return i}return-1};var Ns=function(t,e){this.anchor=t,this.head=e};Ns.prototype.from=function(){return W(this.anchor,this.head)},Ns.prototype.to=function(){return j(this.anchor,this.head)},Ns.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},zr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(t,e){for(var n=this,i=t,r=t+e;i1||!(this.children[0]instanceof zr))){var l=[];this.collapse(l),this.children=[new zr(l)],this.children[0].parent=this}},collapse:function(t){for(var e=this,n=0;n50){for(var s=o.lines.length%25+25,l=s;l10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var i=this,r=0;re.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&yi(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Cr(e.doc)),e&&xe(e,"markerCleared",e,this,r,o),n&&si(e),this.parent&&this.parent.clear()}},Fs.prototype.find=function(t,e){var n=this;null==t&&"bookmark"==this.type&&(t=1);for(var i,r,o=0;o=0;u--)Er(i,r[u]);l?_r(this,l):this.cm&&Xn(this.cm)}),undo:mi(function(){Nr(this,"undo")}),redo:mi(function(){Nr(this,"redo")}),undoSelection:mi(function(){Nr(this,"undo",!0)}),redoSelection:mi(function(){Nr(this,"redo",!0)}),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,i=0;i=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=z(this,t),e=z(this,e);var i=[],r=t.line;return this.iter(t.line,e.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var t=[];return this.iter(function(e){var n=e.markedSpans;if(n)for(var i=0;it?(e=t,!0):(t-=o,void++n)}),z(this,I(n,e))},indexFromPos:function(t){t=z(this,t);var e=t.ch;if(t.linee&&(e=t.from),null!=t.to&&t.to0)r=new I(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),I(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var a=A(t.doc,r.line-1).text;a&&(r=new I(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),I(r.line-1,a.length-1),r,"+transpose"))}n.push(new Ns(r,r))}t.setSelections(n)})},newlineAndIndent:function(t){return pi(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;it&&0==F(e,this.pos)&&n==this.button};var Js,Qs,tl={toString:function(){return"CodeMirror.Init"}},el={},nl={};Go.defaults=el,Go.optionHandlers=nl;var il=[];Go.defineInitHook=function(t){return il.push(t)};var rl=null,ol=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $a,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ol.prototype.init=function(t){function e(t){if(!Dt(r,t)){if(r.somethingSelected())Jo({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=na(r);Jo({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation(function(){r.setSelections(e.ranges,0,Xa),r.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=rl.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var a=ra(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=rl.text.join("\n");var l=document.activeElement;za(s),setTimeout(function(){r.display.lineSpace.removeChild(a),l.focus(),l==o&&i.showPrimarySelection()},50)}}var n=this,i=this,r=i.cm,o=i.div=t.lineDiv;ia(o,r.options.spellcheck),os(o,"paste",function(t){Dt(r,t)||ta(t,r)||Sa<=11&&setTimeout(gi(r,function(){return n.updateFromDOM()}),20)}),os(o,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),os(o,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),os(o,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),os(o,"touchstart",function(){return i.forceCompositionEnd()}),os(o,"input",function(){n.composing||n.readFromDOMSoon()}),os(o,"copy",e),os(o,"cut",e)},ol.prototype.prepareSelection=function(){var t=On(this.cm,!1);return t.focus=this.cm.state.focused,t},ol.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},ol.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ol.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||r.line=e.display.viewFrom&&la(e,i)||{node:s[0].measure.map[2],offset:0},u=r.linet.firstLine()&&(i=I(i.line-1,A(t.doc,i.line-1).length)),r.ch==A(t.doc,r.line).text.length&&r.linee.viewTo-1)return!1;var o,a,s;i.line==e.viewFrom||0==(o=An(t,i.line))?(a=E(e.view[0].line),s=e.view[0].node):(a=E(e.view[o].line),s=e.view[o-1].node.nextSibling);var l,u,c=An(t,r.line);if(c==e.view.length-1?(l=e.viewTo-1,u=e.lineDiv.lastChild):(l=E(e.view[c+1].line)-1,u=e.view[c+1].node.previousSibling),!s)return!1;for(var d=t.doc.splitLines(da(t,s,u,a,l)),h=D(t.doc,I(a,0),I(l,A(t.doc,l).text.length));d.length>1&&h.length>1;)if(g(d)==g(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),a++}for(var f=0,p=0,v=d[0],m=h[0],y=Math.min(v.length,m.length);fi.ch&&b.charCodeAt(b.length-p-1)==_.charCodeAt(_.length-p-1);)f--,p++;d[d.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=I(a,f),S=I(l,h.length?g(h).length-p:0);return d.length>1||d[0]||F(w,S)?(Rr(t.doc,d,w,S,"+input"),!0):void 0},ol.prototype.ensurePolled=function(){this.forceCompositionEnd()},ol.prototype.reset=function(){this.forceCompositionEnd()},ol.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ol.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},ol.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||pi(this.cm,function(){return yi(t.cm)})},ol.prototype.setUneditable=function(t){t.contentEditable="false"},ol.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||gi(this.cm,Qo)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},ol.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},ol.prototype.onContextMenu=function(){},ol.prototype.resetPosition=function(){},ol.prototype.needsContentAttribute=!0;var al=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new $a,this.hasSelection=!1,this.composing=null};al.prototype.init=function(t){function e(t){if(!Dt(r,t)){if(r.somethingSelected())Jo({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=na(r);Jo({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,Xa):(i.prevInput="",o.value=e.text.join("\n"),za(o))}"cut"==t.type&&(r.state.cutIncoming=!0)}}var n=this,i=this,r=this.cm;this.createField(t);var o=this.textarea;t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),Ea&&(o.style.width="0px"),os(o,"input",function(){wa&&Sa>=9&&n.hasSelection&&(n.hasSelection=null),i.poll()}),os(o,"paste",function(t){Dt(r,t)||ta(t,r)||(r.state.pasteIncoming=!0,i.fastPoll())}),os(o,"cut",e),os(o,"copy",e),os(t.scroller,"paste",function(e){Fe(t,e)||Dt(r,e)||(r.state.pasteIncoming=!0,i.focus())}),os(t.lineSpace,"selectstart",function(e){Fe(t,e)||Mt(e)}),os(o,"compositionstart",function(){var t=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}}),os(o,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},al.prototype.createField=function(t){this.wrapper=ra(),this.textarea=this.wrapper.firstChild},al.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=On(t);if(t.options.moveInputWithCursor){var r=cn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},al.prototype.showSelection=function(t){var e=this.cm,i=e.display;n(i.cursorDiv,t.cursors),n(i.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},al.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&za(this.textarea),wa&&Sa>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",wa&&Sa>=9&&(this.hasSelection=null))}},al.prototype.getField=function(){return this.textarea},al.prototype.supportsTouch=function(){return!1},al.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Na||a()!=this.textarea))try{this.textarea.focus()}catch(t){}},al.prototype.blur=function(){this.textarea.blur()},al.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},al.prototype.receivedFocus=function(){this.slowPoll()},al.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},al.prototype.fastPoll=function(){function t(){var i=n.poll();i||e?(n.pollingFast=!1,n.slowPoll()):(e=!0,n.polling.set(60,t))}var e=!1,n=this;n.pollingFast=!0,n.polling.set(20,t)},al.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||ls(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(wa&&Sa>=9&&this.hasSelection===r||Pa&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(i.length,r.length);a1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},al.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},al.prototype.onKeyPress=function(){wa&&Sa>=9&&(this.hasSelection=null),this.fastPoll()},al.prototype.onContextMenu=function(t){function e(){if(null!=a.selectionStart){var t=r.somethingSelected(),e="​"+(t?a.value:"");a.value="⇚",a.value=e,i.prevInput=t?"":"​",a.selectionStart=1,a.selectionEnd=e.length,o.selForContextMenu=r.doc.sel}}function n(){if(i.contextMenuPending==n&&(i.contextMenuPending=!1,i.wrapper.style.cssText=d,a.style.cssText=c,wa&&Sa<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=a.selectionStart)){(!wa||wa&&Sa<9)&&e();var t=0,s=function(){o.selForContextMenu==r.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==i.prevInput?gi(r,Or)(r):t++<10?o.detectingSelectAll=setTimeout(s,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(s,200)}}var i=this,r=i.cm,o=r.display,a=i.textarea;i.contextMenuPending&&i.contextMenuPending();var s=kn(r,t),l=o.scroller.scrollTop;if(s&&!Aa){var u=r.options.resetSelectionOnContextMenu;u&&r.doc.sel.contains(s)==-1&&gi(r,xr)(r.doc,Bi(s),Xa);var c=a.style.cssText,d=i.wrapper.style.cssText,h=i.wrapper.offsetParent.getBoundingClientRect();i.wrapper.style.cssText="position: static",a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-h.top-5)+"px; left: "+(t.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(wa?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(Ca&&(f=window.scrollY),o.input.focus(),Ca&&window.scrollTo(null,f),o.input.reset(),r.somethingSelected()||(a.value=i.prevInput=" "),i.contextMenuPending=n,o.selForContextMenu=r.doc.sel,clearTimeout(o.detectingSelectAll),wa&&Sa>=9&&e(),Wa){It(t);var p=function(){kt(window,"mouseup",p),setTimeout(n,20)};os(window,"mouseup",p)}else setTimeout(n,50)}},al.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},al.prototype.setUneditable=function(){},al.prototype.needsContentAttribute=!1,qo(Go),oa(Go);var sl="iter insert remove copy getEditor constructor".split(" ");for(var ll in js.prototype)js.prototype.hasOwnProperty(ll)&&h(sl,ll)<0&&(Go.prototype[ll]=function(t){return function(){return t.apply(this.doc,arguments)}}(js.prototype[ll]));return Et(js),Go.inputStyles={textarea:al,contenteditable:ol},Go.defineMode=function(t){Go.defaults.mode||"null"==t||(Go.defaults.mode=t),Bt.apply(this,arguments)},Go.defineMIME=zt,Go.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Go.defineMIME("text/plain","null"),Go.defineExtension=function(t,e){Go.prototype[t]=e},Go.defineDocExtension=function(t,e){js.prototype[t]=e},Go.fromTextArea=pa,ga(Go),Go.version="5.42.2",Go})},function(t,e,n){var i=n(195),r=n(214),o=r(function(t,e,n){i(t,e,n)});t.exports=o},function(t,e,n){function i(t,e,n,d,h){t!==e&&a(e,function(a,u){if(l(a))h||(h=new r),s(t,e,u,n,i,d,h);else{var f=d?d(c(t,u),a,u+"",t,e,h):void 0;void 0===f&&(f=a),o(t,u,f)}},u)}var r=n(63),o=n(196),a=n(24),s=n(197),l=n(53),u=n(211),c=n(207);t.exports=i},function(t,e,n){function i(t,e,n){(void 0===n||o(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}var r=n(151),o=n(68);t.exports=i},function(t,e,n){function i(t,e,n,i,b,_,x){var w=m(t,n),S=m(e,n),C=x.get(S);if(C)return void r(t,n,C);var T=_?_(w,S,n+"",t,e,x):void 0,k=void 0===T;if(k){var A=c(S),D=!A&&h(S),O=!A&&!D&&v(S);T=S,A||D||O?c(w)?T=w:d(w)?T=s(w):D?(k=!1,T=o(S,!0)):O?(k=!1,T=a(S,!0)):T=[]:g(S)||u(S)?(T=w,u(w)?T=y(w):p(w)&&!f(w)||(T=l(S))):k=!1}k&&(x.set(S,T),b(T,S,i,_,x),x.delete(S)),r(t,n,T)}var r=n(196),o=n(198),a=n(199),s=n(201),l=n(202),u=n(29),c=n(38),d=n(205),h=n(39),f=n(52),p=n(53),g=n(206),v=n(42),m=n(207),y=n(208);t.exports=i},function(t,e,n){(function(t){function i(t,e){if(e)return t.slice();var n=t.length,i=u?u(n):new t.constructor(n);return t.copy(i),i}var r=n(33),o="object"==typeof e&&e&&!e.nodeType&&e,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o,l=s?r.Buffer:void 0,u=l?l.allocUnsafe:void 0;t.exports=i}).call(e,n(5)(t))},function(t,e,n){function i(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var r=n(200);t.exports=i},function(t,e,n){function i(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}var r=n(108);t.exports=i},function(t,e){function n(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(r--,a):void 0,s&&o(n[0],n[1],s)&&(a=r<3?void 0:a,r=1),e=Object(e);++i0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var i=800,r=16,o=Date.now;t.exports=n},function(t,e,n){function i(t,e,n){if(!s(n))return!1;var i=typeof e;return!!("number"==i?o(n)&&a(e,n.length):"string"==i&&e in n)&&r(n[e],t)}var r=n(68),o=n(51),a=n(41),s=n(53);t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryQuery=void 0;var r=n(148),o=i(r),a={_data_paths:{},_packet:null,_fields:[],_querying:!1,_validation_errors:{},_tlm_dict:null,oninit:function(t){var e=this;m.request({method:"GET",url:"/data"}).then(function(t){e._data_paths=t}),ait.tlm.promise.then(function(){"packet"in t.attrs&&(e._packet=t.attrs.packet)})},view:function(t){var e=this,n=void 0;"data-dir"in t.attrs?n=m("input",{type:"hidden",name:"dataDir",value:t.attrs["data-dir"]}):(n=m("div",{class:"form-group"},[m("label","Data Directory"),m("select",{class:"form-control",name:"dataDir"},[m("option",{disabled:"disabled",selected:"selected"},"Select an option ...")].concat((0,o.default)(Object.keys(this._data_paths),function(t){return m("option",{value:t},t+": "+e._data_paths[t])}))),m("p",{class:"help-block"},"The archive data directory containing the relevant telemetry data over which to search")]),this._validation_errors.dataDir&&(n.attrs.className+=" has-error"));var i=void 0;i="packet"in t.attrs?m("input",{type:"hidden",name:"packet",value:t.attrs.packet}):m("div",{class:"form-group"},[m("label","Telemetry Packet"),m("select",{class:"form-control",name:"packet",onchange:function(t){e._packet=t.currentTarget.value}},[m("option",{disabled:"disabled",selected:"selected"},"Select an option ...")].concat((0,o.default)(Object.keys(ait.tlm.dict),function(t){return m("option",{value:t},t)}))),m("p",{class:"help-block"},"The telemetry packet that contains the fields to be queried")]),this._validation_errors.packet&&(i.attrs.className+=" has-error");var r=null;r=null===this._packet?[]:[m("option",{disabled:"disabled",selected:"selected",value:"bogusDefaultSelectOption"},"Select an option ...")].concat((0,o.default)(Object.keys(ait.tlm.dict[this._packet].fields).sort(),function(t){return m("option",{value:t},t)}));var a=void 0;"time-field"in t.attrs?a=m("input",{type:"hidden",name:"timeField",value:t.attrs["time-field"]}):(a=m("div",{class:"form-group"},[m("label","Telemetry Time Field"),m("select",{class:"form-control",name:"timeField"},r),m("p",{class:"help-block"},"Select and add the telemetry time field to use as a basis for the query")]),this._validation_errors.timeField&&(a.attrs.className+=" has-error"));var s=m("div",{class:"form-group"},[m("label","Telemetry Fields"),m("div",{class:"input-group"},m("select",{class:"form-control",name:"fields"},r),m("div",{class:"input-group-btn"},m("button",{class:"btn btn-default",type:"button",onmousedown:function(t){t.preventDefault();var n=t.currentTarget.parentElement.parentElement.children[0];e._fields.push(n.value),n.value="bogusDefaultSelectOption"}},"Add"))),m("p",{class:"help-block"},"Select and add the telemetry field(s) to query")]);this._validation_errors.fields&&(s.attrs.className+=" has-error");var l=m("span");0!==this._fields.length&&(l=m("div",{class:"form-group"},[m("label","Fields selected for query"),m("div",{class:"field_selection"},(0,o.default)(this._fields,function(t,n){return m("div",{class:"label label-default field_label",onmouseover:function(t){t.currentTarget.classList.add("label-danger")},onmouseout:function(t){t.currentTarget.classList.remove("label-danger")},onclick:function(t){e._fields.splice(n,1)}},t)})),m("p",{class:"help-block"},"The telemetry points that will be filtered from the selected data")]));var u=m("div",{class:"form-group"},[m("label","Start Time"),m("input",{class:"form-control",placeholder:"Start time YYYY-MM-DDTHH:MM:SSZ",name:"startTime"}),m("p",{class:"help-block"},"Start time for data filtering. Expected format: YYYY-MM-DDTHH:MM:SSZ")]);this._validation_errors.startTime&&(u.attrs.className+=" has-error");var c=m("div",{class:"form-group"},[m("label","End Time"),m("input",{class:"form-control",placeholder:"End time YYYY-MM-DDTHH:MM:SSZ",name:"endTime"}),m("p",{class:"help-block"},"End time for data filtering. Expected format: YYYY-MM-DDTHH:MM:SSZ")]);this._validation_errors.endTime&&(c.attrs.className+=" has-error");var d="Query",h={class:"btn btn-success pull-right",type:"submit"};this._querying&&(d=m("span",{class:"glyphicon glyphicon-refresh right-spin"}),h.disabled="disabled");var f=m("button",h,d),p=m("form",{onsubmit:function(n){n.preventDefault();var i=new FormData,r=n.currentTarget;return!!e._validate_form(r)&&(i.append("dataDir",e._data_paths[r.elements.dataDir.value]),i.append("timeField",r.elements.timeField.value),i.append("packet",r.elements.packet.value),i.append("fields",e._fields),i.append("startTime",r.elements.startTime.value),i.append("endTime",r.elements.endTime.value),e._querying=!0,m.request({url:"/tlm/query",method:"POST",data:i,extract:function(t){return t}}).then(function(n){e._querying=!1;var i=new Blob([n.response]),o=document.createElement("a");o.href=window.URL.createObjectURL(i),o.download="query_output.csv",o.click(),r.reset(),"data-dir"in t.attrs||(r.elements.dataDir.selectedIndex=0),"packet"in t.attrs?r.elements.fields.selectedIndex=0:(r.elements.packet.selectedIndex=0,e._packet=null),"time-field"in t.attrs||(r.elements.timeField.selectedIndex=-1),e._fields=[]}).catch(function(t){e._querying=!1}),!1)}},[n,i,a,s,l,u,c,f]);return m("ait-telemetryquery",t.attrs,p)},_validate_form:function(t){this._validation_errors={},0===t.elements.dataDir.selectedIndex&&(this._validation_errors.dataDir=!0),0===t.elements.packet.selectedIndex&&(this._validation_errors.packet=!0),t.elements.timeField.selectedIndex!==-1&&0!==t.elements.timeField.selectedIndex||(this._validation_errors.timeField=!0),0===this._fields.length&&(this._validation_errors.fields=!0);var e=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\dZ/;return e.test(t.elements.startTime.value)||(this._validation_errors.startTime=!0),e.test(t.elements.endTime.value)||(this._validation_errors.endTime=!0),0===Object.keys(this._validation_errors).length}};e.default={TelemetryQuery:a},e.TelemetryQuery=a},function(t,e,n){(function(t){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MnemonicSearch=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=n(148),s=r(a),l=n(225),u=r(l),c=n(13),d=i(c),h=(n(191),n(160)),f=(r(h),n(16)),p=(r(f),n(158),n(159)),g={_packet:null,_selection:null,oninit:function(t){this._packet=t.attrs.packet,ait.tlm.search={dict:{}}},oncreate:function(e){var n=this;ait.tlm.promise.then(function(i){(0,u.default)(e.attrs,{"result-count":20});var r=function(t){return t?t.split("_"):[]};ait.tlm.search.dict=new p({datumTokenizer:r,queryTokenizer:r,local:(0,s.default)(i[n._packet].fields,function(t,e){return t.name}).sort()}),t('input[name="tlmsearch"]',e.dom).typeahead({highlight:!0},{name:"tlm-mnemonics",limit:e.attrs["result-count"],source:ait.tlm.search.dict}).bind("typeahead:select",function(i,r){n._selection=r,i.target.blur(),t('input[name="tlmsearch"]',e.dom).typeahead("val",""),ait.events.emit("modal:show",n._generateModalContent()),m.redraw()}).bind("typeahead:autocomplete",function(i,r){n._selection=r,i.target.blur(),t('input[name="tlmsearch"]',e.dom).typeahead("val",""),ait.events.emit("modal:show",n._generateModalContent()),m.redraw()}).bind("typeahead:close",function(n,i){n.target.blur(),t('input[name="tlmsearch"]',e.dom).typeahead("val",""),m.redraw()})})},_generateModalContent:function(){var t=this,e="N/A",n="N/A",i="N/A",r=d.datetime(new Date,{utc:!0,gps:!1}),a=ait.packets[this._packet]?ait.packets[this._packet].get(0):null;null!==a&&(i=this._selection in a.dntoeu,e=getFieldTyoe(a,!i),e=e[this._selection],n=a.raw[this._selection]);var l={},u=ait.tlm.dict[this._packet]._fields,c=ait.limits.dict[this._packet+"."+this._selection];if(this._selection in u){var h=u[this._selection];l.header=h.name,l.body=[];var f=h.desc?h.desc:"None";l.body.push(m("div",[m("b","Description: "),f,m("br")]));var p=h.type?h.type._name:"Unknown";l.body.push(m("div",[m("b","Data Type: "),p,m("br")]));var g="object"==o(h.bytes)?h.bytes[0]+" - "+h.bytes[1]:h.bytes;l.body.push(m("div",[m("b","Byte(s) in Packet: "),g,m("br")]));var v=h.mask?h.mask:"None";if(l.body.push(m("div",[m("b","Bit Mask: "),v,m("br")])),h.enum&&l.body.push(m("div",[m("b","Enumerated Values: "),(0,s.default)(h.enum,function(t,e){return m("div",[m("b"," "+e+": "),m("span",t),m("br")])})])),h.dntoeu&&l.body.push(m("div",[m("b","DN-to-EU: "),(0,s.default)(h.dntoeu,function(t,e){return m("div",[m("b"," "+e+": "),m("span",t),m("br")])})])),h.aliases&&l.body.push(m("div",[m("b","Aliases: "),(0,s.default)(h.aliases,function(t,e){return m("div",[m("b"," "+e+": "),m("span",t),m("br")])})])),c){var y=[];if(c.value)for(var b=["warn","error"],_=0;_2?e[2]:void 0;for(u&&o(e[0],e[1],u)&&(i=1);++nt?"before":"after")},start:function(t,e){t.dataTransfer.effectAllowed="move",this._from=e}},g={_active:0,_drag:null,_pos:[],_uid:[],anchor:function(t,e){var n=this,i={href:"#",class:"",draggable:this.isActive(e),ondragstart:function(t){return n._drag.start(t,e)},ondragend:function(t){return n._drag.end(t,e)}},r=t.attrs.title;return this.tabs&&Object.keys(this.tabs[r].___limit_error).length>0?i.class+=" tab_title--out-of-limit--error":this.tabs&&Object.keys(this.tabs[r].___limit_warning).length>0&&(i.class+=" tab_title--out-of-limit--warning"),(0,s.default)("a",i,t.attrs.title)},content:function(t,e){var n={key:this._uid[e]},i=this.isActive(e)?".tab-pane.active":".tab-pane";return(0,s.default)(i,n,t.children||t.text)},filterTabs:function(t){return t.filter(function(t){return"ait-tab"===t.tag})},isActive:function(t){return t===this._active},move:function(t,e){var n=this;if(t!==e){var i=this._pos.length,r=(0,f.default)(i,function(t){return t===n._active});u.move(this._pos,t,e),u.move(this._uid,t,e),u.move(r,t,e),this._active=r.findIndex(function(t){return t})}},oninit:function(t){var e=this.filterTabs(t.children);this._pos=(0,d.default)(e.length),this._uid=(0,d.default)(e.length),this._drag=Object.create(p)},filterFields:function(t){var e=[];if(!t)return e;var n=!0,i=!1,r=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var l=a.value;l.instance&&l.instance.tag&&"ait-field"===l.instance.tag?e.push(l.attrs.packet+"_"+l.attrs.name):l.children&&"object"===o(l.children)&&l.children.length>0&&(e=e.concat(this.filterFields(l.children)))}}catch(t){i=!0,r=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw r}}return e},oncreate:function(t){var e=this;this.tabs={};var n=!0,i=!1,r=void 0;try{for(var o,a=this.filterTabs(t.children)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=s.attrs.title;this.tabs[l]={___limit_warning:{},___limit_error:{}};var u=!0,c=!1,d=void 0;try{for(var h,f=this.filterFields(s.children)[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var p=h.value;this.tabs[l][p]=null}}catch(t){c=!0,d=t}finally{try{!u&&f.return&&f.return()}finally{if(c)throw d}}}}catch(t){i=!0,r=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw r}}ait.events.on("field:limitOut",function(t){var n=t.field,i="___limit_"+t.type,r="___limit_"+("warning"===t.type?"error":"warning");for(var o in e.tabs)n in e.tabs[o]&&(e.tabs[o][i][n]=null,delete e.tabs[o][r][n])}),ait.events.on("field:limitIn",function(t){for(var n in e.tabs)t in e.tabs[n]&&(delete e.tabs[n].___limit_warning[t],delete e.tabs[n].___limit_error[t])})},reorder:function(t){return this._pos.map(function(e){return t[e]})},tab:function(t,e){var n=this,i=g.move.bind(this),r={class:this.tabClass(e),key:this._uid[e],onclick:function(){return n._active=e,!1},ondragover:function(t){return n._drag.over(t,e)},ondrop:function(t){return n._drag.drop(t,e,i)}};return(0,s.default)("li",r,this.anchor(t,e))},tabClass:function(t){var e="";return this.isActive(t)?e="active":this._drag.isOver(t)&&(e=this._drag.overClass(t)),e},view:function(t){var e=this.reorder(this.filterTabs(t.children));return(0,s.default)("ait-tabset",[(0,s.default)("ul.nav",t.attrs,e.map(g.tab.bind(this))),(0,s.default)(".tab-content",e.map(g.content.bind(this)))])}};e.default=g,e.TabSet=g},function(t,e,n){var i=n(230),r=i();t.exports=r},function(t,e,n){function i(t){return function(e,n,i){return i&&"number"!=typeof i&&o(e,n,i)&&(n=i=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),i=void 0===i?es)return[];var n=l,i=u(t,l);e=o(e),t-=l;for(var c=r(i,e);++n0)r=new I(r.line,r.ch+1),t.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),I(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var a=A(t.doc,r.line-1).text;a&&(r=new I(r.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),I(r.line-1,a.length-1),r,"+transpose"))}n.push(new Ns(r,r))}t.setSelections(n)})},newlineAndIndent:function(t){return pi(t,function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var i=0;it&&0==F(e,this.pos)&&n==this.button};var Js,Qs,tl={toString:function(){return"CodeMirror.Init"}},el={},nl={};Go.defaults=el,Go.optionHandlers=nl;var il=[];Go.defineInitHook=function(t){return il.push(t)};var rl=null,ol=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $a,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ol.prototype.init=function(t){function e(t){if(!Dt(r,t)){if(r.somethingSelected())Jo({lineWise:!1,text:r.getSelections()}),"cut"==t.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var e=na(r);Jo({lineWise:!0,text:e.text}),"cut"==t.type&&r.operation(function(){r.setSelections(e.ranges,0,Xa),r.replaceSelection("",null,"cut")})}if(t.clipboardData){t.clipboardData.clearData();var n=rl.text.join("\n");if(t.clipboardData.setData("Text",n),t.clipboardData.getData("Text")==n)return void t.preventDefault()}var a=ra(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=rl.text.join("\n");var l=document.activeElement;za(s),setTimeout(function(){r.display.lineSpace.removeChild(a),l.focus(),l==o&&i.showPrimarySelection()},50)}}var n=this,i=this,r=i.cm,o=i.div=t.lineDiv;ia(o,r.options.spellcheck),os(o,"paste",function(t){Dt(r,t)||ta(t,r)||Sa<=11&&setTimeout(gi(r,function(){return n.updateFromDOM()}),20)}),os(o,"compositionstart",function(t){n.composing={data:t.data,done:!1}}),os(o,"compositionupdate",function(t){n.composing||(n.composing={data:t.data,done:!1})}),os(o,"compositionend",function(t){n.composing&&(t.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),os(o,"touchstart",function(){return i.forceCompositionEnd()}),os(o,"input",function(){n.composing||n.readFromDOMSoon()}),os(o,"copy",e),os(o,"cut",e)},ol.prototype.prepareSelection=function(){var t=On(this.cm,!1);return t.focus=this.cm.state.focused,t},ol.prototype.showSelection=function(t,e){t&&this.cm.display.view.length&&((t.focus||e)&&this.showPrimarySelection(),this.showMultipleSelections(t))},ol.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},ol.prototype.showPrimarySelection=function(){var t=this.getSelection(),e=this.cm,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(e.display.viewTo==e.display.viewFrom||i.line>=e.display.viewTo||r.line=e.display.viewFrom&&la(e,i)||{node:s[0].measure.map[2],offset:0},u=r.linet.firstLine()&&(i=I(i.line-1,A(t.doc,i.line-1).length)),r.ch==A(t.doc,r.line).text.length&&r.linee.viewTo-1)return!1;var o,a,s;i.line==e.viewFrom||0==(o=An(t,i.line))?(a=E(e.view[0].line),s=e.view[0].node):(a=E(e.view[o].line),s=e.view[o-1].node.nextSibling);var l,u,c=An(t,r.line);if(c==e.view.length-1?(l=e.viewTo-1,u=e.lineDiv.lastChild):(l=E(e.view[c+1].line)-1,u=e.view[c+1].node.previousSibling),!s)return!1;for(var d=t.doc.splitLines(da(t,s,u,a,l)),h=D(t.doc,I(a,0),I(l,A(t.doc,l).text.length));d.length>1&&h.length>1;)if(g(d)==g(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),a++}for(var f=0,p=0,v=d[0],m=h[0],y=Math.min(v.length,m.length);fi.ch&&b.charCodeAt(b.length-p-1)==_.charCodeAt(_.length-p-1);)f--,p++;d[d.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=I(a,f),S=I(l,h.length?g(h).length-p:0);return d.length>1||d[0]||F(w,S)?(Rr(t.doc,d,w,S,"+input"),!0):void 0},ol.prototype.ensurePolled=function(){this.forceCompositionEnd()},ol.prototype.reset=function(){this.forceCompositionEnd()},ol.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ol.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()},80))},ol.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||pi(this.cm,function(){return yi(t.cm)})},ol.prototype.setUneditable=function(t){t.contentEditable="false"},ol.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||gi(this.cm,Qo)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},ol.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},ol.prototype.onContextMenu=function(){},ol.prototype.resetPosition=function(){},ol.prototype.needsContentAttribute=!0;var al=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new $a,this.hasSelection=!1,this.composing=null};al.prototype.init=function(t){function e(t){if(!Dt(r,t)){if(r.somethingSelected())Jo({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=na(r);Jo({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,Xa):(i.prevInput="",o.value=e.text.join("\n"),za(o))}"cut"==t.type&&(r.state.cutIncoming=!0)}}var n=this,i=this,r=this.cm;this.createField(t);var o=this.textarea;t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),Ea&&(o.style.width="0px"),os(o,"input",function(){wa&&Sa>=9&&n.hasSelection&&(n.hasSelection=null),i.poll()}),os(o,"paste",function(t){Dt(r,t)||ta(t,r)||(r.state.pasteIncoming=!0,i.fastPoll())}),os(o,"cut",e),os(o,"copy",e),os(t.scroller,"paste",function(e){Fe(t,e)||Dt(r,e)||(r.state.pasteIncoming=!0,i.focus())}),os(t.lineSpace,"selectstart",function(e){Fe(t,e)||Mt(e)}),os(o,"compositionstart",function(){var t=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}}),os(o,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},al.prototype.createField=function(t){this.wrapper=ra(),this.textarea=this.wrapper.firstChild},al.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,i=On(t);if(t.options.moveInputWithCursor){var r=cn(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},al.prototype.showSelection=function(t){var e=this.cm,i=e.display;n(i.cursorDiv,t.cursors),n(i.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},al.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&za(this.textarea),wa&&Sa>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",wa&&Sa>=9&&(this.hasSelection=null))}},al.prototype.getField=function(){return this.textarea},al.prototype.supportsTouch=function(){return!1},al.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Na||a()!=this.textarea))try{this.textarea.focus()}catch(t){}},al.prototype.blur=function(){this.textarea.blur()},al.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},al.prototype.receivedFocus=function(){this.slowPoll()},al.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){t.poll(),t.cm.state.focused&&t.slowPoll()})},al.prototype.fastPoll=function(){function t(){var i=n.poll();i||e?(n.pollingFast=!1,n.slowPoll()):(e=!0,n.polling.set(60,t))}var e=!1,n=this;n.pollingFast=!0,n.polling.set(20,t)},al.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!e.state.focused||ls(n)&&!i&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==i&&!e.somethingSelected())return!1;if(wa&&Sa>=9&&this.hasSelection===r||Pa&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,s=Math.min(i.length,r.length);a1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},al.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},al.prototype.onKeyPress=function(){wa&&Sa>=9&&(this.hasSelection=null),this.fastPoll()},al.prototype.onContextMenu=function(t){function e(){if(null!=a.selectionStart){var t=r.somethingSelected(),e="​"+(t?a.value:"");a.value="⇚",a.value=e,i.prevInput=t?"":"​",a.selectionStart=1,a.selectionEnd=e.length,o.selForContextMenu=r.doc.sel}}function n(){if(i.contextMenuPending==n&&(i.contextMenuPending=!1,i.wrapper.style.cssText=d,a.style.cssText=c,wa&&Sa<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=a.selectionStart)){(!wa||wa&&Sa<9)&&e();var t=0,s=function(){o.selForContextMenu==r.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==i.prevInput?gi(r,Or)(r):t++<10?o.detectingSelectAll=setTimeout(s,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(s,200)}}var i=this,r=i.cm,o=r.display,a=i.textarea;i.contextMenuPending&&i.contextMenuPending();var s=kn(r,t),l=o.scroller.scrollTop;if(s&&!Aa){var u=r.options.resetSelectionOnContextMenu;u&&r.doc.sel.contains(s)==-1&&gi(r,xr)(r.doc,Bi(s),Xa);var c=a.style.cssText,d=i.wrapper.style.cssText,h=i.wrapper.offsetParent.getBoundingClientRect();i.wrapper.style.cssText="position: static",a.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-h.top-5)+"px; left: "+(t.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(wa?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var f;if(Ca&&(f=window.scrollY),o.input.focus(),Ca&&window.scrollTo(null,f),o.input.reset(),r.somethingSelected()||(a.value=i.prevInput=" "),i.contextMenuPending=n,o.selForContextMenu=r.doc.sel,clearTimeout(o.detectingSelectAll),wa&&Sa>=9&&e(),Wa){It(t);var p=function(){kt(window,"mouseup",p),setTimeout(n,20)};os(window,"mouseup",p)}else setTimeout(n,50)}},al.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t},al.prototype.setUneditable=function(){},al.prototype.needsContentAttribute=!1,qo(Go),oa(Go);var sl="iter insert remove copy getEditor constructor".split(" ");for(var ll in js.prototype)js.prototype.hasOwnProperty(ll)&&h(sl,ll)<0&&(Go.prototype[ll]=function(t){return function(){return t.apply(this.doc,arguments)}}(js.prototype[ll]));return Et(js),Go.inputStyles={textarea:al,contenteditable:ol},Go.defineMode=function(t){Go.defaults.mode||"null"==t||(Go.defaults.mode=t),Bt.apply(this,arguments)},Go.defineMIME=zt,Go.defineMode("null",function(){return{token:function(t){return t.skipToEnd()}}}),Go.defineMIME("text/plain","null"),Go.defineExtension=function(t,e){Go.prototype[t]=e},Go.defineDocExtension=function(t,e){js.prototype[t]=e},Go.fromTextArea=pa,ga(Go),Go.version="5.42.2",Go})},function(t,e,n){var i=n(195),r=n(214),o=r(function(t,e,n){i(t,e,n)});t.exports=o},function(t,e,n){function i(t,e,n,d,h){t!==e&&a(e,function(a,u){if(l(a))h||(h=new r),s(t,e,u,n,i,d,h);else{var f=d?d(c(t,u),a,u+"",t,e,h):void 0;void 0===f&&(f=a),o(t,u,f)}},u)}var r=n(63),o=n(196),a=n(24),s=n(197),l=n(53),u=n(211),c=n(207);t.exports=i},function(t,e,n){function i(t,e,n){(void 0===n||o(t[e],n))&&(void 0!==n||e in t)||r(t,e,n)}var r=n(151),o=n(68);t.exports=i},function(t,e,n){function i(t,e,n,i,b,_,x){var w=m(t,n),S=m(e,n),C=x.get(S);if(C)return void r(t,n,C);var T=_?_(w,S,n+"",t,e,x):void 0,k=void 0===T;if(k){var A=c(S),D=!A&&h(S),O=!A&&!D&&v(S);T=S,A||D||O?c(w)?T=w:d(w)?T=s(w):D?(k=!1,T=o(S,!0)):O?(k=!1,T=a(S,!0)):T=[]:g(S)||u(S)?(T=w,u(w)?T=y(w):p(w)&&!f(w)||(T=l(S))):k=!1}k&&(x.set(S,T),b(T,S,i,_,x),x.delete(S)),r(t,n,T)}var r=n(196),o=n(198),a=n(199),s=n(201),l=n(202),u=n(29),c=n(38),d=n(205),h=n(39),f=n(52),p=n(53),g=n(206),v=n(42),m=n(207),y=n(208);t.exports=i},function(t,e,n){(function(t){function i(t,e){if(e)return t.slice();var n=t.length,i=u?u(n):new t.constructor(n);return t.copy(i),i}var r=n(33),o="object"==typeof e&&e&&!e.nodeType&&e,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o,l=s?r.Buffer:void 0,u=l?l.allocUnsafe:void 0;t.exports=i}).call(e,n(5)(t))},function(t,e,n){function i(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var r=n(200);t.exports=i},function(t,e,n){function i(t){var e=new t.constructor(t.byteLength);return new r(e).set(new r(t)),e}var r=n(108);t.exports=i},function(t,e){function n(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(r--,a):void 0,s&&o(n[0],n[1],s)&&(a=r<3?void 0:a,r=1),e=Object(e);++i0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var i=800,r=16,o=Date.now;t.exports=n},function(t,e,n){function i(t,e,n){if(!s(n))return!1;var i=typeof e;return!!("number"==i?o(n)&&a(e,n.length):"string"==i&&e in n)&&r(n[e],t)}var r=n(68),o=n(51),a=n(41),s=n(53);t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryQuery=void 0;var r=n(148),o=i(r),a={_data_paths:{},_packet:null,_fields:[],_querying:!1,_validation_errors:{},_tlm_dict:null,oninit:function(t){var e=this;m.request({method:"GET",url:"/data"}).then(function(t){e._data_paths=t}),ait.tlm.promise.then(function(){"packet"in t.attrs&&(e._packet=t.attrs.packet)})},view:function(t){var e=this,n=void 0;"data-dir"in t.attrs?n=m("input",{type:"hidden",name:"dataDir",value:t.attrs["data-dir"]}):(n=m("div",{class:"form-group"},[m("label","Data Directory"),m("select",{class:"form-control",name:"dataDir"},[m("option",{disabled:"disabled",selected:"selected"},"Select an option ...")].concat((0,o.default)(Object.keys(this._data_paths),function(t){return m("option",{value:t},t+": "+e._data_paths[t])}))),m("p",{class:"help-block"},"The archive data directory containing the relevant telemetry data over which to search")]),this._validation_errors.dataDir&&(n.attrs.className+=" has-error"));var i=void 0;i="packet"in t.attrs?m("input",{type:"hidden",name:"packet",value:t.attrs.packet}):m("div",{class:"form-group"},[m("label","Telemetry Packet"),m("select",{class:"form-control",name:"packet",onchange:function(t){e._packet=t.currentTarget.value}},[m("option",{disabled:"disabled",selected:"selected"},"Select an option ...")].concat((0,o.default)(Object.keys(ait.tlm.dict),function(t){return m("option",{value:t},t)}))),m("p",{class:"help-block"},"The telemetry packet that contains the fields to be queried")]),this._validation_errors.packet&&(i.attrs.className+=" has-error");var r=null;r=null===this._packet?[]:[m("option",{disabled:"disabled",selected:"selected",value:"bogusDefaultSelectOption"},"Select an option ...")].concat((0,o.default)(Object.keys(ait.tlm.dict[this._packet].fields).sort(),function(t){return m("option",{value:t},t)}));var a=void 0;"time-field"in t.attrs?a=m("input",{type:"hidden",name:"timeField",value:t.attrs["time-field"]}):(a=m("div",{class:"form-group"},[m("label","Telemetry Time Field"),m("select",{class:"form-control",name:"timeField"},r),m("p",{class:"help-block"},"Select and add the telemetry time field to use as a basis for the query")]),this._validation_errors.timeField&&(a.attrs.className+=" has-error"));var s=m("div",{class:"form-group"},[m("label","Telemetry Fields"),m("div",{class:"input-group"},m("select",{class:"form-control",name:"fields"},r),m("div",{class:"input-group-btn"},m("button",{class:"btn btn-default",type:"button",onmousedown:function(t){t.preventDefault();var n=t.currentTarget.parentElement.parentElement.children[0];e._fields.push(n.value),n.value="bogusDefaultSelectOption"}},"Add"))),m("p",{class:"help-block"},"Select and add the telemetry field(s) to query")]);this._validation_errors.fields&&(s.attrs.className+=" has-error");var l=m("span");0!==this._fields.length&&(l=m("div",{class:"form-group"},[m("label","Fields selected for query"),m("div",{class:"field_selection"},(0,o.default)(this._fields,function(t,n){return m("div",{class:"label label-default field_label",onmouseover:function(t){t.currentTarget.classList.add("label-danger")},onmouseout:function(t){t.currentTarget.classList.remove("label-danger")},onclick:function(t){e._fields.splice(n,1)}},t)})),m("p",{class:"help-block"},"The telemetry points that will be filtered from the selected data")]));var u=m("div",{class:"form-group"},[m("label","Start Time"),m("input",{class:"form-control",placeholder:"Start time YYYY-MM-DDTHH:MM:SSZ",name:"startTime"}),m("p",{class:"help-block"},"Start time for data filtering. Expected format: YYYY-MM-DDTHH:MM:SSZ")]);this._validation_errors.startTime&&(u.attrs.className+=" has-error");var c=m("div",{class:"form-group"},[m("label","End Time"),m("input",{class:"form-control",placeholder:"End time YYYY-MM-DDTHH:MM:SSZ",name:"endTime"}),m("p",{class:"help-block"},"End time for data filtering. Expected format: YYYY-MM-DDTHH:MM:SSZ")]);this._validation_errors.endTime&&(c.attrs.className+=" has-error");var d="Query",h={class:"btn btn-success pull-right",type:"submit"};this._querying&&(d=m("span",{class:"glyphicon glyphicon-refresh right-spin"}),h.disabled="disabled");var f=m("button",h,d),p=m("form",{onsubmit:function(n){n.preventDefault();var i=new FormData,r=n.currentTarget;return!!e._validate_form(r)&&(i.append("dataDir",e._data_paths[r.elements.dataDir.value]),i.append("timeField",r.elements.timeField.value),i.append("packet",r.elements.packet.value),i.append("fields",e._fields),i.append("startTime",r.elements.startTime.value),i.append("endTime",r.elements.endTime.value),e._querying=!0,m.request({url:"/tlm/query",method:"POST",data:i,extract:function(t){return t}}).then(function(n){e._querying=!1;var i=new Blob([n.response]),o=document.createElement("a");o.href=window.URL.createObjectURL(i),o.download="query_output.csv",o.click(),r.reset(),"data-dir"in t.attrs||(r.elements.dataDir.selectedIndex=0),"packet"in t.attrs?r.elements.fields.selectedIndex=0:(r.elements.packet.selectedIndex=0,e._packet=null),"time-field"in t.attrs||(r.elements.timeField.selectedIndex=-1),e._fields=[]}).catch(function(t){e._querying=!1}),!1)}},[n,i,a,s,l,u,c,f]);return m("ait-telemetryquery",t.attrs,p)},_validate_form:function(t){this._validation_errors={},0===t.elements.dataDir.selectedIndex&&(this._validation_errors.dataDir=!0),0===t.elements.packet.selectedIndex&&(this._validation_errors.packet=!0),t.elements.timeField.selectedIndex!==-1&&0!==t.elements.timeField.selectedIndex||(this._validation_errors.timeField=!0),0===this._fields.length&&(this._validation_errors.fields=!0);var e=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\dZ/;return e.test(t.elements.startTime.value)||(this._validation_errors.startTime=!0),e.test(t.elements.endTime.value)||(this._validation_errors.endTime=!0),0===Object.keys(this._validation_errors).length}};e.default={TelemetryQuery:a},e.TelemetryQuery=a},function(t,e,n){(function(t){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.MnemonicSearch=void 0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=n(148),s=r(a),l=n(225),u=r(l),c=n(13),d=i(c),h=n(191),f=n(160),p=(r(f),n(16)),g=(r(p),n(158),n(159)),v={_packet:null,_selection:null,oninit:function(t){this._packet=t.attrs.packet,ait.tlm.search={dict:{}}},oncreate:function(e){var n=this;ait.tlm.promise.then(function(i){(0,u.default)(e.attrs,{"result-count":20});var r=function(t){return t?t.split("_"):[]};ait.tlm.search.dict=new g({datumTokenizer:r,queryTokenizer:r,local:(0,s.default)(i[n._packet].fields,function(t,e){return t.name}).sort()}),t('input[name="tlmsearch"]',e.dom).typeahead({highlight:!0},{name:"tlm-mnemonics",limit:e.attrs["result-count"],source:ait.tlm.search.dict}).bind("typeahead:select",function(i,r){n._selection=r,i.target.blur(),t('input[name="tlmsearch"]',e.dom).typeahead("val",""),ait.events.emit("modal:show",n._generateModalContent()),m.redraw()}).bind("typeahead:autocomplete",function(i,r){n._selection=r,i.target.blur(),t('input[name="tlmsearch"]',e.dom).typeahead("val",""),ait.events.emit("modal:show",n._generateModalContent()),m.redraw()}).bind("typeahead:close",function(n,i){n.target.blur(),t('input[name="tlmsearch"]',e.dom).typeahead("val",""),m.redraw()})})},_generateModalContent:function(){var t=this,e="N/A",n="N/A",i="N/A",r=d.datetime(new Date,{utc:!0,gps:!1}),a=ait.packets[this._packet]?ait.packets[this._packet].get(0):null;null!==a&&(i=this._selection in a.dntoeu,e=(0,h.getFieldType)(a,!i),e=e[this._selection],n=a.raw[this._selection]);var l={},u=ait.tlm.dict[this._packet]._fields,c=ait.limits.dict[this._packet+"."+this._selection];if(this._selection in u){var f=u[this._selection];l.header=f.name,l.body=[];var p=f.desc?f.desc:"None";l.body.push(m("div",[m("b","Description: "),p,m("br")]));var g=f.type?f.type._name:"Unknown";l.body.push(m("div",[m("b","Data Type: "),g,m("br")]));var v="object"==o(f.bytes)?f.bytes[0]+" - "+f.bytes[1]:f.bytes;l.body.push(m("div",[m("b","Byte(s) in Packet: "),v,m("br")]));var y=f.mask?f.mask:"None";if(l.body.push(m("div",[m("b","Bit Mask: "),y,m("br")])),f.enum&&l.body.push(m("div",[m("b","Enumerated Values: "),(0,s.default)(f.enum,function(t,e){return m("div",[m("b"," "+e+": "),m("span",t),m("br")])})])),f.dntoeu&&l.body.push(m("div",[m("b","DN-to-EU: "),(0,s.default)(f.dntoeu,function(t,e){return m("div",[m("b"," "+e+": "),m("span",t),m("br")])})])),f.aliases&&l.body.push(m("div",[m("b","Aliases: "),(0,s.default)(f.aliases,function(t,e){return m("div",[m("b"," "+e+": "),m("span",t),m("br")])})])),c){var b=[];if(c.value)for(var _=["warn","error"],x=0;x<_.length;x++){ +var w=_[x];if(w in c.value){b.push(m("div",[m("b"," "+w+":"),m("br")]));var S="object"===o(c.value[w])?c.value[w]:[c.value[w]],C=!0,T=!1,k=void 0;try{for(var A,D=S[Symbol.iterator]();!(C=(A=D.next()).done);C=!0){var O=A.value;b.push(m("div",[m("span","  "+O),m("br")]))}}catch(t){T=!0,k=t}finally{try{!C&&D.return&&D.return()}finally{if(T)throw k}}}}else for(var L=["lower","upper"],E=0;E2?e[2]:void 0;for(u&&o(e[0],e[1],u)&&(i=1);++nt?"before":"after")},start:function(t,e){t.dataTransfer.effectAllowed="move",this._from=e}},g={_active:0,_drag:null,_pos:[],_uid:[],anchor:function(t,e){var n=this,i={href:"#",class:"",draggable:this.isActive(e),ondragstart:function(t){return n._drag.start(t,e)},ondragend:function(t){return n._drag.end(t,e)}},r=t.attrs.title;return this.tabs&&Object.keys(this.tabs[r].___limit_error).length>0?i.class+=" tab_title--out-of-limit--error":this.tabs&&Object.keys(this.tabs[r].___limit_warning).length>0&&(i.class+=" tab_title--out-of-limit--warning"),(0,s.default)("a",i,t.attrs.title)},content:function(t,e){var n={key:this._uid[e]},i=this.isActive(e)?".tab-pane.active":".tab-pane";return(0,s.default)(i,n,t.children||t.text)},filterTabs:function(t){return t.filter(function(t){return"ait-tab"===t.tag})},isActive:function(t){return t===this._active},move:function(t,e){var n=this;if(t!==e){var i=this._pos.length,r=(0,f.default)(i,function(t){return t===n._active});u.move(this._pos,t,e),u.move(this._uid,t,e),u.move(r,t,e),this._active=r.findIndex(function(t){return t})}},oninit:function(t){var e=this.filterTabs(t.children);this._pos=(0,d.default)(e.length),this._uid=(0,d.default)(e.length),this._drag=Object.create(p)},filterFields:function(t){var e=[];if(!t)return e;var n=!0,i=!1,r=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var l=a.value;l.instance&&l.instance.tag&&"ait-field"===l.instance.tag?e.push(l.attrs.packet+"_"+l.attrs.name):l.children&&"object"===o(l.children)&&l.children.length>0&&(e=e.concat(this.filterFields(l.children)))}}catch(t){i=!0,r=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw r}}return e},oncreate:function(t){var e=this;this.tabs={};var n=!0,i=!1,r=void 0;try{for(var o,a=this.filterTabs(t.children)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=s.attrs.title;this.tabs[l]={___limit_warning:{},___limit_error:{}};var u=!0,c=!1,d=void 0;try{for(var h,f=this.filterFields(s.children)[Symbol.iterator]();!(u=(h=f.next()).done);u=!0){var p=h.value;this.tabs[l][p]=null}}catch(t){c=!0,d=t}finally{try{!u&&f.return&&f.return()}finally{if(c)throw d}}}}catch(t){i=!0,r=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw r}}ait.events.on("field:limitOut",function(t){var n=t.field,i="___limit_"+t.type,r="___limit_"+("warning"===t.type?"error":"warning");for(var o in e.tabs)n in e.tabs[o]&&(e.tabs[o][i][n]=null,delete e.tabs[o][r][n])}),ait.events.on("field:limitIn",function(t){for(var n in e.tabs)t in e.tabs[n]&&(delete e.tabs[n].___limit_warning[t],delete e.tabs[n].___limit_error[t])})},reorder:function(t){return this._pos.map(function(e){return t[e]})},tab:function(t,e){var n=this,i=g.move.bind(this),r={class:this.tabClass(e),key:this._uid[e],onclick:function(){return n._active=e,!1},ondragover:function(t){return n._drag.over(t,e)},ondrop:function(t){return n._drag.drop(t,e,i)}};return(0,s.default)("li",r,this.anchor(t,e))},tabClass:function(t){var e="";return this.isActive(t)?e="active":this._drag.isOver(t)&&(e=this._drag.overClass(t)),e},view:function(t){var e=this.reorder(this.filterTabs(t.children));return(0,s.default)("ait-tabset",[(0,s.default)("ul.nav",t.attrs,e.map(g.tab.bind(this))),(0,s.default)(".tab-content",e.map(g.content.bind(this)))])}};e.default=g,e.TabSet=g},function(t,e,n){var i=n(230),r=i();t.exports=r},function(t,e,n){function i(t){return function(e,n,i){return i&&"number"!=typeof i&&o(e,n,i)&&(n=i=void 0),e=a(e),void 0===n?(n=e,e=0):n=a(n),i=void 0===i?es)return[];var n=l,i=u(t,l);e=o(e),t-=l;for(var c=r(i,e);++n