cosmosc2-tool-tablemanager 5.0.3 → 5.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ce5414f4cdb71105f8894edc36726a9df7119af0b26c02654d8c09f241e0e87
4
- data.tar.gz: 23280b991b0d7889c378731be833c8977f14340116aadbf434851b51455fc2a4
3
+ metadata.gz: dcd730cc64efb479c6c0b98b8605e13ab30bb524cb83cf18df22255304eff559
4
+ data.tar.gz: 745a5b3958a5aed6402e795c6fff29cc58e1579eb753ed9baae69613efa1db62
5
5
  SHA512:
6
- metadata.gz: d76b441440d3565c1381c75cb363f134007f26b4702549ffc3c95e4403b2679a28ec6a828ff62cecad1c21ede11adfb80437d2fc57849c26d4df2c581ee56375
7
- data.tar.gz: 1680108d2015ddb6cfc4343a4702838de41c11ab09d2665a9e53cc94d9fe100c4088d6bd996c2973a85f96a1f0f2238d6b7990bcf562dcb8d9b24daa6684101c
6
+ metadata.gz: ffd8cb656b9a6383d4fb90f63eaa3718e57069a8f46bcb5a39409e562eeadd1b711dedbf2c432ae2113f1ee7ae9aa16c9726df519636fddd4a3094c817d733aa
7
+ data.tar.gz: 40b59e9664c9ff36be4d1d1ca4f3b200fe5fb9b75f94bbdb636a70fb95fd9de00644904f7fb3b9d23a2dd50905b68fb3f43a81781eeebfbc336dc9724327e656
@@ -1,2 +1,2 @@
1
- (self["webpackChunk_cosmosc2_tool_tablemanager"]=self["webpackChunk_cosmosc2_tool_tablemanager"]||[]).push([[550],{9550:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ce}});var l=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[t("top-bar",{attrs:{menus:e.menus,title:e.title}}),t("v-snackbar",{attrs:{top:"",timeout:-1,color:"orange"},scopedSlots:e._u([{key:"action",fn:function(n){var l=n.attrs;return[t("v-btn",e._b({attrs:{text:"",color:"danger","data-test":"unlock-button"},on:{click:e.confirmLocalUnlock}},"v-btn",l,!1),[e._v(" Unlock ")]),t("v-btn",e._b({attrs:{text:""},on:{click:function(){e.showReadOnlyToast=!1}}},"v-btn",l,!1),[e._v(" dismiss ")])]}}]),model:{value:e.showReadOnlyToast,callback:function(n){e.showReadOnlyToast=n},expression:"showReadOnlyToast"}},[t("v-icon",[e._v(" mdi-pencil-off ")]),e._v(" "+e._s(e.lockedBy)+" is editing this script. Editor is in read-only mode ")],1),t("v-file-input",{ref:"fileInput",staticStyle:{position:"fixed",top:"-100%"},attrs:{"show-size":"",accept:".bin","data-test":"file-input"},model:{value:e.fileInput,callback:function(n){e.fileInput=n},expression:"fileInput"}}),t("v-text-field",{attrs:{outlined:"",dense:"",readonly:"","hide-details":"",label:"Definition",id:"definition-filename","data-test":"definition-filename"},model:{value:e.definitionFilename,callback:function(n){e.definitionFilename=n},expression:"definitionFilename"}}),t("v-text-field",{attrs:{outlined:"",dense:"",readonly:"","hide-details":"",label:"Filename",id:"filename","data-test":"filename"},model:{value:e.fullFilename,callback:function(n){e.fullFilename=n},expression:"fullFilename"}}),t("v-card",[t("v-card-title",[e._v(" Items "),t("v-spacer"),t("v-text-field",{attrs:{"append-icon":"mdi-magnify",label:"Search","single-line":"","hide-details":""},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}})],1),t("v-tabs",{model:{value:e.curTab,callback:function(n){e.curTab=n},expression:"curTab"}},e._l(e.tables,(function(n,l){return t("v-tab",{key:l},[e._v(" "+e._s(n.name)+" ")])})),1),t("v-tabs-items",{model:{value:e.curTab,callback:function(n){e.curTab=n},expression:"curTab"}},e._l(e.tables,(function(n,l){return t("v-tab-item",{key:""+e.filename+l},[t("v-data-table",{attrs:{headers:n.headers,items:n.rows,search:e.search,"calculate-widths":"","disable-pagination":"","hide-default-footer":"","multi-sort":"",dense:""},scopedSlots:e._u([{key:"item",fn:function(n){var l=n.item;return[t("table-row",{key:JSON.stringify(l[0]),attrs:{items:l},on:{change:function(n){return e.onChange(l,n)}}})]}}],null,!0)})],1)})),1)],1),e.fileOpen?t("file-open-save-dialog",{attrs:{type:"open","api-url":"/cosmos-api/tables"},on:{file:function(n){return e.setFile(n)},error:function(n){return e.setError(n)}},model:{value:e.fileOpen,callback:function(n){e.fileOpen=n},expression:"fileOpen"}}):e._e(),e.showSaveAs?t("file-open-save-dialog",{attrs:{type:"save","require-target-parent-dir":"","api-url":"/cosmos-api/tables","input-filename":e.filename},on:{filename:function(n){return e.saveAsFilename(n)},error:function(n){return e.setError(n)}},model:{value:e.showSaveAs,callback:function(n){e.showSaveAs=n},expression:"showSaveAs"}}):e._e(),t("simple-text-dialog",{attrs:{title:e.errorTitle,text:e.errorText},model:{value:e.showError,callback:function(n){e.showError=n},expression:"showError"}})],1)},i=[],o=t(8373),a=t(9490),s=(t(5047),t(5794),t(8178),t(9529),t(1235),t(7950),t(8319),t(6710),t(4707),t(1497),t(5640),t(1871),t(8188),t(3675),t(4898),t(5825),t(7170),t(8857),t(8329),t(6279),t(427),t(1159),t(2516),t(4349),t(5273),t(6729),t(1801),t(574),t(5787),t(9271),t(3160),t(5688),t(3157),t(3333),t(315),t(556),t(9224),t(8673),t(6886),t(4121),t(523),t(4660),t(5940),t(3450),t(9644)),c=t.n(s),r=t(4091),u=new r["default"],m=c().create({baseURL:location.origin,timeout:1e4,params:{}});m.interceptors.response.use((function(e){return e}),(function(e){if(401===e.response.status)delete localStorage.cosmosToken,CosmosAuth.login(location.href);else{var n,t,l,i,o,a,s,c,r,m,A="HTTP ".concat(e.response.status," - ");if(null!==(n=e.response)&&void 0!==n&&n.statusText&&(A+="".concat(e.response.statusText," ")),null!==(t=e.response)&&void 0!==t&&null!==(l=t.config)&&void 0!==l&&l.data&&(A+="".concat(e.response.config.data," ")),null!==(i=e.response)&&void 0!==i&&null!==(o=i.data)&&void 0!==o&&o.message)A+="".concat(e.response.data.message);else if(null!==(a=e.response)&&void 0!==a&&null!==(s=a.data)&&void 0!==s&&s.exception)A+="".concat(e.response.data.exception);else if(null!==(c=e.response)&&void 0!==c&&null!==(r=c.data)&&void 0!==r&&null!==(m=r.error)&&void 0!==m&&m.message)e.response.data.error.class&&(A+="".concat(e.response.data.error.class," ")),A+="".concat(e.response.data.error.message);else{var d;A+="".concat(null===(d=e.response)||void 0===d?void 0:d.data)}u.$notify.serious({title:"Network error",body:A})}throw e}));var A=m,d=function(){var e=(0,a.Z)(regeneratorRuntime.mark((function e(n,t){var l,i,o,a,s,c,r,u,m,d=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(l=d.length>2&&void 0!==d[2]?d[2]:{},i=l.data,o=l.params,a=void 0===o?{}:o,s=l.headers,c=l.noAuth,r=void 0!==c&&c,u=l.noScope,m=void 0!==u&&u,r){e.next=11;break}return e.prev=2,e.next=5,CosmosAuth.updateToken(CosmosAuth.defaultMinValidity);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](2),CosmosAuth.login();case 10:s["Authorization"]=localStorage.cosmosToken;case 11:return m||a["scope"]||(a["scope"]=localStorage.scope),e.abrupt("return",A({method:n,url:t,data:i,params:a,headers:s}));case 13:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n,t){return e.apply(this,arguments)}}(),f={Accept:"application/json"},h=(0,o.Z)((0,o.Z)({},f),{},{"Content-Type":"application/json"}),p={get:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.params,l=n.headers,i=void 0===l?f:l,o=n.noScope,a=n.noAuth;return d("get",e,{params:t,headers:i,noScope:o,noAuth:a})},put:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.data,l=n.params,i=n.headers,o=void 0===i?h:i,a=n.noScope,s=n.noAuth;return d("put",e,{data:t,params:l,headers:o,noScope:a,noAuth:s})},post:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.data,l=n.params,i=n.headers,o=void 0===i?h:i,a=n.noScope,s=n.noAuth;return d("post",e,{data:t,params:l,headers:o,noScope:a,noAuth:s})},delete:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.params,l=n.headers,i=void 0===l?f:l,o=n.noScope,a=n.noAuth;return d("delete",e,{params:t,headers:i,noScope:o,noAuth:a})}},v=t(570),C=t(7475),b=t(6330),_=t(2209),g=t(3696),y=(t(1372),t(1245),function(){function e(){(0,b.Z)(this,e),(0,g.Z)(this,"id",1)}return(0,_.Z)(e,[{key:"exec",value:function(){var e=(0,a.Z)(regeneratorRuntime.mark((function e(n,t){var l,i,o,a=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return l=a.length>2&&void 0!==a[2]?a[2]:{},e.prev=1,e.next=4,CosmosAuth.updateToken(CosmosAuth.defaultMinValidity);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e["catch"](1),CosmosAuth.login();case 9:return this.id=this.id+1,e.prev=10,l["scope"]=localStorage.scope,e.next=14,A.post("/cosmos-api/api",{jsonrpc:"2.0",method:n,params:t,id:this.id,keyword_params:l},{headers:{Authorization:localStorage.cosmosToken,"Content-Type":"application/json-rpc"}});case 14:return i=e.sent,e.abrupt("return",i.data.result);case 18:throw e.prev=18,e.t1=e["catch"](10),o=new Error,e.t1.response?(o.name=e.t1.response.data.error.data.class,o.message=e.t1.response.data.error.data.message):e.t1.request?(o.name="Request error",o.message="Request error, no response received"):o.name="Unknown error",o;case 23:case"end":return e.stop()}}),e,this,[[1,6],[10,18]])})));function n(n,t){return e.apply(this,arguments)}return n}()},{key:"decode_cosmos_type",value:function(e){if(null!==e&&"object"===(0,C.Z)(e)&&"Float"==e.json_class&&e.raw){if("NaN"==e.raw)return NaN;if("Infinity"==e.raw)return 1/0;if("-Infinity"==e.raw)return-1/0}return null}},{key:"encode_cosmos_type",value:function(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}},{key:"get_all_interface_info",value:function(){return this.exec("get_all_interface_info",[])}},{key:"connect_interface",value:function(e){return this.exec("connect_interface",[e])}},{key:"disconnect_interface",value:function(e){return this.exec("disconnect_interface",[e])}},{key:"get_all_router_info",value:function(){return this.exec("get_all_router_info",[])}},{key:"connect_router",value:function(e){return this.exec("connect_router",[e])}},{key:"disconnect_router",value:function(e){return this.exec("disconnect_router",[e])}},{key:"get_all_target_info",value:function(){return this.exec("get_all_target_info",[])}},{key:"get_all_cmd_info",value:function(){return this.exec("get_all_cmd_info",[])}},{key:"get_all_tlm_info",value:function(){return this.exec("get_all_tlm_info",[])}},{key:"get_item",value:function(e,n,t){return this.exec("get_item",[e,n,t])}},{key:"get_parameter",value:function(e,n,t){return this.exec("get_parameter",[e,n,t])}},{key:"get_all_packet_logger_info",value:function(){return this.exec("get_all_packet_logger_info",[])}},{key:"start_logging",value:function(){return this.exec("start_logging",[])}},{key:"stop_logging",value:function(){return this.exec("stop_logging",[])}},{key:"start_cmd_log",value:function(e){return this.exec("start_cmd_log",[e])}},{key:"start_tlm_log",value:function(e){return this.exec("start_tlm_log",[e])}},{key:"stop_cmd_log",value:function(e){return this.exec("stop_cmd_log",[e])}},{key:"stop_tlm_log",value:function(e){return this.exec("stop_tlm_log",[e])}},{key:"get_server_status",value:function(){return this.exec("get_server_status",[])}},{key:"get_limits_sets",value:function(){return this.exec("get_limits_sets",[])}},{key:"get_limits_set",value:function(){return this.exec("get_limits_set",[])}},{key:"set_limits_set",value:function(e){return this.exec("set_limits_set",[e])}},{key:"get_background_tasks",value:function(){return this.exec("get_background_tasks",[])}},{key:"start_background_task",value:function(e){return this.exec("start_background_task",[e])}},{key:"stop_background_task",value:function(e){return this.exec("stop_background_task",[e])}},{key:"get_oldest_logfile",value:function(){return this.exec("get_oldest_logfile",[])}},{key:"get_target",value:function(e){return this.exec("get_target",[e])}},{key:"get_target_list",value:function(){return this.exec("get_target_list",[])}},{key:"get_telemetry",value:function(e,n){return this.exec("get_telemetry",[e,n])}},{key:"get_all_telemetry",value:function(e){return this.exec("get_all_telemetry",[e])}},{key:"get_all_telemetry_list",value:function(e){return this.exec("get_all_telemetry_list",[e])}},{key:"get_tlm_packet",value:function(){var e=(0,a.Z)(regeneratorRuntime.mark((function e(n,t,l){var i,o,a,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.exec("get_tlm_packet",[n,t],{type:l});case 2:if(i=e.sent,null!=i)for(o=i.length,a=null,s=0;s<o;s++)a=this.decode_cosmos_type(i[s][1]),null!==a&&(i[s][1]=a);return e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)})));function n(n,t,l){return e.apply(this,arguments)}return n}()},{key:"get_packet_derived_items",value:function(e,n){return this.exec("get_packet_derived_items",[e,n])}},{key:"get_tlm_buffer",value:function(e,n){return this.exec("get_tlm_buffer",[e,n])}},{key:"get_tlm_values",value:function(){var e=(0,a.Z)(regeneratorRuntime.mark((function e(n){var t,l,i,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.exec("get_tlm_values",[n]);case 2:for(t=e.sent,l=t[0].length,i=null,o=0;o<l;o++)i=this.decode_cosmos_type(t[0][o]),null!==i&&(t[0][o]=i);return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e,this)})));function n(n){return e.apply(this,arguments)}return n}()},{key:"get_limits",value:function(e,n,t){return this.exec("get_limits",[e,n,t])}},{key:"tlm",value:function(){var e=(0,a.Z)(regeneratorRuntime.mark((function e(n,t,l){var i,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.exec("tlm",[n,t,l]);case 2:return i=e.sent,o=this.decode_cosmos_type(i),null!==o&&(0,v.Z)("data"),e.abrupt("return",i);case 6:case"end":return e.stop()}}),e,this)})));function n(n,t,l){return e.apply(this,arguments)}return n}()},{key:"get_all_commands",value:function(e){return this.exec("get_all_commands",[e])}},{key:"get_all_commands_list",value:function(e){return this.exec("get_all_commands_list",[e])}},{key:"get_command",value:function(e,n){return this.exec("get_command",[e,n])}},{key:"get_cmd_value",value:function(e,n,t){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"CONVERTED";return this.exec("get_cmd_value",[e,n,t,l])}},{key:"get_cmd_buffer",value:function(e,n){return this.exec("get_cmd_buffer",[e,n])}},{key:"_cmd",value:function(e,n,t,l){var i=null;for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(i=this.encode_cosmos_type(l[o]),null!==i&&(l[o]=i));return this.exec(e,[n,t,l])}},{key:"get_cmd_hazardous",value:function(e,n,t){return void 0===n?this.exec("get_cmd_hazardous",e):this._cmd("get_cmd_hazardous",e,n,t)}},{key:"cmd",value:function(e,n,t){return void 0===n?this.exec("cmd",e):this._cmd("cmd",e,n,t)}},{key:"cmd_no_range_check",value:function(e,n,t){return void 0===n?this.exec("cmd_no_range_check",e):this._cmd("cmd_no_range_check",e,n,t)}},{key:"cmd_raw",value:function(e,n,t){return void 0===n?this.exec("cmd_raw",e):this._cmd("cmd_raw",e,n,t)}},{key:"cmd_raw_no_range_check",value:function(e,n,t){return void 0===n?this.exec("cmd_raw_no_range_check",e):this._cmd("cmd_raw_no_range_check",e,n,t)}},{key:"cmd_no_hazardous_check",value:function(e,n,t){return void 0===n?this.exec("cmd_no_hazardous_check",e):this._cmd("cmd_no_hazardous_check",e,n,t)}},{key:"cmd_no_checks",value:function(e,n,t){return void 0===n?this.exec("cmd_no_checks",e):this._cmd("cmd_no_checks",e,n,t)}},{key:"cmd_raw_no_hazardous_check",value:function(e,n,t){return void 0===n?this.exec("cmd_raw_no_hazardous_check",e):this._cmd("cmd_raw_no_hazardous_check",e,n,t)}},{key:"cmd_raw_no_checks",value:function(e,n,t){return void 0===n?this.exec("cmd_raw_no_checks",e):this._cmd("cmd_raw_no_checks",e,n,t)}},{key:"get_interface_names",value:function(){return this.exec("get_interface_names",[])}},{key:"send_raw",value:function(e,n){return this.exec("send_raw",[e,n])}},{key:"list_configs",value:function(e){return this.exec("list_configs",[e])}},{key:"load_config",value:function(e,n){return this.exec("load_config",[e,n])}},{key:"save_config",value:function(e,n,t){return this.exec("save_config",[e,n,t])}},{key:"delete_config",value:function(e,n){return this.exec("delete_config",[e,n])}},{key:"get_out_of_limits",value:function(){return this.exec("get_out_of_limits",[])}},{key:"get_overall_limits_state",value:function(e){return this.exec("get_overall_limits_state",[e])}},{key:"list_settings",value:function(){return this.exec("list_settings",[])}},{key:"get_all_settings",value:function(){return this.exec("get_all_settings",[])}},{key:"get_setting",value:function(e){return this.exec("get_setting",[e])}},{key:"get_settings",value:function(e){return this.exec("get_settings",e)}},{key:"save_setting",value:function(e,n){return this.exec("save_setting",[e,n])}}]),e}()),k=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("mounting-portal",{attrs:{"mount-to":"#cosmos-menu",append:""}},[t("div",{staticClass:"v-toolbar__content"},[e._l(e.menus,(function(n,l){return t("v-menu",{key:l,attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function(l){var i=l.on,o=l.attrs;return[t("v-btn",e._g(e._b({staticClass:"mx-1",attrs:{outlined:"","data-test":e.formatDT(e.title+" "+n.label)}},"v-btn",o,!1),i),[t("span",{domProps:{textContent:e._s(n.label)}}),t("v-icon",{attrs:{right:""}},[e._v(" mdi-menu-down ")])],1)]}}],null,!0)},[t("v-list",[t("v-radio-group",{staticClass:"ma-0 pa-0",attrs:{value:n.radioGroup,"hide-details":"",dense:""}},[e._l(n.items,(function(l,i){return[l.divider?t("v-divider",{key:i}):t("v-list-item",{key:i,attrs:{disabled:l.disabled,"data-test":e.formatDT(e.title+" "+n.label+" "+l.label)},on:{click:l.command}},[l.radio?t("v-list-item-action",[t("v-radio",{attrs:{color:"secondary",label:l.label,value:l.label}})],1):e._e(),l.checkbox?t("v-list-item-action",[t("v-checkbox",{attrs:{color:"secondary",label:l.label,value:l.label},model:{value:e.checked,callback:function(n){e.checked=n},expression:"checked"}})],1):e._e(),l.icon?t("v-list-item-icon",[t("v-icon",{attrs:{disabled:l.disabled},domProps:{textContent:e._s(l.icon)}})],1):e._e(),l.radio||l.checkbox?e._e():t("v-list-item-title",{style:"cursor: pointer;"+(l.disabled?"opacity: 0.2":""),domProps:{textContent:e._s(l.label)}})],1)]}))],2)],1)],1)})),t("v-spacer"),t("v-toolbar-title",{domProps:{textContent:e._s(e.title)}}),t("v-spacer")],2)])},x=[],w=(t(1639),{props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(e){return e.replaceAll(" ","-").toLowerCase()}}}),T=w,F=(t(7162),t(3287)),I=(0,F.Z)(T,k,x,!1,null,"e3bb7458",null),S=I.exports,E=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("tr",[t("td",{staticClass:"text-start"},[e._v(e._s(e.dataItems[0].index))]),e.oneDimensional?t("td",{staticClass:"text-start"},[e._v(e._s(e.dataItems[0].name))]):e._e(),e._l(e.dataItems,(function(n,l){return t("table-item",{key:n.name,attrs:{item:n},on:{change:function(t){return e.onChange(n,l,t)}}})}))],2)},D=[],O=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("td",[e.isCheckbox?t("v-checkbox",{attrs:{dense:"","hide-details":"",disabled:!e.dataItem.editable},on:{change:e.checkboxChange},model:{value:e.checkValue,callback:function(n){e.checkValue=n},expression:"checkValue"}}):e.dataItem.states?t("v-select",{attrs:{dense:"","hide-details":"",items:e.itemStates,disabled:!e.dataItem.editable},on:{change:e.stateChange},model:{value:e.stateValue,callback:function(n){e.stateValue=n},expression:"stateValue"}}):t("v-text-field",{attrs:{solo:"",dense:"","single-line":"","hide-no-data":"","hide-details":"",disabled:!e.dataItem.editable},on:{change:e.textChange},model:{value:e.dataItem.value,callback:function(n){e.$set(e.dataItem,"value",n)},expression:"dataItem.value"}})],1)},N=[],R=t(6451);t(4769),t(5883),t(9228);function $(){var e="/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableItem.vue",n="a81b214d030e0899a4655b2a5a5c4e258e1826e6",t=new Function("return this")(),l="__coverage__",i={path:"/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableItem.vue",statementMap:{0:{start:{line:62,column:4},end:{line:66,column:5}},1:{start:{line:69,column:4},end:{line:71,column:5}},2:{start:{line:70,column:6},end:{line:70,column:65}},3:{start:{line:72,column:4},end:{line:74,column:5}},4:{start:{line:73,column:6},end:{line:73,column:45}},5:{start:{line:78,column:19},end:{line:78,column:23}},6:{start:{line:79,column:6},end:{line:87,column:7}},7:{start:{line:80,column:8},end:{line:84,column:9}},8:{start:{line:81,column:10},end:{line:83,column:11}},9:{start:{line:82,column:12},end:{line:82,column:26}},10:{start:{line:86,column:8},end:{line:86,column:22}},11:{start:{line:88,column:6},end:{line:88,column:19}},12:{start:{line:91,column:19},end:{line:91,column:21}},13:{start:{line:92,column:6},end:{line:94,column:7}},14:{start:{line:93,column:8},end:{line:93,column:49}},15:{start:{line:95,column:6},end:{line:95,column:19}},16:{start:{line:100,column:6},end:{line:104,column:7}},17:{start:{line:101,column:8},end:{line:101,column:39}},18:{start:{line:103,column:8},end:{line:103,column:41}},19:{start:{line:108,column:18},end:{line:110,column:7}},20:{start:{line:109,column:17},end:{line:109,column:62}},21:{start:{line:111,column:6},end:{line:111,column:33}},22:{start:{line:114,column:6},end:{line:114,column:47}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:61,column:2},end:{line:61,column:3}},loc:{start:{line:61,column:9},end:{line:67,column:3}},line:61},1:{name:"(anonymous_1)",decl:{start:{line:68,column:2},end:{line:68,column:3}},loc:{start:{line:68,column:12},end:{line:75,column:3}},line:68},2:{name:"(anonymous_2)",decl:{start:{line:77,column:16},end:{line:77,column:17}},loc:{start:{line:77,column:28},end:{line:89,column:5}},line:77},3:{name:"(anonymous_3)",decl:{start:{line:90,column:16},end:{line:90,column:17}},loc:{start:{line:90,column:28},end:{line:96,column:5}},line:90},4:{name:"(anonymous_4)",decl:{start:{line:99,column:20},end:{line:99,column:21}},loc:{start:{line:99,column:32},end:{line:105,column:5}},line:99},5:{name:"(anonymous_5)",decl:{start:{line:106,column:17},end:{line:106,column:18}},loc:{start:{line:106,column:29},end:{line:112,column:5}},line:106},6:{name:"(anonymous_6)",decl:{start:{line:109,column:8},end:{line:109,column:9}},loc:{start:{line:109,column:17},end:{line:109,column:62}},line:109},7:{name:"(anonymous_7)",decl:{start:{line:113,column:16},end:{line:113,column:17}},loc:{start:{line:113,column:28},end:{line:115,column:5}},line:113}},branchMap:{0:{loc:{start:{line:69,column:4},end:{line:71,column:5}},type:"if",locations:[{start:{line:69,column:4},end:{line:71,column:5}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:69},1:{loc:{start:{line:72,column:4},end:{line:74,column:5}},type:"if",locations:[{start:{line:72,column:4},end:{line:74,column:5}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:72},2:{loc:{start:{line:79,column:6},end:{line:87,column:7}},type:"if",locations:[{start:{line:79,column:6},end:{line:87,column:7}},{start:{line:85,column:13},end:{line:87,column:7}}],line:79},3:{loc:{start:{line:81,column:10},end:{line:83,column:11}},type:"if",locations:[{start:{line:81,column:10},end:{line:83,column:11}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:81},4:{loc:{start:{line:81,column:14},end:{line:81,column:58}},type:"binary-expr",locations:[{start:{line:81,column:14},end:{line:81,column:33}},{start:{line:81,column:37},end:{line:81,column:58}}],line:81},5:{loc:{start:{line:100,column:6},end:{line:104,column:7}},type:"if",locations:[{start:{line:100,column:6},end:{line:104,column:7}},{start:{line:102,column:13},end:{line:104,column:7}}],line:100}},s:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0},f:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0},b:{0:[0,0],1:[0,0],2:[0,0],3:[0,0],4:[0,0],5:[0,0]},inputSourceMap:{version:3,sources:["TableItem.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableItem.vue",sourceRoot:"src/tools/TableManager",sourcesContent:['\x3c!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This program may also be used under the terms of a commercial or\n# enterprise edition license of COSMOS if purchased from the\n# copyright holder\n--\x3e\n\n<template>\n <td>\n <v-checkbox\n v-if="isCheckbox"\n dense\n hide-details\n v-model="checkValue"\n @change="checkboxChange"\n :disabled="!dataItem.editable"\n />\n <v-select\n v-else-if="dataItem.states"\n dense\n hide-details\n v-model="stateValue"\n :items="itemStates"\n @change="stateChange"\n :disabled="!dataItem.editable"\n />\n <v-text-field\n v-else\n solo\n dense\n single-line\n hide-no-data\n hide-details\n v-model="dataItem.value"\n @change="textChange"\n :disabled="!dataItem.editable"\n />\n </td>\n</template>\n\n<script>\nexport default {\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n data() {\n return {\n dataItem: this.item,\n stateValue: null,\n checkValue: false,\n }\n },\n created() {\n if (this.dataItem.states) {\n this.stateValue = this.dataItem.states[this.dataItem.value]\n }\n if (this.isCheckbox) {\n this.checkValue = this.stateValue === 1\n }\n },\n computed: {\n isCheckbox: function () {\n let result = true\n if (this.dataItem.states) {\n for (const state of Object.keys(this.dataItem.states)) {\n if (state !== \'CHECKED\' && state !== \'UNCHECKED\') {\n result = false\n }\n }\n } else {\n result = false\n }\n return result\n },\n itemStates: function () {\n let result = []\n for (const [text, value] of Object.entries(this.dataItem.states)) {\n result.push({ text: text, value: value })\n }\n return result\n },\n },\n methods: {\n checkboxChange: function () {\n if (this.checkValue) {\n this.$emit(\'change\', \'CHECKED\')\n } else {\n this.$emit(\'change\', \'UNCHECKED\')\n }\n },\n stateChange: function () {\n // Lookup the state key that corresponds to the value\n let state = Object.keys(this.dataItem.states).find(\n (key) => this.dataItem.states[key] === this.stateValue\n )\n this.$emit(\'change\', state)\n },\n textChange: function () {\n this.$emit(\'change\', this.dataItem.value)\n },\n },\n}\n<\/script>\n']},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"a81b214d030e0899a4655b2a5a5c4e258e1826e6"},o=t[l]||(t[l]={});o[e]&&o[e].hash===n||(o[e]=i);var a=o[e];return $=function(){return a},a}$();var M={props:{item:{type:Object,required:!0}},data:function(){return $().f[0]++,$().s[0]++,{dataItem:this.item,stateValue:null,checkValue:!1}},created:function(){$().f[1]++,$().s[1]++,this.dataItem.states?($().b[0][0]++,$().s[2]++,this.stateValue=this.dataItem.states[this.dataItem.value]):$().b[0][1]++,$().s[3]++,this.isCheckbox?($().b[1][0]++,$().s[4]++,this.checkValue=1===this.stateValue):$().b[1][1]++},computed:{isCheckbox:function(){$().f[2]++;var e=($().s[5]++,!0);if($().s[6]++,this.dataItem.states){$().b[2][0]++,$().s[7]++;for(var n=0,t=Object.keys(this.dataItem.states);n<t.length;n++){var l=t[n];$().s[8]++,$().b[4][0]++,"CHECKED"!==l&&($().b[4][1]++,"UNCHECKED"!==l)?($().b[3][0]++,$().s[9]++,e=!1):$().b[3][1]++}}else $().b[2][1]++,$().s[10]++,e=!1;return $().s[11]++,e},itemStates:function(){$().f[3]++;var e=($().s[12]++,[]);$().s[13]++;for(var n=0,t=Object.entries(this.dataItem.states);n<t.length;n++){var l=(0,R.Z)(t[n],2),i=l[0],o=l[1];$().s[14]++,e.push({text:i,value:o})}return $().s[15]++,e}},methods:{checkboxChange:function(){$().f[4]++,$().s[16]++,this.checkValue?($().b[5][0]++,$().s[17]++,this.$emit("change","CHECKED")):($().b[5][1]++,$().s[18]++,this.$emit("change","UNCHECKED"))},stateChange:function(){var e=this;$().f[5]++;var n=($().s[19]++,Object.keys(this.dataItem.states).find((function(n){return $().f[6]++,$().s[20]++,e.dataItem.states[n]===e.stateValue})));$().s[21]++,this.$emit("change",n)},textChange:function(){$().f[7]++,$().s[22]++,this.$emit("change",this.dataItem.value)}}},U=M,B=(0,F.Z)(U,O,N,!1,null,null,null),P=B.exports;function L(){var e="/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableRow.vue",n="dbd0a1855bd5813e025d4acfff9ff0693e3b1a95",t=new Function("return this")(),l="__coverage__",i={path:"/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableRow.vue",statementMap:{0:{start:{line:47,column:4},end:{line:49,column:5}},1:{start:{line:53,column:6},end:{line:57,column:7}},2:{start:{line:54,column:8},end:{line:54,column:19}},3:{start:{line:56,column:8},end:{line:56,column:20}},4:{start:{line:62,column:6},end:{line:62,column:58}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:46,column:2},end:{line:46,column:3}},loc:{start:{line:46,column:9},end:{line:50,column:3}},line:46},1:{name:"(anonymous_1)",decl:{start:{line:52,column:4},end:{line:52,column:5}},loc:{start:{line:52,column:21},end:{line:58,column:5}},line:52},2:{name:"(anonymous_2)",decl:{start:{line:61,column:14},end:{line:61,column:15}},loc:{start:{line:61,column:44},end:{line:63,column:5}},line:61}},branchMap:{0:{loc:{start:{line:53,column:6},end:{line:57,column:7}},type:"if",locations:[{start:{line:53,column:6},end:{line:57,column:7}},{start:{line:55,column:13},end:{line:57,column:7}}],line:53}},s:{0:0,1:0,2:0,3:0,4:0},f:{0:0,1:0,2:0},b:{0:[0,0]},inputSourceMap:{version:3,sources:["TableRow.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableRow.vue",sourceRoot:"src/tools/TableManager",sourcesContent:['\x3c!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This program may also be used under the terms of a commercial or\n# enterprise edition license of COSMOS if purchased from the\n# copyright holder\n--\x3e\n\n<template>\n <tr>\n <td class="text-start">{{ dataItems[0].index }}</td>\n <td class="text-start" v-if="oneDimensional">{{ dataItems[0].name }}</td>\n <table-item\n v-for="(item, index) in dataItems"\n :key="item.name"\n :item="item"\n @change="onChange(item, index, $event)"\n />\n </tr>\n</template>\n\n<script>\nimport TableItem from \'@/tools/TableManager/TableItem\'\n\nexport default {\n components: {\n TableItem,\n },\n props: {\n items: {\n type: Object,\n required: true,\n },\n },\n data() {\n return {\n dataItems: this.items,\n }\n },\n computed: {\n oneDimensional() {\n if (this.dataItems.length === 1) {\n return true\n } else {\n return false\n }\n },\n },\n methods: {\n onChange: function (item, index, event) {\n this.$emit(\'change\', { index: index, event: event })\n },\n },\n}\n<\/script>\n']},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"dbd0a1855bd5813e025d4acfff9ff0693e3b1a95"},o=t[l]||(t[l]={});o[e]&&o[e].hash===n||(o[e]=i);var a=o[e];return L=function(){return a},a}L();var Z={components:{TableItem:P},props:{items:{type:Object,required:!0}},data:function(){return L().f[0]++,L().s[0]++,{dataItems:this.items}},computed:{oneDimensional:function(){return L().f[1]++,L().s[1]++,1===this.dataItems.length?(L().b[0][0]++,L().s[2]++,!0):(L().b[0][1]++,L().s[3]++,!1)}},methods:{onChange:function(e,n,t){L().f[2]++,L().s[4]++,this.$emit("change",{index:n,event:t})}}},j=Z,V=(0,F.Z)(j,E,D,!1,null,null,null),q=V.exports,z=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-dialog",{attrs:{width:"600"},model:{value:e.show,callback:function(n){e.show=n},expression:"show"}},[t("v-card",[t("form",{on:{submit:function(n){return n.preventDefault(),e.success.apply(null,arguments)}}},[t("v-system-bar",[t("v-spacer"),t("span",[e._v(" "+e._s(e.title)+" ")]),t("v-spacer")],1),t("v-card-text",[t("div",{staticClass:"pa-3"},[t("v-row",{attrs:{dense:""}},[t("v-text-field",{attrs:{flat:"",autofocus:"","solo-inverted":"","hide-details":"",clearable:"",label:"Search","data-test":"file-open-save-search"},on:{input:e.handleSearch},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}})],1),t("v-row",{staticClass:"mt-2",attrs:{dense:""}},[t("v-treeview",{ref:"tree",staticStyle:{width:"100%"},attrs:{dense:"",activatable:"","return-object":"",items:e.items,search:e.search,"open-on-click":"open"===e.type},on:{"update:active":e.activeFile},scopedSlots:e._u([{key:"prepend",fn:function(n){var l=n.item,i=n.open;return[l.file?t("v-icon",[e._v(" "+e._s("mdi-language-ruby")+" ")]):t("v-icon",[e._v(" "+e._s(i?"mdi-folder-open":"mdi-folder")+" ")])]}}]),model:{value:e.tree,callback:function(n){e.tree=n},expression:"tree"}})],1),t("v-row",{staticClass:"my-2"},[t("v-text-field",{attrs:{"hide-details":"",label:"Filename","data-test":"file-open-save-filename",disabled:"open"===e.type},model:{value:e.selectedFile,callback:function(n){e.selectedFile=n},expression:"selectedFile"}})],1),t("v-row",{attrs:{dense:""}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.error,expression:"error"}],staticClass:"my-2 red--text",domProps:{textContent:e._s(e.error)}})]),t("v-row",{staticClass:"mt-2"},[t("v-spacer"),t("v-btn",{staticClass:"mx-2",attrs:{outlined:"","data-test":"file-open-save-cancel-btn",disabled:e.disableButtons},on:{click:function(n){e.show=!1}}},[e._v(" Cancel ")]),t("v-btn",{staticClass:"mx-2",attrs:{type:"submit",color:"primary","data-test":"file-open-save-submit-btn",disabled:e.disableButtons||!!e.error},on:{click:function(n){return n.preventDefault(),e.success.apply(null,arguments)}}},[e._v(" "+e._s(e.submit)+" ")])],1)],1)])],1)])],1)},H=[],G=t(6711),Y=(t(4083),t(4069),t(7368),t(4471),t(1172),t(8233),t(9949),t(2501),{props:{type:{type:String,required:!0,validator:function(e){return-1!==["open","save"].indexOf(e)}},apiUrl:String,requireTargetParentDir:Boolean,inputFilename:String,value:Boolean},data:function(){return{tree:[],items:[],id:1,search:null,selectedFile:null,disableButtons:!1,targets:[]}},computed:{show:{get:function(){return this.value},set:function(e){this.$emit("input",e)}},title:function(){return"open"===this.type?"File Open":"File Save As..."},submit:function(){return"open"===this.type?"OPEN":"SAVE"},error:function(){if(""===this.selectedFile||null===this.selectedFile)return"No file selected must select a file";if(!this.selectedFile.match(this.validFilenameRegex)||this.selectedFile.match(/\.\.|\/\/|\.\/|\/\./)){var e="".concat(this.selectedFile," is not a valid filename. Must ");return this.requireTargetParentDir&&(e+="be in a target directory and "),e+="only contain alphanumeric characters and / ! - _ . * ' ( )",e}return null},validFilenameRegex:function(){var e="0-9a-zA-Z",n="".concat(e,"\\/\\!\\-\\_\\.\\*\\'\\(\\)"),t="[".concat(n,"]+\\.[").concat(e,"]+");if(this.requireTargetParentDir){var l="(".concat(this.targets.join("|"),")");t="\\/?".concat(l,"\\/").concat(t)}return new RegExp(t)}},created:function(){var e=this;p.get(this.apiUrl).then((function(n){e.items=[],e.id=1;var t,l=(0,G.Z)(n.data);try{for(l.s();!(t=l.n()).done;){var i=t.value;e.filepath=i,e.insertFile(e.items,1,i),e.id++}}catch(o){l.e(o)}finally{l.f()}e.inputFilename&&(e.selectedFile=e.inputFilename)})).catch((function(n){e.$emit("error","Failed to connect to Cosmos. ".concat(n))})),this.requireTargetParentDir&&p.get("/cosmos-api/targets").then((function(n){e.targets=n.data}))},methods:{clear:function(){this.show=!1,this.overwrite=!1,this.disableButtons=!1},handleSearch:function(e){e?this.$refs.tree.updateAll(!0):this.$refs.tree.updateAll(!1)},activeFile:function(e){0===e.length?this.selectedFile=null:this.selectedFile=e[0].path},exists:function(e,n){var t,l=!1,i=(0,G.Z)(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(o.path===n)return!0;o.children&&(l=l||this.exists(o.children,n))}}catch(a){i.e(a)}finally{i.f()}return l},success:function(){"open"===this.type?this.openSuccess():this.saveSuccess()},openSuccess:function(){var e=this;this.disableButtons=!0,p.get("".concat(this.apiUrl,"/").concat(this.selectedFile)).then((function(n){var t={name:e.selectedFile,contents:n.data.contents};n.data.suites&&(t["suites"]=JSON.parse(n.data.suites)),n.data.error&&(t["error"]=n.data.error),n.data.success&&(t["success"]=n.data.success);var l=n.data.locked,i=n.data.breakpoints;e.$emit("file",{file:t,locked:l,breakpoints:i}),e.clear()})).catch((function(n){e.$emit("error","Failed to open ".concat(e.selectedFile,". ").concat(n)),e.clear()}))},saveSuccess:function(){var e=this,n=this.exists(this.items,this.selectedFile);n?this.$dialog.confirm("Are you sure you want to overwrite: ".concat(this.selectedFile),{okText:"Overwrite",cancelText:"Cancel"}).then((function(n){e.$emit("filename",e.selectedFile),e.clear()})):(this.$emit("filename",this.selectedFile),this.clear())},insertFile:function(e,n,t){var l=t.split("/");if(1===l.length)return e.push({id:this.id,name:l[0],file:"ruby",path:this.filepath}),void this.id++;var i=e.findIndex((function(e){return e.name===l[0]}));-1===i?(e.push({id:this.id,name:l[0],children:[],path:this.filepath.split("/").slice(0,n).join("/")}),this.id++,this.insertFile(e[e.length-1].children,n+1,l.slice(1).join("/"))):this.insertFile(e[i].children,n+1,l.slice(1).join("/"))}}}),W=Y,K=(0,F.Z)(W,z,H,!1,null,null,null),J=K.exports,X=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-dialog",{attrs:{width:e.width},model:{value:e.show,callback:function(n){e.show=n},expression:"show"}},[t("v-card",[t("v-system-bar",[t("v-spacer"),t("span",[e._v(" "+e._s(e.title)+" ")]),t("v-spacer"),t("div",{staticClass:"mx-2"},[t("v-tooltip",{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(n){var l=n.on,i=n.attrs;return[t("div",e._g(e._b({},"div",i,!1),l),[t("v-icon",{attrs:{"data-test":"downloadIcon"},on:{click:e.download}},[e._v(" mdi-download ")])],1)]}}])},[t("span",[e._v(" Download ")])])],1)],1),t("v-card-text",[t("div",{staticClass:"pa-3"},[t("span",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(e.text))])])]),t("v-card-actions",[t("v-spacer"),t("v-btn",{staticClass:"mx-2",attrs:{color:"primary"},on:{click:function(n){e.show=!e.show}}},[e._v(" Ok ")])],1)],1)],1)},Q=[],ee={props:{value:Boolean,text:String,title:String,width:800},computed:{show:{get:function(){return this.value},set:function(e){this.$emit("input",e)}}},methods:{download:function(){var e=new Blob([this.text],{type:"text/plain"}),n=document.createElement("a");n.href=URL.createObjectURL(e),n.setAttribute("download","".concat(this.title,".txt")),n.click()}}},ne=ee,te=(0,F.Z)(ne,X,Q,!1,null,null,null),le=te.exports;function ie(){var e="/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableManager.vue",n="1e3b314010b0a1f11b4e3ba37696a43cb2aacfa1",t=new Function("return this")(),l="__coverage__",i={path:"/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableManager.vue",statementMap:{0:{start:{line:162,column:4},end:{line:181,column:5}},1:{start:{line:185,column:6},end:{line:185,column:28}},2:{start:{line:188,column:6},end:{line:188,column:59}},3:{start:{line:191,column:6},end:{line:255,column:7}},4:{start:{line:199,column:16},end:{line:199,column:30}},5:{start:{line:206,column:16},end:{line:206,column:31}},6:{start:{line:216,column:16},end:{line:216,column:31}},7:{start:{line:223,column:16},end:{line:223,column:29}},8:{start:{line:233,column:16},end:{line:233,column:29}},9:{start:{line:240,column:16},end:{line:240,column:31}},10:{start:{line:250,column:16},end:{line:250,column:29}},11:{start:{line:259,column:4},end:{line:259,column:30}},12:{start:{line:264,column:6},end:{line:264,column:28}},13:{start:{line:265,column:6},end:{line:265,column:25}},14:{start:{line:266,column:6},end:{line:266,column:26}},15:{start:{line:269,column:6},end:{line:269,column:26}},16:{start:{line:274,column:6},end:{line:289,column:7}},17:{start:{line:275,column:8},end:{line:280,column:9}},18:{start:{line:276,column:10},end:{line:276,column:35}},19:{start:{line:277,column:10},end:{line:277,column:30}},20:{start:{line:279,column:10},end:{line:279,column:39}},21:{start:{line:282,column:8},end:{line:282,column:25}},22:{start:{line:284,column:8},end:{line:284,column:47}},23:{start:{line:285,column:8},end:{line:285,column:30}},24:{start:{line:286,column:8},end:{line:286,column:30}},25:{start:{line:288,column:8},end:{line:288,column:28}},26:{start:{line:293,column:6},end:{line:293,column:31}},27:{start:{line:294,column:6},end:{line:294,column:40}},28:{start:{line:295,column:6},end:{line:295,column:44}},29:{start:{line:296,column:6},end:{line:296,column:27}},30:{start:{line:300,column:6},end:{line:300,column:26}},31:{start:{line:302,column:23},end:{line:302,column:37}},32:{start:{line:303,column:6},end:{line:303,column:46}},33:{start:{line:304,column:6},end:{line:304,column:60}},34:{start:{line:305,column:6},end:{line:305,column:60}},35:{start:{line:306,column:6},end:{line:320,column:10}},36:{start:{line:310,column:10},end:{line:310,column:32}},37:{start:{line:311,column:10},end:{line:313,column:18}},38:{start:{line:312,column:12},end:{line:312,column:33}},39:{start:{line:316,column:10},end:{line:316,column:31}},40:{start:{line:317,column:10},end:{line:317,column:40}},41:{start:{line:318,column:10},end:{line:318,column:48}},42:{start:{line:319,column:10},end:{line:319,column:31}},43:{start:{line:321,column:6},end:{line:321,column:21}},44:{start:{line:324,column:6},end:{line:324,column:28}},45:{start:{line:327,column:6},end:{line:327,column:30}},46:{start:{line:328,column:6},end:{line:328,column:21}},47:{start:{line:331,column:6},end:{line:353,column:7}},48:{start:{line:332,column:8},end:{line:352,column:12}},49:{start:{line:338,column:12},end:{line:340,column:14}},50:{start:{line:343,column:12},end:{line:343,column:26}},51:{start:{line:346,column:12},end:{line:351,column:13}},52:{start:{line:347,column:14},end:{line:350,column:16}},53:{start:{line:356,column:6},end:{line:379,column:7}},54:{start:{line:357,column:8},end:{line:378,column:10}},55:{start:{line:359,column:30},end:{line:359,column:65}},56:{start:{line:361,column:29},end:{line:361,column:63}},57:{start:{line:363,column:10},end:{line:365,column:11}},58:{start:{line:363,column:23},end:{line:363,column:24}},59:{start:{line:364,column:12},end:{line:364,column:53}},60:{start:{line:367,column:23},end:{line:369,column:12}},61:{start:{line:371,column:23},end:{line:371,column:50}},62:{start:{line:372,column:10},end:{line:372,column:47}},63:{start:{line:373,column:10},end:{line:376,column:11}},64:{start:{line:377,column:10},end:{line:377,column:22}},65:{start:{line:382,column:6},end:{line:382,column:25}},66:{start:{line:383,column:6},end:{line:383,column:46}},67:{start:{line:385,column:6},end:{line:387,column:7}},68:{start:{line:386,column:8},end:{line:386,column:64}},69:{start:{line:386,column:39},end:{line:386,column:63}},70:{start:{line:388,column:6},end:{line:388,column:41}},71:{start:{line:389,column:6},end:{line:389,column:19}},72:{start:{line:392,column:6},end:{line:403,column:10}},73:{start:{line:401,column:10},end:{line:401,column:30}},74:{start:{line:402,column:10},end:{line:402,column:32}},75:{start:{line:406,column:6},end:{line:406,column:65}},76:{start:{line:409,column:6},end:{line:411,column:7}},77:{start:{line:410,column:8},end:{line:410,column:62}},78:{start:{line:414,column:6},end:{line:418,column:7}},79:{start:{line:415,column:8},end:{line:417,column:38}},80:{start:{line:419,column:23},end:{line:419,column:37}},81:{start:{line:420,column:6},end:{line:420,column:46}},82:{start:{line:421,column:6},end:{line:421,column:55}},83:{start:{line:422,column:6},end:{line:475,column:10}},84:{start:{line:426,column:10},end:{line:426,column:54}},85:{start:{line:427,column:10},end:{line:453,column:12}},86:{start:{line:428,column:12},end:{line:452,column:13}},87:{start:{line:432,column:31},end:{line:435,column:17}},88:{start:{line:436,column:16},end:{line:450,column:17}},89:{start:{line:439,column:18},end:{line:442,column:19}},90:{start:{line:446,column:18},end:{line:449,column:19}},91:{start:{line:455,column:10},end:{line:460,column:11}},92:{start:{line:456,column:12},end:{line:459,column:14}},93:{start:{line:463,column:10},end:{line:474,column:11}},94:{start:{line:464,column:12},end:{line:467,column:14}},95:{start:{line:468,column:12},end:{line:468,column:32}},96:{start:{line:470,column:12},end:{line:473,column:14}},97:{start:{line:478,column:23},end:{line:478,column:37}},98:{start:{line:479,column:6},end:{line:479,column:48}},99:{start:{line:480,column:6},end:{line:485,column:8}},100:{start:{line:483,column:8},end:{line:483,column:46}},101:{start:{line:484,column:8},end:{line:484,column:37}},102:{start:{line:488,column:6},end:{line:488,column:29}},103:{start:{line:489,column:6},end:{line:489,column:31}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:161,column:2},end:{line:161,column:3}},loc:{start:{line:161,column:9},end:{line:182,column:3}},line:161},1:{name:"(anonymous_1)",decl:{start:{line:184,column:14},end:{line:184,column:15}},loc:{start:{line:184,column:26},end:{line:186,column:5}},line:184},2:{name:"(anonymous_2)",decl:{start:{line:187,column:4},end:{line:187,column:5}},loc:{start:{line:187,column:19},end:{line:189,column:5}},line:187},3:{name:"(anonymous_3)",decl:{start:{line:190,column:11},end:{line:190,column:12}},loc:{start:{line:190,column:23},end:{line:256,column:5}},line:190},4:{name:"(anonymous_4)",decl:{start:{line:198,column:23},end:{line:198,column:24}},loc:{start:{line:198,column:29},end:{line:200,column:15}},line:198},5:{name:"(anonymous_5)",decl:{start:{line:205,column:23},end:{line:205,column:24}},loc:{start:{line:205,column:29},end:{line:207,column:15}},line:205},6:{name:"(anonymous_6)",decl:{start:{line:215,column:23},end:{line:215,column:24}},loc:{start:{line:215,column:29},end:{line:217,column:15}},line:215},7:{name:"(anonymous_7)",decl:{start:{line:222,column:23},end:{line:222,column:24}},loc:{start:{line:222,column:29},end:{line:224,column:15}},line:222},8:{name:"(anonymous_8)",decl:{start:{line:232,column:23},end:{line:232,column:24}},loc:{start:{line:232,column:29},end:{line:234,column:15}},line:232},9:{name:"(anonymous_9)",decl:{start:{line:239,column:23},end:{line:239,column:24}},loc:{start:{line:239,column:29},end:{line:241,column:15}},line:239},10:{name:"(anonymous_10)",decl:{start:{line:249,column:23},end:{line:249,column:24}},loc:{start:{line:249,column:29},end:{line:251,column:15}},line:249},11:{name:"(anonymous_11)",decl:{start:{line:258,column:2},end:{line:258,column:3}},loc:{start:{line:258,column:12},end:{line:260,column:3}},line:258},12:{name:"(anonymous_12)",decl:{start:{line:263,column:13},end:{line:263,column:14}},loc:{start:{line:263,column:25},end:{line:267,column:5}},line:263},13:{name:"(anonymous_13)",decl:{start:{line:268,column:14},end:{line:268,column:15}},loc:{start:{line:268,column:26},end:{line:270,column:5}},line:268},14:{name:"(anonymous_14)",decl:{start:{line:272,column:13},end:{line:272,column:14}},loc:{start:{line:272,column:41},end:{line:290,column:5}},line:272},15:{name:"(anonymous_15)",decl:{start:{line:292,column:4},end:{line:292,column:5}},loc:{start:{line:292,column:20},end:{line:297,column:5}},line:292},16:{name:"(anonymous_16)",decl:{start:{line:298,column:14},end:{line:298,column:15}},loc:{start:{line:298,column:26},end:{line:322,column:5}},line:298},17:{name:"(anonymous_17)",decl:{start:{line:309,column:14},end:{line:309,column:15}},loc:{start:{line:309,column:28},end:{line:314,column:9}},line:309},18:{name:"(anonymous_18)",decl:{start:{line:311,column:21},end:{line:311,column:22}},loc:{start:{line:311,column:27},end:{line:313,column:11}},line:311},19:{name:"(anonymous_19)",decl:{start:{line:315,column:15},end:{line:315,column:16}},loc:{start:{line:315,column:33},end:{line:320,column:9}},line:315},20:{name:"(anonymous_20)",decl:{start:{line:323,column:12},end:{line:323,column:13}},loc:{start:{line:323,column:24},end:{line:325,column:5}},line:323},21:{name:"(anonymous_21)",decl:{start:{line:326,column:20},end:{line:326,column:21}},loc:{start:{line:326,column:40},end:{line:329,column:5}},line:326},22:{name:"(anonymous_22)",decl:{start:{line:330,column:12},end:{line:330,column:13}},loc:{start:{line:330,column:24},end:{line:354,column:5}},line:330},23:{name:"(anonymous_23)",decl:{start:{line:337,column:16},end:{line:337,column:17}},loc:{start:{line:337,column:28},end:{line:341,column:11}},line:337},24:{name:"(anonymous_24)",decl:{start:{line:342,column:16},end:{line:342,column:17}},loc:{start:{line:342,column:30},end:{line:344,column:11}},line:342},25:{name:"(anonymous_25)",decl:{start:{line:345,column:17},end:{line:345,column:18}},loc:{start:{line:345,column:28},end:{line:352,column:11}},line:345},26:{name:"(anonymous_26)",decl:{start:{line:355,column:14},end:{line:355,column:15}},loc:{start:{line:355,column:26},end:{line:380,column:5}},line:355},27:{name:"(anonymous_27)",decl:{start:{line:357,column:60},end:{line:357,column:61}},loc:{start:{line:357,column:74},end:{line:378,column:9}},line:357},28:{name:"(anonymous_28)",decl:{start:{line:381,column:4},end:{line:381,column:5}},loc:{start:{line:381,column:19},end:{line:390,column:5}},line:381},29:{name:"(anonymous_29)",decl:{start:{line:386,column:26},end:{line:386,column:27}},loc:{start:{line:386,column:39},end:{line:386,column:63}},line:386},30:{name:"(anonymous_30)",decl:{start:{line:391,column:24},end:{line:391,column:25}},loc:{start:{line:391,column:36},end:{line:404,column:5}},line:391},31:{name:"(anonymous_31)",decl:{start:{line:400,column:14},end:{line:400,column:15}},loc:{start:{line:400,column:20},end:{line:403,column:9}},line:400},32:{name:"(anonymous_32)",decl:{start:{line:405,column:14},end:{line:405,column:15}},loc:{start:{line:405,column:26},end:{line:407,column:5}},line:405},33:{name:"(anonymous_33)",decl:{start:{line:408,column:16},end:{line:408,column:17}},loc:{start:{line:408,column:28},end:{line:412,column:5}},line:408},34:{name:"(anonymous_34)",decl:{start:{line:413,column:19},end:{line:413,column:20}},loc:{start:{line:413,column:56},end:{line:476,column:5}},line:413},35:{name:"(anonymous_35)",decl:{start:{line:425,column:14},end:{line:425,column:15}},loc:{start:{line:425,column:28},end:{line:461,column:9}},line:425},36:{name:"(anonymous_36)",decl:{start:{line:427,column:49},end:{line:427,column:50}},loc:{start:{line:427,column:60},end:{line:453,column:11}},line:427},37:{name:"(anonymous_37)",decl:{start:{line:431,column:41},end:{line:431,column:42}},loc:{start:{line:431,column:54},end:{line:451,column:15}},line:431},38:{name:"(anonymous_38)",decl:{start:{line:462,column:15},end:{line:462,column:16}},loc:{start:{line:462,column:26},end:{line:475,column:9}},line:462},39:{name:"(anonymous_39)",decl:{start:{line:477,column:20},end:{line:477,column:21}},loc:{start:{line:477,column:36},end:{line:486,column:5}},line:477},40:{name:"(anonymous_40)",decl:{start:{line:482,column:14},end:{line:482,column:15}},loc:{start:{line:482,column:28},end:{line:485,column:7}},line:482},41:{name:"(anonymous_41)",decl:{start:{line:487,column:14},end:{line:487,column:15}},loc:{start:{line:487,column:48},end:{line:490,column:5}},line:487}},branchMap:{0:{loc:{start:{line:274,column:6},end:{line:289,column:7}},type:"if",locations:[{start:{line:274,column:6},end:{line:289,column:7}},{start:{line:281,column:13},end:{line:289,column:7}}],line:274},1:{loc:{start:{line:275,column:8},end:{line:280,column:9}},type:"if",locations:[{start:{line:275,column:8},end:{line:280,column:9}},{start:{line:278,column:15},end:{line:280,column:9}}],line:275},2:{loc:{start:{line:331,column:6},end:{line:353,column:7}},type:"if",locations:[{start:{line:331,column:6},end:{line:353,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:331},3:{loc:{start:{line:346,column:12},end:{line:351,column:13}},type:"if",locations:[{start:{line:346,column:12},end:{line:351,column:13}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:346},4:{loc:{start:{line:356,column:6},end:{line:379,column:7}},type:"if",locations:[{start:{line:356,column:6},end:{line:379,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:356},5:{loc:{start:{line:409,column:6},end:{line:411,column:7}},type:"if",locations:[{start:{line:409,column:6},end:{line:411,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:409},6:{loc:{start:{line:409,column:10},end:{line:409,column:48}},type:"binary-expr",locations:[{start:{line:409,column:10},end:{line:409,column:30}},{start:{line:409,column:34},end:{line:409,column:48}}],line:409},7:{loc:{start:{line:413,column:29},end:{line:413,column:54}},type:"default-arg",locations:[{start:{line:413,column:50},end:{line:413,column:54}}],line:413},8:{loc:{start:{line:414,column:6},end:{line:418,column:7}},type:"if",locations:[{start:{line:414,column:6},end:{line:418,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:414},9:{loc:{start:{line:436,column:16},end:{line:450,column:17}},type:"if",locations:[{start:{line:436,column:16},end:{line:450,column:17}},{start:{line:443,column:23},end:{line:450,column:17}}],line:436},10:{loc:{start:{line:455,column:10},end:{line:460,column:11}},type:"if",locations:[{start:{line:455,column:10},end:{line:460,column:11}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:455},11:{loc:{start:{line:463,column:10},end:{line:474,column:11}},type:"if",locations:[{start:{line:463,column:10},end:{line:474,column:11}},{start:{line:469,column:17},end:{line:474,column:11}}],line:463}},s:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0,42:0,43:0,44:0,45:0,46:0,47:0,48:0,49:0,50:0,51:0,52:0,53:0,54:0,55:0,56:0,57:0,58:0,59:0,60:0,61:0,62:0,63:0,64:0,65:0,66:0,67:0,68:0,69:0,70:0,71:0,72:0,73:0,74:0,75:0,76:0,77:0,78:0,79:0,80:0,81:0,82:0,83:0,84:0,85:0,86:0,87:0,88:0,89:0,90:0,91:0,92:0,93:0,94:0,95:0,96:0,97:0,98:0,99:0,100:0,101:0,102:0,103:0},f:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0},b:{0:[0,0],1:[0,0],2:[0,0],3:[0,0],4:[0,0],5:[0,0],6:[0,0],7:[0],8:[0,0],9:[0,0],10:[0,0],11:[0,0]},inputSourceMap:{version:3,sources:["TableManager.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkJA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableManager.vue",sourceRoot:"src/tools/TableManager",sourcesContent:["\x3c!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This program may also be used under the terms of a commercial or\n# enterprise edition license of COSMOS if purchased from the\n# copyright holder\n--\x3e\n\n<template>\n <div>\n <top-bar :menus=\"menus\" :title=\"title\" />\n <v-snackbar v-model=\"showReadOnlyToast\" top :timeout=\"-1\" color=\"orange\">\n <v-icon> mdi-pencil-off </v-icon>\n {{ lockedBy }} is editing this script. Editor is in read-only mode\n <template v-slot:action=\"{ attrs }\">\n <v-btn\n text\n v-bind=\"attrs\"\n color=\"danger\"\n @click=\"confirmLocalUnlock\"\n data-test=\"unlock-button\"\n >\n Unlock\n </v-btn>\n <v-btn\n text\n v-bind=\"attrs\"\n @click=\"\n () => {\n showReadOnlyToast = false\n }\n \"\n >\n dismiss\n </v-btn>\n </template>\n </v-snackbar>\n <v-file-input\n show-size\n v-model=\"fileInput\"\n ref=\"fileInput\"\n accept=\".bin\"\n data-test=\"file-input\"\n style=\"position: fixed; top: -100%\"\n />\n <v-text-field\n outlined\n dense\n readonly\n hide-details\n label=\"Definition\"\n v-model=\"definitionFilename\"\n id=\"definition-filename\"\n data-test=\"definition-filename\"\n />\n <v-text-field\n outlined\n dense\n readonly\n hide-details\n label=\"Filename\"\n v-model=\"fullFilename\"\n id=\"filename\"\n data-test=\"filename\"\n />\n <v-card>\n <v-card-title>\n Items\n <v-spacer />\n <v-text-field\n v-model=\"search\"\n append-icon=\"mdi-magnify\"\n label=\"Search\"\n single-line\n hide-details\n />\n </v-card-title>\n <v-tabs v-model=\"curTab\">\n <v-tab v-for=\"(table, index) in tables\" :key=\"index\">\n {{ table.name }}\n </v-tab>\n </v-tabs>\n <v-tabs-items v-model=\"curTab\">\n <v-tab-item\n v-for=\"(table, index) in tables\"\n :key=\"`${filename}${index}`\"\n >\n <v-data-table\n :headers=\"table.headers\"\n :items=\"table.rows\"\n :search=\"search\"\n calculate-widths\n disable-pagination\n hide-default-footer\n multi-sort\n dense\n >\n <template v-slot:item=\"{ item }\">\n <table-row\n :items=\"item\"\n :key=\"JSON.stringify(item[0])\"\n @change=\"onChange(item, $event)\"\n />\n </template>\n </v-data-table>\n </v-tab-item>\n </v-tabs-items>\n </v-card>\n <file-open-save-dialog\n v-if=\"fileOpen\"\n v-model=\"fileOpen\"\n type=\"open\"\n api-url=\"/cosmos-api/tables\"\n @file=\"setFile($event)\"\n @error=\"setError($event)\"\n />\n <file-open-save-dialog\n v-if=\"showSaveAs\"\n v-model=\"showSaveAs\"\n type=\"save\"\n require-target-parent-dir\n api-url=\"/cosmos-api/tables\"\n :input-filename=\"filename\"\n @filename=\"saveAsFilename($event)\"\n @error=\"setError($event)\"\n />\n <simple-text-dialog\n v-model=\"showError\"\n :title=\"errorTitle\"\n :text=\"errorText\"\n />\n </div>\n</template>\n\n<script>\nimport Api from '@cosmosc2/tool-common/src/services/api'\nimport { CosmosApi } from '@cosmosc2/tool-common/src/services/cosmos-api'\nimport TopBar from '@cosmosc2/tool-common/src/components/TopBar'\nimport TableRow from '@/tools/TableManager/TableRow'\nimport FileOpenSaveDialog from '@cosmosc2/tool-common/src/components/FileOpenSaveDialog'\nimport SimpleTextDialog from '@cosmosc2/tool-common/src/components/SimpleTextDialog'\n\nexport default {\n components: {\n TopBar,\n TableRow,\n FileOpenSaveDialog,\n SimpleTextDialog,\n },\n data() {\n return {\n title: 'Table Manager',\n search: '',\n curTab: null,\n tables: [],\n api: null,\n definition: null,\n fileInput: '',\n definitionFilename: '',\n fileNew: false,\n filename: '',\n fileModified: '',\n lockedBy: null,\n fileOpen: false,\n showSave: false,\n showSaveAs: false,\n showError: false,\n errorTitle: '',\n errorText: '',\n }\n },\n computed: {\n readOnly: function () {\n return !!this.lockedBy\n },\n fullFilename() {\n return `${this.filename} ${this.fileModified}`.trim()\n },\n menus: function () {\n return [\n {\n label: 'File',\n items: [\n {\n label: 'New File',\n icon: 'mdi-file-plus',\n command: () => {\n this.newFile()\n },\n },\n {\n label: 'Open File',\n icon: 'mdi-folder-open',\n command: () => {\n this.openFile()\n },\n },\n {\n divider: true,\n },\n {\n label: 'Save File',\n icon: 'mdi-content-save',\n command: () => {\n this.saveFile()\n },\n },\n {\n label: 'Save As...',\n icon: 'mdi-content-save',\n command: () => {\n this.saveAs()\n },\n },\n {\n divider: true,\n },\n {\n label: 'Upload',\n icon: 'mdi-cloud-upload',\n command: () => {\n this.upload()\n },\n },\n {\n label: 'Download',\n icon: 'mdi-cloud-download',\n command: () => {\n this.download()\n },\n },\n {\n divider: true,\n },\n {\n label: 'Delete File',\n icon: 'mdi-delete',\n command: () => {\n this.delete()\n },\n },\n ],\n },\n ]\n },\n },\n created() {\n this.api = new CosmosApi()\n },\n methods: {\n // File menu actions\n newFile: function () {\n this.fileModified = ''\n this.fileNew = true\n this.fileOpen = true\n },\n openFile: function () {\n this.fileOpen = true\n },\n // Called by the FileOpenDialog to set the file contents\n setFile: function ({ file, locked }) {\n // They opened a definition file so create a new binary\n if (file.name.includes('.txt')) {\n if (this.fileNew) {\n this.buildNewBinary(file)\n this.fileNew = false\n } else {\n this.getDefinition(file.name)\n }\n } else {\n this.unlockFile() // first unlock what was just being edited\n // Split off the ' *' which indicates a file is modified on the server\n this.filename = file.name.split('*')[0]\n this.fileModified = ''\n this.lockedBy = locked\n\n this.getDefinition()\n }\n },\n // Called by the FileOpenSaveDialog on error\n setError(event) {\n this.errorTitle = 'Error'\n this.errorText = `Error: ${event}`\n this.errorText = response.data.message\n this.showError = true\n },\n saveFile: function () {\n // Save a file by posting the new contents\n this.showSave = true\n\n const formData = new FormData()\n formData.append('binary', this.filename)\n formData.append('definition', this.definitionFilename)\n formData.append('tables', JSON.stringify(this.tables))\n Api.post(`/cosmos-api/tables/${this.filename}`, {\n data: formData,\n })\n .then((response) => {\n this.fileModified = ''\n setTimeout(() => {\n this.showSave = false\n }, 2000)\n })\n .catch(({ response }) => {\n this.showSave = false\n this.errorTitle = 'Save Error'\n this.errorText = response.data.message\n this.showError = true\n })\n this.lockFile() // Ensure this file is locked for editing\n },\n saveAs: function () {\n this.showSaveAs = true\n },\n saveAsFilename: function (filename) {\n this.filename = filename\n this.saveFile()\n },\n delete: function () {\n if (this.filename !== '') {\n this.$dialog\n .confirm(`Permanently delete file: ${this.filename}`, {\n okText: 'Delete',\n cancelText: 'Cancel',\n })\n .then((dialog) => {\n return Api.delete(`/cosmos-api/tables/${this.filename}`, {\n data: {},\n })\n })\n .then((response) => {\n this.newFile()\n })\n .catch((error) => {\n if (error) {\n this.$notify.caution({\n title: 'Error',\n body: `Error deleting file: ${error}`,\n })\n }\n })\n }\n },\n download: function () {\n if (this.filename !== '') {\n Api.get(`/cosmos-api/tables/${this.filename}`).then((response) => {\n // Decode Base64 string\n const decodedData = window.atob(response.data.contents)\n // Create UNIT8ARRAY of size same as row data length\n const uInt8Array = new Uint8Array(decodedData.length)\n // Insert all character code into uInt8Array\n for (let i = 0; i < decodedData.length; ++i) {\n uInt8Array[i] = decodedData.charCodeAt(i)\n }\n // Return BLOB image after conversion\n const blob = new Blob([uInt8Array], {\n type: 'application/octet-stream',\n })\n // Make a link and then 'click' on it to start the download\n const link = document.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.setAttribute(\n 'download',\n this.filename.substring(this.filename.lastIndexOf('/') + 1)\n )\n link.click()\n })\n }\n },\n async upload() {\n this.fileInput = ''\n this.$refs.fileInput.$refs.input.click()\n // Wait for the file to be set by the dialog so upload works\n while (this.fileInput === '') {\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n this.filename = this.fileInput.name\n this.saveAs()\n },\n confirmLocalUnlock: function () {\n this.$dialog\n .confirm(\n 'Are you sure you want to unlock this file for editing? If another user is editing this file, your changes might conflict with each other.',\n {\n okText: 'Force Unlock',\n cancelText: 'Cancel',\n }\n )\n .then(() => {\n this.lockedBy = null\n return this.lockFile() // Re-lock it as this user so it's locked for anyone else who opens it\n })\n },\n lockFile: function () {\n return Api.post(`/cosmos-api/tables/${this.filename}/lock`)\n },\n unlockFile: function () {\n if (this.filename !== '' && !this.readOnly) {\n Api.post(`/cosmos-api/tables/${this.filename}/unlock`)\n }\n },\n getDefinition: function (definitionFilename = null) {\n if (!definitionFilename) {\n definitionFilename = this.filename\n .replace('/bin/', '/config/')\n .replace('.bin', '_def.txt')\n }\n const formData = new FormData()\n formData.append('binary', this.filename)\n formData.append('definition', definitionFilename)\n Api.post(`/cosmos-api/tables/load`, {\n data: formData,\n })\n .then((response) => {\n this.definitionFilename = definitionFilename\n this.tables = response.data.tables.map((table) => {\n return {\n ...table,\n // Build up the headers for proper searching\n headers: table.headers.map((text, i) => {\n const header = {\n text,\n filterable: text !== 'INDEX',\n }\n if (table.numColumns === 1) {\n // In the 1D table the searchable value is the first value in the row\n // Note the names in 1D are INDEX, NAME, VALUE\n return {\n ...header,\n value: `[0].${text.toLowerCase()}`,\n }\n } else {\n // In the 2D table the searchable value is always in the value attribute\n // of the current column item\n return {\n ...header,\n value: `[${i}].value`,\n }\n }\n }),\n }\n })\n\n if (response.data['errors']) {\n this.$notify.caution({\n title: 'Warning',\n body: response.data['errors'],\n })\n }\n })\n .catch((error) => {\n if (error.response.status == 404) {\n this.$notify.normal({\n title: 'Definition File Not Found',\n body: `Definition file ${definitionFilename} not found. Please select definition file.`,\n })\n this.fileOpen = true\n } else {\n this.$notify.serious({\n title: 'Error',\n body: `Error loading due to ${error.response.statusText}. Status: ${error.response.status}`,\n })\n }\n })\n },\n buildNewBinary: function (file) {\n const formData = new FormData()\n formData.append('contents', file.contents)\n Api.post(`/cosmos-api/tables/${file.name}/generate`, {\n data: formData,\n }).then((response) => {\n this.filename = response.data.filename\n this.getDefinition(file.name)\n })\n },\n onChange: function (item, { index, event }) {\n this.fileModified = '*'\n item[index].value = event\n },\n },\n}\n<\/script>\n"]},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"1e3b314010b0a1f11b4e3ba37696a43cb2aacfa1"},o=t[l]||(t[l]={});o[e]&&o[e].hash===n||(o[e]=i);var a=o[e];return ie=function(){return a},a}ie();var oe={components:{TopBar:S,TableRow:q,FileOpenSaveDialog:J,SimpleTextDialog:le},data:function(){return ie().f[0]++,ie().s[0]++,{title:"Table Manager",search:"",curTab:null,tables:[],api:null,definition:null,fileInput:"",definitionFilename:"",fileNew:!1,filename:"",fileModified:"",lockedBy:null,fileOpen:!1,showSave:!1,showSaveAs:!1,showError:!1,errorTitle:"",errorText:""}},computed:{readOnly:function(){return ie().f[1]++,ie().s[1]++,!!this.lockedBy},fullFilename:function(){return ie().f[2]++,ie().s[2]++,"".concat(this.filename," ").concat(this.fileModified).trim()},menus:function(){var e=this;return ie().f[3]++,ie().s[3]++,[{label:"File",items:[{label:"New File",icon:"mdi-file-plus",command:function(){ie().f[4]++,ie().s[4]++,e.newFile()}},{label:"Open File",icon:"mdi-folder-open",command:function(){ie().f[5]++,ie().s[5]++,e.openFile()}},{divider:!0},{label:"Save File",icon:"mdi-content-save",command:function(){ie().f[6]++,ie().s[6]++,e.saveFile()}},{label:"Save As...",icon:"mdi-content-save",command:function(){ie().f[7]++,ie().s[7]++,e.saveAs()}},{divider:!0},{label:"Upload",icon:"mdi-cloud-upload",command:function(){ie().f[8]++,ie().s[8]++,e.upload()}},{label:"Download",icon:"mdi-cloud-download",command:function(){ie().f[9]++,ie().s[9]++,e.download()}},{divider:!0},{label:"Delete File",icon:"mdi-delete",command:function(){ie().f[10]++,ie().s[10]++,e.delete()}}]}]}},created:function(){ie().f[11]++,ie().s[11]++,this.api=new y},methods:{newFile:function(){ie().f[12]++,ie().s[12]++,this.fileModified="",ie().s[13]++,this.fileNew=!0,ie().s[14]++,this.fileOpen=!0},openFile:function(){ie().f[13]++,ie().s[15]++,this.fileOpen=!0},setFile:function(e){var n=e.file,t=e.locked;ie().f[14]++,ie().s[16]++,n.name.includes(".txt")?(ie().b[0][0]++,ie().s[17]++,this.fileNew?(ie().b[1][0]++,ie().s[18]++,this.buildNewBinary(n),ie().s[19]++,this.fileNew=!1):(ie().b[1][1]++,ie().s[20]++,this.getDefinition(n.name))):(ie().b[0][1]++,ie().s[21]++,this.unlockFile(),ie().s[22]++,this.filename=n.name.split("*")[0],ie().s[23]++,this.fileModified="",ie().s[24]++,this.lockedBy=t,ie().s[25]++,this.getDefinition())},setError:function(e){ie().f[15]++,ie().s[26]++,this.errorTitle="Error",ie().s[27]++,this.errorText="Error: ".concat(e),ie().s[28]++,this.errorText=response.data.message,ie().s[29]++,this.showError=!0},saveFile:function(){var e=this;ie().f[16]++,ie().s[30]++,this.showSave=!0;var n=(ie().s[31]++,new FormData);ie().s[32]++,n.append("binary",this.filename),ie().s[33]++,n.append("definition",this.definitionFilename),ie().s[34]++,n.append("tables",JSON.stringify(this.tables)),ie().s[35]++,p.post("/cosmos-api/tables/".concat(this.filename),{data:n}).then((function(n){ie().f[17]++,ie().s[36]++,e.fileModified="",ie().s[37]++,setTimeout((function(){ie().f[18]++,ie().s[38]++,e.showSave=!1}),2e3)})).catch((function(n){var t=n.response;ie().f[19]++,ie().s[39]++,e.showSave=!1,ie().s[40]++,e.errorTitle="Save Error",ie().s[41]++,e.errorText=t.data.message,ie().s[42]++,e.showError=!0})),ie().s[43]++,this.lockFile()},saveAs:function(){ie().f[20]++,ie().s[44]++,this.showSaveAs=!0},saveAsFilename:function(e){ie().f[21]++,ie().s[45]++,this.filename=e,ie().s[46]++,this.saveFile()},delete:function(){var e=this;ie().f[22]++,ie().s[47]++,""!==this.filename?(ie().b[2][0]++,ie().s[48]++,this.$dialog.confirm("Permanently delete file: ".concat(this.filename),{okText:"Delete",cancelText:"Cancel"}).then((function(n){return ie().f[23]++,ie().s[49]++,p["delete"]("/cosmos-api/tables/".concat(e.filename),{data:{}})})).then((function(n){ie().f[24]++,ie().s[50]++,e.newFile()})).catch((function(n){ie().f[25]++,ie().s[51]++,n?(ie().b[3][0]++,ie().s[52]++,e.$notify.caution({title:"Error",body:"Error deleting file: ".concat(n)})):ie().b[3][1]++}))):ie().b[2][1]++},download:function(){var e=this;ie().f[26]++,ie().s[53]++,""!==this.filename?(ie().b[4][0]++,ie().s[54]++,p.get("/cosmos-api/tables/".concat(this.filename)).then((function(n){ie().f[27]++;var t=(ie().s[55]++,window.atob(n.data.contents)),l=(ie().s[56]++,new Uint8Array(t.length));ie().s[57]++;for(var i=(ie().s[58]++,0);i<t.length;++i)ie().s[59]++,l[i]=t.charCodeAt(i);var o=(ie().s[60]++,new Blob([l],{type:"application/octet-stream"})),a=(ie().s[61]++,document.createElement("a"));ie().s[62]++,a.href=URL.createObjectURL(o),ie().s[63]++,a.setAttribute("download",e.filename.substring(e.filename.lastIndexOf("/")+1)),ie().s[64]++,a.click()}))):ie().b[4][1]++},upload:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:ie().f[28]++,ie().s[65]++,e.fileInput="",ie().s[66]++,e.$refs.fileInput.$refs.input.click(),ie().s[67]++;case 6:if(""!==e.fileInput){n.next=12;break}return ie().s[68]++,n.next=10,new Promise((function(e){return ie().f[29]++,ie().s[69]++,setTimeout(e,500)}));case 10:n.next=6;break;case 12:ie().s[70]++,e.filename=e.fileInput.name,ie().s[71]++,e.saveAs();case 16:case"end":return n.stop()}}),n)})))()},confirmLocalUnlock:function(){var e=this;ie().f[30]++,ie().s[72]++,this.$dialog.confirm("Are you sure you want to unlock this file for editing? If another user is editing this file, your changes might conflict with each other.",{okText:"Force Unlock",cancelText:"Cancel"}).then((function(){return ie().f[31]++,ie().s[73]++,e.lockedBy=null,ie().s[74]++,e.lockFile()}))},lockFile:function(){return ie().f[32]++,ie().s[75]++,p.post("/cosmos-api/tables/".concat(this.filename,"/lock"))},unlockFile:function(){ie().f[33]++,ie().s[76]++,ie().b[6][0]++,""===this.filename||(ie().b[6][1]++,this.readOnly)?ie().b[5][1]++:(ie().b[5][0]++,ie().s[77]++,p.post("/cosmos-api/tables/".concat(this.filename,"/unlock")))},getDefinition:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(ie().b[7][0]++,null);ie().f[34]++,ie().s[78]++,n?ie().b[8][1]++:(ie().b[8][0]++,ie().s[79]++,n=this.filename.replace("/bin/","/config/").replace(".bin","_def.txt"));var t=(ie().s[80]++,new FormData);ie().s[81]++,t.append("binary",this.filename),ie().s[82]++,t.append("definition",n),ie().s[83]++,p.post("/cosmos-api/tables/load",{data:t}).then((function(t){ie().f[35]++,ie().s[84]++,e.definitionFilename=n,ie().s[85]++,e.tables=t.data.tables.map((function(e){return ie().f[36]++,ie().s[86]++,(0,o.Z)((0,o.Z)({},e),{},{headers:e.headers.map((function(n,t){ie().f[37]++;var l=(ie().s[87]++,{text:n,filterable:"INDEX"!==n});return ie().s[88]++,1===e.numColumns?(ie().b[9][0]++,ie().s[89]++,(0,o.Z)((0,o.Z)({},l),{},{value:"[0].".concat(n.toLowerCase())})):(ie().b[9][1]++,ie().s[90]++,(0,o.Z)((0,o.Z)({},l),{},{value:"[".concat(t,"].value")}))}))})})),ie().s[91]++,t.data["errors"]?(ie().b[10][0]++,ie().s[92]++,e.$notify.caution({title:"Warning",body:t.data["errors"]})):ie().b[10][1]++})).catch((function(t){ie().f[38]++,ie().s[93]++,404==t.response.status?(ie().b[11][0]++,ie().s[94]++,e.$notify.normal({title:"Definition File Not Found",body:"Definition file ".concat(n," not found. Please select definition file.")}),ie().s[95]++,e.fileOpen=!0):(ie().b[11][1]++,ie().s[96]++,e.$notify.serious({title:"Error",body:"Error loading due to ".concat(t.response.statusText,". Status: ").concat(t.response.status)}))}))},buildNewBinary:function(e){var n=this;ie().f[39]++;var t=(ie().s[97]++,new FormData);ie().s[98]++,t.append("contents",e.contents),ie().s[99]++,p.post("/cosmos-api/tables/".concat(e.name,"/generate"),{data:t}).then((function(t){ie().f[40]++,ie().s[100]++,n.filename=t.data.filename,ie().s[101]++,n.getDefinition(e.name)}))},onChange:function(e,n){var t=n.index,l=n.event;ie().f[41]++,ie().s[102]++,this.fileModified="*",ie().s[103]++,e[t].value=l}}},ae=oe,se=(0,F.Z)(ae,l,i,!1,null,null,null),ce=se.exports},3938:function(e,n,t){"use strict";t.r(n);var l=t(3467),i=t.n(l),o=t(8715),a=t.n(o),s=a()(i());s.push([e.id,".v-list[data-v-e3bb7458] .v-label{margin-left:5px}.v-list-item__icon[data-v-e3bb7458]{margin-right:15px!important}.v-list-item__title[data-v-e3bb7458]{color:#fff}",""]),n["default"]=s},7162:function(e,n,t){var l=t(3938);l.__esModule&&(l=l.default),"string"===typeof l&&(l=[[e.id,l,""]]),l.locals&&(e.exports=l.locals);var i=t(3514).Z;i("a2f2c426",l,!0,{sourceMap:!1,shadowMode:!1})}}]);
1
+ (self["webpackChunk_cosmosc2_tool_tablemanager"]=self["webpackChunk_cosmosc2_tool_tablemanager"]||[]).push([[550],{9550:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return re}});var l=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",[t("top-bar",{attrs:{menus:e.menus,title:e.title}}),t("v-snackbar",{attrs:{top:"",timeout:-1,color:"orange"},scopedSlots:e._u([{key:"action",fn:function(n){var l=n.attrs;return[t("v-btn",e._b({attrs:{text:"",color:"danger","data-test":"unlock-button"},on:{click:e.confirmLocalUnlock}},"v-btn",l,!1),[e._v(" Unlock ")]),t("v-btn",e._b({attrs:{text:""},on:{click:function(){e.showReadOnlyToast=!1}}},"v-btn",l,!1),[e._v(" dismiss ")])]}}]),model:{value:e.showReadOnlyToast,callback:function(n){e.showReadOnlyToast=n},expression:"showReadOnlyToast"}},[t("v-icon",[e._v(" mdi-pencil-off ")]),e._v(" "+e._s(e.lockedBy)+" is editing this script. Editor is in read-only mode ")],1),t("v-file-input",{ref:"fileInput",staticStyle:{position:"fixed",top:"-100%"},attrs:{"show-size":"",accept:".bin","data-test":"file-input"},model:{value:e.fileInput,callback:function(n){e.fileInput=n},expression:"fileInput"}}),t("v-text-field",{attrs:{outlined:"",dense:"",readonly:"","hide-details":"",label:"Definition",id:"definition-filename","data-test":"definition-filename"},model:{value:e.definitionFilename,callback:function(n){e.definitionFilename=n},expression:"definitionFilename"}}),t("v-text-field",{attrs:{outlined:"",dense:"",readonly:"","hide-details":"",label:"Filename",id:"filename","data-test":"filename"},model:{value:e.fullFilename,callback:function(n){e.fullFilename=n},expression:"fullFilename"}}),t("v-card",[t("v-card-title",[e._v(" Items "),t("v-spacer"),t("v-text-field",{attrs:{"append-icon":"mdi-magnify",label:"Search","single-line":"","hide-details":""},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}})],1),t("v-tabs",{model:{value:e.curTab,callback:function(n){e.curTab=n},expression:"curTab"}},e._l(e.tables,(function(n,l){return t("v-tab",{key:l},[e._v(" "+e._s(n.name)+" ")])})),1),t("v-tabs-items",{model:{value:e.curTab,callback:function(n){e.curTab=n},expression:"curTab"}},e._l(e.tables,(function(n,l){return t("v-tab-item",{key:""+e.filename+l},[t("v-data-table",{attrs:{headers:n.headers,items:n.rows,search:e.search,"calculate-widths":"","disable-pagination":"","hide-default-footer":"","multi-sort":"",dense:""},scopedSlots:e._u([{key:"item",fn:function(n){var l=n.item;return[t("table-row",{key:JSON.stringify(l[0]),attrs:{items:l},on:{change:function(n){return e.onChange(l,n)}}})]}}],null,!0)})],1)})),1)],1),e.fileOpen?t("file-open-save-dialog",{attrs:{type:"open","api-url":"/cosmos-api/tables"},on:{file:function(n){return e.setFile(n)},error:function(n){return e.setError(n)}},model:{value:e.fileOpen,callback:function(n){e.fileOpen=n},expression:"fileOpen"}}):e._e(),e.showSaveAs?t("file-open-save-dialog",{attrs:{type:"save","require-target-parent-dir":"","api-url":"/cosmos-api/tables","input-filename":e.filename},on:{filename:function(n){return e.saveAsFilename(n)},error:function(n){return e.setError(n)}},model:{value:e.showSaveAs,callback:function(n){e.showSaveAs=n},expression:"showSaveAs"}}):e._e(),t("simple-text-dialog",{attrs:{title:e.errorTitle,text:e.errorText},model:{value:e.showError,callback:function(n){e.showError=n},expression:"showError"}})],1)},i=[],o=t(8373),a=t(1720),s=t(9490),c=(t(5794),t(8178),t(9529),t(1235),t(7950),t(8319),t(6710),t(4707),t(1497),t(5640),t(1871),t(8188),t(3675),t(4898),t(5825),t(7170),t(8857),t(8329),t(6279),t(427),t(1159),t(2516),t(4349),t(5273),t(6729),t(1801),t(574),t(5787),t(9271),t(3160),t(5688),t(3157),t(3333),t(315),t(556),t(9224),t(8673),t(6886),t(4121),t(523),t(4660),t(5940),t(3450),t(9644)),r=t.n(c),u=t(4091),m=new u["default"],A=r().create({baseURL:location.origin,timeout:1e4,params:{}});A.interceptors.response.use((function(e){return e}),(function(e){if(401===e.response.status)delete localStorage.cosmosToken,CosmosAuth.login(location.href);else{var n,t,l,i,o,a,s,c,r,u,A="HTTP ".concat(e.response.status," - ");if(null!==(n=e.response)&&void 0!==n&&n.statusText&&(A+="".concat(e.response.statusText," ")),null!==(t=e.response)&&void 0!==t&&null!==(l=t.config)&&void 0!==l&&l.data&&(A+="".concat(e.response.config.data," ")),null!==(i=e.response)&&void 0!==i&&null!==(o=i.data)&&void 0!==o&&o.message)A+="".concat(e.response.data.message);else if(null!==(a=e.response)&&void 0!==a&&null!==(s=a.data)&&void 0!==s&&s.exception)A+="".concat(e.response.data.exception);else if(null!==(c=e.response)&&void 0!==c&&null!==(r=c.data)&&void 0!==r&&null!==(u=r.error)&&void 0!==u&&u.message)e.response.data.error.class&&(A+="".concat(e.response.data.error.class," ")),A+="".concat(e.response.data.error.message);else{var d;A+="".concat(null===(d=e.response)||void 0===d?void 0:d.data)}m.$notify.serious({title:"Network error",body:A})}throw e}));var d=A,f=function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n,t){var l,i,o,s,c,r,u,m,A,f=arguments;return(0,a.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(l=f.length>2&&void 0!==f[2]?f[2]:{},i=l.data,o=l.params,s=void 0===o?{}:o,c=l.headers,r=l.noAuth,u=void 0!==r&&r,m=l.noScope,A=void 0!==m&&m,u){e.next=11;break}return e.prev=2,e.next=5,CosmosAuth.updateToken(CosmosAuth.defaultMinValidity);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](2),CosmosAuth.login();case 10:c["Authorization"]=localStorage.cosmosToken;case 11:return A||s["scope"]||(s["scope"]=localStorage.scope),e.abrupt("return",d({method:n,url:t,data:i,params:s,headers:c}));case 13:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(n,t){return e.apply(this,arguments)}}(),h={Accept:"application/json"},p=(0,o.Z)((0,o.Z)({},h),{},{"Content-Type":"application/json"}),v={get:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.params,l=n.headers,i=void 0===l?h:l,o=n.noScope,a=n.noAuth;return f("get",e,{params:t,headers:i,noScope:o,noAuth:a})},put:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.data,l=n.params,i=n.headers,o=void 0===i?p:i,a=n.noScope,s=n.noAuth;return f("put",e,{data:t,params:l,headers:o,noScope:a,noAuth:s})},post:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.data,l=n.params,i=n.headers,o=void 0===i?p:i,a=n.noScope,s=n.noAuth;return f("post",e,{data:t,params:l,headers:o,noScope:a,noAuth:s})},delete:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.params,l=n.headers,i=void 0===l?h:l,o=n.noScope,a=n.noAuth;return f("delete",e,{params:t,headers:i,noScope:o,noAuth:a})}},C=t(570),b=t(7475),_=t(6330),g=t(2209),y=t(3696),k=(t(1372),t(1245),function(){function e(){(0,_.Z)(this,e),(0,y.Z)(this,"id",1)}return(0,g.Z)(e,[{key:"exec",value:function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n,t){var l,i,o,s=arguments;return(0,a.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return l=s.length>2&&void 0!==s[2]?s[2]:{},e.prev=1,e.next=4,CosmosAuth.updateToken(CosmosAuth.defaultMinValidity);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e["catch"](1),CosmosAuth.login();case 9:return this.id=this.id+1,e.prev=10,l["scope"]=localStorage.scope,e.next=14,d.post("/cosmos-api/api",{jsonrpc:"2.0",method:n,params:t,id:this.id,keyword_params:l},{headers:{Authorization:localStorage.cosmosToken,"Content-Type":"application/json-rpc"}});case 14:return i=e.sent,e.abrupt("return",i.data.result);case 18:throw e.prev=18,e.t1=e["catch"](10),o=new Error,e.t1.response?(o.name=e.t1.response.data.error.data.class,o.message=e.t1.response.data.error.data.message):e.t1.request?(o.name="Request error",o.message="Request error, no response received"):o.name="Unknown error",o;case 23:case"end":return e.stop()}}),e,this,[[1,6],[10,18]])})));function n(n,t){return e.apply(this,arguments)}return n}()},{key:"decode_cosmos_type",value:function(e){if(null!==e&&"object"===(0,b.Z)(e)&&"Float"==e.json_class&&e.raw){if("NaN"==e.raw)return NaN;if("Infinity"==e.raw)return 1/0;if("-Infinity"==e.raw)return-1/0}return null}},{key:"encode_cosmos_type",value:function(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}},{key:"get_all_interface_info",value:function(){return this.exec("get_all_interface_info",[])}},{key:"connect_interface",value:function(e){return this.exec("connect_interface",[e])}},{key:"disconnect_interface",value:function(e){return this.exec("disconnect_interface",[e])}},{key:"get_all_router_info",value:function(){return this.exec("get_all_router_info",[])}},{key:"connect_router",value:function(e){return this.exec("connect_router",[e])}},{key:"disconnect_router",value:function(e){return this.exec("disconnect_router",[e])}},{key:"get_all_target_info",value:function(){return this.exec("get_all_target_info",[])}},{key:"get_all_cmd_info",value:function(){return this.exec("get_all_cmd_info",[])}},{key:"get_all_tlm_info",value:function(){return this.exec("get_all_tlm_info",[])}},{key:"get_item",value:function(e,n,t){return this.exec("get_item",[e,n,t])}},{key:"get_parameter",value:function(e,n,t){return this.exec("get_parameter",[e,n,t])}},{key:"get_all_packet_logger_info",value:function(){return this.exec("get_all_packet_logger_info",[])}},{key:"start_logging",value:function(){return this.exec("start_logging",[])}},{key:"stop_logging",value:function(){return this.exec("stop_logging",[])}},{key:"start_cmd_log",value:function(e){return this.exec("start_cmd_log",[e])}},{key:"start_tlm_log",value:function(e){return this.exec("start_tlm_log",[e])}},{key:"stop_cmd_log",value:function(e){return this.exec("stop_cmd_log",[e])}},{key:"stop_tlm_log",value:function(e){return this.exec("stop_tlm_log",[e])}},{key:"get_server_status",value:function(){return this.exec("get_server_status",[])}},{key:"get_limits_sets",value:function(){return this.exec("get_limits_sets",[])}},{key:"get_limits_set",value:function(){return this.exec("get_limits_set",[])}},{key:"set_limits_set",value:function(e){return this.exec("set_limits_set",[e])}},{key:"get_background_tasks",value:function(){return this.exec("get_background_tasks",[])}},{key:"start_background_task",value:function(e){return this.exec("start_background_task",[e])}},{key:"stop_background_task",value:function(e){return this.exec("stop_background_task",[e])}},{key:"get_oldest_logfile",value:function(){return this.exec("get_oldest_logfile",[])}},{key:"get_target",value:function(e){return this.exec("get_target",[e])}},{key:"get_target_list",value:function(){return this.exec("get_target_list",[])}},{key:"get_telemetry",value:function(e,n){return this.exec("get_telemetry",[e,n])}},{key:"get_all_telemetry",value:function(e){return this.exec("get_all_telemetry",[e])}},{key:"get_all_telemetry_list",value:function(e){return this.exec("get_all_telemetry_list",[e])}},{key:"get_tlm_packet",value:function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n,t,l){var i,o,s,c;return(0,a.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.exec("get_tlm_packet",[n,t],{type:l});case 2:if(i=e.sent,null!=i)for(o=i.length,s=null,c=0;c<o;c++)s=this.decode_cosmos_type(i[c][1]),null!==s&&(i[c][1]=s);return e.abrupt("return",i);case 5:case"end":return e.stop()}}),e,this)})));function n(n,t,l){return e.apply(this,arguments)}return n}()},{key:"get_packet_derived_items",value:function(e,n){return this.exec("get_packet_derived_items",[e,n])}},{key:"get_tlm_buffer",value:function(e,n){return this.exec("get_tlm_buffer",[e,n])}},{key:"get_tlm_values",value:function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n){var t,l,i,o;return(0,a.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.exec("get_tlm_values",[n]);case 2:for(t=e.sent,l=t[0].length,i=null,o=0;o<l;o++)i=this.decode_cosmos_type(t[0][o]),null!==i&&(t[0][o]=i);return e.abrupt("return",t);case 7:case"end":return e.stop()}}),e,this)})));function n(n){return e.apply(this,arguments)}return n}()},{key:"get_limits",value:function(e,n,t){return this.exec("get_limits",[e,n,t])}},{key:"tlm",value:function(){var e=(0,s.Z)((0,a.Z)().mark((function e(n,t,l){var i,o;return(0,a.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.exec("tlm",[n,t,l]);case 2:return i=e.sent,o=this.decode_cosmos_type(i),null!==o&&(0,C.Z)("data"),e.abrupt("return",i);case 6:case"end":return e.stop()}}),e,this)})));function n(n,t,l){return e.apply(this,arguments)}return n}()},{key:"get_all_commands",value:function(e){return this.exec("get_all_commands",[e])}},{key:"get_all_commands_list",value:function(e){return this.exec("get_all_commands_list",[e])}},{key:"get_command",value:function(e,n){return this.exec("get_command",[e,n])}},{key:"get_cmd_value",value:function(e,n,t){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"CONVERTED";return this.exec("get_cmd_value",[e,n,t,l])}},{key:"get_cmd_buffer",value:function(e,n){return this.exec("get_cmd_buffer",[e,n])}},{key:"_cmd",value:function(e,n,t,l){var i=null;for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(i=this.encode_cosmos_type(l[o]),null!==i&&(l[o]=i));return this.exec(e,[n,t,l])}},{key:"get_cmd_hazardous",value:function(e,n,t){return void 0===n?this.exec("get_cmd_hazardous",e):this._cmd("get_cmd_hazardous",e,n,t)}},{key:"cmd",value:function(e,n,t){return void 0===n?this.exec("cmd",e):this._cmd("cmd",e,n,t)}},{key:"cmd_no_range_check",value:function(e,n,t){return void 0===n?this.exec("cmd_no_range_check",e):this._cmd("cmd_no_range_check",e,n,t)}},{key:"cmd_raw",value:function(e,n,t){return void 0===n?this.exec("cmd_raw",e):this._cmd("cmd_raw",e,n,t)}},{key:"cmd_raw_no_range_check",value:function(e,n,t){return void 0===n?this.exec("cmd_raw_no_range_check",e):this._cmd("cmd_raw_no_range_check",e,n,t)}},{key:"cmd_no_hazardous_check",value:function(e,n,t){return void 0===n?this.exec("cmd_no_hazardous_check",e):this._cmd("cmd_no_hazardous_check",e,n,t)}},{key:"cmd_no_checks",value:function(e,n,t){return void 0===n?this.exec("cmd_no_checks",e):this._cmd("cmd_no_checks",e,n,t)}},{key:"cmd_raw_no_hazardous_check",value:function(e,n,t){return void 0===n?this.exec("cmd_raw_no_hazardous_check",e):this._cmd("cmd_raw_no_hazardous_check",e,n,t)}},{key:"cmd_raw_no_checks",value:function(e,n,t){return void 0===n?this.exec("cmd_raw_no_checks",e):this._cmd("cmd_raw_no_checks",e,n,t)}},{key:"get_interface_names",value:function(){return this.exec("get_interface_names",[])}},{key:"send_raw",value:function(e,n){return this.exec("send_raw",[e,n])}},{key:"list_configs",value:function(e){return this.exec("list_configs",[e])}},{key:"load_config",value:function(e,n){return this.exec("load_config",[e,n])}},{key:"save_config",value:function(e,n,t){return this.exec("save_config",[e,n,t])}},{key:"delete_config",value:function(e,n){return this.exec("delete_config",[e,n])}},{key:"get_out_of_limits",value:function(){return this.exec("get_out_of_limits",[])}},{key:"get_overall_limits_state",value:function(e){return this.exec("get_overall_limits_state",[e])}},{key:"list_settings",value:function(){return this.exec("list_settings",[])}},{key:"get_all_settings",value:function(){return this.exec("get_all_settings",[])}},{key:"get_setting",value:function(e){return this.exec("get_setting",[e])}},{key:"get_settings",value:function(e){return this.exec("get_settings",e)}},{key:"save_setting",value:function(e,n){return this.exec("save_setting",[e,n])}}]),e}()),x=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("mounting-portal",{attrs:{"mount-to":"#cosmos-menu",append:""}},[t("div",{staticClass:"v-toolbar__content"},[e._l(e.menus,(function(n,l){return t("v-menu",{key:l,attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function(l){var i=l.on,o=l.attrs;return[t("v-btn",e._g(e._b({staticClass:"mx-1",attrs:{outlined:"","data-test":e.formatDT(e.title+" "+n.label)}},"v-btn",o,!1),i),[t("span",{domProps:{textContent:e._s(n.label)}}),t("v-icon",{attrs:{right:""}},[e._v(" mdi-menu-down ")])],1)]}}],null,!0)},[t("v-list",[t("v-radio-group",{staticClass:"ma-0 pa-0",attrs:{value:n.radioGroup,"hide-details":"",dense:""}},[e._l(n.items,(function(l,i){return[l.divider?t("v-divider",{key:i}):t("v-list-item",{key:i,attrs:{disabled:l.disabled,"data-test":e.formatDT(e.title+" "+n.label+" "+l.label)},on:{click:l.command}},[l.radio?t("v-list-item-action",[t("v-radio",{attrs:{color:"secondary",label:l.label,value:l.label}})],1):e._e(),l.checkbox?t("v-list-item-action",[t("v-checkbox",{attrs:{color:"secondary",label:l.label,value:l.label},model:{value:e.checked,callback:function(n){e.checked=n},expression:"checked"}})],1):e._e(),l.icon?t("v-list-item-icon",[t("v-icon",{attrs:{disabled:l.disabled},domProps:{textContent:e._s(l.icon)}})],1):e._e(),l.radio||l.checkbox?e._e():t("v-list-item-title",{style:"cursor: pointer;"+(l.disabled?"opacity: 0.2":""),domProps:{textContent:e._s(l.label)}})],1)]}))],2)],1)],1)})),t("v-spacer"),t("v-toolbar-title",{domProps:{textContent:e._s(e.title)}}),t("v-spacer")],2)])},w=[],T=(t(1639),{props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(e){return e.replaceAll(" ","-").toLowerCase()}}}),F=T,I=(t(7162),t(3287)),S=(0,I.Z)(F,x,w,!1,null,"e3bb7458",null),E=S.exports,D=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("tr",[t("td",{staticClass:"text-start"},[e._v(e._s(e.dataItems[0].index))]),e.oneDimensional?t("td",{staticClass:"text-start"},[e._v(e._s(e.dataItems[0].name))]):e._e(),e._l(e.dataItems,(function(n,l){return t("table-item",{key:n.name,attrs:{item:n},on:{change:function(t){return e.onChange(n,l,t)}}})}))],2)},O=[],N=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("td",[e.isCheckbox?t("v-checkbox",{attrs:{dense:"","hide-details":"",disabled:!e.dataItem.editable},on:{change:e.checkboxChange},model:{value:e.checkValue,callback:function(n){e.checkValue=n},expression:"checkValue"}}):e.dataItem.states?t("v-select",{attrs:{dense:"","hide-details":"",items:e.itemStates,disabled:!e.dataItem.editable},on:{change:e.stateChange},model:{value:e.stateValue,callback:function(n){e.stateValue=n},expression:"stateValue"}}):t("v-text-field",{attrs:{solo:"",dense:"","single-line":"","hide-no-data":"","hide-details":"",disabled:!e.dataItem.editable},on:{change:e.textChange},model:{value:e.dataItem.value,callback:function(n){e.$set(e.dataItem,"value",n)},expression:"dataItem.value"}})],1)},$=[],R=t(6451);t(4769),t(5883),t(9228);function M(){var e="/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableItem.vue",n="a81b214d030e0899a4655b2a5a5c4e258e1826e6",t=new Function("return this")(),l="__coverage__",i={path:"/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableItem.vue",statementMap:{0:{start:{line:62,column:4},end:{line:66,column:5}},1:{start:{line:69,column:4},end:{line:71,column:5}},2:{start:{line:70,column:6},end:{line:70,column:65}},3:{start:{line:72,column:4},end:{line:74,column:5}},4:{start:{line:73,column:6},end:{line:73,column:45}},5:{start:{line:78,column:19},end:{line:78,column:23}},6:{start:{line:79,column:6},end:{line:87,column:7}},7:{start:{line:80,column:8},end:{line:84,column:9}},8:{start:{line:81,column:10},end:{line:83,column:11}},9:{start:{line:82,column:12},end:{line:82,column:26}},10:{start:{line:86,column:8},end:{line:86,column:22}},11:{start:{line:88,column:6},end:{line:88,column:19}},12:{start:{line:91,column:19},end:{line:91,column:21}},13:{start:{line:92,column:6},end:{line:94,column:7}},14:{start:{line:93,column:8},end:{line:93,column:49}},15:{start:{line:95,column:6},end:{line:95,column:19}},16:{start:{line:100,column:6},end:{line:104,column:7}},17:{start:{line:101,column:8},end:{line:101,column:39}},18:{start:{line:103,column:8},end:{line:103,column:41}},19:{start:{line:108,column:18},end:{line:110,column:7}},20:{start:{line:109,column:17},end:{line:109,column:62}},21:{start:{line:111,column:6},end:{line:111,column:33}},22:{start:{line:114,column:6},end:{line:114,column:47}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:61,column:2},end:{line:61,column:3}},loc:{start:{line:61,column:9},end:{line:67,column:3}},line:61},1:{name:"(anonymous_1)",decl:{start:{line:68,column:2},end:{line:68,column:3}},loc:{start:{line:68,column:12},end:{line:75,column:3}},line:68},2:{name:"(anonymous_2)",decl:{start:{line:77,column:16},end:{line:77,column:17}},loc:{start:{line:77,column:28},end:{line:89,column:5}},line:77},3:{name:"(anonymous_3)",decl:{start:{line:90,column:16},end:{line:90,column:17}},loc:{start:{line:90,column:28},end:{line:96,column:5}},line:90},4:{name:"(anonymous_4)",decl:{start:{line:99,column:20},end:{line:99,column:21}},loc:{start:{line:99,column:32},end:{line:105,column:5}},line:99},5:{name:"(anonymous_5)",decl:{start:{line:106,column:17},end:{line:106,column:18}},loc:{start:{line:106,column:29},end:{line:112,column:5}},line:106},6:{name:"(anonymous_6)",decl:{start:{line:109,column:8},end:{line:109,column:9}},loc:{start:{line:109,column:17},end:{line:109,column:62}},line:109},7:{name:"(anonymous_7)",decl:{start:{line:113,column:16},end:{line:113,column:17}},loc:{start:{line:113,column:28},end:{line:115,column:5}},line:113}},branchMap:{0:{loc:{start:{line:69,column:4},end:{line:71,column:5}},type:"if",locations:[{start:{line:69,column:4},end:{line:71,column:5}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:69},1:{loc:{start:{line:72,column:4},end:{line:74,column:5}},type:"if",locations:[{start:{line:72,column:4},end:{line:74,column:5}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:72},2:{loc:{start:{line:79,column:6},end:{line:87,column:7}},type:"if",locations:[{start:{line:79,column:6},end:{line:87,column:7}},{start:{line:85,column:13},end:{line:87,column:7}}],line:79},3:{loc:{start:{line:81,column:10},end:{line:83,column:11}},type:"if",locations:[{start:{line:81,column:10},end:{line:83,column:11}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:81},4:{loc:{start:{line:81,column:14},end:{line:81,column:58}},type:"binary-expr",locations:[{start:{line:81,column:14},end:{line:81,column:33}},{start:{line:81,column:37},end:{line:81,column:58}}],line:81},5:{loc:{start:{line:100,column:6},end:{line:104,column:7}},type:"if",locations:[{start:{line:100,column:6},end:{line:104,column:7}},{start:{line:102,column:13},end:{line:104,column:7}}],line:100}},s:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0},f:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0},b:{0:[0,0],1:[0,0],2:[0,0],3:[0,0],4:[0,0],5:[0,0]},inputSourceMap:{version:3,sources:["TableItem.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableItem.vue",sourceRoot:"src/tools/TableManager",sourcesContent:['\x3c!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This program may also be used under the terms of a commercial or\n# enterprise edition license of COSMOS if purchased from the\n# copyright holder\n--\x3e\n\n<template>\n <td>\n <v-checkbox\n v-if="isCheckbox"\n dense\n hide-details\n v-model="checkValue"\n @change="checkboxChange"\n :disabled="!dataItem.editable"\n />\n <v-select\n v-else-if="dataItem.states"\n dense\n hide-details\n v-model="stateValue"\n :items="itemStates"\n @change="stateChange"\n :disabled="!dataItem.editable"\n />\n <v-text-field\n v-else\n solo\n dense\n single-line\n hide-no-data\n hide-details\n v-model="dataItem.value"\n @change="textChange"\n :disabled="!dataItem.editable"\n />\n </td>\n</template>\n\n<script>\nexport default {\n props: {\n item: {\n type: Object,\n required: true,\n },\n },\n data() {\n return {\n dataItem: this.item,\n stateValue: null,\n checkValue: false,\n }\n },\n created() {\n if (this.dataItem.states) {\n this.stateValue = this.dataItem.states[this.dataItem.value]\n }\n if (this.isCheckbox) {\n this.checkValue = this.stateValue === 1\n }\n },\n computed: {\n isCheckbox: function () {\n let result = true\n if (this.dataItem.states) {\n for (const state of Object.keys(this.dataItem.states)) {\n if (state !== \'CHECKED\' && state !== \'UNCHECKED\') {\n result = false\n }\n }\n } else {\n result = false\n }\n return result\n },\n itemStates: function () {\n let result = []\n for (const [text, value] of Object.entries(this.dataItem.states)) {\n result.push({ text: text, value: value })\n }\n return result\n },\n },\n methods: {\n checkboxChange: function () {\n if (this.checkValue) {\n this.$emit(\'change\', \'CHECKED\')\n } else {\n this.$emit(\'change\', \'UNCHECKED\')\n }\n },\n stateChange: function () {\n // Lookup the state key that corresponds to the value\n let state = Object.keys(this.dataItem.states).find(\n (key) => this.dataItem.states[key] === this.stateValue\n )\n this.$emit(\'change\', state)\n },\n textChange: function () {\n this.$emit(\'change\', this.dataItem.value)\n },\n },\n}\n<\/script>\n']},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"a81b214d030e0899a4655b2a5a5c4e258e1826e6"},o=t[l]||(t[l]={});o[e]&&o[e].hash===n||(o[e]=i);var a=o[e];return M=function(){return a},a}M();var U={props:{item:{type:Object,required:!0}},data:function(){return M().f[0]++,M().s[0]++,{dataItem:this.item,stateValue:null,checkValue:!1}},created:function(){M().f[1]++,M().s[1]++,this.dataItem.states?(M().b[0][0]++,M().s[2]++,this.stateValue=this.dataItem.states[this.dataItem.value]):M().b[0][1]++,M().s[3]++,this.isCheckbox?(M().b[1][0]++,M().s[4]++,this.checkValue=1===this.stateValue):M().b[1][1]++},computed:{isCheckbox:function(){M().f[2]++;var e=(M().s[5]++,!0);if(M().s[6]++,this.dataItem.states){M().b[2][0]++,M().s[7]++;for(var n=0,t=Object.keys(this.dataItem.states);n<t.length;n++){var l=t[n];M().s[8]++,M().b[4][0]++,"CHECKED"!==l&&(M().b[4][1]++,"UNCHECKED"!==l)?(M().b[3][0]++,M().s[9]++,e=!1):M().b[3][1]++}}else M().b[2][1]++,M().s[10]++,e=!1;return M().s[11]++,e},itemStates:function(){M().f[3]++;var e=(M().s[12]++,[]);M().s[13]++;for(var n=0,t=Object.entries(this.dataItem.states);n<t.length;n++){var l=(0,R.Z)(t[n],2),i=l[0],o=l[1];M().s[14]++,e.push({text:i,value:o})}return M().s[15]++,e}},methods:{checkboxChange:function(){M().f[4]++,M().s[16]++,this.checkValue?(M().b[5][0]++,M().s[17]++,this.$emit("change","CHECKED")):(M().b[5][1]++,M().s[18]++,this.$emit("change","UNCHECKED"))},stateChange:function(){var e=this;M().f[5]++;var n=(M().s[19]++,Object.keys(this.dataItem.states).find((function(n){return M().f[6]++,M().s[20]++,e.dataItem.states[n]===e.stateValue})));M().s[21]++,this.$emit("change",n)},textChange:function(){M().f[7]++,M().s[22]++,this.$emit("change",this.dataItem.value)}}},Z=U,B=(0,I.Z)(Z,N,$,!1,null,null,null),P=B.exports;function L(){var e="/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableRow.vue",n="dbd0a1855bd5813e025d4acfff9ff0693e3b1a95",t=new Function("return this")(),l="__coverage__",i={path:"/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableRow.vue",statementMap:{0:{start:{line:47,column:4},end:{line:49,column:5}},1:{start:{line:53,column:6},end:{line:57,column:7}},2:{start:{line:54,column:8},end:{line:54,column:19}},3:{start:{line:56,column:8},end:{line:56,column:20}},4:{start:{line:62,column:6},end:{line:62,column:58}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:46,column:2},end:{line:46,column:3}},loc:{start:{line:46,column:9},end:{line:50,column:3}},line:46},1:{name:"(anonymous_1)",decl:{start:{line:52,column:4},end:{line:52,column:5}},loc:{start:{line:52,column:21},end:{line:58,column:5}},line:52},2:{name:"(anonymous_2)",decl:{start:{line:61,column:14},end:{line:61,column:15}},loc:{start:{line:61,column:44},end:{line:63,column:5}},line:61}},branchMap:{0:{loc:{start:{line:53,column:6},end:{line:57,column:7}},type:"if",locations:[{start:{line:53,column:6},end:{line:57,column:7}},{start:{line:55,column:13},end:{line:57,column:7}}],line:53}},s:{0:0,1:0,2:0,3:0,4:0},f:{0:0,1:0,2:0},b:{0:[0,0]},inputSourceMap:{version:3,sources:["TableRow.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableRow.vue",sourceRoot:"src/tools/TableManager",sourcesContent:['\x3c!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This program may also be used under the terms of a commercial or\n# enterprise edition license of COSMOS if purchased from the\n# copyright holder\n--\x3e\n\n<template>\n <tr>\n <td class="text-start">{{ dataItems[0].index }}</td>\n <td class="text-start" v-if="oneDimensional">{{ dataItems[0].name }}</td>\n <table-item\n v-for="(item, index) in dataItems"\n :key="item.name"\n :item="item"\n @change="onChange(item, index, $event)"\n />\n </tr>\n</template>\n\n<script>\nimport TableItem from \'@/tools/TableManager/TableItem\'\n\nexport default {\n components: {\n TableItem,\n },\n props: {\n items: {\n type: Object,\n required: true,\n },\n },\n data() {\n return {\n dataItems: this.items,\n }\n },\n computed: {\n oneDimensional() {\n if (this.dataItems.length === 1) {\n return true\n } else {\n return false\n }\n },\n },\n methods: {\n onChange: function (item, index, event) {\n this.$emit(\'change\', { index: index, event: event })\n },\n },\n}\n<\/script>\n']},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"dbd0a1855bd5813e025d4acfff9ff0693e3b1a95"},o=t[l]||(t[l]={});o[e]&&o[e].hash===n||(o[e]=i);var a=o[e];return L=function(){return a},a}L();var j={components:{TableItem:P},props:{items:{type:Object,required:!0}},data:function(){return L().f[0]++,L().s[0]++,{dataItems:this.items}},computed:{oneDimensional:function(){return L().f[1]++,L().s[1]++,1===this.dataItems.length?(L().b[0][0]++,L().s[2]++,!0):(L().b[0][1]++,L().s[3]++,!1)}},methods:{onChange:function(e,n,t){L().f[2]++,L().s[4]++,this.$emit("change",{index:n,event:t})}}},V=j,q=(0,I.Z)(V,D,O,!1,null,null,null),z=q.exports,H=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-dialog",{attrs:{width:"600"},model:{value:e.show,callback:function(n){e.show=n},expression:"show"}},[t("v-card",[t("form",{on:{submit:function(n){return n.preventDefault(),e.success.apply(null,arguments)}}},[t("v-system-bar",[t("v-spacer"),t("span",[e._v(" "+e._s(e.title)+" ")]),t("v-spacer")],1),t("v-card-text",[t("div",{staticClass:"pa-3"},[t("v-row",{attrs:{dense:""}},[t("v-text-field",{attrs:{flat:"",autofocus:"","solo-inverted":"","hide-details":"",clearable:"",label:"Search","data-test":"file-open-save-search"},on:{input:e.handleSearch},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}})],1),t("v-row",{staticClass:"mt-2",attrs:{dense:""}},[t("v-treeview",{ref:"tree",staticStyle:{width:"100%"},attrs:{dense:"",activatable:"","return-object":"",items:e.items,search:e.search,"open-on-click":"open"===e.type},on:{"update:active":e.activeFile},scopedSlots:e._u([{key:"prepend",fn:function(n){var l=n.item,i=n.open;return[l.file?t("v-icon",[e._v(" "+e._s("mdi-language-ruby")+" ")]):t("v-icon",[e._v(" "+e._s(i?"mdi-folder-open":"mdi-folder")+" ")])]}}]),model:{value:e.tree,callback:function(n){e.tree=n},expression:"tree"}})],1),t("v-row",{staticClass:"my-2"},[t("v-text-field",{attrs:{"hide-details":"",label:"Filename","data-test":"file-open-save-filename",disabled:"open"===e.type},model:{value:e.selectedFile,callback:function(n){e.selectedFile=n},expression:"selectedFile"}})],1),t("v-row",{attrs:{dense:""}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.error,expression:"error"}],staticClass:"my-2 red--text",domProps:{textContent:e._s(e.error)}})]),t("v-row",{staticClass:"mt-2"},[t("v-spacer"),t("v-btn",{staticClass:"mx-2",attrs:{outlined:"","data-test":"file-open-save-cancel-btn",disabled:e.disableButtons},on:{click:function(n){e.show=!1}}},[e._v(" Cancel ")]),t("v-btn",{staticClass:"mx-2",attrs:{type:"submit",color:"primary","data-test":"file-open-save-submit-btn",disabled:e.disableButtons||!!e.error},on:{click:function(n){return n.preventDefault(),e.success.apply(null,arguments)}}},[e._v(" "+e._s(e.submit)+" ")])],1)],1)])],1)])],1)},G=[],Y=t(6711),W=(t(4083),t(4069),t(7368),t(4471),t(1172),t(8233),t(9949),t(2501),{props:{type:{type:String,required:!0,validator:function(e){return-1!==["open","save"].indexOf(e)}},apiUrl:String,requireTargetParentDir:Boolean,inputFilename:String,value:Boolean},data:function(){return{tree:[],items:[],id:1,search:null,selectedFile:null,disableButtons:!1,targets:[]}},computed:{show:{get:function(){return this.value},set:function(e){this.$emit("input",e)}},title:function(){return"open"===this.type?"File Open":"File Save As..."},submit:function(){return"open"===this.type?"OPEN":"SAVE"},error:function(){if(""===this.selectedFile||null===this.selectedFile)return"No file selected must select a file";if(!this.selectedFile.match(this.validFilenameRegex)||this.selectedFile.match(/\.\.|\/\/|\.\/|\/\./)){var e="".concat(this.selectedFile," is not a valid filename. Must ");return this.requireTargetParentDir&&(e+="be in a target directory and "),e+="only contain alphanumeric characters and / ! - _ . * ' ( )",e}return null},validFilenameRegex:function(){var e="0-9a-zA-Z",n="".concat(e,"\\/\\!\\-\\_\\.\\*\\'\\(\\)"),t="[".concat(n,"]+\\.[").concat(e,"]+");if(this.requireTargetParentDir){var l="(".concat(this.targets.join("|"),")");t="\\/?".concat(l,"\\/").concat(t)}return new RegExp(t)}},created:function(){var e=this;v.get(this.apiUrl).then((function(n){e.items=[],e.id=1;var t,l=(0,Y.Z)(n.data);try{for(l.s();!(t=l.n()).done;){var i=t.value;e.filepath=i,e.insertFile(e.items,1,i),e.id++}}catch(o){l.e(o)}finally{l.f()}e.inputFilename&&(e.selectedFile=e.inputFilename)})).catch((function(n){e.$emit("error","Failed to connect to Cosmos. ".concat(n))})),this.requireTargetParentDir&&v.get("/cosmos-api/targets").then((function(n){e.targets=n.data}))},methods:{clear:function(){this.show=!1,this.overwrite=!1,this.disableButtons=!1},handleSearch:function(e){e?this.$refs.tree.updateAll(!0):this.$refs.tree.updateAll(!1)},activeFile:function(e){0===e.length?this.selectedFile=null:this.selectedFile=e[0].path},exists:function(e,n){var t,l=!1,i=(0,Y.Z)(e);try{for(i.s();!(t=i.n()).done;){var o=t.value;if(o.path===n)return!0;o.children&&(l=l||this.exists(o.children,n))}}catch(a){i.e(a)}finally{i.f()}return l},success:function(){"open"===this.type?this.openSuccess():this.saveSuccess()},openSuccess:function(){var e=this;this.disableButtons=!0,v.get("".concat(this.apiUrl,"/").concat(this.selectedFile)).then((function(n){var t={name:e.selectedFile,contents:n.data.contents};n.data.suites&&(t["suites"]=JSON.parse(n.data.suites)),n.data.error&&(t["error"]=n.data.error),n.data.success&&(t["success"]=n.data.success);var l=n.data.locked,i=n.data.breakpoints;e.$emit("file",{file:t,locked:l,breakpoints:i}),e.clear()})).catch((function(n){e.$emit("error","Failed to open ".concat(e.selectedFile,". ").concat(n)),e.clear()}))},saveSuccess:function(){var e=this,n=this.exists(this.items,this.selectedFile);n?this.$dialog.confirm("Are you sure you want to overwrite: ".concat(this.selectedFile),{okText:"Overwrite",cancelText:"Cancel"}).then((function(n){e.$emit("filename",e.selectedFile),e.clear()})):(this.$emit("filename",this.selectedFile),this.clear())},insertFile:function(e,n,t){var l=t.split("/");if(1===l.length)return e.push({id:this.id,name:l[0],file:"ruby",path:this.filepath}),void this.id++;var i=e.findIndex((function(e){return e.name===l[0]}));-1===i?(e.push({id:this.id,name:l[0],children:[],path:this.filepath.split("/").slice(0,n).join("/")}),this.id++,this.insertFile(e[e.length-1].children,n+1,l.slice(1).join("/"))):this.insertFile(e[i].children,n+1,l.slice(1).join("/"))}}}),K=W,J=(0,I.Z)(K,H,G,!1,null,null,null),X=J.exports,Q=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("v-dialog",{attrs:{width:e.width},model:{value:e.show,callback:function(n){e.show=n},expression:"show"}},[t("v-card",[t("v-system-bar",[t("v-spacer"),t("span",[e._v(" "+e._s(e.title)+" ")]),t("v-spacer"),t("div",{staticClass:"mx-2"},[t("v-tooltip",{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function(n){var l=n.on,i=n.attrs;return[t("div",e._g(e._b({},"div",i,!1),l),[t("v-icon",{attrs:{"data-test":"downloadIcon"},on:{click:e.download}},[e._v(" mdi-download ")])],1)]}}])},[t("span",[e._v(" Download ")])])],1)],1),t("v-card-text",[t("div",{staticClass:"pa-3"},[t("span",{staticStyle:{"white-space":"pre-wrap"}},[e._v(e._s(e.text))])])]),t("v-card-actions",[t("v-spacer"),t("v-btn",{staticClass:"mx-2",attrs:{color:"primary"},on:{click:function(n){e.show=!e.show}}},[e._v(" Ok ")])],1)],1)],1)},ee=[],ne={props:{value:Boolean,text:String,title:String,width:800},computed:{show:{get:function(){return this.value},set:function(e){this.$emit("input",e)}}},methods:{download:function(){var e=new Blob([this.text],{type:"text/plain"}),n=document.createElement("a");n.href=URL.createObjectURL(e),n.setAttribute("download","".concat(this.title,".txt")),n.click()}}},te=ne,le=(0,I.Z)(te,Q,ee,!1,null,null,null),ie=le.exports;function oe(){var e="/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableManager.vue",n="1e3b314010b0a1f11b4e3ba37696a43cb2aacfa1",t=new Function("return this")(),l="__coverage__",i={path:"/cosmos/plugins/packages/cosmosc2-tool-tablemanager/src/tools/TableManager/TableManager.vue",statementMap:{0:{start:{line:162,column:4},end:{line:181,column:5}},1:{start:{line:185,column:6},end:{line:185,column:28}},2:{start:{line:188,column:6},end:{line:188,column:59}},3:{start:{line:191,column:6},end:{line:255,column:7}},4:{start:{line:199,column:16},end:{line:199,column:30}},5:{start:{line:206,column:16},end:{line:206,column:31}},6:{start:{line:216,column:16},end:{line:216,column:31}},7:{start:{line:223,column:16},end:{line:223,column:29}},8:{start:{line:233,column:16},end:{line:233,column:29}},9:{start:{line:240,column:16},end:{line:240,column:31}},10:{start:{line:250,column:16},end:{line:250,column:29}},11:{start:{line:259,column:4},end:{line:259,column:30}},12:{start:{line:264,column:6},end:{line:264,column:28}},13:{start:{line:265,column:6},end:{line:265,column:25}},14:{start:{line:266,column:6},end:{line:266,column:26}},15:{start:{line:269,column:6},end:{line:269,column:26}},16:{start:{line:274,column:6},end:{line:289,column:7}},17:{start:{line:275,column:8},end:{line:280,column:9}},18:{start:{line:276,column:10},end:{line:276,column:35}},19:{start:{line:277,column:10},end:{line:277,column:30}},20:{start:{line:279,column:10},end:{line:279,column:39}},21:{start:{line:282,column:8},end:{line:282,column:25}},22:{start:{line:284,column:8},end:{line:284,column:47}},23:{start:{line:285,column:8},end:{line:285,column:30}},24:{start:{line:286,column:8},end:{line:286,column:30}},25:{start:{line:288,column:8},end:{line:288,column:28}},26:{start:{line:293,column:6},end:{line:293,column:31}},27:{start:{line:294,column:6},end:{line:294,column:40}},28:{start:{line:295,column:6},end:{line:295,column:44}},29:{start:{line:296,column:6},end:{line:296,column:27}},30:{start:{line:300,column:6},end:{line:300,column:26}},31:{start:{line:302,column:23},end:{line:302,column:37}},32:{start:{line:303,column:6},end:{line:303,column:46}},33:{start:{line:304,column:6},end:{line:304,column:60}},34:{start:{line:305,column:6},end:{line:305,column:60}},35:{start:{line:306,column:6},end:{line:320,column:10}},36:{start:{line:310,column:10},end:{line:310,column:32}},37:{start:{line:311,column:10},end:{line:313,column:18}},38:{start:{line:312,column:12},end:{line:312,column:33}},39:{start:{line:316,column:10},end:{line:316,column:31}},40:{start:{line:317,column:10},end:{line:317,column:40}},41:{start:{line:318,column:10},end:{line:318,column:48}},42:{start:{line:319,column:10},end:{line:319,column:31}},43:{start:{line:321,column:6},end:{line:321,column:21}},44:{start:{line:324,column:6},end:{line:324,column:28}},45:{start:{line:327,column:6},end:{line:327,column:30}},46:{start:{line:328,column:6},end:{line:328,column:21}},47:{start:{line:331,column:6},end:{line:353,column:7}},48:{start:{line:332,column:8},end:{line:352,column:12}},49:{start:{line:338,column:12},end:{line:340,column:14}},50:{start:{line:343,column:12},end:{line:343,column:26}},51:{start:{line:346,column:12},end:{line:351,column:13}},52:{start:{line:347,column:14},end:{line:350,column:16}},53:{start:{line:356,column:6},end:{line:379,column:7}},54:{start:{line:357,column:8},end:{line:378,column:10}},55:{start:{line:359,column:30},end:{line:359,column:65}},56:{start:{line:361,column:29},end:{line:361,column:63}},57:{start:{line:363,column:10},end:{line:365,column:11}},58:{start:{line:363,column:23},end:{line:363,column:24}},59:{start:{line:364,column:12},end:{line:364,column:53}},60:{start:{line:367,column:23},end:{line:369,column:12}},61:{start:{line:371,column:23},end:{line:371,column:50}},62:{start:{line:372,column:10},end:{line:372,column:47}},63:{start:{line:373,column:10},end:{line:376,column:11}},64:{start:{line:377,column:10},end:{line:377,column:22}},65:{start:{line:382,column:6},end:{line:382,column:25}},66:{start:{line:383,column:6},end:{line:383,column:46}},67:{start:{line:385,column:6},end:{line:387,column:7}},68:{start:{line:386,column:8},end:{line:386,column:64}},69:{start:{line:386,column:39},end:{line:386,column:63}},70:{start:{line:388,column:6},end:{line:388,column:41}},71:{start:{line:389,column:6},end:{line:389,column:19}},72:{start:{line:392,column:6},end:{line:403,column:10}},73:{start:{line:401,column:10},end:{line:401,column:30}},74:{start:{line:402,column:10},end:{line:402,column:32}},75:{start:{line:406,column:6},end:{line:406,column:65}},76:{start:{line:409,column:6},end:{line:411,column:7}},77:{start:{line:410,column:8},end:{line:410,column:62}},78:{start:{line:414,column:6},end:{line:418,column:7}},79:{start:{line:415,column:8},end:{line:417,column:38}},80:{start:{line:419,column:23},end:{line:419,column:37}},81:{start:{line:420,column:6},end:{line:420,column:46}},82:{start:{line:421,column:6},end:{line:421,column:55}},83:{start:{line:422,column:6},end:{line:475,column:10}},84:{start:{line:426,column:10},end:{line:426,column:54}},85:{start:{line:427,column:10},end:{line:453,column:12}},86:{start:{line:428,column:12},end:{line:452,column:13}},87:{start:{line:432,column:31},end:{line:435,column:17}},88:{start:{line:436,column:16},end:{line:450,column:17}},89:{start:{line:439,column:18},end:{line:442,column:19}},90:{start:{line:446,column:18},end:{line:449,column:19}},91:{start:{line:455,column:10},end:{line:460,column:11}},92:{start:{line:456,column:12},end:{line:459,column:14}},93:{start:{line:463,column:10},end:{line:474,column:11}},94:{start:{line:464,column:12},end:{line:467,column:14}},95:{start:{line:468,column:12},end:{line:468,column:32}},96:{start:{line:470,column:12},end:{line:473,column:14}},97:{start:{line:478,column:23},end:{line:478,column:37}},98:{start:{line:479,column:6},end:{line:479,column:48}},99:{start:{line:480,column:6},end:{line:485,column:8}},100:{start:{line:483,column:8},end:{line:483,column:46}},101:{start:{line:484,column:8},end:{line:484,column:37}},102:{start:{line:488,column:6},end:{line:488,column:29}},103:{start:{line:489,column:6},end:{line:489,column:31}}},fnMap:{0:{name:"(anonymous_0)",decl:{start:{line:161,column:2},end:{line:161,column:3}},loc:{start:{line:161,column:9},end:{line:182,column:3}},line:161},1:{name:"(anonymous_1)",decl:{start:{line:184,column:14},end:{line:184,column:15}},loc:{start:{line:184,column:26},end:{line:186,column:5}},line:184},2:{name:"(anonymous_2)",decl:{start:{line:187,column:4},end:{line:187,column:5}},loc:{start:{line:187,column:19},end:{line:189,column:5}},line:187},3:{name:"(anonymous_3)",decl:{start:{line:190,column:11},end:{line:190,column:12}},loc:{start:{line:190,column:23},end:{line:256,column:5}},line:190},4:{name:"(anonymous_4)",decl:{start:{line:198,column:23},end:{line:198,column:24}},loc:{start:{line:198,column:29},end:{line:200,column:15}},line:198},5:{name:"(anonymous_5)",decl:{start:{line:205,column:23},end:{line:205,column:24}},loc:{start:{line:205,column:29},end:{line:207,column:15}},line:205},6:{name:"(anonymous_6)",decl:{start:{line:215,column:23},end:{line:215,column:24}},loc:{start:{line:215,column:29},end:{line:217,column:15}},line:215},7:{name:"(anonymous_7)",decl:{start:{line:222,column:23},end:{line:222,column:24}},loc:{start:{line:222,column:29},end:{line:224,column:15}},line:222},8:{name:"(anonymous_8)",decl:{start:{line:232,column:23},end:{line:232,column:24}},loc:{start:{line:232,column:29},end:{line:234,column:15}},line:232},9:{name:"(anonymous_9)",decl:{start:{line:239,column:23},end:{line:239,column:24}},loc:{start:{line:239,column:29},end:{line:241,column:15}},line:239},10:{name:"(anonymous_10)",decl:{start:{line:249,column:23},end:{line:249,column:24}},loc:{start:{line:249,column:29},end:{line:251,column:15}},line:249},11:{name:"(anonymous_11)",decl:{start:{line:258,column:2},end:{line:258,column:3}},loc:{start:{line:258,column:12},end:{line:260,column:3}},line:258},12:{name:"(anonymous_12)",decl:{start:{line:263,column:13},end:{line:263,column:14}},loc:{start:{line:263,column:25},end:{line:267,column:5}},line:263},13:{name:"(anonymous_13)",decl:{start:{line:268,column:14},end:{line:268,column:15}},loc:{start:{line:268,column:26},end:{line:270,column:5}},line:268},14:{name:"(anonymous_14)",decl:{start:{line:272,column:13},end:{line:272,column:14}},loc:{start:{line:272,column:41},end:{line:290,column:5}},line:272},15:{name:"(anonymous_15)",decl:{start:{line:292,column:4},end:{line:292,column:5}},loc:{start:{line:292,column:20},end:{line:297,column:5}},line:292},16:{name:"(anonymous_16)",decl:{start:{line:298,column:14},end:{line:298,column:15}},loc:{start:{line:298,column:26},end:{line:322,column:5}},line:298},17:{name:"(anonymous_17)",decl:{start:{line:309,column:14},end:{line:309,column:15}},loc:{start:{line:309,column:28},end:{line:314,column:9}},line:309},18:{name:"(anonymous_18)",decl:{start:{line:311,column:21},end:{line:311,column:22}},loc:{start:{line:311,column:27},end:{line:313,column:11}},line:311},19:{name:"(anonymous_19)",decl:{start:{line:315,column:15},end:{line:315,column:16}},loc:{start:{line:315,column:33},end:{line:320,column:9}},line:315},20:{name:"(anonymous_20)",decl:{start:{line:323,column:12},end:{line:323,column:13}},loc:{start:{line:323,column:24},end:{line:325,column:5}},line:323},21:{name:"(anonymous_21)",decl:{start:{line:326,column:20},end:{line:326,column:21}},loc:{start:{line:326,column:40},end:{line:329,column:5}},line:326},22:{name:"(anonymous_22)",decl:{start:{line:330,column:12},end:{line:330,column:13}},loc:{start:{line:330,column:24},end:{line:354,column:5}},line:330},23:{name:"(anonymous_23)",decl:{start:{line:337,column:16},end:{line:337,column:17}},loc:{start:{line:337,column:28},end:{line:341,column:11}},line:337},24:{name:"(anonymous_24)",decl:{start:{line:342,column:16},end:{line:342,column:17}},loc:{start:{line:342,column:30},end:{line:344,column:11}},line:342},25:{name:"(anonymous_25)",decl:{start:{line:345,column:17},end:{line:345,column:18}},loc:{start:{line:345,column:28},end:{line:352,column:11}},line:345},26:{name:"(anonymous_26)",decl:{start:{line:355,column:14},end:{line:355,column:15}},loc:{start:{line:355,column:26},end:{line:380,column:5}},line:355},27:{name:"(anonymous_27)",decl:{start:{line:357,column:60},end:{line:357,column:61}},loc:{start:{line:357,column:74},end:{line:378,column:9}},line:357},28:{name:"(anonymous_28)",decl:{start:{line:381,column:4},end:{line:381,column:5}},loc:{start:{line:381,column:19},end:{line:390,column:5}},line:381},29:{name:"(anonymous_29)",decl:{start:{line:386,column:26},end:{line:386,column:27}},loc:{start:{line:386,column:39},end:{line:386,column:63}},line:386},30:{name:"(anonymous_30)",decl:{start:{line:391,column:24},end:{line:391,column:25}},loc:{start:{line:391,column:36},end:{line:404,column:5}},line:391},31:{name:"(anonymous_31)",decl:{start:{line:400,column:14},end:{line:400,column:15}},loc:{start:{line:400,column:20},end:{line:403,column:9}},line:400},32:{name:"(anonymous_32)",decl:{start:{line:405,column:14},end:{line:405,column:15}},loc:{start:{line:405,column:26},end:{line:407,column:5}},line:405},33:{name:"(anonymous_33)",decl:{start:{line:408,column:16},end:{line:408,column:17}},loc:{start:{line:408,column:28},end:{line:412,column:5}},line:408},34:{name:"(anonymous_34)",decl:{start:{line:413,column:19},end:{line:413,column:20}},loc:{start:{line:413,column:56},end:{line:476,column:5}},line:413},35:{name:"(anonymous_35)",decl:{start:{line:425,column:14},end:{line:425,column:15}},loc:{start:{line:425,column:28},end:{line:461,column:9}},line:425},36:{name:"(anonymous_36)",decl:{start:{line:427,column:49},end:{line:427,column:50}},loc:{start:{line:427,column:60},end:{line:453,column:11}},line:427},37:{name:"(anonymous_37)",decl:{start:{line:431,column:41},end:{line:431,column:42}},loc:{start:{line:431,column:54},end:{line:451,column:15}},line:431},38:{name:"(anonymous_38)",decl:{start:{line:462,column:15},end:{line:462,column:16}},loc:{start:{line:462,column:26},end:{line:475,column:9}},line:462},39:{name:"(anonymous_39)",decl:{start:{line:477,column:20},end:{line:477,column:21}},loc:{start:{line:477,column:36},end:{line:486,column:5}},line:477},40:{name:"(anonymous_40)",decl:{start:{line:482,column:14},end:{line:482,column:15}},loc:{start:{line:482,column:28},end:{line:485,column:7}},line:482},41:{name:"(anonymous_41)",decl:{start:{line:487,column:14},end:{line:487,column:15}},loc:{start:{line:487,column:48},end:{line:490,column:5}},line:487}},branchMap:{0:{loc:{start:{line:274,column:6},end:{line:289,column:7}},type:"if",locations:[{start:{line:274,column:6},end:{line:289,column:7}},{start:{line:281,column:13},end:{line:289,column:7}}],line:274},1:{loc:{start:{line:275,column:8},end:{line:280,column:9}},type:"if",locations:[{start:{line:275,column:8},end:{line:280,column:9}},{start:{line:278,column:15},end:{line:280,column:9}}],line:275},2:{loc:{start:{line:331,column:6},end:{line:353,column:7}},type:"if",locations:[{start:{line:331,column:6},end:{line:353,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:331},3:{loc:{start:{line:346,column:12},end:{line:351,column:13}},type:"if",locations:[{start:{line:346,column:12},end:{line:351,column:13}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:346},4:{loc:{start:{line:356,column:6},end:{line:379,column:7}},type:"if",locations:[{start:{line:356,column:6},end:{line:379,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:356},5:{loc:{start:{line:409,column:6},end:{line:411,column:7}},type:"if",locations:[{start:{line:409,column:6},end:{line:411,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:409},6:{loc:{start:{line:409,column:10},end:{line:409,column:48}},type:"binary-expr",locations:[{start:{line:409,column:10},end:{line:409,column:30}},{start:{line:409,column:34},end:{line:409,column:48}}],line:409},7:{loc:{start:{line:413,column:29},end:{line:413,column:54}},type:"default-arg",locations:[{start:{line:413,column:50},end:{line:413,column:54}}],line:413},8:{loc:{start:{line:414,column:6},end:{line:418,column:7}},type:"if",locations:[{start:{line:414,column:6},end:{line:418,column:7}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:414},9:{loc:{start:{line:436,column:16},end:{line:450,column:17}},type:"if",locations:[{start:{line:436,column:16},end:{line:450,column:17}},{start:{line:443,column:23},end:{line:450,column:17}}],line:436},10:{loc:{start:{line:455,column:10},end:{line:460,column:11}},type:"if",locations:[{start:{line:455,column:10},end:{line:460,column:11}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:455},11:{loc:{start:{line:463,column:10},end:{line:474,column:11}},type:"if",locations:[{start:{line:463,column:10},end:{line:474,column:11}},{start:{line:469,column:17},end:{line:474,column:11}}],line:463}},s:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0,42:0,43:0,44:0,45:0,46:0,47:0,48:0,49:0,50:0,51:0,52:0,53:0,54:0,55:0,56:0,57:0,58:0,59:0,60:0,61:0,62:0,63:0,64:0,65:0,66:0,67:0,68:0,69:0,70:0,71:0,72:0,73:0,74:0,75:0,76:0,77:0,78:0,79:0,80:0,81:0,82:0,83:0,84:0,85:0,86:0,87:0,88:0,89:0,90:0,91:0,92:0,93:0,94:0,95:0,96:0,97:0,98:0,99:0,100:0,101:0,102:0,103:0},f:{0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:0,13:0,14:0,15:0,16:0,17:0,18:0,19:0,20:0,21:0,22:0,23:0,24:0,25:0,26:0,27:0,28:0,29:0,30:0,31:0,32:0,33:0,34:0,35:0,36:0,37:0,38:0,39:0,40:0,41:0},b:{0:[0,0],1:[0,0],2:[0,0],3:[0,0],4:[0,0],5:[0,0],6:[0,0],7:[0],8:[0,0],9:[0,0],10:[0,0],11:[0,0]},inputSourceMap:{version:3,sources:["TableManager.vue"],names:[],mappings:";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkJA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",file:"TableManager.vue",sourceRoot:"src/tools/TableManager",sourcesContent:["\x3c!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n#\n# This program may also be used under the terms of a commercial or\n# enterprise edition license of COSMOS if purchased from the\n# copyright holder\n--\x3e\n\n<template>\n <div>\n <top-bar :menus=\"menus\" :title=\"title\" />\n <v-snackbar v-model=\"showReadOnlyToast\" top :timeout=\"-1\" color=\"orange\">\n <v-icon> mdi-pencil-off </v-icon>\n {{ lockedBy }} is editing this script. Editor is in read-only mode\n <template v-slot:action=\"{ attrs }\">\n <v-btn\n text\n v-bind=\"attrs\"\n color=\"danger\"\n @click=\"confirmLocalUnlock\"\n data-test=\"unlock-button\"\n >\n Unlock\n </v-btn>\n <v-btn\n text\n v-bind=\"attrs\"\n @click=\"\n () => {\n showReadOnlyToast = false\n }\n \"\n >\n dismiss\n </v-btn>\n </template>\n </v-snackbar>\n <v-file-input\n show-size\n v-model=\"fileInput\"\n ref=\"fileInput\"\n accept=\".bin\"\n data-test=\"file-input\"\n style=\"position: fixed; top: -100%\"\n />\n <v-text-field\n outlined\n dense\n readonly\n hide-details\n label=\"Definition\"\n v-model=\"definitionFilename\"\n id=\"definition-filename\"\n data-test=\"definition-filename\"\n />\n <v-text-field\n outlined\n dense\n readonly\n hide-details\n label=\"Filename\"\n v-model=\"fullFilename\"\n id=\"filename\"\n data-test=\"filename\"\n />\n <v-card>\n <v-card-title>\n Items\n <v-spacer />\n <v-text-field\n v-model=\"search\"\n append-icon=\"mdi-magnify\"\n label=\"Search\"\n single-line\n hide-details\n />\n </v-card-title>\n <v-tabs v-model=\"curTab\">\n <v-tab v-for=\"(table, index) in tables\" :key=\"index\">\n {{ table.name }}\n </v-tab>\n </v-tabs>\n <v-tabs-items v-model=\"curTab\">\n <v-tab-item\n v-for=\"(table, index) in tables\"\n :key=\"`${filename}${index}`\"\n >\n <v-data-table\n :headers=\"table.headers\"\n :items=\"table.rows\"\n :search=\"search\"\n calculate-widths\n disable-pagination\n hide-default-footer\n multi-sort\n dense\n >\n <template v-slot:item=\"{ item }\">\n <table-row\n :items=\"item\"\n :key=\"JSON.stringify(item[0])\"\n @change=\"onChange(item, $event)\"\n />\n </template>\n </v-data-table>\n </v-tab-item>\n </v-tabs-items>\n </v-card>\n <file-open-save-dialog\n v-if=\"fileOpen\"\n v-model=\"fileOpen\"\n type=\"open\"\n api-url=\"/cosmos-api/tables\"\n @file=\"setFile($event)\"\n @error=\"setError($event)\"\n />\n <file-open-save-dialog\n v-if=\"showSaveAs\"\n v-model=\"showSaveAs\"\n type=\"save\"\n require-target-parent-dir\n api-url=\"/cosmos-api/tables\"\n :input-filename=\"filename\"\n @filename=\"saveAsFilename($event)\"\n @error=\"setError($event)\"\n />\n <simple-text-dialog\n v-model=\"showError\"\n :title=\"errorTitle\"\n :text=\"errorText\"\n />\n </div>\n</template>\n\n<script>\nimport Api from '@cosmosc2/tool-common/src/services/api'\nimport { CosmosApi } from '@cosmosc2/tool-common/src/services/cosmos-api'\nimport TopBar from '@cosmosc2/tool-common/src/components/TopBar'\nimport TableRow from '@/tools/TableManager/TableRow'\nimport FileOpenSaveDialog from '@cosmosc2/tool-common/src/components/FileOpenSaveDialog'\nimport SimpleTextDialog from '@cosmosc2/tool-common/src/components/SimpleTextDialog'\n\nexport default {\n components: {\n TopBar,\n TableRow,\n FileOpenSaveDialog,\n SimpleTextDialog,\n },\n data() {\n return {\n title: 'Table Manager',\n search: '',\n curTab: null,\n tables: [],\n api: null,\n definition: null,\n fileInput: '',\n definitionFilename: '',\n fileNew: false,\n filename: '',\n fileModified: '',\n lockedBy: null,\n fileOpen: false,\n showSave: false,\n showSaveAs: false,\n showError: false,\n errorTitle: '',\n errorText: '',\n }\n },\n computed: {\n readOnly: function () {\n return !!this.lockedBy\n },\n fullFilename() {\n return `${this.filename} ${this.fileModified}`.trim()\n },\n menus: function () {\n return [\n {\n label: 'File',\n items: [\n {\n label: 'New File',\n icon: 'mdi-file-plus',\n command: () => {\n this.newFile()\n },\n },\n {\n label: 'Open File',\n icon: 'mdi-folder-open',\n command: () => {\n this.openFile()\n },\n },\n {\n divider: true,\n },\n {\n label: 'Save File',\n icon: 'mdi-content-save',\n command: () => {\n this.saveFile()\n },\n },\n {\n label: 'Save As...',\n icon: 'mdi-content-save',\n command: () => {\n this.saveAs()\n },\n },\n {\n divider: true,\n },\n {\n label: 'Upload',\n icon: 'mdi-cloud-upload',\n command: () => {\n this.upload()\n },\n },\n {\n label: 'Download',\n icon: 'mdi-cloud-download',\n command: () => {\n this.download()\n },\n },\n {\n divider: true,\n },\n {\n label: 'Delete File',\n icon: 'mdi-delete',\n command: () => {\n this.delete()\n },\n },\n ],\n },\n ]\n },\n },\n created() {\n this.api = new CosmosApi()\n },\n methods: {\n // File menu actions\n newFile: function () {\n this.fileModified = ''\n this.fileNew = true\n this.fileOpen = true\n },\n openFile: function () {\n this.fileOpen = true\n },\n // Called by the FileOpenDialog to set the file contents\n setFile: function ({ file, locked }) {\n // They opened a definition file so create a new binary\n if (file.name.includes('.txt')) {\n if (this.fileNew) {\n this.buildNewBinary(file)\n this.fileNew = false\n } else {\n this.getDefinition(file.name)\n }\n } else {\n this.unlockFile() // first unlock what was just being edited\n // Split off the ' *' which indicates a file is modified on the server\n this.filename = file.name.split('*')[0]\n this.fileModified = ''\n this.lockedBy = locked\n\n this.getDefinition()\n }\n },\n // Called by the FileOpenSaveDialog on error\n setError(event) {\n this.errorTitle = 'Error'\n this.errorText = `Error: ${event}`\n this.errorText = response.data.message\n this.showError = true\n },\n saveFile: function () {\n // Save a file by posting the new contents\n this.showSave = true\n\n const formData = new FormData()\n formData.append('binary', this.filename)\n formData.append('definition', this.definitionFilename)\n formData.append('tables', JSON.stringify(this.tables))\n Api.post(`/cosmos-api/tables/${this.filename}`, {\n data: formData,\n })\n .then((response) => {\n this.fileModified = ''\n setTimeout(() => {\n this.showSave = false\n }, 2000)\n })\n .catch(({ response }) => {\n this.showSave = false\n this.errorTitle = 'Save Error'\n this.errorText = response.data.message\n this.showError = true\n })\n this.lockFile() // Ensure this file is locked for editing\n },\n saveAs: function () {\n this.showSaveAs = true\n },\n saveAsFilename: function (filename) {\n this.filename = filename\n this.saveFile()\n },\n delete: function () {\n if (this.filename !== '') {\n this.$dialog\n .confirm(`Permanently delete file: ${this.filename}`, {\n okText: 'Delete',\n cancelText: 'Cancel',\n })\n .then((dialog) => {\n return Api.delete(`/cosmos-api/tables/${this.filename}`, {\n data: {},\n })\n })\n .then((response) => {\n this.newFile()\n })\n .catch((error) => {\n if (error) {\n this.$notify.caution({\n title: 'Error',\n body: `Error deleting file: ${error}`,\n })\n }\n })\n }\n },\n download: function () {\n if (this.filename !== '') {\n Api.get(`/cosmos-api/tables/${this.filename}`).then((response) => {\n // Decode Base64 string\n const decodedData = window.atob(response.data.contents)\n // Create UNIT8ARRAY of size same as row data length\n const uInt8Array = new Uint8Array(decodedData.length)\n // Insert all character code into uInt8Array\n for (let i = 0; i < decodedData.length; ++i) {\n uInt8Array[i] = decodedData.charCodeAt(i)\n }\n // Return BLOB image after conversion\n const blob = new Blob([uInt8Array], {\n type: 'application/octet-stream',\n })\n // Make a link and then 'click' on it to start the download\n const link = document.createElement('a')\n link.href = URL.createObjectURL(blob)\n link.setAttribute(\n 'download',\n this.filename.substring(this.filename.lastIndexOf('/') + 1)\n )\n link.click()\n })\n }\n },\n async upload() {\n this.fileInput = ''\n this.$refs.fileInput.$refs.input.click()\n // Wait for the file to be set by the dialog so upload works\n while (this.fileInput === '') {\n await new Promise((resolve) => setTimeout(resolve, 500))\n }\n this.filename = this.fileInput.name\n this.saveAs()\n },\n confirmLocalUnlock: function () {\n this.$dialog\n .confirm(\n 'Are you sure you want to unlock this file for editing? If another user is editing this file, your changes might conflict with each other.',\n {\n okText: 'Force Unlock',\n cancelText: 'Cancel',\n }\n )\n .then(() => {\n this.lockedBy = null\n return this.lockFile() // Re-lock it as this user so it's locked for anyone else who opens it\n })\n },\n lockFile: function () {\n return Api.post(`/cosmos-api/tables/${this.filename}/lock`)\n },\n unlockFile: function () {\n if (this.filename !== '' && !this.readOnly) {\n Api.post(`/cosmos-api/tables/${this.filename}/unlock`)\n }\n },\n getDefinition: function (definitionFilename = null) {\n if (!definitionFilename) {\n definitionFilename = this.filename\n .replace('/bin/', '/config/')\n .replace('.bin', '_def.txt')\n }\n const formData = new FormData()\n formData.append('binary', this.filename)\n formData.append('definition', definitionFilename)\n Api.post(`/cosmos-api/tables/load`, {\n data: formData,\n })\n .then((response) => {\n this.definitionFilename = definitionFilename\n this.tables = response.data.tables.map((table) => {\n return {\n ...table,\n // Build up the headers for proper searching\n headers: table.headers.map((text, i) => {\n const header = {\n text,\n filterable: text !== 'INDEX',\n }\n if (table.numColumns === 1) {\n // In the 1D table the searchable value is the first value in the row\n // Note the names in 1D are INDEX, NAME, VALUE\n return {\n ...header,\n value: `[0].${text.toLowerCase()}`,\n }\n } else {\n // In the 2D table the searchable value is always in the value attribute\n // of the current column item\n return {\n ...header,\n value: `[${i}].value`,\n }\n }\n }),\n }\n })\n\n if (response.data['errors']) {\n this.$notify.caution({\n title: 'Warning',\n body: response.data['errors'],\n })\n }\n })\n .catch((error) => {\n if (error.response.status == 404) {\n this.$notify.normal({\n title: 'Definition File Not Found',\n body: `Definition file ${definitionFilename} not found. Please select definition file.`,\n })\n this.fileOpen = true\n } else {\n this.$notify.serious({\n title: 'Error',\n body: `Error loading due to ${error.response.statusText}. Status: ${error.response.status}`,\n })\n }\n })\n },\n buildNewBinary: function (file) {\n const formData = new FormData()\n formData.append('contents', file.contents)\n Api.post(`/cosmos-api/tables/${file.name}/generate`, {\n data: formData,\n }).then((response) => {\n this.filename = response.data.filename\n this.getDefinition(file.name)\n })\n },\n onChange: function (item, { index, event }) {\n this.fileModified = '*'\n item[index].value = event\n },\n },\n}\n<\/script>\n"]},_coverageSchema:"1a1c01bbd47fc00a2c39e90264f33305004495a9",hash:"1e3b314010b0a1f11b4e3ba37696a43cb2aacfa1"},o=t[l]||(t[l]={});o[e]&&o[e].hash===n||(o[e]=i);var a=o[e];return oe=function(){return a},a}oe();var ae={components:{TopBar:E,TableRow:z,FileOpenSaveDialog:X,SimpleTextDialog:ie},data:function(){return oe().f[0]++,oe().s[0]++,{title:"Table Manager",search:"",curTab:null,tables:[],api:null,definition:null,fileInput:"",definitionFilename:"",fileNew:!1,filename:"",fileModified:"",lockedBy:null,fileOpen:!1,showSave:!1,showSaveAs:!1,showError:!1,errorTitle:"",errorText:""}},computed:{readOnly:function(){return oe().f[1]++,oe().s[1]++,!!this.lockedBy},fullFilename:function(){return oe().f[2]++,oe().s[2]++,"".concat(this.filename," ").concat(this.fileModified).trim()},menus:function(){var e=this;return oe().f[3]++,oe().s[3]++,[{label:"File",items:[{label:"New File",icon:"mdi-file-plus",command:function(){oe().f[4]++,oe().s[4]++,e.newFile()}},{label:"Open File",icon:"mdi-folder-open",command:function(){oe().f[5]++,oe().s[5]++,e.openFile()}},{divider:!0},{label:"Save File",icon:"mdi-content-save",command:function(){oe().f[6]++,oe().s[6]++,e.saveFile()}},{label:"Save As...",icon:"mdi-content-save",command:function(){oe().f[7]++,oe().s[7]++,e.saveAs()}},{divider:!0},{label:"Upload",icon:"mdi-cloud-upload",command:function(){oe().f[8]++,oe().s[8]++,e.upload()}},{label:"Download",icon:"mdi-cloud-download",command:function(){oe().f[9]++,oe().s[9]++,e.download()}},{divider:!0},{label:"Delete File",icon:"mdi-delete",command:function(){oe().f[10]++,oe().s[10]++,e.delete()}}]}]}},created:function(){oe().f[11]++,oe().s[11]++,this.api=new k},methods:{newFile:function(){oe().f[12]++,oe().s[12]++,this.fileModified="",oe().s[13]++,this.fileNew=!0,oe().s[14]++,this.fileOpen=!0},openFile:function(){oe().f[13]++,oe().s[15]++,this.fileOpen=!0},setFile:function(e){var n=e.file,t=e.locked;oe().f[14]++,oe().s[16]++,n.name.includes(".txt")?(oe().b[0][0]++,oe().s[17]++,this.fileNew?(oe().b[1][0]++,oe().s[18]++,this.buildNewBinary(n),oe().s[19]++,this.fileNew=!1):(oe().b[1][1]++,oe().s[20]++,this.getDefinition(n.name))):(oe().b[0][1]++,oe().s[21]++,this.unlockFile(),oe().s[22]++,this.filename=n.name.split("*")[0],oe().s[23]++,this.fileModified="",oe().s[24]++,this.lockedBy=t,oe().s[25]++,this.getDefinition())},setError:function(e){oe().f[15]++,oe().s[26]++,this.errorTitle="Error",oe().s[27]++,this.errorText="Error: ".concat(e),oe().s[28]++,this.errorText=response.data.message,oe().s[29]++,this.showError=!0},saveFile:function(){var e=this;oe().f[16]++,oe().s[30]++,this.showSave=!0;var n=(oe().s[31]++,new FormData);oe().s[32]++,n.append("binary",this.filename),oe().s[33]++,n.append("definition",this.definitionFilename),oe().s[34]++,n.append("tables",JSON.stringify(this.tables)),oe().s[35]++,v.post("/cosmos-api/tables/".concat(this.filename),{data:n}).then((function(n){oe().f[17]++,oe().s[36]++,e.fileModified="",oe().s[37]++,setTimeout((function(){oe().f[18]++,oe().s[38]++,e.showSave=!1}),2e3)})).catch((function(n){var t=n.response;oe().f[19]++,oe().s[39]++,e.showSave=!1,oe().s[40]++,e.errorTitle="Save Error",oe().s[41]++,e.errorText=t.data.message,oe().s[42]++,e.showError=!0})),oe().s[43]++,this.lockFile()},saveAs:function(){oe().f[20]++,oe().s[44]++,this.showSaveAs=!0},saveAsFilename:function(e){oe().f[21]++,oe().s[45]++,this.filename=e,oe().s[46]++,this.saveFile()},delete:function(){var e=this;oe().f[22]++,oe().s[47]++,""!==this.filename?(oe().b[2][0]++,oe().s[48]++,this.$dialog.confirm("Permanently delete file: ".concat(this.filename),{okText:"Delete",cancelText:"Cancel"}).then((function(n){return oe().f[23]++,oe().s[49]++,v["delete"]("/cosmos-api/tables/".concat(e.filename),{data:{}})})).then((function(n){oe().f[24]++,oe().s[50]++,e.newFile()})).catch((function(n){oe().f[25]++,oe().s[51]++,n?(oe().b[3][0]++,oe().s[52]++,e.$notify.caution({title:"Error",body:"Error deleting file: ".concat(n)})):oe().b[3][1]++}))):oe().b[2][1]++},download:function(){var e=this;oe().f[26]++,oe().s[53]++,""!==this.filename?(oe().b[4][0]++,oe().s[54]++,v.get("/cosmos-api/tables/".concat(this.filename)).then((function(n){oe().f[27]++;var t=(oe().s[55]++,window.atob(n.data.contents)),l=(oe().s[56]++,new Uint8Array(t.length));oe().s[57]++;for(var i=(oe().s[58]++,0);i<t.length;++i)oe().s[59]++,l[i]=t.charCodeAt(i);var o=(oe().s[60]++,new Blob([l],{type:"application/octet-stream"})),a=(oe().s[61]++,document.createElement("a"));oe().s[62]++,a.href=URL.createObjectURL(o),oe().s[63]++,a.setAttribute("download",e.filename.substring(e.filename.lastIndexOf("/")+1)),oe().s[64]++,a.click()}))):oe().b[4][1]++},upload:function(){var e=this;return(0,s.Z)((0,a.Z)().mark((function n(){return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:oe().f[28]++,oe().s[65]++,e.fileInput="",oe().s[66]++,e.$refs.fileInput.$refs.input.click(),oe().s[67]++;case 6:if(""!==e.fileInput){n.next=12;break}return oe().s[68]++,n.next=10,new Promise((function(e){return oe().f[29]++,oe().s[69]++,setTimeout(e,500)}));case 10:n.next=6;break;case 12:oe().s[70]++,e.filename=e.fileInput.name,oe().s[71]++,e.saveAs();case 16:case"end":return n.stop()}}),n)})))()},confirmLocalUnlock:function(){var e=this;oe().f[30]++,oe().s[72]++,this.$dialog.confirm("Are you sure you want to unlock this file for editing? If another user is editing this file, your changes might conflict with each other.",{okText:"Force Unlock",cancelText:"Cancel"}).then((function(){return oe().f[31]++,oe().s[73]++,e.lockedBy=null,oe().s[74]++,e.lockFile()}))},lockFile:function(){return oe().f[32]++,oe().s[75]++,v.post("/cosmos-api/tables/".concat(this.filename,"/lock"))},unlockFile:function(){oe().f[33]++,oe().s[76]++,oe().b[6][0]++,""===this.filename||(oe().b[6][1]++,this.readOnly)?oe().b[5][1]++:(oe().b[5][0]++,oe().s[77]++,v.post("/cosmos-api/tables/".concat(this.filename,"/unlock")))},getDefinition:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(oe().b[7][0]++,null);oe().f[34]++,oe().s[78]++,n?oe().b[8][1]++:(oe().b[8][0]++,oe().s[79]++,n=this.filename.replace("/bin/","/config/").replace(".bin","_def.txt"));var t=(oe().s[80]++,new FormData);oe().s[81]++,t.append("binary",this.filename),oe().s[82]++,t.append("definition",n),oe().s[83]++,v.post("/cosmos-api/tables/load",{data:t}).then((function(t){oe().f[35]++,oe().s[84]++,e.definitionFilename=n,oe().s[85]++,e.tables=t.data.tables.map((function(e){return oe().f[36]++,oe().s[86]++,(0,o.Z)((0,o.Z)({},e),{},{headers:e.headers.map((function(n,t){oe().f[37]++;var l=(oe().s[87]++,{text:n,filterable:"INDEX"!==n});return oe().s[88]++,1===e.numColumns?(oe().b[9][0]++,oe().s[89]++,(0,o.Z)((0,o.Z)({},l),{},{value:"[0].".concat(n.toLowerCase())})):(oe().b[9][1]++,oe().s[90]++,(0,o.Z)((0,o.Z)({},l),{},{value:"[".concat(t,"].value")}))}))})})),oe().s[91]++,t.data["errors"]?(oe().b[10][0]++,oe().s[92]++,e.$notify.caution({title:"Warning",body:t.data["errors"]})):oe().b[10][1]++})).catch((function(t){oe().f[38]++,oe().s[93]++,404==t.response.status?(oe().b[11][0]++,oe().s[94]++,e.$notify.normal({title:"Definition File Not Found",body:"Definition file ".concat(n," not found. Please select definition file.")}),oe().s[95]++,e.fileOpen=!0):(oe().b[11][1]++,oe().s[96]++,e.$notify.serious({title:"Error",body:"Error loading due to ".concat(t.response.statusText,". Status: ").concat(t.response.status)}))}))},buildNewBinary:function(e){var n=this;oe().f[39]++;var t=(oe().s[97]++,new FormData);oe().s[98]++,t.append("contents",e.contents),oe().s[99]++,v.post("/cosmos-api/tables/".concat(e.name,"/generate"),{data:t}).then((function(t){oe().f[40]++,oe().s[100]++,n.filename=t.data.filename,oe().s[101]++,n.getDefinition(e.name)}))},onChange:function(e,n){var t=n.index,l=n.event;oe().f[41]++,oe().s[102]++,this.fileModified="*",oe().s[103]++,e[t].value=l}}},se=ae,ce=(0,I.Z)(se,l,i,!1,null,null,null),re=ce.exports},3938:function(e,n,t){"use strict";t.r(n);var l=t(3467),i=t.n(l),o=t(8715),a=t.n(o),s=a()(i());s.push([e.id,".v-list[data-v-e3bb7458] .v-label{margin-left:5px}.v-list-item__icon[data-v-e3bb7458]{margin-right:15px!important}.v-list-item__title[data-v-e3bb7458]{color:#fff}",""]),n["default"]=s},7162:function(e,n,t){var l=t(3938);l.__esModule&&(l=l.default),"string"===typeof l&&(l=[[e.id,l,""]]),l.locals&&(e.exports=l.locals);var i=t(3514).Z;i("a2f2c426",l,!0,{sourceMap:!1,shadowMode:!1})}}]);
2
2
  //# sourceMappingURL=550.js.map