openc3-cosmos-tool-dataextractor 7.4.0 → 7.4.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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/tools/dataextractor/{ArrayWidget-CIDdZjk3-a365d6ff2b67a493871c.js → ArrayWidget-_X_afgHR-848339cb62d72b1922f4.js} +2 -2
  3. data/tools/dataextractor/{ArrayplotWidget-BfO1atvG-6a08522672acf412ee31.js → ArrayplotWidget-BUH82FI4-cec7293efcfa38573113.js} +1 -1
  4. data/tools/dataextractor/{BarColumn-CHX_3ye3-efbf3df88e1db66e93b7.js → BarColumn-B_V83WMV-d2b59608da15a07ed307.js} +1 -1
  5. data/tools/dataextractor/{BlockWidget-DSbunlY_-22efee4c2014dc1373a7.js → BlockWidget-DKedrbWf-cfd62a492728ec2a59c7.js} +2 -2
  6. data/tools/dataextractor/{ButtonWidget-BB4ZOCI8-942359ad22d6846f2adc.js → ButtonWidget-DB3HWmyA-a451c9555921470b0ee7.js} +1 -1
  7. data/tools/dataextractor/CanvasWidget-D9EH5pzn-62c155f458b5c1bbfc0c.js +1 -0
  8. data/tools/dataextractor/CanvasdotWidget-BlE7J1N4-316f6c4f803268f7c3b1.js +1 -0
  9. data/tools/dataextractor/{CanvasimageWidget-DY1DDf0a-376e192da5d8c3579651.js → CanvasimageWidget-BlIBXSax-21e60190f0442f975c6d.js} +1 -1
  10. data/tools/dataextractor/{CanvasimagevalueWidget-0lc2cCPV-9d3edd16eee4a4f28dfe.js → CanvasimagevalueWidget-DXxbcD-Q-a9defc3d592afed39000.js} +1 -1
  11. data/tools/dataextractor/{CanvaslabelWidget-C6TDW9WO-06ba64b610cfcbd8690a.js → CanvaslabelWidget-3GsIsHNJ-a503a642efe204299165.js} +1 -1
  12. data/tools/dataextractor/{CanvaslabelvalueWidget-Cf_dcDW2-d4abd338766f66d68193.js → CanvaslabelvalueWidget-Cccis43F-375b317ca23584a67a6e.js} +1 -1
  13. data/tools/dataextractor/CanvaslineWidget-w07GyddB-ce1c98d68c1e88d66b6c.js +1 -0
  14. data/tools/dataextractor/{CanvaslinevalueWidget-CKpjqlKA-ba1fffbf8bf143563f2f.js → CanvaslinevalueWidget-CuTyiORB-6ffaf4f72d20768ae767.js} +1 -1
  15. data/tools/dataextractor/{CheckbuttonWidget-BWXinMaT-06aa9f5b43e6ef7ee36b.js → CheckbuttonWidget-7b-uK9Tk-66fe79c6d25ac981c471.js} +1 -1
  16. data/tools/dataextractor/ComboboxWidget-CdmrG6UT-58d9aefe0cf7828d0cfa.js +1 -0
  17. data/tools/dataextractor/{DataExtractor-2088fe0995e64bab5096.js → DataExtractor-e07fb38dc7183d41b098.js} +8 -8
  18. data/tools/dataextractor/{DateWidget-qUbLzQsX-fa054ed3b5c152e3ad52.js → DateWidget-D1pxOAks-8b2ce628388f535a975f.js} +1 -1
  19. data/tools/dataextractor/{DetailsDialog-CLPj0nP0-4bf5ea98e5ff56a47f05.js → DetailsDialog-CrP3epOv-5d7ec90aec185b3b7bb4.js} +1 -1
  20. data/tools/dataextractor/{DynamicWidget-yna_ejyc-41f93b7bf1514ee52ac0.js → DynamicWidget-yna_ejyc-4ec8a9e4b43555e0e9be.js} +1 -1
  21. data/tools/dataextractor/{FilechecksumWidget-DqNThsOX-c679ca6bff3a875eb9c4.js → FilechecksumWidget-eMy16t1i-41eb08ca3b045a8155c6.js} +1 -1
  22. data/tools/dataextractor/{FiledisplayWidget-BRhhiVEs-316e90e38c4eca99bd0b.js → FiledisplayWidget-B-hR67mo-c2bc42f3d0691f2bb792.js} +1 -1
  23. data/tools/dataextractor/{FormatvalueWidget-pEjAh0h2-06f06dc0a5a1827cdf25.js → FormatvalueWidget-lUNlLWlR-8c67ab633d4e5a99afa5.js} +1 -1
  24. data/tools/dataextractor/Graph--wiWQKh0-db7a194b09e2c6199203.js +1 -0
  25. data/tools/dataextractor/{GraphWidget-BZjBkefj-152c6140396136b6e842.js → GraphWidget-BvyRvV66-d9aa42efd0159537deb9.js} +1 -1
  26. data/tools/dataextractor/{HorizontalWidget-Brag6E4y-a9141bd384f055413c6f.js → HorizontalWidget-DKjAFowf-70aa3a393d2dc2eb43bb.js} +1 -1
  27. data/tools/dataextractor/HorizontalboxWidget-ge9b4747-9dd04301b8452b717ea9.js +1 -0
  28. data/tools/dataextractor/HorizontallineWidget-BX8YItd_-36a82f99582b3fbeda90.js +1 -0
  29. data/tools/dataextractor/{IframeWidget-Ciu5u58E-0a7070640afefb67e88e.js → IframeWidget-B6WC_SMn-a6ac85fb63784e70ad32.js} +1 -1
  30. data/tools/dataextractor/ImageLoader-QC6TN_Tu-c7c598257cade2eb7b88.js +1 -0
  31. data/tools/dataextractor/{ImageviewerWidget-vWMGPveb-805995e452eeb9c96950.js → ImageviewerWidget-CLcPtNkW-8cac26c9baa92c91d4d6.js} +1 -1
  32. data/tools/dataextractor/{LabelWidget-DVp0CmFH-ad94520313e6050c0342.js → LabelWidget-BMxEJEgT-618ee6d2a0a3e468e0a4.js} +1 -1
  33. data/tools/dataextractor/{LabelledWidget-1DeE1-6G-37c387bb59733698156e.js → LabelledWidget-DyLep7BJ-14e03fffb70a0bd6954d.js} +1 -1
  34. data/tools/dataextractor/LabelprogressbarWidget-CQVg9bpz-6cc87ec260b4bf8131a5.js +1 -0
  35. data/tools/dataextractor/LabelsparklineWidget-Dq4ZFHs0-11ea61f1777a5a5f6c19.js +1 -0
  36. data/tools/dataextractor/LabelvalueWidget-17PcoD2V-17171583a9a2b660fe34.js +1 -0
  37. data/tools/dataextractor/{LabelvaluedescWidget-c5BUCRxB-bb4bc7800b9fcb8834ff.js → LabelvaluedescWidget-zpeZoPGi-78d98f7a3107c4dedd59.js} +1 -1
  38. data/tools/dataextractor/LabelvaluelimitsbarWidget-CAX0dGi5-48375d083f8f9fed38db.js +1 -0
  39. data/tools/dataextractor/LabelvaluelimitscolumnWidget-Bi-ROV2g-5171e84949f449eaf187.js +1 -0
  40. data/tools/dataextractor/LabelvaluerangebarWidget-D8zuio3--83b671d86158a2742e4d.js +1 -0
  41. data/tools/dataextractor/{Layout-Df-lJgpB-3443a03561b770b828ae.js → Layout-740AmQLZ-f6e9a63a6c62fe9db2ae.js} +1 -1
  42. data/tools/dataextractor/{LedWidget-C97EJXBo-7c9b12b76be262fb0539.js → LedWidget-Bg65XQ0l-1c13ee5f7951b66fa287.js} +1 -1
  43. data/tools/dataextractor/{LimitsBar-DNV39okL-42e6976651a1fe948f8e.js → LimitsBar-DoRwFPYW-bb3cc6ba5b3d7d020e4f.js} +1 -1
  44. data/tools/dataextractor/{LimitsbarWidget-BIO6xztx-bc1a02229036f0dd4023.js → LimitsbarWidget-BJcc_1qa-74d09adcc8caed529d74.js} +1 -1
  45. data/tools/dataextractor/{LimitscolorWidget-BGrNA65J-f459bdc35b6389c77718.js → LimitscolorWidget-Dzz0Qxet-5d82fa05b34e5d13603e.js} +1 -1
  46. data/tools/dataextractor/{LimitscolumnWidget-Bw6EXJs9-aea5bb3bcbfd9ded4639.js → LimitscolumnWidget-CwzHaKP4-936d95682f604485397f.js} +1 -1
  47. data/tools/dataextractor/LinegraphWidget-C6tb4yDb-480caa9da0b31cc68c55.js +1 -0
  48. data/tools/dataextractor/{MatrixbycolumnsWidget-C33-g7kK-2243491e9688c4485a52.js → MatrixbycolumnsWidget-B18dc43U-48a91a930e7459e82bec.js} +1 -1
  49. data/tools/dataextractor/{OpenC3TimePicker-cOr0aOVn-25acc4b1827c96c6823a.js → OpenC3TimePicker-CM2VG1mS-76b626662e43cfd8ce5c.js} +1 -1
  50. data/tools/dataextractor/{ProgressbarWidget-DqfSMI10-435b3abb259019c8dd67.js → ProgressbarWidget-DXMt6dar-5b71b7ede0b52a551fd9.js} +1 -1
  51. data/tools/dataextractor/{RadiobuttonWidget-CSQeEacF-bf748e1aa8fa763e632c.js → RadiobuttonWidget-zxv884Z8-a45c917097a8f42e64fc.js} +1 -1
  52. data/tools/dataextractor/RadiogroupWidget-BVE6wpmw-11b38f696995bcec6206.js +1 -0
  53. data/tools/dataextractor/{RangebarWidget-CJSUof1--661a6e4b51cab637183e.js → RangebarWidget-B43rOEnA-7edc938b7579ddbc0a1c.js} +1 -1
  54. data/tools/dataextractor/{RollupWidget-C977Lkcx-3ae75d3c4a2c4fd3048c.js → RollupWidget-BEEjvyua-1cb0045b8391e40b092b.js} +1 -1
  55. data/tools/dataextractor/{ScrollwindowWidget-BFxz61oW-11083dcc92493b36f51b.js → ScrollwindowWidget-CUUtkAh4-b88476be8393325bcee9.js} +1 -1
  56. data/tools/dataextractor/{SignalWidget-BT6AcbBx-87df19489741e9c87fa5.js → SignalWidget-CbvidVbl-47cc56cf6111509642cc.js} +1 -1
  57. data/tools/dataextractor/{SpacerWidget-B_f09KAi-e7a9e18824431e35eb57.js → SpacerWidget-BukDoKlv-0fb5874f5c51902b2d74.js} +1 -1
  58. data/tools/dataextractor/SparklineWidget-BjSNHLGS-d3018ea40cbc91c909cd.js +1 -0
  59. data/tools/dataextractor/TabbookWidget-5Dz5n4sQ-a8fd98b2e9aff142b1f5.js +1 -0
  60. data/tools/dataextractor/TargetPacketItemChooser-CVGMtU04-ec3cf60712a2f39fa0da.js +1 -0
  61. data/tools/dataextractor/TextboxWidget-QzrrHB9s-a948fd62757acc1fb16c.js +1 -0
  62. data/tools/dataextractor/TextfieldWidget-BpDBnDUq-9a03432e1a4a19c48d99.js +1 -0
  63. data/tools/dataextractor/TimeWidget-CjZInJFT-faab2e9938442fb0b771.js +1 -0
  64. data/tools/dataextractor/TitleWidget-C9VC8OUI-bc587be955b9030990a2.js +1 -0
  65. data/tools/dataextractor/{VWidget-C4VLQ7-b-1126b116a416d121c008.js → VWidget-D8HzcrTo-46c5080712362c20af55.js} +1 -1
  66. data/tools/dataextractor/ValueWidget-CGOhPtMG-ac9aae952352e742f8c6.js +1 -0
  67. data/tools/dataextractor/ValuelimitsbarWidget-Lfq0cbnZ-9216a8334490268d31d1.js +1 -0
  68. data/tools/dataextractor/ValuelimitscolumnWidget-BH333HsT-3200ce225ae476394598.js +1 -0
  69. data/tools/dataextractor/ValuerangebarWidget-95AG0gex-6a904cf5b709dd7689f6.js +1 -0
  70. data/tools/dataextractor/VerticalWidget-fxittOB1-3e56d72a028304a9b0ea.js +1 -0
  71. data/tools/dataextractor/{VerticalboxWidget-BD5Eq3BH-904a6e5160ae7db4a651.js → VerticalboxWidget-CKnoHa-u-27d8704631035739b0ca.js} +1 -1
  72. data/tools/dataextractor/{Widget-ClRi417b-ca09328deaed4efe3ede.js → Widget-lYL8eSaS-184685bb2dd5a2a947c1.js} +1 -1
  73. data/tools/dataextractor/{main-58ef2ae57480aa824e7d.js → main-13c824ef27be48800fd9.js} +2 -2
  74. data/tools/dataextractor/main.js +1 -1
  75. metadata +73 -73
  76. data/tools/dataextractor/CanvasWidget-DsyMt7xW-bd39bce7dccaf632c4fc.js +0 -1
  77. data/tools/dataextractor/CanvasdotWidget-BZpkCAoH-4e5ef4f101d1c45c58ef.js +0 -1
  78. data/tools/dataextractor/CanvaslineWidget-jg2ozQ0N-af40156bc5036e8afe1a.js +0 -1
  79. data/tools/dataextractor/ComboboxWidget-BzKkyRDT-54a91389040556de2534.js +0 -1
  80. data/tools/dataextractor/Graph-GVQZltap-a899a85c24f92402cd6b.js +0 -1
  81. data/tools/dataextractor/HorizontalboxWidget-BnkH4cVq-13270435a51ec5890b03.js +0 -1
  82. data/tools/dataextractor/HorizontallineWidget-k7fL4EPN-e6835950fab23e268e2f.js +0 -1
  83. data/tools/dataextractor/ImageLoader-DH5e4lg8-ab7bd82e4b6c97a1d343.js +0 -1
  84. data/tools/dataextractor/LabelprogressbarWidget-DME-BrZe-c080e3f10caa92cab91a.js +0 -1
  85. data/tools/dataextractor/LabelsparklineWidget-4iDHGnPL-a4b3c7297887ce897715.js +0 -1
  86. data/tools/dataextractor/LabelvalueWidget-C6NQSHTb-c5d0fe4cae5fcd4bbf4d.js +0 -1
  87. data/tools/dataextractor/LabelvaluelimitsbarWidget-DBKZLpXJ-1145ebe0da314afb3b31.js +0 -1
  88. data/tools/dataextractor/LabelvaluelimitscolumnWidget-NdEu06go-05b4cb5c6acba5f7cb0b.js +0 -1
  89. data/tools/dataextractor/LabelvaluerangebarWidget-CL5HLK0t-10272441ee3df15c0c2d.js +0 -1
  90. data/tools/dataextractor/LinegraphWidget-Drf9tTPN-6ef8c7ff76dc3dd45a89.js +0 -1
  91. data/tools/dataextractor/RadiogroupWidget-DlQN9z-Z-737a18df0967dcab93a0.js +0 -1
  92. data/tools/dataextractor/SparklineWidget-Bji9DILO-cffcd58ebba764704623.js +0 -1
  93. data/tools/dataextractor/TabbookWidget-B74U8t2i-4ec2d216f654b67378fc.js +0 -1
  94. data/tools/dataextractor/TargetPacketItemChooser-XyyCP_cB-6fdc892d26307a74d591.js +0 -1
  95. data/tools/dataextractor/TextboxWidget-CbKE9aSW-61d80b11342c80f46880.js +0 -1
  96. data/tools/dataextractor/TextfieldWidget-CpdmfNk5-ba0b072fd637b2dbd9a0.js +0 -1
  97. data/tools/dataextractor/TimeWidget-BTaXBxVm-f4a9bc93fa17dbee8c11.js +0 -1
  98. data/tools/dataextractor/TitleWidget-ulO_gdVY-3aa67ccbdf5e87b899f5.js +0 -1
  99. data/tools/dataextractor/ValueWidget-B3-Jjoux-e8c93f5f6dc1f642c0b2.js +0 -1
  100. data/tools/dataextractor/ValuelimitsbarWidget-CqRkPwWS-3718efa59bfa32b811f9.js +0 -1
  101. data/tools/dataextractor/ValuelimitscolumnWidget-CF4CN14a-6108b13eebe9aa97b31d.js +0 -1
  102. data/tools/dataextractor/ValuerangebarWidget-DJtrknKH-fa7968c1ee5f4d2361f7.js +0 -1
  103. data/tools/dataextractor/VerticalWidget-CoJiy2TT-d8e0025943059c8b8699.js +0 -1
@@ -1,14 +1,14 @@
1
- System.register(["./main-58ef2ae57480aa824e7d.js","vue","./TargetPacketItemChooser-XyyCP_cB-6fdc892d26307a74d591.js","./OpenC3TimePicker-cOr0aOVn-25acc4b1827c96c6823a.js","vue-router","pinia","single-spa","vuetify"],(function(Os,fa){"use strict";var $t,dt,Bt,zt,Ht,Wt,x,N,q,Jt,p,v,xe,ne,ce,ve,Ae,Kt,J,Je,ht,ft,Ee,Xt,pt,Zt,Gt;return{setters:[P=>{$t=P.g,dt=P.O,Bt=P._,zt=P.R,Ht=P.a,Wt=P.k},P=>{x=P.resolveComponent,N=P.openBlock,q=P.createBlock,Jt=P.Teleport,p=P.createVNode,v=P.withCtx,xe=P.createElementVNode,ne=P.toDisplayString,ce=P.createElementBlock,ve=P.Fragment,Ae=P.renderList,Kt=P.ref,J=P.createTextVNode,Je=P.mergeProps,ht=P.createSlots,ft=P.normalizeStyle,Ee=P.createCommentVNode,Xt=P.withModifiers,pt=P.withKeys},P=>{Zt=P._},P=>{Gt=P.w},null,null,null,null],execute:(function(){var P=document.createElement("style");P.textContent=`.title-font[data-v-05a98b50]{font-size:1.125rem}.v-progress-linear__determinate[data-v-05a98b50]{transition:none!important}
2
- /*$vite$:1*/`,document.head.appendChild(P);const Ts={__name:"TopBarMenu",props:{menu:{type:Object,required:!0},title:{type:String,required:!0}},emits:["submenu-click"],setup(t,{emit:e}){const r=e,s=Kt(!1);function n(){s.value=!1}function o(i){return i.replaceAll(" ","-").toLowerCase()}return(i,a)=>{const l=x("v-icon"),d=x("v-btn"),u=x("v-divider"),h=x("v-list-item-title"),g=x("v-list-item"),_=x("v-list"),R=x("v-menu"),A=x("v-radio"),m=x("v-list-item-action"),w=x("v-radio-group"),b=x("v-checkbox"),E=x("v-tooltip");return N(),q(R,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=f=>s.value=f),"close-on-content-click":!1},{activator:v(({props:f})=>[p(d,Je(f,{variant:"outlined",class:"mx-1 menu-button",text:t.menu.label,"data-test":o(`${t.title} ${t.menu.label}`)}),{append:v(()=>[p(l,{class:"menu-button-icon"},{default:v(()=>[...a[1]||(a[1]=[J(" mdi-menu-down ",-1)])]),_:1})]),_:1},16,["text","data-test"])]),default:v(()=>[p(_,null,{default:v(()=>[(N(!0),ce(ve,null,Ae(t.menu.items,(f,k)=>(N(),ce(ve,null,[f.divider?(N(),q(u,{key:k+"-divider"})):f.subMenu&&f.subMenu.length>0?(N(),ce("div",{key:k+"-submenu"},[(N(),q(R,{key:k,"open-on-hover":"",location:"right"},{activator:v(({props:T})=>[(N(),q(g,Je({ref_for:!0},T,{key:k,disabled:f.disabled}),ht({append:v(()=>[p(l,null,{default:v(()=>[...a[2]||(a[2]=[J(" mdi-chevron-right ",-1)])]),_:1})]),default:v(()=>[!f.radio&&!f.checkbox?(N(),q(h,{key:0,style:ft("cursor: pointer;"+(f.disabled?"opacity: 0.2":""))},{default:v(()=>[J(ne(f.label),1)]),_:2},1032,["style"])):Ee("",!0)]),_:2},[f.icon?{name:"prepend",fn:v(()=>[p(l,{disabled:f.disabled},{default:v(()=>[J(ne(f.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:v(()=>[p(_,null,{default:v(()=>[(N(!0),ce(ve,null,Ae(f.subMenu,(T,L)=>(N(),q(g,{key:L,"prepend-icon":T.icon,onClick:Z=>r("submenu-click",T)},{default:v(()=>[p(h,null,{default:v(()=>[J(ne(T.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):f.radioGroup?(N(),q(w,{key:k+"-radio-group",class:"ma-0 pa-0",density:"compact","hide-details":"","model-value":f.value,"onUpdate:modelValue":f.command},{default:v(()=>[(N(!0),ce(ve,null,Ae(f.choices,(T,L)=>(N(),q(g,{key:L+"-choice"},{default:v(()=>[p(m,{class:"list-action"},{default:v(()=>[p(A,{color:"secondary",label:T.label,value:T.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(N(),q(E,{key:k+"-list",disabled:!f.tooltip,text:f.tooltip,location:"right"},{activator:v(({props:T})=>[xe("div",Je({ref_for:!0},T),[p(g,{disabled:f.disabled,"data-test":o(`${t.title} ${t.menu.label} ${f.label}`),onClick:()=>{f.command(f),f.checkbox||n()}},ht({default:v(()=>[f.checkbox?(N(),q(m,{key:0,class:"list-action"},{default:v(()=>[p(b,{modelValue:f.checked,"onUpdate:modelValue":L=>f.checked=L,label:f.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):Ee("",!0),!f.radio&&!f.checkbox?(N(),q(h,{key:1,style:ft("cursor: pointer;"+(f.disabled?"opacity: 0.2":""))},{default:v(()=>[J(ne(f.label),1)]),_:2},1032,["style"])):Ee("",!0)]),_:2},[f.icon?{name:"prepend",fn:v(()=>[p(l,{icon:f.icon,disabled:f.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["disabled","data-test","onClick"])],16)]),_:2},1032,["disabled","text"]))],64))),256))]),_:1})]),_:1},8,["modelValue"])}}},Cs={components:{TopBarMenu:Ts},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}}},Rs={class:"app-title mr-2"};function xs(t,e,r,s,n,o){const i=x("v-col"),a=x("v-row"),l=x("TopBarMenu");return N(),q(Jt,{to:"#openc3-menu"},[p(a,{"no-gutters":""},{default:v(()=>[p(i,{"align-self":"end"},{default:v(()=>[xe("span",Rs,ne(r.title),1)]),_:1})]),_:1}),p(a,{dense:"",class:"flex-nowrap"},{default:v(()=>[(N(!0),ce(ve,null,Ae(r.menus,(d,u)=>(N(),q(l,{key:u+"-top-menu",ref_for:!0,ref:"topmenu",menu:d,title:r.title,onSubmenuClick:o.subMenuClick},null,8,["menu","title","onSubmenuClick"]))),128))]),_:1})])}const As=$t(Cs,[["render",xs],["__scopeId","data-v-f4fb184e"]]),Ps="__default",ks={data:{dontSaveDefaultConfig:!1},created:function(){if(!this.configKey)throw alert("Components using the Config mixin must provide a configKey"),new Error("Components using the Config mixin must provide a configKey")},computed:{storageKey(){return`${this.configKey}${Ps}`}},methods:{loadDefaultConfig:function(){const t=localStorage.getItem(this.storageKey);return t?JSON.parse(t):{}},saveDefaultConfig:function(t){this.dontSaveDefaultConfig||localStorage.setItem(this.storageKey,JSON.stringify(t))},openConfigBase:function(t,e=!1,r=null){new dt().load_config(this.configKey,t).then(s=>{s?(this.$notify.normal({title:"Loading configuration",body:t}),r&&r(JSON.parse(s)),e||this.$route.fullPath.includes(t)||this.$router.push({query:{config:t}})):this.$notify.caution({title:"Unknown configuration",body:t})}).catch(s=>{s&&this.$notify.serious({title:`Error opening configuration: ${t}`,body:s})})},saveConfigBase:function(t,e){new dt().save_config(this.configKey,t,JSON.stringify(e)).then(()=>{this.$notify.normal({title:"Saved configuration",body:t})}).catch(r=>{r&&this.$notify.serious({title:`Error saving configuration: ${t}`,body:r})})},resetConfigBase:function(){localStorage.removeItem(this.storageKey);const t={...this.$route.query};delete t.config,this.$router.replace({query:t})}}};function Qt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ds}=Object.prototype,{getPrototypeOf:ue}=Object,{iterator:Pe,toStringTag:Yt}=Symbol,ke=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),er=t=>typeof t=="string"&&(t==="__proto__"||t==="constructor"||t==="prototype"),tr=(t,e,r)=>t===Object.prototype||!r&&e===null,Ns=t=>{if(!Object.isExtensible(t))return!1;const e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&e.push(...Object.getOwnPropertySymbols(t)),e.every(r=>{if(er(r))return!1;const s=Object.getOwnPropertyDescriptor(t,r);return!!s&&s.configurable&&s.writable===!0})},De=(t,e)=>{let r=t;const s=[];for(;r!=null;){if(s.indexOf(r)!==-1)return!1;s.push(r);const n=ue(r);if(tr(r,n,r===t))return!1;if(ke(r,e))return!0;r=n}return!1},js=(t,e)=>t!=null&&De(t,e)?t[e]:void 0,Is=t=>{if(t==null||typeof t!="object"&&typeof t!="function")return t;const e=ue(t);if(e===null&&Ns(t))return t;const r=Object.create(null),s=Object.create(null),n=[];let o=t;for(;o!=null&&n.indexOf(o)===-1;){n.push(o);const i=o===t?e:ue(o);if(tr(o,i,o===t))break;const a=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(o));for(const l of a)er(l)||ke(s,l)||(r[l]=t[l],s[l]=!0);o=i}return r},mt=(t=>e=>{const r=Ds.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Q=t=>(t=t.toLowerCase(),e=>mt(e)===t),Ke=t=>e=>typeof e===t,{isArray:he}=Array,fe=Ke("undefined");function Se(t){return t!==null&&!fe(t)&&t.constructor!==null&&!fe(t.constructor)&&K(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const rr=Q("ArrayBuffer");function Us(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&rr(t.buffer),e}const Ls=Ke("string"),K=Ke("function"),sr=Ke("number"),Oe=t=>t!==null&&typeof t=="object",Ms=t=>t===!0||t===!1,Xe=t=>{if(!Oe(t))return!1;const e=ue(t);return(e===null||e===Object.prototype||ue(e)===null)&&!De(t,Yt)&&!De(t,Pe)},Fs=t=>{if(!Oe(t)||Se(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Vs=Q("Date"),qs=Q("File"),$s=t=>!!(t&&typeof t.uri<"u"),Bs=t=>t&&typeof t.getParts<"u",zs=Q("Blob"),Hs=Q("FileList"),Ws=Q("Set"),Js=t=>Oe(t)&&K(t.pipe);function Ks(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const nr=Ks(),ir=typeof nr.FormData<"u"?nr.FormData:void 0,Xs=t=>{if(!t)return!1;if(ir&&t instanceof ir)return!0;const e=ue(t);if(!e||e===Object.prototype||!K(t.append))return!1;const r=mt(t);return r==="formdata"||r==="object"&&K(t.toString)&&t.toString()==="[object FormData]"},Zs=Q("URLSearchParams"),[Gs,Qs,Ys,en]=["ReadableStream","Request","Response","Headers"].map(Q),tn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,n;if(typeof t!="object"&&(t=[t]),he(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{if(Se(t))return;const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(s=0;s<i;s++)a=o[s],e.call(null,t[a],a,t)}}function or(t,e){if(Se(t))return null;e=e.toLowerCase();const r=Object.keys(t);let s=r.length,n;for(;s-- >0;)if(n=r[s],e===n.toLowerCase())return n;return null}const pe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ar=t=>!fe(t)&&t!==pe;function gt(...t){const{caseless:e,skipUndefined:r}=ar(this)&&this||{},s={},n=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const a=e&&typeof i=="string"&&or(s,i)||i,l=ke(s,a)?s[a]:void 0;Xe(l)&&Xe(o)?s[a]=gt(l,o):Xe(o)?s[a]=gt({},o):he(o)?s[a]=o.slice():(!r||!fe(o))&&(s[a]=o)};for(let o=0,i=t.length;o<i;o++){const a=t[o];if(!a||Se(a)||(Ne(a,n),typeof a!="object"||he(a)))continue;const l=Object.getOwnPropertySymbols(a);for(let d=0;d<l.length;d++){const u=l[d];pn.call(a,u)&&n(a[u],u)}}return s}const rn=(t,e,r,{allOwnKeys:s}={})=>(Ne(e,(n,o)=>{r&&K(n)?Object.defineProperty(t,o,{__proto__:null,value:Qt(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),t),sn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),nn=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:e.prototype}),r&&Object.assign(t.prototype,r)},on=(t,e,r,s)=>{let n,o,i;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),o=n.length;o-- >0;)i=n[o],(!s||s(i,t,e))&&!a[i]&&(e[i]=t[i],a[i]=!0);t=r!==!1&&ue(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},an=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const s=t.indexOf(e,r);return s!==-1&&s===r},ln=t=>{if(!t)return null;if(he(t))return t;let e=t.length;if(!sr(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},cn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ue(Uint8Array)),un=(t,e)=>{const r=(t&&t[Pe]).call(t);let s;for(;(s=r.next())&&!s.done;){const n=s.value;e.call(t,n[0],n[1])}},dn=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},hn=Q("HTMLFormElement"),fn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,r,s){return r.toUpperCase()+s}),{propertyIsEnumerable:pn}=Object.prototype,mn=Q("RegExp"),lr=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};Ne(r,(n,o)=>{let i;(i=e(n,o,t))!==!1&&(s[o]=i||n)}),Object.defineProperties(t,s)},gn=t=>{lr(t,(e,r)=>{if(K(t)&&["arguments","caller","callee"].includes(r))return!1;const s=t[r];if(K(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},bn=(t,e)=>{const r={},s=n=>{n.forEach(o=>{r[o]=!0})};return he(t)?s(t):s(String(t).split(e)),r},_n=()=>{},yn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function wn(t){return!!(t&&K(t.append)&&t[Yt]==="FormData"&&t[Pe])}const vn=t=>{const e=new WeakSet,r=s=>{if(Oe(s)){if(e.has(s))return;if(Se(s))return s;if(!("toJSON"in s)){e.add(s);let n;if(Ws(s)){n=[];for(const o of s){const i=r(o);!fe(i)&&n.push(i)}}else n=he(s)?[]:{},Ne(s,(o,i)=>{const a=r(o);!fe(a)&&(n[i]=a)});return e.delete(s),n}}return s};return r(t)},En=Q("AsyncFunction"),Sn=t=>t&&(Oe(t)||K(t))&&K(t.then)&&K(t.catch),cr=((t,e)=>t?setImmediate:e?((r,s)=>(pe.addEventListener("message",({source:n,data:o})=>{n===pe&&o===r&&s.length&&s.shift()()},!1),n=>{s.push(n),pe.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",K(pe.postMessage)),On=typeof queueMicrotask<"u"?queueMicrotask.bind(pe):typeof process<"u"&&process.nextTick||cr,ur=t=>t!=null&&K(t[Pe]),Tn=t=>t!=null&&De(t,Pe)&&ur(t),c={isArray:he,isArrayBuffer:rr,isBuffer:Se,isFormData:Xs,isArrayBufferView:Us,isString:Ls,isNumber:sr,isBoolean:Ms,isObject:Oe,isPlainObject:Xe,isEmptyObject:Fs,isReadableStream:Gs,isRequest:Qs,isResponse:Ys,isHeaders:en,isUndefined:fe,isDate:Vs,isFile:qs,isReactNativeBlob:$s,isReactNative:Bs,isBlob:zs,isRegExp:mn,isFunction:K,isStream:Js,isURLSearchParams:Zs,isTypedArray:cn,isFileList:Hs,forEach:Ne,merge:gt,extend:rn,trim:tn,stripBOM:sn,inherits:nn,toFlatObject:on,kindOf:mt,kindOfTest:Q,endsWith:an,toArray:ln,forEachEntry:un,matchAll:dn,isHTMLForm:hn,hasOwnProperty:ke,hasOwnProp:ke,hasOwnInPrototypeChain:De,getSafeProp:js,toSafeFlatObject:Is,reduceDescriptors:lr,freezeMethods:gn,toObjectSet:bn,toCamelCase:fn,noop:_n,toFiniteNumber:yn,findKey:or,global:pe,isContextDefined:ar,isSpecCompliantForm:wn,toJSONObject:vn,isAsyncFn:En,isThenable:Sn,setImmediate:cr,asap:On,isIterable:ur,isSafeIterable:Tn},Cn=c.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"]),Rn=t=>{const e={};let r,s,n;return t&&t.split(`
3
- `).forEach(function(o){n=o.indexOf(":"),r=o.substring(0,n).trim().toLowerCase(),s=o.substring(n+1).trim();const i=c.hasOwnProp(e,r);!r||i&&c.hasOwnProp(Cn,r)||(r==="set-cookie"?i?e[r].push(s):e[r]=[s]:e[r]=i?e[r]+", "+s:s)}),e};function xn(t){let e=0,r=t.length;for(;e<r;){const s=t.charCodeAt(e);if(s!==9&&s!==32)break;e+=1}for(;r>e;){const s=t.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return e===0&&r===t.length?t:t.slice(e,r)}const An=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Pn=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function bt(t,e){return c.isArray(t)?t.map(r=>bt(r,e)):xn(String(t).replace(e,""))}const kn=t=>bt(t,An),Dn=t=>bt(t,Pn);function dr(t){const e=Object.create(null);return c.forEach(t.toJSON(),(r,s)=>{e[s]=Dn(r)}),e}const hr=Symbol("internals");function je(t){return t&&String(t).trim().toLowerCase()}function Ze(t){return t===!1||t==null?t:c.isArray(t)?t.map(Ze):kn(String(t))}function Nn(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}const jn=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function _t(t){let e=0,r=t.length;for(;e<r;){const s=t.charCodeAt(e);if(s!==9&&s!==32)break;e+=1}for(;r>e;){const s=t.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return e===0&&r===t.length?t:t.slice(e,r)}function In(t){const e=t.length-1;if(e<1||t.charCodeAt(0)!==34||t.charCodeAt(e)!==34)return t;let r="";for(let s=1;s<e;s++){const n=t.charCodeAt(s);if(n===34||n===92&&(s+=1,s>=e))return t;r+=t[s]}return r}function Un(t){const e=Object.create(null),r=String(t);let s=0,n=!1,o=!1;function i(a){const l=_t(r.slice(s,a)),d=l.indexOf("=");if(d<1)return;const u=_t(l.slice(0,d));if(!jn.test(u))return;const h=u.toLowerCase();if(h==="__proto__"||h==="constructor"||h==="prototype")return;const g=_t(l.slice(d+1));e[h]=In(g)}for(let a=0;a<r.length;a++){const l=r.charCodeAt(a);n?o?o=!1:l===92?o=!0:l===34&&(n=!1):l===34?n=!0:(l===44||l===59)&&(i(a),s=a+1)}return i(r.length),e}const Ln=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function yt(t,e,r,s,n){if(c.isFunction(s))return s.call(this,e,r);if(n&&(e=r),!!c.isString(e)){if(c.isString(s))return e.indexOf(s)!==-1;if(c.isRegExp(s))return s.test(e)}}function Mn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function Fn(t,e){const r=c.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{__proto__:null,value:function(n,o,i){return this[s].call(this,e,n,o,i)},configurable:!0})})}let $=class{constructor(t){t&&this.set(t)}set(t,e,r){const s=this;function n(i,a,l){const d=je(a);if(!d)return;const u=c.findKey(s,d);(!u||s[u]===void 0||l===!0||l===void 0&&s[u]!==!1)&&(s[u||a]=Ze(i))}const o=(i,a)=>c.forEach(i,(l,d)=>n(l,d,a));if(c.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(c.isString(t)&&(t=t.trim())&&!Ln(t))o(Rn(t),e);else if(c.isObject(t)&&c.isSafeIterable(t)){let i=Object.create(null),a,l;for(const d of t){if(!c.isArray(d))throw new TypeError("Object iterator must return a key-value pair");l=d[0],c.hasOwnProp(i,l)?(a=i[l],i[l]=c.isArray(a)?[...a,d[1]]:[a,d[1]]):i[l]=d[1]}o(i,e)}else t!=null&&n(e,t,r);return this}get(t,e){if(t=je(t),t){const r=c.findKey(this,t);if(r){const s=this[r];if(!e)return s;if(e===!0)return Nn(s);if(c.isFunction(e))return e.call(this,s,r);if(c.isRegExp(e))return e.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=je(t),t){const r=c.findKey(this,t);return!!(r&&this[r]!==void 0&&(!e||yt(this,this[r],r,e)))}return!1}delete(t,e){const r=this;let s=!1;function n(o){if(o=je(o),o){const i=c.findKey(r,o);i&&(!e||yt(r,r[i],i,e))&&(delete r[i],s=!0)}}return c.isArray(t)?t.forEach(n):n(t),s}clear(t){const e=Object.keys(this);let r=e.length,s=!1;for(;r--;){const n=e[r];(!t||yt(this,this[n],n,t,!0))&&(delete this[n],s=!0)}return s}normalize(t){const e=this,r={};return c.forEach(this,(s,n)=>{const o=c.findKey(r,n);if(o){e[o]=Ze(s),delete e[n];return}const i=t?Mn(n):String(n).trim();i!==n&&delete e[n],e[i]=Ze(s),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return c.forEach(this,(r,s)=>{r!=null&&r!==!1&&(e[s]=t&&c.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
4
- `)}getSetCookie(){const t=this.get("set-cookie");return c.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Un(t)}static concat(t,...e){const r=new this(t);return e.forEach(s=>r.set(s)),r}static accessor(t){const e=(this[hr]=this[hr]={accessors:{}}).accessors,r=this.prototype;function s(n){const o=je(n);e[o]||(Fn(r,n),e[o]=!0)}return c.isArray(t)?t.forEach(s):s(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors($.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}}),c.freezeMethods($);const Ge="[REDACTED ****]";function Vn(t){if(c.hasOwnProp(t,"toJSON"))return!0;let e=Object.getPrototypeOf(t);for(;e&&e!==Object.prototype;){if(c.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function qn(t,e){const r=new Set(e.map(o=>String(o).toLowerCase())),s=[],n=o=>{if(o===null||typeof o!="object"||c.isBuffer(o))return o;if(s.indexOf(o)!==-1)return;o instanceof $&&(o=o.toJSON()),s.push(o);let i;if(c.isArray(o))i=[],o.forEach((a,l)=>{const d=n(a);c.isUndefined(d)||(i[l]=d)});else{if(!c.isPlainObject(o)&&Vn(o))return s.pop(),o;i=Object.create(null);for(const[a,l]of Object.entries(o)){const d=r.has(a.toLowerCase())?Ge:n(l);c.isUndefined(d)||(i[a]=d)}}return s.pop(),i};return n(t)}function fr(t){try{return String(t)}catch{return""}}function $n(t){return t.errors.map(e=>{try{return e&&e.message?fr(e.message):fr(e)}catch{return""}}).filter(Boolean).join("; ")||t.name||"AggregateError"}let y=class Es extends Error{static from(e,r,s,n,o,i){let a=e.message;!a&&c.isArray(e.errors)&&e.errors.length&&(a=$n(e));const l=new Es(a,r||e.code,s,n,o);return Object.defineProperty(l,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),l.name=e.name,e.status!=null&&l.status==null&&(l.status=e.status),i&&Object.assign(l,i),l}constructor(e,r,s,n,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),s&&(this.config=s),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,r=e&&c.hasOwnProp(e,"redact")?e.redact:void 0,s=c.isArray(r)&&r.length>0?qn(e,r):c.toJSONObject(e);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:s,code:this.code,status:this.status}}};y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",y.ERR_BAD_OPTION="ERR_BAD_OPTION",y.ECONNABORTED="ECONNABORTED",y.ETIMEDOUT="ETIMEDOUT",y.ECONNREFUSED="ECONNREFUSED",y.ERR_NETWORK="ERR_NETWORK",y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",y.ERR_DEPRECATED="ERR_DEPRECATED",y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",y.ERR_BAD_REQUEST="ERR_BAD_REQUEST",y.ERR_CANCELED="ERR_CANCELED",y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",y.ERR_INVALID_URL="ERR_INVALID_URL",y.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Bn=null,pr=100;function wt(t){return c.isPlainObject(t)||c.isArray(t)}function mr(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function vt(t,e,r){return t?t.concat(e).map(function(s,n){return s=mr(s),!r&&n?"["+s+"]":s}).join(r?".":""):e}function zn(t){return c.isArray(t)&&!t.some(wt)}const Hn=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Qe(t,e,r){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const s=(b,E)=>{const f=c.getSafeProp(r,b);return c.isUndefined(f)?E:f},n=s("metaTokens",!0),o=s("visitor")||A,i=s("dots",!1),a=s("indexes",!1),l=s("Blob")||typeof Blob<"u"&&Blob,d=s("maxDepth",pr),u=l&&c.isSpecCompliantForm(e),h=[];if(!c.isFunction(o))throw new TypeError("visitor must be a function");function g(b){if(b===null)return"";if(c.isDate(b))return b.toISOString();if(c.isBoolean(b))return b.toString();if(!u&&c.isBlob(b))throw new y("Blob is not supported. Use a Buffer instead.");if(c.isArrayBuffer(b)||c.isTypedArray(b)){if(u&&typeof l=="function")return new l([b]);throw new y("Blob is not supported. Use a Buffer instead.",y.ERR_NOT_SUPPORT)}return b}function _(b){if(b>d)throw new y("Object is too deeply nested ("+b+" levels). Max depth: "+d,y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function R(b,E){if(d===1/0)return JSON.stringify(b);const f=[];return JSON.stringify(b,function(k,T){if(!c.isObject(T))return T;for(;f.length&&f[f.length-1]!==this;)f.pop();return f.push(T),_(E+f.length-1),T})}function A(b,E,f){let k=b;if(c.isReactNative(e)&&c.isReactNativeBlob(b))return e.append(vt(f,E,i),g(b)),!1;if(b&&!f&&typeof b=="object"){if(c.endsWith(E,"{}"))E=n?E:E.slice(0,-2),b=R(b,1);else if(c.isArray(b)&&zn(b)||(c.isFileList(b)||c.endsWith(E,"[]"))&&(k=c.toArray(b)))return E=mr(E),k.forEach(function(T,L){!(c.isUndefined(T)||T===null)&&e.append(a===!0?vt([E],L,i):a===null?E:E+"[]",g(T))}),!1}return wt(b)?!0:(e.append(vt(f,E,i),g(b)),!1)}const m=Object.assign(Hn,{defaultVisitor:A,convertValue:g,isVisitable:wt});function w(b,E,f=0){if(!c.isUndefined(b)){if(_(f),h.indexOf(b)!==-1)throw new Error("Circular reference detected in "+E.join("."));h.push(b),c.forEach(b,function(k,T){(!(c.isUndefined(k)||k===null)&&o.call(e,k,c.isString(T)?T.trim():T,E,m))===!0&&w(k,E?E.concat(T):[T],f+1)}),h.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return w(t),e}function gr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(r){return e[r]})}function Et(t,e){this._pairs=[],t&&Qe(t,this,e)}const br=Et.prototype;br.append=function(t,e){this._pairs.push([t,e])},br.toString=function(t){const e=t?r=>t.call(this,r,gr):gr;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function Wn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _r(t,e,r){if(!e)return t;t=t||"";const s=c.isFunction(r)?{serialize:r}:r,n=c.getSafeProp(s,"encode")||Wn,o=c.getSafeProp(s,"serialize");let i;if(o?i=o(e,s):i=c.isURLSearchParams(e)?e.toString():new Et(e,s).toString(n),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}const Ie=Symbol("internals");function yr(t){return t?t.length:0}function wr(t){if(t)for(;t.length&&t[t.length-1]===null;)t.pop()}function Ue(t,e){const r=t.handlers,s=yr(r);r!==e.handlersRef?(e.handlersRef=r,e.handlerEntries.clear()):s!==e.handlersLength&&(s?e.handlerEntries.forEach(function(n,o){r[n.index]!==n.handler&&e.handlerEntries.delete(o)}):e.handlerEntries.clear()),e.handlersLength=s}class vr{constructor(){this.handlers=[],this[Ie]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,r,s){const n={fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null},o=this[Ie];this.handlers==null&&(this.handlers=[]),Ue(this,o);const i=o.nextId++;return this.handlers.push(n),o.handlerEntries.set(i,{handler:n,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}eject(e){const r=this[Ie];Ue(this,r);const s=r.handlerEntries.get(e);if(s){if(r.handlerEntries.delete(e),this.handlers[s.index]!==s.handler)return;this.handlers[s.index]=null,r.iterationDepth||(wr(this.handlers),r.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Ue(this,this[Ie]))}forEach(e){const r=this[Ie];Ue(this,r),r.iterationDepth++;try{c.forEach(this.handlers,function(s){s!==null&&e(s)})}finally{--r.iterationDepth||(Ue(this,r),wr(this.handlers),r.handlersLength=yr(this.handlers))}}}const St={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Jn=typeof URLSearchParams<"u"?URLSearchParams:Et,Kn=typeof FormData<"u"?FormData:null,Xn=typeof Blob<"u"?Blob:null,Zn={isBrowser:!0,classes:{URLSearchParams:Jn,FormData:Kn,Blob:Xn},protocols:["http","https","file","blob","url","data"]},Ot=typeof window<"u"&&typeof document<"u",Tt=typeof navigator=="object"&&navigator||void 0,Gn=Ot&&(!Tt||["ReactNative","NativeScript","NS"].indexOf(Tt.product)<0),Qn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yn=Ot&&window.location.href||"http://localhost",ei=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ot,hasStandardBrowserEnv:Gn,hasStandardBrowserWebWorkerEnv:Qn,navigator:Tt,origin:Yn},Symbol.toStringTag,{value:"Module"})),V={...ei,...Zn};function ti(t,e){return Qe(t,new V.classes.URLSearchParams,{visitor:function(r,s,n,o){return V.isNode&&c.isBuffer(r)?(this.append(s,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}const Er=pr;function Sr(t){if(t>Er)throw new y("FormData field is too deeply nested ("+t+" levels). Max depth: "+Er,y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function ri(t){const e=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;let s;for(;(s=r.exec(t))!==null;)Sr(e.length),e.push(s[0]==="[]"?"":s[1]||s[0]);return e}function si(t){const e={},r=Object.keys(t);let s;const n=r.length;let o;for(s=0;s<n;s++)o=r[s],e[o]=t[o];return e}function Or(t){function e(r,s,n,o){Sr(o);let i=r[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=o>=r.length;return i=!i&&c.isArray(n)?n.length:i,l?(c.hasOwnProp(n,i)?n[i]=c.isArray(n[i])?n[i].concat(s):[n[i],s]:n[i]=s,!a):((!c.hasOwnProp(n,i)||!c.isObject(n[i]))&&(n[i]=[]),e(r,s,n[i],o)&&c.isArray(n[i])&&(n[i]=si(n[i])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const r={};return c.forEachEntry(t,(s,n)=>{e(ri(s),n,r,0)}),r}return null}const Tr=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Te=(t,e)=>t!=null&&c.hasOwnProp(t,e)?t[e]:void 0;function ni(t,e,r){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}const Le={transitional:St,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",s=r.indexOf("application/json")>-1,n=c.isObject(t);if(n&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(Or(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(n){const i=Te(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return ti(t,i).toString();if((o=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const a=Te(this,"env"),l=a&&a.FormData;return Qe(o?{"files[]":t}:t,l&&new l,i)}}return n||s?(e.setContentType("application/json",!1),ni(t)):t}],transformResponse:[function(t){const e=Te(this,"transitional")||Le.transitional,r=e&&e.forcedJSONParsing,s=Te(this,"responseType"),n=s==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!s||n)){const o=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,Te(this,"parseReviver"))}catch(i){if(o)throw i.name==="SyntaxError"?y.from(i,y.ERR_BAD_RESPONSE,this,null,Te(this,"response")):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:V.classes.FormData,Blob:V.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(Tr,t=>{Le.headers[t]={}});function Ct(t,e){const r=this||Le,s=e||r,n=$.from(s.headers);let o=s.data;return c.forEach(t,function(i){o=i.call(r,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function Cr(t){return!!(t&&t.__CANCEL__)}let Me=class extends y{constructor(t,e,r){super(t??"canceled",y.ERR_CANCELED,e,r),this.name="CanceledError",this.__CANCEL__=!0}};function Rr(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new y("Request failed with status code "+r.status,r.status>=400&&r.status<500?y.ERR_BAD_REQUEST:y.ERR_BAD_RESPONSE,r.config,r.request,r))}const ii=/[\t\n\r]/g;function xr(t){if(typeof t!="string")return t;let e=0;for(;e<t.length&&t.charCodeAt(e)<=32;)e++;return t.slice(e).replace(ii,"")}function Rt(t){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return e&&e[1]||""}function oi(t,e){t=t||10;const r=new Array(t),s=new Array(t);let n=0,o=0,i;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),d=s[o];i||(i=l),r[n]=a,s[n]=l;let u=o,h=0;for(;u!==n;)h+=r[u++],u=u%t;if(n=(n+1)%t,n===o&&(o=(o+1)%t),l-i<e)return;const g=d&&l-d;return g?Math.round(h*1e3/g):void 0}}function ai(t,e){let r=0,s=1e3/e,n,o;const i=(a,l=Date.now())=>{r=l,n=null,o&&(clearTimeout(o),o=null),t(...a)};return[(...a)=>{const l=Date.now(),d=l-r;d>=s?i(a,l):(n=a,o||(o=setTimeout(()=>{o=null,i(n)},s-d)))},()=>n&&i(n),(...a)=>i(a)]}const Ye=(t,e,r=3)=>{let s=0;const n=oi(50,250);return ai(o=>{if(!o||!c.isNumber(o.loaded))return;const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=Math.max(0,a!=null?Math.min(i,a):i),d=Math.max(0,l-s),u=n(d);s=Math.max(s,l);const h={loaded:l,total:a,progress:a?l/a:void 0,bytes:d,rate:u||void 0,estimated:u&&a?(a-l)/u:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},r)},Ar=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},Pr=(t,e=c.asap)=>(...r)=>e(()=>t(...r)),li=V.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,V.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(V.origin),V.navigator&&/(msie|trident)/i.test(V.navigator.userAgent)):()=>!0,ci=V.hasStandardBrowserEnv?{write(t,e,r,s,n,o,i){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(s)&&a.push(`path=${s}`),c.isString(n)&&a.push(`domain=${n}`),o===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let r=0;r<e.length;r++){const s=e[r].replace(/^\s+/,""),n=s.indexOf("=");if(n!==-1&&s.slice(0,n)===t)try{return decodeURIComponent(s.slice(n+1))}catch{return s.slice(n+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ui(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function di(t,e){if(!e)return t;let r=t.length;for(;r>0&&t.charCodeAt(r-1)===47;)r--;return t.slice(0,r)+"/"+e.replace(/^\/+/,"")}const hi=/^https?:(?!\/\/)/i;function fi(t){return t&&t.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,r,s="")=>`${r}${s}${Ge}`)}function pi(t){const e=t.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Ge}@`),r=e.indexOf("#"),s=(r===-1?e:e.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Ge}`);return r===-1?s:`${s}#${fi(e.slice(r+1))}`}function kr(t,e){if(typeof t=="string"){const r=xr(t);if(hi.test(r))throw new y(`Invalid URL ${JSON.stringify(pi(r))}: missing "//" after protocol`,y.ERR_INVALID_URL,e)}}function Dr(t,e,r,s){kr(e,s);let n=!ui(e);return t&&(n||r===!1)?(kr(t,s),di(t,e)):e}const Nr=t=>t instanceof $?{...t}:t,mi=t=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(t).concat(Object.getOwnPropertySymbols(t).filter(e=>Object.getOwnPropertyDescriptor(t,e).enumerable)):Object.keys(t);function me(t,e){t=t||{},e=e||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function s(u,h,g,_){return c.isPlainObject(u)&&c.isPlainObject(h)?c.merge.call({caseless:_},u,h):c.isPlainObject(h)?c.merge({},h):c.isArray(h)?h.slice():h}function n(u,h,g,_){if(c.isUndefined(h)){if(!c.isUndefined(u))return s(void 0,u,g,_)}else return s(u,h,g,_)}function o(u,h){if(!c.isUndefined(h))return s(void 0,h)}function i(u,h){if(c.isUndefined(h)){if(!c.isUndefined(u))return s(void 0,u)}else return s(void 0,h)}function a(u){const h=c.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!c.isUndefined(h))if(c.isPlainObject(h)){if(c.hasOwnProp(h,u))return h[u]}else return;const g=c.hasOwnProp(t,"transitional")?t.transitional:void 0;if(c.isPlainObject(g)&&c.hasOwnProp(g,u))return g[u]}function l(u,h,g){if(c.hasOwnProp(e,g))return s(u,h);if(c.hasOwnProp(t,g))return s(void 0,u)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutErrorMessage: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,allowedSocketPaths:i,responseEncoding:i,validateStatus:l,headers:(u,h,g)=>n(Nr(u),Nr(h),g,!0)};return c.forEach(mi({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=c.hasOwnProp(d,u)?d[u]:n,g=c.hasOwnProp(t,u)?t[u]:void 0,_=c.hasOwnProp(e,u)?e[u]:void 0,R=h(g,_,u);c.isUndefined(R)&&h!==l||(r[u]=R)}),c.hasOwnProp(e,"validateStatus")&&c.isUndefined(e.validateStatus)&&a("validateStatusUndefinedResolves")===!1&&(c.hasOwnProp(t,"validateStatus")?r.validateStatus=s(void 0,t.validateStatus):delete r.validateStatus),r}const gi=["content-type","content-length"];function bi(t,e,r){if(r!=="content-only"){t.set(e);return}Object.entries(e||{}).forEach(([s,n])=>{gi.includes(s.toLowerCase())&&t.set(s,n)})}const _i=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,r)=>String.fromCharCode(parseInt(r,16)));function jr(t){const e=me({},t),r=g=>c.hasOwnProp(e,g)?e[g]:void 0,s=r("data");let n=r("withXSRFToken");const o=r("xsrfHeaderName"),i=r("xsrfCookieName");let a=r("headers");const l=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),h=r("url");if(e.headers=a=$.from(a),e.url=_r(Dr(d,h,u,e),r("params"),r("paramsSerializer")),l){const g=c.getSafeProp(l,"username")||"",_=c.getSafeProp(l,"password")||"";try{a.set("Authorization","Basic "+btoa(g+":"+(_?_i(_):"")))}catch(R){throw y.from(R,y.ERR_BAD_OPTION_VALUE,t)}}if(c.isFormData(s)){const g=c.getSafeProp(s,"getHeaders");V.hasStandardBrowserEnv||V.hasStandardBrowserWebWorkerEnv||c.isReactNative(s)?a.setContentType(void 0):c.isFunction(g)&&bi(a,g.call(s),r("formDataHeaderPolicy"))}if(V.hasStandardBrowserEnv&&(c.isFunction(n)&&(n=n(e)),n===!0||n==null&&li(e.url))){const g=o&&i&&ci.read(i);g&&a.set(o,g)}return e}const yi=typeof XMLHttpRequest<"u",wi=yi&&function(t){return new Promise(function(e,r){const s=jr(t);let n=s.data;const o=$.from(s.headers).normalize();let{responseType:i,onUploadProgress:a,onDownloadProgress:l}=s,d,u,h,g,_,R;function A(){g&&g(),_&&_(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function w(E){if(!m)return;if(m.status===0&&(Rt(xr(s.url))||Rt(V.origin))!=="file"&&!(m.responseURL&&m.responseURL.startsWith("file:"))){r(new y("Request aborted",y.ECONNABORTED,t,m)),A(),m=null;return}try{E?R&&R(E):_&&_()}catch(T){setTimeout(()=>{throw T})}if(!m)return;const f=$.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),k={data:!i||i==="text"||i==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:f,config:t,request:m};Rr(function(T){e(T),A()},function(T){r(T),A()},k),m=null}"onloadend"in m?m.onloadend=w:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.startsWith("file:"))||setTimeout(w)},m.onabort=function(){m&&(r(new y("Request aborted",y.ECONNABORTED,t,m)),A(),m=null)},m.onerror=function(E){const f=E&&E.message?E.message:"Network Error",k=new y(f,y.ERR_NETWORK,t,m);k.event=E||null,r(k),A(),m=null},m.ontimeout=function(){let E=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const f=s.transitional||St;s.timeoutErrorMessage&&(E=s.timeoutErrorMessage),r(new y(E,f.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,m)),A(),m=null},n===void 0&&o.setContentType(null),"setRequestHeader"in m&&c.forEach(dr(o),function(E,f){m.setRequestHeader(f,E)}),c.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),i&&i!=="json"&&(m.responseType=s.responseType),l&&([h,_,R]=Ye(l,!0),m.addEventListener("progress",h)),a&&m.upload&&([u,g]=Ye(a),m.upload.addEventListener("progress",u),m.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=E=>{m&&(r(!E||E.type?new Me(null,t,m):E),m.abort(),A(),m=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const b=Rt(s.url);if(b&&!V.protocols.includes(b)){r(new y("Unsupported protocol "+b+":",y.ERR_BAD_REQUEST,t)),A();return}m.send(n||null)})},vi=(t,e)=>{if(t=t?t.filter(Boolean):[],!e&&!t.length)return;const r=new AbortController;let s=!1;const n=function(l){if(!s){s=!0,i();const d=l instanceof Error?l:this.reason;r.abort(d instanceof y?d:new Me(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,n(new y(`timeout of ${e}ms exceeded`,y.ETIMEDOUT))},e);const i=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(n):l.removeEventListener("abort",n)}),t=null)};t.forEach(l=>{if(!s){if(l.aborted){n.call(l);return}l.addEventListener("abort",n,{once:!0})}});const{signal:a}=r;return a.unsubscribe=()=>c.asap(i),a},Ei=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,n;for(;s<r;)n=s+e,yield t.slice(s,n),s=n},Si=async function*(t,e){for await(const r of Oi(t))yield*Ei(r,e)},Oi=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},Ir=(t,e,r,s)=>{const n=Si(t,e);let o=0,i,a=l=>{i||(i=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await n.next();if(d){a(),l.close();return}let h=u.byteLength;if(r){let g=o+=h;r(g)}l.enqueue(new Uint8Array(u))}catch(d){throw a(d),d}},cancel(l){return a(l),n.return()}},{highWaterMark:2})},Ur=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,Lr=(t,e,r)=>e+2<r&&Ur(t.charCodeAt(e+1))&&Ur(t.charCodeAt(e+2)),Mr=t=>t<=57?t-48:(t&223)-55,Ti=t=>t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===43||t===47||t===45||t===95,Ci=t=>t===9||t===10||t===12||t===13||t===32,Ri=t=>{const e=Math.floor(t/4),r=t%4;return e*3+(r===2?1:r===3?2:0)},xi=t=>{const e=t.length;let r=0;return e>0&&t.charCodeAt(e-1)===61&&(r++,e>1&&t.charCodeAt(e-2)===61&&r++),Math.floor((e-r)*3/4)},Ai=t=>{const e=t.length;let r=0,s=0,n=!1;for(let o=0;o<e;o++){let i=t.charCodeAt(o);if(i===37&&Lr(t,o,e)&&(i=Mr(t.charCodeAt(o+1))*16+Mr(t.charCodeAt(o+2)),o+=2),!Ci(i)){if(i===61){s++;continue}if(!Ti(i)||s>0){n=!0;continue}r++}}return n||s>2||s>0&&(r+s)%4!==0||r%4===1?xi(t):Ri(r)},Pi=(t,e)=>{if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;const r=t.indexOf(",");if(r<0)return 0;const s=t.slice(5,r),n=t.slice(r+1);if(/;base64/i.test(s))return e(n);let o=0;for(let i=0,a=n.length;i<a;i++){const l=n.charCodeAt(i);if(l===37&&Lr(n,i,a))o+=1,i+=2;else if(l<128)o+=1;else if(l<2048)o+=2;else if(l>=55296&&l<=56319&&i+1<a){const d=n.charCodeAt(i+1);d>=56320&&d<=57343?(o+=4,i++):o+=3}else o+=3}return o};function ki(t){const e=typeof t=="string"?t.indexOf("#"):-1;return Pi(e===-1?t:t.slice(0,e),Ai)}const xt="1.20.0",Fr=64*1024,Di={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:et}=c,Ni=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,r)=>String.fromCharCode(parseInt(r,16))),Vr=t=>{if(!c.isString(t))return t;try{return decodeURIComponent(t)}catch{return t}},qr=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ji=t=>{const e=t.indexOf("://");let r=t;return e!==-1&&(r=r.slice(e+3)),r.includes("@")||r.includes(":")},Ii=t=>{const e=c.global!==void 0&&c.global!==null?c.global:globalThis,{ReadableStream:r,TextEncoder:s}=e;t=c.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},t);const{fetch:n,Request:o,Response:i}=t,a=n?et(n):typeof fetch=="function",l=et(o),d=et(i);if(!a)return!1;const u=a&&et(r),h=a&&(typeof s=="function"?(w=>b=>w.encode(b))(new s):async w=>new Uint8Array(await new o(w).arrayBuffer())),g=l&&u&&qr(()=>{let w=!1;const b=new o(V.origin,{body:new r,method:"POST",get duplex(){return w=!0,"half"}}),E=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),w&&!E}),_=d&&u&&qr(()=>c.isReadableStream(new i("").body)),R={stream:_&&(w=>w.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!R[w]&&(R[w]=(b,E)=>{let f=b&&b[w];if(f)return f.call(b);throw new y(`Response type '${w}' is not supported`,y.ERR_NOT_SUPPORT,E)})});const A=async w=>{if(w==null)return 0;if(c.isBlob(w))return w.size;if(c.isSpecCompliantForm(w))return(await new o(V.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(c.isArrayBufferView(w)||c.isArrayBuffer(w))return w.byteLength;if(c.isURLSearchParams(w)&&(w=w+""),c.isString(w))return(await h(w)).byteLength},m=async(w,b)=>c.toFiniteNumber(w.getContentLength())??A(b);return async w=>{let{url:b,method:E,data:f,signal:k,cancelToken:T,timeout:L,onDownloadProgress:Z,onUploadProgress:X,responseType:z,headers:M,withCredentials:S="same-origin",fetchOptions:j,maxContentLength:H,maxBodyLength:Re,maxRedirects:Y}=jr(w);const O=c.isNumber(H)&&H>-1,I=c.isNumber(Re)&&Re>-1,re=D=>c.hasOwnProp(w,D)?w[D]:void 0;let ie=n||fetch;z=z?(z+"").toLowerCase():"text";let G=vi([k,T&&T.toAbortSignal()],L),F=null;const ye=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let ze,He=null;const _s=()=>new y("Request body larger than maxBodyLength limit",y.ERR_BAD_REQUEST,w,F);try{let D;const ee=re("auth");if(ee){const C=c.getSafeProp(ee,"username")||"",W=c.getSafeProp(ee,"password")||"";D={username:C,password:W}}if(ji(b)){const C=new URL(b,V.origin);if(!D&&(C.username||C.password)){const W=Vr(C.username),de=Vr(C.password);D={username:W,password:de}}(C.username||C.password)&&(C.username="",C.password="",b=C.href)}if(D&&(M.delete("authorization"),M.set("Authorization","Basic "+btoa(Ni((D.username||"")+":"+(D.password||""))))),O&&typeof b=="string"&&b.startsWith("data:")&&ki(b)>H)throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F);if(I&&E!=="get"&&E!=="head"){const C=await A(f);if(typeof C=="number"&&isFinite(C)&&(ze=C,C>Re))throw _s()}const ut=I&&(c.isReadableStream(f)||c.isStream(f)),ys=(C,W,de)=>Ir(C,Fr,we=>{if(I&&we>Re)throw He=_s();W&&W(we)},de);if(g&&E!=="get"&&E!=="head"&&(X||ut)){if(ze=ze??await m(M,f),ze!==0||ut){let C=new o(b,{method:"POST",body:f,duplex:"half"}),W;if(c.isFormData(f)&&(W=C.headers.get("content-type"))&&M.setContentType(W),C.body){const[de,we]=X&&Ar(ze,Ye(Pr(X)))||[];f=ys(C.body,de,we)}}}else if(ut&&!l&&u&&E!=="get"&&E!=="head")f=ys(f);else if(ut&&l&&!g&&E!=="get"&&E!=="head")throw new y("Stream request bodies are not supported by the current fetch implementation",y.ERR_NOT_SUPPORT,w,F);c.isString(S)||(S=S?"include":"omit");const da=l&&"credentials"in o.prototype;if(c.isFormData(f)){const C=M.getContentType();C&&/^multipart\/form-data/i.test(C)&&!/boundary=/i.test(C)&&M.delete("content-type")}M.set("User-Agent","axios/"+xt,!1);const se=j==null?j:Object.assign(Object.create(null),j);se&&(delete se.body,delete se.headers,delete se.method,delete se.signal,delete se.duplex,delete se.credentials);const oe=Object.assign(Object.create(null),se,{signal:G,method:E.toUpperCase(),headers:dr(M.normalize()),body:f,duplex:"half",credentials:da?S:void 0});l&&(c.forEach(Di,(C,W)=>{oe[W]===void 0&&(oe[W]=C)}),oe.signal===void 0&&(oe.signal=null),oe.body===void 0&&(oe.body=null)),Y===0&&(oe.redirect="manual",se&&(se.redirect="manual")),F=l&&new o(b,oe);let ae=await(l?ie(F,se):ie(b,oe));const ws=$.from(ae.headers);if(O){const C=c.toFiniteNumber(ws.getContentLength());if(C!=null&&C>H)throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F)}const qt=_&&(z==="stream"||z==="response");if(_&&ae.body&&(Z||O||qt&&ye)){const C={};["status","statusText","headers"].forEach(We=>{C[We]=ae[We]});const W=c.toFiniteNumber(ws.getContentLength()),[de,we]=Z&&Ar(W,Ye(Pr(Z),!0))||[];let vs=0;const ha=We=>{if(O&&(vs=We,vs>H))throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F);de&&de(We)};ae=new i(Ir(ae.body,Fr,ha,()=>{we&&we(),ye&&ye()}),C)}z=z||"text";let le=await R[c.findKey(R,z)||"text"](ae,w);if(O&&!_&&!qt){let C;if(le!=null&&(typeof le.byteLength=="number"?C=le.byteLength:typeof le.size=="number"?C=le.size:typeof le=="string"&&(C=typeof s=="function"?new s().encode(le).byteLength:le.length)),typeof C=="number"&&C>H)throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F)}return!qt&&ye&&ye(),await new Promise((C,W)=>{Rr(C,W,{data:le,headers:$.from(ae.headers),status:ae.status,statusText:ae.statusText,config:w,request:F})})}catch(D){if(ye&&ye(),G&&G.aborted&&G.reason instanceof y){const ee=G.reason;throw ee.config=w,F&&(ee.request=F),D!==ee&&Object.defineProperty(ee,"cause",{__proto__:null,value:D,writable:!0,enumerable:!1,configurable:!0}),ee}if(He)throw F&&!He.request&&(He.request=F),He;if(D instanceof y)throw F&&!D.request&&(D.request=F),D;if(D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)){const ee=new y("Network Error",y.ERR_NETWORK,w,F,D&&D.response);throw Object.defineProperty(ee,"cause",{__proto__:null,value:D.cause||D,writable:!0,enumerable:!1,configurable:!0}),ee}throw y.from(D,D&&D.code,w,F,D&&D.response)}}},Ui=new Map,$r=t=>{let e=t&&t.env||{};const{fetch:r,Request:s,Response:n}=e,o=[s,n,r];let i=o.length,a=i,l,d,u=Ui;for(;a--;)l=o[a],d=u.get(l),d===void 0&&u.set(l,d=a?new Map:Ii(e)),u=d;return d};$r();const At={http:Bn,xhr:wi,fetch:{get:$r}};c.forEach(At,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(t,"adapterName",{__proto__:null,value:e})}});const Br=t=>`- ${t}`,Li=t=>c.isFunction(t)||t===null||t===!1;function Mi(t,e){t=c.isArray(t)?t:[t];const{length:r}=t;let s,n;const o={};for(let i=0;i<r;i++){s=t[i];let a;if(n=s,!Li(s)&&(n=At[(a=String(s)).toLowerCase()],n===void 0))throw new y(`Unknown adapter '${a}'`);if(n&&(c.isFunction(n)||(n=n.get(e))))break;o[a||"#"+i]=n}if(!n){const i=Object.entries(o).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=r?i.length>1?`since :
1
+ System.register(["./main-13c824ef27be48800fd9.js","vue","./TargetPacketItemChooser-CVGMtU04-ec3cf60712a2f39fa0da.js","./OpenC3TimePicker-CM2VG1mS-76b626662e43cfd8ce5c.js","vue-router","pinia","single-spa","vuetify"],(function(Os,fa){"use strict";var $t,dt,Bt,zt,Ht,Wt,x,N,q,Jt,p,v,xe,ne,ce,ve,Ae,Kt,J,Je,ht,ft,Ee,Zt,pt,Xt,Gt;return{setters:[P=>{$t=P.g,dt=P.O,Bt=P._,zt=P.R,Ht=P.a,Wt=P.k},P=>{x=P.resolveComponent,N=P.openBlock,q=P.createBlock,Jt=P.Teleport,p=P.createVNode,v=P.withCtx,xe=P.createElementVNode,ne=P.toDisplayString,ce=P.createElementBlock,ve=P.Fragment,Ae=P.renderList,Kt=P.ref,J=P.createTextVNode,Je=P.mergeProps,ht=P.createSlots,ft=P.normalizeStyle,Ee=P.createCommentVNode,Zt=P.withModifiers,pt=P.withKeys},P=>{Xt=P.w},P=>{Gt=P.w},null,null,null,null],execute:(function(){var P=document.createElement("style");P.textContent=`.title-font[data-v-05a98b50]{font-size:1.125rem}.v-progress-linear__determinate[data-v-05a98b50]{transition:none!important}
2
+ /*$vite$:1*/`,document.head.appendChild(P);const Ts={__name:"TopBarMenu",props:{menu:{type:Object,required:!0},title:{type:String,required:!0}},emits:["submenu-click"],setup(t,{emit:e}){const r=e,s=Kt(!1);function n(){s.value=!1}function o(i){return i.replaceAll(" ","-").toLowerCase()}return(i,a)=>{const l=x("v-icon"),d=x("v-btn"),u=x("v-divider"),h=x("v-list-item-title"),g=x("v-list-item"),_=x("v-list"),R=x("v-menu"),A=x("v-radio"),m=x("v-list-item-action"),w=x("v-radio-group"),b=x("v-checkbox"),E=x("v-tooltip");return N(),q(R,{modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=f=>s.value=f),"close-on-content-click":!1},{activator:v(({props:f})=>[p(d,Je(f,{variant:"outlined",class:"mx-1 menu-button",text:t.menu.label,"data-test":o(`${t.title} ${t.menu.label}`)}),{append:v(()=>[p(l,{class:"menu-button-icon"},{default:v(()=>[...a[1]||(a[1]=[J(" mdi-menu-down ",-1)])]),_:1})]),_:1},16,["text","data-test"])]),default:v(()=>[p(_,null,{default:v(()=>[(N(!0),ce(ve,null,Ae(t.menu.items,(f,k)=>(N(),ce(ve,null,[f.divider?(N(),q(u,{key:k+"-divider"})):f.subMenu&&f.subMenu.length>0?(N(),ce("div",{key:k+"-submenu"},[(N(),q(R,{key:k,"open-on-hover":"",location:"right"},{activator:v(({props:T})=>[(N(),q(g,Je({ref_for:!0},T,{key:k,disabled:f.disabled}),ht({append:v(()=>[p(l,null,{default:v(()=>[...a[2]||(a[2]=[J(" mdi-chevron-right ",-1)])]),_:1})]),default:v(()=>[!f.radio&&!f.checkbox?(N(),q(h,{key:0,style:ft("cursor: pointer;"+(f.disabled?"opacity: 0.2":""))},{default:v(()=>[J(ne(f.label),1)]),_:2},1032,["style"])):Ee("",!0)]),_:2},[f.icon?{name:"prepend",fn:v(()=>[p(l,{disabled:f.disabled},{default:v(()=>[J(ne(f.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:v(()=>[p(_,null,{default:v(()=>[(N(!0),ce(ve,null,Ae(f.subMenu,(T,L)=>(N(),q(g,{key:L,"prepend-icon":T.icon,onClick:X=>r("submenu-click",T)},{default:v(()=>[p(h,null,{default:v(()=>[J(ne(T.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):f.radioGroup?(N(),q(w,{key:k+"-radio-group",class:"ma-0 pa-0",density:"compact","hide-details":"","model-value":f.value,"onUpdate:modelValue":f.command},{default:v(()=>[(N(!0),ce(ve,null,Ae(f.choices,(T,L)=>(N(),q(g,{key:L+"-choice"},{default:v(()=>[p(m,{class:"list-action"},{default:v(()=>[p(A,{color:"secondary",label:T.label,value:T.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(N(),q(E,{key:k+"-list",disabled:!f.tooltip,text:f.tooltip,location:"right"},{activator:v(({props:T})=>[xe("div",Je({ref_for:!0},T),[p(g,{disabled:f.disabled,"data-test":o(`${t.title} ${t.menu.label} ${f.label}`),onClick:()=>{f.command(f),f.checkbox||n()}},ht({default:v(()=>[f.checkbox?(N(),q(m,{key:0,class:"list-action"},{default:v(()=>[p(b,{modelValue:f.checked,"onUpdate:modelValue":L=>f.checked=L,label:f.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):Ee("",!0),!f.radio&&!f.checkbox?(N(),q(h,{key:1,style:ft("cursor: pointer;"+(f.disabled?"opacity: 0.2":""))},{default:v(()=>[J(ne(f.label),1)]),_:2},1032,["style"])):Ee("",!0)]),_:2},[f.icon?{name:"prepend",fn:v(()=>[p(l,{icon:f.icon,disabled:f.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["disabled","data-test","onClick"])],16)]),_:2},1032,["disabled","text"]))],64))),256))]),_:1})]),_:1},8,["modelValue"])}}},Cs={components:{TopBarMenu:Ts},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}}},Rs={class:"app-title mr-2"};function xs(t,e,r,s,n,o){const i=x("v-col"),a=x("v-row"),l=x("TopBarMenu");return N(),q(Jt,{to:"#openc3-menu"},[p(a,{"no-gutters":""},{default:v(()=>[p(i,{"align-self":"end"},{default:v(()=>[xe("span",Rs,ne(r.title),1)]),_:1})]),_:1}),p(a,{dense:"",class:"flex-nowrap"},{default:v(()=>[(N(!0),ce(ve,null,Ae(r.menus,(d,u)=>(N(),q(l,{key:u+"-top-menu",ref_for:!0,ref:"topmenu",menu:d,title:r.title,onSubmenuClick:o.subMenuClick},null,8,["menu","title","onSubmenuClick"]))),128))]),_:1})])}const As=$t(Cs,[["render",xs],["__scopeId","data-v-f4fb184e"]]),Ps="__default",ks={data:{dontSaveDefaultConfig:!1},created:function(){if(!this.configKey)throw alert("Components using the Config mixin must provide a configKey"),new Error("Components using the Config mixin must provide a configKey")},computed:{storageKey(){return`${this.configKey}${Ps}`}},methods:{loadDefaultConfig:function(){const t=localStorage.getItem(this.storageKey);return t?JSON.parse(t):{}},saveDefaultConfig:function(t){this.dontSaveDefaultConfig||localStorage.setItem(this.storageKey,JSON.stringify(t))},openConfigBase:function(t,e=!1,r=null){new dt().load_config(this.configKey,t).then(s=>{s?(this.$notify.normal({title:"Loading configuration",body:t}),r&&r(JSON.parse(s)),e||this.$route.fullPath.includes(t)||this.$router.push({query:{config:t}})):this.$notify.caution({title:"Unknown configuration",body:t})}).catch(s=>{s&&this.$notify.serious({title:`Error opening configuration: ${t}`,body:s})})},saveConfigBase:function(t,e){new dt().save_config(this.configKey,t,JSON.stringify(e)).then(()=>{this.$notify.normal({title:"Saved configuration",body:t})}).catch(r=>{r&&this.$notify.serious({title:`Error saving configuration: ${t}`,body:r})})},resetConfigBase:function(){localStorage.removeItem(this.storageKey);const t={...this.$route.query};delete t.config,this.$router.replace({query:t})}}};function Qt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ds}=Object.prototype,{getPrototypeOf:ue}=Object,{iterator:Pe,toStringTag:Yt}=Symbol,ke=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),er=t=>typeof t=="string"&&(t==="__proto__"||t==="constructor"||t==="prototype"),tr=(t,e,r)=>t===Object.prototype||!r&&e===null,Ns=t=>{if(!Object.isExtensible(t))return!1;const e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&e.push(...Object.getOwnPropertySymbols(t)),e.every(r=>{if(er(r))return!1;const s=Object.getOwnPropertyDescriptor(t,r);return!!s&&s.configurable&&s.writable===!0})},De=(t,e)=>{let r=t;const s=[];for(;r!=null;){if(s.indexOf(r)!==-1)return!1;s.push(r);const n=ue(r);if(tr(r,n,r===t))return!1;if(ke(r,e))return!0;r=n}return!1},js=(t,e)=>t!=null&&De(t,e)?t[e]:void 0,Is=t=>{if(t==null||typeof t!="object"&&typeof t!="function")return t;const e=ue(t);if(e===null&&Ns(t))return t;const r=Object.create(null),s=Object.create(null),n=[];let o=t;for(;o!=null&&n.indexOf(o)===-1;){n.push(o);const i=o===t?e:ue(o);if(tr(o,i,o===t))break;const a=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(o));for(const l of a)er(l)||ke(s,l)||(r[l]=t[l],s[l]=!0);o=i}return r},mt=(t=>e=>{const r=Ds.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Q=t=>(t=t.toLowerCase(),e=>mt(e)===t),Ke=t=>e=>typeof e===t,{isArray:he}=Array,fe=Ke("undefined");function Se(t){return t!==null&&!fe(t)&&t.constructor!==null&&!fe(t.constructor)&&K(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const rr=Q("ArrayBuffer");function Us(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&rr(t.buffer),e}const Ls=Ke("string"),K=Ke("function"),sr=Ke("number"),Oe=t=>t!==null&&typeof t=="object",Ms=t=>t===!0||t===!1,Ze=t=>{if(!Oe(t))return!1;const e=ue(t);return(e===null||e===Object.prototype||ue(e)===null)&&!De(t,Yt)&&!De(t,Pe)},Fs=t=>{if(!Oe(t)||Se(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Vs=Q("Date"),qs=Q("File"),$s=t=>!!(t&&typeof t.uri<"u"),Bs=t=>t&&typeof t.getParts<"u",zs=Q("Blob"),Hs=Q("FileList"),Ws=Q("Set"),Js=t=>Oe(t)&&K(t.pipe);function Ks(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const nr=Ks(),ir=typeof nr.FormData<"u"?nr.FormData:void 0,Zs=t=>{if(!t)return!1;if(ir&&t instanceof ir)return!0;const e=ue(t);if(!e||e===Object.prototype||!K(t.append))return!1;const r=mt(t);return r==="formdata"||r==="object"&&K(t.toString)&&t.toString()==="[object FormData]"},Xs=Q("URLSearchParams"),[Gs,Qs,Ys,en]=["ReadableStream","Request","Response","Headers"].map(Q),tn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,n;if(typeof t!="object"&&(t=[t]),he(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{if(Se(t))return;const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(s=0;s<i;s++)a=o[s],e.call(null,t[a],a,t)}}function or(t,e){if(Se(t))return null;e=e.toLowerCase();const r=Object.keys(t);let s=r.length,n;for(;s-- >0;)if(n=r[s],e===n.toLowerCase())return n;return null}const pe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ar=t=>!fe(t)&&t!==pe;function gt(...t){const{caseless:e,skipUndefined:r}=ar(this)&&this||{},s={},n=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const a=e&&typeof i=="string"&&or(s,i)||i,l=ke(s,a)?s[a]:void 0;Ze(l)&&Ze(o)?s[a]=gt(l,o):Ze(o)?s[a]=gt({},o):he(o)?s[a]=o.slice():(!r||!fe(o))&&(s[a]=o)};for(let o=0,i=t.length;o<i;o++){const a=t[o];if(!a||Se(a)||(Ne(a,n),typeof a!="object"||he(a)))continue;const l=Object.getOwnPropertySymbols(a);for(let d=0;d<l.length;d++){const u=l[d];pn.call(a,u)&&n(a[u],u)}}return s}const rn=(t,e,r,{allOwnKeys:s}={})=>(Ne(e,(n,o)=>{r&&K(n)?Object.defineProperty(t,o,{__proto__:null,value:Qt(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),t),sn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),nn=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:e.prototype}),r&&Object.assign(t.prototype,r)},on=(t,e,r,s)=>{let n,o,i;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),o=n.length;o-- >0;)i=n[o],(!s||s(i,t,e))&&!a[i]&&(e[i]=t[i],a[i]=!0);t=r!==!1&&ue(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},an=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const s=t.indexOf(e,r);return s!==-1&&s===r},ln=t=>{if(!t)return null;if(he(t))return t;let e=t.length;if(!sr(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},cn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ue(Uint8Array)),un=(t,e)=>{const r=(t&&t[Pe]).call(t);let s;for(;(s=r.next())&&!s.done;){const n=s.value;e.call(t,n[0],n[1])}},dn=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},hn=Q("HTMLFormElement"),fn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,r,s){return r.toUpperCase()+s}),{propertyIsEnumerable:pn}=Object.prototype,mn=Q("RegExp"),lr=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};Ne(r,(n,o)=>{let i;(i=e(n,o,t))!==!1&&(s[o]=i||n)}),Object.defineProperties(t,s)},gn=t=>{lr(t,(e,r)=>{if(K(t)&&["arguments","caller","callee"].includes(r))return!1;const s=t[r];if(K(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},bn=(t,e)=>{const r={},s=n=>{n.forEach(o=>{r[o]=!0})};return he(t)?s(t):s(String(t).split(e)),r},_n=()=>{},yn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function wn(t){return!!(t&&K(t.append)&&t[Yt]==="FormData"&&t[Pe])}const vn=t=>{const e=new WeakSet,r=s=>{if(Oe(s)){if(e.has(s))return;if(Se(s))return s;if(!("toJSON"in s)){e.add(s);let n;if(Ws(s)){n=[];for(const o of s){const i=r(o);!fe(i)&&n.push(i)}}else n=he(s)?[]:{},Ne(s,(o,i)=>{const a=r(o);!fe(a)&&(n[i]=a)});return e.delete(s),n}}return s};return r(t)},En=Q("AsyncFunction"),Sn=t=>t&&(Oe(t)||K(t))&&K(t.then)&&K(t.catch),cr=((t,e)=>t?setImmediate:e?((r,s)=>(pe.addEventListener("message",({source:n,data:o})=>{n===pe&&o===r&&s.length&&s.shift()()},!1),n=>{s.push(n),pe.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",K(pe.postMessage)),On=typeof queueMicrotask<"u"?queueMicrotask.bind(pe):typeof process<"u"&&process.nextTick||cr,ur=t=>t!=null&&K(t[Pe]),Tn=t=>t!=null&&De(t,Pe)&&ur(t),c={isArray:he,isArrayBuffer:rr,isBuffer:Se,isFormData:Zs,isArrayBufferView:Us,isString:Ls,isNumber:sr,isBoolean:Ms,isObject:Oe,isPlainObject:Ze,isEmptyObject:Fs,isReadableStream:Gs,isRequest:Qs,isResponse:Ys,isHeaders:en,isUndefined:fe,isDate:Vs,isFile:qs,isReactNativeBlob:$s,isReactNative:Bs,isBlob:zs,isRegExp:mn,isFunction:K,isStream:Js,isURLSearchParams:Xs,isTypedArray:cn,isFileList:Hs,forEach:Ne,merge:gt,extend:rn,trim:tn,stripBOM:sn,inherits:nn,toFlatObject:on,kindOf:mt,kindOfTest:Q,endsWith:an,toArray:ln,forEachEntry:un,matchAll:dn,isHTMLForm:hn,hasOwnProperty:ke,hasOwnProp:ke,hasOwnInPrototypeChain:De,getSafeProp:js,toSafeFlatObject:Is,reduceDescriptors:lr,freezeMethods:gn,toObjectSet:bn,toCamelCase:fn,noop:_n,toFiniteNumber:yn,findKey:or,global:pe,isContextDefined:ar,isSpecCompliantForm:wn,toJSONObject:vn,isAsyncFn:En,isThenable:Sn,setImmediate:cr,asap:On,isIterable:ur,isSafeIterable:Tn},Cn=c.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"]),Rn=t=>{const e={};let r,s,n;return t&&t.split(`
3
+ `).forEach(function(o){n=o.indexOf(":"),r=o.substring(0,n).trim().toLowerCase(),s=o.substring(n+1).trim();const i=c.hasOwnProp(e,r);!r||i&&c.hasOwnProp(Cn,r)||(r==="set-cookie"?i?e[r].push(s):e[r]=[s]:e[r]=i?e[r]+", "+s:s)}),e};function xn(t){let e=0,r=t.length;for(;e<r;){const s=t.charCodeAt(e);if(s!==9&&s!==32)break;e+=1}for(;r>e;){const s=t.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return e===0&&r===t.length?t:t.slice(e,r)}const An=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Pn=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function bt(t,e){return c.isArray(t)?t.map(r=>bt(r,e)):xn(String(t).replace(e,""))}const kn=t=>bt(t,An),Dn=t=>bt(t,Pn);function dr(t){const e=Object.create(null);return c.forEach(t.toJSON(),(r,s)=>{e[s]=Dn(r)}),e}const hr=Symbol("internals");function je(t){return t&&String(t).trim().toLowerCase()}function Xe(t){return t===!1||t==null?t:c.isArray(t)?t.map(Xe):kn(String(t))}function Nn(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}const jn=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function _t(t){let e=0,r=t.length;for(;e<r;){const s=t.charCodeAt(e);if(s!==9&&s!==32)break;e+=1}for(;r>e;){const s=t.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return e===0&&r===t.length?t:t.slice(e,r)}function In(t){const e=t.length-1;if(e<1||t.charCodeAt(0)!==34||t.charCodeAt(e)!==34)return t;let r="";for(let s=1;s<e;s++){const n=t.charCodeAt(s);if(n===34||n===92&&(s+=1,s>=e))return t;r+=t[s]}return r}function Un(t){const e=Object.create(null),r=String(t);let s=0,n=!1,o=!1;function i(a){const l=_t(r.slice(s,a)),d=l.indexOf("=");if(d<1)return;const u=_t(l.slice(0,d));if(!jn.test(u))return;const h=u.toLowerCase();if(h==="__proto__"||h==="constructor"||h==="prototype")return;const g=_t(l.slice(d+1));e[h]=In(g)}for(let a=0;a<r.length;a++){const l=r.charCodeAt(a);n?o?o=!1:l===92?o=!0:l===34&&(n=!1):l===34?n=!0:(l===44||l===59)&&(i(a),s=a+1)}return i(r.length),e}const Ln=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function yt(t,e,r,s,n){if(c.isFunction(s))return s.call(this,e,r);if(n&&(e=r),!!c.isString(e)){if(c.isString(s))return e.indexOf(s)!==-1;if(c.isRegExp(s))return s.test(e)}}function Mn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function Fn(t,e){const r=c.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{__proto__:null,value:function(n,o,i){return this[s].call(this,e,n,o,i)},configurable:!0})})}let $=class{constructor(t){t&&this.set(t)}set(t,e,r){const s=this;function n(i,a,l){const d=je(a);if(!d)return;const u=c.findKey(s,d);(!u||s[u]===void 0||l===!0||l===void 0&&s[u]!==!1)&&(s[u||a]=Xe(i))}const o=(i,a)=>c.forEach(i,(l,d)=>n(l,d,a));if(c.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(c.isString(t)&&(t=t.trim())&&!Ln(t))o(Rn(t),e);else if(c.isObject(t)&&c.isSafeIterable(t)){let i=Object.create(null),a,l;for(const d of t){if(!c.isArray(d))throw new TypeError("Object iterator must return a key-value pair");l=d[0],c.hasOwnProp(i,l)?(a=i[l],i[l]=c.isArray(a)?[...a,d[1]]:[a,d[1]]):i[l]=d[1]}o(i,e)}else t!=null&&n(e,t,r);return this}get(t,e){if(t=je(t),t){const r=c.findKey(this,t);if(r){const s=this[r];if(!e)return s;if(e===!0)return Nn(s);if(c.isFunction(e))return e.call(this,s,r);if(c.isRegExp(e))return e.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=je(t),t){const r=c.findKey(this,t);return!!(r&&this[r]!==void 0&&(!e||yt(this,this[r],r,e)))}return!1}delete(t,e){const r=this;let s=!1;function n(o){if(o=je(o),o){const i=c.findKey(r,o);i&&(!e||yt(r,r[i],i,e))&&(delete r[i],s=!0)}}return c.isArray(t)?t.forEach(n):n(t),s}clear(t){const e=Object.keys(this);let r=e.length,s=!1;for(;r--;){const n=e[r];(!t||yt(this,this[n],n,t,!0))&&(delete this[n],s=!0)}return s}normalize(t){const e=this,r={};return c.forEach(this,(s,n)=>{const o=c.findKey(r,n);if(o){e[o]=Xe(s),delete e[n];return}const i=t?Mn(n):String(n).trim();i!==n&&delete e[n],e[i]=Xe(s),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return c.forEach(this,(r,s)=>{r!=null&&r!==!1&&(e[s]=t&&c.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
4
+ `)}getSetCookie(){const t=this.get("set-cookie");return c.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Un(t)}static concat(t,...e){const r=new this(t);return e.forEach(s=>r.set(s)),r}static accessor(t){const e=(this[hr]=this[hr]={accessors:{}}).accessors,r=this.prototype;function s(n){const o=je(n);e[o]||(Fn(r,n),e[o]=!0)}return c.isArray(t)?t.forEach(s):s(t),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors($.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}}),c.freezeMethods($);const Ge="[REDACTED ****]";function Vn(t){if(c.hasOwnProp(t,"toJSON"))return!0;let e=Object.getPrototypeOf(t);for(;e&&e!==Object.prototype;){if(c.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function qn(t,e){const r=new Set(e.map(o=>String(o).toLowerCase())),s=[],n=o=>{if(o===null||typeof o!="object"||c.isBuffer(o))return o;if(s.indexOf(o)!==-1)return;o instanceof $&&(o=o.toJSON()),s.push(o);let i;if(c.isArray(o))i=[],o.forEach((a,l)=>{const d=n(a);c.isUndefined(d)||(i[l]=d)});else{if(!c.isPlainObject(o)&&Vn(o))return s.pop(),o;i=Object.create(null);for(const[a,l]of Object.entries(o)){const d=r.has(a.toLowerCase())?Ge:n(l);c.isUndefined(d)||(i[a]=d)}}return s.pop(),i};return n(t)}function fr(t){try{return String(t)}catch{return""}}function $n(t){return t.errors.map(e=>{try{return e&&e.message?fr(e.message):fr(e)}catch{return""}}).filter(Boolean).join("; ")||t.name||"AggregateError"}let y=class Es extends Error{static from(e,r,s,n,o,i){let a=e.message;!a&&c.isArray(e.errors)&&e.errors.length&&(a=$n(e));const l=new Es(a,r||e.code,s,n,o);return Object.defineProperty(l,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),l.name=e.name,e.status!=null&&l.status==null&&(l.status=e.status),i&&Object.assign(l,i),l}constructor(e,r,s,n,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),s&&(this.config=s),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,r=e&&c.hasOwnProp(e,"redact")?e.redact:void 0,s=c.isArray(r)&&r.length>0?qn(e,r):c.toJSONObject(e);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:s,code:this.code,status:this.status}}};y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",y.ERR_BAD_OPTION="ERR_BAD_OPTION",y.ECONNABORTED="ECONNABORTED",y.ETIMEDOUT="ETIMEDOUT",y.ECONNREFUSED="ECONNREFUSED",y.ERR_NETWORK="ERR_NETWORK",y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",y.ERR_DEPRECATED="ERR_DEPRECATED",y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",y.ERR_BAD_REQUEST="ERR_BAD_REQUEST",y.ERR_CANCELED="ERR_CANCELED",y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",y.ERR_INVALID_URL="ERR_INVALID_URL",y.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Bn=null,pr=100;function wt(t){return c.isPlainObject(t)||c.isArray(t)}function mr(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function vt(t,e,r){return t?t.concat(e).map(function(s,n){return s=mr(s),!r&&n?"["+s+"]":s}).join(r?".":""):e}function zn(t){return c.isArray(t)&&!t.some(wt)}const Hn=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Qe(t,e,r){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const s=(b,E)=>{const f=c.getSafeProp(r,b);return c.isUndefined(f)?E:f},n=s("metaTokens",!0),o=s("visitor")||A,i=s("dots",!1),a=s("indexes",!1),l=s("Blob")||typeof Blob<"u"&&Blob,d=s("maxDepth",pr),u=l&&c.isSpecCompliantForm(e),h=[];if(!c.isFunction(o))throw new TypeError("visitor must be a function");function g(b){if(b===null)return"";if(c.isDate(b))return b.toISOString();if(c.isBoolean(b))return b.toString();if(!u&&c.isBlob(b))throw new y("Blob is not supported. Use a Buffer instead.");if(c.isArrayBuffer(b)||c.isTypedArray(b)){if(u&&typeof l=="function")return new l([b]);throw new y("Blob is not supported. Use a Buffer instead.",y.ERR_NOT_SUPPORT)}return b}function _(b){if(b>d)throw new y("Object is too deeply nested ("+b+" levels). Max depth: "+d,y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function R(b,E){if(d===1/0)return JSON.stringify(b);const f=[];return JSON.stringify(b,function(k,T){if(!c.isObject(T))return T;for(;f.length&&f[f.length-1]!==this;)f.pop();return f.push(T),_(E+f.length-1),T})}function A(b,E,f){let k=b;if(c.isReactNative(e)&&c.isReactNativeBlob(b))return e.append(vt(f,E,i),g(b)),!1;if(b&&!f&&typeof b=="object"){if(c.endsWith(E,"{}"))E=n?E:E.slice(0,-2),b=R(b,1);else if(c.isArray(b)&&zn(b)||(c.isFileList(b)||c.endsWith(E,"[]"))&&(k=c.toArray(b)))return E=mr(E),k.forEach(function(T,L){!(c.isUndefined(T)||T===null)&&e.append(a===!0?vt([E],L,i):a===null?E:E+"[]",g(T))}),!1}return wt(b)?!0:(e.append(vt(f,E,i),g(b)),!1)}const m=Object.assign(Hn,{defaultVisitor:A,convertValue:g,isVisitable:wt});function w(b,E,f=0){if(!c.isUndefined(b)){if(_(f),h.indexOf(b)!==-1)throw new Error("Circular reference detected in "+E.join("."));h.push(b),c.forEach(b,function(k,T){(!(c.isUndefined(k)||k===null)&&o.call(e,k,c.isString(T)?T.trim():T,E,m))===!0&&w(k,E?E.concat(T):[T],f+1)}),h.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return w(t),e}function gr(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(r){return e[r]})}function Et(t,e){this._pairs=[],t&&Qe(t,this,e)}const br=Et.prototype;br.append=function(t,e){this._pairs.push([t,e])},br.toString=function(t){const e=t?r=>t.call(this,r,gr):gr;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function Wn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _r(t,e,r){if(!e)return t;t=t||"";const s=c.isFunction(r)?{serialize:r}:r,n=c.getSafeProp(s,"encode")||Wn,o=c.getSafeProp(s,"serialize");let i;if(o?i=o(e,s):i=c.isURLSearchParams(e)?e.toString():new Et(e,s).toString(n),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}const Ie=Symbol("internals");function yr(t){return t?t.length:0}function wr(t){if(t)for(;t.length&&t[t.length-1]===null;)t.pop()}function Ue(t,e){const r=t.handlers,s=yr(r);r!==e.handlersRef?(e.handlersRef=r,e.handlerEntries.clear()):s!==e.handlersLength&&(s?e.handlerEntries.forEach(function(n,o){r[n.index]!==n.handler&&e.handlerEntries.delete(o)}):e.handlerEntries.clear()),e.handlersLength=s}class vr{constructor(){this.handlers=[],this[Ie]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,r,s){const n={fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null},o=this[Ie];this.handlers==null&&(this.handlers=[]),Ue(this,o);const i=o.nextId++;return this.handlers.push(n),o.handlerEntries.set(i,{handler:n,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}eject(e){const r=this[Ie];Ue(this,r);const s=r.handlerEntries.get(e);if(s){if(r.handlerEntries.delete(e),this.handlers[s.index]!==s.handler)return;this.handlers[s.index]=null,r.iterationDepth||(wr(this.handlers),r.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Ue(this,this[Ie]))}forEach(e){const r=this[Ie];Ue(this,r),r.iterationDepth++;try{c.forEach(this.handlers,function(s){s!==null&&e(s)})}finally{--r.iterationDepth||(Ue(this,r),wr(this.handlers),r.handlersLength=yr(this.handlers))}}}const St={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Jn=typeof URLSearchParams<"u"?URLSearchParams:Et,Kn=typeof FormData<"u"?FormData:null,Zn=typeof Blob<"u"?Blob:null,Xn={isBrowser:!0,classes:{URLSearchParams:Jn,FormData:Kn,Blob:Zn},protocols:["http","https","file","blob","url","data"]},Ot=typeof window<"u"&&typeof document<"u",Tt=typeof navigator=="object"&&navigator||void 0,Gn=Ot&&(!Tt||["ReactNative","NativeScript","NS"].indexOf(Tt.product)<0),Qn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Yn=Ot&&window.location.href||"http://localhost",ei=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ot,hasStandardBrowserEnv:Gn,hasStandardBrowserWebWorkerEnv:Qn,navigator:Tt,origin:Yn},Symbol.toStringTag,{value:"Module"})),V={...ei,...Xn};function ti(t,e){return Qe(t,new V.classes.URLSearchParams,{visitor:function(r,s,n,o){return V.isNode&&c.isBuffer(r)?(this.append(s,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}const Er=pr;function Sr(t){if(t>Er)throw new y("FormData field is too deeply nested ("+t+" levels). Max depth: "+Er,y.ERR_FORM_DATA_DEPTH_EXCEEDED)}function ri(t){const e=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;let s;for(;(s=r.exec(t))!==null;)Sr(e.length),e.push(s[0]==="[]"?"":s[1]||s[0]);return e}function si(t){const e={},r=Object.keys(t);let s;const n=r.length;let o;for(s=0;s<n;s++)o=r[s],e[o]=t[o];return e}function Or(t){function e(r,s,n,o){Sr(o);let i=r[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),l=o>=r.length;return i=!i&&c.isArray(n)?n.length:i,l?(c.hasOwnProp(n,i)?n[i]=c.isArray(n[i])?n[i].concat(s):[n[i],s]:n[i]=s,!a):((!c.hasOwnProp(n,i)||!c.isObject(n[i]))&&(n[i]=[]),e(r,s,n[i],o)&&c.isArray(n[i])&&(n[i]=si(n[i])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const r={};return c.forEachEntry(t,(s,n)=>{e(ri(s),n,r,0)}),r}return null}const Tr=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Te=(t,e)=>t!=null&&c.hasOwnProp(t,e)?t[e]:void 0;function ni(t,e,r){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}const Le={transitional:St,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",s=r.indexOf("application/json")>-1,n=c.isObject(t);if(n&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(Or(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(n){const i=Te(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return ti(t,i).toString();if((o=c.isFileList(t))||r.indexOf("multipart/form-data")>-1){const a=Te(this,"env"),l=a&&a.FormData;return Qe(o?{"files[]":t}:t,l&&new l,i)}}return n||s?(e.setContentType("application/json",!1),ni(t)):t}],transformResponse:[function(t){const e=Te(this,"transitional")||Le.transitional,r=e&&e.forcedJSONParsing,s=Te(this,"responseType"),n=s==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(r&&!s||n)){const o=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,Te(this,"parseReviver"))}catch(i){if(o)throw i.name==="SyntaxError"?y.from(i,y.ERR_BAD_RESPONSE,this,null,Te(this,"response")):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:V.classes.FormData,Blob:V.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(Tr,t=>{Le.headers[t]={}});function Ct(t,e){const r=this||Le,s=e||r,n=$.from(s.headers);let o=s.data;return c.forEach(t,function(i){o=i.call(r,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function Cr(t){return!!(t&&t.__CANCEL__)}let Me=class extends y{constructor(t,e,r){super(t??"canceled",y.ERR_CANCELED,e,r),this.name="CanceledError",this.__CANCEL__=!0}};function Rr(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new y("Request failed with status code "+r.status,r.status>=400&&r.status<500?y.ERR_BAD_REQUEST:y.ERR_BAD_RESPONSE,r.config,r.request,r))}const ii=/[\t\n\r]/g;function xr(t){if(typeof t!="string")return t;let e=0;for(;e<t.length&&t.charCodeAt(e)<=32;)e++;return t.slice(e).replace(ii,"")}function Rt(t){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return e&&e[1]||""}function oi(t,e){t=t||10;const r=new Array(t),s=new Array(t);let n=0,o=0,i;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),d=s[o];i||(i=l),r[n]=a,s[n]=l;let u=o,h=0;for(;u!==n;)h+=r[u++],u=u%t;if(n=(n+1)%t,n===o&&(o=(o+1)%t),l-i<e)return;const g=d&&l-d;return g?Math.round(h*1e3/g):void 0}}function ai(t,e){let r=0,s=1e3/e,n,o;const i=(a,l=Date.now())=>{r=l,n=null,o&&(clearTimeout(o),o=null),t(...a)};return[(...a)=>{const l=Date.now(),d=l-r;d>=s?i(a,l):(n=a,o||(o=setTimeout(()=>{o=null,i(n)},s-d)))},()=>n&&i(n),(...a)=>i(a)]}const Ye=(t,e,r=3)=>{let s=0;const n=oi(50,250);return ai(o=>{if(!o||!c.isNumber(o.loaded))return;const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=Math.max(0,a!=null?Math.min(i,a):i),d=Math.max(0,l-s),u=n(d);s=Math.max(s,l);const h={loaded:l,total:a,progress:a?l/a:void 0,bytes:d,rate:u||void 0,estimated:u&&a?(a-l)/u:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},r)},Ar=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},Pr=(t,e=c.asap)=>(...r)=>e(()=>t(...r)),li=V.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,V.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(V.origin),V.navigator&&/(msie|trident)/i.test(V.navigator.userAgent)):()=>!0,ci=V.hasStandardBrowserEnv?{write(t,e,r,s,n,o,i){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(s)&&a.push(`path=${s}`),c.isString(n)&&a.push(`domain=${n}`),o===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let r=0;r<e.length;r++){const s=e[r].replace(/^\s+/,""),n=s.indexOf("=");if(n!==-1&&s.slice(0,n)===t)try{return decodeURIComponent(s.slice(n+1))}catch{return s.slice(n+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ui(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function di(t,e){if(!e)return t;let r=t.length;for(;r>0&&t.charCodeAt(r-1)===47;)r--;return t.slice(0,r)+"/"+e.replace(/^\/+/,"")}const hi=/^https?:(?!\/\/)/i;function fi(t){return t&&t.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,r,s="")=>`${r}${s}${Ge}`)}function pi(t){const e=t.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Ge}@`),r=e.indexOf("#"),s=(r===-1?e:e.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Ge}`);return r===-1?s:`${s}#${fi(e.slice(r+1))}`}function kr(t,e){if(typeof t=="string"){const r=xr(t);if(hi.test(r))throw new y(`Invalid URL ${JSON.stringify(pi(r))}: missing "//" after protocol`,y.ERR_INVALID_URL,e)}}function Dr(t,e,r,s){kr(e,s);let n=!ui(e);return t&&(n||r===!1)?(kr(t,s),di(t,e)):e}const Nr=t=>t instanceof $?{...t}:t,mi=t=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(t).concat(Object.getOwnPropertySymbols(t).filter(e=>Object.getOwnPropertyDescriptor(t,e).enumerable)):Object.keys(t);function me(t,e){t=t||{},e=e||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function s(u,h,g,_){return c.isPlainObject(u)&&c.isPlainObject(h)?c.merge.call({caseless:_},u,h):c.isPlainObject(h)?c.merge({},h):c.isArray(h)?h.slice():h}function n(u,h,g,_){if(c.isUndefined(h)){if(!c.isUndefined(u))return s(void 0,u,g,_)}else return s(u,h,g,_)}function o(u,h){if(!c.isUndefined(h))return s(void 0,h)}function i(u,h){if(c.isUndefined(h)){if(!c.isUndefined(u))return s(void 0,u)}else return s(void 0,h)}function a(u){const h=c.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!c.isUndefined(h))if(c.isPlainObject(h)){if(c.hasOwnProp(h,u))return h[u]}else return;const g=c.hasOwnProp(t,"transitional")?t.transitional:void 0;if(c.isPlainObject(g)&&c.hasOwnProp(g,u))return g[u]}function l(u,h,g){if(c.hasOwnProp(e,g))return s(u,h);if(c.hasOwnProp(t,g))return s(void 0,u)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutErrorMessage: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,allowedSocketPaths:i,responseEncoding:i,validateStatus:l,headers:(u,h,g)=>n(Nr(u),Nr(h),g,!0)};return c.forEach(mi({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=c.hasOwnProp(d,u)?d[u]:n,g=c.hasOwnProp(t,u)?t[u]:void 0,_=c.hasOwnProp(e,u)?e[u]:void 0,R=h(g,_,u);c.isUndefined(R)&&h!==l||(r[u]=R)}),c.hasOwnProp(e,"validateStatus")&&c.isUndefined(e.validateStatus)&&a("validateStatusUndefinedResolves")===!1&&(c.hasOwnProp(t,"validateStatus")?r.validateStatus=s(void 0,t.validateStatus):delete r.validateStatus),r}const gi=["content-type","content-length"];function bi(t,e,r){if(r!=="content-only"){t.set(e);return}Object.entries(e||{}).forEach(([s,n])=>{gi.includes(s.toLowerCase())&&t.set(s,n)})}const _i=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,r)=>String.fromCharCode(parseInt(r,16)));function jr(t){const e=me({},t),r=g=>c.hasOwnProp(e,g)?e[g]:void 0,s=r("data");let n=r("withXSRFToken");const o=r("xsrfHeaderName"),i=r("xsrfCookieName");let a=r("headers");const l=r("auth"),d=r("baseURL"),u=r("allowAbsoluteUrls"),h=r("url");if(e.headers=a=$.from(a),e.url=_r(Dr(d,h,u,e),r("params"),r("paramsSerializer")),l){const g=c.getSafeProp(l,"username")||"",_=c.getSafeProp(l,"password")||"";try{a.set("Authorization","Basic "+btoa(g+":"+(_?_i(_):"")))}catch(R){throw y.from(R,y.ERR_BAD_OPTION_VALUE,t)}}if(c.isFormData(s)){const g=c.getSafeProp(s,"getHeaders");V.hasStandardBrowserEnv||V.hasStandardBrowserWebWorkerEnv||c.isReactNative(s)?a.setContentType(void 0):c.isFunction(g)&&bi(a,g.call(s),r("formDataHeaderPolicy"))}if(V.hasStandardBrowserEnv&&(c.isFunction(n)&&(n=n(e)),n===!0||n==null&&li(e.url))){const g=o&&i&&ci.read(i);g&&a.set(o,g)}return e}const yi=typeof XMLHttpRequest<"u",wi=yi&&function(t){return new Promise(function(e,r){const s=jr(t);let n=s.data;const o=$.from(s.headers).normalize();let{responseType:i,onUploadProgress:a,onDownloadProgress:l}=s,d,u,h,g,_,R;function A(){g&&g(),_&&_(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function w(E){if(!m)return;if(m.status===0&&(Rt(xr(s.url))||Rt(V.origin))!=="file"&&!(m.responseURL&&m.responseURL.startsWith("file:"))){r(new y("Request aborted",y.ECONNABORTED,t,m)),A(),m=null;return}try{E?R&&R(E):_&&_()}catch(T){setTimeout(()=>{throw T})}if(!m)return;const f=$.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),k={data:!i||i==="text"||i==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:f,config:t,request:m};Rr(function(T){e(T),A()},function(T){r(T),A()},k),m=null}"onloadend"in m?m.onloadend=w:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.startsWith("file:"))||setTimeout(w)},m.onabort=function(){m&&(r(new y("Request aborted",y.ECONNABORTED,t,m)),A(),m=null)},m.onerror=function(E){const f=E&&E.message?E.message:"Network Error",k=new y(f,y.ERR_NETWORK,t,m);k.event=E||null,r(k),A(),m=null},m.ontimeout=function(){let E=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const f=s.transitional||St;s.timeoutErrorMessage&&(E=s.timeoutErrorMessage),r(new y(E,f.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,m)),A(),m=null},n===void 0&&o.setContentType(null),"setRequestHeader"in m&&c.forEach(dr(o),function(E,f){m.setRequestHeader(f,E)}),c.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),i&&i!=="json"&&(m.responseType=s.responseType),l&&([h,_,R]=Ye(l,!0),m.addEventListener("progress",h)),a&&m.upload&&([u,g]=Ye(a),m.upload.addEventListener("progress",u),m.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=E=>{m&&(r(!E||E.type?new Me(null,t,m):E),m.abort(),A(),m=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const b=Rt(s.url);if(b&&!V.protocols.includes(b)){r(new y("Unsupported protocol "+b+":",y.ERR_BAD_REQUEST,t)),A();return}m.send(n||null)})},vi=(t,e)=>{if(t=t?t.filter(Boolean):[],!e&&!t.length)return;const r=new AbortController;let s=!1;const n=function(l){if(!s){s=!0,i();const d=l instanceof Error?l:this.reason;r.abort(d instanceof y?d:new Me(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,n(new y(`timeout of ${e}ms exceeded`,y.ETIMEDOUT))},e);const i=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(n):l.removeEventListener("abort",n)}),t=null)};t.forEach(l=>{if(!s){if(l.aborted){n.call(l);return}l.addEventListener("abort",n,{once:!0})}});const{signal:a}=r;return a.unsubscribe=()=>c.asap(i),a},Ei=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,n;for(;s<r;)n=s+e,yield t.slice(s,n),s=n},Si=async function*(t,e){for await(const r of Oi(t))yield*Ei(r,e)},Oi=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},Ir=(t,e,r,s)=>{const n=Si(t,e);let o=0,i,a=l=>{i||(i=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:d,value:u}=await n.next();if(d){a(),l.close();return}let h=u.byteLength;if(r){let g=o+=h;r(g)}l.enqueue(new Uint8Array(u))}catch(d){throw a(d),d}},cancel(l){return a(l),n.return()}},{highWaterMark:2})},Ur=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,Lr=(t,e,r)=>e+2<r&&Ur(t.charCodeAt(e+1))&&Ur(t.charCodeAt(e+2)),Mr=t=>t<=57?t-48:(t&223)-55,Ti=t=>t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===43||t===47||t===45||t===95,Ci=t=>t===9||t===10||t===12||t===13||t===32,Ri=t=>{const e=Math.floor(t/4),r=t%4;return e*3+(r===2?1:r===3?2:0)},xi=t=>{const e=t.length;let r=0;return e>0&&t.charCodeAt(e-1)===61&&(r++,e>1&&t.charCodeAt(e-2)===61&&r++),Math.floor((e-r)*3/4)},Ai=t=>{const e=t.length;let r=0,s=0,n=!1;for(let o=0;o<e;o++){let i=t.charCodeAt(o);if(i===37&&Lr(t,o,e)&&(i=Mr(t.charCodeAt(o+1))*16+Mr(t.charCodeAt(o+2)),o+=2),!Ci(i)){if(i===61){s++;continue}if(!Ti(i)||s>0){n=!0;continue}r++}}return n||s>2||s>0&&(r+s)%4!==0||r%4===1?xi(t):Ri(r)},Pi=(t,e)=>{if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;const r=t.indexOf(",");if(r<0)return 0;const s=t.slice(5,r),n=t.slice(r+1);if(/;base64/i.test(s))return e(n);let o=0;for(let i=0,a=n.length;i<a;i++){const l=n.charCodeAt(i);if(l===37&&Lr(n,i,a))o+=1,i+=2;else if(l<128)o+=1;else if(l<2048)o+=2;else if(l>=55296&&l<=56319&&i+1<a){const d=n.charCodeAt(i+1);d>=56320&&d<=57343?(o+=4,i++):o+=3}else o+=3}return o};function ki(t){const e=typeof t=="string"?t.indexOf("#"):-1;return Pi(e===-1?t:t.slice(0,e),Ai)}const xt="1.20.0",Fr=64*1024,Di={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:et}=c,Ni=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,r)=>String.fromCharCode(parseInt(r,16))),Vr=t=>{if(!c.isString(t))return t;try{return decodeURIComponent(t)}catch{return t}},qr=(t,...e)=>{try{return!!t(...e)}catch{return!1}},ji=t=>{const e=t.indexOf("://");let r=t;return e!==-1&&(r=r.slice(e+3)),r.includes("@")||r.includes(":")},Ii=t=>{const e=c.global!==void 0&&c.global!==null?c.global:globalThis,{ReadableStream:r,TextEncoder:s}=e;t=c.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},t);const{fetch:n,Request:o,Response:i}=t,a=n?et(n):typeof fetch=="function",l=et(o),d=et(i);if(!a)return!1;const u=a&&et(r),h=a&&(typeof s=="function"?(w=>b=>w.encode(b))(new s):async w=>new Uint8Array(await new o(w).arrayBuffer())),g=l&&u&&qr(()=>{let w=!1;const b=new o(V.origin,{body:new r,method:"POST",get duplex(){return w=!0,"half"}}),E=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),w&&!E}),_=d&&u&&qr(()=>c.isReadableStream(new i("").body)),R={stream:_&&(w=>w.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!R[w]&&(R[w]=(b,E)=>{let f=b&&b[w];if(f)return f.call(b);throw new y(`Response type '${w}' is not supported`,y.ERR_NOT_SUPPORT,E)})});const A=async w=>{if(w==null)return 0;if(c.isBlob(w))return w.size;if(c.isSpecCompliantForm(w))return(await new o(V.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(c.isArrayBufferView(w)||c.isArrayBuffer(w))return w.byteLength;if(c.isURLSearchParams(w)&&(w=w+""),c.isString(w))return(await h(w)).byteLength},m=async(w,b)=>c.toFiniteNumber(w.getContentLength())??A(b);return async w=>{let{url:b,method:E,data:f,signal:k,cancelToken:T,timeout:L,onDownloadProgress:X,onUploadProgress:Z,responseType:z,headers:M,withCredentials:S="same-origin",fetchOptions:j,maxContentLength:H,maxBodyLength:Re,maxRedirects:Y}=jr(w);const O=c.isNumber(H)&&H>-1,I=c.isNumber(Re)&&Re>-1,re=D=>c.hasOwnProp(w,D)?w[D]:void 0;let ie=n||fetch;z=z?(z+"").toLowerCase():"text";let G=vi([k,T&&T.toAbortSignal()],L),F=null;const ye=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let ze,He=null;const _s=()=>new y("Request body larger than maxBodyLength limit",y.ERR_BAD_REQUEST,w,F);try{let D;const ee=re("auth");if(ee){const C=c.getSafeProp(ee,"username")||"",W=c.getSafeProp(ee,"password")||"";D={username:C,password:W}}if(ji(b)){const C=new URL(b,V.origin);if(!D&&(C.username||C.password)){const W=Vr(C.username),de=Vr(C.password);D={username:W,password:de}}(C.username||C.password)&&(C.username="",C.password="",b=C.href)}if(D&&(M.delete("authorization"),M.set("Authorization","Basic "+btoa(Ni((D.username||"")+":"+(D.password||""))))),O&&typeof b=="string"&&b.startsWith("data:")&&ki(b)>H)throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F);if(I&&E!=="get"&&E!=="head"){const C=await A(f);if(typeof C=="number"&&isFinite(C)&&(ze=C,C>Re))throw _s()}const ut=I&&(c.isReadableStream(f)||c.isStream(f)),ys=(C,W,de)=>Ir(C,Fr,we=>{if(I&&we>Re)throw He=_s();W&&W(we)},de);if(g&&E!=="get"&&E!=="head"&&(Z||ut)){if(ze=ze??await m(M,f),ze!==0||ut){let C=new o(b,{method:"POST",body:f,duplex:"half"}),W;if(c.isFormData(f)&&(W=C.headers.get("content-type"))&&M.setContentType(W),C.body){const[de,we]=Z&&Ar(ze,Ye(Pr(Z)))||[];f=ys(C.body,de,we)}}}else if(ut&&!l&&u&&E!=="get"&&E!=="head")f=ys(f);else if(ut&&l&&!g&&E!=="get"&&E!=="head")throw new y("Stream request bodies are not supported by the current fetch implementation",y.ERR_NOT_SUPPORT,w,F);c.isString(S)||(S=S?"include":"omit");const da=l&&"credentials"in o.prototype;if(c.isFormData(f)){const C=M.getContentType();C&&/^multipart\/form-data/i.test(C)&&!/boundary=/i.test(C)&&M.delete("content-type")}M.set("User-Agent","axios/"+xt,!1);const se=j==null?j:Object.assign(Object.create(null),j);se&&(delete se.body,delete se.headers,delete se.method,delete se.signal,delete se.duplex,delete se.credentials);const oe=Object.assign(Object.create(null),se,{signal:G,method:E.toUpperCase(),headers:dr(M.normalize()),body:f,duplex:"half",credentials:da?S:void 0});l&&(c.forEach(Di,(C,W)=>{oe[W]===void 0&&(oe[W]=C)}),oe.signal===void 0&&(oe.signal=null),oe.body===void 0&&(oe.body=null)),Y===0&&(oe.redirect="manual",se&&(se.redirect="manual")),F=l&&new o(b,oe);let ae=await(l?ie(F,se):ie(b,oe));const ws=$.from(ae.headers);if(O){const C=c.toFiniteNumber(ws.getContentLength());if(C!=null&&C>H)throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F)}const qt=_&&(z==="stream"||z==="response");if(_&&ae.body&&(X||O||qt&&ye)){const C={};["status","statusText","headers"].forEach(We=>{C[We]=ae[We]});const W=c.toFiniteNumber(ws.getContentLength()),[de,we]=X&&Ar(W,Ye(Pr(X),!0))||[];let vs=0;const ha=We=>{if(O&&(vs=We,vs>H))throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F);de&&de(We)};ae=new i(Ir(ae.body,Fr,ha,()=>{we&&we(),ye&&ye()}),C)}z=z||"text";let le=await R[c.findKey(R,z)||"text"](ae,w);if(O&&!_&&!qt){let C;if(le!=null&&(typeof le.byteLength=="number"?C=le.byteLength:typeof le.size=="number"?C=le.size:typeof le=="string"&&(C=typeof s=="function"?new s().encode(le).byteLength:le.length)),typeof C=="number"&&C>H)throw new y("maxContentLength size of "+H+" exceeded",y.ERR_BAD_RESPONSE,w,F)}return!qt&&ye&&ye(),await new Promise((C,W)=>{Rr(C,W,{data:le,headers:$.from(ae.headers),status:ae.status,statusText:ae.statusText,config:w,request:F})})}catch(D){if(ye&&ye(),G&&G.aborted&&G.reason instanceof y){const ee=G.reason;throw ee.config=w,F&&(ee.request=F),D!==ee&&Object.defineProperty(ee,"cause",{__proto__:null,value:D,writable:!0,enumerable:!1,configurable:!0}),ee}if(He)throw F&&!He.request&&(He.request=F),He;if(D instanceof y)throw F&&!D.request&&(D.request=F),D;if(D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)){const ee=new y("Network Error",y.ERR_NETWORK,w,F,D&&D.response);throw Object.defineProperty(ee,"cause",{__proto__:null,value:D.cause||D,writable:!0,enumerable:!1,configurable:!0}),ee}throw y.from(D,D&&D.code,w,F,D&&D.response)}}},Ui=new Map,$r=t=>{let e=t&&t.env||{};const{fetch:r,Request:s,Response:n}=e,o=[s,n,r];let i=o.length,a=i,l,d,u=Ui;for(;a--;)l=o[a],d=u.get(l),d===void 0&&u.set(l,d=a?new Map:Ii(e)),u=d;return d};$r();const At={http:Bn,xhr:wi,fetch:{get:$r}};c.forEach(At,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(t,"adapterName",{__proto__:null,value:e})}});const Br=t=>`- ${t}`,Li=t=>c.isFunction(t)||t===null||t===!1;function Mi(t,e){t=c.isArray(t)?t:[t];const{length:r}=t;let s,n;const o={};for(let i=0;i<r;i++){s=t[i];let a;if(n=s,!Li(s)&&(n=At[(a=String(s)).toLowerCase()],n===void 0))throw new y(`Unknown adapter '${a}'`);if(n&&(c.isFunction(n)||(n=n.get(e))))break;o[a||"#"+i]=n}if(!n){const i=Object.entries(o).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=r?i.length>1?`since :
5
5
  `+i.map(Br).join(`
6
6
  `):" "+Br(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+a,y.ERR_NOT_SUPPORT)}return n}const zr={getAdapter:Mi,adapters:At};function Pt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Me(null,t)}function kt(t){const e=c.toSafeFlatObject(t);return Pt(e),e.headers=$.from(c.getSafeProp(e,"headers")),e.data=Ct.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),zr.getAdapter(e.adapter||Le.adapter,e)(e).then(function(r){Pt(e),e.response=r;try{r.data=Ct.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=$.from(r.headers),r},function(r){if(!Cr(r)&&(Pt(e),r&&r.response)){e.response=r.response;try{r.response.data=Ct.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=$.from(r.response.headers)}return Promise.reject(r)})}const tt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{tt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Hr={};tt.transitional=function(t,e,r){function s(n,o){return"[Axios v"+xt+"] Transitional option '"+n+"'"+o+(r?". "+r:"")}return(n,o,i)=>{if(t===!1)throw new y(s(o," has been removed"+(e?" in "+e:"")),y.ERR_DEPRECATED);return e&&!Hr[o]&&(Hr[o]=!0,console.warn(s(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,o,i):!0}},tt.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Fi(t,e,r){if(typeof t!="object"||t===null)throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let n=s.length;for(;n-- >0;){const o=s[n],i=Object.prototype.hasOwnProperty.call(e,o)?e[o]:void 0;if(i){const a=t[o],l=a===void 0||i(a,o,t);if(l!==!0)throw new y("option "+o+" must be "+l,y.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const rt={assertOptions:Fi,validators:tt},B=rt.validators;let ge=class{constructor(t){this.defaults=t||{},this.interceptors={request:new vr,response:new vr}}async request(t,e){try{return await this._request(t,e)}catch(r){if(r instanceof Error)try{let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const n=s.stack;let o="";if(typeof n=="string"){const i=n.indexOf(`
7
7
  `);o=i===-1?"":n.slice(i+1)}if(!r.stack)r.stack=o;else if(o){const i=o.indexOf(`
8
8
  `),a=i===-1?-1:o.indexOf(`
9
9
  `,i+1),l=a===-1?"":o.slice(a+1);String(r.stack).endsWith(l)||(r.stack+=`
10
- `+o)}}catch{}throw r}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=me(this.defaults,e);const{transitional:r,paramsSerializer:s,headers:n}=e;r!==void 0&&rt.assertOptions(r,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean),legacyInterceptorReqResOrdering:B.transitional(B.boolean),advertiseZstdAcceptEncoding:B.transitional(B.boolean),validateStatusUndefinedResolves:B.transitional(B.boolean)},!1),s!=null&&(c.isFunction(s)?e.paramsSerializer={serialize:s}:rt.assertOptions(s,{encode:B.function,serialize:B.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),rt.assertOptions(e,{baseUrl:B.spelling("baseURL"),withXsrfToken:B.spelling("withXSRFToken")},!0),e.method=(c.getSafeProp(e,"method")||c.getSafeProp(this.defaults,"method")||"get").toLowerCase();let o=n&&c.merge(n.common,n[e.method]);n&&c.forEach(Tr.concat("common"),_=>{delete n[_]}),e.headers=$.concat(o,n);const i=[];let a=!0;this.interceptors.request.forEach(function(_){if(typeof _.runWhen=="function"&&_.runWhen(e)===!1)return;a=a&&_.synchronous;const R=e.transitional||St;R&&R.legacyInterceptorReqResOrdering?i.unshift(_.fulfilled,_.rejected):i.push(_.fulfilled,_.rejected)});const l=[];this.interceptors.response.forEach(function(_){l.push(_.fulfilled,_.rejected)});let d,u=0,h;if(!a){const _=[kt.bind(this),void 0];for(_.unshift(...i),_.push(...l),h=_.length,d=Promise.resolve(e);u<h;)d=d.then(_[u++],_[u++]);return d}h=i.length;let g=e;for(;u<h;){const _=i[u++],R=i[u++];try{g=_?_(g):g}catch(A){if(!R){d=Promise.reject(A);break}try{const m=R.call(this,A);c.isThenable(m)&&(d=Promise.resolve(m).then(()=>kt.call(this,g)))}catch(m){d=Promise.reject(m)}break}}if(!d)try{d=kt.call(this,g)}catch(_){d=Promise.reject(_)}for(u=0,h=l.length;u<h;)d=d.then(l[u++],l[u++]);return d}getUri(t){t=me(this.defaults,t);const e=Dr(t.baseURL,t.url,t.allowAbsoluteUrls,t);return _r(e,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){ge.prototype[t]=function(e,r){return this.request(me(r||{},{method:t,url:e,data:r&&c.hasOwnProp(r,"data")?r.data:void 0}))}}),c.forEach(["post","put","patch","query"],function(t){function e(r){return function(s,n,o){return this.request(me(o||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:n}))}}ge.prototype[t]=e(),t!=="query"&&(ge.prototype[t+"Form"]=e(!0))});let Vi=class Ss{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});const s=this;this.promise.then(n=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](n);s._listeners=null}),this.promise.then=n=>{let o;const i=new Promise(a=>{s.subscribe(a),o=a}).then(n);return i.cancel=function(){s.unsubscribe(o)},i},e(function(n,o,i){s.reason||(s.reason=new Me(n,o,i),r(s.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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Ss(function(r){e=r}),cancel:e}}};function qi(t){return function(e){return t.apply(null,e)}}function $i(t){return c.isObject(t)&&t.isAxiosError===!0}const st={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(st).forEach(([t,e])=>{st[e]===void 0&&(st[e]=t)});function Wr(t){const e=new ge(t),r=Qt(ge.prototype.request,e);return c.extend(r,ge.prototype,e,{allOwnKeys:!0}),c.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return Wr(me(t,s))},r}const U=Wr(Le);U.Axios=ge,U.CanceledError=Me,U.CancelToken=Vi,U.isCancel=Cr,U.VERSION=xt,U.toFormData=Qe,U.AxiosError=y,U.Cancel=U.CanceledError,U.all=function(t){return Promise.all(t)},U.spread=qi,U.isAxiosError=$i,U.mergeConfig=me,U.AxiosHeaders=$,U.formToJSON=t=>Or(c.isHTMLForm(t)?new FormData(t):t),U.getAdapter=zr.getAdapter,U.HttpStatusCode=st,U.default=U;const{Axios:pa,AxiosError:ma,CanceledError:ga,isCancel:ba,CancelToken:_a,VERSION:ya,all:wa,Cancel:va,isAxiosError:Ea,spread:Sa,toFormData:Oa,AxiosHeaders:Ta,HttpStatusCode:Ca,formToJSON:Ra,getAdapter:xa,mergeConfig:Aa,create:Pa}=U;function Fe(t){return t?.name==="AuthRequiredError"}const Bi=new Set(["OpenC3::AuthError","OpenC3::ForbiddenError"]);function zi(t){return t?.response?.status===401||t?.status===401||Bi.has(t?.name)}function Jr(t){!Fe(t)&&!zi(t)&&console.error(t)}class Kr extends Error{constructor(e="Authentication required"){super(e),this.name="AuthRequiredError"}}globalThis.__openc3AuthRejectionHandler||(globalThis.__openc3AuthRejectionHandler=!0,globalThis.addEventListener?.("unhandledrejection",t=>{Fe(t.reason)&&t.preventDefault()}));let Xr=!1;function Zr(){Xr||(Xr=!0,OpenC3Auth.login())}async function Dt(){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch(t){throw Fe(t)?t:(Zr(),new Kr(t?.message))}if(!localStorage.openc3Token)throw Zr(),new Kr}const Nt=U.create({baseURL:location.origin,timeout:6e4,params:{}});Nt.interceptors.response.use(t=>t,t=>{if(t.response){if(t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);if(t.response.status===401)return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(n){n&&OpenC3Auth.setTokens()}).catch(Jr),Promise.reject(t);const e=t.response?.data?.error?.data?.class;if(e==="HazardousError"||e==="CriticalCmdError")return Promise.reject(t);let r=`HTTP ${t.response.status} - `;t.response?.statusText&&(r+=`${t.response.statusText} `),t.response?.config?.data&&(r+=`${t.response.config.data} `),t.response?.data?.message?r+=`${t.response.data.message}`:t.response?.data?.exception?r+=`${t.response.data.exception}`:t.response?.data?.error?.message?(t.response.data.error.class&&(r+=`${t.response.data.error.class} `),r+=`${t.response.data.error.message}`):r+=`${t.response?.data}`;const{$cosmosNotify:s}=window;throw s&&s.serious({title:"Network error",body:r}),t}else throw t});const nt=async function(t,e,{data:r,params:s={},headers:n,noAuth:o=!1,optionalAuth:i=!1,noScope:a=!1,onUploadProgress:l=!1,responseType:d}={}){if(!o)if(i){try{await Dt()}catch(u){if(!Fe(u))throw u}localStorage.openc3Token&&(n.Authorization=localStorage.openc3Token)}else await Dt(),n.Authorization=localStorage.openc3Token;return n.manual=!0,!a&&!s.scope&&(s.scope=window.openc3Scope),Nt({method:t,url:e,data:r,params:s,headers:n,onUploadProgress:l,responseType:d})},jt={Accept:"application/json"},Gr={...jt,"Content-Type":"application/json"},Hi={get:function(t,{params:e,headers:r=jt,noScope:s,noAuth:n,optionalAuth:o,onUploadProgress:i,responseType:a}={}){return nt("get",t,{params:e,headers:r,noScope:s,noAuth:n,optionalAuth:o,onUploadProgress:i,responseType:a})},put:function(t,{data:e,params:r,headers:s=Gr,noScope:n,noAuth:o,onUploadProgress:i}={}){return nt("put",t,{data:e,params:r,headers:s,noScope:n,noAuth:o,onUploadProgress:i})},post:function(t,{data:e,params:r,headers:s=Gr,noScope:n,noAuth:o,onUploadProgress:i,responseType:a}={}){return nt("post",t,{data:e,params:r,headers:s,noScope:n,noAuth:o,onUploadProgress:i,responseType:a})},delete:function(t,{params:e,headers:r=jt,noScope:s,noAuth:n,onUploadProgress:o}={}){return nt("delete",t,{params:e,headers:r,noScope:s,noAuth:n,onUploadProgress:o})}};let it=()=>({emit(t,...e){for(let r=this.events[t]||[],s=0,n=r.length;s<n;s++)r[s](...e)},events:{},on(t,e){return(this.events[t]||=[]).push(e),()=>{this.events[t]=this.events[t]?.filter(r=>e!==r)}}});class Ve extends Error{constructor(e,r){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=r,this.name="ReasonError"}}class It extends Ve{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class Wi extends Ve{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class te extends Ve{constructor(e,r){r?super(e,r):super("Disconnected",e),this.name="DisconnectedError"}}class Ji extends te{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Qr(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let r=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${r}`}).join(",")}}`:""}class Ki{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,r){if(!this._info)return this._info={id:String(e),info:r},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((r,{id:s,info:n})=>(r[s]=n,r),{})}}const be=Symbol("state");class Yr{constructor(e={}){this.emitter=it(),this.params=Object.freeze(e),this.presence=new Ki(this),this.initialConnect=!0,this[be]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Qr({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[be]}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[be]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[be]="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[be]="connected";let e=!0,r=!0;this.initialConnect=!1,this.emit("connect",{reconnect:r,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[be]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[be]="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,r){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,r)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(r){let s=this.receiver?this.receiver.logger:null;s&&s.warn("whisper failed: ",r)}}receive(e,r){this.emit("message",e,r)}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}emit(e,...r){return this.emitter.emit(e,...r)}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,r)=>{let s=[()=>delete this._pendingSubscribe];s.push(this.on("connect",()=>{s.forEach(n=>n()),e()})),s.push(this.on("close",n=>{s.forEach(o=>o()),r(n||new Ve("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class Xi{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 r=this.channels.indexOf(e);r>-1&&this.channels.splice(r,1)}notify(e,...r){this.state=e==="restored"?"connected":e,r.length===1?this.channels.forEach(s=>s[e](r[0])):this.channels.forEach(s=>s[e]())}pending(e){this._checkIntent(e);let r=this._pendings[0];return!r||r.intent!==e?Promise.resolve():r.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 r,s={promise:new Promise(o=>{r=o}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(s),1),r(s)},canceled:!1,acquired:!1},n=this._pendingTop;return this._pendings.push(s),n&&await n.promise,this.gvl&&await this.gvl.acquire(s,e),s.acquired=!0,s}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 r=this._pendingTop;return!r||r.acquired||r.intent!==e?!1:(this._pendings.pop(),r.canceled=!0,!0)}}class Zi{constructor(){this.queue=[]}async acquire(e,r){r==="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 Gi{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new Zi),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:r,unsubscribe:s}){let n=this._subscriptions[e]=new Xi(e);return n.remoteId=this._localToRemote[e],n.subscriber=r,n.unsubscriber=s,n.gvl=this.glv,n}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,r){this._localToRemote[e]=r;let s=this.get(e);s&&(s.remoteId=r)}}class Qi{constructor(e={}){this.subscriptions=new Gi(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,r){this._remoteToLocal[r]=e,this.subscriptions.storeRemoteId(e,r),this.flush(r)}unsubscribe(e){let r=this.subscriptions.get(e);if(!r)return;let s=r.remoteId;s&&delete this._remoteToLocal[s],this.subscriptions.remove(e)}transmit(e,r,s){let n=this._remoteToLocal[e];if(!n){this._pendingMessages.push([e,r,s]);return}let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>{i.receive(r,s)})}notify(e,r,s){let n=this._remoteToLocal[e];if(!n)return;let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>i.emit(r,s))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let r=[];for(let s of this._pendingMessages)s[0]===e?this.transmit(s[0],s[1],s[2]):r.push(s);this._pendingMessages=r}}const es={debug:0,info:1,warn:2,error:3};class ts{constructor(e){this.level=e||"warn"}log(e,r,s){es[e]<es[this.level]||this.writeLogEntry(e,r,s)}writeLogEntry(){throw Error("Not implemented")}debug(e,r){this.log("debug",e,r)}info(e,r){this.log("info",e,r)}warn(e,r){this.log("warn",e,r)}error(e,r){this.log("error",e,r)}}class qe extends ts{writeLogEntry(){}}class Yi{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let eo=0;class rs{constructor(e={}){let{logger:r}=e;this.logger=r||new qe,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,r){let s={channel:e};r&&Object.assign(s,r);let n=Qr(s);if(this.pendingUnsubscriptions[n]){let i=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${i}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,r))},i)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let o=this.subscribeRetryInterval;return new Promise((i,a)=>{let l=++eo;this.pendingSubscriptions[n]={resolve:i,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,n,o)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(this.logger.warn(`no subscription ack received in ${s}ms, retrying subscribe`,r),this.cable.send(this.buildSubscribeRequest(r)),this.maybeExpireSubscribe(e,r,s))},s)}maybeExpireSubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(delete this.pendingSubscriptions[r],n.reject(new Wi(`Haven't received subscription ack in ${s*2}ms for ${r}`)))},s)}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,r,s){return r==="$whisper"?this.whisper(e,s):(s||(s={}),s.action||=r,this.cable.send({command:"message",identifier:e,data:JSON.stringify(s)}),Promise.resolve())}whisper(e,r){return this.cable.send({command:"whisper",identifier:e,data:r}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n,reason:o,reconnect:i}=e;if(r==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(r==="disconnect"){let a=new te(o);this.reset(a),i===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(r==="confirm_subscription"){let a=this.pendingSubscriptions[s];if(!a){this.logger.error("subscription not found, unsubscribing",{type:r,identifier:s}),this.unsubscribe(s);return}return delete this.pendingSubscriptions[s],a.resolve(s)}if(r==="reject_subscription"){let a=this.pendingSubscriptions[s];return a?(delete this.pendingSubscriptions[s],a.reject(new It)):this.logger.error("subscription not found",{type:r,identifier:s})}if(n)return{identifier:s,message:n};this.logger.warn(`unknown message type: ${r}`,{message:e})}reset(e){for(let r in this.pendingSubscriptions)this.pendingSubscriptions[r].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const ss=()=>Date.now()/1e3|0;class to extends rs{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=ss()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let r in this.pendingPresence)this.pendingPresence[r].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n}=e;if(r==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(r==="reject_subscription")return super.receive(e);if(r==="confirm_subscription")return this.subscriptionStreams[s]||(this.subscriptionStreams[s]=new Set),super.receive(e);if(r==="ping")return this.restoreSince&&(this.restoreSince=ss()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",s);return}if(r==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",s);return}if(r==="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(r==="presence"){let o=n.type;if(o==="info"){let i=this.pendingPresence[s];i&&(delete this.pendingPresence[s],i.resolve(n))}else if(o==="error"){let i=this.pendingPresence[s];i&&(delete this.pendingPresence[s],i.reject(new Error("failed to retrieve presence")))}return{type:r,identifier:s,message:n}}if(n){let o=this.trackStreamPosition(s,e.stream_id,e.epoch,e.offset);return{identifier:s,message:n,meta:o}}this.logger.warn(`unknown message type: ${r}`,{message:e})}perform(e,r,s){switch(r){case"$presence:join":return this.join(e,s);case"$presence:leave":return this.leave(e,s);case"$presence:info":return this.presence(e,s)}return super.perform(e,r,s)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let r=super.buildSubscribeRequest(e),s=this.historyRequestFor(e);s&&(r.history=s,this.pendingHistory[e]=!0);let n=this.presenceInfo[e];return n&&(r.presence=n),r}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let r={},s=!1;if(this.subscriptionStreams[e])for(let n of this.subscriptionStreams[e]){let o=this.streamsPositions[n];o&&(s=!0,r[n]=o)}if(!(!s&&!this.restoreSince))return{since:this.restoreSince,streams:r}}trackStreamPosition(e,r,s,n){if(!(!r||!s))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(r),this.streamsPositions[r]={epoch:s,offset:n},{stream:r,epoch:s,offset:n}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,r){return this.presenceInfo[e]=r,this.cable.send({command:"join",identifier:e,presence:r}),Promise.resolve()}async leave(e,r){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:r}),Promise.resolve()}presence(e,r){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((s,n)=>{this.pendingPresence[e]={resolve:s,reject:n},this.cable.send({command:"presence",identifier:e,data:r})})}}class ro extends Ve{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class ns extends Yr{static identifier="__ghost__";constructor(e,r){super(r),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}const so="$pubsub";class is extends Yr{static identifier=so;async perform(e,r){if(e.startsWith("$"))return super.perform(e,r);throw Error("not implemented")}}const _e=Symbol("state");let no=class{constructor({transport:t,protocol:e,encoder:r,logger:s,lazy:n,hubOptions:o,performFailures:i,transportConfigurator:a}){this.emitter=it(),this.transport=t,this.encoder=r,this.logger=s||new qe,this.protocol=e,this.performFailures=i||"throw",this.protocol.attached(this),this.hub=new Qi(o||{}),this[_e]="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,n===!1&&this.connect().catch(()=>{})}get state(){return this[_e]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[_e]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(r){this.handleClose(r)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[_e]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new te("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[_e]="connected",this.hub.subscriptions.all().forEach(s=>{t&&s.remoteId&&t.includes(s.remoteId)?s.notify("restored"):(s.notify("disconnected",new te("recovery_failed")),this._resubscribe(s))});let e=!this.initialConnect,r=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:r})}notify(t,e,r){e&&typeof e!="string"&&(r=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:r}):this.emit("info",{type:t,data:r})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new te(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[_e]="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 te?t:new te(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[_e]="closed";let r=e||new te("cable_closed");this.hub.subscriptions.all().forEach(s=>s.notify("disconnected",r)),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 r=this.protocol.receive(e);if(r){this.logger.debug("processed incoming message",r);let{type:s,identifier:n,message:o,meta:i}=r;s?this.hub.notify(n,s,o):this.hub.transmit(n,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 is({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new is({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let r,s;return typeof t=="string"&&(s=t,t=ns),r=s?new t(s,e):new t(e),this.subscribe(r)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let r=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:s=>this._subscribe(s,t.channelId,t.params),unsubscribe:s=>this._unsubscribe(s)});return r.add(t),r.intent==="subscribed"&&r.state==="connected"&&t.connected(),r.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,r){let s=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s});return}this.logger.debug("acquiring subscribe lock",{identifier:s});let n=await t.acquire("subscribed");if(n.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:s}),n.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:s}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),n.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s}),n.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:s}),t.notify("connected"),n.release();return}let o={identifier:e,params:r};this.logger.debug("subscribing",o);try{let i=await this.protocol.subscribe(e,r);this.hub.subscribe(s,i),this.logger.debug("subscribed",{...o,remoteId:i}),t.notify("connected")}catch(i){if(i){if(i instanceof It&&this.logger.warn("rejected",o),i instanceof te){this.logger.debug("disconnected during subscription; will retry on connect",o),n.release();return}this.logger.error("failed to subscribe",{error:i,...o})}t.close(i),this.hub.unsubscribe(s)}n.release()}unsubscribe(t){let e=t.identifier,r=this.hub.subscriptions.get(e);if(!r)throw Error(`Subscription not found: ${e}`);r.remove(t),t.closed(),r.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let r=await t.acquire("unsubscribed");if(r.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),r.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}),r.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),r.release();return}let s=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:s}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),r.release();return}try{await this.protocol.unsubscribe(s),this.logger.debug("unsubscribed remotely",{id:e})}catch(n){n&&(n instanceof te?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:n}):this.logger.error("unsubscribe failed",{id:e,error:n}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",r.release()}async perform(t,e,r){if(this.performFailures==="throw")return this._perform(t,e,r);try{return await this._perform(t,e,r)}catch(s){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:s});return}}async _perform(t,e,r){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new ro;let s=this.hub.subscriptions.get(t);if(!s)throw Error(`Subscription not found: ${t}`);if(await s.pending("subscribed"),s.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let n=s.remoteId,o={id:n,action:e,payload:r};this.logger.debug("perform",o);try{let i=await this.protocol.perform(n,e,r);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 r=this.emitter.on(t,(...s)=>{r(),e(...s)});return r}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let r=[()=>delete this._pendingConnect];r.push(this.on("connect",()=>{r.forEach(s=>s()),t()})),r.push(this.on("close",s=>{r.forEach(n=>n()),e(s)})),r.push(this.on("disconnect",s=>{r.forEach(n=>n()),e(s)}))}),this._pendingConnect)}};const io={maxMissingPings:2,maxReconnectAttempts:1/0},Ce=()=>Date.now(),os=(t,e)=>{e=e||{};let{backoffRate:r,jitterRatio:s,maxInterval:n}=e;return r=r||2,s===void 0&&(s=.5),o=>{let i=t*r**o,a=i*r,l=i+(a-i)*Math.random(),d=2*(Math.random()-.5)*s;return l=l*(1+d),n&&n<l&&(l=n),l}};let as=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},io,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 qe,this.state="pending_connect",this.attempts=0,this.disconnectedAt=Ce()}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=Ce(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=Ce(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=Ce(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=Ce()})),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=Ce()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new Ji))}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 oo{constructor(e,r={}){this.transports=e,this.transport=null,this.emitter=it(),this.unbind=[],this.logger=r.logger||new qe}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let r=this.transports[e];try{this.transport=r,this.resetListeners(),this.logger.debug(`Trying to connect via ${r.displayName()}`),await r.open(),this.logger.debug(`Connected via ${r.displayName()}`);return}catch(s){this.logger.debug(`Failed to connect via ${r.displayName()}: ${s.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,r){this.transports.forEach(s=>{s.setParam(e,r)})}setToken(e,r){this.transports.forEach(s=>{s.setToken(e,r)})}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 ao{constructor(e,r={}){this.url=e;let s=r.websocketImplementation;if(s)this.Impl=s;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=it();let{format:n,subprotocol:o,authStrategy:i}=r;this.format=n||"text",this.connectionOptions=r.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((r,s)=>{let n=[];n.push(this.once("open",()=>{n.forEach(o=>o()),r()})),n.push(this.once("close",()=>{n.forEach(o=>o()),s(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,r){let s=new URL(this.url);s.searchParams.set(e,r);let n=`${s.protocol}//${s.host}${s.pathname}?${s.searchParams}`;this.setURL(n)}setToken(e,r="jid"){if(this.authStrategy==="param")this.setParam(r,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let s=`x-${r}`.toLowerCase();s=Object.keys(this.connectionOptions.headers).find(n=>n.toLowerCase()===s)||s,this.connectionOptions.headers[s]=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,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 r=e.data;this.format==="binary"&&(r=new Uint8Array(r)),this.emitter.emit("data",r)},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 lo{constructor(e){this.channel=e}notify(e,...r){typeof this[e]=="function"&&this[e](...r)}perform(e,r={}){this.channel.perform(e,r)}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 co extends ns{constructor(e,r,s){super(e,r),this.subscription=new lo(this),Object.assign(this.subscription,s),this.on("connect",({reconnect:n})=>this.subscription.notify("connected",{reconnected:n})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",n=>this.subscription.notify("received",n)),this.on("close",n=>{n&&n instanceof It?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class uo{constructor(e){this.cable=e}create(e,r){let s,n;typeof e=="object"?(s=e.channel,delete e.channel,n=e):(s=e,n={});let o=new co(s,n,r);return o.subscription.notify("initialized"),this.cable.subscribe(o),o.subscription}findAll(e){return this.cable.hub.channels.filter(r=>r.identifier===e).map(r=>r.subscription)}}class ho{constructor(e){this.cable=e,this.subscriptions=new uo(e)}send(e){return this.cable.send(e)}connect(){return this.cable.connect()}disconnect(){return this.cable.disconnect()}ensureActiveConnection(){return this.cable.connect()}}const ls={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function fo(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({},ls,e);let{protocol:r,websocketImplementation:s,websocketFormat:n,websocketOptions:o,websocketAuthStrategy:i,fallbacks:a,logLevel:l,logger:d,transport:u,encoder:h,lazy:g,monitor:_,pingInterval:R,reconnectStrategy:A,maxMissingPings:m,maxReconnectAttempts:w,subprotocol:b,tokenRefresher:E,historyTimestamp:f,protocolOptions:k,concurrentSubscribes:T,performFailures:L,transportConfigurator:Z,auth:X}=e;if(d=d||new qe(l),typeof r=="string"){b=b||r;let S=r.substring(0,r.lastIndexOf("-")),j=r.substring(r.lastIndexOf("-")+1);if(k=k||{},S==="actioncable-v1")r=new rs({logger:d,...k});else if(S==="actioncable-v1-ext")r=new to({logger:d,historyTimestamp:f,...k});else throw Error(`Protocol is not supported yet: ${r}`);if(j==="json")h=h||new Yi,n=n||"text";else if(j==="msgpack"){if(n="binary",!h)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(j==="protobuf"){if(n=n||"binary",!h)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: ${r}`)}if(!r)throw Error("Protocol must be specified");u=u||new ao(t,{websocketImplementation:s,websocketOptions:o,subprotocol:b,authStrategy:i,format:n}),a&&(u=new oo([u,...a],{logger:d})),X&&X.token&&u.setToken(X.token,X.param||"jid"),A=A||os(R),_!==!1&&(_=_||new as({pingInterval:R,reconnectStrategy:A,maxMissingPings:m,maxReconnectAttempts:w,logger:d}));let z={concurrentSubscribes:T},M=new no({protocol:r,transport:u,encoder:h,logger:d,lazy:g,hubOptions:z,performFailures:L,transportConfigurator:Z});return _&&(_.watch(M),M.monitor=_),E&&po(M,async()=>{try{await E(u)}catch(S){return d.error("Failed to refresh authentication token: "+S),!1}return M.connect().catch(()=>{}),!0}),M}function po(t,e){let r=!1;t.on("connect",()=>r=!1),t.on("close",async s=>{if(s){if(r){t.logger.warn("Token auto-refresh is disabled",s);return}s.reason==="token_expired"&&(r=!0,await e())}})}class mo extends ts{writeLogEntry(e,r,s){s?console[e](r,s):console[e](r)}}class go extends as{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")},r=n=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:n})},s=()=>this.disconnect(new te("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",r,!1),window.addEventListener("resume",r,!1),window.addEventListener("freeze",s,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",r,!1),window.removeEventListener("online",r,!1),window.removeEventListener("resume",r,!1),window.removeEventListener("freeze",s,!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 bo=["cable","action-cable"],_o="/cable",ot=(t,e)=>{for(let r of bo){let s=t.head.querySelector(`meta[name='${r}-${e}']`);if(s)return s.getAttribute("content")}},cs=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,yo=()=>{if(typeof document<"u"&&document.head){let t=ot(document,"url");if(t)return cs(t)}return cs(_o)},wo=()=>{if(typeof document<"u"&&document.head){let t=ot(document,"history-timestamp");if(t)return t|0}},vo=()=>{if(typeof document<"u"&&document.head)return ot(document,"token")},Eo=()=>{if(typeof document<"u"&&document.head)return ot(document,"token-param")};function So(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||yo(),e=e||{},e.historyTimestamp||=wo();let r=vo();if(r){let d=Eo();e.auth=Object.assign({token:r,param:d},e.auth||{})}e=Object.assign({},ls,e);let{logLevel:s,logger:n,pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new mo(s),i=e.reconnectStrategy=e.reconnectStrategy||os(o),e.monitor!==!1&&(e.monitor=e.monitor||new go({pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:l,logger:n})),fo(t,e)}function Oo(t,e){let r=So(t,e);return new ho(r)}const To=1e3;class Co{constructor(e,r,s,n,o){this._cable=e,this._channel=r,this._scope=s,this._callbacks=n,this._additionalOptions=o,this._subscription=null,this._unsubscribed=!1}get identifier(){return this._subscription?.identifier}perform(e,r){return this._subscription?.perform(e,r)}send(e){return this._subscription?.send(e)}unsubscribe(){return this._unsubscribed=!0,this._cable._forget(this),this._subscription?.unsubscribe()}_subscribe(e){this._unsubscribed||(this._subscription=e.subscriptions.create({channel:this._channel,token:localStorage.openc3Token,...this._additionalOptions},{...this._callbacks,disconnected:r=>{this._unsubscribed||(r?.allowReconnect===!1&&this._cable._scheduleRecovery(),this._callbacks.disconnected?.(r))}}))}}class Ro{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e,this._subscriptions=new Set,this._recovery=null}disconnect(){this._cancelRecovery(),this._subscriptions.forEach(e=>{e._unsubscribed=!0}),this._subscriptions.clear(),this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,r,s={},n={}){const o=new Co(this,e,r,s,n);return this._subscriptions.add(o),this._resubscribe(o).then(()=>o)}_resubscribe(e){if(this._cable==null){const r=new URL(this._url,document.baseURI);r.searchParams.set("scope",e._scope),this._cable=Oo(r.href)}return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(r=>{r&&OpenC3Auth.setTokens(),this._cable&&e._subscribe(this._cable)}).catch(r=>{if(!Fe(r))throw r})}_scheduleRecovery(){this._recovery||(this._recovery=setTimeout(()=>{const e=[...this._subscriptions];this._cable&&(this._cable.cable.disconnect(),this._cable=null),e.reduce((r,s)=>r.then(()=>this._resubscribe(s)),Promise.resolve()).catch(r=>console.error("failed to recover cable",r)).finally(()=>{this._recovery=null})},To))}_cancelRecovery(){this._recovery&&(clearTimeout(this._recovery),this._recovery=null)}_forget(e){this._subscriptions.delete(e),this._subscriptions.size===0&&this._cancelRecovery()}recordPing(){}}function $e(t){return xo.test(t)}const xo=/^-?[0-9]+$/;function us(t){return Ao.test(t)}const Ao=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ds(t,e){if($e(t))return Number.isSafeInteger(Number.parseInt(t,10));const r=Number.parseFloat(t),s=String(r);if(t===s)return!0;const n=hs(t),o=hs(s);return!!(n===o||e?.approx===!0&&!$e(t)&&o.length>=14&&n.startsWith(o.substring(0,14)))}let Be=(function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t})({});function Po(t){if(ds(t,{approx:!1}))return;if($e(t))return Be.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?Be.underflow:Be.truncate_float:Be.overflow}function hs(t){const{start:e,end:r}=ko(t),s=t.substring(e,r),n=s.indexOf(".");return n===-1?s:s.substring(0,n)+s.substring(n+1)}function ko(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let r=t.lastIndexOf("e");for(r===-1&&(r=t.lastIndexOf("E")),r===-1&&(r=t.length);(t[r-1]==="0"||t[r-1]===".")&&r>e;)r--;return{start:e,end:r}}class Do{isLosslessNumber=!0;constructor(e){if(!us(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Po(this.value);if(e===void 0||e===Be.truncate_float)return Number.parseFloat(this.value);if($e(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 No(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function jo(t){return new Do(t)}function Io(t,e){return Ut({"":t},"",t,e)}function Ut(t,e,r,s){return Array.isArray(r)?s.call(t,e,Lo(r,s)):r&&typeof r=="object"&&!No(r)?s.call(t,e,Uo(r,s)):s.call(t,e,r)}function Uo(t,e){for(const r of Object.keys(t)){const s=Ut(t,r,t[r],e);s!==void 0?t[r]=s:delete t[r]}return t}function Lo(t,e){for(let r=0;r<t.length;r++)t[r]=Ut(t,String(r),t[r],e);return t}function Mo(t,e,r){const s=typeof r=="function"?{parseNumber:r}:r,n=s?.parseNumber??jo,o=s?.onDuplicateKey??L;let i=0;const a=u();return w(a),E(),e?Io(a,e):a;function l(){if(t.charCodeAt(i)===zo){i++,g();const O={};let I=!0;for(;i<t.length&&t.charCodeAt(i)!==ps;){I?I=!1:(A(),g());const re=i,ie=_();if(ie===void 0){T();return}g(),m();const G=u();if(G===void 0){S();return}if(Object.prototype.hasOwnProperty.call(O,ie)&&!Lt(G,O[ie])){const F=o({key:ie,position:re+1,oldValue:O[ie],newValue:G});F!==void 0&&(O[ie]=F)}else O[ie]=G}return t.charCodeAt(i)!==ps&&Z(),i++,O}}function d(){if(t.charCodeAt(i)===Ho){i++,g();const O=[];let I=!0;for(;i<t.length&&t.charCodeAt(i)!==ms;){I?I=!1:A();const re=u();b(re),O.push(re)}return t.charCodeAt(i)!==ms&&X(),i++,O}}function u(){g();const O=_()??R()??l()??d()??h("true",!0)??h("false",!1)??h("null",null);return g(),O}function h(O,I){if(t.slice(i,i+O.length)===O)return i+=O.length,I}function g(){for(;Fo(t.charCodeAt(i));)i++}function _(){if(t.charCodeAt(i)===Mt){i++;let O="";for(;i<t.length&&t.charCodeAt(i)!==Mt;){if(t.charCodeAt(i)===Bo){const I=t[i+1],re=$o[I];re!==void 0?(O+=re,i++):I==="u"?at(t.charCodeAt(i+2))&&at(t.charCodeAt(i+3))&&at(t.charCodeAt(i+4))&&at(t.charCodeAt(i+5))?(O+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):j(i):M(i)}else qo(t.charCodeAt(i))?O+=t[i]:z(t[i]);i++}return k(),i++,O}}function R(){const O=i;if(t.charCodeAt(i)===gs&&(i++,f(O)),t.charCodeAt(i)===Ft)i++;else if(Vo(t.charCodeAt(i)))for(i++;lt(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===Yo)for(i++,f(O);lt(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===na||t.charCodeAt(i)===sa)for(i++,(t.charCodeAt(i)===gs||t.charCodeAt(i)===Zo)&&i++,f(O);lt(t.charCodeAt(i));)i++;if(i>O)return n(t.slice(O,i))}function A(){if(t.charCodeAt(i)!==Qo)throw new SyntaxError(`Comma ',' expected after value ${Y()}`);i++}function m(){if(t.charCodeAt(i)!==ea)throw new SyntaxError(`Colon ':' expected after property name ${Y()}`);i++}function w(O){if(O===void 0)throw new SyntaxError(`JSON value expected ${Y()}`)}function b(O){if(O===void 0)throw new SyntaxError(`Array item expected ${Y()}`)}function E(){if(i<t.length)throw new SyntaxError(`Expected end of input ${Y()}`)}function f(O){if(!lt(t.charCodeAt(i))){const I=t.slice(O,i);throw new SyntaxError(`Invalid number '${I}', expecting a digit ${Y()}`)}}function k(){if(t.charCodeAt(i)!==Mt)throw new SyntaxError(`End of string '"' expected ${Y()}`)}function T(){throw new SyntaxError(`Quoted object key expected ${Y()}`)}function L(O){let{key:I,position:re}=O;throw new SyntaxError(`Duplicate key '${I}' encountered at position ${re}`)}function Z(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${Y()}`)}function X(){throw new SyntaxError(`Array item or end of array ']' expected ${Y()}`)}function z(O){throw new SyntaxError(`Invalid character '${O}' ${H()}`)}function M(O){const I=t.slice(O,O+2);throw new SyntaxError(`Invalid escape character '${I}' ${H()}`)}function S(){throw new SyntaxError(`Object value expected after ':' ${H()}`)}function j(O){const I=t.slice(O,O+6);throw new SyntaxError(`Invalid unicode character '${I}' ${H()}`)}function H(){return`at position ${i}`}function Re(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function Y(){return`${Re()} ${H()}`}}function Fo(t){return t===Wo||t===Jo||t===Ko||t===Xo}function at(t){return t>=Ft&&t<=Vt||t>=ta&&t<=ia||t>=ra&&t<=oa}function lt(t){return t>=Ft&&t<=Vt}function Vo(t){return t>=Go&&t<=Vt}function qo(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((r,s)=>Lt(r,e[s])):fs(t)&&fs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(r=>Lt(t[r],e[r])):!1}function fs(t){return typeof t=="object"&&t!==null}const $o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
11
- `,r:"\r",t:" "},Bo=92,zo=123,ps=125,Ho=91,ms=93,Wo=32,Jo=10,Ko=9,Xo=13,Mt=34,Zo=43,gs=45,Ft=48,Go=49,Vt=57,Qo=44,Yo=46,ea=58,ta=65,ra=97,sa=69,na=101,ia=70,oa=102;function bs(t,e,r,s){return n(t);function n(l,d){if(Array.isArray(s)){const u=s.find(h=>h.test(l));if(u){const h=u.stringify(l);if(typeof h!="string"||!us(h))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${h})`);return h}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l?.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return o(l);if(l&&typeof l=="object")return i(l)}function o(l,d){if(l.length===0)return"[]";let u="[";for(let h=0;h<l.length;h++){const g=l[h];typeof g<"u"&&typeof g!="function"?u+=n(g):u+="null",h<l.length-1&&(u+=",")}return u+="]",u}function i(l,d){if(typeof l.toJSON=="function")return bs(l.toJSON(),e,r,void 0);const u=Array.isArray(e)?e.map(String):Object.keys(l);if(u.length===0)return"{}";let h=!0,g="{";for(const _ of u){const R=l[_];if(a(_,R)){h?h=!1:g+=",";const A=JSON.stringify(_);g+=`${A}:`,g+=n(R)}}return g+="}",g}function a(l,d){return typeof d<"u"&&typeof d!="function"&&typeof d!="symbol"}}function aa(t){return $e(t)&&!ds(t)?BigInt(t):Number.parseFloat(t)}class la{id=1;constructor(){}async exec(e,r,s={},n={},o=6e4){await Dt(),this.id=this.id+1;try{return s.scope=window.openc3Scope,n.manual=!0,(await Nt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:r,id:this.id,keyword_params:s},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...n},timeout:o,transformRequest:[(i,a)=>bs(i)],transformResponse:[i=>{try{return Mo(i,void 0,aa)}catch{const a=typeof i=="string"?i.substring(0,200):String(i),l=new Error(`Server returned non-JSON response: ${a}`);throw l.name="ServerError",l}}]})).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,r,s,n,o){return this.exec("map_target_to_interface",[e,r],{cmd_only:s,tlm_only:n,unmap_old:o})}unmap_target_from_interface(e,r,s,n){return this.exec("unmap_target_from_interface",[e,r],{cmd_only:s,tlm_only:n})}connect_interface(e,...r){return r.length>0?this.exec("connect_interface",[e,...r]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,r,...s){return this.exec("interface_cmd",[e,r,...s])}interface_target_enable(e,r,s=!1,n=!1){return this.exec("interface_target_enable",[e,r],{cmd_only:s,tlm_only:n})}interface_target_disable(e,r,s=!1,n=!1){return this.exec("interface_target_disable",[e,r],{cmd_only:s,tlm_only:n})}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,r,s,n,o){return this.exec("map_target_to_router",[e,r],{cmd_only:s,tlm_only:n,unmap_old:o})}unmap_target_from_router(e,r,s,n){return this.exec("unmap_target_from_router",[e,r],{cmd_only:s,tlm_only:n})}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}router_target_enable(e,r,s=!1,n=!1){return this.exec("router_target_enable",[e,r],{cmd_only:s,tlm_only:n})}router_target_disable(e,r,s=!1,n=!1){return this.exec("router_target_disable",[e,r],{cmd_only:s,tlm_only:n})}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,r,s){return this.exec("get_item",[e,r,s])}get_param(e,r,s){return this.exec("get_param",[e,r,s])}get_parameter(e,r,s){return this.get_param(e,r,s)}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])}delete_limits_set(e){return this.exec("delete_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.get_target_names()}get_tlm(e,r){return this.exec("get_tlm",[e,r])}get_telemetry(e,r){return this.get_tlm(e,r)}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.get_all_tlm(e)}get_all_tlm_names(e,r=!1){return this.exec("get_all_tlm_names",[e],{hidden:r})}get_all_telemetry_names(e){return this.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,r,s,n=30){const o=await this.exec("get_tlm_packet",[e,r],{type:s,stale_time:n});if(o!=null){let i=o.length,a=null;for(let l=0;l<i;l++)a=this.decode_openc3_type(o[l][1]),a!==null&&(o[l][1]=a)}return o}get_packet_derived_items(e,r){return this.exec("get_packet_derived_items",[e,r])}get_tlm_buffer(e,r){return this.exec("get_tlm_buffer",[e,r])}get_tlm_available(e,r={},s={}){return this.exec("get_tlm_available",[e],r,s)}async get_tlm_values(e,r=30,s=null,n=null,o=null,i={}){let a={stale_time:r};s!==null&&(a.cache_timeout=s),n!==null&&(a.start_time=n.toISOString()),o!==null&&(a.end_time=o.toISOString());const l=await this.exec("get_tlm_values",[e],a,i,1e4);if(l&&l.length>0){let d=l.length,u=null;for(let h=0;h<d;h++)u=this.decode_openc3_type(l[h][0]),u!==null&&(l[h][0]=u)}return l}get_limits(e,r,s){return this.exec("get_limits",[e,r,s])}async tlm(e,r,s,n="CONVERTED"){let o=null;if(r===void 0)o=await this.exec("tlm",[e]);else if(s===void 0)if(["RAW","CONVERTED","FORMATTED"].includes(r))o=await this.exec("tlm",[e],{type:r});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${r}. Valid options are RAW, CONVERTED or FORMATTED.`,a}else o=await this.exec("tlm",[e,r,s],{type:n});let i=this.decode_openc3_type(o);return i!==null&&(o=i),o}async inject_tlm(e,r,s=null,n="CONVERTED",o=!1){await this.exec("inject_tlm",[e,r,s],{type:n,stored:o})}set_tlm(e,r,s,n){return this.exec("set_tlm",[e,r,s],{type:n})}override_tlm(e,r,s,n){return this.exec("override_tlm",[e,r,s],{type:n})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,r,s,n){return this.exec("normalize_tlm",[e,r,s],{type:n})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.get_all_cmds(e)}get_all_cmd_names(e,r=!1){return this.exec("get_all_cmd_names",[e],{hidden:r})}get_all_command_names(e){return this.get_all_cmd_names(e)}get_cmd(e,r){return this.exec("get_cmd",[e,r])}get_command(e,r){return this.get_cmd(e,r)}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,r,s,n="CONVERTED"){return this.exec("get_cmd_value",[e,r,s,n])}get_cmd_buffer(e,r){return this.exec("get_cmd_buffer",[e,r])}_cmd(e,r,s,n,o,i={}){let a=null;for(let l in n)Object.prototype.hasOwnProperty.call(n,l)&&(a=this.encode_openc3_type(n[l]),a!==null&&(n[l]=a));return this.exec(e,[r,s,n],i,o)}get_cmd_hazardous(e,r,s,n={}){return r===void 0?this.exec("get_cmd_hazardous",e,{},n):this._cmd("get_cmd_hazardous",e,r,s,n)}cmd(e,r,s,n={},o={}){return r===void 0?this.exec("cmd",e,o,n):this._cmd("cmd",e,r,s,n,o)}cmd_no_range_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_range_check",e,o,n):this._cmd("cmd_no_range_check",e,r,s,n,o)}cmd_raw(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw",e,o,n):this._cmd("cmd_raw",e,r,s,n,o)}cmd_raw_no_range_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_range_check",e,o,n):this._cmd("cmd_raw_no_range_check",e,r,s,n,o)}cmd_no_hazardous_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_hazardous_check",e,o,n):this._cmd("cmd_no_hazardous_check",e,r,s,n,o)}cmd_no_checks(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_checks",e,o,n):this._cmd("cmd_no_checks",e,r,s,n,o)}cmd_raw_no_hazardous_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_hazardous_check",e,o,n):this._cmd("cmd_raw_no_hazardous_check",e,r,s,n,o)}cmd_raw_no_checks(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_checks",e,o,n):this._cmd("cmd_raw_no_checks",e,r,s,n,o)}build_cmd(e,r,s,n={},o={}){return r===void 0?this.exec("build_cmd",e,o,n):this._cmd("build_cmd",e,r,s,n,o)}build_command(e,r,s,n={},o={}){return this.build_cmd(e,r,s,n,o)}get_interface_names(){return this.exec("get_interface_names",[])}get_router_names(){return this.exec("get_router_names",[])}send_raw(e,r){return this.exec("send_raw",[e,r])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,r){return this.exec("load_config",[e,r])}save_config(e,r,s){return this.exec("save_config",[e,r,s])}delete_config(e,r){return this.exec("delete_config",[e,r])}enable_limits(e,r,s){return this.exec("enable_limits",[e,r,s])}disable_limits(e,r,s){return this.exec("disable_limits",[e,r,s])}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,r){return this.exec("get_setting",[e],r)}get_settings(e,r){return this.exec("get_settings",e,r)}set_setting(e,r){return this.exec("set_setting",[e,r])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}save_setting(e,r){return this.set_setting(e,r)}get_metrics(){return this.exec("get_metrics",[])}open_tab(e){window.open(e,"_blank")}async hashString(e){if(window.isSecureContext){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",r),n=new Uint8Array(s);return Array.from(n).map(o=>o.toString(16).padStart(2,"0")).join("")}}}let ct=[];const ca={components:{OpenC3TimePicker:Gt,OpenConfigDialog:Wt,SaveConfigDialog:Ht,TargetPacketItemChooser:Zt,TopBar:As},mixins:[ks,zt],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,allowWildcards:!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 Ro,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}},{label:"Allow Wildcards",checkbox:!0,checked:this.allowWildcards,command:()=>{this.allowWildcards=!this.allowWildcards}},{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,allowWildcards:this.allowWildcards,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)},allowWildcards: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 la,await this.api.get_setting("time_zone").then(e=>{e&&(this.timeZone=e)}).catch(e=>{}),await Hi.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.allowWildcards=!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.allowWildcards=t.allowWildcards,this.menus[1].items[3].checked=this.allowWildcards||!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,r=>{this.applyConfig(r),this.startDate=r.startDate,this.startTime=r.startTime,this.endTime=r.endTime,this.endDate=r.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
10
+ `+o)}}catch{}throw r}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=me(this.defaults,e);const{transitional:r,paramsSerializer:s,headers:n}=e;r!==void 0&&rt.assertOptions(r,{silentJSONParsing:B.transitional(B.boolean),forcedJSONParsing:B.transitional(B.boolean),clarifyTimeoutError:B.transitional(B.boolean),legacyInterceptorReqResOrdering:B.transitional(B.boolean),advertiseZstdAcceptEncoding:B.transitional(B.boolean),validateStatusUndefinedResolves:B.transitional(B.boolean)},!1),s!=null&&(c.isFunction(s)?e.paramsSerializer={serialize:s}:rt.assertOptions(s,{encode:B.function,serialize:B.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),rt.assertOptions(e,{baseUrl:B.spelling("baseURL"),withXsrfToken:B.spelling("withXSRFToken")},!0),e.method=(c.getSafeProp(e,"method")||c.getSafeProp(this.defaults,"method")||"get").toLowerCase();let o=n&&c.merge(n.common,n[e.method]);n&&c.forEach(Tr.concat("common"),_=>{delete n[_]}),e.headers=$.concat(o,n);const i=[];let a=!0;this.interceptors.request.forEach(function(_){if(typeof _.runWhen=="function"&&_.runWhen(e)===!1)return;a=a&&_.synchronous;const R=e.transitional||St;R&&R.legacyInterceptorReqResOrdering?i.unshift(_.fulfilled,_.rejected):i.push(_.fulfilled,_.rejected)});const l=[];this.interceptors.response.forEach(function(_){l.push(_.fulfilled,_.rejected)});let d,u=0,h;if(!a){const _=[kt.bind(this),void 0];for(_.unshift(...i),_.push(...l),h=_.length,d=Promise.resolve(e);u<h;)d=d.then(_[u++],_[u++]);return d}h=i.length;let g=e;for(;u<h;){const _=i[u++],R=i[u++];try{g=_?_(g):g}catch(A){if(!R){d=Promise.reject(A);break}try{const m=R.call(this,A);c.isThenable(m)&&(d=Promise.resolve(m).then(()=>kt.call(this,g)))}catch(m){d=Promise.reject(m)}break}}if(!d)try{d=kt.call(this,g)}catch(_){d=Promise.reject(_)}for(u=0,h=l.length;u<h;)d=d.then(l[u++],l[u++]);return d}getUri(t){t=me(this.defaults,t);const e=Dr(t.baseURL,t.url,t.allowAbsoluteUrls,t);return _r(e,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){ge.prototype[t]=function(e,r){return this.request(me(r||{},{method:t,url:e,data:r&&c.hasOwnProp(r,"data")?r.data:void 0}))}}),c.forEach(["post","put","patch","query"],function(t){function e(r){return function(s,n,o){return this.request(me(o||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:n}))}}ge.prototype[t]=e(),t!=="query"&&(ge.prototype[t+"Form"]=e(!0))});let Vi=class Ss{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});const s=this;this.promise.then(n=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](n);s._listeners=null}),this.promise.then=n=>{let o;const i=new Promise(a=>{s.subscribe(a),o=a}).then(n);return i.cancel=function(){s.unsubscribe(o)},i},e(function(n,o,i){s.reason||(s.reason=new Me(n,o,i),r(s.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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Ss(function(r){e=r}),cancel:e}}};function qi(t){return function(e){return t.apply(null,e)}}function $i(t){return c.isObject(t)&&t.isAxiosError===!0}const st={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(st).forEach(([t,e])=>{st[e]===void 0&&(st[e]=t)});function Wr(t){const e=new ge(t),r=Qt(ge.prototype.request,e);return c.extend(r,ge.prototype,e,{allOwnKeys:!0}),c.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return Wr(me(t,s))},r}const U=Wr(Le);U.Axios=ge,U.CanceledError=Me,U.CancelToken=Vi,U.isCancel=Cr,U.VERSION=xt,U.toFormData=Qe,U.AxiosError=y,U.Cancel=U.CanceledError,U.all=function(t){return Promise.all(t)},U.spread=qi,U.isAxiosError=$i,U.mergeConfig=me,U.AxiosHeaders=$,U.formToJSON=t=>Or(c.isHTMLForm(t)?new FormData(t):t),U.getAdapter=zr.getAdapter,U.HttpStatusCode=st,U.default=U;const{Axios:pa,AxiosError:ma,CanceledError:ga,isCancel:ba,CancelToken:_a,VERSION:ya,all:wa,Cancel:va,isAxiosError:Ea,spread:Sa,toFormData:Oa,AxiosHeaders:Ta,HttpStatusCode:Ca,formToJSON:Ra,getAdapter:xa,mergeConfig:Aa,create:Pa}=U;function Fe(t){return t?.name==="AuthRequiredError"}const Bi=new Set(["OpenC3::AuthError","OpenC3::ForbiddenError"]);function zi(t){return t?.response?.status===401||t?.status===401||Bi.has(t?.name)}function Jr(t){!Fe(t)&&!zi(t)&&console.error(t)}class Kr extends Error{constructor(e="Authentication required"){super(e),this.name="AuthRequiredError"}}globalThis.__openc3AuthRejectionHandler||(globalThis.__openc3AuthRejectionHandler=!0,globalThis.addEventListener?.("unhandledrejection",t=>{Fe(t.reason)&&t.preventDefault()}));let Zr=!1;function Xr(){Zr||(Zr=!0,OpenC3Auth.login())}async function Dt(){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch(t){throw Fe(t)?t:(Xr(),new Kr(t?.message))}if(!localStorage.openc3Token)throw Xr(),new Kr}const Nt=U.create({baseURL:location.origin,timeout:6e4,params:{}});Nt.interceptors.response.use(t=>t,t=>{if(t.response){if(t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);if(t.response.status===401)return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(n){n&&OpenC3Auth.setTokens()}).catch(Jr),Promise.reject(t);const e=t.response?.data?.error?.data?.class;if(e==="HazardousError"||e==="CriticalCmdError")return Promise.reject(t);let r=`HTTP ${t.response.status} - `;t.response?.statusText&&(r+=`${t.response.statusText} `),t.response?.config?.data&&(r+=`${t.response.config.data} `),t.response?.data?.message?r+=`${t.response.data.message}`:t.response?.data?.exception?r+=`${t.response.data.exception}`:t.response?.data?.error?.message?(t.response.data.error.class&&(r+=`${t.response.data.error.class} `),r+=`${t.response.data.error.message}`):r+=`${t.response?.data}`;const{$cosmosNotify:s}=window;throw s&&s.serious({title:"Network error",body:r}),t}else throw t});const nt=async function(t,e,{data:r,params:s={},headers:n,noAuth:o=!1,optionalAuth:i=!1,noScope:a=!1,onUploadProgress:l=!1,responseType:d}={}){if(!o)if(i){try{await Dt()}catch(u){if(!Fe(u))throw u}localStorage.openc3Token&&(n.Authorization=localStorage.openc3Token)}else await Dt(),n.Authorization=localStorage.openc3Token;return n.manual=!0,!a&&!s.scope&&(s.scope=window.openc3Scope),Nt({method:t,url:e,data:r,params:s,headers:n,onUploadProgress:l,responseType:d})},jt={Accept:"application/json"},Gr={...jt,"Content-Type":"application/json"},Hi={get:function(t,{params:e,headers:r=jt,noScope:s,noAuth:n,optionalAuth:o,onUploadProgress:i,responseType:a}={}){return nt("get",t,{params:e,headers:r,noScope:s,noAuth:n,optionalAuth:o,onUploadProgress:i,responseType:a})},put:function(t,{data:e,params:r,headers:s=Gr,noScope:n,noAuth:o,onUploadProgress:i}={}){return nt("put",t,{data:e,params:r,headers:s,noScope:n,noAuth:o,onUploadProgress:i})},post:function(t,{data:e,params:r,headers:s=Gr,noScope:n,noAuth:o,onUploadProgress:i,responseType:a}={}){return nt("post",t,{data:e,params:r,headers:s,noScope:n,noAuth:o,onUploadProgress:i,responseType:a})},delete:function(t,{params:e,headers:r=jt,noScope:s,noAuth:n,onUploadProgress:o}={}){return nt("delete",t,{params:e,headers:r,noScope:s,noAuth:n,onUploadProgress:o})}};let it=()=>({emit(t,...e){for(let r=this.events[t]||[],s=0,n=r.length;s<n;s++)r[s](...e)},events:{},on(t,e){return(this.events[t]||=[]).push(e),()=>{this.events[t]=this.events[t]?.filter(r=>e!==r)}}});class Ve extends Error{constructor(e,r){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=r,this.name="ReasonError"}}class It extends Ve{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class Wi extends Ve{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class te extends Ve{constructor(e,r){r?super(e,r):super("Disconnected",e),this.name="DisconnectedError"}}class Ji extends te{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Qr(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let r=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${r}`}).join(",")}}`:""}class Ki{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,r){if(!this._info)return this._info={id:String(e),info:r},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((r,{id:s,info:n})=>(r[s]=n,r),{})}}const be=Symbol("state");class Yr{constructor(e={}){this.emitter=it(),this.params=Object.freeze(e),this.presence=new Ki(this),this.initialConnect=!0,this[be]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Qr({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[be]}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[be]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[be]="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[be]="connected";let e=!0,r=!0;this.initialConnect=!1,this.emit("connect",{reconnect:r,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[be]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[be]="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,r){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,r)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(r){let s=this.receiver?this.receiver.logger:null;s&&s.warn("whisper failed: ",r)}}receive(e,r){this.emit("message",e,r)}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}emit(e,...r){return this.emitter.emit(e,...r)}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,r)=>{let s=[()=>delete this._pendingSubscribe];s.push(this.on("connect",()=>{s.forEach(n=>n()),e()})),s.push(this.on("close",n=>{s.forEach(o=>o()),r(n||new Ve("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class Zi{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 r=this.channels.indexOf(e);r>-1&&this.channels.splice(r,1)}notify(e,...r){this.state=e==="restored"?"connected":e,r.length===1?this.channels.forEach(s=>s[e](r[0])):this.channels.forEach(s=>s[e]())}pending(e){this._checkIntent(e);let r=this._pendings[0];return!r||r.intent!==e?Promise.resolve():r.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 r,s={promise:new Promise(o=>{r=o}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(s),1),r(s)},canceled:!1,acquired:!1},n=this._pendingTop;return this._pendings.push(s),n&&await n.promise,this.gvl&&await this.gvl.acquire(s,e),s.acquired=!0,s}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 r=this._pendingTop;return!r||r.acquired||r.intent!==e?!1:(this._pendings.pop(),r.canceled=!0,!0)}}class Xi{constructor(){this.queue=[]}async acquire(e,r){r==="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 Gi{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new Xi),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:r,unsubscribe:s}){let n=this._subscriptions[e]=new Zi(e);return n.remoteId=this._localToRemote[e],n.subscriber=r,n.unsubscriber=s,n.gvl=this.glv,n}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,r){this._localToRemote[e]=r;let s=this.get(e);s&&(s.remoteId=r)}}class Qi{constructor(e={}){this.subscriptions=new Gi(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,r){this._remoteToLocal[r]=e,this.subscriptions.storeRemoteId(e,r),this.flush(r)}unsubscribe(e){let r=this.subscriptions.get(e);if(!r)return;let s=r.remoteId;s&&delete this._remoteToLocal[s],this.subscriptions.remove(e)}transmit(e,r,s){let n=this._remoteToLocal[e];if(!n){this._pendingMessages.push([e,r,s]);return}let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>{i.receive(r,s)})}notify(e,r,s){let n=this._remoteToLocal[e];if(!n)return;let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>i.emit(r,s))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let r=[];for(let s of this._pendingMessages)s[0]===e?this.transmit(s[0],s[1],s[2]):r.push(s);this._pendingMessages=r}}const es={debug:0,info:1,warn:2,error:3};class ts{constructor(e){this.level=e||"warn"}log(e,r,s){es[e]<es[this.level]||this.writeLogEntry(e,r,s)}writeLogEntry(){throw Error("Not implemented")}debug(e,r){this.log("debug",e,r)}info(e,r){this.log("info",e,r)}warn(e,r){this.log("warn",e,r)}error(e,r){this.log("error",e,r)}}class qe extends ts{writeLogEntry(){}}class Yi{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let eo=0;class rs{constructor(e={}){let{logger:r}=e;this.logger=r||new qe,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,r){let s={channel:e};r&&Object.assign(s,r);let n=Qr(s);if(this.pendingUnsubscriptions[n]){let i=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${i}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,r))},i)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let o=this.subscribeRetryInterval;return new Promise((i,a)=>{let l=++eo;this.pendingSubscriptions[n]={resolve:i,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,n,o)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(this.logger.warn(`no subscription ack received in ${s}ms, retrying subscribe`,r),this.cable.send(this.buildSubscribeRequest(r)),this.maybeExpireSubscribe(e,r,s))},s)}maybeExpireSubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(delete this.pendingSubscriptions[r],n.reject(new Wi(`Haven't received subscription ack in ${s*2}ms for ${r}`)))},s)}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,r,s){return r==="$whisper"?this.whisper(e,s):(s||(s={}),s.action||=r,this.cable.send({command:"message",identifier:e,data:JSON.stringify(s)}),Promise.resolve())}whisper(e,r){return this.cable.send({command:"whisper",identifier:e,data:r}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n,reason:o,reconnect:i}=e;if(r==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(r==="disconnect"){let a=new te(o);this.reset(a),i===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(r==="confirm_subscription"){let a=this.pendingSubscriptions[s];if(!a){this.logger.error("subscription not found, unsubscribing",{type:r,identifier:s}),this.unsubscribe(s);return}return delete this.pendingSubscriptions[s],a.resolve(s)}if(r==="reject_subscription"){let a=this.pendingSubscriptions[s];return a?(delete this.pendingSubscriptions[s],a.reject(new It)):this.logger.error("subscription not found",{type:r,identifier:s})}if(n)return{identifier:s,message:n};this.logger.warn(`unknown message type: ${r}`,{message:e})}reset(e){for(let r in this.pendingSubscriptions)this.pendingSubscriptions[r].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const ss=()=>Date.now()/1e3|0;class to extends rs{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=ss()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let r in this.pendingPresence)this.pendingPresence[r].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n}=e;if(r==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(r==="reject_subscription")return super.receive(e);if(r==="confirm_subscription")return this.subscriptionStreams[s]||(this.subscriptionStreams[s]=new Set),super.receive(e);if(r==="ping")return this.restoreSince&&(this.restoreSince=ss()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",s);return}if(r==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",s);return}if(r==="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(r==="presence"){let o=n.type;if(o==="info"){let i=this.pendingPresence[s];i&&(delete this.pendingPresence[s],i.resolve(n))}else if(o==="error"){let i=this.pendingPresence[s];i&&(delete this.pendingPresence[s],i.reject(new Error("failed to retrieve presence")))}return{type:r,identifier:s,message:n}}if(n){let o=this.trackStreamPosition(s,e.stream_id,e.epoch,e.offset);return{identifier:s,message:n,meta:o}}this.logger.warn(`unknown message type: ${r}`,{message:e})}perform(e,r,s){switch(r){case"$presence:join":return this.join(e,s);case"$presence:leave":return this.leave(e,s);case"$presence:info":return this.presence(e,s)}return super.perform(e,r,s)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let r=super.buildSubscribeRequest(e),s=this.historyRequestFor(e);s&&(r.history=s,this.pendingHistory[e]=!0);let n=this.presenceInfo[e];return n&&(r.presence=n),r}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let r={},s=!1;if(this.subscriptionStreams[e])for(let n of this.subscriptionStreams[e]){let o=this.streamsPositions[n];o&&(s=!0,r[n]=o)}if(!(!s&&!this.restoreSince))return{since:this.restoreSince,streams:r}}trackStreamPosition(e,r,s,n){if(!(!r||!s))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(r),this.streamsPositions[r]={epoch:s,offset:n},{stream:r,epoch:s,offset:n}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,r){return this.presenceInfo[e]=r,this.cable.send({command:"join",identifier:e,presence:r}),Promise.resolve()}async leave(e,r){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:r}),Promise.resolve()}presence(e,r){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((s,n)=>{this.pendingPresence[e]={resolve:s,reject:n},this.cable.send({command:"presence",identifier:e,data:r})})}}class ro extends Ve{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class ns extends Yr{static identifier="__ghost__";constructor(e,r){super(r),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}const so="$pubsub";class is extends Yr{static identifier=so;async perform(e,r){if(e.startsWith("$"))return super.perform(e,r);throw Error("not implemented")}}const _e=Symbol("state");let no=class{constructor({transport:t,protocol:e,encoder:r,logger:s,lazy:n,hubOptions:o,performFailures:i,transportConfigurator:a}){this.emitter=it(),this.transport=t,this.encoder=r,this.logger=s||new qe,this.protocol=e,this.performFailures=i||"throw",this.protocol.attached(this),this.hub=new Qi(o||{}),this[_e]="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,n===!1&&this.connect().catch(()=>{})}get state(){return this[_e]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[_e]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(r){this.handleClose(r)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[_e]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new te("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[_e]="connected",this.hub.subscriptions.all().forEach(s=>{t&&s.remoteId&&t.includes(s.remoteId)?s.notify("restored"):(s.notify("disconnected",new te("recovery_failed")),this._resubscribe(s))});let e=!this.initialConnect,r=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:r})}notify(t,e,r){e&&typeof e!="string"&&(r=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:r}):this.emit("info",{type:t,data:r})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new te(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[_e]="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 te?t:new te(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[_e]="closed";let r=e||new te("cable_closed");this.hub.subscriptions.all().forEach(s=>s.notify("disconnected",r)),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 r=this.protocol.receive(e);if(r){this.logger.debug("processed incoming message",r);let{type:s,identifier:n,message:o,meta:i}=r;s?this.hub.notify(n,s,o):this.hub.transmit(n,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 is({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new is({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let r,s;return typeof t=="string"&&(s=t,t=ns),r=s?new t(s,e):new t(e),this.subscribe(r)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let r=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:s=>this._subscribe(s,t.channelId,t.params),unsubscribe:s=>this._unsubscribe(s)});return r.add(t),r.intent==="subscribed"&&r.state==="connected"&&t.connected(),r.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,r){let s=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s});return}this.logger.debug("acquiring subscribe lock",{identifier:s});let n=await t.acquire("subscribed");if(n.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:s}),n.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:s}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),n.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s}),n.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:s}),t.notify("connected"),n.release();return}let o={identifier:e,params:r};this.logger.debug("subscribing",o);try{let i=await this.protocol.subscribe(e,r);this.hub.subscribe(s,i),this.logger.debug("subscribed",{...o,remoteId:i}),t.notify("connected")}catch(i){if(i){if(i instanceof It&&this.logger.warn("rejected",o),i instanceof te){this.logger.debug("disconnected during subscription; will retry on connect",o),n.release();return}this.logger.error("failed to subscribe",{error:i,...o})}t.close(i),this.hub.unsubscribe(s)}n.release()}unsubscribe(t){let e=t.identifier,r=this.hub.subscriptions.get(e);if(!r)throw Error(`Subscription not found: ${e}`);r.remove(t),t.closed(),r.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let r=await t.acquire("unsubscribed");if(r.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),r.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}),r.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),r.release();return}let s=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:s}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),r.release();return}try{await this.protocol.unsubscribe(s),this.logger.debug("unsubscribed remotely",{id:e})}catch(n){n&&(n instanceof te?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:n}):this.logger.error("unsubscribe failed",{id:e,error:n}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",r.release()}async perform(t,e,r){if(this.performFailures==="throw")return this._perform(t,e,r);try{return await this._perform(t,e,r)}catch(s){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:s});return}}async _perform(t,e,r){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new ro;let s=this.hub.subscriptions.get(t);if(!s)throw Error(`Subscription not found: ${t}`);if(await s.pending("subscribed"),s.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let n=s.remoteId,o={id:n,action:e,payload:r};this.logger.debug("perform",o);try{let i=await this.protocol.perform(n,e,r);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 r=this.emitter.on(t,(...s)=>{r(),e(...s)});return r}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let r=[()=>delete this._pendingConnect];r.push(this.on("connect",()=>{r.forEach(s=>s()),t()})),r.push(this.on("close",s=>{r.forEach(n=>n()),e(s)})),r.push(this.on("disconnect",s=>{r.forEach(n=>n()),e(s)}))}),this._pendingConnect)}};const io={maxMissingPings:2,maxReconnectAttempts:1/0},Ce=()=>Date.now(),os=(t,e)=>{e=e||{};let{backoffRate:r,jitterRatio:s,maxInterval:n}=e;return r=r||2,s===void 0&&(s=.5),o=>{let i=t*r**o,a=i*r,l=i+(a-i)*Math.random(),d=2*(Math.random()-.5)*s;return l=l*(1+d),n&&n<l&&(l=n),l}};let as=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},io,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 qe,this.state="pending_connect",this.attempts=0,this.disconnectedAt=Ce()}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=Ce(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=Ce(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=Ce(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=Ce()})),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=Ce()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new Ji))}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 oo{constructor(e,r={}){this.transports=e,this.transport=null,this.emitter=it(),this.unbind=[],this.logger=r.logger||new qe}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let r=this.transports[e];try{this.transport=r,this.resetListeners(),this.logger.debug(`Trying to connect via ${r.displayName()}`),await r.open(),this.logger.debug(`Connected via ${r.displayName()}`);return}catch(s){this.logger.debug(`Failed to connect via ${r.displayName()}: ${s.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,r){this.transports.forEach(s=>{s.setParam(e,r)})}setToken(e,r){this.transports.forEach(s=>{s.setToken(e,r)})}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 ao{constructor(e,r={}){this.url=e;let s=r.websocketImplementation;if(s)this.Impl=s;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=it();let{format:n,subprotocol:o,authStrategy:i}=r;this.format=n||"text",this.connectionOptions=r.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((r,s)=>{let n=[];n.push(this.once("open",()=>{n.forEach(o=>o()),r()})),n.push(this.once("close",()=>{n.forEach(o=>o()),s(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,r){let s=new URL(this.url);s.searchParams.set(e,r);let n=`${s.protocol}//${s.host}${s.pathname}?${s.searchParams}`;this.setURL(n)}setToken(e,r="jid"){if(this.authStrategy==="param")this.setParam(r,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let s=`x-${r}`.toLowerCase();s=Object.keys(this.connectionOptions.headers).find(n=>n.toLowerCase()===s)||s,this.connectionOptions.headers[s]=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,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 r=e.data;this.format==="binary"&&(r=new Uint8Array(r)),this.emitter.emit("data",r)},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 lo{constructor(e){this.channel=e}notify(e,...r){typeof this[e]=="function"&&this[e](...r)}perform(e,r={}){this.channel.perform(e,r)}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 co extends ns{constructor(e,r,s){super(e,r),this.subscription=new lo(this),Object.assign(this.subscription,s),this.on("connect",({reconnect:n})=>this.subscription.notify("connected",{reconnected:n})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",n=>this.subscription.notify("received",n)),this.on("close",n=>{n&&n instanceof It?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class uo{constructor(e){this.cable=e}create(e,r){let s,n;typeof e=="object"?(s=e.channel,delete e.channel,n=e):(s=e,n={});let o=new co(s,n,r);return o.subscription.notify("initialized"),this.cable.subscribe(o),o.subscription}findAll(e){return this.cable.hub.channels.filter(r=>r.identifier===e).map(r=>r.subscription)}}class ho{constructor(e){this.cable=e,this.subscriptions=new uo(e)}send(e){return this.cable.send(e)}connect(){return this.cable.connect()}disconnect(){return this.cable.disconnect()}ensureActiveConnection(){return this.cable.connect()}}const ls={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function fo(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({},ls,e);let{protocol:r,websocketImplementation:s,websocketFormat:n,websocketOptions:o,websocketAuthStrategy:i,fallbacks:a,logLevel:l,logger:d,transport:u,encoder:h,lazy:g,monitor:_,pingInterval:R,reconnectStrategy:A,maxMissingPings:m,maxReconnectAttempts:w,subprotocol:b,tokenRefresher:E,historyTimestamp:f,protocolOptions:k,concurrentSubscribes:T,performFailures:L,transportConfigurator:X,auth:Z}=e;if(d=d||new qe(l),typeof r=="string"){b=b||r;let S=r.substring(0,r.lastIndexOf("-")),j=r.substring(r.lastIndexOf("-")+1);if(k=k||{},S==="actioncable-v1")r=new rs({logger:d,...k});else if(S==="actioncable-v1-ext")r=new to({logger:d,historyTimestamp:f,...k});else throw Error(`Protocol is not supported yet: ${r}`);if(j==="json")h=h||new Yi,n=n||"text";else if(j==="msgpack"){if(n="binary",!h)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(j==="protobuf"){if(n=n||"binary",!h)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: ${r}`)}if(!r)throw Error("Protocol must be specified");u=u||new ao(t,{websocketImplementation:s,websocketOptions:o,subprotocol:b,authStrategy:i,format:n}),a&&(u=new oo([u,...a],{logger:d})),Z&&Z.token&&u.setToken(Z.token,Z.param||"jid"),A=A||os(R),_!==!1&&(_=_||new as({pingInterval:R,reconnectStrategy:A,maxMissingPings:m,maxReconnectAttempts:w,logger:d}));let z={concurrentSubscribes:T},M=new no({protocol:r,transport:u,encoder:h,logger:d,lazy:g,hubOptions:z,performFailures:L,transportConfigurator:X});return _&&(_.watch(M),M.monitor=_),E&&po(M,async()=>{try{await E(u)}catch(S){return d.error("Failed to refresh authentication token: "+S),!1}return M.connect().catch(()=>{}),!0}),M}function po(t,e){let r=!1;t.on("connect",()=>r=!1),t.on("close",async s=>{if(s){if(r){t.logger.warn("Token auto-refresh is disabled",s);return}s.reason==="token_expired"&&(r=!0,await e())}})}class mo extends ts{writeLogEntry(e,r,s){s?console[e](r,s):console[e](r)}}class go extends as{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")},r=n=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:n})},s=()=>this.disconnect(new te("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",r,!1),window.addEventListener("resume",r,!1),window.addEventListener("freeze",s,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",r,!1),window.removeEventListener("online",r,!1),window.removeEventListener("resume",r,!1),window.removeEventListener("freeze",s,!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 bo=["cable","action-cable"],_o="/cable",ot=(t,e)=>{for(let r of bo){let s=t.head.querySelector(`meta[name='${r}-${e}']`);if(s)return s.getAttribute("content")}},cs=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,yo=()=>{if(typeof document<"u"&&document.head){let t=ot(document,"url");if(t)return cs(t)}return cs(_o)},wo=()=>{if(typeof document<"u"&&document.head){let t=ot(document,"history-timestamp");if(t)return t|0}},vo=()=>{if(typeof document<"u"&&document.head)return ot(document,"token")},Eo=()=>{if(typeof document<"u"&&document.head)return ot(document,"token-param")};function So(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||yo(),e=e||{},e.historyTimestamp||=wo();let r=vo();if(r){let d=Eo();e.auth=Object.assign({token:r,param:d},e.auth||{})}e=Object.assign({},ls,e);let{logLevel:s,logger:n,pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new mo(s),i=e.reconnectStrategy=e.reconnectStrategy||os(o),e.monitor!==!1&&(e.monitor=e.monitor||new go({pingInterval:o,reconnectStrategy:i,maxMissingPings:a,maxReconnectAttempts:l,logger:n})),fo(t,e)}function Oo(t,e){let r=So(t,e);return new ho(r)}const To=1e3;class Co{constructor(e,r,s,n,o){this._cable=e,this._channel=r,this._scope=s,this._callbacks=n,this._additionalOptions=o,this._subscription=null,this._unsubscribed=!1}get identifier(){return this._subscription?.identifier}perform(e,r){return this._subscription?.perform(e,r)}send(e){return this._subscription?.send(e)}unsubscribe(){return this._unsubscribed=!0,this._cable._forget(this),this._subscription?.unsubscribe()}_subscribe(e){this._unsubscribed||(this._subscription=e.subscriptions.create({channel:this._channel,token:localStorage.openc3Token,...this._additionalOptions},{...this._callbacks,disconnected:r=>{this._unsubscribed||(r?.allowReconnect===!1&&this._cable._scheduleRecovery(),this._callbacks.disconnected?.(r))}}))}}class Ro{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e,this._subscriptions=new Set,this._recovery=null}disconnect(){this._cancelRecovery(),this._subscriptions.forEach(e=>{e._unsubscribed=!0}),this._subscriptions.clear(),this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,r,s={},n={}){const o=new Co(this,e,r,s,n);return this._subscriptions.add(o),this._resubscribe(o).then(()=>o)}_resubscribe(e){if(this._cable==null){const r=new URL(this._url,document.baseURI);r.searchParams.set("scope",e._scope),this._cable=Oo(r.href)}return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(r=>{r&&OpenC3Auth.setTokens(),this._cable&&e._subscribe(this._cable)}).catch(r=>{if(!Fe(r))throw r})}_scheduleRecovery(){this._recovery||(this._recovery=setTimeout(()=>{const e=[...this._subscriptions];this._cable&&(this._cable.cable.disconnect(),this._cable=null),e.reduce((r,s)=>r.then(()=>this._resubscribe(s)),Promise.resolve()).catch(r=>console.error("failed to recover cable",r)).finally(()=>{this._recovery=null})},To))}_cancelRecovery(){this._recovery&&(clearTimeout(this._recovery),this._recovery=null)}_forget(e){this._subscriptions.delete(e),this._subscriptions.size===0&&this._cancelRecovery()}recordPing(){}}function $e(t){return xo.test(t)}const xo=/^-?[0-9]+$/;function us(t){return Ao.test(t)}const Ao=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ds(t,e){if($e(t))return Number.isSafeInteger(Number.parseInt(t,10));const r=Number.parseFloat(t),s=String(r);if(t===s)return!0;const n=hs(t),o=hs(s);return!!(n===o||e?.approx===!0&&!$e(t)&&o.length>=14&&n.startsWith(o.substring(0,14)))}let Be=(function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t})({});function Po(t){if(ds(t,{approx:!1}))return;if($e(t))return Be.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?Be.underflow:Be.truncate_float:Be.overflow}function hs(t){const{start:e,end:r}=ko(t),s=t.substring(e,r),n=s.indexOf(".");return n===-1?s:s.substring(0,n)+s.substring(n+1)}function ko(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let r=t.lastIndexOf("e");for(r===-1&&(r=t.lastIndexOf("E")),r===-1&&(r=t.length);(t[r-1]==="0"||t[r-1]===".")&&r>e;)r--;return{start:e,end:r}}class Do{isLosslessNumber=!0;constructor(e){if(!us(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Po(this.value);if(e===void 0||e===Be.truncate_float)return Number.parseFloat(this.value);if($e(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 No(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function jo(t){return new Do(t)}function Io(t,e){return Ut({"":t},"",t,e)}function Ut(t,e,r,s){return Array.isArray(r)?s.call(t,e,Lo(r,s)):r&&typeof r=="object"&&!No(r)?s.call(t,e,Uo(r,s)):s.call(t,e,r)}function Uo(t,e){for(const r of Object.keys(t)){const s=Ut(t,r,t[r],e);s!==void 0?t[r]=s:delete t[r]}return t}function Lo(t,e){for(let r=0;r<t.length;r++)t[r]=Ut(t,String(r),t[r],e);return t}function Mo(t,e,r){const s=typeof r=="function"?{parseNumber:r}:r,n=s?.parseNumber??jo,o=s?.onDuplicateKey??L;let i=0;const a=u();return w(a),E(),e?Io(a,e):a;function l(){if(t.charCodeAt(i)===zo){i++,g();const O={};let I=!0;for(;i<t.length&&t.charCodeAt(i)!==ps;){I?I=!1:(A(),g());const re=i,ie=_();if(ie===void 0){T();return}g(),m();const G=u();if(G===void 0){S();return}if(Object.prototype.hasOwnProperty.call(O,ie)&&!Lt(G,O[ie])){const F=o({key:ie,position:re+1,oldValue:O[ie],newValue:G});F!==void 0&&(O[ie]=F)}else O[ie]=G}return t.charCodeAt(i)!==ps&&X(),i++,O}}function d(){if(t.charCodeAt(i)===Ho){i++,g();const O=[];let I=!0;for(;i<t.length&&t.charCodeAt(i)!==ms;){I?I=!1:A();const re=u();b(re),O.push(re)}return t.charCodeAt(i)!==ms&&Z(),i++,O}}function u(){g();const O=_()??R()??l()??d()??h("true",!0)??h("false",!1)??h("null",null);return g(),O}function h(O,I){if(t.slice(i,i+O.length)===O)return i+=O.length,I}function g(){for(;Fo(t.charCodeAt(i));)i++}function _(){if(t.charCodeAt(i)===Mt){i++;let O="";for(;i<t.length&&t.charCodeAt(i)!==Mt;){if(t.charCodeAt(i)===Bo){const I=t[i+1],re=$o[I];re!==void 0?(O+=re,i++):I==="u"?at(t.charCodeAt(i+2))&&at(t.charCodeAt(i+3))&&at(t.charCodeAt(i+4))&&at(t.charCodeAt(i+5))?(O+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):j(i):M(i)}else qo(t.charCodeAt(i))?O+=t[i]:z(t[i]);i++}return k(),i++,O}}function R(){const O=i;if(t.charCodeAt(i)===gs&&(i++,f(O)),t.charCodeAt(i)===Ft)i++;else if(Vo(t.charCodeAt(i)))for(i++;lt(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===Yo)for(i++,f(O);lt(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===na||t.charCodeAt(i)===sa)for(i++,(t.charCodeAt(i)===gs||t.charCodeAt(i)===Xo)&&i++,f(O);lt(t.charCodeAt(i));)i++;if(i>O)return n(t.slice(O,i))}function A(){if(t.charCodeAt(i)!==Qo)throw new SyntaxError(`Comma ',' expected after value ${Y()}`);i++}function m(){if(t.charCodeAt(i)!==ea)throw new SyntaxError(`Colon ':' expected after property name ${Y()}`);i++}function w(O){if(O===void 0)throw new SyntaxError(`JSON value expected ${Y()}`)}function b(O){if(O===void 0)throw new SyntaxError(`Array item expected ${Y()}`)}function E(){if(i<t.length)throw new SyntaxError(`Expected end of input ${Y()}`)}function f(O){if(!lt(t.charCodeAt(i))){const I=t.slice(O,i);throw new SyntaxError(`Invalid number '${I}', expecting a digit ${Y()}`)}}function k(){if(t.charCodeAt(i)!==Mt)throw new SyntaxError(`End of string '"' expected ${Y()}`)}function T(){throw new SyntaxError(`Quoted object key expected ${Y()}`)}function L(O){let{key:I,position:re}=O;throw new SyntaxError(`Duplicate key '${I}' encountered at position ${re}`)}function X(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${Y()}`)}function Z(){throw new SyntaxError(`Array item or end of array ']' expected ${Y()}`)}function z(O){throw new SyntaxError(`Invalid character '${O}' ${H()}`)}function M(O){const I=t.slice(O,O+2);throw new SyntaxError(`Invalid escape character '${I}' ${H()}`)}function S(){throw new SyntaxError(`Object value expected after ':' ${H()}`)}function j(O){const I=t.slice(O,O+6);throw new SyntaxError(`Invalid unicode character '${I}' ${H()}`)}function H(){return`at position ${i}`}function Re(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function Y(){return`${Re()} ${H()}`}}function Fo(t){return t===Wo||t===Jo||t===Ko||t===Zo}function at(t){return t>=Ft&&t<=Vt||t>=ta&&t<=ia||t>=ra&&t<=oa}function lt(t){return t>=Ft&&t<=Vt}function Vo(t){return t>=Go&&t<=Vt}function qo(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((r,s)=>Lt(r,e[s])):fs(t)&&fs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(r=>Lt(t[r],e[r])):!1}function fs(t){return typeof t=="object"&&t!==null}const $o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
11
+ `,r:"\r",t:" "},Bo=92,zo=123,ps=125,Ho=91,ms=93,Wo=32,Jo=10,Ko=9,Zo=13,Mt=34,Xo=43,gs=45,Ft=48,Go=49,Vt=57,Qo=44,Yo=46,ea=58,ta=65,ra=97,sa=69,na=101,ia=70,oa=102;function bs(t,e,r,s){return n(t);function n(l,d){if(Array.isArray(s)){const u=s.find(h=>h.test(l));if(u){const h=u.stringify(l);if(typeof h!="string"||!us(h))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${h})`);return h}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l?.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return o(l);if(l&&typeof l=="object")return i(l)}function o(l,d){if(l.length===0)return"[]";let u="[";for(let h=0;h<l.length;h++){const g=l[h];typeof g<"u"&&typeof g!="function"?u+=n(g):u+="null",h<l.length-1&&(u+=",")}return u+="]",u}function i(l,d){if(typeof l.toJSON=="function")return bs(l.toJSON(),e,r,void 0);const u=Array.isArray(e)?e.map(String):Object.keys(l);if(u.length===0)return"{}";let h=!0,g="{";for(const _ of u){const R=l[_];if(a(_,R)){h?h=!1:g+=",";const A=JSON.stringify(_);g+=`${A}:`,g+=n(R)}}return g+="}",g}function a(l,d){return typeof d<"u"&&typeof d!="function"&&typeof d!="symbol"}}function aa(t){return $e(t)&&!ds(t)?BigInt(t):Number.parseFloat(t)}class la{id=1;constructor(){}async exec(e,r,s={},n={},o=6e4){await Dt(),this.id=this.id+1;try{return s.scope=window.openc3Scope,n.manual=!0,(await Nt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:r,id:this.id,keyword_params:s},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...n},timeout:o,transformRequest:[(i,a)=>bs(i)],transformResponse:[i=>{try{return Mo(i,void 0,aa)}catch{const a=typeof i=="string"?i.substring(0,200):String(i),l=new Error(`Server returned non-JSON response: ${a}`);throw l.name="ServerError",l}}]})).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,r,s,n,o){return this.exec("map_target_to_interface",[e,r],{cmd_only:s,tlm_only:n,unmap_old:o})}unmap_target_from_interface(e,r,s,n){return this.exec("unmap_target_from_interface",[e,r],{cmd_only:s,tlm_only:n})}connect_interface(e,...r){return r.length>0?this.exec("connect_interface",[e,...r]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,r,...s){return this.exec("interface_cmd",[e,r,...s])}interface_target_enable(e,r,s=!1,n=!1){return this.exec("interface_target_enable",[e,r],{cmd_only:s,tlm_only:n})}interface_target_disable(e,r,s=!1,n=!1){return this.exec("interface_target_disable",[e,r],{cmd_only:s,tlm_only:n})}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,r,s,n,o){return this.exec("map_target_to_router",[e,r],{cmd_only:s,tlm_only:n,unmap_old:o})}unmap_target_from_router(e,r,s,n){return this.exec("unmap_target_from_router",[e,r],{cmd_only:s,tlm_only:n})}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}router_target_enable(e,r,s=!1,n=!1){return this.exec("router_target_enable",[e,r],{cmd_only:s,tlm_only:n})}router_target_disable(e,r,s=!1,n=!1){return this.exec("router_target_disable",[e,r],{cmd_only:s,tlm_only:n})}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,r,s){return this.exec("get_item",[e,r,s])}get_param(e,r,s){return this.exec("get_param",[e,r,s])}get_parameter(e,r,s){return this.get_param(e,r,s)}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])}delete_limits_set(e){return this.exec("delete_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.get_target_names()}get_tlm(e,r){return this.exec("get_tlm",[e,r])}get_telemetry(e,r){return this.get_tlm(e,r)}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.get_all_tlm(e)}get_all_tlm_names(e,r=!1){return this.exec("get_all_tlm_names",[e],{hidden:r})}get_all_telemetry_names(e){return this.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,r,s,n=30){const o=await this.exec("get_tlm_packet",[e,r],{type:s,stale_time:n});if(o!=null){let i=o.length,a=null;for(let l=0;l<i;l++)a=this.decode_openc3_type(o[l][1]),a!==null&&(o[l][1]=a)}return o}get_packet_derived_items(e,r){return this.exec("get_packet_derived_items",[e,r])}get_tlm_buffer(e,r){return this.exec("get_tlm_buffer",[e,r])}get_tlm_available(e,r={},s={}){return this.exec("get_tlm_available",[e],r,s)}async get_tlm_values(e,r=30,s=null,n=null,o=null,i={}){let a={stale_time:r};s!==null&&(a.cache_timeout=s),n!==null&&(a.start_time=n.toISOString()),o!==null&&(a.end_time=o.toISOString());const l=await this.exec("get_tlm_values",[e],a,i,1e4);if(l&&l.length>0){let d=l.length,u=null;for(let h=0;h<d;h++)u=this.decode_openc3_type(l[h][0]),u!==null&&(l[h][0]=u)}return l}get_limits(e,r,s){return this.exec("get_limits",[e,r,s])}async tlm(e,r,s,n="CONVERTED"){let o=null;if(r===void 0)o=await this.exec("tlm",[e]);else if(s===void 0)if(["RAW","CONVERTED","FORMATTED"].includes(r))o=await this.exec("tlm",[e],{type:r});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${r}. Valid options are RAW, CONVERTED or FORMATTED.`,a}else o=await this.exec("tlm",[e,r,s],{type:n});let i=this.decode_openc3_type(o);return i!==null&&(o=i),o}async inject_tlm(e,r,s=null,n="CONVERTED",o=!1){await this.exec("inject_tlm",[e,r,s],{type:n,stored:o})}set_tlm(e,r,s,n){return this.exec("set_tlm",[e,r,s],{type:n})}override_tlm(e,r,s,n){return this.exec("override_tlm",[e,r,s],{type:n})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,r,s,n){return this.exec("normalize_tlm",[e,r,s],{type:n})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.get_all_cmds(e)}get_all_cmd_names(e,r=!1){return this.exec("get_all_cmd_names",[e],{hidden:r})}get_all_command_names(e){return this.get_all_cmd_names(e)}get_cmd(e,r){return this.exec("get_cmd",[e,r])}get_command(e,r){return this.get_cmd(e,r)}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,r,s,n="CONVERTED"){return this.exec("get_cmd_value",[e,r,s,n])}get_cmd_buffer(e,r){return this.exec("get_cmd_buffer",[e,r])}_cmd(e,r,s,n,o,i={}){let a=null;for(let l in n)Object.prototype.hasOwnProperty.call(n,l)&&(a=this.encode_openc3_type(n[l]),a!==null&&(n[l]=a));return this.exec(e,[r,s,n],i,o)}get_cmd_hazardous(e,r,s,n={}){return r===void 0?this.exec("get_cmd_hazardous",e,{},n):this._cmd("get_cmd_hazardous",e,r,s,n)}cmd(e,r,s,n={},o={}){return r===void 0?this.exec("cmd",e,o,n):this._cmd("cmd",e,r,s,n,o)}cmd_no_range_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_range_check",e,o,n):this._cmd("cmd_no_range_check",e,r,s,n,o)}cmd_raw(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw",e,o,n):this._cmd("cmd_raw",e,r,s,n,o)}cmd_raw_no_range_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_range_check",e,o,n):this._cmd("cmd_raw_no_range_check",e,r,s,n,o)}cmd_no_hazardous_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_hazardous_check",e,o,n):this._cmd("cmd_no_hazardous_check",e,r,s,n,o)}cmd_no_checks(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_checks",e,o,n):this._cmd("cmd_no_checks",e,r,s,n,o)}cmd_raw_no_hazardous_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_hazardous_check",e,o,n):this._cmd("cmd_raw_no_hazardous_check",e,r,s,n,o)}cmd_raw_no_checks(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_checks",e,o,n):this._cmd("cmd_raw_no_checks",e,r,s,n,o)}build_cmd(e,r,s,n={},o={}){return r===void 0?this.exec("build_cmd",e,o,n):this._cmd("build_cmd",e,r,s,n,o)}build_command(e,r,s,n={},o={}){return this.build_cmd(e,r,s,n,o)}get_interface_names(){return this.exec("get_interface_names",[])}get_router_names(){return this.exec("get_router_names",[])}send_raw(e,r){return this.exec("send_raw",[e,r])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,r){return this.exec("load_config",[e,r])}save_config(e,r,s){return this.exec("save_config",[e,r,s])}delete_config(e,r){return this.exec("delete_config",[e,r])}enable_limits(e,r,s){return this.exec("enable_limits",[e,r,s])}disable_limits(e,r,s){return this.exec("disable_limits",[e,r,s])}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,r){return this.exec("get_setting",[e],r)}get_settings(e,r){return this.exec("get_settings",e,r)}set_setting(e,r){return this.exec("set_setting",[e,r])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}save_setting(e,r){return this.set_setting(e,r)}get_metrics(){return this.exec("get_metrics",[])}open_tab(e){window.open(e,"_blank")}async hashString(e){if(window.isSecureContext){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",r),n=new Uint8Array(s);return Array.from(n).map(o=>o.toString(16).padStart(2,"0")).join("")}}}let ct=[];const ca={components:{OpenC3TimePicker:Gt,OpenConfigDialog:Wt,SaveConfigDialog:Ht,TargetPacketItemChooser:Xt,TopBar:As},mixins:[ks,zt],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,allowWildcards:!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 Ro,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}},{label:"Allow Wildcards",checkbox:!0,checked:this.allowWildcards,command:()=>{this.allowWildcards=!this.allowWildcards}},{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,allowWildcards:this.allowWildcards,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)},allowWildcards: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 la,await this.api.get_setting("time_zone").then(e=>{e&&(this.timeZone=e)}).catch(e=>{}),await Hi.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.allowWildcards=!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.allowWildcards=t.allowWildcards,this.menus[1].items[3].checked=this.allowWildcards||!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,r=>{this.applyConfig(r),this.startDate=r.startDate,this.startTime=r.startTime,this.endTime=r.endTime,this.endDate=r.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
12
12
  continue to stream in real-time until
13
- ${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(){ct=[],this.packetsReceived=0,this.itemsReceived=0},onConnected:function(){this.resetAllVars();let t=[];this.items.forEach((e,r)=>{let s=`${e.mode}__${e.cmdOrTlm}__${e.targetName}__${e.packetName}__${e.itemName}__${e.valueType}`;e.reducedType!=="SAMPLE"&&(s=s+"__"+e.reducedType);let n=String(r);this.keyMap[n]=s,t.push([s,n])}),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})}).catch(Jr)},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 n of t){let o=Object.keys(n);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]),ct.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]||e;const[r,s,n,o,i,a,l]=e.split("__");let d=i;this.columnMode==="full"&&(d=n+" "+o+" "+i),r&&r!=="DECOM"&&(d=d+" {"+r+"}"),a&&a!=="CONVERTED"&&(d=d+" ("+a+")"),l&&(d=d+" ["+l+"]"),this.columnHeaders.push(d)})},createFile:async function(){let t=ct.flat(),e=this.columnHeaders,r=this.columnMap,s=[];this.resetPerFileVars();let n="";this.matlabHeader&&(n+="% "),n+=e.join(this.delimiter),s.push(n),await this.yieldToMain(),t.sort((_,R)=>_.__time-R.__time),await this.yieldToMain();let o=[],i=[],a=null,l=0;for(let _ of t){let R=!1;this.fillDown&&a?i=[...a]:i=[];let A="";if(Object.keys(_).forEach(m=>{if(m.slice(0,2)==="__"||m==="COSMOS_EXTRA")return;A=m;let w=r[m];if(typeof _[m]=="object")if(_[m]===null)i[w]="";else if(Array.isArray(_[m]))i[w]='"['+_[m]+']"';else{let b=_[m].raw;if(Array.isArray(b)){let E="0x";b.forEach(f=>{E+=f.toString(16).padStart(2,"0").toUpperCase()}),i[w]=E}else i[w]="'"+b+"'"}else i[w]=_[m];this.uniqueOnly&&o[w]!==i[w]&&(R=!0),o[w]=i[w]}),this.fillDown&&(a=[...i]),!this.uniqueOnly||R){if(this.columnMode==="normal"){A=this.keyMap[A]||A;const[m,w,b,E,f,k,T]=A.split("__"),L=BigInt(_.__time),Z=Number(L/1000000n),X=Number(L%1000000n),z=new Date(Z).toISOString(),M=String(X).padStart(6,"0");if(i[0]=z.replace(/\.(\d{3})Z$/,(S,j)=>`.${j}${M}Z`),i[1]=b,i[2]=E,this.hasCommands){const S=_.COSMOS_EXTRA?JSON.parse(_.COSMOS_EXTRA):{};i[3]=S?.username||"",this.enterprise&&(i[4]=S?.approver||"")}}s.push(i.join(this.delimiter))}l+=1,l%1e3==0&&await this.yieldToMain()}let d=".csv",u="text/csv";this.delimiter===" "&&(d=".txt",u="text/tab-separated-values"),await this.yieldToMain();const h=new Blob([s.join(`
14
- `)],{type:u});await this.yieldToMain();const g=document.createElement("a");g.href=URL.createObjectURL(h),g.setAttribute("download",this.startDateTimeFilename+"_"+this.fileCount+d),g.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),ct.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 ua(t,e,r,s,n,o){const i=x("top-bar"),a=x("v-text-field"),l=x("v-col"),d=x("OpenC3TimePicker"),u=x("v-row"),h=x("v-radio"),g=x("v-radio-group"),_=x("target-packet-item-chooser"),R=x("v-container"),A=x("v-progress-circular"),m=x("v-spacer"),w=x("v-btn"),b=x("v-toolbar"),E=x("v-card-title"),f=x("v-select"),k=x("v-card-text"),T=x("v-card-actions"),L=x("v-card"),Z=x("v-dialog"),X=x("v-data-table"),z=x("open-config-dialog"),M=x("save-config-dialog");return N(),ce("div",null,[p(i,{menus:o.menus,title:n.title},null,8,["menus","title"]),p(L,null,{default:v(()=>[p(R,null,{default:v(()=>[p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(a,{modelValue:n.startDate,"onUpdate:modelValue":e[0]||(e[0]=S=>n.startDate=S),label:"Start Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"start-date"},null,8,["modelValue","max","rules"])]),_:1}),p(l,null,{default:v(()=>[p(d,{modelValue:n.startTime,"onUpdate:modelValue":e[1]||(e[1]=S=>n.startTime=S),label:"Start Time",rules:[n.rules.required],"data-test":"start-time"},null,8,["modelValue","rules"])]),_:1}),p(l,null,{default:v(()=>[p(a,{modelValue:n.endDate,"onUpdate:modelValue":e[2]||(e[2]=S=>n.endDate=S),label:"End Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"end-date"},null,8,["modelValue","max","rules"])]),_:1}),p(l,null,{default:v(()=>[p(d,{modelValue:n.endTime,"onUpdate:modelValue":e[3]||(e[3]=S=>n.endTime=S),label:"End Time",rules:[n.rules.required],"data-test":"end-time"},null,8,["modelValue","rules"])]),_:1})]),_:1}),p(u,{"no-gutters":""},{default:v(()=>[p(l,null,{default:v(()=>[p(g,{modelValue:n.cmdOrTlm,"onUpdate:modelValue":e[4]||(e[4]=S=>n.cmdOrTlm=S),inline:"","hide-details":"",class:"mt-0"},{default:v(()=>[p(h,{label:"Command",value:"cmd","data-test":"cmd-radio"}),p(h,{label:"Telemetry",value:"tlm","data-test":"tlm-radio"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(_,{"button-text":"Add Item",mode:n.cmdOrTlm,hidden:!0,"choose-item":"","allow-all":"","allow-glob":n.allowWildcards,"show-latest":"",onAddItem:e[5]||(e[5]=S=>o.addItem(S))},null,8,["mode","allow-glob"])]),_:1})]),_:1})]),_:1}),p(b,{class:"pl-3"},{default:v(()=>[p(A,{"model-value":n.progress},null,8,["model-value"]),J("   Processed: "+ne(n.totalPacketsReceived)+" packets, "+ne(n.totalItemsReceived)+" items ",1),p(m),p(w,{class:"bg-primary",disabled:n.items.length<1,onClick:o.processItems},{default:v(()=>[J(ne(n.processButtonText),1)]),_:1},8,["disabled","onClick"]),p(m),p(w,{icon:"mdi-pencil-box-multiple",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"editAll","aria-label":"Edit All Items",onClick:e[6]||(e[6]=S=>n.editAll=!0)},null,8,["disabled"]),p(w,{icon:"mdi-delete-sweep",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"delete-all","aria-label":"Delete All Items",onClick:o.deleteAll},null,8,["disabled","onClick"])]),_:1}),p(L,{width:"100%"},{default:v(()=>[p(E,null,{default:v(()=>[e[18]||(e[18]=J(" Items ",-1)),p(m),p(a,{modelValue:n.search,"onUpdate:modelValue":e[7]||(e[7]=S=>n.search=S),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),p(X,{"items-per-page":n.itemsPerPage,"onUpdate:itemsPerPage":e[8]||(e[8]=S=>n.itemsPerPage=S),headers:n.headers,items:n.items,search:n.search,"items-per-page-options":[10,20,50,100,-1],"multi-sort":"",density:"compact"},{"item.edit":v(({item:S})=>[p(w,{icon:"mdi-pencil",variant:"text","data-test":"edit-row","aria-label":"Edit Item",onClick:Xt(j=>S.edit=!0,["stop"])},null,8,["onClick"]),p(Z,{modelValue:S.edit,"onUpdate:modelValue":j=>S.edit=j,"max-width":"600",persistent:"",onKeydown:pt(j=>S.edit=!1,["esc"])},{default:v(()=>[p(L,null,{default:v(()=>[p(b,{height:"24"},{default:v(()=>[p(m),e[19]||(e[19]=xe("span",null," DataExtractor: Edit Item Mode ",-1)),p(m)]),_:1}),p(k,null,{default:v(()=>[p(u,{class:"mt-3 title-font"},{default:v(()=>[p(l,null,{default:v(()=>[J(ne(o.getItemLabel(S)),1)]),_:2},1024)]),_:2},1024),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:S.mode,"onUpdate:modelValue":j=>S.mode=j,"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:S.valueType,"onUpdate:modelValue":j=>S.valueType=j,"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:S.reducedType,"onUpdate:modelValue":j=>S.reducedType=j,"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024)]),_:2},1024),p(T,{class:"px-6 py-3"},{default:v(()=>[p(m),p(w,{variant:"flat",onClick:j=>S.edit=!1},{default:v(()=>[...e[20]||(e[20]=[J(" Close ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","onKeydown"])]),"item.delete":v(({item:S})=>[p(w,{icon:"mdi-delete",variant:"text","data-test":"delete-row","aria-label":"Delete Item",onClick:j=>o.deleteItem(S)},null,8,["onClick"])]),_:1},8,["items-per-page","headers","items","search"])]),_:1})]),_:1}),p(Z,{modelValue:n.editAll,"onUpdate:modelValue":e[14]||(e[14]=S=>n.editAll=S),"max-width":"600",persistent:"",onKeydown:e[15]||(e[15]=pt(S=>n.editAll=!1,["esc"]))},{default:v(()=>[p(L,null,{default:v(()=>[p(b,{height:"24"},{default:v(()=>[p(m),e[21]||(e[21]=xe("span",null," DataExtractor: Edit All Items",-1)),p(m)]),_:1}),p(k,null,{default:v(()=>[p(u,{class:"mt-3"},{default:v(()=>[p(l,null,{default:v(()=>[...e[22]||(e[22]=[J(" This will change all items to the following data type! ",-1)])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:n.allItemMode,"onUpdate:modelValue":e[9]||(e[9]=S=>n.allItemMode=S),"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:n.allItemValueType,"onUpdate:modelValue":e[10]||(e[10]=S=>n.allItemValueType=S),"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:n.allItemReducedType,"onUpdate:modelValue":e[11]||(e[11]=S=>n.allItemReducedType=S),"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1})]),_:1}),p(T,{class:"px-6 py-3"},{default:v(()=>[p(m),p(w,{variant:"outlined",onClick:e[12]||(e[12]=S=>n.editAll=!1)},{default:v(()=>[...e[23]||(e[23]=[J(" Cancel ",-1)])]),_:1}),p(w,{variant:"flat",disabled:!n.allItemValueType,onClick:e[13]||(e[13]=S=>o.editAllItems())},{default:v(()=>[...e[24]||(e[24]=[J(" Ok ",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),n.openConfig?(N(),q(z,{key:0,modelValue:n.openConfig,"onUpdate:modelValue":e[16]||(e[16]=S=>n.openConfig=S),"config-key":n.configKey,onSuccess:o.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):Ee("",!0),n.saveConfig?(N(),q(M,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[17]||(e[17]=S=>n.saveConfig=S),"config-key":n.configKey,onSuccess:o.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):Ee("",!0)])}const ka=Os("default",Bt(ca,[["render",ua],["__scopeId","data-v-05a98b50"]]))})}}));
13
+ ${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(){ct=[],this.packetsReceived=0,this.itemsReceived=0},onConnected:function(){this.resetAllVars();let t=[];this.items.forEach((e,r)=>{let s=`${e.mode}__${e.cmdOrTlm}__${e.targetName}__${e.packetName}__${e.itemName}__${e.valueType}`;e.reducedType!=="SAMPLE"&&(s=s+"__"+e.reducedType);let n=String(r);this.keyMap[n]=s,t.push([s,n])}),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})}).catch(Jr)},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 n of t){let o=Object.keys(n);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]),ct.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]||e;const[r,s,n,o,i,a,l]=e.split("__");let d=i;this.columnMode==="full"&&(d=n+" "+o+" "+i),r&&r!=="DECOM"&&(d=d+" {"+r+"}"),a&&a!=="CONVERTED"&&(d=d+" ("+a+")"),l&&(d=d+" ["+l+"]"),this.columnHeaders.push(d)})},createFile:async function(){let t=ct.flat(),e=this.columnHeaders,r=this.columnMap,s=[];this.resetPerFileVars();let n="";this.matlabHeader&&(n+="% "),n+=e.join(this.delimiter),s.push(n),await this.yieldToMain(),t.sort((_,R)=>_.__time-R.__time),await this.yieldToMain();let o=[],i=[],a=null,l=0;for(let _ of t){let R=!1;this.fillDown&&a?i=[...a]:i=[];let A="";if(Object.keys(_).forEach(m=>{if(m.slice(0,2)==="__"||m==="COSMOS_EXTRA")return;A=m;let w=r[m];if(typeof _[m]=="object")if(_[m]===null)i[w]="";else if(Array.isArray(_[m]))i[w]='"['+_[m]+']"';else{let b=_[m].raw;if(Array.isArray(b)){let E="0x";b.forEach(f=>{E+=f.toString(16).padStart(2,"0").toUpperCase()}),i[w]=E}else i[w]="'"+b+"'"}else i[w]=_[m];this.uniqueOnly&&o[w]!==i[w]&&(R=!0),o[w]=i[w]}),this.fillDown&&(a=[...i]),!this.uniqueOnly||R){if(this.columnMode==="normal"){A=this.keyMap[A]||A;const[m,w,b,E,f,k,T]=A.split("__"),L=BigInt(_.__time),X=Number(L/1000000n),Z=Number(L%1000000n),z=new Date(X).toISOString(),M=String(Z).padStart(6,"0");if(i[0]=z.replace(/\.(\d{3})Z$/,(S,j)=>`.${j}${M}Z`),i[1]=b,i[2]=E,this.hasCommands){const S=_.COSMOS_EXTRA?JSON.parse(_.COSMOS_EXTRA):{};i[3]=S?.username||"",this.enterprise&&(i[4]=S?.approver||"")}}s.push(i.join(this.delimiter))}l+=1,l%1e3==0&&await this.yieldToMain()}let d=".csv",u="text/csv";this.delimiter===" "&&(d=".txt",u="text/tab-separated-values"),await this.yieldToMain();const h=new Blob([s.join(`
14
+ `)],{type:u});await this.yieldToMain();const g=document.createElement("a");g.href=URL.createObjectURL(h),g.setAttribute("download",this.startDateTimeFilename+"_"+this.fileCount+d),g.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),ct.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 ua(t,e,r,s,n,o){const i=x("top-bar"),a=x("v-text-field"),l=x("v-col"),d=x("OpenC3TimePicker"),u=x("v-row"),h=x("v-radio"),g=x("v-radio-group"),_=x("target-packet-item-chooser"),R=x("v-container"),A=x("v-progress-circular"),m=x("v-spacer"),w=x("v-btn"),b=x("v-toolbar"),E=x("v-card-title"),f=x("v-select"),k=x("v-card-text"),T=x("v-card-actions"),L=x("v-card"),X=x("v-dialog"),Z=x("v-data-table"),z=x("open-config-dialog"),M=x("save-config-dialog");return N(),ce("div",null,[p(i,{menus:o.menus,title:n.title},null,8,["menus","title"]),p(L,null,{default:v(()=>[p(R,null,{default:v(()=>[p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(a,{modelValue:n.startDate,"onUpdate:modelValue":e[0]||(e[0]=S=>n.startDate=S),label:"Start Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"start-date"},null,8,["modelValue","max","rules"])]),_:1}),p(l,null,{default:v(()=>[p(d,{modelValue:n.startTime,"onUpdate:modelValue":e[1]||(e[1]=S=>n.startTime=S),label:"Start Time",rules:[n.rules.required],"data-test":"start-time"},null,8,["modelValue","rules"])]),_:1}),p(l,null,{default:v(()=>[p(a,{modelValue:n.endDate,"onUpdate:modelValue":e[2]||(e[2]=S=>n.endDate=S),label:"End Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"end-date"},null,8,["modelValue","max","rules"])]),_:1}),p(l,null,{default:v(()=>[p(d,{modelValue:n.endTime,"onUpdate:modelValue":e[3]||(e[3]=S=>n.endTime=S),label:"End Time",rules:[n.rules.required],"data-test":"end-time"},null,8,["modelValue","rules"])]),_:1})]),_:1}),p(u,{"no-gutters":""},{default:v(()=>[p(l,null,{default:v(()=>[p(g,{modelValue:n.cmdOrTlm,"onUpdate:modelValue":e[4]||(e[4]=S=>n.cmdOrTlm=S),inline:"","hide-details":"",class:"mt-0"},{default:v(()=>[p(h,{label:"Command",value:"cmd","data-test":"cmd-radio"}),p(h,{label:"Telemetry",value:"tlm","data-test":"tlm-radio"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(_,{"button-text":"Add Item",mode:n.cmdOrTlm,hidden:!0,"choose-item":"","allow-all":"","allow-glob":n.allowWildcards,"show-latest":"",onAddItem:e[5]||(e[5]=S=>o.addItem(S))},null,8,["mode","allow-glob"])]),_:1})]),_:1})]),_:1}),p(b,{class:"pl-3"},{default:v(()=>[p(A,{"model-value":n.progress},null,8,["model-value"]),J("   Processed: "+ne(n.totalPacketsReceived)+" packets, "+ne(n.totalItemsReceived)+" items ",1),p(m),p(w,{class:"bg-primary",disabled:n.items.length<1,onClick:o.processItems},{default:v(()=>[J(ne(n.processButtonText),1)]),_:1},8,["disabled","onClick"]),p(m),p(w,{icon:"mdi-pencil-box-multiple",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"editAll","aria-label":"Edit All Items",onClick:e[6]||(e[6]=S=>n.editAll=!0)},null,8,["disabled"]),p(w,{icon:"mdi-delete-sweep",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"delete-all","aria-label":"Delete All Items",onClick:o.deleteAll},null,8,["disabled","onClick"])]),_:1}),p(L,{width:"100%"},{default:v(()=>[p(E,null,{default:v(()=>[e[18]||(e[18]=J(" Items ",-1)),p(m),p(a,{modelValue:n.search,"onUpdate:modelValue":e[7]||(e[7]=S=>n.search=S),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),p(Z,{"items-per-page":n.itemsPerPage,"onUpdate:itemsPerPage":e[8]||(e[8]=S=>n.itemsPerPage=S),headers:n.headers,items:n.items,search:n.search,"items-per-page-options":[10,20,50,100,-1],"multi-sort":"",density:"compact"},{"item.edit":v(({item:S})=>[p(w,{icon:"mdi-pencil",variant:"text","data-test":"edit-row","aria-label":"Edit Item",onClick:Zt(j=>S.edit=!0,["stop"])},null,8,["onClick"]),p(X,{modelValue:S.edit,"onUpdate:modelValue":j=>S.edit=j,"max-width":"600",persistent:"",onKeydown:pt(j=>S.edit=!1,["esc"])},{default:v(()=>[p(L,null,{default:v(()=>[p(b,{height:"24"},{default:v(()=>[p(m),e[19]||(e[19]=xe("span",null," DataExtractor: Edit Item Mode ",-1)),p(m)]),_:1}),p(k,null,{default:v(()=>[p(u,{class:"mt-3 title-font"},{default:v(()=>[p(l,null,{default:v(()=>[J(ne(o.getItemLabel(S)),1)]),_:2},1024)]),_:2},1024),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:S.mode,"onUpdate:modelValue":j=>S.mode=j,"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:S.valueType,"onUpdate:modelValue":j=>S.valueType=j,"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:S.reducedType,"onUpdate:modelValue":j=>S.reducedType=j,"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024)]),_:2},1024),p(T,{class:"px-6 py-3"},{default:v(()=>[p(m),p(w,{variant:"flat",onClick:j=>S.edit=!1},{default:v(()=>[...e[20]||(e[20]=[J(" Close ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","onKeydown"])]),"item.delete":v(({item:S})=>[p(w,{icon:"mdi-delete",variant:"text","data-test":"delete-row","aria-label":"Delete Item",onClick:j=>o.deleteItem(S)},null,8,["onClick"])]),_:1},8,["items-per-page","headers","items","search"])]),_:1})]),_:1}),p(X,{modelValue:n.editAll,"onUpdate:modelValue":e[14]||(e[14]=S=>n.editAll=S),"max-width":"600",persistent:"",onKeydown:e[15]||(e[15]=pt(S=>n.editAll=!1,["esc"]))},{default:v(()=>[p(L,null,{default:v(()=>[p(b,{height:"24"},{default:v(()=>[p(m),e[21]||(e[21]=xe("span",null," DataExtractor: Edit All Items",-1)),p(m)]),_:1}),p(k,null,{default:v(()=>[p(u,{class:"mt-3"},{default:v(()=>[p(l,null,{default:v(()=>[...e[22]||(e[22]=[J(" This will change all items to the following data type! ",-1)])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:n.allItemMode,"onUpdate:modelValue":e[9]||(e[9]=S=>n.allItemMode=S),"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:n.allItemValueType,"onUpdate:modelValue":e[10]||(e[10]=S=>n.allItemValueType=S),"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),p(u,null,{default:v(()=>[p(l,null,{default:v(()=>[p(f,{modelValue:n.allItemReducedType,"onUpdate:modelValue":e[11]||(e[11]=S=>n.allItemReducedType=S),"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1})]),_:1}),p(T,{class:"px-6 py-3"},{default:v(()=>[p(m),p(w,{variant:"outlined",onClick:e[12]||(e[12]=S=>n.editAll=!1)},{default:v(()=>[...e[23]||(e[23]=[J(" Cancel ",-1)])]),_:1}),p(w,{variant:"flat",disabled:!n.allItemValueType,onClick:e[13]||(e[13]=S=>o.editAllItems())},{default:v(()=>[...e[24]||(e[24]=[J(" Ok ",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),n.openConfig?(N(),q(z,{key:0,modelValue:n.openConfig,"onUpdate:modelValue":e[16]||(e[16]=S=>n.openConfig=S),"config-key":n.configKey,onSuccess:o.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):Ee("",!0),n.saveConfig?(N(),q(M,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[17]||(e[17]=S=>n.saveConfig=S),"config-key":n.configKey,onSuccess:o.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):Ee("",!0)])}const ka=Os("default",Bt(ca,[["render",ua],["__scopeId","data-v-05a98b50"]]))})}}));