openc3-cosmos-tool-dataextractor 7.0.0 → 7.0.1
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-Dh6zDiC7-873bed41f0920d4f20e2.js +2 -0
- data/tools/dataextractor/{ArrayplotWidget-CDNRxI2F-a83801ded05b12f711f8.js → ArrayplotWidget-CSc_TqNm-faea7e102c3b0e77340e.js} +1 -1
- data/tools/dataextractor/{BarColumn-nSFR2LZF-52aaa4252f2230353368.js → BarColumn-DmjMnw5l-e63ca3ac4f4e5f880c78.js} +1 -1
- data/tools/dataextractor/BlockWidget-BdR_HCVc-339e6dbc0abdf23824ee.js +2 -0
- data/tools/dataextractor/{ButtonWidget-rS7sVb7m-dbf9f92372e6dff8e3d3.js → ButtonWidget-DZ4VCNWU-467ba3039befef92a15a.js} +2 -2
- data/tools/dataextractor/{CanvasWidget-DuWolVCW-2bd38dd443fd2f303296.js → CanvasWidget-DuXOo3jG-cca60757795adfc9b555.js} +1 -1
- data/tools/dataextractor/CanvasdotWidget-WoLpxI1u-42cc7026c74d2b83f1bf.js +1 -0
- data/tools/dataextractor/{CanvasimageWidget-DMHdDTSs-e3480e258876ee7d5ce8.js → CanvasimageWidget-tWpK5rsv-037c03642913e202f682.js} +1 -1
- data/tools/dataextractor/{CanvasimagevalueWidget-ns-5S1HA-984a3695590efe80a103.js → CanvasimagevalueWidget-BVzJYz3l-3d76b92444baed7b16b9.js} +1 -1
- data/tools/dataextractor/{CanvaslabelWidget-DElES3gU-9213b36fbadeb0359f4e.js → CanvaslabelWidget-CDFf8Vll-90f5994b9ebe9dd669d7.js} +1 -1
- data/tools/dataextractor/{CanvaslabelvalueWidget-B2B5KlUm-04fa31c935f3aa224322.js → CanvaslabelvalueWidget-DzJKD6qs-16454bcd3f0db6ad1a0d.js} +1 -1
- data/tools/dataextractor/CanvaslineWidget-BttTXCZq-4f927bb9d629d4ca2431.js +1 -0
- data/tools/dataextractor/{CanvaslinevalueWidget-CrtDsSOP-3dd527a40c656fd8d936.js → CanvaslinevalueWidget-i6G0JfnZ-6ed33732c8ac89cd98bb.js} +1 -1
- data/tools/dataextractor/CheckbuttonWidget-18jtf7sh-1bb7cf5924c0accea787.js +1 -0
- data/tools/dataextractor/{ComboboxWidget-CciRWuKq-3f1ba4ec7db5de697819.js → ComboboxWidget-BjaVFbD4-68be351db2576115fc45.js} +1 -1
- data/tools/dataextractor/{DataExtractor-e5f302088707d33752fd.js → DataExtractor-6a57a8b8549d610cacac.js} +8 -8
- data/tools/dataextractor/{DateWidget-DwgQ3Jik-d443f1fdc2599de1735d.js → DateWidget-DkFAFlc8-8b87a00cd8c7df7adf8c.js} +1 -1
- data/tools/dataextractor/{DetailsDialog-CspQjoR5-a13c819a71a18f3ba1f8.js → DetailsDialog-sqja4Lzq-3c07f8084078cec125bc.js} +1 -1
- data/tools/dataextractor/{DynamicWidget-Bym87woV-24d53debe022dc41bdad.js → DynamicWidget-BuSbQVhf-57879c868050e8e6066a.js} +1 -1
- data/tools/dataextractor/{FilechecksumWidget-BS281Q0h-aa51848ef542e86ad554.js → FilechecksumWidget-DqJ_hvN4-458d5afdd66f766a320e.js} +1 -1
- data/tools/dataextractor/{FiledisplayWidget-C9YdXDdv-7048222386da1c6b8556.js → FiledisplayWidget-CYznG_tf-633ffe7729c3d8df045f.js} +1 -1
- data/tools/dataextractor/{FormatvalueWidget-dfmQfrNA-43064fa838d0937da3ab.js → FormatvalueWidget-BnVu4YGx-685c1b3d38cda62137ef.js} +1 -1
- data/tools/dataextractor/Graph-CUFzx8Ti-e326729124e84b220373.js +1 -0
- data/tools/dataextractor/{GraphWidget-CWJ4Yb26-15460f438f038901828a.js → GraphWidget-DO5XbOGy-edd2165bb446a9306f21.js} +1 -1
- data/tools/dataextractor/{HorizontalWidget-DFAqF95S-4494e9bd7db85c2b3380.js → HorizontalWidget-BA9PiP3d-61dbe5e15cff5d64bb29.js} +1 -1
- data/tools/dataextractor/HorizontalboxWidget-B-7HOqgl-32dab144449bf94f15aa.js +1 -0
- data/tools/dataextractor/HorizontallineWidget-D-o9MGo0-ddb9630a2adc743b1e74.js +1 -0
- data/tools/dataextractor/{IframeWidget-BsDu4b17-729d665632327b5613f4.js → IframeWidget-BzOka-fX-cbf4824b3f4d3e3f6424.js} +1 -1
- data/tools/dataextractor/{ImageLoader-CT4rnwWn-5b50796341061a230f31.js → ImageLoader-CstmWFM4-f27420bebced8580ff70.js} +1 -1
- data/tools/dataextractor/{ImageviewerWidget-BQbrz2WL-708300227e9c554627dd.js → ImageviewerWidget-BA9uOM1q-b0947f82f033e760c532.js} +1 -1
- data/tools/dataextractor/{LabelWidget-D5-IFUYW-5fcc7202ac2b5e9869c8.js → LabelWidget-Da2howZF-bfb9fcc9c81e16f870e5.js} +1 -1
- data/tools/dataextractor/LabelledWidget-BH8y3OXT-68af25a9704951142531.js +1 -0
- data/tools/dataextractor/{LabelprogressbarWidget-BNFgTq4D-606ff758c918eb5b0223.js → LabelprogressbarWidget-Brl24F4c-e37d3a3a1ea8e0130fa0.js} +1 -1
- data/tools/dataextractor/LabelsparklineWidget-D22MB7-4-4d4c54cc590572f96ebc.js +1 -0
- data/tools/dataextractor/LabelvalueWidget-_1JPbK-K-79535add803f699f912d.js +1 -0
- data/tools/dataextractor/{LabelvaluedescWidget-DeBRjYXs-7d13f0625327ab080392.js → LabelvaluedescWidget-BgduSJJb-2c9d371ecc2f493464fd.js} +1 -1
- data/tools/dataextractor/LabelvaluelimitsbarWidget-C9PlEhWo-124291211bb9a7fb7a20.js +1 -0
- data/tools/dataextractor/LabelvaluelimitscolumnWidget-Cay6AhoZ-aeb62c844e9d862bc2b3.js +1 -0
- data/tools/dataextractor/LabelvaluerangebarWidget-s_8IgY-C-299393edba519bae3a75.js +1 -0
- data/tools/dataextractor/{Layout-LSeXBY_W-523b3bdfa663af9d9dc2.js → Layout-D7RGn0Fe-4c6501b5b5c13bc5939b.js} +1 -1
- data/tools/dataextractor/{LedWidget-CH4Il9R7-84f6b5b3f3604db94a1e.js → LedWidget-DgMtvsiv-f9fb0a4ee2f71ef2a9f6.js} +1 -1
- data/tools/dataextractor/{LimitsBar-BelAQFD0-1c800ecbee755a7c8180.js → LimitsBar-CcOaAw0C-3ee7e5044b0ba18270a6.js} +1 -1
- data/tools/dataextractor/{LimitsbarWidget-PkPqlyxL-41cb2134202cfc229b0d.js → LimitsbarWidget-DpmJn1Lo-06311c5aa1a8fd9c3272.js} +1 -1
- data/tools/dataextractor/{LimitscolorWidget-BlA15g4A-ac374db2daee985c3708.js → LimitscolorWidget-BMXiEaDm-82722cde5d79a4a63dd5.js} +1 -1
- data/tools/dataextractor/{LimitscolumnWidget-PT917BA0-ec85efca8ebf5a868be1.js → LimitscolumnWidget-ufFMz6R--c471ef82b3a96efbb076.js} +1 -1
- data/tools/dataextractor/{LinegraphWidget-BW7kS_6G-5ff2b791254cc5b7db2a.js → LinegraphWidget-BC2wVOny-7d86e1f9b9bee5c66333.js} +1 -1
- data/tools/dataextractor/{MatrixbycolumnsWidget-BGNsZvjv-896c0c73f296fc47bc2b.js → MatrixbycolumnsWidget-DfUAeBnO-b55624295093260752b3.js} +1 -1
- data/tools/dataextractor/{OpenC3TimePicker-CkaALgy9-f3da4082559cd932f4f8.js → OpenC3TimePicker-DpkbfbgC-b9b15927c58cff1786d9.js} +1 -1
- data/tools/dataextractor/{ProgressbarWidget-Cy_ad8mb-1df695c5267162e765d7.js → ProgressbarWidget-D3ndYnq_-3586c760d2e8861c4010.js} +1 -1
- data/tools/dataextractor/{RadiobuttonWidget-aJBIz45y-801a2c33babce797526f.js → RadiobuttonWidget-CP0S9nWW-7982529538978f6d02c1.js} +1 -1
- data/tools/dataextractor/{RadiogroupWidget-DNRlJnPE-a36bed855246f97bd481.js → RadiogroupWidget-BXHfA21T-dd31b0768cdf93c1cabc.js} +1 -1
- data/tools/dataextractor/{RangebarWidget-h4YItqPF-280ea4eef24736bdbb85.js → RangebarWidget-Bv2DqkPo-ec5662b730343afaa28e.js} +1 -1
- data/tools/dataextractor/{RollupWidget-CnxDQRQ0-6358e8358a580c5921d0.js → RollupWidget-o_huYU0x-8a7a96915fa5538ce930.js} +1 -1
- data/tools/dataextractor/{ScrollwindowWidget-DFkTJ2Ue-cb731315321666ce3bce.js → ScrollwindowWidget-DdjaML6D-b4480561f3da8583459b.js} +1 -1
- data/tools/dataextractor/{SignalWidget-jYpXSIfD-c768dd15f02c955f8b39.js → SignalWidget-Dd54y28I-ad29f9a3ddb39bc8e712.js} +1 -1
- data/tools/dataextractor/SpacerWidget-GPFYtIG1-9dd77eb1e2a7304cf299.js +1 -0
- data/tools/dataextractor/{SparklineWidget-CVf1TtjV-1fe0a1f3a17091ff0b62.js → SparklineWidget-f11nrlLS-92deda7a9b6298571159.js} +1 -1
- data/tools/dataextractor/TabbookWidget-DeaC27yC-a92ec7a904c37d283bab.js +1 -0
- data/tools/dataextractor/{TargetPacketItemChooser-CS2Vvi2U-33c8290f414a2fa4a3d2.js → TargetPacketItemChooser-BoBqvs3T-341c7c9e84a220b1a0d3.js} +1 -1
- data/tools/dataextractor/{TextboxWidget-B0Y1W7GP-1bcbf7550300c331597a.js → TextboxWidget-tL41zWUX-75750425b2582c87e1a4.js} +1 -1
- data/tools/dataextractor/TextfieldWidget-D1qj14Qi-0858b199ec7f9902291c.js +1 -0
- data/tools/dataextractor/TimeWidget-CSVGNong-12f265007f01523c523a.js +1 -0
- data/tools/dataextractor/TitleWidget-CLx-tuYT-e469f1843cd091fea225.js +1 -0
- data/tools/dataextractor/{VWidget-0KwtSssI-de3422ba8381ba405cbe.js → VWidget-CxnaMF0w-a4302069e065dead5397.js} +1 -1
- data/tools/dataextractor/ValueWidget-BYgpXfDo-9f7bb34efd4d22fd774e.js +1 -0
- data/tools/dataextractor/ValuelimitsbarWidget-Dc9-VNZ3-42880e7e026ad3e9e259.js +1 -0
- data/tools/dataextractor/ValuelimitscolumnWidget-b7W8K3mR-c331b0200587603b6c9e.js +1 -0
- data/tools/dataextractor/ValuerangebarWidget-DmhczZQb-c8c6852c06a1fb11c936.js +1 -0
- data/tools/dataextractor/{VerticalWidget-0UbbE2g3-adcb27032c4f6fa2fbfe.js → VerticalWidget-BvsVh0Ob-32ffa67d963ba10b5185.js} +1 -1
- data/tools/dataextractor/VerticalboxWidget-ClTCDCQN-b36d02475eee09ac8fa2.js +1 -0
- data/tools/dataextractor/{Widget-CGePksBA-7989ab8fd0278679400c.js → Widget-DRhVdCLP-3d6dd25fe49a64f4c89c.js} +1 -1
- data/tools/dataextractor/main-7641c12765b47b03f01d.js +1490 -0
- data/tools/dataextractor/main.js +1 -1
- metadata +73 -73
- data/tools/dataextractor/ArrayWidget-D2UrA5Db-1c55b514e63b95e490f6.js +0 -2
- data/tools/dataextractor/BlockWidget-C-WB0Q2m-e1a936c86d9896422505.js +0 -2
- data/tools/dataextractor/CanvasdotWidget-B42YizA1-890ec798f4b45d558907.js +0 -1
- data/tools/dataextractor/CanvaslineWidget-DaHxgGyM-4b7e326afc628efa9af7.js +0 -1
- data/tools/dataextractor/CheckbuttonWidget-BK4SgIu7-773142e6557fb0f58a78.js +0 -1
- data/tools/dataextractor/Graph-BTtGIbYG-52d7fea4217161d294a4.js +0 -1
- data/tools/dataextractor/HorizontalboxWidget-CL1xEhDj-2dd7af897f322c232db4.js +0 -1
- data/tools/dataextractor/HorizontallineWidget-DPiADCAy-d4be2847dc5bacd22c4c.js +0 -1
- data/tools/dataextractor/LabelledWidget-Dt9miRtB-bb76d04fcf2b737b5427.js +0 -1
- data/tools/dataextractor/LabelsparklineWidget-BByxev6X-4dad3009fa3f0d9431c1.js +0 -1
- data/tools/dataextractor/LabelvalueWidget-BM6L9bVw-59a90e09c9e467c44e76.js +0 -1
- data/tools/dataextractor/LabelvaluelimitsbarWidget-CqV0-c3G-51ce8510c0eaa914f0b3.js +0 -1
- data/tools/dataextractor/LabelvaluelimitscolumnWidget-Bz0PKTIV-62a95b407e98ab69b8f0.js +0 -1
- data/tools/dataextractor/LabelvaluerangebarWidget-DKuAJHLm-4d25d7a8a2989a7f9778.js +0 -1
- data/tools/dataextractor/SpacerWidget-CUqvml6o-de2112756e057c724689.js +0 -1
- data/tools/dataextractor/TabbookWidget-CTUEpDnn-c73cbfe51c07bb486d65.js +0 -1
- data/tools/dataextractor/TextfieldWidget-B8TAf9oU-2216d2290bef09e3d7ef.js +0 -1
- data/tools/dataextractor/TimeWidget-DewVXks0-da9657b4ea49f337b77c.js +0 -1
- data/tools/dataextractor/TitleWidget-BAq2LGJF-ae630acb77cf4c766ebc.js +0 -1
- data/tools/dataextractor/ValueWidget-BGNqaaRs-7f8ecf0b5a905c91d823.js +0 -1
- data/tools/dataextractor/ValuelimitsbarWidget-B6mH4PdF-4a0a3408f6142f31fece.js +0 -1
- data/tools/dataextractor/ValuelimitscolumnWidget-DlX90_-6-6ab61b02182d88318289.js +0 -1
- data/tools/dataextractor/ValuerangebarWidget-C9xyLOJO-a10f1bcce7dea09a14bb.js +0 -1
- data/tools/dataextractor/VerticalboxWidget-efbeOAKE-7cafb64c5c613da26835.js +0 -1
- data/tools/dataextractor/main-92b16557aa3a51ee770f.js +0 -1490
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
System.register(["./main-
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(x);const Is={__name:"TopBarMenu",props:{menu:{type:Object,required:!0},title:{type:String,required:!0}},emits:["submenu-click"],setup(t,{emit:e}){const s=e,n=vt(!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"),w=C("v-list-item"),h=C("v-list"),m=C("v-menu"),p=C("v-radio"),E=C("v-list-item-action"),T=C("v-radio-group"),O=C("v-checkbox");return N(),U(m,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=y=>n.value=y),"close-on-content-click":!1},{activator:g(({props:y})=>[f(u,Be(y,{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]=[L(" mdi-menu-down ",-1)])]),_:1})]),_:1},16,["text","data-test"])]),default:g(()=>[f(h,null,{default:g(()=>[(N(!0),te(ae,null,he(t.menu.items,(y,R)=>(N(),te(ae,null,[y.divider?(N(),U(d,{key:R+"-divider"})):y.subMenu&&y.subMenu.length>0?(N(),te("div",{key:R+"-submenu"},[(N(),U(m,{key:R,"open-on-hover":"",location:"right"},{activator:g(({props:A})=>[(N(),U(w,Be({ref_for:!0},A,{key:R,disabled:y.disabled}),$e({append:g(()=>[f(c,null,{default:g(()=>[...a[2]||(a[2]=[L(" mdi-chevron-right ",-1)])]),_:1})]),default:g(()=>[!y.radio&&!y.checkbox?(N(),U(b,{key:0,style:He("cursor: pointer;"+(y.disabled?"opacity: 0.2":""))},{default:g(()=>[L(X(y.label),1)]),_:2},1032,["style"])):ce("",!0)]),_:2},[y.icon?{name:"prepend",fn:g(()=>[f(c,{disabled:y.disabled},{default:g(()=>[L(X(y.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:g(()=>[f(h,null,{default:g(()=>[(N(!0),te(ae,null,he(y.subMenu,(A,B)=>(N(),U(w,{key:B,"prepend-icon":A.icon,onClick:j=>s("submenu-click",A)},{default:g(()=>[f(b,null,{default:g(()=>[L(X(A.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):y.radioGroup?(N(),U(T,{key:R+"-radio-group",class:"ma-0 pa-0",density:"compact","hide-details":"","model-value":y.value,"onUpdate:modelValue":y.command},{default:g(()=>[(N(!0),te(ae,null,he(y.choices,(A,B)=>(N(),U(w,{key:B+"-choice"},{default:g(()=>[f(E,{class:"list-action"},{default:g(()=>[f(p,{color:"secondary",label:A.label,value:A.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(N(),U(w,{key:R+"-list",disabled:y.disabled,"data-test":o(`${t.title} ${t.menu.label} ${y.label}`),onClick:()=>{y.command(y),y.checkbox||r()}},$e({default:g(()=>[y.checkbox?(N(),U(E,{key:0,class:"list-action"},{default:g(()=>[f(O,{modelValue:y.checked,"onUpdate:modelValue":A=>y.checked=A,label:y.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):ce("",!0),!y.radio&&!y.checkbox?(N(),U(b,{key:1,style:He("cursor: pointer;"+(y.disabled?"opacity: 0.2":""))},{default:g(()=>[L(X(y.label),1)]),_:2},1032,["style"])):ce("",!0)]),_:2},[y.icon?{name:"prepend",fn:g(()=>[f(c,{icon:y.icon,disabled:y.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["disabled","data-test","onClick"]))],64))),256))]),_:1})]),_:1},8,["modelValue"])}}},js={components:{TopBarMenu:Is},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}}},Us={class:"app-title mr-2"};function Ms(t,e,s,n,r,o){const i=C("v-col"),a=C("v-row"),c=C("TopBarMenu");return N(),U(wt,{to:"#openc3-menu"},[f(a,{"no-gutters":""},{default:g(()=>[f(i,{"align-self":"end"},{default:g(()=>[Se("span",Us,X(s.title),1)]),_:1})]),_:1}),f(a,{dense:"",class:"flex-nowrap"},{default:g(()=>[(N(!0),te(ae,null,he(s.menus,(u,d)=>(N(),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 Ls=pt(js,[["render",Ms],["__scopeId","data-v-f4fb184e"]]);function Ct(t,e){return function(){return t.apply(e,arguments)}}const{toString:Fs}=Object.prototype,{getPrototypeOf:Je}=Object,{iterator:Te,toStringTag:Ot}=Symbol,Ce=(t=>e=>{const s=Fs.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Z=t=>(t=t.toLowerCase(),e=>Ce(e)===t),Oe=t=>e=>typeof e===t,{isArray:le}=Array,ue=Oe("undefined");function fe(t){return t!==null&&!ue(t)&&t.constructor!==null&&!ue(t.constructor)&&V(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const xt=Z("ArrayBuffer");function Vs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&xt(t.buffer),e}const qs=Oe("string"),V=Oe("function"),Rt=Oe("number"),pe=t=>t!==null&&typeof t=="object",Bs=t=>t===!0||t===!1,xe=t=>{if(Ce(t)!=="object")return!1;const e=Je(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Ot in t)&&!(Te in t)},$s=t=>{if(!pe(t)||fe(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Hs=Z("Date"),zs=Z("File"),Js=t=>!!(t&&typeof t.uri<"u"),Ws=t=>t&&typeof t.getParts<"u",Ks=Z("Blob"),Zs=Z("FileList"),Gs=t=>pe(t)&&V(t.pipe);function Xs(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const kt=Xs(),At=typeof kt.FormData<"u"?kt.FormData:void 0,Qs=t=>{let e;return t&&(At&&t instanceof At||V(t.append)&&((e=Ce(t))==="formdata"||e==="object"&&V(t.toString)&&t.toString()==="[object FormData]"))},Ys=Z("URLSearchParams"),[en,tn,sn,nn]=["ReadableStream","Request","Response","Headers"].map(Z),rn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function me(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(fe(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 Pt(t,e){if(fe(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,Dt=t=>!ue(t)&&t!==se;function We(){const{caseless:t,skipUndefined:e}=Dt(this)&&this||{},s={},n=(r,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const i=t&&Pt(s,o)||o;xe(s[i])&&xe(r)?s[i]=We(s[i],r):xe(r)?s[i]=We({},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]&&me(arguments[r],n);return s}const on=(t,e,s,{allOwnKeys:n}={})=>(me(e,(r,o)=>{s&&V(r)?Object.defineProperty(t,o,{value:Ct(r,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),an=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),cn=(t,e,s,n)=>{t.prototype=Object.create(e.prototype,n),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},ln=(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},un=(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},dn=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},hn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Je(Uint8Array)),fn=(t,e)=>{const s=(t&&t[Te]).call(t);let n;for(;(n=s.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},pn=(t,e)=>{let s;const n=[];for(;(s=t.exec(e))!==null;)n.push(s);return n},mn=Z("HTMLFormElement"),gn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),Nt=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),bn=Z("RegExp"),It=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),n={};me(s,(r,o)=>{let i;(i=e(r,o,t))!==!1&&(n[o]=i||r)}),Object.defineProperties(t,n)},_n=t=>{It(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+"'")})}})},yn=(t,e)=>{const s={},n=r=>{r.forEach(o=>{s[o]=!0})};return le(t)?n(t):n(String(t).split(e)),s},wn=()=>{},vn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function En(t){return!!(t&&V(t.append)&&t[Ot]==="FormData"&&t[Te])}const Sn=t=>{const e=new Array(10),s=(n,r)=>{if(pe(n)){if(e.indexOf(n)>=0)return;if(fe(n))return n;if(!("toJSON"in n)){e[r]=n;const o=le(n)?[]:{};return me(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)},Tn=Z("AsyncFunction"),Cn=t=>t&&(pe(t)||V(t))&&V(t.then)&&V(t.catch),jt=((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)),On=typeof queueMicrotask<"u"?queueMicrotask.bind(se):typeof process<"u"&&process.nextTick||jt,xn=t=>t!=null&&V(t[Te]),l={isArray:le,isArrayBuffer:xt,isBuffer:fe,isFormData:Qs,isArrayBufferView:Vs,isString:qs,isNumber:Rt,isBoolean:Bs,isObject:pe,isPlainObject:xe,isEmptyObject:$s,isReadableStream:en,isRequest:tn,isResponse:sn,isHeaders:nn,isUndefined:ue,isDate:Hs,isFile:zs,isReactNativeBlob:Js,isReactNative:Ws,isBlob:Ks,isRegExp:bn,isFunction:V,isStream:Gs,isURLSearchParams:Ys,isTypedArray:hn,isFileList:Zs,forEach:me,merge:We,extend:on,trim:rn,stripBOM:an,inherits:cn,toFlatObject:ln,kindOf:Ce,kindOfTest:Z,endsWith:un,toArray:dn,forEachEntry:fn,matchAll:pn,isHTMLForm:mn,hasOwnProperty:Nt,hasOwnProp:Nt,reduceDescriptors:It,freezeMethods:_n,toObjectSet:yn,toCamelCase:gn,noop:wn,toFiniteNumber:vn,findKey:Pt,global:se,isContextDefined:Dt,isSpecCompliantForm:En,toJSONObject:Sn,isAsyncFn:Tn,isThenable:Cn,setImmediate:jt,asap:On,isIterable:xn};let v=class Ps extends Error{static from(e,s,n,r,o,i){const a=new Ps(e.message,s||e.code,n,r,o);return a.cause=e,a.name=e.name,e.status!=null&&a.status==null&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,s,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){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}}};v.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",v.ERR_BAD_OPTION="ERR_BAD_OPTION",v.ECONNABORTED="ECONNABORTED",v.ETIMEDOUT="ETIMEDOUT",v.ERR_NETWORK="ERR_NETWORK",v.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",v.ERR_DEPRECATED="ERR_DEPRECATED",v.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",v.ERR_BAD_REQUEST="ERR_BAD_REQUEST",v.ERR_CANCELED="ERR_CANCELED",v.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",v.ERR_INVALID_URL="ERR_INVALID_URL";const Rn=null;function Ke(t){return l.isPlainObject(t)||l.isArray(t)}function Ut(t){return l.endsWith(t,"[]")?t.slice(0,-2):t}function Ze(t,e,s){return t?t.concat(e).map(function(n,r){return n=Ut(n),!s&&r?"["+n+"]":n}).join(s?".":""):e}function kn(t){return l.isArray(t)&&!t.some(Ke)}const An=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(h,m){return!l.isUndefined(m[h])});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(h){if(h===null)return"";if(l.isDate(h))return h.toISOString();if(l.isBoolean(h))return h.toString();if(!a&&l.isBlob(h))throw new v("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(h)||l.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,p){let E=h;if(l.isReactNative(e)&&l.isReactNativeBlob(h))return e.append(Ze(p,m,o),c(h)),!1;if(h&&!p&&typeof h=="object"){if(l.endsWith(m,"{}"))m=n?m:m.slice(0,-2),h=JSON.stringify(h);else if(l.isArray(h)&&kn(h)||(l.isFileList(h)||l.endsWith(m,"[]"))&&(E=l.toArray(h)))return m=Ut(m),E.forEach(function(T,O){!(l.isUndefined(T)||T===null)&&e.append(i===!0?Ze([m],O,o):i===null?m:m+"[]",c(T))}),!1}return Ke(h)?!0:(e.append(Ze(p,m,o),c(h)),!1)}const d=[],b=Object.assign(An,{defaultVisitor:u,convertValue:c,isVisitable:Ke});function w(h,m){if(!l.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),l.forEach(h,function(p,E){(!(l.isUndefined(p)||p===null)&&r.call(e,p,l.isString(E)?E.trim():E,m,b))===!0&&w(p,m?m.concat(E):[E])}),d.pop()}}if(!l.isObject(t))throw new TypeError("data must be an object");return w(t),e}function Mt(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 Lt=Ge.prototype;Lt.append=function(t,e){this._pairs.push([t,e])},Lt.toString=function(t){const e=t?function(s){return t.call(this,s,Mt)}:Mt;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function Pn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ft(t,e,s){if(!e)return t;const n=s&&s.encode||Pn,r=l.isFunction(s)?{serialize:s}:s,o=r&&r.serialize;let i;if(o?i=o(e,r):i=l.isURLSearchParams(e)?e.toString():new Ge(e,r).toString(n),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Vt{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 Xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Dn=typeof URLSearchParams<"u"?URLSearchParams:Ge,Nn=typeof FormData<"u"?FormData:null,In=typeof Blob<"u"?Blob:null,jn={isBrowser:!0,classes:{URLSearchParams:Dn,FormData:Nn,Blob:In},protocols:["http","https","file","blob","url","data"]},Qe=typeof window<"u"&&typeof document<"u",Ye=typeof navigator=="object"&&navigator||void 0,Un=Qe&&(!Ye||["ReactNative","NativeScript","NS"].indexOf(Ye.product)<0),Mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ln=Qe&&window.location.href||"http://localhost",Fn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Qe,hasStandardBrowserEnv:Un,hasStandardBrowserWebWorkerEnv:Mn,navigator:Ye,origin:Ln},Symbol.toStringTag,{value:"Module"})),M={...Fn,...jn};function Vn(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 qn(t){return l.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Bn(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 qt(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]=Bn(r[i])),!a)}if(l.isFormData(t)&&l.isFunction(t.entries)){const s={};return l.forEachEntry(t,(n,r)=>{e(qn(n),r,s,0)}),s}return null}function $n(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 ge={transitional:Xe,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(qt(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 Vn(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),$n(t)):t}],transformResponse:[function(t){const e=this.transitional||ge.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"?v.from(o,v.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=>{ge.headers[t]={}});const Hn=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"]),zn=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]&&Hn[s])&&(s==="set-cookie"?e[s]?e[s].push(n):e[s]=[n]:e[s]=e[s]?e[s]+", "+n:n)}),e},Bt=Symbol("internals");function be(t){return t&&String(t).trim().toLowerCase()}function ke(t){return t===!1||t==null?t:l.isArray(t)?t.map(ke):String(t)}function Jn(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 Wn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function et(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 Kn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,n)=>s.toUpperCase()+n)}function Zn(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=be(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]=ke(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())&&!Wn(t))o(zn(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=be(t),t){const s=l.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Jn(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=be(t),t){const s=l.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||et(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(o){if(o=be(o),o){const i=l.findKey(s,o);i&&(!e||et(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||et(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]=ke(n),delete e[r];return}const i=t?Kn(r):String(r).trim();i!==r&&delete e[r],e[i]=ke(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[Bt]=this[Bt]={accessors:{}}).accessors,s=this.prototype;function n(r){const o=be(r);e[o]||(Zn(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 tt(t,e){const s=this||ge,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 $t(t){return!!(t&&t.__CANCEL__)}let _e=class extends v{constructor(t,e,s){super(t??"canceled",v.ERR_CANCELED,e,s),this.name="CanceledError",this.__CANCEL__=!0}};function Ht(t,e,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):e(new v("Request failed with status code "+s.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Gn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Xn(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 w=u&&c-u;return w?Math.round(b*1e3/w):void 0}}function Qn(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 Ae=(t,e,s=3)=>{let n=0;const r=Xn(50,250);return Qn(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)},zt=(t,e)=>{const s=t!=null;return[n=>e[0]({lengthComputable:s,total:t,loaded:n}),e[1]]},Jt=t=>(...e)=>l.asap(()=>t(...e)),Yn=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,er=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 tr(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function sr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Wt(t,e,s){let n=!tr(e);return t&&(n||s==!1)?sr(t,e):e}const Kt=t=>t instanceof q?{...t}:t;function ne(t,e){e=e||{};const s={};function n(u,d,b,w){return l.isPlainObject(u)&&l.isPlainObject(d)?l.merge.call({caseless:w},u,d):l.isPlainObject(d)?l.merge({},d):l.isArray(d)?d.slice():d}function r(u,d,b,w){if(l.isUndefined(d)){if(!l.isUndefined(u))return n(void 0,u,b,w)}else return n(u,d,b,w)}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(Kt(u),Kt(d),b,!0)};return l.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=l.hasOwnProp(c,u)?c[u]:r,b=d(t[u],e[u],u);l.isUndefined(b)&&d!==a||(s[u]=b)}),s}const Zt=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=Ft(Wt(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&&Yn(e.url))){const c=r&&o&&er.read(o);c&&i.set(r,c)}return e},nr=typeof XMLHttpRequest<"u",rr=nr&&function(t){return new Promise(function(e,s){const n=Zt(t);let r=n.data;const o=q.from(n.headers).normalize();let{responseType:i,onUploadProgress:a,onDownloadProgress:c}=n,u,d,b,w,h;function m(){w&&w(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout;function E(){if(!p)return;const O=q.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),y={data:!i||i==="text"||i==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:O,config:t,request:p};Ht(function(R){e(R),m()},function(R){s(R),m()},y),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(s(new v("Request aborted",v.ECONNABORTED,t,p)),p=null)},p.onerror=function(O){const y=O&&O.message?O.message:"Network Error",R=new v(y,v.ERR_NETWORK,t,p);R.event=O||null,s(R),p=null},p.ontimeout=function(){let O=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const y=n.transitional||Xe;n.timeoutErrorMessage&&(O=n.timeoutErrorMessage),s(new v(O,y.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},r===void 0&&o.setContentType(null),"setRequestHeader"in p&&l.forEach(o.toJSON(),function(O,y){p.setRequestHeader(y,O)}),l.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),i&&i!=="json"&&(p.responseType=n.responseType),c&&([b,h]=Ae(c,!0),p.addEventListener("progress",b)),a&&p.upload&&([d,w]=Ae(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",w)),(n.cancelToken||n.signal)&&(u=O=>{p&&(s(!O||O.type?new _e(null,t,p):O),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const T=Gn(n.url);if(T&&M.protocols.indexOf(T)===-1){s(new v("Unsupported protocol "+T+":",v.ERR_BAD_REQUEST,t));return}p.send(r||null)})},ir=(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 v?d:new _e(d instanceof Error?d.message:d))}};let i=e&&setTimeout(()=>{i=null,o(new v(`timeout of ${e}ms exceeded`,v.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}},or=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},ar=async function*(t,e){for await(const s of cr(t))yield*or(s,e)},cr=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()}},Gt=(t,e,s,n)=>{const r=ar(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 w=o+=b;s(w)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},Xt=64*1024,{isFunction:Pe}=l,lr=(({Request:t,Response:e})=>({Request:t,Response:e}))(l.global),{ReadableStream:Qt,TextEncoder:Yt}=l.global,es=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ur=t=>{t=l.merge.call({skipUndefined:!0},lr,t);const{fetch:e,Request:s,Response:n}=t,r=e?Pe(e):typeof fetch=="function",o=Pe(s),i=Pe(n);if(!r)return!1;const a=r&&Pe(Qt),c=r&&(typeof Yt=="function"?(m=>p=>m.encode(p))(new Yt):async m=>new Uint8Array(await new s(m).arrayBuffer())),u=o&&a&&es(()=>{let m=!1;const p=new s(M.origin,{body:new Qt,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!p}),d=i&&a&&es(()=>l.isReadableStream(new n("").body)),b={stream:d&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!b[m]&&(b[m]=(p,E)=>{let T=p&&p[m];if(T)return T.call(p);throw new v(`Response type '${m}' is not supported`,v.ERR_NOT_SUPPORT,E)})});const w=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},h=async(m,p)=>l.toFiniteNumber(m.getContentLength())??w(p);return async m=>{let{url:p,method:E,data:T,signal:O,cancelToken:y,timeout:R,onDownloadProgress:A,onUploadProgress:B,responseType:j,headers:W,withCredentials:F="same-origin",fetchOptions:Q}=Zt(m),$=e||fetch;j=j?(j+"").toLowerCase():"text";let _=ir([O,y&&y.toAbortSignal()],R),P=null;const H=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let Ve;try{if(B&&u&&E!=="get"&&E!=="head"&&(Ve=await h(W,T))!==0){let z=new s(p,{method:"POST",body:T,duplex:"half"}),ee;if(l.isFormData(T)&&(ee=z.headers.get("content-type"))&&W.setContentType(ee),z.body){const[ft,qe]=zt(Ve,Ae(Jt(B)));T=Gt(z.body,Xt,ft,qe)}}l.isString(F)||(F=F?"include":"omit");const D=o&&"credentials"in s.prototype,S={...Q,signal:_,method:E.toUpperCase(),headers:W.normalize().toJSON(),body:T,duplex:"half",credentials:D?F:void 0};P=o&&new s(p,S);let k=await(o?$(P,Q):$(p,S));const K=d&&(j==="stream"||j==="response");if(d&&(A||K&&H)){const z={};["status","statusText","headers"].forEach(As=>{z[As]=k[As]});const ee=l.toFiniteNumber(k.headers.get("content-length")),[ft,qe]=A&&zt(ee,Ae(Jt(A),!0))||[];k=new n(Gt(k.body,Xt,ft,()=>{qe&&qe(),H&&H()}),z)}j=j||"text";let Y=await b[l.findKey(b,j)||"text"](k,m);return!K&&H&&H(),await new Promise((z,ee)=>{Ht(z,ee,{data:Y,headers:q.from(k.headers),status:k.status,statusText:k.statusText,config:m,request:P})})}catch(D){throw H&&H(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,m,P,D&&D.response),{cause:D.cause||D}):v.from(D,D&&D.code,m,P,D&&D.response)}}},dr=new Map,ts=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=dr;for(;a--;)c=o[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:ur(e)),d=u;return u};ts();const st={http:Rn,xhr:rr,fetch:{get:ts}};l.forEach(st,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ss=t=>`- ${t}`,hr=t=>l.isFunction(t)||t===null||t===!1;function fr(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,!hr(n)&&(r=st[(a=String(n)).toLowerCase()],r===void 0))throw new v(`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 :
|
|
1
|
+
System.register(["./main-7641c12765b47b03f01d.js","vue","./TargetPacketItemChooser-BoBqvs3T-341c7c9e84a220b1a0d3.js","./OpenC3TimePicker-DpkbfbgC-b9b15927c58cff1786d9.js","vue-router","pinia","single-spa","vuetify"],(function(Ns,Ii){"use strict";var pt,mt,gt,bt,_t,yt,C,N,U,wt,f,g,Se,X,te,ae,he,vt,L,Be,$e,He,ce,Et,ze,St,Tt;return{setters:[x=>{pt=x.d,mt=x._,gt=x.k,bt=x.R,_t=x.M,yt=x.I},x=>{C=x.resolveComponent,N=x.openBlock,U=x.createBlock,wt=x.Teleport,f=x.createVNode,g=x.withCtx,Se=x.createElementVNode,X=x.toDisplayString,te=x.createElementBlock,ae=x.Fragment,he=x.renderList,vt=x.ref,L=x.createTextVNode,Be=x.mergeProps,$e=x.createSlots,He=x.normalizeStyle,ce=x.createCommentVNode,Et=x.withModifiers,ze=x.withKeys},x=>{St=x.C},x=>{Tt=x.M},null,null,null,null],execute:(function(){var x=document.createElement("style");x.textContent=`.title-font[data-v-d21cc656]{font-size:1.125rem}.v-progress-linear__determinate[data-v-d21cc656]{transition:none!important}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(x);const Is={__name:"TopBarMenu",props:{menu:{type:Object,required:!0},title:{type:String,required:!0}},emits:["submenu-click"],setup(t,{emit:e}){const s=e,n=vt(!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"),w=C("v-list-item"),h=C("v-list"),m=C("v-menu"),p=C("v-radio"),v=C("v-list-item-action"),T=C("v-radio-group"),O=C("v-checkbox");return N(),U(m,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=y=>n.value=y),"close-on-content-click":!1},{activator:g(({props:y})=>[f(u,Be(y,{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]=[L(" mdi-menu-down ",-1)])]),_:1})]),_:1},16,["text","data-test"])]),default:g(()=>[f(h,null,{default:g(()=>[(N(!0),te(ae,null,he(t.menu.items,(y,R)=>(N(),te(ae,null,[y.divider?(N(),U(d,{key:R+"-divider"})):y.subMenu&&y.subMenu.length>0?(N(),te("div",{key:R+"-submenu"},[(N(),U(m,{key:R,"open-on-hover":"",location:"right"},{activator:g(({props:A})=>[(N(),U(w,Be({ref_for:!0},A,{key:R,disabled:y.disabled}),$e({append:g(()=>[f(c,null,{default:g(()=>[...a[2]||(a[2]=[L(" mdi-chevron-right ",-1)])]),_:1})]),default:g(()=>[!y.radio&&!y.checkbox?(N(),U(b,{key:0,style:He("cursor: pointer;"+(y.disabled?"opacity: 0.2":""))},{default:g(()=>[L(X(y.label),1)]),_:2},1032,["style"])):ce("",!0)]),_:2},[y.icon?{name:"prepend",fn:g(()=>[f(c,{disabled:y.disabled},{default:g(()=>[L(X(y.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:g(()=>[f(h,null,{default:g(()=>[(N(!0),te(ae,null,he(y.subMenu,(A,B)=>(N(),U(w,{key:B,"prepend-icon":A.icon,onClick:j=>s("submenu-click",A)},{default:g(()=>[f(b,null,{default:g(()=>[L(X(A.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):y.radioGroup?(N(),U(T,{key:R+"-radio-group",class:"ma-0 pa-0",density:"compact","hide-details":"","model-value":y.value,"onUpdate:modelValue":y.command},{default:g(()=>[(N(!0),te(ae,null,he(y.choices,(A,B)=>(N(),U(w,{key:B+"-choice"},{default:g(()=>[f(v,{class:"list-action"},{default:g(()=>[f(p,{color:"secondary",label:A.label,value:A.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(N(),U(w,{key:R+"-list",disabled:y.disabled,"data-test":o(`${t.title} ${t.menu.label} ${y.label}`),onClick:()=>{y.command(y),y.checkbox||r()}},$e({default:g(()=>[y.checkbox?(N(),U(v,{key:0,class:"list-action"},{default:g(()=>[f(O,{modelValue:y.checked,"onUpdate:modelValue":A=>y.checked=A,label:y.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):ce("",!0),!y.radio&&!y.checkbox?(N(),U(b,{key:1,style:He("cursor: pointer;"+(y.disabled?"opacity: 0.2":""))},{default:g(()=>[L(X(y.label),1)]),_:2},1032,["style"])):ce("",!0)]),_:2},[y.icon?{name:"prepend",fn:g(()=>[f(c,{icon:y.icon,disabled:y.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["disabled","data-test","onClick"]))],64))),256))]),_:1})]),_:1},8,["modelValue"])}}},js={components:{TopBarMenu:Is},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}}},Us={class:"app-title mr-2"};function Ms(t,e,s,n,r,o){const i=C("v-col"),a=C("v-row"),c=C("TopBarMenu");return N(),U(wt,{to:"#openc3-menu"},[f(a,{"no-gutters":""},{default:g(()=>[f(i,{"align-self":"end"},{default:g(()=>[Se("span",Us,X(s.title),1)]),_:1})]),_:1}),f(a,{dense:"",class:"flex-nowrap"},{default:g(()=>[(N(!0),te(ae,null,he(s.menus,(u,d)=>(N(),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 Ls=pt(js,[["render",Ms],["__scopeId","data-v-f4fb184e"]]);function Ct(t,e){return function(){return t.apply(e,arguments)}}const{toString:Fs}=Object.prototype,{getPrototypeOf:Je}=Object,{iterator:Te,toStringTag:Ot}=Symbol,Ce=(t=>e=>{const s=Fs.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),Z=t=>(t=t.toLowerCase(),e=>Ce(e)===t),Oe=t=>e=>typeof e===t,{isArray:le}=Array,ue=Oe("undefined");function fe(t){return t!==null&&!ue(t)&&t.constructor!==null&&!ue(t.constructor)&&V(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const xt=Z("ArrayBuffer");function Vs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&xt(t.buffer),e}const qs=Oe("string"),V=Oe("function"),Rt=Oe("number"),pe=t=>t!==null&&typeof t=="object",Bs=t=>t===!0||t===!1,xe=t=>{if(Ce(t)!=="object")return!1;const e=Je(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Ot in t)&&!(Te in t)},$s=t=>{if(!pe(t)||fe(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Hs=Z("Date"),zs=Z("File"),Js=t=>!!(t&&typeof t.uri<"u"),Ws=t=>t&&typeof t.getParts<"u",Ks=Z("Blob"),Zs=Z("FileList"),Gs=t=>pe(t)&&V(t.pipe);function Xs(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const kt=Xs(),At=typeof kt.FormData<"u"?kt.FormData:void 0,Qs=t=>{let e;return t&&(At&&t instanceof At||V(t.append)&&((e=Ce(t))==="formdata"||e==="object"&&V(t.toString)&&t.toString()==="[object FormData]"))},Ys=Z("URLSearchParams"),[en,tn,sn,nn]=["ReadableStream","Request","Response","Headers"].map(Z),rn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function me(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(fe(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 Pt(t,e){if(fe(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,Dt=t=>!ue(t)&&t!==se;function We(){const{caseless:t,skipUndefined:e}=Dt(this)&&this||{},s={},n=(r,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const i=t&&Pt(s,o)||o;xe(s[i])&&xe(r)?s[i]=We(s[i],r):xe(r)?s[i]=We({},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]&&me(arguments[r],n);return s}const on=(t,e,s,{allOwnKeys:n}={})=>(me(e,(r,o)=>{s&&V(r)?Object.defineProperty(t,o,{value:Ct(r,s),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),an=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),cn=(t,e,s,n)=>{t.prototype=Object.create(e.prototype,n),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},ln=(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},un=(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},dn=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},hn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Je(Uint8Array)),fn=(t,e)=>{const s=(t&&t[Te]).call(t);let n;for(;(n=s.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},pn=(t,e)=>{let s;const n=[];for(;(s=t.exec(e))!==null;)n.push(s);return n},mn=Z("HTMLFormElement"),gn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),Nt=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),bn=Z("RegExp"),It=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),n={};me(s,(r,o)=>{let i;(i=e(r,o,t))!==!1&&(n[o]=i||r)}),Object.defineProperties(t,n)},_n=t=>{It(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+"'")})}})},yn=(t,e)=>{const s={},n=r=>{r.forEach(o=>{s[o]=!0})};return le(t)?n(t):n(String(t).split(e)),s},wn=()=>{},vn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function En(t){return!!(t&&V(t.append)&&t[Ot]==="FormData"&&t[Te])}const Sn=t=>{const e=new Array(10),s=(n,r)=>{if(pe(n)){if(e.indexOf(n)>=0)return;if(fe(n))return n;if(!("toJSON"in n)){e[r]=n;const o=le(n)?[]:{};return me(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)},Tn=Z("AsyncFunction"),Cn=t=>t&&(pe(t)||V(t))&&V(t.then)&&V(t.catch),jt=((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)),On=typeof queueMicrotask<"u"?queueMicrotask.bind(se):typeof process<"u"&&process.nextTick||jt,xn=t=>t!=null&&V(t[Te]),l={isArray:le,isArrayBuffer:xt,isBuffer:fe,isFormData:Qs,isArrayBufferView:Vs,isString:qs,isNumber:Rt,isBoolean:Bs,isObject:pe,isPlainObject:xe,isEmptyObject:$s,isReadableStream:en,isRequest:tn,isResponse:sn,isHeaders:nn,isUndefined:ue,isDate:Hs,isFile:zs,isReactNativeBlob:Js,isReactNative:Ws,isBlob:Ks,isRegExp:bn,isFunction:V,isStream:Gs,isURLSearchParams:Ys,isTypedArray:hn,isFileList:Zs,forEach:me,merge:We,extend:on,trim:rn,stripBOM:an,inherits:cn,toFlatObject:ln,kindOf:Ce,kindOfTest:Z,endsWith:un,toArray:dn,forEachEntry:fn,matchAll:pn,isHTMLForm:mn,hasOwnProperty:Nt,hasOwnProp:Nt,reduceDescriptors:It,freezeMethods:_n,toObjectSet:yn,toCamelCase:gn,noop:wn,toFiniteNumber:vn,findKey:Pt,global:se,isContextDefined:Dt,isSpecCompliantForm:En,toJSONObject:Sn,isAsyncFn:Tn,isThenable:Cn,setImmediate:jt,asap:On,isIterable:xn};let E=class Ps extends Error{static from(e,s,n,r,o,i){const a=new Ps(e.message,s||e.code,n,r,o);return a.cause=e,a.name=e.name,e.status!=null&&a.status==null&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,s,n,r,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,s&&(this.code=s),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){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}}};E.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",E.ERR_BAD_OPTION="ERR_BAD_OPTION",E.ECONNABORTED="ECONNABORTED",E.ETIMEDOUT="ETIMEDOUT",E.ERR_NETWORK="ERR_NETWORK",E.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",E.ERR_DEPRECATED="ERR_DEPRECATED",E.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",E.ERR_BAD_REQUEST="ERR_BAD_REQUEST",E.ERR_CANCELED="ERR_CANCELED",E.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",E.ERR_INVALID_URL="ERR_INVALID_URL";const Rn=null;function Ke(t){return l.isPlainObject(t)||l.isArray(t)}function Ut(t){return l.endsWith(t,"[]")?t.slice(0,-2):t}function Ze(t,e,s){return t?t.concat(e).map(function(n,r){return n=Ut(n),!s&&r?"["+n+"]":n}).join(s?".":""):e}function kn(t){return l.isArray(t)&&!t.some(Ke)}const An=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(h,m){return!l.isUndefined(m[h])});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(h){if(h===null)return"";if(l.isDate(h))return h.toISOString();if(l.isBoolean(h))return h.toString();if(!a&&l.isBlob(h))throw new E("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(h)||l.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,p){let v=h;if(l.isReactNative(e)&&l.isReactNativeBlob(h))return e.append(Ze(p,m,o),c(h)),!1;if(h&&!p&&typeof h=="object"){if(l.endsWith(m,"{}"))m=n?m:m.slice(0,-2),h=JSON.stringify(h);else if(l.isArray(h)&&kn(h)||(l.isFileList(h)||l.endsWith(m,"[]"))&&(v=l.toArray(h)))return m=Ut(m),v.forEach(function(T,O){!(l.isUndefined(T)||T===null)&&e.append(i===!0?Ze([m],O,o):i===null?m:m+"[]",c(T))}),!1}return Ke(h)?!0:(e.append(Ze(p,m,o),c(h)),!1)}const d=[],b=Object.assign(An,{defaultVisitor:u,convertValue:c,isVisitable:Ke});function w(h,m){if(!l.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),l.forEach(h,function(p,v){(!(l.isUndefined(p)||p===null)&&r.call(e,p,l.isString(v)?v.trim():v,m,b))===!0&&w(p,m?m.concat(v):[v])}),d.pop()}}if(!l.isObject(t))throw new TypeError("data must be an object");return w(t),e}function Mt(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 Lt=Ge.prototype;Lt.append=function(t,e){this._pairs.push([t,e])},Lt.toString=function(t){const e=t?function(s){return t.call(this,s,Mt)}:Mt;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function Pn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ft(t,e,s){if(!e)return t;const n=s&&s.encode||Pn,r=l.isFunction(s)?{serialize:s}:s,o=r&&r.serialize;let i;if(o?i=o(e,r):i=l.isURLSearchParams(e)?e.toString():new Ge(e,r).toString(n),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Vt{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 Xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Dn=typeof URLSearchParams<"u"?URLSearchParams:Ge,Nn=typeof FormData<"u"?FormData:null,In=typeof Blob<"u"?Blob:null,jn={isBrowser:!0,classes:{URLSearchParams:Dn,FormData:Nn,Blob:In},protocols:["http","https","file","blob","url","data"]},Qe=typeof window<"u"&&typeof document<"u",Ye=typeof navigator=="object"&&navigator||void 0,Un=Qe&&(!Ye||["ReactNative","NativeScript","NS"].indexOf(Ye.product)<0),Mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ln=Qe&&window.location.href||"http://localhost",Fn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Qe,hasStandardBrowserEnv:Un,hasStandardBrowserWebWorkerEnv:Mn,navigator:Ye,origin:Ln},Symbol.toStringTag,{value:"Module"})),M={...Fn,...jn};function Vn(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 qn(t){return l.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Bn(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 qt(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]=Bn(r[i])),!a)}if(l.isFormData(t)&&l.isFunction(t.entries)){const s={};return l.forEachEntry(t,(n,r)=>{e(qn(n),r,s,0)}),s}return null}function $n(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 ge={transitional:Xe,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(qt(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 Vn(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),$n(t)):t}],transformResponse:[function(t){const e=this.transitional||ge.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"?E.from(o,E.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=>{ge.headers[t]={}});const Hn=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"]),zn=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]&&Hn[s])&&(s==="set-cookie"?e[s]?e[s].push(n):e[s]=[n]:e[s]=e[s]?e[s]+", "+n:n)}),e},Bt=Symbol("internals");function be(t){return t&&String(t).trim().toLowerCase()}function ke(t){return t===!1||t==null?t:l.isArray(t)?t.map(ke):String(t).replace(/[\r\n]+$/,"")}function Jn(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 Wn=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function et(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 Kn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,n)=>s.toUpperCase()+n)}function Zn(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=be(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]=ke(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())&&!Wn(t))o(zn(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=be(t),t){const s=l.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Jn(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=be(t),t){const s=l.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||et(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(o){if(o=be(o),o){const i=l.findKey(s,o);i&&(!e||et(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||et(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]=ke(n),delete e[r];return}const i=t?Kn(r):String(r).trim();i!==r&&delete e[r],e[i]=ke(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[Bt]=this[Bt]={accessors:{}}).accessors,s=this.prototype;function n(r){const o=be(r);e[o]||(Zn(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 tt(t,e){const s=this||ge,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 $t(t){return!!(t&&t.__CANCEL__)}let _e=class extends E{constructor(t,e,s){super(t??"canceled",E.ERR_CANCELED,e,s),this.name="CanceledError",this.__CANCEL__=!0}};function Ht(t,e,s){const n=s.config.validateStatus;!s.status||!n||n(s.status)?t(s):e(new E("Request failed with status code "+s.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Gn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Xn(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 w=u&&c-u;return w?Math.round(b*1e3/w):void 0}}function Qn(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 Ae=(t,e,s=3)=>{let n=0;const r=Xn(50,250);return Qn(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)},zt=(t,e)=>{const s=t!=null;return[n=>e[0]({lengthComputable:s,total:t,loaded:n}),e[1]]},Jt=t=>(...e)=>l.asap(()=>t(...e)),Yn=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,er=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 tr(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function sr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Wt(t,e,s){let n=!tr(e);return t&&(n||s==!1)?sr(t,e):e}const Kt=t=>t instanceof q?{...t}:t;function ne(t,e){e=e||{};const s={};function n(u,d,b,w){return l.isPlainObject(u)&&l.isPlainObject(d)?l.merge.call({caseless:w},u,d):l.isPlainObject(d)?l.merge({},d):l.isArray(d)?d.slice():d}function r(u,d,b,w){if(l.isUndefined(d)){if(!l.isUndefined(u))return n(void 0,u,b,w)}else return n(u,d,b,w)}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(Kt(u),Kt(d),b,!0)};return l.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=l.hasOwnProp(c,u)?c[u]:r,b=d(t[u],e[u],u);l.isUndefined(b)&&d!==a||(s[u]=b)}),s}const Zt=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=Ft(Wt(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&&Yn(e.url))){const c=r&&o&&er.read(o);c&&i.set(r,c)}return e},nr=typeof XMLHttpRequest<"u",rr=nr&&function(t){return new Promise(function(e,s){const n=Zt(t);let r=n.data;const o=q.from(n.headers).normalize();let{responseType:i,onUploadProgress:a,onDownloadProgress:c}=n,u,d,b,w,h;function m(){w&&w(),h&&h(),n.cancelToken&&n.cancelToken.unsubscribe(u),n.signal&&n.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout;function v(){if(!p)return;const O=q.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),y={data:!i||i==="text"||i==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:O,config:t,request:p};Ht(function(R){e(R),m()},function(R){s(R),m()},y),p=null}"onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(s(new E("Request aborted",E.ECONNABORTED,t,p)),p=null)},p.onerror=function(O){const y=O&&O.message?O.message:"Network Error",R=new E(y,E.ERR_NETWORK,t,p);R.event=O||null,s(R),p=null},p.ontimeout=function(){let O=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const y=n.transitional||Xe;n.timeoutErrorMessage&&(O=n.timeoutErrorMessage),s(new E(O,y.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,t,p)),p=null},r===void 0&&o.setContentType(null),"setRequestHeader"in p&&l.forEach(o.toJSON(),function(O,y){p.setRequestHeader(y,O)}),l.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),i&&i!=="json"&&(p.responseType=n.responseType),c&&([b,h]=Ae(c,!0),p.addEventListener("progress",b)),a&&p.upload&&([d,w]=Ae(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",w)),(n.cancelToken||n.signal)&&(u=O=>{p&&(s(!O||O.type?new _e(null,t,p):O),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(u),n.signal&&(n.signal.aborted?u():n.signal.addEventListener("abort",u)));const T=Gn(n.url);if(T&&M.protocols.indexOf(T)===-1){s(new E("Unsupported protocol "+T+":",E.ERR_BAD_REQUEST,t));return}p.send(r||null)})},ir=(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 E?d:new _e(d instanceof Error?d.message:d))}};let i=e&&setTimeout(()=>{i=null,o(new E(`timeout of ${e}ms exceeded`,E.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}},or=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},ar=async function*(t,e){for await(const s of cr(t))yield*or(s,e)},cr=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()}},Gt=(t,e,s,n)=>{const r=ar(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 w=o+=b;s(w)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})},Xt=64*1024,{isFunction:Pe}=l,lr=(({Request:t,Response:e})=>({Request:t,Response:e}))(l.global),{ReadableStream:Qt,TextEncoder:Yt}=l.global,es=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ur=t=>{t=l.merge.call({skipUndefined:!0},lr,t);const{fetch:e,Request:s,Response:n}=t,r=e?Pe(e):typeof fetch=="function",o=Pe(s),i=Pe(n);if(!r)return!1;const a=r&&Pe(Qt),c=r&&(typeof Yt=="function"?(m=>p=>m.encode(p))(new Yt):async m=>new Uint8Array(await new s(m).arrayBuffer())),u=o&&a&&es(()=>{let m=!1;const p=new Qt,v=new s(M.origin,{body:p,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return p.cancel(),m&&!v}),d=i&&a&&es(()=>l.isReadableStream(new n("").body)),b={stream:d&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!b[m]&&(b[m]=(p,v)=>{let T=p&&p[m];if(T)return T.call(p);throw new E(`Response type '${m}' is not supported`,E.ERR_NOT_SUPPORT,v)})});const w=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},h=async(m,p)=>l.toFiniteNumber(m.getContentLength())??w(p);return async m=>{let{url:p,method:v,data:T,signal:O,cancelToken:y,timeout:R,onDownloadProgress:A,onUploadProgress:B,responseType:j,headers:W,withCredentials:F="same-origin",fetchOptions:Q}=Zt(m),$=e||fetch;j=j?(j+"").toLowerCase():"text";let _=ir([O,y&&y.toAbortSignal()],R),P=null;const H=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let Ve;try{if(B&&u&&v!=="get"&&v!=="head"&&(Ve=await h(W,T))!==0){let z=new s(p,{method:"POST",body:T,duplex:"half"}),ee;if(l.isFormData(T)&&(ee=z.headers.get("content-type"))&&W.setContentType(ee),z.body){const[ft,qe]=zt(Ve,Ae(Jt(B)));T=Gt(z.body,Xt,ft,qe)}}l.isString(F)||(F=F?"include":"omit");const D=o&&"credentials"in s.prototype,S={...Q,signal:_,method:v.toUpperCase(),headers:W.normalize().toJSON(),body:T,duplex:"half",credentials:D?F:void 0};P=o&&new s(p,S);let k=await(o?$(P,Q):$(p,S));const K=d&&(j==="stream"||j==="response");if(d&&(A||K&&H)){const z={};["status","statusText","headers"].forEach(As=>{z[As]=k[As]});const ee=l.toFiniteNumber(k.headers.get("content-length")),[ft,qe]=A&&zt(ee,Ae(Jt(A),!0))||[];k=new n(Gt(k.body,Xt,ft,()=>{qe&&qe(),H&&H()}),z)}j=j||"text";let Y=await b[l.findKey(b,j)||"text"](k,m);return!K&&H&&H(),await new Promise((z,ee)=>{Ht(z,ee,{data:Y,headers:q.from(k.headers),status:k.status,statusText:k.statusText,config:m,request:P})})}catch(D){throw H&&H(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,m,P,D&&D.response),{cause:D.cause||D}):E.from(D,D&&D.code,m,P,D&&D.response)}}},dr=new Map,ts=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=dr;for(;a--;)c=o[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:ur(e)),d=u;return u};ts();const st={http:Rn,xhr:rr,fetch:{get:ts}};l.forEach(st,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const ss=t=>`- ${t}`,hr=t=>l.isFunction(t)||t===null||t===!1;function fr(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,!hr(n)&&(r=st[(a=String(n)).toLowerCase()],r===void 0))throw new E(`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
5
|
`+i.map(ss).join(`
|
|
6
|
-
`):" "+ss(i[0]):"as no adapter specified";throw new
|
|
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:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean),legacyInterceptorReqResOrdering:J.transitional(J.boolean)},!1),n!=null&&(l.isFunction(n)?e.paramsSerializer={serialize:n}:Ne.assertOptions(n,{encode:J.function,serialize:J.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ne.assertOptions(e,{baseUrl:J.spelling("baseURL"),withXsrfToken:J.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"],h=>{delete r[h]}),e.headers=q.concat(o,r);const i=[];let a=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(e)===!1)return;a=a&&h.synchronous;const m=e.transitional||Xe;m&&m.legacyInterceptorReqResOrdering?i.unshift(h.fulfilled,h.rejected):i.push(h.fulfilled,h.rejected)});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let u,d=0,b;if(!a){const h=[rs.bind(this),void 0];for(h.unshift(...i),h.push(...c),b=h.length,u=Promise.resolve(e);d<b;)u=u.then(h[d++],h[d++]);return u}b=i.length;let w=e;for(;d<b;){const h=i[d++],m=i[d++];try{w=h(w)}catch(p){m.call(this,p);break}}try{u=rs.call(this,w)}catch(h){return Promise.reject(h)}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=Wt(t.baseURL,t.url,t.allowAbsoluteUrls);return Ft(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 mr=class Ds{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 _e(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 Ds(function(s){e=s}),cancel:e}}};function gr(t){return function(e){return t.apply(null,e)}}function br(t){return l.isObject(t)&&t.isAxiosError===!0}const rt={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(rt).forEach(([t,e])=>{rt[e]=t});function as(t){const e=new re(t),s=Ct(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 as(ne(t,n))},s}const I=as(ge);I.Axios=re,I.CanceledError=_e,I.CancelToken=mr,I.isCancel=$t,I.VERSION=is,I.toFormData=Re,I.AxiosError=v,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=gr,I.isAxiosError=br,I.mergeConfig=ne,I.AxiosHeaders=q,I.formToJSON=t=>qt(l.isHTMLForm(t)?new FormData(t):t),I.getAdapter=ns.getAdapter,I.HttpStatusCode=rt,I.default=I;const{Axios:ji,AxiosError:Ui,CanceledError:Mi,isCancel:Li,CancelToken:Fi,VERSION:Vi,all:qi,Cancel:Bi,isAxiosError:$i,spread:Hi,toFormData:zi,AxiosHeaders:Ji,HttpStatusCode:Wi,formToJSON:Ki,getAdapter:Zi,mergeConfig:Gi}=I,it=I.create({baseURL:location.origin,timeout:6e4,params:{}});it.interceptors.response.use(t=>t,t=>{if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(n){n&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let e=`HTTP ${t.response.status} - `;t.response?.statusText&&(e+=`${t.response.statusText} `),t.response?.config?.data&&(e+=`${t.response.config.data} `),t.response?.data?.message?e+=`${t.response.data.message}`:t.response?.data?.exception?e+=`${t.response.data.exception}`:t.response?.data?.error?.message?(t.response.data.error.class&&(e+=`${t.response.data.error.class} `),e+=`${t.response.data.error.message}`):e+=`${t.response?.data}`;const{$cosmosNotify:s}=window;throw s&&s.serious({title:"Network error",body:e}),t}else throw t});const Ie=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),it({method:t,url:e,data:s,params:n,headers:r,onUploadProgress:a})},ot={Accept:"application/json"},cs={...ot,"Content-Type":"application/json"},ls={get:function(t,{params:e,headers:s=ot,noScope:n,noAuth:r,onUploadProgress:o}={}){return Ie("get",t,{params:e,headers:s,noScope:n,noAuth:r,onUploadProgress:o})},put:function(t,{data:e,params:s,headers:n=cs,noScope:r,noAuth:o,onUploadProgress:i}={}){return Ie("put",t,{data:e,params:s,headers:n,noScope:r,noAuth:o,onUploadProgress:i})},post:function(t,{data:e,params:s,headers:n=cs,noScope:r,noAuth:o,onUploadProgress:i}={}){return Ie("post",t,{data:e,params:s,headers:n,noScope:r,noAuth:o,onUploadProgress:i})},delete:function(t,{params:e,headers:s=ot,noScope:n,noAuth:r,onUploadProgress:o}={}){return Ie("delete",t,{params:e,headers:s,noScope:n,noAuth:r,onUploadProgress:o})}};let je=()=>({emit(t,...e){for(let s=this.events[t]||[],n=0,r=s.length;n<r;n++)s[n](...e)},events:{},on(t,e){return(this.events[t]||=[]).push(e),()=>{this.events[t]=this.events[t]?.filter(s=>e!==s)}}});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 at extends ye{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class _r extends ye{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class G extends ye{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class yr extends G{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function us(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 wr{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:String(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 ds{constructor(e={}){this.emitter=je(),this.params=Object.freeze(e),this.presence=new wr(this),this.initialConnect=!0,this[ie]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=us({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 vr{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 Er{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 Er),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 vr(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 hs={debug:0,info:1,warn:2,error:3};class fs{constructor(e){this.level=e||"warn"}log(e,s,n){hs[e]<hs[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 fs{writeLogEntry(){}}class Cr{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let Or=0;class ps{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=us(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=++Or;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 _r(`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 G(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 at)):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 ms=()=>Date.now()/1e3|0;class xr extends ps{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=ms()),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=ms()),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 Rr extends ye{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class gs extends ds{static identifier="__ghost__";constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}const kr="$pubsub";class bs extends ds{static identifier=kr;async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}const oe=Symbol("state");let Ar=class{constructor({transport:t,protocol:e,encoder:s,logger:n,lazy:r,hubOptions:o,performFailures:i,transportConfigurator:a}){this.emitter=je(),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 G("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 G("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 G(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 G?t:new G(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[oe]="closed";let s=e||new G("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 bs({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new bs({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,n;return typeof t=="string"&&(n=t,t=gs),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 at&&this.logger.warn("rejected",o),i instanceof G){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 G?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 Rr;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 Pr={maxMissingPings:2,maxReconnectAttempts:1/0},de=()=>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({},Pr,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=de()}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=de(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=de(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=de(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=de()})),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=de()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new yr))}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 Dr{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=je(),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 Nr{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=je();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")}}class Ir{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)}whisper(e){return this.channel.whisper(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class jr extends gs{constructor(e,s,n){super(e,s),this.subscription=new Ir(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 at?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Ur{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 jr(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 Mr{constructor(e){this.cable=e,this.subscriptions=new Ur(e)}send(e){return this.cable.send(e)}connect(){return this.cable.connect()}disconnect(){return this.cable.disconnect()}ensureActiveConnection(){return this.cable.connect()}}const ws={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Lr(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:w,monitor:h,pingInterval:m,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,subprotocol:O,tokenRefresher:y,historyTimestamp:R,protocolOptions:A,concurrentSubscribes:B,performFailures:j,transportConfigurator:W,auth:F}=e;if(u=u||new we(c),typeof s=="string"){O=O||s;let _=s.substring(0,s.lastIndexOf("-")),P=s.substring(s.lastIndexOf("-")+1);if(A=A||{},_==="actioncable-v1")s=new ps({logger:u,...A});else if(_==="actioncable-v1-ext")s=new xr({logger:u,historyTimestamp:R,...A});else throw Error(`Protocol is not supported yet: ${s}`);if(P==="json")b=b||new Cr,r=r||"text";else if(P==="msgpack"){if(r="binary",!b)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(P==="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 Nr(t,{websocketImplementation:n,websocketOptions:o,subprotocol:O,authStrategy:i,format:r}),a&&(d=new Dr([d,...a],{logger:u})),F&&F.token&&d.setToken(F.token,F.param||"jid"),p=p||_s(m),h!==!1&&(h=h||new ys({pingInterval:m,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,logger:u}));let Q={concurrentSubscribes:B},$=new Ar({protocol:s,transport:d,encoder:b,logger:u,lazy:w,hubOptions:Q,performFailures:j,transportConfigurator:W});return h&&(h.watch($),$.monitor=h),y&&Fr($,async()=>{try{await y(d)}catch(_){return u.error("Failed to refresh authentication token: "+_),!1}return $.connect().catch(()=>{}),!0}),$}function Fr(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 Vr extends fs{writeLogEntry(e,s,n){n?console[e](s,n):console[e](s)}}class qr 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 G("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 Br=["cable","action-cable"],$r="/cable",Ue=(t,e)=>{for(let s of Br){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,Hr=()=>{if(typeof document<"u"&&document.head){let t=Ue(document,"url");if(t)return vs(t)}return vs($r)},zr=()=>{if(typeof document<"u"&&document.head){let t=Ue(document,"history-timestamp");if(t)return t|0}},Jr=()=>{if(typeof document<"u"&&document.head)return Ue(document,"token")},Wr=()=>{if(typeof document<"u"&&document.head)return Ue(document,"token-param")};function Kr(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Hr(),e=e||{},e.historyTimestamp||=zr();let s=Jr();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 Vr(n),i=e.reconnectStrategy=e.reconnectStrategy||_s(o),e.monitor!==!1&&(e.monitor=e.monitor||new qr({pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:c,logger:r})),Lr(t,e)}function Zr(t,e){let s=Kr(t,e);return new Mr(s)}class Gr{constructor(e="/openc3-api/cable",s="/openc3-api/auth/otp"){this._cable=null,this._url=e,this._otpUrl=s}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,n={},r={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(o=>(o&&OpenC3Auth.setTokens(),ls.get(this._otpUrl,{params:{scope:s}}))).then(({data:o})=>{if(this._cable==null){const i=new URL(this._url,document.baseURI);i.searchParams.set("scope",s),i.searchParams.set("authorization",o),this._cable=Zr(i.href)}return this._cable.subscriptions.create({channel:e,...r},n)})}recordPing(){}}function ve(t){return Xr.test(t)}const Xr=/^-?[0-9]+$/;function Es(t){return Qr.test(t)}const Qr=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ss(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=Ts(t),o=Ts(n);return!!(r===o||e?.approx===!0&&!ve(t)&&o.length>=14&&r.startsWith(o.substring(0,14)))}let Ee=(function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t})({});function Yr(t){if(Ss(t,{approx:!1}))return;if(ve(t))return Ee.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?Ee.underflow:Ee.truncate_float:Ee.overflow}function Ts(t){const{start:e,end:s}=ei(t),n=t.substring(e,s),r=n.indexOf(".");return r===-1?n:n.substring(0,r)+n.substring(r+1)}function ei(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 ti{isLosslessNumber=!0;constructor(e){if(!Es(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Yr(this.value);if(e===void 0||e===Ee.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 si(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function ni(t){return new ti(t)}function ri(t,e){return ct({"":t},"",t,e)}function ct(t,e,s,n){return Array.isArray(s)?n.call(t,e,oi(s,n)):s&&typeof s=="object"&&!si(s)?n.call(t,e,ii(s,n)):n.call(t,e,s)}function ii(t,e){for(const s of Object.keys(t)){const n=ct(t,s,t[s],e);n!==void 0?t[s]=n:delete t[s]}return t}function oi(t,e){for(let s=0;s<t.length;s++)t[s]=ct(t,String(s),t[s],e);return t}function ai(t,e,s){const n=typeof s=="function"?{parseNumber:s}:s,r=n?.parseNumber??ni,o=n?.onDuplicateKey??j;let i=0;const a=d();return T(a),y(),e?ri(a,e):a;function c(){if(t.charCodeAt(i)===fi){i++,w();const S={};let k=!0;for(;i<t.length&&t.charCodeAt(i)!==Os;){k?k=!1:(p(),w());const K=i,Y=h();if(Y===void 0){B();return}w(),E();const z=d();if(z===void 0){_();return}if(Object.prototype.hasOwnProperty.call(S,Y)&&!lt(z,S[Y])){const ee=o({key:Y,position:K+1,oldValue:S[Y],newValue:z});ee!==void 0&&(S[Y]=ee)}else S[Y]=z}return t.charCodeAt(i)!==Os&&W(),i++,S}}function u(){if(t.charCodeAt(i)===pi){i++,w();const S=[];let k=!0;for(;i<t.length&&t.charCodeAt(i)!==xs;){k?k=!1:p();const K=d();O(K),S.push(K)}return t.charCodeAt(i)!==xs&&F(),i++,S}}function d(){w();const S=h()??m()??c()??u()??b("true",!0)??b("false",!1)??b("null",null);return w(),S}function b(S,k){if(t.slice(i,i+S.length)===S)return i+=S.length,k}function w(){for(;ci(t.charCodeAt(i));)i++}function h(){if(t.charCodeAt(i)===ut){i++;let S="";for(;i<t.length&&t.charCodeAt(i)!==ut;){if(t.charCodeAt(i)===hi){const k=t[i+1],K=di[k];K!==void 0?(S+=K,i++):k==="u"?Me(t.charCodeAt(i+2))&&Me(t.charCodeAt(i+3))&&Me(t.charCodeAt(i+4))&&Me(t.charCodeAt(i+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):P(i):$(i)}else ui(t.charCodeAt(i))?S+=t[i]:Q(t[i]);i++}return A(),i++,S}}function m(){const S=i;if(t.charCodeAt(i)===Rs&&(i++,R(S)),t.charCodeAt(i)===dt)i++;else if(li(t.charCodeAt(i)))for(i++;Le(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===Ei)for(i++,R(S);Le(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===xi||t.charCodeAt(i)===Oi)for(i++,(t.charCodeAt(i)===Rs||t.charCodeAt(i)===yi)&&i++,R(S);Le(t.charCodeAt(i));)i++;if(i>S)return r(t.slice(S,i))}function p(){if(t.charCodeAt(i)!==vi)throw new SyntaxError(`Comma ',' expected after value ${D()}`);i++}function E(){if(t.charCodeAt(i)!==Si)throw new SyntaxError(`Colon ':' expected after property name ${D()}`);i++}function T(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${D()}`)}function O(S){if(S===void 0)throw new SyntaxError(`Array item expected ${D()}`)}function y(){if(i<t.length)throw new SyntaxError(`Expected end of input ${D()}`)}function R(S){if(!Le(t.charCodeAt(i))){const k=t.slice(S,i);throw new SyntaxError(`Invalid number '${k}', expecting a digit ${D()}`)}}function A(){if(t.charCodeAt(i)!==ut)throw new SyntaxError(`End of string '"' expected ${D()}`)}function B(){throw new SyntaxError(`Quoted object key expected ${D()}`)}function j(S){let{key:k,position:K}=S;throw new SyntaxError(`Duplicate key '${k}' encountered at position ${K}`)}function W(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${D()}`)}function F(){throw new SyntaxError(`Array item or end of array ']' expected ${D()}`)}function Q(S){throw new SyntaxError(`Invalid character '${S}' ${H()}`)}function $(S){const k=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${k}' ${H()}`)}function _(){throw new SyntaxError(`Object value expected after ':' ${H()}`)}function P(S){const k=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${k}' ${H()}`)}function H(){return`at position ${i}`}function Ve(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function D(){return`${Ve()} ${H()}`}}function ci(t){return t===mi||t===gi||t===bi||t===_i}function Me(t){return t>=dt&&t<=ht||t>=Ti&&t<=Ri||t>=Ci&&t<=ki}function Le(t){return t>=dt&&t<=ht}function li(t){return t>=wi&&t<=ht}function ui(t){return t>=32&&t<=1114111}function lt(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,n)=>lt(s,e[n])):Cs(t)&&Cs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>lt(t[s],e[s])):!1}function Cs(t){return typeof t=="object"&&t!==null}const di={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
6
|
+
`):" "+ss(i[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}const ns={getAdapter:fr,adapters:st};function nt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new _e(null,t)}function rs(t){return nt(t),t.headers=q.from(t.headers),t.data=tt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ns.getAdapter(t.adapter||ge.adapter,t)(t).then(function(e){return nt(t),e.data=tt.call(t,t.transformResponse,e),e.headers=q.from(e.headers),e},function(e){return $t(e)||(nt(t),e&&e.response&&(e.response.data=tt.call(t,t.transformResponse,e.response),e.response.headers=q.from(e.response.headers))),Promise.reject(e)})}const is="1.14.0",De={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{De[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const os={};De.transitional=function(t,e,s){function n(r,o){return"[Axios v"+is+"] Transitional option '"+r+"'"+o+(s?". "+s:"")}return(r,o,i)=>{if(t===!1)throw new E(n(o," has been removed"+(e?" in "+e:"")),E.ERR_DEPRECATED);return e&&!os[o]&&(os[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 pr(t,e,s){if(typeof t!="object")throw new E("options must be an object",E.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 E("option "+o+" must be "+c,E.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new E("Unknown option "+o,E.ERR_BAD_OPTION)}}const Ne={assertOptions:pr,validators:De},J=Ne.validators;let re=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Vt,response:new Vt}}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:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean),legacyInterceptorReqResOrdering:J.transitional(J.boolean)},!1),n!=null&&(l.isFunction(n)?e.paramsSerializer={serialize:n}:Ne.assertOptions(n,{encode:J.function,serialize:J.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ne.assertOptions(e,{baseUrl:J.spelling("baseURL"),withXsrfToken:J.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"],h=>{delete r[h]}),e.headers=q.concat(o,r);const i=[];let a=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(e)===!1)return;a=a&&h.synchronous;const m=e.transitional||Xe;m&&m.legacyInterceptorReqResOrdering?i.unshift(h.fulfilled,h.rejected):i.push(h.fulfilled,h.rejected)});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let u,d=0,b;if(!a){const h=[rs.bind(this),void 0];for(h.unshift(...i),h.push(...c),b=h.length,u=Promise.resolve(e);d<b;)u=u.then(h[d++],h[d++]);return u}b=i.length;let w=e;for(;d<b;){const h=i[d++],m=i[d++];try{w=h(w)}catch(p){m.call(this,p);break}}try{u=rs.call(this,w)}catch(h){return Promise.reject(h)}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=Wt(t.baseURL,t.url,t.allowAbsoluteUrls);return Ft(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 mr=class Ds{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 _e(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 Ds(function(s){e=s}),cancel:e}}};function gr(t){return function(e){return t.apply(null,e)}}function br(t){return l.isObject(t)&&t.isAxiosError===!0}const rt={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(rt).forEach(([t,e])=>{rt[e]=t});function as(t){const e=new re(t),s=Ct(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 as(ne(t,n))},s}const I=as(ge);I.Axios=re,I.CanceledError=_e,I.CancelToken=mr,I.isCancel=$t,I.VERSION=is,I.toFormData=Re,I.AxiosError=E,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=gr,I.isAxiosError=br,I.mergeConfig=ne,I.AxiosHeaders=q,I.formToJSON=t=>qt(l.isHTMLForm(t)?new FormData(t):t),I.getAdapter=ns.getAdapter,I.HttpStatusCode=rt,I.default=I;const{Axios:ji,AxiosError:Ui,CanceledError:Mi,isCancel:Li,CancelToken:Fi,VERSION:Vi,all:qi,Cancel:Bi,isAxiosError:$i,spread:Hi,toFormData:zi,AxiosHeaders:Ji,HttpStatusCode:Wi,formToJSON:Ki,getAdapter:Zi,mergeConfig:Gi}=I,it=I.create({baseURL:location.origin,timeout:6e4,params:{}});it.interceptors.response.use(t=>t,t=>{if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(n){n&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let e=`HTTP ${t.response.status} - `;t.response?.statusText&&(e+=`${t.response.statusText} `),t.response?.config?.data&&(e+=`${t.response.config.data} `),t.response?.data?.message?e+=`${t.response.data.message}`:t.response?.data?.exception?e+=`${t.response.data.exception}`:t.response?.data?.error?.message?(t.response.data.error.class&&(e+=`${t.response.data.error.class} `),e+=`${t.response.data.error.message}`):e+=`${t.response?.data}`;const{$cosmosNotify:s}=window;throw s&&s.serious({title:"Network error",body:e}),t}else throw t});const Ie=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),it({method:t,url:e,data:s,params:n,headers:r,onUploadProgress:a})},ot={Accept:"application/json"},cs={...ot,"Content-Type":"application/json"},ls={get:function(t,{params:e,headers:s=ot,noScope:n,noAuth:r,onUploadProgress:o}={}){return Ie("get",t,{params:e,headers:s,noScope:n,noAuth:r,onUploadProgress:o})},put:function(t,{data:e,params:s,headers:n=cs,noScope:r,noAuth:o,onUploadProgress:i}={}){return Ie("put",t,{data:e,params:s,headers:n,noScope:r,noAuth:o,onUploadProgress:i})},post:function(t,{data:e,params:s,headers:n=cs,noScope:r,noAuth:o,onUploadProgress:i}={}){return Ie("post",t,{data:e,params:s,headers:n,noScope:r,noAuth:o,onUploadProgress:i})},delete:function(t,{params:e,headers:s=ot,noScope:n,noAuth:r,onUploadProgress:o}={}){return Ie("delete",t,{params:e,headers:s,noScope:n,noAuth:r,onUploadProgress:o})}};let je=()=>({emit(t,...e){for(let s=this.events[t]||[],n=0,r=s.length;n<r;n++)s[n](...e)},events:{},on(t,e){return(this.events[t]||=[]).push(e),()=>{this.events[t]=this.events[t]?.filter(s=>e!==s)}}});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 at extends ye{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class _r extends ye{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class G extends ye{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class yr extends G{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function us(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 wr{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:String(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 ds{constructor(e={}){this.emitter=je(),this.params=Object.freeze(e),this.presence=new wr(this),this.initialConnect=!0,this[ie]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=us({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 vr{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 Er{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 Er),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 vr(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 hs={debug:0,info:1,warn:2,error:3};class fs{constructor(e){this.level=e||"warn"}log(e,s,n){hs[e]<hs[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 fs{writeLogEntry(){}}class Cr{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let Or=0;class ps{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=us(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=++Or;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 _r(`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 G(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 at)):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 ms=()=>Date.now()/1e3|0;class xr extends ps{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=ms()),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=ms()),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 Rr extends ye{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class gs extends ds{static identifier="__ghost__";constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}const kr="$pubsub";class bs extends ds{static identifier=kr;async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}const oe=Symbol("state");let Ar=class{constructor({transport:t,protocol:e,encoder:s,logger:n,lazy:r,hubOptions:o,performFailures:i,transportConfigurator:a}){this.emitter=je(),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 G("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 G("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 G(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 G?t:new G(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[oe]="closed";let s=e||new G("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 bs({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new bs({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,n;return typeof t=="string"&&(n=t,t=gs),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 at&&this.logger.warn("rejected",o),i instanceof G){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 G?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 Rr;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 Pr={maxMissingPings:2,maxReconnectAttempts:1/0},de=()=>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({},Pr,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=de()}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=de(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=de(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=de(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=de()})),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=de()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new yr))}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 Dr{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=je(),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 Nr{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=je();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")}}class Ir{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)}whisper(e){return this.channel.whisper(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class jr extends gs{constructor(e,s,n){super(e,s),this.subscription=new Ir(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 at?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Ur{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 jr(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 Mr{constructor(e){this.cable=e,this.subscriptions=new Ur(e)}send(e){return this.cable.send(e)}connect(){return this.cable.connect()}disconnect(){return this.cable.disconnect()}ensureActiveConnection(){return this.cable.connect()}}const ws={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Lr(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:w,monitor:h,pingInterval:m,reconnectStrategy:p,maxMissingPings:v,maxReconnectAttempts:T,subprotocol:O,tokenRefresher:y,historyTimestamp:R,protocolOptions:A,concurrentSubscribes:B,performFailures:j,transportConfigurator:W,auth:F}=e;if(u=u||new we(c),typeof s=="string"){O=O||s;let _=s.substring(0,s.lastIndexOf("-")),P=s.substring(s.lastIndexOf("-")+1);if(A=A||{},_==="actioncable-v1")s=new ps({logger:u,...A});else if(_==="actioncable-v1-ext")s=new xr({logger:u,historyTimestamp:R,...A});else throw Error(`Protocol is not supported yet: ${s}`);if(P==="json")b=b||new Cr,r=r||"text";else if(P==="msgpack"){if(r="binary",!b)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(P==="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 Nr(t,{websocketImplementation:n,websocketOptions:o,subprotocol:O,authStrategy:i,format:r}),a&&(d=new Dr([d,...a],{logger:u})),F&&F.token&&d.setToken(F.token,F.param||"jid"),p=p||_s(m),h!==!1&&(h=h||new ys({pingInterval:m,reconnectStrategy:p,maxMissingPings:v,maxReconnectAttempts:T,logger:u}));let Q={concurrentSubscribes:B},$=new Ar({protocol:s,transport:d,encoder:b,logger:u,lazy:w,hubOptions:Q,performFailures:j,transportConfigurator:W});return h&&(h.watch($),$.monitor=h),y&&Fr($,async()=>{try{await y(d)}catch(_){return u.error("Failed to refresh authentication token: "+_),!1}return $.connect().catch(()=>{}),!0}),$}function Fr(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 Vr extends fs{writeLogEntry(e,s,n){n?console[e](s,n):console[e](s)}}class qr 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 G("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 Br=["cable","action-cable"],$r="/cable",Ue=(t,e)=>{for(let s of Br){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,Hr=()=>{if(typeof document<"u"&&document.head){let t=Ue(document,"url");if(t)return vs(t)}return vs($r)},zr=()=>{if(typeof document<"u"&&document.head){let t=Ue(document,"history-timestamp");if(t)return t|0}},Jr=()=>{if(typeof document<"u"&&document.head)return Ue(document,"token")},Wr=()=>{if(typeof document<"u"&&document.head)return Ue(document,"token-param")};function Kr(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Hr(),e=e||{},e.historyTimestamp||=zr();let s=Jr();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 Vr(n),i=e.reconnectStrategy=e.reconnectStrategy||_s(o),e.monitor!==!1&&(e.monitor=e.monitor||new qr({pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:c,logger:r})),Lr(t,e)}function Zr(t,e){let s=Kr(t,e);return new Mr(s)}class Gr{constructor(e="/openc3-api/cable",s="/openc3-api/auth/otp"){this._cable=null,this._url=e,this._otpUrl=s}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,n={},r={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(o=>(o&&OpenC3Auth.setTokens(),ls.get(this._otpUrl,{params:{scope:s}}))).then(({data:o})=>{if(this._cable==null){const i=new URL(this._url,document.baseURI);i.searchParams.set("scope",s),i.searchParams.set("authorization",o),this._cable=Zr(i.href)}return this._cable.subscriptions.create({channel:e,...r},n)})}recordPing(){}}function ve(t){return Xr.test(t)}const Xr=/^-?[0-9]+$/;function Es(t){return Qr.test(t)}const Qr=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ss(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=Ts(t),o=Ts(n);return!!(r===o||e?.approx===!0&&!ve(t)&&o.length>=14&&r.startsWith(o.substring(0,14)))}let Ee=(function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t})({});function Yr(t){if(Ss(t,{approx:!1}))return;if(ve(t))return Ee.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?Ee.underflow:Ee.truncate_float:Ee.overflow}function Ts(t){const{start:e,end:s}=ei(t),n=t.substring(e,s),r=n.indexOf(".");return r===-1?n:n.substring(0,r)+n.substring(r+1)}function ei(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 ti{isLosslessNumber=!0;constructor(e){if(!Es(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Yr(this.value);if(e===void 0||e===Ee.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 si(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function ni(t){return new ti(t)}function ri(t,e){return ct({"":t},"",t,e)}function ct(t,e,s,n){return Array.isArray(s)?n.call(t,e,oi(s,n)):s&&typeof s=="object"&&!si(s)?n.call(t,e,ii(s,n)):n.call(t,e,s)}function ii(t,e){for(const s of Object.keys(t)){const n=ct(t,s,t[s],e);n!==void 0?t[s]=n:delete t[s]}return t}function oi(t,e){for(let s=0;s<t.length;s++)t[s]=ct(t,String(s),t[s],e);return t}function ai(t,e,s){const n=typeof s=="function"?{parseNumber:s}:s,r=n?.parseNumber??ni,o=n?.onDuplicateKey??j;let i=0;const a=d();return T(a),y(),e?ri(a,e):a;function c(){if(t.charCodeAt(i)===fi){i++,w();const S={};let k=!0;for(;i<t.length&&t.charCodeAt(i)!==Os;){k?k=!1:(p(),w());const K=i,Y=h();if(Y===void 0){B();return}w(),v();const z=d();if(z===void 0){_();return}if(Object.prototype.hasOwnProperty.call(S,Y)&&!lt(z,S[Y])){const ee=o({key:Y,position:K+1,oldValue:S[Y],newValue:z});ee!==void 0&&(S[Y]=ee)}else S[Y]=z}return t.charCodeAt(i)!==Os&&W(),i++,S}}function u(){if(t.charCodeAt(i)===pi){i++,w();const S=[];let k=!0;for(;i<t.length&&t.charCodeAt(i)!==xs;){k?k=!1:p();const K=d();O(K),S.push(K)}return t.charCodeAt(i)!==xs&&F(),i++,S}}function d(){w();const S=h()??m()??c()??u()??b("true",!0)??b("false",!1)??b("null",null);return w(),S}function b(S,k){if(t.slice(i,i+S.length)===S)return i+=S.length,k}function w(){for(;ci(t.charCodeAt(i));)i++}function h(){if(t.charCodeAt(i)===ut){i++;let S="";for(;i<t.length&&t.charCodeAt(i)!==ut;){if(t.charCodeAt(i)===hi){const k=t[i+1],K=di[k];K!==void 0?(S+=K,i++):k==="u"?Me(t.charCodeAt(i+2))&&Me(t.charCodeAt(i+3))&&Me(t.charCodeAt(i+4))&&Me(t.charCodeAt(i+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):P(i):$(i)}else ui(t.charCodeAt(i))?S+=t[i]:Q(t[i]);i++}return A(),i++,S}}function m(){const S=i;if(t.charCodeAt(i)===Rs&&(i++,R(S)),t.charCodeAt(i)===dt)i++;else if(li(t.charCodeAt(i)))for(i++;Le(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===Ei)for(i++,R(S);Le(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===xi||t.charCodeAt(i)===Oi)for(i++,(t.charCodeAt(i)===Rs||t.charCodeAt(i)===yi)&&i++,R(S);Le(t.charCodeAt(i));)i++;if(i>S)return r(t.slice(S,i))}function p(){if(t.charCodeAt(i)!==vi)throw new SyntaxError(`Comma ',' expected after value ${D()}`);i++}function v(){if(t.charCodeAt(i)!==Si)throw new SyntaxError(`Colon ':' expected after property name ${D()}`);i++}function T(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${D()}`)}function O(S){if(S===void 0)throw new SyntaxError(`Array item expected ${D()}`)}function y(){if(i<t.length)throw new SyntaxError(`Expected end of input ${D()}`)}function R(S){if(!Le(t.charCodeAt(i))){const k=t.slice(S,i);throw new SyntaxError(`Invalid number '${k}', expecting a digit ${D()}`)}}function A(){if(t.charCodeAt(i)!==ut)throw new SyntaxError(`End of string '"' expected ${D()}`)}function B(){throw new SyntaxError(`Quoted object key expected ${D()}`)}function j(S){let{key:k,position:K}=S;throw new SyntaxError(`Duplicate key '${k}' encountered at position ${K}`)}function W(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${D()}`)}function F(){throw new SyntaxError(`Array item or end of array ']' expected ${D()}`)}function Q(S){throw new SyntaxError(`Invalid character '${S}' ${H()}`)}function $(S){const k=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${k}' ${H()}`)}function _(){throw new SyntaxError(`Object value expected after ':' ${H()}`)}function P(S){const k=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${k}' ${H()}`)}function H(){return`at position ${i}`}function Ve(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function D(){return`${Ve()} ${H()}`}}function ci(t){return t===mi||t===gi||t===bi||t===_i}function Me(t){return t>=dt&&t<=ht||t>=Ti&&t<=Ri||t>=Ci&&t<=ki}function Le(t){return t>=dt&&t<=ht}function li(t){return t>=wi&&t<=ht}function ui(t){return t>=32&&t<=1114111}function lt(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,n)=>lt(s,e[n])):Cs(t)&&Cs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>lt(t[s],e[s])):!1}function Cs(t){return typeof t=="object"&&t!==null}const di={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
8
8
|
`,r:"\r",t:" "},hi=92,fi=123,Os=125,pi=91,xs=93,mi=32,gi=10,bi=9,_i=13,ut=34,yi=43,Rs=45,dt=48,wi=49,ht=57,vi=44,Ei=46,Si=58,Ti=65,Ci=97,Oi=69,xi=101,Ri=70,ki=102;function ks(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"||!Es(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?.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 w=c[b];typeof w<"u"&&typeof w!="function"?d+=r(w):d+="null",b<c.length-1&&(d+=",")}return d+="]",d}function i(c,u){if(typeof c.toJSON=="function")return ks(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,w="{";for(const h of d){const m=c[h];if(a(h,m)){b?b=!1:w+=",";const p=JSON.stringify(h);w+=`${p}:`,w+=r(m)}}return w+="}",w}function a(c,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function Ai(t){return ve(t)&&!Ss(t)?BigInt(t):parseFloat(t)}class Pi{id=1;constructor(){}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 it.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)=>ks(i)],transformResponse:[i=>{try{return ai(i,void 0,Ai)}catch{const a=typeof i=="string"?i.substring(0,200):String(i),c=new Error(`Server returned non-JSON response: ${a}`);throw c.name="ServerError",c}}]})).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"].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 or FORMATTED.`,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",[])}open_tab(e){window.open(e,"_blank")}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 Fe=[];const Di={components:{OpenC3TimePicker:Tt,OpenConfigDialog:yt,SaveConfigDialog:_t,TargetPacketItemChooser:St,TopBar:Ls},mixins:[gt,bt],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"],reducedTypes:["SAMPLE","MIN","MAX","AVG","STDDEV"],editAll:!1,allItemMode:"DECOM",allItemValueType:"CONVERTED",allItemReducedType:"SAMPLE",cable:new Gr,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 Pi,await this.api.get_setting("time_zone").then(e=>{e&&(this.timeZone=e)}).catch(e=>{}),await ls.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
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(){Fe=[],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("__")||a==="COSMOS_EXTRA").length;this.itemsReceived+=o.length-i,this.totalItemsReceived+=o.length-i}e.delete("__type"),e.delete("__time"),e.delete("COSMOS_EXTRA"),this.buildHeaders([...e]),Fe.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(){let t=Fe.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,m)=>h.__time-m.__time),await this.yieldToMain();let o=[],i=[],a=null,c=0;for(let h of t){let m=!1;this.fillDown&&a?i=[...a]:i=[];let p="";if(Object.keys(h).forEach(
|
|
11
|
-
`)],{type:d});await this.yieldToMain();const w=document.createElement("a");w.href=URL.createObjectURL(b),w.setAttribute("download",this.startDateTimeFilename+"_"+this.fileCount+u),w.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),Fe.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 Ni(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"),w=C("v-radio-group"),h=C("target-packet-item-chooser"),m=C("v-container"),p=C("v-progress-circular"),
|
|
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(){Fe=[],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("__")||a==="COSMOS_EXTRA").length;this.itemsReceived+=o.length-i,this.totalItemsReceived+=o.length-i}e.delete("__type"),e.delete("__time"),e.delete("COSMOS_EXTRA"),this.buildHeaders([...e]),Fe.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(){let t=Fe.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,m)=>h.__time-m.__time),await this.yieldToMain();let o=[],i=[],a=null,c=0;for(let h of t){let m=!1;this.fillDown&&a?i=[...a]:i=[];let p="";if(Object.keys(h).forEach(v=>{if(v.slice(0,2)==="__"||v==="COSMOS_EXTRA")return;p=v;let T=s[v];if(typeof h[v]=="object")if(h[v]===null)i[T]="";else if(Array.isArray(h[v]))i[T]='"['+h[v]+']"';else{let O=h[v].raw;if(Array.isArray(O)){let y="0x";O.forEach(R=>{y+=R.toString(16).padStart(2,"0").toUpperCase()}),i[T]=y}else i[T]="'"+O+"'"}else i[T]=h[v];this.uniqueOnly&&o[T]!==i[T]&&(m=!0),o[T]=i[T]}),this.fillDown&&(a=[...i]),!this.uniqueOnly||m){if(this.columnMode==="normal"){p=this.keyMap[p];const[v,T,O,y,R,A,B]=p.split("__"),j=BigInt(h.__time),W=Number(j/1000000n),F=Number(j%1000000n),Q=new Date(W).toISOString(),$=String(F).padStart(6,"0");if(i[0]=Q.replace(/\.(\d{3})Z$/,(_,P)=>`.${P}${$}Z`),i[1]=O,i[2]=y,this.hasCommands){const _=h.COSMOS_EXTRA?JSON.parse(h.COSMOS_EXTRA):{};i[3]=_?.username||"",this.enterprise&&(i[4]=_?.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 w=document.createElement("a");w.href=URL.createObjectURL(b),w.setAttribute("download",this.startDateTimeFilename+"_"+this.fileCount+u),w.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),Fe.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 Ni(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"),w=C("v-radio-group"),h=C("target-packet-item-chooser"),m=C("v-container"),p=C("v-progress-circular"),v=C("v-spacer"),T=C("v-btn"),O=C("v-toolbar"),y=C("v-card-title"),R=C("v-select"),A=C("v-card-text"),B=C("v-card-actions"),j=C("v-card"),W=C("v-dialog"),F=C("v-data-table"),Q=C("open-config-dialog"),$=C("save-config-dialog");return N(),te("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]=_=>r.startDate=_),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]=_=>r.startTime=_),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]=_=>r.endDate=_),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]=_=>r.endTime=_),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(w,{modelValue:r.cmdOrTlm,"onUpdate:modelValue":e[4]||(e[4]=_=>r.cmdOrTlm=_),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(h,{"button-text":"Add Item",mode:r.cmdOrTlm,hidden:!0,"choose-item":"","allow-all":"","show-latest":"",onAddItem:e[5]||(e[5]=_=>o.addItem(_))},null,8,["mode"])]),_:1})]),_:1})]),_:1}),f(O,{class:"pl-3"},{default:g(()=>[f(p,{"model-value":r.progress},null,8,["model-value"]),L(" Processed: "+X(r.totalPacketsReceived)+" packets, "+X(r.totalItemsReceived)+" items ",1),f(v),f(T,{class:"bg-primary",disabled:r.items.length<1,onClick:o.processItems},{default:g(()=>[L(X(r.processButtonText),1)]),_:1},8,["disabled","onClick"]),f(v),f(T,{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]=_=>r.editAll=!0)},null,8,["disabled"]),f(T,{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(y,null,{default:g(()=>[e[18]||(e[18]=L(" Items ",-1)),f(v),f(a,{modelValue:r.search,"onUpdate:modelValue":e[7]||(e[7]=_=>r.search=_),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),f(F,{"items-per-page":r.itemsPerPage,"onUpdate:itemsPerPage":e[8]||(e[8]=_=>r.itemsPerPage=_),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:_})=>[f(T,{icon:"mdi-pencil",variant:"text","data-test":"edit-row","aria-label":"Edit Item",onClick:Et(P=>_.edit=!0,["stop"])},null,8,["onClick"]),f(W,{modelValue:_.edit,"onUpdate:modelValue":P=>_.edit=P,"max-width":"600",persistent:"",onKeydown:ze(P=>_.edit=!1,["esc"])},{default:g(()=>[f(j,null,{default:g(()=>[f(O,{height:"24"},{default:g(()=>[f(v),e[19]||(e[19]=Se("span",null," DataExtractor: Edit Item Mode ",-1)),f(v)]),_:1}),f(A,null,{default:g(()=>[f(d,{class:"mt-3 title-font"},{default:g(()=>[f(c,null,{default:g(()=>[L(X(o.getItemLabel(_)),1)]),_:2},1024)]),_:2},1024),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(R,{modelValue:_.mode,"onUpdate:modelValue":P=>_.mode=P,"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(R,{modelValue:_.valueType,"onUpdate:modelValue":P=>_.valueType=P,"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(R,{modelValue:_.reducedType,"onUpdate:modelValue":P=>_.reducedType=P,"hide-details":"",items:r.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024)]),_:2},1024),f(B,{class:"px-6 py-3"},{default:g(()=>[f(v),f(T,{variant:"flat",onClick:P=>_.edit=!1},{default:g(()=>[...e[20]||(e[20]=[L(" Close ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","onKeydown"])]),"item.delete":g(({item:_})=>[f(T,{icon:"mdi-delete",variant:"text","data-test":"delete-row","aria-label":"Delete Item",onClick:P=>o.deleteItem(_)},null,8,["onClick"])]),_:1},8,["items-per-page","headers","items","search"])]),_:1})]),_:1}),f(W,{modelValue:r.editAll,"onUpdate:modelValue":e[14]||(e[14]=_=>r.editAll=_),"max-width":"600",persistent:"",onKeydown:e[15]||(e[15]=ze(_=>r.editAll=!1,["esc"]))},{default:g(()=>[f(j,null,{default:g(()=>[f(O,{height:"24"},{default:g(()=>[f(v),e[21]||(e[21]=Se("span",null," DataExtractor: Edit All Items",-1)),f(v)]),_:1}),f(A,null,{default:g(()=>[f(d,{class:"mt-3"},{default:g(()=>[f(c,null,{default:g(()=>[...e[22]||(e[22]=[L(" This will change all items to the following data type! ",-1)])]),_:1})]),_:1}),f(d,null,{default:g(()=>[f(c,null,{default:g(()=>[f(R,{modelValue:r.allItemMode,"onUpdate:modelValue":e[9]||(e[9]=_=>r.allItemMode=_),"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(R,{modelValue:r.allItemValueType,"onUpdate:modelValue":e[10]||(e[10]=_=>r.allItemValueType=_),"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(R,{modelValue:r.allItemReducedType,"onUpdate:modelValue":e[11]||(e[11]=_=>r.allItemReducedType=_),"hide-details":"",items:r.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1})]),_:1}),f(B,{class:"px-6 py-3"},{default:g(()=>[f(v),f(T,{variant:"outlined",onClick:e[12]||(e[12]=_=>r.editAll=!1)},{default:g(()=>[...e[23]||(e[23]=[L(" Cancel ",-1)])]),_:1}),f(T,{variant:"flat",disabled:!r.allItemValueType,onClick:e[13]||(e[13]=_=>o.editAllItems())},{default:g(()=>[...e[24]||(e[24]=[L(" Ok ",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),r.openConfig?(N(),U(Q,{key:0,modelValue:r.openConfig,"onUpdate:modelValue":e[16]||(e[16]=_=>r.openConfig=_),"config-key":r.configKey,onSuccess:o.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):ce("",!0),r.saveConfig?(N(),U($,{key:1,modelValue:r.saveConfig,"onUpdate:modelValue":e[17]||(e[17]=_=>r.saveConfig=_),"config-key":r.configKey,onSuccess:o.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):ce("",!0)])}const Xi=Ns("default",mt(Di,[["render",Ni],["__scopeId","data-v-d21cc656"]]))})}}));
|