openc3-cosmos-tool-dataextractor 6.10.2 → 6.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/tools/dataextractor/ArrayWidget-DfiusKpM-a429a5a35aff3aad2072.js +2 -0
- data/tools/dataextractor/{ArrayplotWidget-DDEd-jRJ-84ba295930b81d4eb221.js → ArrayplotWidget-DsvOovu9-cae71a1b94599e900be5.js} +1 -1
- data/tools/dataextractor/BarColumn-DHHJBR3V-46bfcdd1b868aec90ca5.js +1 -0
- data/tools/dataextractor/BlockWidget-BdYXWS_0-a1603263f5ba10e5abb4.js +2 -0
- data/tools/dataextractor/ButtonWidget-zpSJmiQT-3cdbebd0c95fe74c6fed.js +2 -0
- data/tools/dataextractor/{CanvasWidget-DcwDi5Zk-1cf153daec27a9f780f5.js → CanvasWidget-DaUB1G9X-e59ca78e6da56a061082.js} +1 -1
- data/tools/dataextractor/CanvasdotWidget-C255aTVc-6ae2f67bee6c22492603.js +1 -0
- data/tools/dataextractor/CanvasimageWidget-CFlUUFqr-a895ca9cc3d9cee1e23d.js +1 -0
- data/tools/dataextractor/CanvasimagevalueWidget-s4gR3fo5-8c62e8d6362be567898d.js +1 -0
- data/tools/dataextractor/{CanvaslabelWidget-DoMplTTO-c59605de499dffd59345.js → CanvaslabelWidget-CaOc-lTQ-80bbf76fcf08634a4d3f.js} +1 -1
- data/tools/dataextractor/CanvaslabelvalueWidget-hqJoPekq-927f7e4946a290758b8b.js +1 -0
- data/tools/dataextractor/{CanvaslineWidget-D7W1TIxm-999c1564db4810f07c54.js → CanvaslineWidget-DebP2L43-a008528d4dd073aa4f5b.js} +1 -1
- data/tools/dataextractor/CanvaslinevalueWidget-BkPG5Vtx-512390727604c4d72a50.js +1 -0
- data/tools/dataextractor/CheckbuttonWidget-eQIcPATf-658fe1be998ed6c15429.js +1 -0
- data/tools/dataextractor/ComboboxWidget-B5kzYxFk-5a1a98b7ee3b81eefaaf.js +1 -0
- data/tools/dataextractor/DataExtractor-9e315e6ca613394b5f93.js +11 -0
- data/tools/dataextractor/{DateWidget-_ZmPsi2l-88b7ef356d7d81c22a8f.js → DateWidget-1IZOe50K-1dfd8bef8abf3063d827.js} +1 -1
- data/tools/dataextractor/DetailsDialog-D-rjL4oc-42527ff3f15896b49ffb.js +1 -0
- data/tools/dataextractor/DynamicWidget-DEHWYr8i-46b6f8c6d4ac6db30649.js +1 -0
- data/tools/dataextractor/FilechecksumWidget-F_FX1Kjx-30c3f25bba0fd0759a34.js +1 -0
- data/tools/dataextractor/FiledisplayWidget-BF3G22jF-2205b350f1620540a8ff.js +1 -0
- data/tools/dataextractor/FormatvalueWidget-BkF9iiHs-e6ea937daf837a000d48.js +1 -0
- data/tools/dataextractor/Graph-C-7C2Jq5-11eb0a8d281ee8b042a8.js +1 -0
- data/tools/dataextractor/{GraphWidget-BpkPpAbd-f051d1e664ed931ea4b2.js → GraphWidget-DRkDn8za-1cadc0976f9566e325d7.js} +1 -1
- data/tools/dataextractor/HorizontalWidget-DB64wzZB-e2665ea2fa7ba485c122.js +1 -0
- data/tools/dataextractor/HorizontalboxWidget-BsHsGlvK-a97546bf1b5df47aed69.js +1 -0
- data/tools/dataextractor/HorizontallineWidget-CyiexzIu-ed413bd3a5f83291ff07.js +1 -0
- data/tools/dataextractor/{IframeWidget-DK7rbULe-3a893df2232a44c3a3ba.js → IframeWidget-D9Vh0w2c-7148a75b6b5e4e5896b7.js} +1 -1
- data/tools/dataextractor/{ImageLoader-C9rN_pSY-ea1316dd0a3366aa0eb9.js → ImageLoader-B4iBPFyi-63980dd733dd3b1c6768.js} +1 -1
- data/tools/dataextractor/ImageviewerWidget-DqV4SClv-f306633521ca9d163b89.js +1 -0
- data/tools/dataextractor/{LabelWidget-D71FfOSw-2236774228b5f5147e34.js → LabelWidget-BDukcPet-31760d000a21f043f804.js} +1 -1
- data/tools/dataextractor/LabelledWidget-tVHE426s-21c84a75bf002fb8d01a.js +1 -0
- data/tools/dataextractor/LabelprogressbarWidget-CjMDFUUv-f37c673b8b65bfd7a3b0.js +1 -0
- data/tools/dataextractor/LabelsparklineWidget-dZl3cGu0-882d20869ccd87b0504a.js +1 -0
- data/tools/dataextractor/LabelvalueWidget-UcAc_2Ry-e635b73a24e0fafcb04d.js +1 -0
- data/tools/dataextractor/LabelvaluedescWidget-Crb8udVe-9e0215d421c3cd4cb0a0.js +1 -0
- data/tools/dataextractor/LabelvaluelimitsbarWidget-BZGUQrRt-fadf2a8cad01ed8ced03.js +1 -0
- data/tools/dataextractor/LabelvaluelimitscolumnWidget-NNYW2aMO-7ece42105a62cff943f7.js +1 -0
- data/tools/dataextractor/LabelvaluerangebarWidget-CjkVDlVJ-3e87ab73208f47528e87.js +1 -0
- data/tools/dataextractor/Layout-FpBx3iic-ce86a0846f170bb59bb3.js +1 -0
- data/tools/dataextractor/LedWidget-Bsp1aja--393030ed5a160d853828.js +1 -0
- data/tools/dataextractor/LimitsBar-IVv8t4FE-8c4464aab7f5c57f839c.js +1 -0
- data/tools/dataextractor/LimitsbarWidget-Bo1JAoQp-0d199c342a4173113eeb.js +1 -0
- data/tools/dataextractor/LimitscolorWidget-Doq8h_g1-fab5ce7ba52f4f843b44.js +1 -0
- data/tools/dataextractor/{LimitscolumnWidget-CjBy-CCI-da3d3299dd370fd29ad2.js → LimitscolumnWidget-qasXHN7m-26fe75ce1876c0fff23a.js} +1 -1
- data/tools/dataextractor/LinegraphWidget-BNMqcr_r-cb99dd80c8953ea69ba6.js +1 -0
- data/tools/dataextractor/MatrixbycolumnsWidget-BlF1CyIT-8ece83d295ac766f5fdc.js +1 -0
- data/tools/dataextractor/OpenC3TimePicker-D-_qqySI-3567ab45a515094ba0d0.js +1 -0
- data/tools/dataextractor/ProgressbarWidget-DQ80NANH-9fecc0b3bbb5e0110f90.js +1 -0
- data/tools/dataextractor/RadiobuttonWidget-LD18M4IQ-88d530bbe15b4d4b24eb.js +1 -0
- data/tools/dataextractor/RadiogroupWidget-D_pt2MPz-fdd38282ab3f3f6538ec.js +1 -0
- data/tools/dataextractor/RangebarWidget-DhaWpHjB-7f827ea4b32592166f2e.js +1 -0
- data/tools/dataextractor/RollupWidget-CMU1-HwL-45e2ca651e4c698b68f3.js +1 -0
- data/tools/dataextractor/ScrollwindowWidget-D7Ln-QMq-e50f5afd615e22e0cb4e.js +1 -0
- data/tools/dataextractor/SignalWidget-PreTg4Mt-fd853433a876369f4dc0.js +1 -0
- data/tools/dataextractor/SpacerWidget-Chy1NO28-2c01d0a39e58e0f504b4.js +1 -0
- data/tools/dataextractor/SparklineWidget-Bb-gCNNt-c75f2105d22c4077be9c.js +1 -0
- data/tools/dataextractor/TabbookWidget-a-LsBhBE-f061d50e234198262752.js +1 -0
- data/tools/dataextractor/TargetPacketItemChooser-DDqBQTWC-14850752bb987478aae1.js +1 -0
- data/tools/dataextractor/TextboxWidget-DIHEOldN-d88ae753462abdf03bdb.js +1 -0
- data/tools/dataextractor/TextfieldWidget-CIBo7Dau-aeef40d0899e9c0e93b3.js +1 -0
- data/tools/dataextractor/TimeWidget-CLuOYfPP-057e06980ffafaf21480.js +1 -0
- data/tools/dataextractor/TitleWidget-BTHKLAsb-2d44a428a77f77ff7baa.js +1 -0
- data/tools/dataextractor/{VWidget-CBmUpKSV-8813886a1679fe6a0d79.js → VWidget-BcwkHuIT-4b2fbda2cd88559aeb5b.js} +1 -1
- data/tools/dataextractor/ValueWidget-BubIamVx-8b83830f75d379716847.js +1 -0
- data/tools/dataextractor/ValuelimitsbarWidget-DKTrV1RT-62e9e609054c8e60d62e.js +1 -0
- data/tools/dataextractor/ValuelimitscolumnWidget-D8JIK4Zi-a8c29fba1f90d3ef7b74.js +1 -0
- data/tools/dataextractor/ValuerangebarWidget-D8hVKp0l-26ef42e5000b3d741af3.js +1 -0
- data/tools/dataextractor/VerticalWidget-DMp3DXGa-ec8a8497d466fc81135b.js +1 -0
- data/tools/dataextractor/VerticalboxWidget-CVf1d_3_-ddc77d1deb5814b78edf.js +1 -0
- data/tools/dataextractor/Widget-D4rzBHnr-20d97feec6afa1ff041b.js +1 -0
- data/tools/dataextractor/{main-651b12795c7d3f57ff0a.js → main-5393150a38f7b14176e1.js} +102 -102
- data/tools/dataextractor/main.js +1 -1
- metadata +73 -69
- data/tools/dataextractor/ArrayWidget-CR7Wpw3N-4ca5ba9c1472d172e34a.js +0 -2
- data/tools/dataextractor/BarColumn-XWs-3Cwb-21c0dd0f2e2d81d838b0.js +0 -1
- data/tools/dataextractor/BlockWidget-CfFgdNSv-ee2e545e318e822ff830.js +0 -2
- data/tools/dataextractor/ButtonWidget-BaSvtElA-3008cfe38f3e1a6ab70b.js +0 -2
- data/tools/dataextractor/CanvasdotWidget--awMOWyz-3268ed3b5e57c7ca818d.js +0 -1
- data/tools/dataextractor/CanvasimageWidget-YP1pCtvb-a7453f79095a733809a0.js +0 -1
- data/tools/dataextractor/CanvasimagevalueWidget-CjVHb2uj-6e19551a3cc4a7768c5b.js +0 -1
- data/tools/dataextractor/CanvaslabelvalueWidget-Dyo_ogHn-73e1670a20f61242cb4e.js +0 -1
- data/tools/dataextractor/CanvaslinevalueWidget-BOZyJuLE-42a886e387bc417d66ca.js +0 -1
- data/tools/dataextractor/CheckbuttonWidget-B1E4BC6v-e83eda227dc11668601e.js +0 -1
- data/tools/dataextractor/ComboboxWidget-BExUBH57-f47c695c6ce53ea803eb.js +0 -1
- data/tools/dataextractor/DataExtractor-8d5c32776754cd6abd96.js +0 -11
- data/tools/dataextractor/DetailsDialog-Bq7SS7bc-370ad81c0b8d58b6beb7.js +0 -1
- data/tools/dataextractor/DynamicWidget-DHL7pbgW-36375999f9512b7571a7.js +0 -1
- data/tools/dataextractor/FormatvalueWidget-4C0vrL2i-ab3a65a41c507c38a659.js +0 -1
- data/tools/dataextractor/Graph-B7KPo9Ul-7b306a369c80cfe4bf4a.js +0 -1
- data/tools/dataextractor/HorizontalWidget-DbEQYjFC-9203fa237c0cd1418248.js +0 -1
- data/tools/dataextractor/HorizontalboxWidget-CTomf_Iy-6bad35d71df5161bb1f2.js +0 -1
- data/tools/dataextractor/HorizontallineWidget-B7xx7ofY-97ef865d308d570e2c6f.js +0 -1
- data/tools/dataextractor/ImageviewerWidget-6d6Kl3W_-18ad718f4811f20f2ec9.js +0 -1
- data/tools/dataextractor/LabelledWidget-D2ir5kVU-46ddb5413fb17e9ba985.js +0 -1
- data/tools/dataextractor/LabelprogressbarWidget-C4_YbROz-2979f0fd13dea6e9c7e9.js +0 -1
- data/tools/dataextractor/LabelsparklineWidget-CdZ_pM2B-ccb839cc3227c8bb6bb9.js +0 -1
- data/tools/dataextractor/LabelvalueWidget-BS0EPY5h-b2d50ca8ebebfb8070d3.js +0 -1
- data/tools/dataextractor/LabelvaluedescWidget-Cpr8_Voq-9d3e714591f1790a792c.js +0 -1
- data/tools/dataextractor/LabelvaluelimitsbarWidget-DTcYbEQS-295e194a657a0f792e3f.js +0 -1
- data/tools/dataextractor/LabelvaluelimitscolumnWidget-D0ltQ9Ta-6d0ff30ab65fd16d3a56.js +0 -1
- data/tools/dataextractor/LabelvaluerangebarWidget-O8IHjvHs-9ee2ac49fa08bf5b2af9.js +0 -1
- data/tools/dataextractor/Layout-DW5yNlp7-a04881cc025866ca3e70.js +0 -1
- data/tools/dataextractor/LedWidget-DUvJ2v8k-9e2485196914e23d2538.js +0 -1
- data/tools/dataextractor/LimitsbarWidget-BehZv0-k-9abf0cdf88d8d5f1d1bd.js +0 -1
- data/tools/dataextractor/LimitscolorWidget-FXT0ZPPH-bbf2593ac2985c9d1166.js +0 -1
- data/tools/dataextractor/LinegraphWidget-lmu_tFKd-91801ed0807817616018.js +0 -1
- data/tools/dataextractor/MatrixbycolumnsWidget-CCF7rCkV-b873a6e1dc0653093d1a.js +0 -1
- data/tools/dataextractor/ProgressbarWidget-B5WN658S-bc544e73206a78e9249f.js +0 -1
- data/tools/dataextractor/RadiobuttonWidget-B_3nys46-1e702e9e29fb04e173ec.js +0 -1
- data/tools/dataextractor/RadiogroupWidget-BiMIL9li-590f65e75e2b8fe44af7.js +0 -1
- data/tools/dataextractor/RangebarWidget-Dn0GASdi-efd25afb6da2563deeec.js +0 -1
- data/tools/dataextractor/RollupWidget-b62qcG5K-539ab49117bf974594cd.js +0 -1
- data/tools/dataextractor/ScrollwindowWidget-Dn29gs-U-e981a64d1dfbe059e752.js +0 -1
- data/tools/dataextractor/SignalWidget-CLi6qask-f6fc60a0e6946a35b4c6.js +0 -1
- data/tools/dataextractor/SpacerWidget-BCA3gdap-cc56baed1188df1d3dc2.js +0 -1
- data/tools/dataextractor/SparklineWidget-D8mb4zLt-9e4d79986e2c57d73440.js +0 -1
- data/tools/dataextractor/TabbookWidget-Bkt4g02d-d85a179566dd6f6d41d3.js +0 -1
- data/tools/dataextractor/TargetPacketItemChooser-DGcXvdTX-422956920d910f64a05d.js +0 -1
- data/tools/dataextractor/TextboxWidget-CR05wO-t-63d354dae7933e1986ff.js +0 -1
- data/tools/dataextractor/TextfieldWidget-Be_Pz2bF-97c806c745df649fb2d8.js +0 -1
- data/tools/dataextractor/TimeWidget-Dy8zpkC6-460c2358c078e49902d8.js +0 -1
- data/tools/dataextractor/TitleWidget-BcmxUDzM-826f8fd6658fe3903950.js +0 -1
- data/tools/dataextractor/ValueWidget-BxWrHkYY-2278104ac60275e9299f.js +0 -1
- data/tools/dataextractor/ValuelimitsbarWidget-BdY02gqc-fdcf83e59254f5d0a837.js +0 -1
- data/tools/dataextractor/ValuelimitscolumnWidget-CuJ6rqtC-f0d3097b2117bee025dc.js +0 -1
- data/tools/dataextractor/ValuerangebarWidget-C5rolGDi-62d3e5e4d8774813037e.js +0 -1
- data/tools/dataextractor/VerticalWidget-DsnEzKZ2-697f969e98054b0a76c1.js +0 -1
- data/tools/dataextractor/VerticalboxWidget-CzDgveBl-40ee69dcb7bd81c4b4c5.js +0 -1
- data/tools/dataextractor/Widget-VCl8Ts8s-95d14cdc312d1d87d6e4.js +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 672c32328463a3cdfcf00ff9dcd3944c2c68a0b0caeb7cee7cdafd7e82fb7aa5
|
|
4
|
+
data.tar.gz: 4566a7e5fdbf8abbd7178084d32751e9e59c7c871a07e2e6fecc7cf208df65a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac0f586c3acc7c05f7af629c1b6e87418f25582c19f73ce9b24145edf018ba2d11eef45d34fc4891d84cb25b3ac48772c2c02afae75eaaeedb7100d5fec8d1fa
|
|
7
|
+
data.tar.gz: ea834d74a579ded779db3696aeb12b8b941f014f18aabeba3c45b42fc53ee5f0ef3a3071e1802b8fc3782d5803830a60f8aa921378758be4f9ce79aa23368082
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","vue","./DetailsDialog-D-rjL4oc-42527ff3f15896b49ffb.js","single-spa","./VWidget-BcwkHuIT-4b2fbda2cd88559aeb5b.js","vue-router","vuex","vuetify","./LimitsBar-IVv8t4FE-8c4464aab7f5c57f839c.js","./Widget-D4rzBHnr-20d97feec6afa1ff041b.js"],function(B,N){"use strict";var h,a,m,u,i,d,p,l,g,f,v,w,y,x,C,V;return{setters:[t=>{h=t.d},t=>{a=t.resolveComponent,m=t.createElementBlock,u=t.openBlock,i=t.createVNode,d=t.normalizeStyle,p=t.normalizeClass,l=t.withCtx,g=t.Fragment,f=t.renderList,v=t.createBlock,w=t.withModifiers,y=t.createTextVNode,x=t.toDisplayString},t=>{C=t.q},null,t=>{V=t.h},null,null,null,null,null],execute:function(){const t={components:{DetailsDialog:C},mixins:[V],data:function(){return{width:200,height:100,itemsPerRow:4,formatter:null}},computed:{aging(){return{"--aging":this.grayLevel}}},created:function(){this.width=this.setWidth(this.parameters[3],"px",this.width),this.height=this.setHeight(this.parameters[4],"px",this.height),this.parameters[5]&&(this.formatter=this.parameters[5]),this.parameters[6]&&(this.itemsPerRow=parseInt(this.parameters[6]))},methods:{getType:function(){let e="CONVERTED";return this.parameters[7]&&(e=this.parameters[7]),e},formatValue:function(e){var r;let n="",k=" ",D=`
|
|
2
|
+
`,o=0;if(Array.isArray(e)){for(const c of e)this.formatter&&((r=this.formatter)==null?void 0:r.toLowerCase())!=="nil"?n+=sprintf(this.formatter,c):n+=c,o+=1,o%this.itemsPerRow===0?(o=0,n+=D):n+=k;return n.trim()}else return e}}},S={class:"array-widget-container"};function z(e,r,n,k,D,o){const c=a("v-textarea"),_=a("v-list-item-title"),j=a("v-list-item"),L=a("v-list"),M=a("v-menu"),E=a("details-dialog");return u(),m("div",S,[i(c,{variant:"solo",density:"compact",readonly:"","no-resize":"","auto-grow":"",rows:"2","hide-details":"","model-value":e._value,class:p(e.valueClass),style:d([e.computedStyle,o.aging]),"data-test":"array-widget",onContextmenu:e.showContextMenu},null,8,["model-value","class","style","onContextmenu"]),i(M,{modelValue:e.contextMenuShown,"onUpdate:modelValue":r[0]||(r[0]=s=>e.contextMenuShown=s),target:[e.x,e.y]},{default:l(()=>[i(L,null,{default:l(()=>[(u(!0),m(g,null,f(e.contextMenuOptions,(s,I)=>(u(),v(j,{key:I,onClick:w(s.action,["stop"])},{default:l(()=>[i(_,null,{default:l(()=>[y(x(s.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["modelValue","target"]),i(E,{modelValue:e.viewDetails,"onUpdate:modelValue":r[1]||(r[1]=s=>e.viewDetails=s),"target-name":e.parameters[0],"packet-name":e.parameters[1],"item-name":e.parameters[2]},null,8,["modelValue","target-name","packet-name","item-name"])])}const T=B("default",h(t,[["render",z],["__scopeId","data-v-69b65cde"]]))}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./main-
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","./GraphWidget-DRkDn8za-1cadc0976f9566e325d7.js","vue","vue-router","single-spa","vuex","vuetify","./Widget-D4rzBHnr-20d97feec6afa1ff041b.js"],function(m,k){"use strict";var c,l,h,d,u,p;return{setters:[s=>{c=s.d,l=s.f,h=s.P},s=>{d=s.M},s=>{u=s.createElementBlock,p=s.openBlock},null,null,null,null,null],execute:function(){const s={mixins:[d],data:function(){return{items:[],indexes:{},data:[[]],cable:new h,subscription:null,graph:null,xAxis:null,title:"Array Plot",colorIndex:0,colors:["#00c7cb","#938bdb","#4dacff","lime","darkorange","red","gold","hotpink","tan","cyan","maroon","blue","teal","purple","green","brown","lightblue","white","black"]}},computed:{dataOnly(){return this.data[1]}},watch:{dataOnly:function(){this.graph&&this.graph.setData(this.data)}},created(){for(const[e,t]of this.items.entries())this.data.push([]),this.indexes[this.subscriptionKey(t)]=e+1,t.color=this.colors[this.colorIndex],this.colorIndex++;this.appliedSettings.forEach(e=>{switch(e[0]){case"TITLE":this.title=e[1];break;case"X_AXIS":this.xAxis={start:parseFloat(e[1]),step:parseFloat(e[2])};break}})},mounted(){let e=[];this.items.forEach(n=>{e.push({label:this.itemName(n),stroke:n.color,width:2,value:(r,i)=>typeof i=="string"||isNaN(i)?"NaN":i==null?"--":i.toFixed(3)})});let t={title:this.title,width:this.size.width,height:this.size.height,scales:{x:{time:!1},y:{time:!1,range:(n,r,i)=>[r,i]}},axes:[{stroke:"white",grid:{show:!0,stroke:"rgba(255, 255, 255, .1)",width:2}},{stroke:"white",grid:{show:!0,stroke:"rgba(255, 255, 255, .1)",width:2}}],series:[{label:"X Value"},...e]};this.graph=new l(t,this.data,document.getElementById(`chart${this.id}`)),this.subscribe()},beforeUnmount:function(){this.cable.disconnect()},methods:{subscribe:function(){this.cable.createSubscription("StreamingChannel",window.openc3Scope,{received:e=>this.received(e),connected:()=>{this.addItemsToSubscription(this.items)},disconnected:e=>{e.allowReconnect&&this.errors.push({type:"disconnected",message:"OpenC3 backend connection disconnected",time:new Date().getTime()})},rejected:()=>{this.errors.push({type:"rejected",message:"OpenC3 backend connection rejected",time:new Date().getTime()})}}).then(e=>{this.subscription=e})},received:function(e){for(let t of e){let n=[];for(const[r,i]of Object.entries(t)){r==="__time"&&(this.xAxis?n=Array.from({length:this.data[1].length},(f,o)=>this.xAxis.start+o*this.xAxis.step):n.length===0&&(n=Array.from({length:this.data[1].length},(f,o)=>o)),this.data[0]=n);let a=this.indexes[r];a&&(Array.isArray(i[0])?(this.data[a]=i[1],n=i[0]):this.data[a]=i)}}},addItemsToSubscription:function(e=this.items){this.subscription&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(t=>{t&&OpenC3Auth.setTokens(),this.subscription.perform("add",{scope:window.openc3Scope,token:localStorage.openc3Token,items:e.map(this.subscriptionKey),start_time:null,end_time:null})})},itemName:function(e){return`${e.targetName} ${e.packetName} ${e.itemName}`},subscriptionKey:function(e){let t=`${e.reduced}__TLM__${e.targetName}__${e.packetName}__${e.itemName}__${e.valueType}`;return(e.reduced==="REDUCED_MINUTE"||e.reduced==="REDUCED_HOUR"||e.reduced==="REDUCED_DAY")&&(t+=`__${e.reducedType}`),t}}},b=["id"];function g(e,t,n,r,i,a){return p(),u("div",{id:`chart${e.id}`,class:"pa-1"},null,8,b)}const w=m("default",c(s,[["render",g]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","./main-5393150a38f7b14176e1.js"],function(a,n){"use strict";var h,r;return{setters:[e=>{h=e.o},e=>{r=e.B}],execute:function(){const e=a("u",{mixins:[h],data(){return{minValue:null,maxValue:null,redLow:0,yellowLow:0,greenLow:0,greenHigh:0,yellowHigh:0,redHigh:0,blue:0,api:null,limitsSettings:{DEFAULT:[]},currentLimitsSet:"DEFAULT",currentSetRefreshInterval:null}},computed:{cssProps:function(){let t=this.screenValues[this.valueId][0],i=this.modifyLimits(this.limitsSettings[this.selectedLimitsSet]);return this.calcLimits(i),{"--height":this.height+"px","--width":this.width+"px","--container-height":this.height-5+"px","--position":this.calcPosition(t,i)+"%","--redlow-width":this.redLow+"%","--redhigh-width":this.redHigh+"%","--yellowlow-width":this.yellowLow+"%","--yellowhigh-width":this.yellowHigh+"%","--greenlow-width":this.greenLow+"%","--greenhigh-width":this.greenHigh+"%","--blue-width":this.blue+"%"}},selectedLimitsSet:function(){return this.limitsSettings.hasOwnProperty(this.currentLimitsSet)?this.currentLimitsSet:"DEFAULT"}},created(){this.api=new r,this.parameters[2].includes("[[")&&(this.parameters[2]=this.parameters[2].replace("[[","[").replace("]]","]")),this.api.get_limits(this.parameters[0],this.parameters[1],this.parameters[2]).then(t=>{this.limitsSettings=t}),this.getCurrentLimitsSet(),this.currentSetRefreshInterval=setInterval(this.getCurrentLimitsSet,6e4),this.appliedSettings.forEach(t=>{t[0]==="MIN_VALUE"&&(this.minValue=parseInt(t[1])),t[0]==="MAX_VALUE"&&(this.maxValue=parseInt(t[1]))}),this.width=this.setWidth(this.parameters[4],"px",this.width),this.height=this.setHeight(this.parameters[5],"px",this.height),this.valueId=`${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__CONVERTED`,this.$emit("addItem",this.valueId)},destroyed(){this.$emit("deleteItem",this.valueId),clearInterval(this.currentSetRefreshInterval)},methods:{modifyLimits(t){if(!t)return;this.redLow=10,this.redHigh=10,this.minValue!==null&&(t[0]<=this.minValue&&(t[0]=this.minValue,this.redLow=0),t[1]<=this.minValue&&(t[1]=this.minValue),t[2]<=this.minValue&&(t[2]=this.minValue),t[3]<=this.minValue&&(t[3]=this.minValue),t.length>4&&t[4]<=this.minValue&&(t[4]=this.minValue),t.length>4&&t[5]<=this.minValue&&(t[5]=this.minValue)),this.maxValue!==null&&(t[0]>=this.maxValue&&(t[0]=this.maxValue),t[1]>=this.maxValue&&(t[1]=this.maxValue),t[2]>=this.maxValue&&(t[2]=this.maxValue),t[3]>=this.maxValue&&(t[3]=this.maxValue,this.redHigh=0),t.length>4&&t[4]>=this.maxValue&&(t[4]=this.maxValue),t.length>4&&t[5]>=this.maxValue&&(t[5]=this.maxValue)),t[0]==t[1]&&(this.yellowLow=0),t[2]==t[3]&&(this.yellowHigh=0);let i=80;return this.redLow==0&&(i+=10),this.redHigh==0&&(i+=10),this.scale=(t[3]-t[0])/i,t},calcPosition(t,i){if(!t||!i)return;let l=i[0]-10*this.scale;if(this.minValue&&this.minValue==i[0]&&(l=i[0]),i[3]-10*this.scale,this.maxValue&&this.maxValue==i[3]&&i[3],t.raw)return t.raw==="-Infinity"?0:100;if(t<this.min)return 0;if(t>this.max)return 100;{const s=parseInt((t-l)/this.scale);return s>100?100:s<0?0:s}},calcLimits(t){t&&(this.yellowLow=Math.round((t[1]-t[0])/this.scale),this.yellowHigh=Math.round((t[3]-t[2])/this.scale),t.length>4?(this.greenLow=Math.round((t[4]-t[1])/this.scale),this.greenHigh=Math.round((t[2]-t[5])/this.scale),this.blue=Math.round(100-this.redLow-this.yellowLow-this.greenLow-this.greenHigh-this.yellowHigh-this.redHigh)):(this.greenLow=Math.round(100-this.redLow-this.yellowLow-this.yellowHigh-this.redHigh),this.greenHigh=0,this.blue=0))},getCurrentLimitsSet:function(){this.api.get_limits_set().then(t=>{this.currentLimitsSet=t})}}})}}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","vue","./DetailsDialog-D-rjL4oc-42527ff3f15896b49ffb.js","single-spa","./VWidget-BcwkHuIT-4b2fbda2cd88559aeb5b.js","vue-router","vuex","vuetify","./LimitsBar-IVv8t4FE-8c4464aab7f5c57f839c.js","./Widget-D4rzBHnr-20d97feec6afa1ff041b.js"],function(S,z){"use strict";var u,a,m,h,s,p,g,o,w,f,v,y,x,k,V,C;return{setters:[e=>{u=e.d},e=>{a=e.resolveComponent,m=e.createElementBlock,h=e.openBlock,s=e.createVNode,p=e.normalizeStyle,g=e.normalizeClass,o=e.withCtx,w=e.Fragment,f=e.renderList,v=e.createBlock,y=e.withModifiers,x=e.createTextVNode,k=e.toDisplayString},e=>{V=e.q},null,e=>{C=e.h},null,null,null,null,null],execute:function(){const e={components:{DetailsDialog:V},mixins:[C],data:function(){return{width:400,height:400,bytesPerWord:4,wordsPerRow:4,addrFormat:null,formatter:"%02X"}},computed:{aging(){return{"--aging":this.grayLevel}},rows:function(){return(this.height-16)/24}},created:function(){this.width=this.setWidth(this.parameters[3],"px",this.width),this.height=this.setHeight(this.parameters[4],"px",this.height),this.parameters[5]&&(this.formatter=this.parameters[5]),this.parameters[6]&&(this.bytesPerWord=parseInt(this.parameters[6])),this.parameters[7]&&(this.wordsPerRow=parseInt(this.parameters[7])),this.parameters[8]&&(this.addrFormat=this.parameters[8])},methods:{getType:function(){let t="RAW";return this.parameters[9]&&(t=this.parameters[9]),t},formatValue:function(t){let r="";if(t&&t.raw){let D=" ",B=`
|
|
2
|
+
`,i=0,l=0;const d=this.bytesPerWord*this.wordsPerRow;for(const c of t.raw)this.addrFormat&&i===0&&(r+=sprintf(this.addrFormat,l),l+=d),r+=sprintf(this.formatter,c),i+=1,i%d===0?(i=0,r+=B):i%this.bytesPerWord===0&&(r+=D)}else r=t;return r}}},W={class:"block-widget-container"};function F(t,r,D,B,i,l){const d=a("v-textarea"),c=a("v-list-item-title"),M=a("v-list-item"),P=a("v-list"),_=a("v-menu"),b=a("details-dialog");return h(),m("div",W,[s(d,{variant:"solo",density:"compact",readonly:"","no-resize":"","hide-details":"",rows:l.rows,width:t.width,"model-value":t._value,class:g(t.valueClass),style:p([t.computedStyle,l.aging]),"data-test":"valueText",onContextmenu:t.showContextMenu},null,8,["rows","width","model-value","class","style","onContextmenu"]),s(_,{modelValue:t.contextMenuShown,"onUpdate:modelValue":r[0]||(r[0]=n=>t.contextMenuShown=n),target:[t.x,t.y]},{default:o(()=>[s(P,null,{default:o(()=>[(h(!0),m(w,null,f(t.contextMenuOptions,(n,j)=>(h(),v(M,{key:j,onClick:y(n.action,["stop"])},{default:o(()=>[s(c,null,{default:o(()=>[x(k(n.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["modelValue","target"]),s(b,{modelValue:t.viewDetails,"onUpdate:modelValue":r[1]||(r[1]=n=>t.viewDetails=n),"target-name":t.parameters[0],"packet-name":t.parameters[1],"item-name":t.parameters[2]},null,8,["modelValue","target-name","packet-name","item-name"])])}const I=S("default",u(e,[["render",F],["__scopeId","data-v-454d6ab5"]]))}}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","vue","single-spa","./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue-router","vuex","vuetify"],function(exports,module){"use strict";var d,w,FA,BA,resolveComponent,createBlock,openBlock,withCtx,createVNode,createElementVNode,createCommentVNode,createTextVNode,toDisplayString,withModifiers,createElementBlock,normalizeStyle,o;return{setters:[e=>{d=e.d,w=e.w,FA=e.F,BA=e.B},e=>{resolveComponent=e.resolveComponent,createBlock=e.createBlock,openBlock=e.openBlock,withCtx=e.withCtx,createVNode=e.createVNode,createElementVNode=e.createElementVNode,createCommentVNode=e.createCommentVNode,createTextVNode=e.createTextVNode,toDisplayString=e.toDisplayString,withModifiers=e.withModifiers,createElementBlock=e.createElementBlock,normalizeStyle=e.normalizeStyle},null,e=>{o=e.o},null,null,null],execute:function(){const S={props:{uuid:{type:String,default:null},cmdUser:{type:String,default:null},cmdString:{type:String,default:null},persistent:{type:Boolean,default:!1},modelValue:Boolean},emits:["update:modelValue","status"],data(){return{updater:null,username:null,password:null,canApprove:!1,error:!1,errorText:""}},computed:{show:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},formValid:function(){return!!this.password&&!!this.username},disableButtons:function(){return!this.formValid&&!this.canApprove}},watch:{modelValue:function(e,t){e?(FA.get("/openc3-api/criticalcmd/canapprove/"+this.uuid).then(s=>{s.data.status==="ok"&&(this.canApprove=!0)}),this.updater=setInterval(()=>{this.uuid?FA.get("/openc3-api/criticalcmd/status/"+this.uuid).then(s=>{s.data.status!=="WAITING"&&(this.$emit("status",s.data.status),this.show=!1)}):this.show=!1},1e3)):(clearInterval(this.updater),this.updater=null,this.canApprove=!1,this.username=null,this.password=null)}},beforeUnmount(){clearInterval(this.updater),this.updater=null,this.canApprove=!1,this.username=null,this.password=null},methods:{async approve(){if(this.canApprove)await FA.post("/openc3-api/criticalcmd/approve/"+this.uuid,{}).then(e=>{e.status==200&&(this.$emit("status","APPROVED"),this.show=!1,this.error=!1)});else{let e=await this.getKeycloakToken();w.post("/openc3-api/criticalcmd/approve/"+this.uuid,{},{headers:{Authorization:e,"Content-Type":"application/json"},params:{scope:window.openc3Scope},timeout:5e3}).then(t=>{this.$emit("status","APPROVED"),this.show=!1,this.error=!1}).catch(t=>{this.error=!0,t.response?this.errorText=t.response.data.message:this.errorText=t.message})}},async reject(){if(this.canApprove)await FA.post("/openc3-api/criticalcmd/reject/"+this.uuid,{}).then(e=>{e.status==200&&(this.$emit("status","REJECTED"),this.show=!1,this.error=!1)});else{let e=await this.getKeycloakToken();(await w.post("/openc3-api/criticalcmd/reject/"+this.uuid,{},{headers:{Authorization:e,"Content-Type":"application/json"},params:{scope:window.openc3Scope},timeout:5e3})).status==200&&(this.$emit("status","REJECTED"),this.show=!1,this.error=!1)}},async getKeycloakToken(){return(await w.post(localStorage.keycloakUrl+"/realms/"+localStorage.keycloakRealm+"/protocol/openid-connect/token",{username:this.username,password:this.password,client_id:localStorage.keycloakClientId,grant_type:"password",scope:"openid"},{headers:{"Content-Type":"application/x-www-form-urlencoded"},timeout:5e3})).data.access_token}}};function E(e,t,s,p,a,r){const n=resolveComponent("v-spacer"),f=resolveComponent("v-toolbar"),m=resolveComponent("v-alert"),l=resolveComponent("v-row"),h=resolveComponent("v-text-field"),C=resolveComponent("v-btn"),v=resolveComponent("v-container"),V=resolveComponent("v-card-text"),u=resolveComponent("v-card"),y=resolveComponent("v-dialog");return openBlock(),createBlock(y,{modelValue:r.show,"onUpdate:modelValue":t[3]||(t[3]=c=>r.show=c),persistent:s.persistent,width:"600"},{default:withCtx(()=>[createVNode(u,null,{default:withCtx(()=>[createVNode(f,{height:"24"},{default:withCtx(()=>[createVNode(n),t[4]||(t[4]=createElementVNode("span",null," Waiting for Critical Command Approval ",-1)),createVNode(n)]),_:1}),createVNode(V,null,{default:withCtx(()=>[createVNode(v,{fluid:""},{default:withCtx(()=>[createVNode(m,{modelValue:a.error,"onUpdate:modelValue":t[0]||(t[0]=c=>a.error=c),type:"error",closable:""},{default:withCtx(()=>[createTextVNode(toDisplayString(a.errorText),1)]),_:1},8,["modelValue"]),createVNode(l,{class:"pt-4",style:{color:"white"}},{default:withCtx(()=>[createTextVNode("User "+toDisplayString(s.cmdUser)+" is waiting for approval to execute: ",1)]),_:1}),createVNode(l,{class:"pa-4",style:{color:"white"}},{default:withCtx(()=>[createTextVNode(toDisplayString(s.cmdString),1)]),_:1}),createVNode(l,{class:"text-subtitle-2"},{default:withCtx(()=>[createTextVNode("UUID: "+toDisplayString(s.uuid),1)]),_:1}),a.canApprove?createCommentVNode("",!0):(openBlock(),createBlock(l,{key:0},{default:withCtx(()=>[createVNode(h,{modelValue:a.username,"onUpdate:modelValue":t[1]||(t[1]=c=>a.username=c),label:"Username","data-test":"username"},null,8,["modelValue"])]),_:1})),a.canApprove?createCommentVNode("",!0):(openBlock(),createBlock(l,{key:1},{default:withCtx(()=>[createVNode(h,{modelValue:a.password,"onUpdate:modelValue":t[2]||(t[2]=c=>a.password=c),type:"password",label:"Password","data-test":"password"},null,8,["modelValue"])]),_:1})),createVNode(l,{class:"pt-2"},{default:withCtx(()=>[createVNode(n),createVNode(C,{type:"submit",class:"mx-2",color:"secondary",variant:"outlined",disabled:r.disableButtons,"data-test":"reject",onClick:withModifiers(r.reject,["prevent"])},{default:withCtx(()=>[...t[5]||(t[5]=[createTextVNode(" Reject ",-1)])]),_:1},8,["disabled","onClick"]),createVNode(C,{type:"submit",class:"mx-2",color:"primary",disabled:r.disableButtons,"data-test":"approve",onClick:withModifiers(r.approve,["prevent"])},{default:withCtx(()=>[...t[6]||(t[6]=[createTextVNode(" Approve ",-1)])]),_:1},8,["disabled","onClick"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","persistent"])}const N=d(S,[["render",E],["__scopeId","data-v-0b6637f7"]]),_sfc_main={components:{CriticalCmdDialog:N},mixins:[o],data(){return{api:null,displaySendHazardous:!1,lastCmd:"",criticalCmdUuid:null,criticalCmdString:null,criticalCmdUser:null,displayCriticalCmd:!1}},computed:{buttonText(){return this.parameters[0]},eval(){return this.parameters[1]}},created(){this.api=new BA},methods:{async onClick(){const lines=this.eval.split(";;"),self=this,screen=this.screen,screenValues=this.screenValues,screenTimeZone=this.screenTimeZone,api=this.api,runScript=this.runScript;(self||screen||screenValues||screenTimeZone||api||runScript)&&this.$nextTick(()=>{});for(let i=0;i<lines.length;i++)try{const result=eval(lines[i].trim());result instanceof Promise&&await result}catch(e){if(e.message.includes("CriticalCmdError"))this.criticalCmdUuid=e.object.data.instance_variables["@uuid"],this.criticalCmdString=e.object.data.instance_variables["@cmd_string"],this.criticalCmdUser=e.object.data.instance_variables["@username"],this.displayCriticalCmd=!0;else if(e.message.includes("is Hazardous"))for(this.lastCmd=e.message.split(`
|
|
2
|
+
`).pop(),this.displaySendHazardous=!0;this.displaySendHazardous;)await new Promise(t=>setTimeout(t,500));else console.error(e)}},async sendHazardousCmd(){this.lastCmd=this.lastCmd.replace("cmd(","this.api.cmd_no_hazardous_check(");try{const result=eval(this.lastCmd);result instanceof Promise&&await result}catch(e){e.message.includes("CriticalCmdError")&&(this.criticalCmdUuid=e.object.data.instance_variables["@uuid"],this.criticalCmdString=e.object.data.instance_variables["@cmd_string"],this.criticalCmdUser=e.object.data.instance_variables["@username"],this.displayCriticalCmd=!0)}this.displaySendHazardous=!1},cancelHazardousCmd(){this.displaySendHazardous=!1},runScript(e,t=!0,s={}){let p=[];for(const a in s)p.push({key:a,value:s[a],readonly:!1});FA.post(`/script-api/scripts/${e}/run`,{data:{environment:p}}).then(a=>{t&&window.open(`/tools/scriptrunner/${a.data}`,"_blank")})}}},_hoisted_1={class:"mx-1"};function _sfc_render(e,t,s,p,a,r){const n=resolveComponent("v-btn"),f=resolveComponent("v-card-title"),m=resolveComponent("v-row"),l=resolveComponent("v-spacer"),h=resolveComponent("v-card-text"),C=resolveComponent("v-card"),v=resolveComponent("v-dialog"),V=resolveComponent("critical-cmd-dialog");return openBlock(),createElementBlock("div",null,[createVNode(n,{class:"ma-1",color:"primary",style:normalizeStyle(e.computedStyle),onClick:r.onClick},{default:withCtx(()=>[createTextVNode(toDisplayString(r.buttonText),1)]),_:1},8,["style","onClick"]),createVNode(v,{modelValue:a.displaySendHazardous,"onUpdate:modelValue":t[0]||(t[0]=u=>a.displaySendHazardous=u),"max-width":"300"},{default:withCtx(()=>[createVNode(C,null,{default:withCtx(()=>[createVNode(f,null,{default:withCtx(()=>[...t[2]||(t[2]=[createTextVNode("Hazardous",-1)])]),_:1}),createVNode(h,null,{default:withCtx(()=>[createElementVNode("div",_hoisted_1,[createVNode(m,{class:"my-2"},{default:withCtx(()=>[...t[3]||(t[3]=[createElementVNode("span",null," Warning: Command is Hazardous. Send? ",-1)])]),_:1}),createVNode(m,null,{default:withCtx(()=>[createVNode(l),createVNode(n,{variant:"outlined",onClick:r.cancelHazardousCmd},{default:withCtx(()=>[...t[4]||(t[4]=[createTextVNode(" Cancel ",-1)])]),_:1},8,["onClick"]),createVNode(n,{class:"bg-primary mx-1",onClick:r.sendHazardousCmd},{default:withCtx(()=>[...t[5]||(t[5]=[createTextVNode(" Send ",-1)])]),_:1},8,["onClick"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["modelValue"]),createVNode(V,{modelValue:a.displayCriticalCmd,"onUpdate:modelValue":t[1]||(t[1]=u=>a.displayCriticalCmd=u),uuid:a.criticalCmdUuid,"cmd-string":a.criticalCmdString,"cmd-user":a.criticalCmdUser},null,8,["modelValue","uuid","cmd-string","cmd-user"])])}const ButtonWidget=exports("default",d(_sfc_main,[["render",_sfc_render]]))}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./Layout-
|
|
1
|
+
System.register(["./Layout-FpBx3iic-ce86a0846f170bb59bb3.js","vue","./main-5393150a38f7b14176e1.js","./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue-router","single-spa","vuex","vuetify"],function(p,f){"use strict";var i,s,n,a,l,c,u,o,g;return{setters:[e=>{i=e.u},e=>{s=e.createElementBlock,n=e.openBlock,a=e.Fragment,l=e.renderList,c=e.createBlock,u=e.resolveDynamicComponent,o=e.mergeProps},e=>{g=e.d},null,null,null,null,null],execute:function(){const e={mixins:[i],computed:{width(){return this.parameters[0]+"px"},height(){return this.parameters[1]+"px"}}},d=["width","height"];function h(r,B,k,y,x,m){return n(),s("svg",{id:"canvas",width:m.width,height:m.height},[(n(!0),s(a,null,l(r.widgets,(t,v)=>(n(),c(u(t.type),o({ref_for:!0},r.listeners,{key:v,target:t.target,parameters:t.parameters,settings:t.settings,"screen-values":r.screenValues,"screen-time-zone":r.screenTimeZone,widgets:t.widgets,name:t.name,line:t.line,"line-number":t.lineNumber}),null,16,["target","parameters","settings","screen-values","screen-time-zone","widgets","name","line","line-number"]))),128))],8,d)}const w=p("default",g(e,[["render",h],["__scopeId","data-v-16dc7bf8"]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(s,a){"use strict";var t,n,l,c;return{setters:[e=>{t=e.o},e=>{n=e.createElementBlock,l=e.openBlock},e=>{c=e.d},null,null,null,null],execute:function(){const e={mixins:[t]},u=["cx","cy","r","fill"];function i(r,m,f,p,d,v){return l(),n("circle",{cx:r.parameters[0],cy:r.parameters[1],r:r.parameters[3],fill:r.parameters[2]},null,8,u)}const o=s("default",c(e,[["render",i]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","./ImageLoader-B4iBPFyi-63980dd733dd3b1c6768.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(m,d){"use strict";var i,n,s,a,l,c,h;return{setters:[e=>{i=e.o},e=>{n=e.s},e=>{s=e.createElementBlock,a=e.createCommentVNode,l=e.openBlock,c=e.normalizeStyle},e=>{h=e.d},null,null,null,null],execute:function(){const e={mixins:[i,n],emits:["open"],data:function(){return{imageUrl:null,screenTarget:null,screenName:null}},computed:{width:function(){return this.parameters[3]?`${this.parameters[3]}px`:"100%"},height:function(){return this.parameters[4]?`${this.parameters[4]}px`:"100%"},pointerStyle(){return this.screenTarget&&this.screenName?{cursor:"pointer"}:{cursor:"default"}}},created:function(){this.appliedSettings.forEach(t=>{t[0]==="SCREEN"&&(this.screenTarget=t[1],this.screenName=t[2])}),this.parameters[0].startsWith("http")?this.imageUrl=this.parameters[0]:this.getPresignedUrl(this.parameters[0]).then(t=>{this.imageUrl=t})},methods:{clickHandler(){this.screenTarget&&this.screenName&&this.$emit("open",this.screenTarget,this.screenName)}}},u=["href","x","y","width","height"];function p(t,o,y,k,N,r){return t.imageUrl?(l(),s("image",{key:0,href:t.imageUrl,x:t.parameters[1],y:t.parameters[2],width:r.width,height:r.height,style:c(r.pointerStyle),onClick:o[0]||(o[0]=(...g)=>r.clickHandler&&r.clickHandler(...g))},null,12,u)):a("",!0)}const f=m("default",h(e,[["render",p]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","./ImageLoader-B4iBPFyi-63980dd733dd3b1c6768.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(I,S){"use strict";var m,d,l,n,h,o,g,p,u,c,f;return{setters:[t=>{m=t.o},t=>{d=t.s},t=>{l=t.createElementBlock,n=t.openBlock,h=t.withDirectives,o=t.createCommentVNode,g=t.Fragment,p=t.renderList,u=t.normalizeStyle,c=t.vShow},t=>{f=t.d},null,null,null,null],execute:function(){const t={mixins:[m,d],emits:["addItem","deleteItem","open"],data:function(){return{images:[],defaultImage:null,screenTarget:null,screenName:null}},computed:{selectedValue:function(){return this.screenValues[this.valueId]?this.screenValues[this.valueId][0]:null},showDefault:function(){return!this.images.some(r=>r.value==this.selectedValue)},pointerStyle(){return this.screenTarget&&this.screenName?{cursor:"pointer"}:{cursor:"default"}}},created:function(){this.appliedSettings.forEach(e=>{e[0]==="SCREEN"&&(this.screenTarget=e[1],this.screenName=e[2])}),this.valueId=`${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__${this.parameters[3]||"RAW"}`,this.$emit("addItem",this.valueId);const r=this.appliedSettings.filter(e=>e[0]==="IMAGE").map(async e=>{let i=e[2];return i.startsWith("http")||(i=await this.getPresignedUrl(i)),{url:i,value:e[1],x:e[3],y:e[4],width:e[5],height:e[6]}});if(Promise.all(r).then(e=>{this.images=e}),this.parameters[4]){const e={x:this.parameters[5],y:this.parameters[6],width:this.parameters[7]?`${this.parameters[7]}px`:"100%",height:this.parameters[8]?`${this.parameters[8]}px`:"100%"};let i=this.parameters[4];i.startsWith("http")?this.defaultImage={...e,url:i}:this.getPresignedUrl(i).then(y=>{this.defaultImage={...e,url:y}})}},unmounted:function(){this.$emit("deleteItem",this.valueId)},methods:{clickHandler(){this.screenTarget&&this.screenName&&this.$emit("open",this.screenTarget,this.screenName)}}},v=["href","x","y","width","height"],w=["href","x","y","width","height"];function k(r,e,i,y,N,a){return n(),l("g",null,[(n(!0),l(g,null,p(r.images,s=>h((n(),l("image",{key:s.value,href:s.url,x:s.x,y:s.y,width:s.width,height:s.height,style:u(a.pointerStyle),onClick:e[0]||(e[0]=(...x)=>a.clickHandler&&a.clickHandler(...x))},null,12,v)),[[c,s.value==a.selectedValue]])),128)),r.defaultImage?h((n(),l("image",{key:0,href:r.defaultImage.url,x:r.defaultImage.x,y:r.defaultImage.y,width:r.defaultImage.width,height:r.defaultImage.height,style:u(a.pointerStyle),onClick:e[1]||(e[1]=(...s)=>a.clickHandler&&a.clickHandler(...s))},null,12,w)),[[c,a.showDefault]]):o("",!0)])}const $=I("default",f(t,[["render",k]]))}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./Widget-
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(o,p){"use strict";var r,l,n,s,i;return{setters:[e=>{r=e.o},e=>{l=e.createElementBlock,n=e.openBlock,s=e.toDisplayString},e=>{i=e.d},null,null,null,null],execute:function(){const e={mixins:[r],computed:{fillColor(){return this.parameters[3]?this.parameters[3]:"black"}}},a=["x","y","fill"];function u(t,f,x,d,y,c){return n(),l("text",{x:t.parameters[0],y:t.parameters[1],fill:c.fillColor},s(t.parameters[2]),9,a)}const m=o("default",i(e,[["render",u]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(u,d){"use strict";var s,a,i,l,n;return{setters:[e=>{s=e.o},e=>{a=e.createElementBlock,i=e.openBlock,l=e.toDisplayString},e=>{n=e.d},null,null,null,null],execute:function(){const e={mixins:[s],emits:["addItem","deleteItem"],data(){return{valueId:null}},computed:{_value(){return this.screenValues[this.valueId][0]},fontSize(){return this.parameters[5]?this.parameters[5]+"px":"14px"},fillColor(){return this.parameters[6]?this.parameters[6]:"black"}},created(){let t="CONVERTED";this.parameters[7]&&(t=this.parameters[7]),this.valueId=`${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__${t}`,this.$emit("addItem",this.valueId)},unmounted(){this.$emit("deleteItem",this.valueId)}},o=["x","y","font-size","fill"];function m(t,c,h,f,v,r){return i(),a("text",{x:t.parameters[3],y:t.parameters[4],"font-size":r.fontSize,fill:r.fillColor},l(r._value),9,o)}const p=u("default",n(e,[["render",m]]))}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./Widget-
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(i,p){"use strict";var l,n,s,a,c;return{setters:[e=>{l=e.o},e=>{n=e.createElementBlock,s=e.openBlock,a=e.normalizeStyle},e=>{c=e.d},null,null,null,null],execute:function(){const e={mixins:[l],computed:{calcStyle(){let t="black";this.parameters[4]&&(t=this.parameters[4]);let r=1;return this.parameters[5]&&(r=this.parameters[5]),"stroke:"+t+";stroke-width:"+r}}},u=["x1","y1","x2","y2"];function o(t,r,d,k,x,m){return s(),n("line",{x1:t.parameters[0],y1:t.parameters[1],x2:t.parameters[2],y2:t.parameters[3],style:a(m.calcStyle)},null,12,u)}const y=i("default",c(e,[["render",o]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(u,h){"use strict";var s,r,l,i,n;return{setters:[t=>{s=t.o},t=>{r=t.createElementBlock,l=t.openBlock,i=t.normalizeStyle},t=>{n=t.d},null,null,null,null],execute:function(){const t={mixins:[s],emits:["addItem","deleteItem"],data(){return{valueId:0,valueMap:{}}},computed:{calcStyle(){let e="black";this.screenValues[this.valueId]&&(e=this.valueMap[this.screenValues[this.valueId][0]]);let a=1;return this.parameters[7]&&(a=this.parameters[7]),"stroke:"+e+";stroke-width:"+a}},created(){this.appliedSettings.forEach(a=>{a[0]==="VALUE_EQ"&&(this.valueMap[a[1]]=a[2])});let e="CONVERTED";this.parameters[8]&&(e=this.parameters[8]),this.valueId=`${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__${e}`,this.$emit("addItem",this.valueId)},unmounted(){this.$emit("deleteItem",this.valueId)}},m=["x1","y1","x2","y2"];function c(e,a,p,v,y,d){return l(),r("line",{x1:e.parameters[3],y1:e.parameters[4],x2:e.parameters[5],y2:e.parameters[6],style:i(d.calcStyle)},null,12,m)}const o=u("default",n(t,[["render",c]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(c,h){"use strict";var t,n,a,r,o,s;return{setters:[e=>{t=e.o},e=>{n=e.resolveComponent,a=e.createBlock,r=e.openBlock,o=e.normalizeStyle},e=>{s=e.d},null,null,null,null],execute:function(){const e={mixins:[t],data(){return{items:[],label:"Checkbox",value:!1}},created(){this.label=this.parameters[0],this.parameters[1]&&(this.value=!0)},methods:{checked(){return this.value}}};function i(d,u,k,y,l,b){const m=n("v-checkbox");return r(),a(m,{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=v=>l.value=v),"hide-details":"",density:"compact",label:l.label,style:o(d.computedStyle)},null,8,["modelValue","label","style"])}const p=c("default",s(e,[["render",i]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(i,p){"use strict";var l,n,s,r,o,u;return{setters:[e=>{l=e.o},e=>{n=e.resolveComponent,s=e.createBlock,r=e.openBlock,o=e.normalizeStyle},e=>{u=e.d},null,null,null,null],execute:function(){const e={mixins:[l],data(){return{items:[],value:null}},created(){this.value=this.parameters[0],this.items=this.parameters},methods:{text(){return this.value}}};function c(m,a,h,f,t,B){const d=n("v-select");return r(),s(d,{modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=v=>t.value=v),"hide-details":"",density:"compact",variant:"outlined",items:t.items,style:o(m.computedStyle)},null,8,["modelValue","items","style"])}const y=i("default",u(e,[["render",c]]))}}});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","vue","./TargetPacketItemChooser-DDqBQTWC-14850752bb987478aae1.js","./OpenC3TimePicker-D-_qqySI-3567ab45a515094ba0d0.js","vue-router","single-spa","vuex","vuetify"],function(Is,Di){"use strict";var mt,gt,bt,_t,yt,wt,C,U,P,vt,f,g,Te,G,ee,ae,fe,St,F,Be,He,ce,ze,Tt,We,Et,Ct;return{setters:[k=>{mt=k.d,gt=k._,bt=k.k,_t=k.R,yt=k.M,wt=k.I},k=>{C=k.resolveComponent,U=k.createBlock,P=k.openBlock,vt=k.Teleport,f=k.createVNode,g=k.withCtx,Te=k.createElementVNode,G=k.toDisplayString,ee=k.createElementBlock,ae=k.Fragment,fe=k.renderList,St=k.ref,F=k.createTextVNode,Be=k.mergeProps,He=k.createSlots,ce=k.createCommentVNode,ze=k.normalizeStyle,Tt=k.withModifiers,We=k.withKeys},k=>{Et=k.C},k=>{Ct=k.M},null,null,null,null],execute:function(){var k=document.createElement("style");k.textContent=`.title-font[data-v-2675b2d7]{font-size:1.125rem}.v-progress-linear__determinate[data-v-2675b2d7]{transition:none!important}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(k);const Ds={__name:"TopBarMenu",props:{menu:{type:Object,required:!0},title:{type:String,required:!0}},emits:["submenu-click"],setup(t,{emit:e}){const s=e,n=St(!1);function r(){n.value=!1}function o(i){return i.replaceAll(" ","-").toLowerCase()}return(i,a)=>{const c=C("v-icon"),u=C("v-btn"),d=C("v-divider"),b=C("v-list-item-title"),y=C("v-list-item"),p=C("v-list"),m=C("v-menu"),h=C("v-radio"),E=C("v-list-item-action"),x=C("v-radio-group"),T=C("v-checkbox");return P(),U(m,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=_=>n.value=_),"close-on-content-click":!1},{activator:g(({props:_})=>[f(u,Be(_,{variant:"outlined",class:"mx-1 menu-button",text:t.menu.label,"data-test":o(`${t.title} ${t.menu.label}`)}),{append:g(()=>[f(c,{class:"menu-button-icon"},{default:g(()=>[...a[1]||(a[1]=[F(" mdi-menu-down ",-1)])]),_:1})]),_:1},16,["text","data-test"])]),default:g(()=>[f(p,null,{default:g(()=>[(P(!0),ee(ae,null,fe(t.menu.items,(_,O)=>(P(),ee(ae,null,[_.divider?(P(),U(d,{key:O+"-divider"})):_.subMenu&&_.subMenu.length>0?(P(),ee("div",{key:O+"-submenu"},[(P(),U(m,{key:O,"open-on-hover":"",location:"right"},{activator:g(({props:R})=>[(P(),U(y,Be({ref_for:!0},R,{key:O,disabled:_.disabled}),He({append:g(()=>[f(c,null,{default:g(()=>[...a[2]||(a[2]=[F(" mdi-chevron-right ",-1)])]),_:1})]),default:g(()=>[!_.radio&&!_.checkbox?(P(),U(b,{key:0,style:ze("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:g(()=>[F(G(_.label),1)]),_:2},1032,["style"])):ce("",!0)]),_:2},[_.icon?{name:"prepend",fn:g(()=>[f(c,{disabled:_.disabled},{default:g(()=>[F(G(_.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:g(()=>[f(p,null,{default:g(()=>[(P(!0),ee(ae,null,fe(_.subMenu,(R,L)=>(P(),U(y,{key:L,"prepend-icon":R.icon,onClick:j=>s("submenu-click",R)},{default:g(()=>[f(b,null,{default:g(()=>[F(G(R.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):_.radioGroup?(P(),U(x,{key:O+"-radio-group",class:"ma-0 pa-0",density:"compact","hide-details":"","model-value":_.value,"onUpdate:modelValue":_.command},{default:g(()=>[(P(!0),ee(ae,null,fe(_.choices,(R,L)=>(P(),U(y,{key:L+"-choice"},{default:g(()=>[f(E,{class:"list-action"},{default:g(()=>[f(h,{color:"secondary",label:R.label,value:R.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(P(),U(y,{key:O+"-list",disabled:_.disabled,"data-test":o(`${t.title} ${t.menu.label} ${_.label}`),onClick:()=>{_.command(_),_.checkbox||r()}},He({default:g(()=>[_.checkbox?(P(),U(E,{key:0,class:"list-action"},{default:g(()=>[f(T,{modelValue:_.checked,"onUpdate:modelValue":R=>_.checked=R,label:_.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):ce("",!0),!_.radio&&!_.checkbox?(P(),U(b,{key:1,style:ze("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:g(()=>[F(G(_.label),1)]),_:2},1032,["style"])):ce("",!0)]),_:2},[_.icon?{name:"prepend",fn:g(()=>[f(c,{icon:_.icon,disabled:_.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["disabled","data-test","onClick"]))],64))),256))]),_:1})]),_:1},8,["modelValue"])}}},Ns={components:{TopBarMenu:Ds},props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},mounted(){document.title=this.title},methods:{subMenuClick(t){t.command(t),this.$refs.topmenu[0].isActive=!1}}},js={class:"app-title mr-2"};function Us(t,e,s,n,r,o){const i=C("v-col"),a=C("v-row"),c=C("TopBarMenu");return P(),U(vt,{to:"#openc3-menu"},[f(a,{"no-gutters":""},{default:g(()=>[f(i,{"align-self":"end"},{default:g(()=>[Te("span",js,G(s.title),1)]),_:1})]),_:1}),f(a,{dense:"",class:"flex-nowrap"},{default:g(()=>[(P(!0),ee(ae,null,fe(s.menus,(u,d)=>(P(),U(c,{key:d+"-top-menu",ref_for:!0,ref:"topmenu",menu:u,title:s.title,onSubmenuClick:o.subMenuClick},null,8,["menu","title","onSubmenuClick"]))),128))]),_:1})])}const Ms=mt(Ns,[["render",Us],["__scopeId","data-v-b6581c4c"]]);var Ls=Object.defineProperty,Fs=(t,e,s)=>e in t?Ls(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Ee=(t,e,s)=>Fs(t,typeof e!="symbol"?e+"":e,s);function xt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Vs}=Object.prototype,{getPrototypeOf:Je}=Object,{iterator:Ce,toStringTag:Ot}=Symbol,xe=(t=>e=>{const s=Vs.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),J=t=>(t=t.toLowerCase(),e=>xe(e)===t),Oe=t=>e=>typeof e===t,{isArray:le}=Array,ue=Oe("undefined");function pe(t){return t!==null&&!ue(t)&&t.constructor!==null&&!ue(t.constructor)&&V(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const kt=J("ArrayBuffer");function qs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&kt(t.buffer),e}const $s=Oe("string"),V=Oe("function"),Rt=Oe("number"),me=t=>t!==null&&typeof t=="object",Bs=t=>t===!0||t===!1,ke=t=>{if(xe(t)!=="object")return!1;const e=Je(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Ot in t)&&!(Ce in t)},Hs=t=>{if(!me(t)||pe(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},zs=J("Date"),Ws=J("File"),Js=J("Blob"),Ks=J("FileList"),Zs=t=>me(t)&&V(t.pipe),Gs=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||V(t.append)&&((e=xe(t))==="formdata"||e==="object"&&V(t.toString)&&t.toString()==="[object FormData]"))},Xs=J("URLSearchParams"),[Qs,Ys,en,tn]=["ReadableStream","Request","Response","Headers"].map(J),sn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ge(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),le(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{if(pe(t))return;const o=s?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(n=0;n<i;n++)a=o[n],e.call(null,t[a],a,t)}}function At(t,e){if(pe(t))return null;e=e.toLowerCase();const s=Object.keys(t);let n=s.length,r;for(;n-- >0;)if(r=s[n],e===r.toLowerCase())return r;return null}const se=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pt=t=>!ue(t)&&t!==se;function Ke(){const{caseless:t,skipUndefined:e}=Pt(this)&&this||{},s={},n=(r,o)=>{const i=t&&At(s,o)||o;ke(s[i])&&ke(r)?s[i]=Ke(s[i],r):ke(r)?s[i]=Ke({},r):le(r)?s[i]=r.slice():(!e||!ue(r))&&(s[i]=r)};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&ge(arguments[r],n);return s}const nn=(t,e,s,{allOwnKeys:n}={})=>(ge(e,(r,o)=>{s&&V(r)?t[o]=xt(r,s):t[o]=r},{allOwnKeys:n}),t),rn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),on=(t,e,s,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},an=(t,e,s,n)=>{let r,o,i;const a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),o=r.length;o-- >0;)i=r[o],(!n||n(i,t,e))&&!a[i]&&(e[i]=t[i],a[i]=!0);t=s!==!1&&Je(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},cn=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const n=t.indexOf(e,s);return n!==-1&&n===s},ln=t=>{if(!t)return null;if(le(t))return t;let e=t.length;if(!Rt(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},un=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Je(Uint8Array)),dn=(t,e)=>{const s=(t&&t[Ce]).call(t);let n;for(;(n=s.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},hn=(t,e)=>{let s;const n=[];for(;(s=t.exec(e))!==null;)n.push(s);return n},fn=J("HTMLFormElement"),pn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),It=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),mn=J("RegExp"),Dt=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),n={};ge(s,(r,o)=>{let i;(i=e(r,o,t))!==!1&&(n[o]=i||r)}),Object.defineProperties(t,n)},gn=t=>{Dt(t,(e,s)=>{if(V(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const n=t[s];if(V(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},bn=(t,e)=>{const s={},n=r=>{r.forEach(o=>{s[o]=!0})};return le(t)?n(t):n(String(t).split(e)),s},_n=()=>{},yn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function wn(t){return!!(t&&V(t.append)&&t[Ot]==="FormData"&&t[Ce])}const vn=t=>{const e=new Array(10),s=(n,r)=>{if(me(n)){if(e.indexOf(n)>=0)return;if(pe(n))return n;if(!("toJSON"in n)){e[r]=n;const o=le(n)?[]:{};return ge(n,(i,a)=>{const c=s(i,r+1);!ue(c)&&(o[a]=c)}),e[r]=void 0,o}}return n};return s(t,0)},Sn=J("AsyncFunction"),Tn=t=>t&&(me(t)||V(t))&&V(t.then)&&V(t.catch),Nt=((t,e)=>t?setImmediate:e?((s,n)=>(se.addEventListener("message",({source:r,data:o})=>{r===se&&o===s&&n.length&&n.shift()()},!1),r=>{n.push(r),se.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",V(se.postMessage)),En=typeof queueMicrotask<"u"?queueMicrotask.bind(se):typeof process<"u"&&process.nextTick||Nt,Cn=t=>t!=null&&V(t[Ce]),l={isArray:le,isArrayBuffer:kt,isBuffer:pe,isFormData:Gs,isArrayBufferView:qs,isString:$s,isNumber:Rt,isBoolean:Bs,isObject:me,isPlainObject:ke,isEmptyObject:Hs,isReadableStream:Qs,isRequest:Ys,isResponse:en,isHeaders:tn,isUndefined:ue,isDate:zs,isFile:Ws,isBlob:Js,isRegExp:mn,isFunction:V,isStream:Zs,isURLSearchParams:Xs,isTypedArray:un,isFileList:Ks,forEach:ge,merge:Ke,extend:nn,trim:sn,stripBOM:rn,inherits:on,toFlatObject:an,kindOf:xe,kindOfTest:J,endsWith:cn,toArray:ln,forEachEntry:dn,matchAll:hn,isHTMLForm:fn,hasOwnProperty:It,hasOwnProp:It,reduceDescriptors:Dt,freezeMethods:gn,toObjectSet:bn,toCamelCase:pn,noop:_n,toFiniteNumber:yn,findKey:At,global:se,isContextDefined:Pt,isSpecCompliantForm:wn,toJSONObject:vn,isAsyncFn:Sn,isThenable:Tn,setImmediate:Nt,asap:En,isIterable:Cn};function S(t,e,s,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),s&&(this.config=s),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}l.inherits(S,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l.toJSONObject(this.config),code:this.code,status:this.status}}});const jt=S.prototype,Ut={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ut[t]={value:t}}),Object.defineProperties(S,Ut),Object.defineProperty(jt,"isAxiosError",{value:!0}),S.from=(t,e,s,n,r,o)=>{const i=Object.create(jt);l.toFlatObject(t,i,function(u){return u!==Error.prototype},u=>u!=="isAxiosError");const a=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return S.call(i,a,c,s,n,r),t&&i.cause==null&&Object.defineProperty(i,"cause",{value:t,configurable:!0}),i.name=t&&t.name||"Error",o&&Object.assign(i,o),i};const xn=null;function Ze(t){return l.isPlainObject(t)||l.isArray(t)}function Mt(t){return l.endsWith(t,"[]")?t.slice(0,-2):t}function Lt(t,e,s){return t?t.concat(e).map(function(n,r){return n=Mt(n),!s&&r?"["+n+"]":n}).join(s?".":""):e}function On(t){return l.isArray(t)&&!t.some(Ze)}const kn=l.toFlatObject(l,{},null,function(t){return/^is[A-Z]/.test(t)});function Re(t,e,s){if(!l.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=l.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,m){return!l.isUndefined(m[p])});const n=s.metaTokens,r=s.visitor||u,o=s.dots,i=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(e);if(!l.isFunction(r))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(l.isDate(p))return p.toISOString();if(l.isBoolean(p))return p.toString();if(!a&&l.isBlob(p))throw new S("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(p)||l.isTypedArray(p)?a&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,h){let E=p;if(p&&!h&&typeof p=="object"){if(l.endsWith(m,"{}"))m=n?m:m.slice(0,-2),p=JSON.stringify(p);else if(l.isArray(p)&&On(p)||(l.isFileList(p)||l.endsWith(m,"[]"))&&(E=l.toArray(p)))return m=Mt(m),E.forEach(function(x,T){!(l.isUndefined(x)||x===null)&&e.append(i===!0?Lt([m],T,o):i===null?m:m+"[]",c(x))}),!1}return Ze(p)?!0:(e.append(Lt(h,m,o),c(p)),!1)}const d=[],b=Object.assign(kn,{defaultVisitor:u,convertValue:c,isVisitable:Ze});function y(p,m){if(!l.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),l.forEach(p,function(h,E){(!(l.isUndefined(h)||h===null)&&r.call(e,h,l.isString(E)?E.trim():E,m,b))===!0&&y(h,m?m.concat(E):[E])}),d.pop()}}if(!l.isObject(t))throw new TypeError("data must be an object");return y(t),e}function Ft(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ge(t,e){this._pairs=[],t&&Re(t,this,e)}const Vt=Ge.prototype;Vt.append=function(t,e){this._pairs.push([t,e])},Vt.toString=function(t){const e=t?function(s){return t.call(this,s,Ft)}:Ft;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function Rn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qt(t,e,s){if(!e)return t;const n=s&&s.encode||Rn;l.isFunction(s)&&(s={serialize:s});const r=s&&s.serialize;let o;if(r?o=r(e,s):o=l.isURLSearchParams(e)?e.toString():new Ge(e,s).toString(n),o){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class $t{constructor(){this.handlers=[]}use(e,s,n){return this.handlers.push({fulfilled:e,rejected:s,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){l.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Bt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},An=typeof URLSearchParams<"u"?URLSearchParams:Ge,Pn=typeof FormData<"u"?FormData:null,In=typeof Blob<"u"?Blob:null,Dn={isBrowser:!0,classes:{URLSearchParams:An,FormData:Pn,Blob:In},protocols:["http","https","file","blob","url","data"]},Xe=typeof window<"u"&&typeof document<"u",Qe=typeof navigator=="object"&&navigator||void 0,Nn=Xe&&(!Qe||["ReactNative","NativeScript","NS"].indexOf(Qe.product)<0),jn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Un=Xe&&window.location.href||"http://localhost",Mn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xe,hasStandardBrowserEnv:Nn,hasStandardBrowserWebWorkerEnv:jn,navigator:Qe,origin:Un},Symbol.toStringTag,{value:"Module"})),M={...Mn,...Dn};function Ln(t,e){return Re(t,new M.classes.URLSearchParams,{visitor:function(s,n,r,o){return M.isNode&&l.isBuffer(s)?(this.append(n,s.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function Fn(t){return l.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Vn(t){const e={},s=Object.keys(t);let n;const r=s.length;let o;for(n=0;n<r;n++)o=s[n],e[o]=t[o];return e}function Ht(t){function e(s,n,r,o){let i=s[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),c=o>=s.length;return i=!i&&l.isArray(r)?r.length:i,c?(l.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):((!r[i]||!l.isObject(r[i]))&&(r[i]=[]),e(s,n,r[i],o)&&l.isArray(r[i])&&(r[i]=Vn(r[i])),!a)}if(l.isFormData(t)&&l.isFunction(t.entries)){const s={};return l.forEachEntry(t,(n,r)=>{e(Fn(n),r,s,0)}),s}return null}function qn(t,e,s){if(l.isString(t))try{return(e||JSON.parse)(t),l.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(s||JSON.stringify)(t)}const be={transitional:Bt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=l.isObject(t);if(r&&l.isHTMLForm(t)&&(t=new FormData(t)),l.isFormData(t))return n?JSON.stringify(Ht(t)):t;if(l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t)||l.isReadableStream(t))return t;if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ln(t,this.formSerializer).toString();if((o=l.isFileList(t))||s.indexOf("multipart/form-data")>-1){const i=this.env&&this.env.FormData;return Re(o?{"files[]":t}:t,i&&new i,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),qn(t)):t}],transformResponse:[function(t){const e=this.transitional||be.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(l.isResponse(t)||l.isReadableStream(t))return t;if(t&&l.isString(t)&&(s&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,this.parseReviver)}catch(o){if(r)throw o.name==="SyntaxError"?S.from(o,S.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:M.classes.FormData,Blob:M.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],t=>{be.headers[t]={}});const $n=l.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bn=t=>{const e={};let s,n,r;return t&&t.split(`
|
|
3
|
+
`).forEach(function(o){r=o.indexOf(":"),s=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim(),!(!s||e[s]&&$n[s])&&(s==="set-cookie"?e[s]?e[s].push(n):e[s]=[n]:e[s]=e[s]?e[s]+", "+n:n)}),e},zt=Symbol("internals");function _e(t){return t&&String(t).trim().toLowerCase()}function Ae(t){return t===!1||t==null?t:l.isArray(t)?t.map(Ae):String(t)}function Hn(t){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=s.exec(t);)e[n[1]]=n[2];return e}const zn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ye(t,e,s,n,r){if(l.isFunction(n))return n.call(this,e,s);if(r&&(e=s),!!l.isString(e)){if(l.isString(n))return e.indexOf(n)!==-1;if(l.isRegExp(n))return n.test(e)}}function Wn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,n)=>s.toUpperCase()+n)}function Jn(t,e){const s=l.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+s,{value:function(r,o,i){return this[n].call(this,e,r,o,i)},configurable:!0})})}let q=class{constructor(t){t&&this.set(t)}set(t,e,s){const n=this;function r(i,a,c){const u=_e(a);if(!u)throw new Error("header name must be a non-empty string");const d=l.findKey(n,u);(!d||n[d]===void 0||c===!0||c===void 0&&n[d]!==!1)&&(n[d||a]=Ae(i))}const o=(i,a)=>l.forEach(i,(c,u)=>r(c,u,a));if(l.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(l.isString(t)&&(t=t.trim())&&!zn(t))o(Bn(t),e);else if(l.isObject(t)&&l.isIterable(t)){let i={},a,c;for(const u of t){if(!l.isArray(u))throw TypeError("Object iterator must return a key-value pair");i[c=u[0]]=(a=i[c])?l.isArray(a)?[...a,u[1]]:[a,u[1]]:u[1]}o(i,e)}else t!=null&&r(e,t,s);return this}get(t,e){if(t=_e(t),t){const s=l.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Hn(n);if(l.isFunction(e))return e.call(this,n,s);if(l.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=_e(t),t){const s=l.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Ye(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(o){if(o=_e(o),o){const i=l.findKey(s,o);i&&(!e||Ye(s,s[i],i,e))&&(delete s[i],n=!0)}}return l.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let s=e.length,n=!1;for(;s--;){const r=e[s];(!t||Ye(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const e=this,s={};return l.forEach(this,(n,r)=>{const o=l.findKey(s,r);if(o){e[o]=Ae(n),delete e[r];return}const i=t?Wn(r):String(r).trim();i!==r&&delete e[r],e[i]=Ae(n),s[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return l.forEach(this,(s,n)=>{s!=null&&s!==!1&&(e[n]=t&&l.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
4
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const e=(this[zt]=this[zt]={accessors:{}}).accessors,s=this.prototype;function n(r){const o=_e(r);e[o]||(Jn(s,r),e[o]=!0)}return l.isArray(t)?t.forEach(n):n(t),this}};q.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l.reduceDescriptors(q.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[s]=n}}}),l.freezeMethods(q);function et(t,e){const s=this||be,n=e||s,r=q.from(n.headers);let o=n.data;return l.forEach(t,function(i){o=i.call(s,o,r.normalize(),e?e.status:void 0)}),r.normalize(),o}function Wt(t){return!!(t&&t.__CANCEL__)}function de(t,e,s){S.call(this,t??"canceled",S.ERR_CANCELED,e,s),this.name="CanceledError"}l.inherits(de,S,{__CANCEL__:!0});function Jt(t,e,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):e(new S("Request failed with status code "+s.status,[S.ERR_BAD_REQUEST,S.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Kn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Zn(t,e){t=t||10;const s=new Array(t),n=new Array(t);let r=0,o=0,i;return e=e!==void 0?e:1e3,function(a){const c=Date.now(),u=n[o];i||(i=c),s[r]=a,n[r]=c;let d=o,b=0;for(;d!==r;)b+=s[d++],d=d%t;if(r=(r+1)%t,r===o&&(o=(o+1)%t),c-i<e)return;const y=u&&c-u;return y?Math.round(b*1e3/y):void 0}}function Gn(t,e){let s=0,n=1e3/e,r,o;const i=(a,c=Date.now())=>{s=c,r=null,o&&(clearTimeout(o),o=null),t(...a)};return[(...a)=>{const c=Date.now(),u=c-s;u>=n?i(a,c):(r=a,o||(o=setTimeout(()=>{o=null,i(r)},n-u)))},()=>r&&i(r)]}const Pe=(t,e,s=3)=>{let n=0;const r=Zn(50,250);return Gn(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,c=i-n,u=r(c),d=i<=a;n=i;const b={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-i)/u:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(b)},s)},Kt=(t,e)=>{const s=t!=null;return[n=>e[0]({lengthComputable:s,total:t,loaded:n}),e[1]]},Zt=t=>(...e)=>l.asap(()=>t(...e)),Xn=M.hasStandardBrowserEnv?((t,e)=>s=>(s=new URL(s,M.origin),t.protocol===s.protocol&&t.host===s.host&&(e||t.port===s.port)))(new URL(M.origin),M.navigator&&/(msie|trident)/i.test(M.navigator.userAgent)):()=>!0,Qn=M.hasStandardBrowserEnv?{write(t,e,s,n,r,o,i){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];l.isNumber(s)&&a.push(`expires=${new Date(s).toUTCString()}`),l.isString(n)&&a.push(`path=${n}`),l.isString(r)&&a.push(`domain=${r}`),o===!0&&a.push("secure"),l.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Yn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function er(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Gt(t,e,s){let n=!Yn(e);return t&&(n||s==!1)?er(t,e):e}const Xt=t=>t instanceof q?{...t}:t;function ne(t,e){e=e||{};const s={};function n(u,d,b,y){return l.isPlainObject(u)&&l.isPlainObject(d)?l.merge.call({caseless:y},u,d):l.isPlainObject(d)?l.merge({},d):l.isArray(d)?d.slice():d}function r(u,d,b,y){if(l.isUndefined(d)){if(!l.isUndefined(u))return n(void 0,u,b,y)}else return n(u,d,b,y)}function o(u,d){if(!l.isUndefined(d))return n(void 0,d)}function i(u,d){if(l.isUndefined(d)){if(!l.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function a(u,d,b){if(b in e)return n(u,d);if(b in t)return n(void 0,u)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,d,b)=>r(Xt(u),Xt(d),b,!0)};return l.forEach(Object.keys({...t,...e}),function(u){const d=c[u]||r,b=d(t[u],e[u],u);l.isUndefined(b)&&d!==a||(s[u]=b)}),s}const Qt=t=>{const e=ne({},t);let{data:s,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:o,headers:i,auth:a}=e;if(e.headers=i=q.from(i),e.url=qt(Gt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),l.isFormData(s)){if(M.hasStandardBrowserEnv||M.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(l.isFunction(s.getHeaders)){const c=s.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([d,b])=>{u.includes(d.toLowerCase())&&i.set(d,b)})}}if(M.hasStandardBrowserEnv&&(n&&l.isFunction(n)&&(n=n(e)),n||n!==!1&&Xn(e.url))){const c=r&&o&&Qn.read(o);c&&i.set(r,c)}return e},tr=typeof XMLHttpRequest<"u",sr=tr&&function(t){return new Promise(function(e,s){const n=Qt(t);let r=n.data;const o=q.from(n.headers).normalize();let{responseType:i,onUploadProgress:a,onDownloadProgress:c}=n,u,d,b,y,p;function m(){y&&y(),p&&p(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(n.method.toUpperCase(),n.url,!0),h.timeout=n.timeout;function E(){if(!h)return;const T=q.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),_={data:!i||i==="text"||i==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:T,config:t,request:h};Jt(function(O){e(O),m()},function(O){s(O),m()},_),h=null}"onloadend"in h?h.onloadend=E:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(E)},h.onabort=function(){h&&(s(new S("Request aborted",S.ECONNABORTED,t,h)),h=null)},h.onerror=function(T){const _=T&&T.message?T.message:"Network Error",O=new S(_,S.ERR_NETWORK,t,h);O.event=T||null,s(O),h=null},h.ontimeout=function(){let T=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const _=n.transitional||Bt;n.timeoutErrorMessage&&(T=n.timeoutErrorMessage),s(new S(T,_.clarifyTimeoutError?S.ETIMEDOUT:S.ECONNABORTED,t,h)),h=null},r===void 0&&o.setContentType(null),"setRequestHeader"in h&&l.forEach(o.toJSON(),function(T,_){h.setRequestHeader(_,T)}),l.isUndefined(n.withCredentials)||(h.withCredentials=!!n.withCredentials),i&&i!=="json"&&(h.responseType=n.responseType),c&&([b,p]=Pe(c,!0),h.addEventListener("progress",b)),a&&h.upload&&([d,y]=Pe(a),h.upload.addEventListener("progress",d),h.upload.addEventListener("loadend",y)),(n.cancelToken||n.signal)&&(u=T=>{h&&(s(!T||T.type?new de(null,t,h):T),h.abort(),h=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const x=Kn(n.url);if(x&&M.protocols.indexOf(x)===-1){s(new S("Unsupported protocol "+x+":",S.ERR_BAD_REQUEST,t));return}h.send(r||null)})},nr=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let n=new AbortController,r;const o=function(u){if(!r){r=!0,a();const d=u instanceof Error?u:this.reason;n.abort(d instanceof S?d:new de(d instanceof Error?d.message:d))}};let i=e&&setTimeout(()=>{i=null,o(new S(`timeout ${e} of ms exceeded`,S.ETIMEDOUT))},e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),t=null)};t.forEach(u=>u.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=()=>l.asap(a),c}},rr=function*(t,e){let s=t.byteLength;if(s<e){yield t;return}let n=0,r;for(;n<s;)r=n+e,yield t.slice(n,r),n=r},ir=async function*(t,e){for await(const s of or(t))yield*rr(s,e)},or=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:s,value:n}=await e.read();if(s)break;yield n}}finally{await e.cancel()}},Yt=(t,e,s,n)=>{const r=ir(t,e);let o=0,i,a=c=>{i||(i=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){a(),c.close();return}let b=d.byteLength;if(s){let y=o+=b;s(y)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},es=64*1024,{isFunction:Ie}=l,ar=(({Request:t,Response:e})=>({Request:t,Response:e}))(l.global),{ReadableStream:ts,TextEncoder:ss}=l.global,ns=(t,...e)=>{try{return!!t(...e)}catch{return!1}},cr=t=>{t=l.merge.call({skipUndefined:!0},ar,t);const{fetch:e,Request:s,Response:n}=t,r=e?Ie(e):typeof fetch=="function",o=Ie(s),i=Ie(n);if(!r)return!1;const a=r&&Ie(ts),c=r&&(typeof ss=="function"?(m=>h=>m.encode(h))(new ss):async m=>new Uint8Array(await new s(m).arrayBuffer())),u=o&&a&&ns(()=>{let m=!1;const h=new s(M.origin,{body:new ts,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!h}),d=i&&a&&ns(()=>l.isReadableStream(new n("").body)),b={stream:d&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!b[m]&&(b[m]=(h,E)=>{let x=h&&h[m];if(x)return x.call(h);throw new S(`Response type '${m}' is not supported`,S.ERR_NOT_SUPPORT,E)})});const y=async m=>{if(m==null)return 0;if(l.isBlob(m))return m.size;if(l.isSpecCompliantForm(m))return(await new s(M.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(l.isArrayBufferView(m)||l.isArrayBuffer(m))return m.byteLength;if(l.isURLSearchParams(m)&&(m=m+""),l.isString(m))return(await c(m)).byteLength},p=async(m,h)=>l.toFiniteNumber(m.getContentLength())??y(h);return async m=>{let{url:h,method:E,data:x,signal:T,cancelToken:_,timeout:O,onDownloadProgress:R,onUploadProgress:L,responseType:j,headers:Z,withCredentials:$="same-origin",fetchOptions:te}=Qt(m),z=e||fetch;j=j?(j+"").toLowerCase():"text";let w=nr([T,_&&_.toAbortSignal()],O),I=null;const B=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let qe;try{if(L&&u&&E!=="get"&&E!=="head"&&(qe=await p(Z,x))!==0){let H=new s(h,{method:"POST",body:x,duplex:"half"}),Y;if(l.isFormData(x)&&(Y=H.headers.get("content-type"))&&Z.setContentType(Y),H.body){const[pt,$e]=Kt(qe,Pe(Zt(L)));x=Yt(H.body,es,pt,$e)}}l.isString($)||($=$?"include":"omit");const N=o&&"credentials"in s.prototype,v={...te,signal:w,method:E.toUpperCase(),headers:Z.normalize().toJSON(),body:x,duplex:"half",credentials:N?$:void 0};I=o&&new s(h,v);let A=await(o?z(I,te):z(h,v));const W=d&&(j==="stream"||j==="response");if(d&&(R||W&&B)){const H={};["status","statusText","headers"].forEach(As=>{H[As]=A[As]});const Y=l.toFiniteNumber(A.headers.get("content-length")),[pt,$e]=R&&Kt(Y,Pe(Zt(R),!0))||[];A=new n(Yt(A.body,es,pt,()=>{$e&&$e(),B&&B()}),H)}j=j||"text";let Q=await b[l.findKey(b,j)||"text"](A,m);return!W&&B&&B(),await new Promise((H,Y)=>{Jt(H,Y,{data:Q,headers:q.from(A.headers),status:A.status,statusText:A.statusText,config:m,request:I})})}catch(N){throw B&&B(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new S("Network Error",S.ERR_NETWORK,m,I),{cause:N.cause||N}):S.from(N,N&&N.code,m,I)}}},lr=new Map,rs=t=>{let e=t&&t.env||{};const{fetch:s,Request:n,Response:r}=e,o=[n,r,s];let i=o.length,a=i,c,u,d=lr;for(;a--;)c=o[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:cr(e)),d=u;return u};rs();const tt={http:xn,xhr:sr,fetch:{get:rs}};l.forEach(tt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const is=t=>`- ${t}`,ur=t=>l.isFunction(t)||t===null||t===!1;function dr(t,e){t=l.isArray(t)?t:[t];const{length:s}=t;let n,r;const o={};for(let i=0;i<s;i++){n=t[i];let a;if(r=n,!ur(n)&&(r=tt[(a=String(n)).toLowerCase()],r===void 0))throw new S(`Unknown adapter '${a}'`);if(r&&(l.isFunction(r)||(r=r.get(e))))break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=s?i.length>1?`since :
|
|
5
|
+
`+i.map(is).join(`
|
|
6
|
+
`):" "+is(i[0]):"as no adapter specified";throw new S("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}const os={getAdapter:dr,adapters:tt};function st(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new de(null,t)}function as(t){return st(t),t.headers=q.from(t.headers),t.data=et.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),os.getAdapter(t.adapter||be.adapter,t)(t).then(function(e){return st(t),e.data=et.call(t,t.transformResponse,e),e.headers=q.from(e.headers),e},function(e){return Wt(e)||(st(t),e&&e.response&&(e.response.data=et.call(t,t.transformResponse,e.response),e.response.headers=q.from(e.response.headers))),Promise.reject(e)})}const cs="1.13.2",De={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{De[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const ls={};De.transitional=function(t,e,s){function n(r,o){return"[Axios v"+cs+"] Transitional option '"+r+"'"+o+(s?". "+s:"")}return(r,o,i)=>{if(t===!1)throw new S(n(o," has been removed"+(e?" in "+e:"")),S.ERR_DEPRECATED);return e&&!ls[o]&&(ls[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,o,i):!0}},De.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function hr(t,e,s){if(typeof t!="object")throw new S("options must be an object",S.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const o=n[r],i=e[o];if(i){const a=t[o],c=a===void 0||i(a,o,t);if(c!==!0)throw new S("option "+o+" must be "+c,S.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new S("Unknown option "+o,S.ERR_BAD_OPTION)}}const Ne={assertOptions:hr,validators:De},X=Ne.validators;let re=class{constructor(t){this.defaults=t||{},this.interceptors={request:new $t,response:new $t}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;const r=n.stack?n.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
7
|
+
`+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ne(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&Ne.assertOptions(s,{silentJSONParsing:X.transitional(X.boolean),forcedJSONParsing:X.transitional(X.boolean),clarifyTimeoutError:X.transitional(X.boolean)},!1),n!=null&&(l.isFunction(n)?e.paramsSerializer={serialize:n}:Ne.assertOptions(n,{encode:X.function,serialize:X.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ne.assertOptions(e,{baseUrl:X.spelling("baseURL"),withXsrfToken:X.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&l.merge(r.common,r[e.method]);r&&l.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=q.concat(o,r);const i=[];let a=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(e)===!1||(a=a&&p.synchronous,i.unshift(p.fulfilled,p.rejected))});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let u,d=0,b;if(!a){const p=[as.bind(this),void 0];for(p.unshift(...i),p.push(...c),b=p.length,u=Promise.resolve(e);d<b;)u=u.then(p[d++],p[d++]);return u}b=i.length;let y=e;for(;d<b;){const p=i[d++],m=i[d++];try{y=p(y)}catch(h){m.call(this,h);break}}try{u=as.call(this,y)}catch(p){return Promise.reject(p)}for(d=0,b=c.length;d<b;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=ne(this.defaults,t);const e=Gt(t.baseURL,t.url,t.allowAbsoluteUrls);return qt(e,t.params,t.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(t){re.prototype[t]=function(e,s){return this.request(ne(s||{},{method:t,url:e,data:(s||{}).data}))}}),l.forEach(["post","put","patch"],function(t){function e(s){return function(n,r,o){return this.request(ne(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}re.prototype[t]=e(),re.prototype[t+"Form"]=e(!0)});let fr=class Ps{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(r){s=r});const n=this;this.promise.then(r=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](r);n._listeners=null}),this.promise.then=r=>{let o;const i=new Promise(a=>{n.subscribe(a),o=a}).then(r);return i.cancel=function(){n.unsubscribe(o)},i},e(function(r,o,i){n.reason||(n.reason=new de(r,o,i),s(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const e=new AbortController,s=n=>{e.abort(n)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new Ps(function(s){e=s}),cancel:e}}};function pr(t){return function(e){return t.apply(null,e)}}function mr(t){return l.isObject(t)&&t.isAxiosError===!0}const nt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(nt).forEach(([t,e])=>{nt[e]=t});function us(t){const e=new re(t),s=xt(re.prototype.request,e);return l.extend(s,re.prototype,e,{allOwnKeys:!0}),l.extend(s,e,null,{allOwnKeys:!0}),s.create=function(n){return us(ne(t,n))},s}const D=us(be);D.Axios=re,D.CanceledError=de,D.CancelToken=fr,D.isCancel=Wt,D.VERSION=cs,D.toFormData=Re,D.AxiosError=S,D.Cancel=D.CanceledError,D.all=function(t){return Promise.all(t)},D.spread=pr,D.isAxiosError=mr,D.mergeConfig=ne,D.AxiosHeaders=q,D.formToJSON=t=>Ht(l.isHTMLForm(t)?new FormData(t):t),D.getAdapter=os.getAdapter,D.HttpStatusCode=nt,D.default=D;const{Axios:Ni,AxiosError:ji,CanceledError:Ui,isCancel:Mi,CancelToken:Li,VERSION:Fi,all:Vi,Cancel:qi,isAxiosError:$i,spread:Bi,toFormData:Hi,AxiosHeaders:zi,HttpStatusCode:Wi,formToJSON:Ji,getAdapter:Ki,mergeConfig:Zi}=D,rt=D.create({baseURL:location.origin,timeout:6e4,params:{}});rt.interceptors.response.use(t=>t,t=>{var e,s,n,r,o,i,a,c,u,d,b;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(m){m&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let y=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(y+=`${t.response.statusText} `),(n=(s=t.response)==null?void 0:s.config)!=null&&n.data&&(y+=`${t.response.config.data} `),(o=(r=t.response)==null?void 0:r.data)!=null&&o.message?y+=`${t.response.data.message}`:(a=(i=t.response)==null?void 0:i.data)!=null&&a.exception?y+=`${t.response.data.exception}`:(d=(u=(c=t.response)==null?void 0:c.data)==null?void 0:u.error)!=null&&d.message?(t.response.data.error.class&&(y+=`${t.response.data.error.class} `),y+=`${t.response.data.error.message}`):y+=`${(b=t.response)==null?void 0:b.data}`;const{$cosmosNotify:p}=window;throw p&&p.serious({title:"Network error",body:y}),t}else throw t});const je=async function(t,e,{data:s,params:n={},headers:r,noAuth:o=!1,noScope:i=!1,onUploadProgress:a=!1}={}){if(!o){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}r.Authorization=localStorage.openc3Token}return r.manual=!0,!i&&!n.scope&&(n.scope=window.openc3Scope),rt({method:t,url:e,data:s,params:n,headers:r,onUploadProgress:a})},it={Accept:"application/json"},ds={...it,"Content-Type":"application/json"},gr={get:function(t,{params:e,headers:s=it,noScope:n,noAuth:r,onUploadProgress:o}={}){return je("get",t,{params:e,headers:s,noScope:n,noAuth:r,onUploadProgress:o})},put:function(t,{data:e,params:s,headers:n=ds,noScope:r,noAuth:o,onUploadProgress:i}={}){return je("put",t,{data:e,params:s,headers:n,noScope:r,noAuth:o,onUploadProgress:i})},post:function(t,{data:e,params:s,headers:n=ds,noScope:r,noAuth:o,onUploadProgress:i}={}){return je("post",t,{data:e,params:s,headers:n,noScope:r,noAuth:o,onUploadProgress:i})},delete:function(t,{params:e,headers:s=it,noScope:n,noAuth:r,onUploadProgress:o}={}){return je("delete",t,{params:e,headers:s,noScope:n,noAuth:r,onUploadProgress:o})}};let Ue=()=>({emit(t,...e){for(let s=this.events[t]||[],n=0,r=s.length;n<r;n++)s[n](...e)},events:{},on(t,e){var s;return((s=this.events)[t]||(s[t]=[])).push(e),()=>{var n;this.events[t]=(n=this.events[t])==null?void 0:n.filter(r=>e!==r)}}});class ye extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class ot extends ye{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class br extends ye{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class K extends ye{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class _r extends K{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function hs(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let s=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${s}`}).join(",")}}`:""}class yr{constructor(e){this.channel=e,this.listeners=[]}watch(){this.listeners.push(this.channel.on("presence",e=>{if(e.type==="info"){this._state||(this._state=this.stateFromInfo(e));return}this._state&&(e.type==="join"?this._state[e.id]=e.info:e.type==="leave"&&delete this._state[e.id])}))}reset(){delete this._state}dispose(){delete this._info,delete this._state,this.listeners.forEach(e=>e()),this.listeners.length=0}async join(e,s){if(!this._info)return this._info={id:e,info:s},this.channel.perform("$presence:join",this._info)}async leave(){if(!this._info)return;let e=await this.channel.perform("$presence:leave");return delete this._info,e}async info(){return this._state?this._state:(this._promise||(this._promise=this._sync()),await this._promise,this._state)}async _sync(){this.watch();try{let e=await this.channel.perform("$presence:info",{});return this._state=this.stateFromInfo(e),this._state}finally{delete this._promise}}stateFromInfo(e){return e.records.reduce((s,{id:n,info:r})=>(s[n]=r,s),{})}}const ie=Symbol("state");class fs{constructor(e={}){this.emitter=Ue(),this.params=Object.freeze(e),this.presence=new yr(this),this.initialConnect=!0,this[ie]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=hs({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[ie]}attached(e){if(this.receiver){if(this.receiver!==e)throw Error("Already connected to a different receiver");return!1}return this.receiver=e,!0}connecting(){this[ie]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[ie]="connected";let e=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:e})):this.emit("connect",{reconnect:!0,restored:e})}restored(){if(this.state==="connected")throw Error("Already connected");this[ie]="connected";let e=!0,s=!0;this.initialConnect=!1,this.emit("connect",{reconnect:s,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[ie]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[ie]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",e))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(e,s){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,s)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(s){let n=this.receiver?this.receiver.logger:null;n&&n.warn("whisper failed: ",s)}}receive(e,s){this.emit("message",e,s)}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}emit(e,...s){return this.emitter.emit(e,...s)}ensureSubscribed(){return this.state==="connected"?Promise.resolve():this.state==="closed"?Promise.reject(Error("Channel is unsubscribed")):this.pendingSubscribe()}pendingSubscribe(){return this._pendingSubscribe?this._pendingSubscribe:(this._pendingSubscribe=new Promise((e,s)=>{let n=[()=>delete this._pendingSubscribe];n.push(this.on("connect",()=>{n.forEach(r=>r()),e()})),n.push(this.on("close",r=>{n.forEach(o=>o()),s(r||new ye("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class wr{constructor(e){this.id=e,this.intent="unsubscribed",this.state="idle",this.channels=[],this.disposed=!1,this._pendings=[]}add(e){this.channels.includes(e)||this.channels.push(e)}remove(e){let s=this.channels.indexOf(e);s>-1&&this.channels.splice(s,1)}notify(e,...s){this.state=e==="restored"?"connected":e,s.length===1?this.channels.forEach(n=>n[e](s[0])):this.channels.forEach(n=>n[e]())}pending(e){this._checkIntent(e);let s=this._pendings[0];return!s||s.intent!==e?Promise.resolve():s.promise}ensureResubscribed(){this.disposed||(this.intent=void 0,this.ensureSubscribed())}ensureSubscribed(){if(this.intent!=="subscribed"){if(this.disposed)throw Error("Subscription is disposed");this.intent="subscribed",!this._mergeWithPending("unsubscribed")&&this.subscriber(this)}}maybeUnsubscribe(){this.disposed||this.intent==="unsubscribed"||this.channels.length>0||(this.intent="unsubscribed",this._mergeWithPending("subscribed"))||this.unsubscriber(this)}async acquire(e){this._checkIntent(e);let s,n={promise:new Promise(o=>{s=o}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(n),1),s(n)},canceled:!1,acquired:!1},r=this._pendingTop;return this._pendings.push(n),r&&await r.promise,this.gvl&&await this.gvl.acquire(n,e),n.acquired=!0,n}close(e){this.disposed=!0,this.intent=void 0,this.notify("closed",e)}_checkIntent(e){if(!(e==="unsubscribed"||e==="subscribed"))throw Error(`Unknown subscription intent: ${e}`)}get _pendingTop(){return this._pendings.length?this._pendings[this._pendings.length-1]:void 0}_mergeWithPending(e){let s=this._pendingTop;return!s||s.acquired||s.intent!==e?!1:(this._pendings.pop(),s.canceled=!0,!0)}}class vr{constructor(){this.queue=[]}async acquire(e,s){s==="subscribed"&&(this.queue.push(e.promise.then(()=>{this.queue.splice(this.queue.indexOf(e),1)})),this.queue.length>1&&await this.queue[this.queue.length-2])}}class Sr{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new vr),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:s,unsubscribe:n}){let r=this._subscriptions[e]=new wr(e);return r.remoteId=this._localToRemote[e],r.subscriber=s,r.unsubscriber=n,r.gvl=this.glv,r}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,s){this._localToRemote[e]=s;let n=this.get(e);n&&(n.remoteId=s)}}class Tr{constructor(e={}){this.subscriptions=new Sr(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,s){this._remoteToLocal[s]=e,this.subscriptions.storeRemoteId(e,s),this.flush(s)}unsubscribe(e){let s=this.subscriptions.get(e);if(!s)return;let n=s.remoteId;n&&delete this._remoteToLocal[n],this.subscriptions.remove(e)}transmit(e,s,n){let r=this._remoteToLocal[e];if(!r){this._pendingMessages.push([e,s,n]);return}let o=this.subscriptions.get(r);o&&o.channels.forEach(i=>{i.receive(s,n)})}notify(e,s,n){let r=this._remoteToLocal[e];if(!r)return;let o=this.subscriptions.get(r);o&&o.channels.forEach(i=>i.emit(s,n))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let s=[];for(let n of this._pendingMessages)n[0]===e?this.transmit(n[0],n[1],n[2]):s.push(n);this._pendingMessages=s}}const ps={debug:0,info:1,warn:2,error:3};class ms{constructor(e){this.level=e||"warn"}log(e,s,n){ps[e]<ps[this.level]||this.writeLogEntry(e,s,n)}writeLogEntry(){throw Error("Not implemented")}debug(e,s){this.log("debug",e,s)}info(e,s){this.log("info",e,s)}warn(e,s){this.log("warn",e,s)}error(e,s){this.log("error",e,s)}}class we extends ms{writeLogEntry(){}}class Er{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let Cr=0;class gs{constructor(e={}){let{logger:s}=e;this.logger=s||new we,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,s){let n={channel:e};s&&Object.assign(n,s);let r=hs(n);if(this.pendingUnsubscriptions[r]){let i=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${i}`,r),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},i)})}if(this.pendingSubscriptions[r])return this.logger.warn("subscription is already pending, skipping",r),Promise.reject(Error("Already subscribing"));let o=this.subscribeRetryInterval;return new Promise((i,a)=>{let c=++Cr;this.pendingSubscriptions[r]={resolve:i,reject:a,id:c},this.cable.send(this.buildSubscribeRequest(r)),this.maybeRetrySubscribe(c,r,o)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,s,n){setTimeout(()=>{let r=this.pendingSubscriptions[s];r&&r.id===e&&(this.logger.warn(`no subscription ack received in ${n}ms, retrying subscribe`,s),this.cable.send(this.buildSubscribeRequest(s)),this.maybeExpireSubscribe(e,s,n))},n)}maybeExpireSubscribe(e,s,n){setTimeout(()=>{let r=this.pendingSubscriptions[s];r&&r.id===e&&(delete this.pendingSubscriptions[s],r.reject(new br(`Haven't received subscription ack in ${n*2}ms for ${s}`)))},n)}unsubscribe(e){return this.cable.send({command:"unsubscribe",identifier:e}),this.pendingUnsubscriptions[e]=!0,setTimeout(()=>{delete this.pendingUnsubscriptions[e]},this.subscribeCooldownInterval),Promise.resolve()}perform(e,s,n){return s==="$whisper"?this.whisper(e,n):(n||(n={}),n.action=s,this.cable.send({command:"message",identifier:e,data:JSON.stringify(n)}),Promise.resolve())}whisper(e,s){return this.cable.send({command:"whisper",identifier:e,data:s}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:n,message:r,reason:o,reconnect:i}=e;if(s==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(s==="disconnect"){let a=new K(o);this.reset(a),i===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[n];if(!a){this.logger.error("subscription not found, unsubscribing",{type:s,identifier:n}),this.unsubscribe(n);return}return delete this.pendingSubscriptions[n],a.resolve(n)}if(s==="reject_subscription"){let a=this.pendingSubscriptions[n];return a?(delete this.pendingSubscriptions[n],a.reject(new ot)):this.logger.error("subscription not found",{type:s,identifier:n})}if(r)return{identifier:n,message:r};this.logger.warn(`unknown message type: ${s}`,{message:e})}reset(e){for(let s in this.pendingSubscriptions)this.pendingSubscriptions[s].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const bs=()=>Date.now()/1e3|0;class xr extends gs{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=bs()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let s in this.pendingPresence)this.pendingPresence[s].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:n,message:r}=e;if(s==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(s==="reject_subscription")return super.receive(e);if(s==="confirm_subscription")return this.subscriptionStreams[n]||(this.subscriptionStreams[n]=new Set),super.receive(e);if(s==="ping")return this.restoreSince&&(this.restoreSince=bs()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",n);return}if(s==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",n);return}if(s==="welcome"){if(this.disableSessionRecovery||(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId)),e.restored){let o=e.restored_ids||Object.keys(this.subscriptionStreams);for(let i of o)this.cable.send({identifier:i,command:"history",history:this.historyRequestFor(i)}),this.presenceInfo[i]&&this.cable.send({identifier:i,command:"join",presence:this.presenceInfo[i]});return this.cable.restored(o)}return this.cable.connected(this.sessionId)}if(s==="presence"){let o=r.type;if(o==="info"){let i=this.pendingPresence[n];i&&(delete this.pendingPresence[n],i.resolve(r))}else if(o==="error"){let i=this.pendingPresence[n];i&&(delete this.pendingPresence[n],i.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:n,message:r}}if(r){let o=this.trackStreamPosition(n,e.stream_id,e.epoch,e.offset);return{identifier:n,message:r,meta:o}}this.logger.warn(`unknown message type: ${s}`,{message:e})}perform(e,s,n){switch(s){case"$presence:join":return this.join(e,n);case"$presence:leave":return this.leave(e,n);case"$presence:info":return this.presence(e,n)}return super.perform(e,s,n)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let s=super.buildSubscribeRequest(e),n=this.historyRequestFor(e);n&&(s.history=n,this.pendingHistory[e]=!0);let r=this.presenceInfo[e];return r&&(s.presence=r),s}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let s={},n=!1;if(this.subscriptionStreams[e])for(let r of this.subscriptionStreams[e]){let o=this.streamsPositions[r];o&&(n=!0,s[r]=o)}if(!(!n&&!this.restoreSince))return{since:this.restoreSince,streams:s}}trackStreamPosition(e,s,n,r){if(!(!s||!n))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(s),this.streamsPositions[s]={epoch:n,offset:r},{stream:s,epoch:n,offset:r}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,s){return this.presenceInfo[e]=s,this.cable.send({command:"join",identifier:e,presence:s}),Promise.resolve()}async leave(e,s){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:s}),Promise.resolve()}presence(e,s){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((n,r)=>{this.pendingPresence[e]={resolve:n,reject:r},this.cable.send({command:"presence",identifier:e,data:s})})}}class Or extends ye{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class at extends fs{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}Ee(at,"identifier","__ghost__");const kr="$pubsub";class ct extends fs{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}Ee(ct,"identifier",kr);const oe=Symbol("state");let Rr=class{constructor({transport:t,protocol:e,encoder:s,logger:n,lazy:r,hubOptions:o,performFailures:i,transportConfigurator:a}){this.emitter=Ue(),this.transport=t,this.encoder=s,this.logger=n||new we,this.protocol=e,this.performFailures=i||"throw",this.protocol.attached(this),this.hub=new Tr(o||{}),this[oe]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,r===!1&&this.connect().catch(()=>{})}get state(){return this[oe]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[oe]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(s){this.handleClose(s)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[oe]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new K("recovery_failed"))),this.hub.subscriptions.all().forEach(e=>this._resubscribe(e));let t=!1;this.recovering=!1,this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:t})):this.emit("connect",{reconnect:!0,restored:t})}restored(t){this.logger.info("connection recovered",{remoteIds:t}),this[oe]="connected",this.hub.subscriptions.all().forEach(n=>{t&&n.remoteId&&t.includes(n.remoteId)?n.notify("restored"):(n.notify("disconnected",new K("recovery_failed")),this._resubscribe(n))});let e=!this.initialConnect,s=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:s})}notify(t,e,s){e&&typeof e!="string"&&(s=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:s}):this.emit("info",{type:t,data:s})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new K(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[oe]="disconnected",this.recovering=this.protocol.recoverableClosure(t),this.recovering?this.hub.subscriptions.all().forEach(e=>e.notify("connecting")):this.hub.subscriptions.all().forEach(e=>{e.notify("disconnected",t)}),this.protocol.reset(t),this.hub.close(),this.transport.close(),this.emit("disconnect",t))}closed(t){if(this.state==="closed"||this.state==="idle")return;let e;t&&(e=t instanceof K?t:new K(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[oe]="closed";let s=e||new K("cable_closed");this.hub.subscriptions.all().forEach(n=>n.notify("disconnected",s)),this.hub.close(),this.protocol.reset(),this.transport.close(),this.initialConnect=!0,this.emit("close",e)}disconnect(){this.closed()}handleIncoming(t){if(this.state==="closed"||this.state==="idle")return;let e=this.encoder.decode(t);if(e===void 0){this.logger.error("failed to decode message",{message:t});return}this.logger.debug("incoming data",e);let s=this.protocol.receive(e);if(s){this.logger.debug("processed incoming message",s);let{type:n,identifier:r,message:o,meta:i}=s;n?this.hub.notify(r,n,o):this.hub.transmit(r,o,i)}}send(t){if(this.state==="closed")throw Error("Cable is closed");let e=this.encoder.encode(t);if(e===void 0){this.logger.error("failed to encode message",{message:t});return}this.logger.debug("outgoing message",t),this.transport.send(e)}keepalive(t){this.emit("keepalive",t)}streamFrom(t){let e=new ct({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new ct({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,n;return typeof t=="string"&&(n=t,t=at),s=n?new t(n,e):new t(e),this.subscribe(s)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let s=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:n=>this._subscribe(n,t.channelId,t.params),unsubscribe:n=>this._unsubscribe(n)});return s.add(t),s.intent==="subscribed"&&s.state==="connected"&&t.connected(),s.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,s){let n=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:n});return}this.logger.debug("acquiring subscribe lock",{identifier:n});let r=await t.acquire("subscribed");if(r.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:n}),r.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:n}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),r.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:n}),r.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:n}),t.notify("connected"),r.release();return}let o={identifier:e,params:s};this.logger.debug("subscribing",o);try{let i=await this.protocol.subscribe(e,s);this.hub.subscribe(n,i),this.logger.debug("subscribed",{...o,remoteId:i}),t.notify("connected")}catch(i){if(i){if(i instanceof ot&&this.logger.warn("rejected",o),i instanceof K){this.logger.debug("disconnected during subscription; will retry on connect",o),r.release();return}this.logger.error("failed to subscribe",{error:i,...o})}t.close(i),this.hub.unsubscribe(n)}r.release()}unsubscribe(t){let e=t.identifier,s=this.hub.subscriptions.get(e);if(!s)throw Error(`Subscription not found: ${e}`);s.remove(t),t.closed(),s.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let s=await t.acquire("unsubscribed");if(s.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),s.release();return}if(this.logger.debug("unsubscribe lock has been acquired",{identifier:e}),t.intent!=="unsubscribed"){this.logger.debug("cancel unsubscribe, no longer needed",{identifier:e,intent:t.intent}),s.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),s.release();return}let n=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:n}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),s.release();return}try{await this.protocol.unsubscribe(n),this.logger.debug("unsubscribed remotely",{id:e})}catch(r){r&&(r instanceof K?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:r}):this.logger.error("unsubscribe failed",{id:e,error:r}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",s.release()}async perform(t,e,s){if(this.performFailures==="throw")return this._perform(t,e,s);try{return await this._perform(t,e,s)}catch(n){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:n});return}}async _perform(t,e,s){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new Or;let n=this.hub.subscriptions.get(t);if(!n)throw Error(`Subscription not found: ${t}`);if(await n.pending("subscribed"),n.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let r=n.remoteId,o={id:r,action:e,payload:s};this.logger.debug("perform",o);try{let i=await this.protocol.perform(r,e,s);return i&&this.logger.debug("perform result",{message:i,request:o}),i}catch(i){throw this.logger.error("perform failed",{error:i,request:o}),i}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...n)=>{s(),e(...n)});return s}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let s=[()=>delete this._pendingConnect];s.push(this.on("connect",()=>{s.forEach(n=>n()),t()})),s.push(this.on("close",n=>{s.forEach(r=>r()),e(n)})),s.push(this.on("disconnect",n=>{s.forEach(r=>r()),e(n)}))}),this._pendingConnect)}};const Ar={maxMissingPings:2,maxReconnectAttempts:1/0},he=()=>Date.now(),_s=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:n,maxInterval:r}=e;return s=s||2,n===void 0&&(n=.5),o=>{let i=t*s**o,a=i*s,c=i+(a-i)*Math.random(),u=2*(Math.random()-.5)*n;return c=c*(1+u),r&&r<c&&(c=r),c}};let ys=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},Ar,e),this.strategy=e.reconnectStrategy,!this.strategy)throw Error("Reconnect strategy must be provided");this.maxMissingPings=e.maxMissingPings,this.maxReconnectAttempts=e.maxReconnectAttempts,this.logger=e.logger||new we,this.state="pending_connect",this.attempts=0,this.disconnectedAt=he()}watch(t){this.target=t,this.initListeners()}reconnectNow(){return this.state==="connected"||this.state==="pending_connect"||this.state==="closed"?!1:(this.cancelReconnect(),this.state="pending_connect",this.target.connect().catch(t=>{this.logger.info("Failed at reconnecting: "+t)}),!0)}initListeners(){this.unbind=[],this.unbind.push(this.target.on("connect",()=>{this.attempts=0,this.pingedAt=he(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=he(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=he(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=he()})),this.unbind.push(()=>{this.cancelReconnect(),this.stopPolling()})}dispose(){delete this.target,this.unbind&&this.unbind.forEach(t=>t()),delete this.unbind}startPolling(){this.pollId&&clearTimeout(this.pollId);let t=this.pingInterval+(Math.random()-.5)*this.pingInterval*.5;this.pollId=setTimeout(()=>{this.checkStale(),this.state==="connected"&&this.startPolling()},t)}stopPolling(){this.pollId&&clearTimeout(this.pollId)}checkStale(){let t=he()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new _r))}scheduleReconnect(){if(this.attempts>=this.maxReconnectAttempts){this.target.close();return}let t=this.strategy(this.attempts);this.attempts++,this.logger.info(`Reconnecting in ${t}ms (${this.attempts} attempt)`),this.state="pending_reconnect",this.reconnnectId=setTimeout(()=>this.reconnectNow(),t)}cancelReconnect(){this.reconnnectId&&(clearTimeout(this.reconnnectId),delete this.reconnnectId)}};class Pr{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=Ue(),this.unbind=[],this.logger=s.logger||new we}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let s=this.transports[e];try{this.transport=s,this.resetListeners(),this.logger.debug(`Trying to connect via ${s.displayName()}`),await s.open(),this.logger.debug(`Connected via ${s.displayName()}`);return}catch(n){this.logger.debug(`Failed to connect via ${s.displayName()}: ${n.message}`)}}throw this.transport=null,this.resetListeners(),new Error("Couldn't connect via any available transport")}send(e){if(!this.transport)throw new Error("No transport is open");this.transport.send(e)}async close(){if(!this.transport)throw new Error("No transport is open");await this.transport.close(),this.transport=null}setURL(){throw new Error("Not implemented. Set URL for each transport separately")}setParam(e,s){this.transports.forEach(n=>{n.setParam(e,s)})}setToken(e,s){this.transports.forEach(n=>{n.setToken(e,s)})}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}get url(){return this.transport?this.transport.url:""}resetListeners(){this.unbind.forEach(e=>e()),this.unbind.length=0,this.transport&&this.unbind.push(this.transport.on("open",()=>{this.emitter.emit("open")}),this.transport.on("data",e=>{this.emitter.emit("data",e)}),this.transport.on("close",e=>{this.emitter.emit("close",e)}),this.transport.on("error",e=>{this.emitter.emit("error",e)}))}}class Ir{constructor(e,s={}){this.url=e;let n=s.websocketImplementation;if(n)this.Impl=n;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Ue();let{format:r,subprotocol:o,authStrategy:i}=s;this.format=r||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=i||"param",this.authProtocol="",this.subprotocol=o}displayName(){return"WebSocket("+this.url+")"}open(){let e=this.subprotocol;return this.authStrategy==="sub-protocol"&&(e=[this.subprotocol,this.authProtocol]),this.connectionOptions?this.ws=new this.Impl(this.url,e,this.connectionOptions):this.ws=new this.Impl(this.url,e),this.ws.binaryType="arraybuffer",this.initListeners(),new Promise((s,n)=>{let r=[];r.push(this.once("open",()=>{r.forEach(o=>o()),s()})),r.push(this.once("close",()=>{r.forEach(o=>o()),n(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,s){let n=new URL(this.url);n.searchParams.set(e,s);let r=`${n.protocol}//${n.host}${n.pathname}?${n.searchParams}`;this.setURL(r)}setToken(e,s="jid"){if(this.authStrategy==="param")this.setParam(s,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let n=`x-${s}`.toLowerCase();n=Object.keys(this.connectionOptions.headers).find(r=>r.toLowerCase()===n)||n,this.connectionOptions.headers[n]=e}else if(this.authStrategy==="sub-protocol")this.authProtocol=`anycable-token.${e}`;else throw new Error("Unknown auth strategy: "+this.authStrategy)}send(e){if(!this.ws||!this.connected)throw Error("WebSocket is not connected");this.ws.send(e)}close(){this.ws?this.onclose():this.connected=!1}on(e,s){return this.emitter.on(e,s)}once(e,s){let n=this.emitter.on(e,(...r)=>{n(),s(...r)});return n}initListeners(){this.ws.onerror=e=>{this.connected&&this.emitter.emit("error",e.error||new Error("WS Error"))},this.ws.onclose=()=>{this.onclose()},this.ws.onmessage=e=>{let s=e.data;this.format==="binary"&&(s=new Uint8Array(s)),this.emitter.emit("data",s)},this.ws.onopen=()=>{this.connected=!0,this.emitter.emit("open")}}onclose(){this.ws.onclose=void 0,this.ws.onmessage=void 0,this.ws.onopen=void 0,this.ws.close(),delete this.ws,this.connected=!1,this.emitter.emit("close")}}const ws={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Dr(t,e){if(typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),e=e||{},!t&&!e.transport)throw Error("URL or transport must be specified");e=Object.assign({},ws,e);let{protocol:s,websocketImplementation:n,websocketFormat:r,websocketOptions:o,websocketAuthStrategy:i,fallbacks:a,logLevel:c,logger:u,transport:d,encoder:b,lazy:y,monitor:p,pingInterval:m,reconnectStrategy:h,maxMissingPings:E,maxReconnectAttempts:x,subprotocol:T,tokenRefresher:_,historyTimestamp:O,protocolOptions:R,concurrentSubscribes:L,performFailures:j,transportConfigurator:Z,auth:$}=e;if(u=u||new we(c),typeof s=="string"){T=T||s;let w=s.substring(0,s.lastIndexOf("-")),I=s.substring(s.lastIndexOf("-")+1);if(R=R||{},w==="actioncable-v1")s=new gs({logger:u,...R});else if(w==="actioncable-v1-ext")s=new xr({logger:u,historyTimestamp:O,...R});else throw Error(`Protocol is not supported yet: ${s}`);if(I==="json")b=b||new Er,r=r||"text";else if(I==="msgpack"){if(r="binary",!b)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(I==="protobuf"){if(r=r||"binary",!b)throw Error("Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own")}else throw Error(`Protocol is not supported yet: ${s}`)}if(!s)throw Error("Protocol must be specified");d=d||new Ir(t,{websocketImplementation:n,websocketOptions:o,subprotocol:T,authStrategy:i,format:r}),a&&(d=new Pr([d,...a],{logger:u})),$&&$.token&&d.setToken($.token,$.param||"jid"),h=h||_s(m),p!==!1&&(p=p||new ys({pingInterval:m,reconnectStrategy:h,maxMissingPings:E,maxReconnectAttempts:x,logger:u}));let te={concurrentSubscribes:L},z=new Rr({protocol:s,transport:d,encoder:b,logger:u,lazy:y,hubOptions:te,performFailures:j,transportConfigurator:Z});return p&&(p.watch(z),z.monitor=p),_&&Nr(z,async()=>{try{await _(d)}catch(w){return u.error("Failed to refresh authentication token: "+w),!1}return z.connect().catch(()=>{}),!0}),z}function Nr(t,e){let s=!1;t.on("connect",()=>s=!1),t.on("close",async n=>{if(n){if(s){t.logger.warn("Token auto-refresh is disabled",n);return}n.reason==="token_expired"&&(s=!0,await e())}})}class jr{constructor(e){this.channel=e}notify(e,...s){typeof this[e]=="function"&&this[e](...s)}perform(e,s={}){this.channel.perform(e,s)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class Ur extends at{constructor(e,s,n){super(e,s),this.subscription=new jr(this),Object.assign(this.subscription,n),this.on("connect",({reconnect:r})=>this.subscription.notify("connected",{reconnected:r})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",r=>this.subscription.notify("received",r)),this.on("close",r=>{r&&r instanceof ot?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Mr{constructor(e){this.cable=e}create(e,s){let n,r;typeof e=="object"?(n=e.channel,delete e.channel,r=e):(n=e,r={});let o=new Ur(n,r,s);return o.subscription.notify("initialized"),this.cable.subscribe(o),o.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class Lr{constructor(e){this.cable=e,this.subscriptions=new Mr(e)}}class Fr extends ms{writeLogEntry(e,s,n){n?console[e](s,n):console[e](s)}}class Vr extends ys{watch(e){super.watch(e),this.initActivityListeners()}initActivityListeners(){if(typeof document<"u"&&typeof window<"u"&&document.addEventListener&&window.addEventListener){let e=()=>{document.hidden||this.reconnectNow()&&this.logger.debug("Trigger reconnect due to visibility change")},s=r=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:r})},n=()=>this.disconnect(new K("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",s,!1),window.addEventListener("resume",s,!1),window.addEventListener("freeze",n,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",s,!1),window.removeEventListener("online",s,!1),window.removeEventListener("resume",s,!1),window.removeEventListener("freeze",n,!1)})}}disconnect(e){this.state==="disconnected"||this.state==="closed"||(this.logger.info("Disconnecting",{reason:e.message}),this.cancelReconnect(),this.stopPolling(),this.state="pending_disconnect",this.target.disconnected(e))}}const qr=["cable","action-cable"],$r="/cable",Me=(t,e)=>{for(let s of qr){let n=t.head.querySelector(`meta[name='${s}-${e}']`);if(n)return n.getAttribute("content")}},vs=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Br=()=>{if(typeof document<"u"&&document.head){let t=Me(document,"url");if(t)return vs(t)}return vs($r)},Hr=()=>{if(typeof document<"u"&&document.head){let t=Me(document,"history-timestamp");if(t)return t|0}},zr=()=>{if(typeof document<"u"&&document.head)return Me(document,"token")},Wr=()=>{if(typeof document<"u"&&document.head)return Me(document,"token-param")};function Jr(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Br(),e=e||{},e.historyTimestamp||(e.historyTimestamp=Hr());let s=zr();if(s){let u=Wr();e.auth=Object.assign({token:s,param:u},e.auth||{})}e=Object.assign({},ws,e);let{logLevel:n,logger:r,pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:c}=e;return r=e.logger=e.logger||new Fr(n),i=e.reconnectStrategy=e.reconnectStrategy||_s(o),e.monitor!==!1&&(e.monitor=e.monitor||new Vr({pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:c,logger:r})),Dr(t,e)}function Kr(t,e){let s=Jr(t,e);return new Lr(s)}class Zr{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,n={},r={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(o=>{if(o&&OpenC3Auth.setTokens(),this._cable==null){let i=this._url+"?scope="+encodeURIComponent(s)+"&authorization="+encodeURIComponent(localStorage.openc3Token);i=new URL(i,document.baseURI).href,this._cable=Kr(i)}return this._cable.subscriptions.create({channel:e,...r},n)})}recordPing(){}}function ve(t){return Gr.test(t)}const Gr=/^-?[0-9]+$/;function Ss(t){return Xr.test(t)}const Xr=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ts(t,e){if(ve(t))return Number.isSafeInteger(Number.parseInt(t,10));const s=Number.parseFloat(t),n=String(s);if(t===n)return!0;const r=Es(t),o=Es(n);return!!(r===o||(e==null?void 0:e.approx)===!0&&!ve(t)&&o.length>=14&&r.startsWith(o.substring(0,14)))}let Se=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Qr(t){if(Ts(t,{approx:!1}))return;if(ve(t))return Se.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?Se.underflow:Se.truncate_float:Se.overflow}function Es(t){const{start:e,end:s}=Yr(t),n=t.substring(e,s),r=n.indexOf(".");return r===-1?n:n.substring(0,r)+n.substring(r+1)}function Yr(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let s=t.lastIndexOf("e");for(s===-1&&(s=t.lastIndexOf("E")),s===-1&&(s=t.length);(t[s-1]==="0"||t[s-1]===".")&&s>e;)s--;return{start:e,end:s}}class ei{constructor(e){if(Ee(this,"isLosslessNumber",!0),!Ss(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Qr(this.value);if(e===void 0||e===Se.truncate_float)return Number.parseFloat(this.value);if(ve(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function ti(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function si(t){return new ei(t)}function ni(t,e){return lt({"":t},"",t,e)}function lt(t,e,s,n){return Array.isArray(s)?n.call(t,e,ii(s,n)):s&&typeof s=="object"&&!ti(s)?n.call(t,e,ri(s,n)):n.call(t,e,s)}function ri(t,e){for(const s of Object.keys(t)){const n=lt(t,s,t[s],e);n!==void 0?t[s]=n:delete t[s]}return t}function ii(t,e){for(let s=0;s<t.length;s++)t[s]=lt(t,String(s),t[s],e);return t}function oi(t,e,s){const n=typeof s=="function"?{parseNumber:s}:s,r=(n==null?void 0:n.parseNumber)??si,o=(n==null?void 0:n.onDuplicateKey)??j;let i=0;const a=d();return x(a),_(),e?ni(a,e):a;function c(){if(t.charCodeAt(i)===hi){i++,y();const v={};let A=!0;for(;i<t.length&&t.charCodeAt(i)!==xs;){A?A=!1:(h(),y());const W=i,Q=p();if(Q===void 0){L();return}y(),E();const H=d();if(H===void 0){w();return}if(Object.prototype.hasOwnProperty.call(v,Q)&&!ut(H,v[Q])){const Y=o({key:Q,position:W+1,oldValue:v[Q],newValue:H});Y!==void 0&&(v[Q]=Y)}else v[Q]=H}return t.charCodeAt(i)!==xs&&Z(),i++,v}}function u(){if(t.charCodeAt(i)===fi){i++,y();const v=[];let A=!0;for(;i<t.length&&t.charCodeAt(i)!==Os;){A?A=!1:h();const W=d();T(W),v.push(W)}return t.charCodeAt(i)!==Os&&$(),i++,v}}function d(){y();const v=p()??m()??c()??u()??b("true",!0)??b("false",!1)??b("null",null);return y(),v}function b(v,A){if(t.slice(i,i+v.length)===v)return i+=v.length,A}function y(){for(;ai(t.charCodeAt(i));)i++}function p(){if(t.charCodeAt(i)===dt){i++;let v="";for(;i<t.length&&t.charCodeAt(i)!==dt;){if(t.charCodeAt(i)===di){const A=t[i+1],W=ui[A];W!==void 0?(v+=W,i++):A==="u"?Le(t.charCodeAt(i+2))&&Le(t.charCodeAt(i+3))&&Le(t.charCodeAt(i+4))&&Le(t.charCodeAt(i+5))?(v+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):I(i):z(i)}else li(t.charCodeAt(i))?v+=t[i]:te(t[i]);i++}return R(),i++,v}}function m(){const v=i;if(t.charCodeAt(i)===ks&&(i++,O(v)),t.charCodeAt(i)===ht)i++;else if(ci(t.charCodeAt(i)))for(i++;Fe(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===vi)for(i++,O(v);Fe(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===xi||t.charCodeAt(i)===Ci)for(i++,(t.charCodeAt(i)===ks||t.charCodeAt(i)===_i)&&i++,O(v);Fe(t.charCodeAt(i));)i++;if(i>v)return r(t.slice(v,i))}function h(){if(t.charCodeAt(i)!==wi)throw new SyntaxError(`Comma ',' expected after value ${N()}`);i++}function E(){if(t.charCodeAt(i)!==Si)throw new SyntaxError(`Colon ':' expected after property name ${N()}`);i++}function x(v){if(v===void 0)throw new SyntaxError(`JSON value expected ${N()}`)}function T(v){if(v===void 0)throw new SyntaxError(`Array item expected ${N()}`)}function _(){if(i<t.length)throw new SyntaxError(`Expected end of input ${N()}`)}function O(v){if(!Fe(t.charCodeAt(i))){const A=t.slice(v,i);throw new SyntaxError(`Invalid number '${A}', expecting a digit ${N()}`)}}function R(){if(t.charCodeAt(i)!==dt)throw new SyntaxError(`End of string '"' expected ${N()}`)}function L(){throw new SyntaxError(`Quoted object key expected ${N()}`)}function j(v){let{key:A,position:W}=v;throw new SyntaxError(`Duplicate key '${A}' encountered at position ${W}`)}function Z(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${N()}`)}function $(){throw new SyntaxError(`Array item or end of array ']' expected ${N()}`)}function te(v){throw new SyntaxError(`Invalid character '${v}' ${B()}`)}function z(v){const A=t.slice(v,v+2);throw new SyntaxError(`Invalid escape character '${A}' ${B()}`)}function w(){throw new SyntaxError(`Object value expected after ':' ${B()}`)}function I(v){const A=t.slice(v,v+6);throw new SyntaxError(`Invalid unicode character '${A}' ${B()}`)}function B(){return`at position ${i}`}function qe(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function N(){return`${qe()} ${B()}`}}function ai(t){return t===pi||t===mi||t===gi||t===bi}function Le(t){return t>=ht&&t<=ft||t>=Ti&&t<=Oi||t>=Ei&&t<=ki}function Fe(t){return t>=ht&&t<=ft}function ci(t){return t>=yi&&t<=ft}function li(t){return t>=32&&t<=1114111}function ut(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,n)=>ut(s,e[n])):Cs(t)&&Cs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>ut(t[s],e[s])):!1}function Cs(t){return typeof t=="object"&&t!==null}const ui={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
8
|
+
`,r:"\r",t:" "},di=92,hi=123,xs=125,fi=91,Os=93,pi=32,mi=10,gi=9,bi=13,dt=34,_i=43,ks=45,ht=48,yi=49,ft=57,wi=44,vi=46,Si=58,Ti=65,Ei=97,Ci=69,xi=101,Oi=70,ki=102;function Rs(t,e,s,n){return r(t);function r(c,u){if(Array.isArray(n)){const d=n.find(b=>b.test(c));if(d){const b=d.stringify(c);if(typeof b!="string"||!Ss(b))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${b})`);return b}}if(typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c===null||c instanceof Date||c instanceof Boolean||c instanceof Number||c instanceof String)return JSON.stringify(c);if(c!=null&&c.isLosslessNumber||typeof c=="bigint")return c.toString();if(Array.isArray(c))return o(c);if(c&&typeof c=="object")return i(c)}function o(c,u){if(c.length===0)return"[]";let d="[";for(let b=0;b<c.length;b++){const y=c[b];typeof y<"u"&&typeof y!="function"?d+=r(y):d+="null",b<c.length-1&&(d+=",")}return d+="]",d}function i(c,u){if(typeof c.toJSON=="function")return Rs(c.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(c);if(d.length===0)return"{}";let b=!0,y="{";for(const p of d){const m=c[p];if(a(p,m)){b?b=!1:y+=",";const h=JSON.stringify(p);y+=`${h}:`,y+=r(m)}}return y+="}",y}function a(c,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function Ri(t){return ve(t)&&!Ts(t)?BigInt(t):parseFloat(t)}class Ai{constructor(){Ee(this,"id",1)}async exec(e,s,n={},r={},o=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return n.scope=window.openc3Scope,r.manual=!0,(await rt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:s,id:this.id,keyword_params:n},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...r},timeout:o,transformRequest:[(i,a)=>Rs(i)],transformResponse:[i=>oi(i,void 0,Ri)]})).data.result}catch(i){let a=new Error;throw i.response?(a.name=i.response.data.error.data.class,a.message=i.response.data.error.data.message,a.object=i.response.data.error):i.request?(a.name="Request error",a.message="Request error, no response received"):a=i,a}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(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}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,s,n,r,o){return this.exec("map_target_to_interface",[e,s],{cmd_only:n,tlm_only:r,unmap_old:o})}unmap_target_from_interface(e,s,n,r){return this.exec("unmap_target_from_interface",[e,s],{cmd_only:n,tlm_only:r})}connect_interface(e,...s){return s.length>0?this.exec("connect_interface",[e,...s]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,s,...n){return this.exec("interface_cmd",[e,s,...n])}interface_target_enable(e,s,n=!1,r=!1){return this.exec("interface_target_enable",[e,s],{cmd_only:n,tlm_only:r})}interface_target_disable(e,s,n=!1,r=!1){return this.exec("interface_target_disable",[e,s],{cmd_only:n,tlm_only:r})}interface_details(e){return this.exec("interface_details",[e])}get_all_router_info(){return this.exec("get_all_router_info",[])}map_target_to_router(e,s,n,r,o){return this.exec("map_target_to_router",[e,s],{cmd_only:n,tlm_only:r,unmap_old:o})}unmap_target_from_router(e,s,n,r){return this.exec("unmap_target_from_router",[e,s],{cmd_only:n,tlm_only:r})}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}router_target_enable(e,s,n=!1,r=!1){return this.exec("router_target_enable",[e,s],{cmd_only:n,tlm_only:r})}router_target_disable(e,s,n=!1,r=!1){return this.exec("router_target_disable",[e,s],{cmd_only:n,tlm_only:r})}router_details(e){return this.exec("router_details",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,s,n){return this.exec("get_item",[e,s,n])}get_param(e,s,n){return this.exec("get_param",[e,s,n])}get_parameter(e,s,n){return this.exec("get_param",[e,s,n])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(e){return this.exec("set_limits_set",[e])}get_target(e){return this.exec("get_target",[e])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_names",[])}get_tlm(e,s){return this.exec("get_tlm",[e,s])}get_telemetry(e,s){return this.exec("get_tlm",[e,s])}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.exec("get_all_tlm",[e])}get_all_tlm_names(e,s=!1){return this.exec("get_all_tlm_names",[e],{hidden:s})}get_all_telemetry_names(e){return this.exec("get_all_tlm_names",[e])}get_all_tlm_item_names(e){return this.exec("get_all_tlm_item_names",[e])}async get_tlm_packet(e,s,n,r=30){const o=await this.exec("get_tlm_packet",[e,s],{type:n,stale_time:r});if(o!=null){let i=o.length,a=null;for(let c=0;c<i;c++)a=this.decode_openc3_type(o[c][1]),a!==null&&(o[c][1]=a)}return o}get_packet_derived_items(e,s){return this.exec("get_packet_derived_items",[e,s])}get_tlm_buffer(e,s){return this.exec("get_tlm_buffer",[e,s])}get_tlm_available(e){return this.exec("get_tlm_available",[e])}async get_tlm_values(e,s=30,n=null,r=null,o=null){let i={stale_time:s};n!==null&&(i.cache_timeout=n),r!==null&&(i.start_time=r.toISOString()),o!==null&&(i.end_time=o.toISOString());const a=await this.exec("get_tlm_values",[e],i,{},1e4);if(a&&a.length>0){let c=a.length,u=null;for(let d=0;d<c;d++)u=this.decode_openc3_type(a[d][0]),u!==null&&(a[d][0]=u)}return a}get_limits(e,s,n){return this.exec("get_limits",[e,s,n])}async tlm(e,s,n,r="CONVERTED"){let o=null;if(s===void 0)o=await this.exec("tlm",[e]);else if(n===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))o=await this.exec("tlm",[e],{type:s});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${s}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else o=await this.exec("tlm",[e,s,n],{type:r});let i=this.decode_openc3_type(o);return i!==null&&(o=i),o}async inject_tlm(e,s,n=null,r="CONVERTED"){await this.exec("inject_tlm",[e,s,n],{type:r})}set_tlm(e,s,n,r){return this.exec("set_tlm",[e,s,n],{type:r})}override_tlm(e,s,n,r){return this.exec("override_tlm",[e,s,n],{type:r})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,s,n,r){return this.exec("normalize_tlm",[e,s,n],{type:r})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.exec("get_all_cmds",[e])}get_all_cmd_names(e,s=!1){return this.exec("get_all_cmd_names",[e],{hidden:s})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,s){return this.exec("get_cmd",[e,s])}get_command(e,s){return this.exec("get_cmd",[e,s])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,s,n,r="CONVERTED"){return this.exec("get_cmd_value",[e,s,n,r])}get_cmd_buffer(e,s){return this.exec("get_cmd_buffer",[e,s])}_cmd(e,s,n,r,o,i={}){let a=null;for(let c in r)Object.prototype.hasOwnProperty.call(r,c)&&(a=this.encode_openc3_type(r[c]),a!==null&&(r[c]=a));return this.exec(e,[s,n,r],i,o)}get_cmd_hazardous(e,s,n,r={}){return s===void 0?this.exec("get_cmd_hazardous",e,{},r):this._cmd("get_cmd_hazardous",e,s,n,r)}cmd(e,s,n,r={},o={}){return s===void 0?this.exec("cmd",e,o,r):this._cmd("cmd",e,s,n,r,o)}cmd_no_range_check(e,s,n,r={},o={}){return s===void 0?this.exec("cmd_no_range_check",e,o,r):this._cmd("cmd_no_range_check",e,s,n,r,o)}cmd_raw(e,s,n,r={},o={}){return s===void 0?this.exec("cmd_raw",e,o,r):this._cmd("cmd_raw",e,s,n,r,o)}cmd_raw_no_range_check(e,s,n,r={},o={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,o,r):this._cmd("cmd_raw_no_range_check",e,s,n,r,o)}cmd_no_hazardous_check(e,s,n,r={},o={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,o,r):this._cmd("cmd_no_hazardous_check",e,s,n,r,o)}cmd_no_checks(e,s,n,r={},o={}){return s===void 0?this.exec("cmd_no_checks",e,o,r):this._cmd("cmd_no_checks",e,s,n,r,o)}cmd_raw_no_hazardous_check(e,s,n,r={},o={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,o,r):this._cmd("cmd_raw_no_hazardous_check",e,s,n,r,o)}cmd_raw_no_checks(e,s,n,r={},o={}){return s===void 0?this.exec("cmd_raw_no_checks",e,o,r):this._cmd("cmd_raw_no_checks",e,s,n,r,o)}build_cmd(e,s,n,r={},o={}){return s===void 0?this.exec("build_cmd",e,o,r):this._cmd("build_cmd",e,s,n,r,o)}build_command(e,s,n,r={},o={}){return s===void 0?this.exec("build_cmd",e,o,r):this._cmd("build_cmd",e,s,n,r,o)}get_interface_names(){return this.exec("get_interface_names",[])}get_router_names(){return this.exec("get_router_names",[])}send_raw(e,s){return this.exec("send_raw",[e,s])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,s){return this.exec("load_config",[e,s])}save_config(e,s,n){return this.exec("save_config",[e,s,n])}delete_config(e,s){return this.exec("delete_config",[e,s])}enable_limits(e,s,n){return this.exec("enable_limits",[e,s,n])}disable_limits(e,s,n){return this.exec("disable_limits",[e,s,n])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(e){return this.exec("get_overall_limits_state",[e])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(e,s){return this.exec("get_setting",[e],s)}get_settings(e,s){return this.exec("get_settings",e,s)}set_setting(e,s){return this.exec("set_setting",[e,s])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}save_setting(e,s){return this.exec("set_setting",[e,s])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const s=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",s),r=new Uint8Array(n);return Array.from(r).map(o=>o.toString(16).padStart(2,"0")).join("")}}}let Ve=[];const Pi={components:{OpenC3TimePicker:Ct,OpenConfigDialog:wt,SaveConfigDialog:yt,TargetPacketItemChooser:Et,TopBar:Ms},mixins:[bt,_t],data(){return{title:"Data Extractor",configKey:"data_extractor",openConfig:!1,saveConfig:!1,api:null,timeZone:"local",progress:0,packetsReceived:0,totalPacketsReceived:0,itemsReceived:0,totalItemsReceived:0,processButtonText:"Process",todaysDate:null,startDate:null,startTime:null,endTime:null,endDate:null,startDateTime:null,endDateTime:null,startDateTimeFilename:"",rules:{required:t=>!!t||"Required"},cmdOrTlm:"tlm",items:[],search:"",headers:[{title:"Target",value:"targetName"},{title:"Packet",value:"packetName"},{title:"Item",value:"itemName"},{title:"Mode",value:"mode"},{title:"ValueType",value:"valueType"},{title:"ReducedType",value:"reducedType"},{title:"Edit",value:"edit"},{title:"Delete",value:"delete"}],itemsPerPage:20,columnMap:{},delimiter:",",columnMode:"normal",fileCount:0,skipIgnored:!0,fillDown:!1,matlabHeader:!1,uniqueOnly:!1,keyMap:{},modes:["DECOM","REDUCED_MINUTE","REDUCED_HOUR","REDUCED_DAY"],valueTypes:["CONVERTED","RAW","FORMATTED","WITH_UNITS"],reducedTypes:["SAMPLE","MIN","MAX","AVG","STDDEV"],editAll:!1,allItemMode:"DECOM",allItemValueType:"CONVERTED",allItemReducedType:"SAMPLE",cable:new Zr,subscription:null,enterprise:!1}},computed:{hasCommands:function(){return this.items.some(t=>t.cmdOrTlm==="CMD")},menus:function(){return[{label:"File",items:[{label:"Open Configuration",icon:"mdi-folder-open",command:()=>{this.openConfig=!0}},{label:"Save Configuration",icon:"mdi-content-save",command:()=>{this.saveConfig=!0}},{label:"Reset Configuration",icon:"mdi-monitor-shimmer",command:()=>{this.resetConfig(),this.resetConfigBase()}},{divider:!0},{radioGroup:!0,value:this.delimiter,command:t=>{this.delimiter=t},choices:[{label:"Comma Delimited",value:","},{label:"Tab Delimited",value:" "}]}]},{label:"Mode",items:[{label:"Fill Down",checkbox:!0,checked:this.fillDown,command:()=>{this.fillDown=!this.fillDown}},{label:"Matlab Header",checkbox:!0,checked:this.matlabHeader,command:t=>{this.matlabHeader=!this.matlabHeader}},{label:"Unique Only",checkbox:!0,checked:this.uniqueOnly,command:t=>{this.uniqueOnly=!this.uniqueOnly}},{divider:!0},{radioGroup:!0,value:this.columnMode,command:t=>{this.columnMode=t},choices:[{label:"Normal Columns",value:"normal"},{label:"Full Column Names",value:"full"}]}]}]},currentConfig:function(){return{delimiter:this.delimiter,fillDown:this.fillDown,matlabHeader:this.matlabHeader,uniqueOnly:this.uniqueOnly,columnMode:this.columnMode,cmdOrTlm:this.cmdOrTlm,items:this.items,itemsPerPage:this.itemsPerPage}}},watch:{delimiter:function(){this.saveDefaultConfig(this.currentConfig)},fillDown:function(){this.saveDefaultConfig(this.currentConfig)},matlabHeader:function(){this.saveDefaultConfig(this.currentConfig)},uniqueOnly:function(){this.saveDefaultConfig(this.currentConfig)},columnNode:function(){this.saveDefaultConfig(this.currentConfig)},cmdOrTlm:function(){this.items.length===0?this.saveDefaultConfig(this.currentConfig):this.items=[]},items:{handler:function(){this.saveDefaultConfig(this.currentConfig)},deep:!0},itemsPerPage:function(){this.saveDefaultConfig(this.currentConfig)}},async created(){this.api=new Ai,await this.api.get_setting("time_zone").then(e=>{e&&(this.timeZone=e)}).catch(e=>{}),await gr.get("/openc3-api/info").then(e=>{e.data.enterprise&&(this.enterprise=!0)});let t=new Date;this.todaysDate=this.formatDate(t,this.timeZone),this.startDate=this.formatDate(t-36e5,this.timeZone),this.startTime=this.formatTimeHMS(t-36e5,this.timeZone),this.endTime=this.formatTimeHMS(t,this.timeZone),this.endDate=this.formatDate(t,this.timeZone)},mounted:function(){if(this.$route.query&&this.$route.query.config)this.openConfiguration(this.$route.query.config,!0);else{let t=this.loadDefaultConfig();JSON.stringify(t)!=="{}"&&this.applyConfig(t)}},unmounted:function(){this.subscription&&this.subscription.unsubscribe(),this.cable.disconnect()},methods:{resetConfig:function(){this.delimiter=",",this.fillDown=!1,this.matlabHeader=!1,this.uniqueOnly=!1,this.columnMode="normal";let t=new Date;this.startDate=this.formatDate(t-36e5,this.timeZone),this.startTime=this.formatTimeHMS(t-36e5,this.timeZone),this.endTime=this.formatTimeHMS(t,this.timeZone),this.endDate=this.formatDate(t,this.timeZone),this.cmdOrTlm="tlm",this.items=[],this.itemsPerPage=20,this.applyConfig(this.currentConfig)},applyConfig:function(t){this.delimiter=t.delimiter||",",this.menus[0].radioGroup=this.delimiter===","?"Comma Delimited":"Tab Delimited",this.fillDown=t.fillDown,this.menus[1].items[0].checked=this.fillDown||!1,this.matlabHeader=t.matlabHeader,this.menus[1].items[1].checked=this.matlabHeader||!1,this.uniqueOnly=t.uniqueOnly,this.menus[1].items[2].checked=this.uniqueOnly||!1,this.columnMode=t.columnMode,this.menus[1].radioGroup=this.columnMode==="normal"?"Normal Columns":"Full Column Names",this.cmdOrTlm=t.cmdOrTlm,this.items=t.items,this.itemsPerPage=t.itemsPerPage},openConfiguration:function(t,e=!1){this.openConfigBase(t,e,s=>{this.applyConfig(s),this.startDate=s.startDate,this.startTime=s.startTime,this.endTime=s.endTime,this.endDate=s.endDate,this.saveDefaultConfig(this.currentConfig)})},saveConfiguration:function(t){let e=this.currentConfig;e.startDate=this.startDate,e.startTime=this.startTime,e.endTime=this.endTime,e.endDate=this.endDate,this.saveConfigBase(t,e)},addItem:function(t){for(const e of this.items)if(e.itemName===t.itemName&&e.packetName===t.packetName&&e.targetName===t.targetName&&e.valueType==="CONVERTED"&&e.reducedType==="SAMPLE"&&e.mode==="DECOM"){this.$notify.caution({body:"This item has already been added!"});return}t.cmdOrTlm=this.cmdOrTlm.toUpperCase(),t.edit=!1,t.valueType="CONVERTED",t.reducedType="SAMPLE",t.mode="DECOM",this.items.push(t)},deleteItem:function(t){let e=this.items.indexOf(t);this.items.splice(e,1)},deleteAll:function(){this.items=[]},editAllItems:function(){this.editAll=!1;for(let t of this.items)t.mode=this.allItemMode,t.valueType=this.allItemValueType,t.reducedType=this.allItemReducedType},getItemLabel:function(t){let e=[`${t.targetName} - ${t.packetName} - ${t.itemName}`];return t.mode!=="DECOM"&&e.push(`{ ${t.mode} }`),t.valueType!=="CONVERTED"&&e.push(`( ${t.valueType} )`),t.reducedType!=="SAMPLE"&&e.push(`[ ${t.reducedType} ]`),e.join(" ")},setTimestamps:function(){this.startDateTimeFilename=this.startDate+"_"+this.startTime,this.startDateTimeFilename=this.startDateTimeFilename.replace(/(:|-|\.)\s*/g,"_");let t,e;try{this.timeZone==="local"?(t=new Date(this.startDate+" "+this.startTime),e=new Date(this.endDate+" "+this.endTime)):(t=new Date(this.startDate+" "+this.startTime+"Z"),e=new Date(this.endDate+" "+this.endTime+"Z"),this.startDateTimeFilename+="_UTC")}catch{return}this.startDateTime=t.getTime()*1e6,this.endDateTime=e.getTime()*1e6},processItems:function(){if(this.processButtonText==="Cancel"){this.finished();return}if(this.setTimestamps(),!this.startDateTime||!this.endDateTime){this.$notify.caution({body:"Invalid date/time selected!"});return}if(this.startDateTime===this.endDateTime){this.$notify.caution({body:"Start date/time is equal to end date/time!"});return}if(this.endDateTime-this.startDateTime<0){this.$notify.caution({body:"Start date/time is greater then end date/time!"});return}new Date(this.endDateTime/1e6)>Date.now()&&this.$notify.caution({title:"Note",body:`End date/time is greater than current date/time. Data will
|
|
9
|
+
continue to stream in real-time until
|
|
10
|
+
${new Date(this.endDateTime/1e6).toISOString()} is reached.`}),this.progress=0,this.processButtonText="Cancel",this.cable.createSubscription("StreamingChannel",window.openc3Scope,{received:t=>this.received(t),connected:()=>this.onConnected(),disconnected:t=>{t.allowReconnect&&this.$notify.caution({body:"OpenC3 backend connection disconnected."})},rejected:()=>{this.$notify.caution({body:"OpenC3 backend connection rejected."})}}).then(t=>{this.subscription=t})},resetAllVars:function(){this.fileCount=0,this.totalPacketsReceived=0,this.totalItemsReceived=0,this.columnHeaders=[],this.columnMap={},this.keyMap={},this.resetPerFileVars()},resetPerFileVars:function(){Ve=[],this.packetsReceived=0,this.itemsReceived=0},onConnected:function(){this.resetAllVars();let t=[];this.items.forEach((e,s)=>{let n=`${e.mode}__${e.cmdOrTlm}__${e.targetName}__${e.packetName}__${e.itemName}__${e.valueType}`;e.reducedType!=="SAMPLE"&&(n=n+"__"+e.reducedType);let r=String(s);this.keyMap[r]=n,t.push([n,r])}),OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(e=>{e&&OpenC3Auth.setTokens(),this.subscription.perform("add",{scope:window.openc3Scope,token:localStorage.openc3Token,items:t,start_time:this.startDateTime,end_time:this.endDateTime})})},received:function(t){if(this.cable.recordPing(),t.error){this.$notify.serious({body:t.error});return}if(this.packetsReceived+=t.length,this.totalPacketsReceived+=t.length,t.length>0){let e=new Set;for(let r of t){let o=Object.keys(r);o.forEach(e.add,e);let i=o.filter(a=>a.startsWith("__")).length;this.itemsReceived+=o.length-i,this.totalItemsReceived+=o.length-i}e.delete("__type"),e.delete("__time"),e.delete("__extra"),this.buildHeaders([...e]),Ve.push(t),this.progress=Math.ceil(100*(t[0].__time-this.startDateTime)/(this.endDateTime-this.startDateTime)),this.columnHeaders.length*this.packetsReceived+this.itemsReceived*8>1e8&&this.createFile()}else this.finished();t=null},buildHeaders:function(t){this.columnHeaders.length===0&&this.columnMode==="normal"&&(this.columnHeaders.push("TIME"),this.columnHeaders.push("TARGET"),this.columnHeaders.push("PACKET"),this.hasCommands&&(this.columnHeaders.push("USERNAME"),this.enterprise&&this.columnHeaders.push("APPROVER"))),t.forEach(e=>{if(e.slice(0,2)==="__"||this.columnMap[e])return;this.columnMap[e]=this.columnHeaders.length,e=this.keyMap[e];const[s,n,r,o,i,a,c]=e.split("__");let u=i;this.columnMode==="full"&&(u=r+" "+o+" "+i),s&&s!=="DECOM"&&(u=u+" {"+s+"}"),a&&a!=="CONVERTED"&&(u=u+" ("+a+")"),c&&(u=u+" ["+c+"]"),this.columnHeaders.push(u)})},createFile:async function(){var p,m;let t=Ve.flat(),e=this.columnHeaders,s=this.columnMap,n=[];this.resetPerFileVars();let r="";this.matlabHeader&&(r+="% "),r+=e.join(this.delimiter),n.push(r),await this.yieldToMain(),t.sort((h,E)=>h.__time-E.__time),await this.yieldToMain();let o=[],i=[],a=null,c=0;for(let h of t){let E=!1;this.fillDown&&a?i=[...a]:i=[];let x="";if(Object.keys(h).forEach(T=>{if(T.slice(0,2)==="__")return;x=T;let _=s[T];if(typeof h[T]=="object")if(h[T]===null)i[_]="";else if(Array.isArray(h[T]))i[_]='"['+h[T]+']"';else{let O=h[T].raw;if(Array.isArray(O)){let R="0x";O.forEach(L=>{R+=L.toString(16).padStart(2,"0").toUpperCase()}),i[_]=R}else i[_]="'"+O+"'"}else i[_]=h[T];this.uniqueOnly&&o[_]!==i[_]&&(E=!0),o[_]=i[_]}),this.fillDown&&(a=[...i]),!this.uniqueOnly||E){if(this.columnMode==="normal"){x=this.keyMap[x];const[T,_,O,R,L,j,Z]=x.split("__");i[0]=new Date(h.__time/1e6).toISOString(),i[1]=O,i[2]=R,this.hasCommands&&(i[3]=((p=h.__extra)==null?void 0:p.username)||"",this.enterprise&&(i[4]=((m=h.__extra)==null?void 0:m.approver)||""))}n.push(i.join(this.delimiter))}c+=1,c%1e3==0&&await this.yieldToMain()}let u=".csv",d="text/csv";this.delimiter===" "&&(u=".txt",d="text/tab-separated-values"),await this.yieldToMain();const b=new Blob([n.join(`
|
|
11
|
+
`)],{type:d});await this.yieldToMain();const y=document.createElement("a");y.href=URL.createObjectURL(b),y.setAttribute("download",this.startDateTimeFilename+"_"+this.fileCount+u),y.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),Ve.length!==0)await this.createFile();else if(this.fileCount===0){let t=new Date(this.startDateTime/1e6).toISOString(),e=new Date(this.endDateTime/1e6).toISOString();this.$notify.caution({body:`No data found for the items in the requested time range of ${t} to ${e}`})}this.progress=100,this.processButtonText="Process"}}};function Ii(t,e,s,n,r,o){const i=C("top-bar"),a=C("v-text-field"),c=C("v-col"),u=C("OpenC3TimePicker"),d=C("v-row"),b=C("v-radio"),y=C("v-radio-group"),p=C("target-packet-item-chooser"),m=C("v-container"),h=C("v-progress-circular"),E=C("v-spacer"),x=C("v-btn"),T=C("v-toolbar"),_=C("v-card-title"),O=C("v-select"),R=C("v-card-text"),L=C("v-card-actions"),j=C("v-card"),Z=C("v-dialog"),$=C("v-data-table"),te=C("open-config-dialog"),z=C("save-config-dialog");return P(),ee("div",null,[f(i,{menus:o.menus,title:r.title},null,8,["menus","title"]),f(j,null,{default:g(()=>[f(m,null,{default:g(()=>[f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(a,{modelValue:r.startDate,"onUpdate:modelValue":e[0]||(e[0]=w=>r.startDate=w),label:"Start Date",type:"date",max:r.todaysDate,rules:[r.rules.required],"data-test":"start-date"},null,8,["modelValue","max","rules"])]),_:1}),f(c,null,{default:g(()=>[f(u,{modelValue:r.startTime,"onUpdate:modelValue":e[1]||(e[1]=w=>r.startTime=w),label:"Start Time",rules:[r.rules.required],"data-test":"start-time"},null,8,["modelValue","rules"])]),_:1}),f(c,null,{default:g(()=>[f(a,{modelValue:r.endDate,"onUpdate:modelValue":e[2]||(e[2]=w=>r.endDate=w),label:"End Date",type:"date",max:r.todaysDate,rules:[r.rules.required],"data-test":"end-date"},null,8,["modelValue","max","rules"])]),_:1}),f(c,null,{default:g(()=>[f(u,{modelValue:r.endTime,"onUpdate:modelValue":e[3]||(e[3]=w=>r.endTime=w),label:"End Time",rules:[r.rules.required],"data-test":"end-time"},null,8,["modelValue","rules"])]),_:1})]),_:1}),f(d,{"no-gutters":""},{default:g(()=>[f(c,null,{default:g(()=>[f(y,{modelValue:r.cmdOrTlm,"onUpdate:modelValue":e[4]||(e[4]=w=>r.cmdOrTlm=w),inline:"","hide-details":"",class:"mt-0"},{default:g(()=>[f(b,{label:"Command",value:"cmd","data-test":"cmd-radio"}),f(b,{label:"Telemetry",value:"tlm","data-test":"tlm-radio"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(p,{"button-text":"Add Item",mode:r.cmdOrTlm,hidden:!0,"choose-item":"","allow-all":"",onAddItem:e[5]||(e[5]=w=>o.addItem(w))},null,8,["mode"])]),_:1})]),_:1})]),_:1}),f(T,{class:"pl-3"},{default:g(()=>[f(h,{"model-value":r.progress},null,8,["model-value"]),F(" Processed: "+G(r.totalPacketsReceived)+" packets, "+G(r.totalItemsReceived)+" items ",1),f(E),f(x,{class:"bg-primary",disabled:r.items.length<1,onClick:o.processItems},{default:g(()=>[F(G(r.processButtonText),1)]),_:1},8,["disabled","onClick"]),f(E),f(x,{icon:"mdi-pencil-box-multiple",variant:"text",density:"compact",disabled:r.items.length<1,"data-test":"editAll","aria-label":"Edit All Items",onClick:e[6]||(e[6]=w=>r.editAll=!0)},null,8,["disabled"]),f(x,{icon:"mdi-delete-sweep",variant:"text",density:"compact",disabled:r.items.length<1,"data-test":"delete-all","aria-label":"Delete All Items",onClick:o.deleteAll},null,8,["disabled","onClick"])]),_:1}),f(j,{width:"100%"},{default:g(()=>[f(_,null,{default:g(()=>[e[18]||(e[18]=F(" Items ",-1)),f(E),f(a,{modelValue:r.search,"onUpdate:modelValue":e[7]||(e[7]=w=>r.search=w),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),f($,{"items-per-page":r.itemsPerPage,"onUpdate:itemsPerPage":e[8]||(e[8]=w=>r.itemsPerPage=w),headers:r.headers,items:r.items,search:r.search,"items-per-page-options":[10,20,50,100,-1],"multi-sort":"",density:"compact"},{"item.edit":g(({item:w})=>[f(x,{icon:"mdi-pencil",variant:"text","data-test":"edit-row","aria-label":"Edit Item",onClick:Tt(I=>w.edit=!0,["stop"])},null,8,["onClick"]),f(Z,{modelValue:w.edit,"onUpdate:modelValue":I=>w.edit=I,"max-width":"600",persistent:"",onKeydown:We(I=>w.edit=!1,["esc"])},{default:g(()=>[f(j,null,{default:g(()=>[f(T,{height:"24"},{default:g(()=>[f(E),e[19]||(e[19]=Te("span",null," DataExtractor: Edit Item Mode ",-1)),f(E)]),_:1}),f(R,null,{default:g(()=>[f(d,{class:"mt-3 title-font"},{default:g(()=>[f(c,null,{default:g(()=>[F(G(o.getItemLabel(w)),1)]),_:2},1024)]),_:2},1024),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(O,{modelValue:w.mode,"onUpdate:modelValue":I=>w.mode=I,"hide-details":"",items:r.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(O,{modelValue:w.valueType,"onUpdate:modelValue":I=>w.valueType=I,"hide-details":"",items:r.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(O,{modelValue:w.reducedType,"onUpdate:modelValue":I=>w.reducedType=I,"hide-details":"",items:r.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024)]),_:2},1024),f(L,{class:"px-2"},{default:g(()=>[f(E),f(x,{variant:"flat",onClick:I=>w.edit=!1},{default:g(()=>[...e[20]||(e[20]=[F(" Close ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","onKeydown"])]),"item.delete":g(({item:w})=>[f(x,{icon:"mdi-delete",variant:"text","data-test":"delete-row","aria-label":"Delete Item",onClick:I=>o.deleteItem(w)},null,8,["onClick"])]),_:1},8,["items-per-page","headers","items","search"])]),_:1})]),_:1}),f(Z,{modelValue:r.editAll,"onUpdate:modelValue":e[14]||(e[14]=w=>r.editAll=w),"max-width":"600",persistent:"",onKeydown:e[15]||(e[15]=We(w=>r.editAll=!1,["esc"]))},{default:g(()=>[f(j,null,{default:g(()=>[f(T,{height:"24"},{default:g(()=>[f(E),e[21]||(e[21]=Te("span",null," DataExtractor: Edit All Items",-1)),f(E)]),_:1}),f(R,null,{default:g(()=>[f(d,{class:"mt-3"},{default:g(()=>[f(c,null,{default:g(()=>[...e[22]||(e[22]=[F(" This will change all items to the following data type! ",-1)])]),_:1})]),_:1}),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(O,{modelValue:r.allItemMode,"onUpdate:modelValue":e[9]||(e[9]=w=>r.allItemMode=w),"hide-details":"",items:r.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(O,{modelValue:r.allItemValueType,"onUpdate:modelValue":e[10]||(e[10]=w=>r.allItemValueType=w),"hide-details":"",items:r.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(O,{modelValue:r.allItemReducedType,"onUpdate:modelValue":e[11]||(e[11]=w=>r.allItemReducedType=w),"hide-details":"",items:r.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1})]),_:1}),f(L,{class:"px-2"},{default:g(()=>[f(E),f(x,{variant:"outlined",onClick:e[12]||(e[12]=w=>r.editAll=!1)},{default:g(()=>[...e[23]||(e[23]=[F(" Cancel ",-1)])]),_:1}),f(x,{variant:"flat",disabled:!r.allItemValueType,onClick:e[13]||(e[13]=w=>o.editAllItems())},{default:g(()=>[...e[24]||(e[24]=[F(" Ok ",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),r.openConfig?(P(),U(te,{key:0,modelValue:r.openConfig,"onUpdate:modelValue":e[16]||(e[16]=w=>r.openConfig=w),"config-key":r.configKey,onSuccess:o.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):ce("",!0),r.saveConfig?(P(),U(z,{key:1,modelValue:r.saveConfig,"onUpdate:modelValue":e[17]||(e[17]=w=>r.saveConfig=w),"config-key":r.configKey,onSuccess:o.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):ce("",!0)])}const Gi=Is("default",gt(Pi,[["render",Ii],["__scopeId","data-v-2675b2d7"]]))}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./Widget-
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","./main-5393150a38f7b14176e1.js","vue","vue-router","single-spa","vuex","vuetify"],function(d,V){"use strict";var l,a,n,r,s,u,o;return{setters:[e=>{l=e.o},e=>{a=e.d,n=e.R},e=>{r=e.resolveComponent,s=e.createBlock,u=e.openBlock,o=e.normalizeStyle},null,null,null,null],execute:function(){const e={mixins:[l,n],data(){return{label:"Date",dateValue:""}},created(){this.parameters[0]&&(this.label=this.parameters[0]),this.dateValue=this.formatDate(new Date,this.screenTimeZone)},methods:{text(){return this.dateValue},date(){return this.dateValue}}};function c(m,i,v,y,t,b){const h=r("v-text-field");return u(),s(h,{modelValue:t.dateValue,"onUpdate:modelValue":i[0]||(i[0]=p=>t.dateValue=p),label:t.label,style:o(m.computedStyle),type:"date","hide-details":""},null,8,["modelValue","label","style"])}const f=d("default",a(e,[["render",c]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","./LimitsBar-IVv8t4FE-8c4464aab7f5c57f839c.js","vue"],function(S,M){"use strict";var k,L,C,h,o,u,e,t,w,s,d,g,p,N,V;return{setters:[c=>{k=c.d,L=c.B},c=>{C=c.x},c=>{h=c.resolveComponent,o=c.createBlock,u=c.openBlock,e=c.withCtx,t=c.createVNode,w=c.createElementVNode,s=c.createTextVNode,d=c.toDisplayString,g=c.createCommentVNode,p=c.createElementBlock,N=c.Fragment,V=c.renderList}],execute:function(){const c={components:{LimitsBar:C},props:{type:{default:"tlm",validator:function(r){return["cmd","tlm"].indexOf(r)!==-1}},targetName:{type:String,default:null},packetName:{type:String,default:null},itemName:{type:String,default:null},modelValue:Boolean},emits:["update:modelValue"],data(){return{details:Object,available:null,updater:null,rawValue:null,convertedValue:null,formattedValue:null,unitsValue:null}},computed:{show:{get(){return this.modelValue},set(r){this.$emit("update:modelValue",r)}}},watch:{modelValue:function(r,a){r?(this.requestDetails(),this.type==="tlm"&&(this.updater=setInterval(()=>{this.available&&this.details&&this.api.get_tlm_values(this.available).then(_=>{for(let y of _){let i=null;if(y[0].json_class==="String"&&y[0].raw!==void 0?i=y[0].raw:this.details.data_type==="BLOCK"&&(i=y[0]),i!==null){i=i.slice(0,parseInt(this.details.bit_size)/8);let b=!1;i.length>64&&(b=!0),y[0]=Array.from(i.slice(0,64),function(v){return v===" "?"20":("0"+(v&255).toString(16)).slice(-2)}).join(" ").toUpperCase(),b&&(y[0]+="...")}}this.details.data_type.includes("INT")&&!this.details.array_size?this.rawValue=`${_[0][0]} (0x${_[0][0].toString(16).toUpperCase()})`:this.rawValue=_[0][0],this.convertedValue=_[1][0],this.formattedValue=_[2][0],this.unitsValue=_[3][0]})},1e3))):(clearInterval(this.updater),this.updater=null)}},created(){this.api=new L},beforeUnmount(){clearInterval(this.updater),this.updater=null},methods:{hasLimits(r){let a=!1;return r.limits.DEFAULT&&(a=!0),r.states&&Object.getOwnPropertyNames(r.states).forEach(_=>{r.states[_].color&&(a=!0)}),a},async requestDetails(){this.type==="tlm"?this.api.get_tlm_available([`${this.targetName}__${this.packetName}__${this.itemName}__RAW`,`${this.targetName}__${this.packetName}__${this.itemName}__CONVERTED`,`${this.targetName}__${this.packetName}__${this.itemName}__FORMATTED`,`${this.targetName}__${this.packetName}__${this.itemName}__WITH_UNITS`]).then(r=>{r&&r.length>0&&(this.available=r),this.api.get_item(this.targetName,this.packetName,this.itemName).then(a=>{this.details=a,this.hasLimits(a)||(this.details.limits=null)})}):this.api.get_parameter(this.targetName,this.packetName,this.itemName).then(r=>{this.details=r})},async changeLimitsEnabled(){this.details.limits.enabled?await this.api.enable_limits(this.targetName,this.packetName,this.itemName):await this.api.disable_limits(this.targetName,this.packetName,this.itemName)},formatLimit(r){return r.hasOwnProperty("green_low")?"RL/"+r.red_low+" YL/"+r.yellow_low+" YH/"+r.yellow_high+" RH/"+r.red_high+" GL/"+r.green_low+" GH/"+r.green_high:r.hasOwnProperty("red_low")?"RL/"+r.red_low+" YL/"+r.yellow_low+" YH/"+r.yellow_high+" RH/"+r.red_high:r}}},B={key:5},E={key:7},$={class:"limits-text"},x={key:9};function U(r,a,_,y,i,b){const v=h("v-spacer"),D=h("v-toolbar"),I=h("v-card-title"),T=h("v-card-subtitle"),l=h("v-col"),n=h("v-row"),O=h("v-switch"),F=h("LimitsBar"),R=h("v-container"),j=h("v-card-text"),z=h("v-card"),A=h("v-dialog");return u(),o(A,{modelValue:b.show,"onUpdate:modelValue":a[1]||(a[1]=m=>b.show=m),width:"700"},{default:e(()=>[t(z,null,{default:e(()=>[t(D,{height:24},{default:e(()=>[t(v),a[2]||(a[2]=w("span",null," Details ",-1)),t(v)]),_:1}),t(I,null,{default:e(()=>[s(d(_.targetName)+" "+d(_.packetName)+" "+d(_.itemName),1)]),_:1}),t(T,null,{default:e(()=>[s(d(i.details.description),1)]),_:1}),t(j,null,{default:e(()=>[t(R,{fluid:""},{default:e(()=>[_.type==="tlm"?(u(),o(n,{key:0,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[3]||(a[3]=[s("Item Values",-1)])]),_:1}),t(l)]),_:1})):g("",!0),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[...a[4]||(a[4]=[s("Raw Value",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.rawValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[...a[5]||(a[5]=[s("Converted Value",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.convertedValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[...a[6]||(a[6]=[s("Formatted Value",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.formattedValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[...a[7]||(a[7]=[s("With Units Value",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.unitsValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[8]||(a[8]=[s("Bit Offset",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.bit_offset),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[9]||(a[9]=[s("Bit Size",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.bit_size),1)]),_:1})]),_:1}),i.details.array_size?(u(),o(n,{key:1,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[10]||(a[10]=[s("Array Size",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.array_size),1)]),_:1})]),_:1})):g("",!0),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[11]||(a[11]=[s("Data Type",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.data_type),1)]),_:1})]),_:1}),_.type==="cmd"?(u(),o(n,{key:2,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[12]||(a[12]=[s("Minimum",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.minimum),1)]),_:1})]),_:1})):g("",!0),_.type==="cmd"?(u(),o(n,{key:3,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[13]||(a[13]=[s("Maximum",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.maximum),1)]),_:1})]),_:1})):g("",!0),_.type==="cmd"?(u(),o(n,{key:4,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[14]||(a[14]=[s("Default",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.default),1)]),_:1})]),_:1})):g("",!0),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[15]||(a[15]=[s("Format String",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.format_string),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[16]||(a[16]=[s("Read Conversion",-1)])]),_:1}),i.details.read_conversion?(u(),o(l,{key:0},{default:e(()=>[s(" Class: "+d(i.details.read_conversion.class)+" ",1),a[17]||(a[17]=w("br",null,null,-1)),s(" Params: "+d(i.details.read_conversion.params),1)]),_:1})):(u(),o(l,{key:1}))]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[18]||(a[18]=[s("Write Conversion",-1)])]),_:1}),i.details.write_conversion?(u(),o(l,{key:0},{default:e(()=>[s(" Class: "+d(i.details.write_conversion.class)+" ",1),a[19]||(a[19]=w("br",null,null,-1)),s(" Params: "+d(i.details.write_conversion.params),1)]),_:1})):(u(),o(l,{key:1}))]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[20]||(a[20]=[s("Id Value",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.id_value),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[21]||(a[21]=[s("Units Full",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.units_full),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[22]||(a[22]=[s("Units Abbr",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.units),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[23]||(a[23]=[s("Endianness",-1)])]),_:1}),t(l,null,{default:e(()=>[s(d(i.details.endianness),1)]),_:1})]),_:1}),i.details.states?(u(),p("div",B,[t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[24]||(a[24]=[s("States",-1)])]),_:1}),t(l)]),_:1}),(u(!0),p(N,null,V(i.details.states,(m,f)=>(u(),o(n,{key:f,"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[s(d(f),1)]),_:2},1024),t(l,null,{default:e(()=>[s(d(m.value),1)]),_:2},1024)]),_:2},1024))),128))])):(u(),o(n,{key:6,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[25]||(a[25]=[s("States",-1)])]),_:1}),t(l,null,{default:e(()=>[...a[26]||(a[26]=[s("None",-1)])]),_:1})]),_:1})),i.details.limits?(u(),p("div",E,[t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[27]||(a[27]=[s("Limits",-1)])]),_:1}),t(l)]),_:1}),(u(!0),p(N,null,V(i.details.limits,(m,f)=>(u(),o(n,{key:f,"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),f==="enabled"?(u(),o(l,{key:0,cols:"4",class:"label"},{default:e(()=>[...a[28]||(a[28]=[s("Enabled",-1)])]),_:1})):g("",!0),f==="enabled"?(u(),o(O,{key:1,modelValue:i.details.limits.enabled,"onUpdate:modelValue":[a[0]||(a[0]=H=>i.details.limits.enabled=H),b.changeLimitsEnabled],density:"compact",color:"primary",class:"compact-switch","hide-details":""},null,8,["modelValue","onUpdate:modelValue"])):g("",!0),f!=="enabled"?(u(),o(l,{key:2,cols:"4",class:"label"},{default:e(()=>[s(d(f),1)]),_:2},1024)):g("",!0),f!=="enabled"?(u(),o(l,{key:3},{default:e(()=>[w("div",$,d(b.formatLimit(m)),1),m.red_low!==void 0?(u(),o(F,{key:0,"red-low":m.red_low,"yellow-low":m.yellow_low,"yellow-high":m.yellow_high,"red-high":m.red_high,"green-low":m.green_low,"green-high":m.green_high,value:i.convertedValue,width:300,height:22},null,8,["red-low","yellow-low","yellow-high","red-high","green-low","green-high","value"])):g("",!0)]),_:2},1024)):g("",!0)]),_:2},1024))),128))])):(u(),o(n,{key:8,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[29]||(a[29]=[s("Limits",-1)])]),_:1}),t(l,null,{default:e(()=>[...a[30]||(a[30]=[s("None",-1)])]),_:1})]),_:1})),i.details.meta?(u(),p("div",x,[t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[31]||(a[31]=[s("Meta",-1)])]),_:1}),t(l)]),_:1}),(u(!0),p(N,null,V(i.details.meta,(m,f)=>(u(),o(n,{key:f,"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[s(d(f),1)]),_:2},1024),t(l,null,{default:e(()=>[s(d(m.join(", ")),1)]),_:2},1024)]),_:2},1024))),128))])):(u(),o(n,{key:10,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>[...a[32]||(a[32]=[s("Meta",-1)])]),_:1}),t(l,null,{default:e(()=>[...a[33]||(a[33]=[s("None",-1)])]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const P=S("q",k(c,[["render",U],["__scopeId","data-v-7d957b35"]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["vue","./main-5393150a38f7b14176e1.js","vue-router","single-spa","vuex","vuetify"],function(a,p){"use strict";var t,n,r,o,i,s;return{setters:[e=>{t=e.createBlock,n=e.openBlock,r=e.resolveDynamicComponent,o=e.normalizeProps,i=e.guardReactiveProps},e=>{s=e.d},null,null,null,null],execute:function(){const e={props:{name:{type:String,default:null}},data(){return{widgetType:null}},computed:{url:function(){return`${window.location.origin}/tools/widgets/${this.name}/${this.name}.umd.min.js`}},async mounted(){try{this.widgetType=await System.import(this.url)}catch{throw new Error(`Unknown widget: ${this.name}`)}}};function l(u,d,g,w,c,y){return n(),t(r(c.widgetType),o(i({...u.$props,...u.$attrs})),null,16)}const m=a("default",s(e,[["render",l]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","vue-router","single-spa","vuex","vuetify"],function(S,j){"use strict";var C,g,x,a,y,u,v,l,o,m,i,p,w,f,E,k,b;return{setters:[t=>{C=t.d,g=t.F},t=>{x=t.o},t=>{a=t.resolveComponent,y=t.createBlock,u=t.openBlock,v=t.normalizeStyle,l=t.withCtx,o=t.createVNode,m=t.createElementVNode,i=t.toDisplayString,p=t.createElementBlock,w=t.createCommentVNode,f=t.Fragment,E=t.renderList,k=t.createTextVNode,b=t.normalizeClass},null,null,null,null],execute:function(){const t={mixins:[x],data(){return{files:[],loading:!1}},computed:{match(){if(this.files.some(s=>s.error))return!1;if(this.files.some(s=>!s.checksum))return null;const e=this.files[0].checksum;return this.files.every(s=>s.checksum===e)},matchStatus(){return{null:{icon:"$info",color:"grey",text:"Comparing..."},true:{icon:"$success",color:"success",text:"Checksums Match"},false:{icon:"$error",color:"error",text:this.files.some(e=>e.error)?"Error loading file(s)":"Checksums Do Not Match"}}[this.match]}},created(){this.files=this.parameters.filter(e=>e).map(e=>({path:e,checksum:null,error:null,copied:!1}))},mounted(){this.files.length&&this.fetchChecksums()},methods:{getDisplayText(e){return e.error?`Error: ${e.error}`:e.checksum?e.checksum:this.loading?"Loading...":"Not loaded"},async computeChecksum(e){const s=new TextEncoder().encode(e),d=await crypto.subtle.digest("SHA-256",s);return Array.from(new Uint8Array(d)).map(n=>n.toString(16).padStart(2,"0")).join("")},async fetchFile(e){var s;const d=window.openc3Scope||"DEFAULT";let n=`${d}/targets_modified/${e}`,r=await g.get(`/openc3-api/storage/download_file/${encodeURIComponent(n)}`,{params:{bucket:"OPENC3_CONFIG_BUCKET"},headers:{"Ignore-Errors":"404,500"}}).catch(()=>null);if((!r||r.status===404)&&(n=`${d}/targets/${e}`,r=await g.get(`/openc3-api/storage/download_file/${encodeURIComponent(n)}`,{params:{bucket:"OPENC3_CONFIG_BUCKET"}})),(s=r==null?void 0:r.data)!=null&&s.contents)return atob(r.data.contents);throw new Error("File not found")},async copyChecksum(e){if(e.checksum)try{await navigator.clipboard.writeText(e.checksum),e.copied=!0,setTimeout(()=>e.copied=!1,2e3)}catch(s){console.error("Failed to copy checksum:",s)}},async fetchChecksums(){this.loading=!0,this.files.forEach(e=>{e.checksum=null,e.error=null}),(await Promise.all(this.files.map(e=>this.fetchFile(e.path).then(s=>this.computeChecksum(s)).catch(s=>({error:s.message||"File not found"}))))).forEach((e,s)=>{e!=null&&e.error?this.files[s].error=e.error:this.files[s].checksum=e}),this.loading=!1}}},$={class:"text-caption text-medium-emphasis font-weight-regular"},T={class:"text-caption text-medium-emphasis mb-2"},z={class:"ml-1 text-high-emphasis"},B={class:"flex-grow-1 overflow-wrap-anywhere"};function V(e,s,d,n,r,h){const D=a("v-spacer"),F=a("v-btn"),U=a("v-card-title"),_=a("v-divider"),I=a("v-sheet"),A=a("v-chip"),L=a("v-card-text"),O=a("v-card");return u(),y(O,{style:v(e.computedStyle),"min-width":"400"},{default:l(()=>[o(U,{class:"d-flex align-center pa-2"},{default:l(()=>[m("span",$,i(r.files.length===1?"File Checksum":"File Checksum Comparison"),1),o(D),o(F,{size:"x-small",icon:"mdi-refresh",variant:"text",loading:r.loading,onClick:h.fetchChecksums},null,8,["loading","onClick"])]),_:1}),o(_),o(L,{class:"pa-3"},{default:l(()=>[(u(!0),p(f,null,E(r.files,(c,N)=>(u(),p(f,{key:N},[m("div",T,[k(i(r.files.length===1?"File:":`File ${N+1}:`)+" ",1),m("span",z,i(c.path),1)]),o(I,{class:b([c.error?"text-error":"","d-flex align-center ga-2 px-2 py-1 mb-3 rounded text-caption"]),style:{"background-color":"rgba(128, 128, 128, 0.2)"}},{default:l(()=>[m("span",B,i(h.getDisplayText(c)),1),o(F,{icon:c.copied?"$success":"mdi-content-copy",color:c.copied?"success":void 0,disabled:!c.checksum,size:"x-small",variant:"plain",density:"compact",onClick:P=>h.copyChecksum(c)},null,8,["icon","color","disabled","onClick"])]),_:2},1032,["class"])],64))),128)),r.files.length>1?(u(),p(f,{key:0},[o(_,{class:"mb-3"}),o(A,{color:h.matchStatus.color,size:"small",variant:"tonal",label:"","prepend-icon":h.matchStatus.icon},{default:l(()=>[k(i(h.matchStatus.text),1)]),_:1},8,["color","prepend-icon"])],64)):w("",!0)]),_:1})]),_:1},8,["style"])}const K=S("default",C(t,[["render",V],["__scopeId","data-v-7cb83af3"]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./main-5393150a38f7b14176e1.js","./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","vue","vue-router","single-spa","vuex","vuetify"],function(y,F){"use strict";var c,l,f,p,i,u,g,d,a,o,h,m;return{setters:[t=>{c=t.d,l=t.F,f=t.b},t=>{p=t.o},t=>{i=t.resolveComponent,u=t.createBlock,g=t.openBlock,d=t.normalizeStyle,a=t.withCtx,o=t.createVNode,h=t.createElementVNode,m=t.toDisplayString},null,null,null,null],execute:function(){const t={mixins:[p],data(){return{filePath:"",fileContent:"Loading...",loading:!1,width:600,height:300,editor:null}},computed:{contentStyle(){return{width:this.width+"px",height:this.height+"px"}},aceMode(){var r;const e=(r=this.filePath.split(".").pop())==null?void 0:r.toLowerCase();return{json:"ace/mode/json",rb:"ace/mode/ruby",py:"ace/mode/python",txt:"ace/mode/text"}[e]||"ace/mode/text"}},created(){this.parameters[0]&&(this.filePath=this.parameters[0]),this.parameters[1]&&(this.width=parseInt(this.parameters[1])),this.parameters[2]&&(this.height=parseInt(this.parameters[2]))},mounted(){this.editor=f.edit(this.$refs.editor),this.editor.setTheme("ace/theme/twilight"),this.editor.setReadOnly(!0),this.editor.setShowPrintMargin(!1),this.editor.setHighlightActiveLine(!1),this.editor.renderer.setShowGutter(!1),this.editor.renderer.setScrollMargin(8,8,0,0),this.editor.renderer.setPadding(8),this.editor.setValue(this.fileContent,-1),this.filePath&&this.fetchFile()},beforeUnmount(){this.editor&&(this.editor.destroy(),this.editor.container.remove())},methods:{updateEditor(){this.editor&&(this.editor.session.setMode(this.aceMode),this.editor.setValue(this.fileContent,-1))},async fetchFile(){var r;if(!this.filePath){this.fileContent='Error: No file path specified. Usage: FILEDISPLAY "TARGET/path/to/file.txt"',this.updateEditor();return}this.loading=!0;try{const e=window.openc3Scope||"DEFAULT";let n=`${e}/targets_modified/${this.filePath}`,s=await l.get(`/openc3-api/storage/download_file/${encodeURIComponent(n)}`,{params:{bucket:"OPENC3_CONFIG_BUCKET"},headers:{"Ignore-Errors":"404,500"}}).catch(()=>null);(!s||s.status===404)&&(n=`${e}/targets/${this.filePath}`,s=await l.get(`/openc3-api/storage/download_file/${encodeURIComponent(n)}`,{params:{bucket:"OPENC3_CONFIG_BUCKET"}})),(r=s==null?void 0:s.data)!=null&&r.contents?this.fileContent=atob(s.data.contents):this.fileContent="Error: Could not load file"}catch(e){this.fileContent=`Error: ${e.message||e}`}finally{this.loading=!1,this.updateEditor()}}}},w={class:"text-caption text-medium-emphasis font-weight-regular"};function x(r,e,n,s,C,v){const E=i("v-spacer"),P=i("v-btn"),S=i("v-card-title"),_=i("v-divider"),b=i("v-card-text"),N=i("v-card");return g(),u(N,{style:d(r.computedStyle)},{default:a(()=>[o(S,{class:"d-flex align-center pa-2"},{default:a(()=>[h("span",w,m(C.filePath),1),o(E),o(P,{size:"x-small",icon:"mdi-refresh",variant:"text",loading:C.loading,onClick:v.fetchFile},null,8,["loading","onClick"])]),_:1}),o(_),o(b,{class:"pa-0"},{default:a(()=>[h("div",{ref:"editor",style:d(v.contentStyle)},null,4)]),_:1})]),_:1},8,["style"])}const I=y("default",c(t,[["render",x]]))}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./Widget-D4rzBHnr-20d97feec6afa1ff041b.js","./ValueWidget-BubIamVx-8b83830f75d379716847.js","vue","./main-5393150a38f7b14176e1.js","./DetailsDialog-D-rjL4oc-42527ff3f15896b49ffb.js","./LimitsBar-IVv8t4FE-8c4464aab7f5c57f839c.js","single-spa","./VWidget-BcwkHuIT-4b2fbda2cd88559aeb5b.js","vue-router","vuex","vuetify"],function(m,f){"use strict";var r,s,n,a,l,i,o,c,u;return{setters:[e=>{r=e.o},e=>{s=e.default},e=>{n=e.resolveComponent,a=e.createElementBlock,l=e.openBlock,i=e.normalizeStyle,o=e.createVNode,c=e.mergeProps},e=>{u=e.d},null,null,null,null,null,null,null],execute:function(){const p={components:{ValueWidget:s},mixins:[r],computed:{getParameters(){return[this.parameters[0],this.parameters[1],this.parameters[2],this.parameters[4]]}},created(){this.setWidth(parseInt(this.parameters[5])+4,"ch",16)}};function g(t,B,V,j,y,d){const v=n("value-widget");return l(),a("div",{ref:"container",class:"d-flex flex-row",style:i(t.computedStyle)},[o(v,c(t.$attrs,{parameters:d.getParameters,settings:t.appliedSettings,"screen-values":t.screenValues,"screen-time-zone":t.screenTimeZone,"format-string":t.parameters[3]}),null,16,["parameters","settings","screen-values","screen-time-zone","format-string"])],4)}const h=m("default",u(p,[["render",g]]))}}});
|