import{s as Ce,ac as _e,N as Ee,_ as Se}from"./index.c98a7b8a.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as Be,f as wt,r as Ae,o as Ie,aY as Te,bZ as Pe,bV as Ne,b3 as Fe,bP as Me,bI as De,C as x,D as q,aI as C,aH as S,aM as L,aN as v,G,u as Re,a$ as Zt,b0 as Wt,aK as nt,aJ as ot,aE as rt,n as Xt,bc as Le,bk as Ue,bY as ve,b8 as ke,bi as Ve,b_ as $e,bG as xe,bJ as Oe,bL as He,bm as ze,bn as Je}from"./arco.c29bba08.js";import{e as yt,g as te,h as I,b as F,s as Ye}from"./serial.c6b76da8.js";import{u as Ke}from"./loading.d503f2cd.js";import"./chart.34708d29.js";import"./vue.437ba699.js";var W={},je=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},re={},k={};let Pt;const qe=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];k.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17};k.getSymbolTotalCodewords=function(n){return qe[n]};k.getBCHDigit=function(o){let n=0;for(;o!==0;)n++,o>>>=1;return n};k.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');Pt=n};k.isKanjiModeEnabled=function(){return typeof Pt<"u"};k.toSJIS=function(n){return Pt(n)};var ut={};(function(o){o.L={bit:1},o.M={bit:0},o.Q={bit:3},o.H={bit:2};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return o.L;case"m":case"medium":return o.M;case"q":case"quartile":return o.Q;case"h":case"high":return o.H;default:throw new Error("Unknown EC Level: "+i)}}o.isValid=function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},o.from=function(e,a){if(o.isValid(e))return e;try{return n(e)}catch{return a}}})(ut);function ae(){this.buffer=[],this.length=0}ae.prototype={get:function(o){const n=Math.floor(o/8);return(this.buffer[n]>>>7-o%8&1)===1},put:function(o,n){for(let i=0;i>>n-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),o&&(this.buffer[n]|=128>>>this.length%8),this.length++}};var Ge=ae;function X(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}X.prototype.set=function(o,n,i,e){const a=o*this.size+n;this.data[a]=i,e&&(this.reservedBit[a]=!0)};X.prototype.get=function(o,n){return this.data[o*this.size+n]};X.prototype.xor=function(o,n,i){this.data[o*this.size+n]^=i};X.prototype.isReserved=function(o,n){return this.reservedBit[o*this.size+n]};var Qe=X,ie={};(function(o){const n=k.getSymbolSize;o.getRowColCoords=function(e){if(e===1)return[];const a=Math.floor(e/7)+2,r=n(e),s=r===145?26:Math.ceil((r-13)/(2*a-2))*2,t=[r-7];for(let l=1;l=0&&a<=7},o.from=function(a){return o.isValid(a)?parseInt(a,10):void 0},o.getPenaltyN1=function(a){const r=a.size;let s=0,t=0,l=0,g=null,h=null;for(let A=0;A=5&&(s+=n.N1+(t-5)),g=m,t=1),m=a.get(y,A),m===h?l++:(l>=5&&(s+=n.N1+(l-5)),h=m,l=1)}t>=5&&(s+=n.N1+(t-5)),l>=5&&(s+=n.N1+(l-5))}return s},o.getPenaltyN2=function(a){const r=a.size;let s=0;for(let t=0;t=10&&(t===1488||t===93)&&s++,l=l<<1&2047|a.get(h,g),h>=10&&(l===1488||l===93)&&s++}return s*n.N3},o.getPenaltyN4=function(a){let r=0;const s=a.data.length;for(let l=0;l=0;){const s=r[0];for(let l=0;l0){const r=new Uint8Array(this.degree);return r.set(e,a),r}return e};var We=Nt,fe={},H={},Ft={};Ft.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40};var $={};const de="[0-9]+",Xe="[A-Z $%*+\\-./:]+";let Z="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Z=Z.replace(/u/g,"\\u");const tn="(?:(?![A-Z0-9 $%*+\\-./:]|"+Z+`)(?:.|[\r ]))+`;$.KANJI=new RegExp(Z,"g");$.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");$.BYTE=new RegExp(tn,"g");$.NUMERIC=new RegExp(de,"g");$.ALPHANUMERIC=new RegExp(Xe,"g");const en=new RegExp("^"+Z+"$"),nn=new RegExp("^"+de+"$"),on=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");$.testKanji=function(n){return en.test(n)};$.testNumeric=function(n){return nn.test(n)};$.testAlphanumeric=function(n){return on.test(n)};(function(o){const n=Ft,i=$;o.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},o.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},o.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},o.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},o.MIXED={bit:-1},o.getCharCountIndicator=function(r,s){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!n.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?r.ccBits[0]:s<27?r.ccBits[1]:r.ccBits[2]},o.getBestModeForData=function(r){return i.testNumeric(r)?o.NUMERIC:i.testAlphanumeric(r)?o.ALPHANUMERIC:i.testKanji(r)?o.KANJI:o.BYTE},o.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},o.isValid=function(r){return r&&r.bit&&r.ccBits};function e(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"numeric":return o.NUMERIC;case"alphanumeric":return o.ALPHANUMERIC;case"kanji":return o.KANJI;case"byte":return o.BYTE;default:throw new Error("Unknown mode: "+a)}}o.from=function(r,s){if(o.isValid(r))return r;try{return e(r)}catch{return s}}})(H);(function(o){const n=k,i=ct,e=ut,a=H,r=Ft,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,t=n.getBCHDigit(s);function l(y,m,_){for(let E=1;E<=40;E++)if(m<=o.getCapacity(E,_,y))return E}function g(y,m){return a.getCharCountIndicator(y,m)+4}function h(y,m){let _=0;return y.forEach(function(E){const T=g(E.mode,m);_+=T+E.getBitsLength()}),_}function A(y,m){for(let _=1;_<=40;_++)if(h(y,_)<=o.getCapacity(_,m,a.MIXED))return _}o.from=function(m,_){return r.isValid(m)?parseInt(m,10):_},o.getCapacity=function(m,_,E){if(!r.isValid(m))throw new Error("Invalid QR Code version");typeof E>"u"&&(E=a.BYTE);const T=n.getSymbolTotalCodewords(m),b=i.getTotalCodewordsCount(m,_),c=(T-b)*8;if(E===a.MIXED)return c;const u=c-g(E,m);switch(E){case a.NUMERIC:return Math.floor(u/10*3);case a.ALPHANUMERIC:return Math.floor(u/11*2);case a.KANJI:return Math.floor(u/13);case a.BYTE:default:return Math.floor(u/8)}},o.getBestVersionForData=function(m,_){let E;const T=e.from(_,e.M);if(Array.isArray(m)){if(m.length>1)return A(m,T);if(m.length===0)return 1;E=m[0]}else E=m;return l(E.mode,E.getLength(),T)},o.getEncodedBits=function(m){if(!r.isValid(m)||m<7)throw new Error("Invalid QR Code version");let _=m<<12;for(;n.getBCHDigit(_)-t>=0;)_^=s<=0;)a^=he<0&&(e=this.data.substr(i),a=parseInt(e,10),n.put(a,r*3+1))};var sn=J;const ln=H,bt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Y(o){this.mode=ln.ALPHANUMERIC,this.data=o}Y.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)};Y.prototype.getLength=function(){return this.data.length};Y.prototype.getBitsLength=function(){return Y.getBitsLength(this.data.length)};Y.prototype.write=function(n){let i;for(i=0;i+2<=this.data.length;i+=2){let e=bt.indexOf(this.data[i])*45;e+=bt.indexOf(this.data[i+1]),n.put(e,11)}this.data.length%2&&n.put(bt.indexOf(this.data[i]),6)};var un=Y,cn=function(n){for(var i=[],e=n.length,a=0;a=55296&&r<=56319&&e>a+1){var s=n.charCodeAt(a+1);s>=56320&&s<=57343&&(r=(r-55296)*1024+s-56320+65536,a+=1)}if(r<128){i.push(r);continue}if(r<2048){i.push(r>>6|192),i.push(r&63|128);continue}if(r<55296||r>=57344&&r<65536){i.push(r>>12|224),i.push(r>>6&63|128),i.push(r&63|128);continue}if(r>=65536&&r<=1114111){i.push(r>>18|240),i.push(r>>12&63|128),i.push(r>>6&63|128),i.push(r&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer};const fn=cn,dn=H;function K(o){this.mode=dn.BYTE,typeof o=="string"&&(o=fn(o)),this.data=new Uint8Array(o)}K.getBitsLength=function(n){return n*8};K.prototype.getLength=function(){return this.data.length};K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)};K.prototype.write=function(o){for(let n=0,i=this.data.length;n=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+` Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),o.put(i,13)}};var mn=j,me={exports:{}};(function(o){var n={single_source_shortest_paths:function(i,e,a){var r={},s={};s[e]=0;var t=n.PriorityQueue.make();t.push(e,0);for(var l,g,h,A,y,m,_,E,T;!t.empty();){l=t.pop(),g=l.value,A=l.cost,y=i[g]||{};for(h in y)y.hasOwnProperty(h)&&(m=y[h],_=A+m,E=s[h],T=typeof s[h]>"u",(T||E>_)&&(s[h]=_,t.push(h,_),r[h]=g))}if(typeof a<"u"&&typeof s[a]>"u"){var b=["Could not find a path from ",e," to ",a,"."].join("");throw new Error(b)}return r},extract_shortest_path_from_predecessor_list:function(i,e){for(var a=[],r=e;r;)a.push(r),i[r],r=i[r];return a.reverse(),a},find_path:function(i,e,a){var r=n.single_source_shortest_paths(i,e,a);return n.extract_shortest_path_from_predecessor_list(r,a)},PriorityQueue:{make:function(i){var e=n.PriorityQueue,a={},r;i=i||{};for(r in e)e.hasOwnProperty(r)&&(a[r]=e[r]);return a.queue=[],a.sorter=i.sorter||e.default_sorter,a},default_sorter:function(i,e){return i.cost-e.cost},push:function(i,e){var a={value:i,cost:e};this.queue.push(a),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};o.exports=n})(me);(function(o){const n=H,i=sn,e=un,a=gn,r=mn,s=$,t=k,l=me.exports;function g(b){return unescape(encodeURIComponent(b)).length}function h(b,c,u){const f=[];let d;for(;(d=b.exec(u))!==null;)f.push({data:d[0],index:d.index,mode:c,length:d[0].length});return f}function A(b){const c=h(s.NUMERIC,n.NUMERIC,b),u=h(s.ALPHANUMERIC,n.ALPHANUMERIC,b);let f,d;return t.isKanjiModeEnabled()?(f=h(s.BYTE,n.BYTE,b),d=h(s.KANJI,n.KANJI,b)):(f=h(s.BYTE_KANJI,n.BYTE,b),d=[]),c.concat(u,f,d).sort(function(B,R){return B.index-R.index}).map(function(B){return{data:B.data,mode:B.mode,length:B.length}})}function y(b,c){switch(c){case n.NUMERIC:return i.getBitsLength(b);case n.ALPHANUMERIC:return e.getBitsLength(b);case n.KANJI:return r.getBitsLength(b);case n.BYTE:return a.getBitsLength(b)}}function m(b){return b.reduce(function(c,u){const f=c.length-1>=0?c[c.length-1]:null;return f&&f.mode===u.mode?(c[c.length-1].data+=u.data,c):(c.push(u),c)},[])}function _(b){const c=[];for(let u=0;u=0&&t<=6&&(l===0||l===6)||l>=0&&l<=6&&(t===0||t===6)||t>=2&&t<=4&&l>=2&&l<=4?o.set(r+t,s+l,!0,!0):o.set(r+t,s+l,!1,!0))}}function An(o){const n=o.size;for(let i=8;i>t&1)===1,o.set(a,r,s,!0),o.set(r,a,s,!0)}function Et(o,n,i){const e=o.size,a=En.getEncodedBits(n,i);let r,s;for(r=0;r<15;r++)s=(a>>r&1)===1,r<6?o.set(r,8,s,!0):r<8?o.set(r+1,8,s,!0):o.set(e-15+r,8,s,!0),r<8?o.set(8,e-r-1,s,!0):r<9?o.set(8,15-r-1+1,s,!0):o.set(8,15-r-1,s,!0);o.set(e-8,8,1,!0)}function Pn(o,n){const i=o.size;let e=-1,a=i-1,r=7,s=0;for(let t=i-1;t>0;t-=2)for(t===6&&t--;;){for(let l=0;l<2;l++)if(!o.isReserved(a,t-l)){let g=!1;s>>r&1)===1),o.set(a,t-l,g),r--,r===-1&&(s++,r=7)}if(a+=e,a<0||i<=a){a-=e,e=-e;break}}}function Nn(o,n,i){const e=new wn;i.forEach(function(l){e.put(l.mode.bit,4),e.put(l.getLength(),Sn.getCharCountIndicator(l.mode,o)),l.write(e)});const a=dt.getSymbolTotalCodewords(o),r=It.getTotalCodewordsCount(o,n),s=(a-r)*8;for(e.getLengthInBits()+4<=s&&e.put(0,4);e.getLengthInBits()%8!==0;)e.putBit(0);const t=(s-e.getLengthInBits())/8;for(let l=0;l=7&&Tn(l,n),Pn(l,s),isNaN(e)&&(e=At.getBestMask(l,Et.bind(null,l,i))),At.applyMask(e,l),Et(l,i,e),{modules:l,version:n,errorCorrectionLevel:i,maskPattern:e,segments:a}}re.create=function(n,i){if(typeof n>"u"||n==="")throw new Error("No input text");let e=Ct.M,a,r;return typeof i<"u"&&(e=Ct.from(i.errorCorrectionLevel,Ct.M),a=lt.from(i.version),r=At.from(i.maskPattern),i.toSJISFunc&&dt.setToSJISFunction(i.toSJISFunc)),Mn(n,a,e,r)};var we={},Mt={};(function(o){function n(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let e=i.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+i);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(r){return[r,r]}))),e.length===6&&e.push("F","F");const a=parseInt(e.join(""),16);return{r:a>>24&255,g:a>>16&255,b:a>>8&255,a:a&255,hex:"#"+e.slice(0,6).join("")}}o.getOptions=function(e){e||(e={}),e.color||(e.color={});const a=typeof e.margin>"u"||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,s=e.scale||4;return{width:r,scale:r?4:s,margin:a,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},o.getScale=function(e,a){return a.width&&a.width>=e+a.margin*2?a.width/(e+a.margin*2):a.scale},o.getImageWidth=function(e,a){const r=o.getScale(e,a);return Math.floor((e+a.margin*2)*r)},o.qrToImageData=function(e,a,r){const s=a.modules.size,t=a.modules.data,l=o.getScale(s,r),g=Math.floor((s+r.margin*2)*l),h=r.margin*l,A=[r.color.light,r.color.dark];for(let y=0;y=h&&m>=h&&y"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(g=e()),l=n.getOptions(l);const h=n.getImageWidth(r.modules.size,l),A=g.getContext("2d"),y=A.createImageData(h,h);return n.qrToImageData(y.data,r,l),i(A,g,h),A.putImageData(y,0,0),g},o.renderToDataURL=function(r,s,t){let l=t;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const g=o.render(r,s,l),h=l.type||"image/png",A=l.rendererOpts||{};return g.toDataURL(h,A.quality)}})(we);var ye={};const Dn=Mt;function oe(o,n){const i=o.a/255,e=n+'="'+o.hex+'"';return i<1?e+" "+n+'-opacity="'+i.toFixed(2).slice(1)+'"':e}function St(o,n,i){let e=o+n;return typeof i<"u"&&(e+=" "+i),e}function Rn(o,n,i){let e="",a=0,r=!1,s=0;for(let t=0;t0&&l>0&&o[t-1]||(e+=r?St("M",l+i,.5+g+i):St("m",a,0),a=0,r=!1),l+1':"",g="',h='viewBox="0 0 '+t+" "+t+'"',y=''+l+g+` `;return typeof e=="function"&&e(null,y),y};const Ln=je,Tt=re,be=we,Un=ye;function Dt(o,n,i,e,a){const r=[].slice.call(arguments,1),s=r.length,t=typeof r[s-1]=="function";if(!t&&!Ln())throw new Error("Callback required as last argument");if(t){if(s<2)throw new Error("Too few arguments provided");s===2?(a=i,i=n,n=e=void 0):s===3&&(n.getContext&&typeof a>"u"?(a=e,e=void 0):(a=e,e=i,i=n,n=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=n,n=e=void 0):s===2&&!n.getContext&&(e=i,i=n,n=void 0),new Promise(function(l,g){try{const h=Tt.create(i,e);l(o(h,n,e))}catch(h){g(h)}})}try{const l=Tt.create(i,e);a(null,o(l,n,e))}catch(l){a(l)}}W.create=Tt.create;W.toCanvas=Dt.bind(null,be.render);W.toDataURL=Dt.bind(null,be.renderToDataURL);W.toString=Dt.bind(null,function(o,n,i){return Un.render(o,i)});const vn=o=>(ze("data-v-10f00c06"),o=o(),Je(),o),kn={class:"container"},Vn={style:{"text-align":"center"}},$n=["src"],xn=vn(()=>G("br",null,null,-1)),On=["innerHTML"],Hn={name:"Sat"},zn=Be({...Hn,setup(o){const{loading:n,setLoading:i}=Ke(!0),e=Ce(),a=wt(null),r=wt(null),s=wt(null),t=Ae({uuid:"",qrcode:"",visible:!1,showHide:0,status:"\u70B9\u51FB\u5199\u5165\u6309\u94AE\u5199\u5165\u536B\u661F\u6570\u636E\u5230\u8BBE\u5907

",sat:"",satData:[],lng:0,lat:0,alt:0,tx:0,rx:0,txTone:0,rxTone:0,CTCSSOption:[67,69.3,71.9,74.4,77,79.7,82.5,85.4,88.5,91.5,94.8,97.4,100,103.5,107.2,110.9,114.8,118.8,123,127.3,131.8,136.5,141.3,146.2,151.4,156.7,159.8,162.2,165.5,167.9,171.3,173.8,177.3,179.9,183.5,186.2,189.9,192.8,196.6,199.5,203.5,206.5,210.7,218.1,225.7,229.1,233.6,241.8,250.3,254.1],pass:void 0,passOption:[],dt:"",timer:void 0,passCustom:void 0,dtCustom:void 0,freqDb:[]});Ie(async()=>{const c=await(await fetch("https://mirror.ghproxy.com/https://raw.githubusercontent.com/palewire/ham-satellite-database/main/data/amsat-active-frequencies.json")).text();t.freqDb=JSON.parse(c),t.lng=parseFloat(localStorage.getItem("myLng")||"0"),t.lat=parseFloat(localStorage.getItem("myLat")||"0"),t.alt=parseFloat(localStorage.getItem("myAlt")||"0"),await a.value.$forceUpdate(),await r.value.$forceUpdate(),await s.value.$forceUpdate(),t.lng=parseFloat(a.value.inputRef.modelValue||"0"),t.lat=parseFloat(r.value.inputRef.modelValue||"0"),t.alt=parseFloat(s.value.inputRef.modelValue||"0"),t.timer=setInterval(()=>{t.dt=new Date().toLocaleString("zh-CN",{timeZone:"Asia/Shanghai"}),localStorage.setItem("myLng",t.lng.toString()),localStorage.setItem("myLat",t.lat.toString()),localStorage.setItem("myAlt",t.alt.toString())},1e3)}),Te(()=>{try{clearInterval(t.timer)}catch{}});const l=async()=>{if(e.connectState!=!0){alert(sessionStorage.getItem("noticeConnectK5"));return}i(!0),await yt(e.connectPort),await g(),await te(e.connectPort),i(!1)},g=async()=>{var f;const c=t.dtCustom?new Date(t.dtCustom):new Date,u=[...I(parseInt(c.getFullYear().toString().substring(2,4)).toString(16)),...I((c.getMonth()+1).toString(16)),...I(c.getDate().toString(16)),...I(c.getHours().toString(16)),...I(c.getMinutes().toString(16)),...I(c.getSeconds().toString(16))];await F(e.connectPort,11200,new Uint8Array(u),6,(f=e.configuration)==null?void 0:f.uart)},h=async c=>{const u=t.satData.find(f=>f.name==c);if(u&&u.path){t.status+="
\u536B\u661F\u53C2\u6570\uFF1A
",u.path.map(d=>{t.status+=d+"
"});let f=!1;t.freqDb.map(d=>{u.path[1].split(" ")[1]==d.norad_id&&d.mode.indexOf("FM")!=-1&&(console.log(d),f=!0,t.tx=d.uplink?parseFloat(d.uplink.split("/")[0]):0,t.rx=d.downlink?parseFloat(d.downlink.split("/")[0]):0,t.txTone=parseFloat([0,...t.CTCSSOption].reduce((p,B)=>d.mode.indexOf(B)!=-1?B:p)))}),f||(t.tx=0,t.rx=0,t.txTone=0,t.rxTone=0)}Xt(()=>{const f=document==null?void 0:document.getElementById("statusArea");f&&(f.scrollTop=f==null?void 0:f.scrollHeight)})};(async()=>{i(!0);const u=(await(await fetch("https://celestrak.org/NORAD/elements/amateur.txt")).text()).split(/\r?\n/),f=[];let d={};for(let p=0;p{i(!0),navigator.geolocation.getCurrentPosition(c=>{c.coords&&(t.lat=c.coords.latitude,t.lng=c.coords.longitude,c.coords.altitude&&(t.alt=c.coords.altitude))}),i(!1)};y();const m=async()=>{t.visible=!0,t.uuid=crypto.randomUUID(),t.qrcode=await W.toDataURL(location.origin+"/#/satloc?uuid="+t.uuid,{width:250}),console.log(t.uuid)},_=async()=>{const c=await(await fetch("https://k5.vicicode.cn/api/lol",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({func:1,uuid:t.uuid})})).json(),u=JSON.parse(c.cache);u.length>=3&&(t.lng=u[0],t.lat=u[1],t.alt=u[2])},E=async(c=0,u)=>{var f;await yt(e.connectPort);for(let d=c;d",Xt(()=>{const p=document==null?void 0:document.getElementById("statusArea");p&&(p.scrollTop=p==null?void 0:p.scrollHeight)});t.status=t.status+"\u5199\u5165\u8FDB\u5EA6\uFF1A100.0%
"},T=async()=>{if(!t.sat){alert("\u8BF7\u9009\u62E9\u536B\u661F\uFF01");return}i(!0);const c=await(await fetch("https://k5.vicicode.cn/api/pass",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({sat:t.sat,sat_line_1:t.satData.find(f=>f.name==t.sat).path[0],sat_line_2:t.satData.find(f=>f.name==t.sat).path[1],lat:t.lat,lng:t.lng,alt:t.alt})})).json(),u=[];for(let f=0;f0?d=[c.pass_times[f],c.departure_times[f]]:d=[c.pass_times[f],c.departure_times[f+1]],u.push(d)}catch{}u.length>0?t.pass=u[0][0]+"|"+u[0][1]:t.pass=void 0,t.passOption=u,i(!1)},b=async()=>{var w,Rt,Lt,Ut,vt,kt,Vt,$t,xt,Ot,Ht,zt,Jt,Yt,Kt,jt,qt,Gt;if(e.connectState!=!0){alert(sessionStorage.getItem("noticeConnectK5"));return}if(((w=e.configuration)==null?void 0:w.sat)!=!0){alert(sessionStorage.getItem("noticeVersionNoSupport"));return}if(!t.sat){alert("\u8BF7\u9009\u62E9\u536B\u661F\uFF01");return}if(t.passCustom&&(t.pass=t.passCustom[0]+"|"+t.passCustom[1]),!t.pass){alert("\u8BF7\u9009\u62E9\u8FC7\u5883\u65F6\u95F4\uFF01");return}i(!0);const c=await(await fetch("https://k5.vicicode.cn/api/doppler",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({sat:t.sat,sat_line_1:t.satData.find(z=>z.name==t.sat).path[0],sat_line_2:t.satData.find(z=>z.name==t.sat).path[1],lat:t.lat,lng:t.lng,alt:t.alt,tx:t.tx,rx:t.rx,pass_time:t.pass.split("|")[0],departure_time:t.pass.split("|")[1]})})).json(),u=t.sat,f=t.pass.split("|")[0],d=f.split("-")[0].substring(2,4),p=f.split("-")[1],B=f.split("-")[2].split(" ")[0],R=f.split(" ")[1].split(":")[0],M=f.split(" ")[1].split(":")[1],D=f.split(" ")[1].split(":")[2],P=t.pass.split("|")[1],V=P.split("-")[0].substring(2,4),U=P.split("-")[1],gt=P.split("-")[2].split(" ")[0],ht=P.split(" ")[1].split(":")[0],pt=P.split(" ")[1].split(":")[1],mt=P.split(" ")[1].split(":")[2];await yt(e.connectPort);let N=new Uint8Array(10);N.set(Ye(u.trim()).subarray(0,9)),await F(e.connectPort,11168,N,10,(Rt=e.configuration)==null?void 0:Rt.uart),await F(e.connectPort,11178,I(parseInt(d).toString(16)).subarray(0,1),1,(Lt=e.configuration)==null?void 0:Lt.uart),await F(e.connectPort,11179,I(parseInt(p).toString(16)).subarray(0,1),1,(Ut=e.configuration)==null?void 0:Ut.uart),await F(e.connectPort,11180,I(parseInt(B).toString(16)).subarray(0,1),1,(vt=e.configuration)==null?void 0:vt.uart),await F(e.connectPort,11181,I(parseInt(R).toString(16)).subarray(0,1),1,(kt=e.configuration)==null?void 0:kt.uart),await F(e.connectPort,11182,I(parseInt(M).toString(16)).subarray(0,1),1,(Vt=e.configuration)==null?void 0:Vt.uart),await F(e.connectPort,11183,I(parseInt(D).toString(16)).subarray(0,1),1,($t=e.configuration)==null?void 0:$t.uart),await F(e.connectPort,11184,I(parseInt(V).toString(16)).subarray(0,1),1,(xt=e.configuration)==null?void 0:xt.uart),await F(e.connectPort,11185,I(parseInt(U).toString(16)).subarray(0,1),1,(Ot=e.configuration)==null?void 0:Ot.uart),await F(e.connectPort,11186,I(parseInt(gt).toString(16)).subarray(0,1),1,(Ht=e.configuration)==null?void 0:Ht.uart),await F(e.connectPort,11187,I(parseInt(ht).toString(16)).subarray(0,1),1,(zt=e.configuration)==null?void 0:zt.uart),await F(e.connectPort,11188,I(parseInt(pt).toString(16)).subarray(0,1),1,(Jt=e.configuration)==null?void 0:Jt.uart),await F(e.connectPort,11189,I(parseInt(mt).toString(16)).subarray(0,1),1,(Yt=e.configuration)==null?void 0:Yt.uart),N=new Uint8Array(2),N.set(I(((Date.parse(P)-Date.parse(f))/1e3).toString(16)).subarray(0,2)),await F(e.connectPort,11190,N,2,(Kt=e.configuration)==null?void 0:Kt.uart),N=new Uint8Array(2),t.txTone&&t.txTone>0&&N.set(I(parseInt((t.txTone*10).toFixed(0)).toString(16)).subarray(0,2)),await F(e.connectPort,11192,N,2,(jt=e.configuration)==null?void 0:jt.uart),N=new Uint8Array(2),t.rxTone&&t.rxTone>0&&N.set(I(parseInt((t.rxTone*10).toFixed(0)).toString(16)).subarray(0,2)),await F(e.connectPort,11194,N,2,(qt=e.configuration)==null?void 0:qt.uart),N=new Uint8Array(4),N.set(I(((Date.parse(f)-Date.parse("2000-01-01 00:00:00"))/1e3).toString(16)).subarray(0,4)),await F(e.connectPort,11196,N,4,(Gt=e.configuration)==null?void 0:Gt.uart);const tt=[];c.shift_array.filter((z,et)=>et%2===0).map(z=>{const et=new Uint8Array(4),Qt=new Uint8Array(4);et.set(I(parseInt(((t.tx*1e6+z[0])/10).toFixed(0)).toString(16))),Qt.set(I(parseInt(((t.rx*1e6+z[1])/10).toFixed(0)).toString(16))),tt.push(...et,...Qt)}),N=new Uint8Array(7680),N.set(new Uint8Array(tt).subarray(0,7680)),await E(123392,N),await g(),await te(e.connectPort),i(!1)};return(c,u)=>{const f=Le,d=_e,p=Ue,B=Pe,R=Ee,M=ve,D=Ne,P=Fe,V=ke,U=Ve,gt=$e,ht=xe,pt=Me,mt=De,N=Oe,tt=He;return x(),q("div",kn,[C(f,{visible:t.visible,"onUpdate:visible":u[0]||(u[0]=w=>t.visible=w),onOk:_,"ok-text":c.$t("tool.scaned")},{title:S(()=>[L(v(c.$t("tool.scanqr")),1)]),default:S(()=>[G("div",Vn,[G("img",{src:t.qrcode},null,8,$n),xn,L(" "+v(c.$t("tool.scannotice")),1)])]),_:1},8,["visible","ok-text"]),C(d,{items:[c.$t("menu.list"),c.$t("menu.satellite")]},null,8,["items"]),C(tt,{gutter:20,align:"stretch"},{default:S(()=>[C(N,{span:24},{default:S(()=>[C(mt,{class:"general-card",title:c.$t("menu.satellite")+c.$t("global.onStart")},{default:S(()=>[C(pt,{loading:Re(n),style:{width:"100%"},tip:"\u6B63\u5728\u5904\u7406 ..."},{default:S(()=>[C(p,{"label-col-style":{width:"25%"},field:"dt",label:c.$t("tool.brtime"),onClick:u[1]||(u[1]=()=>{t.showHide+=1})},{default:S(()=>[L(v(t.dt),1)]),_:1},8,["label"]),Zt(C(p,{"label-col-style":{width:"25%"},field:"dtCustom",label:"\u81EA\u5B9A\u4E49\u65F6\u95F4"},{default:S(()=>[G("div",null,[C(B,{style:{width:"220px",margin:"0 24px 24px 0"},"show-time":"","time-picker-props":{defaultValue:"00:00:00"},format:"YYYY-MM-DD HH:mm:ss",modelValue:t.dtCustom,"onUpdate:modelValue":u[2]||(u[2]=w=>t.dtCustom=w)},null,8,["modelValue"]),L(" \xA0\xA0"),C(R,{size:"small",theme:"success",onClick:l},{default:S(()=>[L("\u5199\u5165\u65F6\u95F4\u5230\u53F0\u7AD9")]),_:1})])]),_:1},512),[[Wt,t.showHide>=5]]),C(p,{"label-col-style":{width:"25%"},field:"sat",label:c.$t("tool.selectSatellite")},{default:S(()=>[C(D,{modelValue:t.sat,"onUpdate:modelValue":u[3]||(u[3]=w=>t.sat=w),onChange:h,placeholder:c.$t("tool.selectSatellite")+"...","allow-search":"","allow-clear":""},{default:S(()=>[(x(!0),q(nt,null,ot(t.satData,w=>(x(),rt(M,{key:w.name,value:w.name},{default:S(()=>[L(v(w.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},field:"lng",label:c.$t("tool.longitude")},{default:S(()=>[C(P,{ref_key:"lngRef",ref:a,precision:6,modelValue:t.lng,"onUpdate:modelValue":u[4]||(u[4]=w=>t.lng=w)},null,8,["modelValue"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},field:"lat",label:c.$t("tool.latitude")},{default:S(()=>[C(P,{ref_key:"latRef",ref:r,precision:6,modelValue:t.lat,"onUpdate:modelValue":u[5]||(u[5]=w=>t.lat=w)},null,8,["modelValue"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},field:"alt",label:c.$t("tool.altitude")},{default:S(()=>[C(P,{ref_key:"altRef",ref:s,precision:0,modelValue:t.alt,"onUpdate:modelValue":u[6]||(u[6]=w=>t.alt=w)},null,8,["modelValue"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},label:""},{default:S(()=>[C(U,null,{default:S(()=>[C(V,{onClick:y},{default:S(()=>[L(v(c.$t("tool.brlonlat")),1)]),_:1}),C(V,{onClick:m},{default:S(()=>[L(v(c.$t("tool.phonelonlat")),1)]),_:1}),C(V,{type:"primary",onClick:T},{default:S(()=>[L(v(c.$t("tool.satpasstime")),1)]),_:1})]),_:1})]),_:1}),C(p,{"label-col-style":{width:"25%"},field:"pass",label:c.$t("tool.selectPassTime")},{default:S(()=>[C(D,{modelValue:t.pass,"onUpdate:modelValue":u[7]||(u[7]=w=>t.pass=w),"allow-search":"","allow-clear":""},{default:S(()=>[(x(!0),q(nt,null,ot(t.passOption,w=>(x(),rt(M,{key:w[0]+"|"+w[1],value:w[0]+"|"+w[1]},{default:S(()=>[L(v(w[0]+" - "+w[1]),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),Zt(C(p,{"label-col-style":{width:"25%"},field:"passCustom",label:"\u81EA\u5B9A\u4E49\u8FC7\u5883\u65F6\u95F4"},{default:S(()=>[C(gt,{style:{width:"360px",margin:"0 24px 24px 0"},"show-time":"","time-picker-props":{defaultValue:["00:00:00","00:00:00"]},format:"YYYY-MM-DD HH:mm:ss",modelValue:t.passCustom,"onUpdate:modelValue":u[8]||(u[8]=w=>t.passCustom=w)},null,8,["modelValue"])]),_:1},512),[[Wt,t.showHide>=5]]),C(p,{"label-col-style":{width:"25%"},field:"tx",label:c.$t("tool.txFreq")},{default:S(()=>[C(P,{precision:5,modelValue:t.tx,"onUpdate:modelValue":u[9]||(u[9]=w=>t.tx=w)},null,8,["modelValue"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},field:"txTone",label:c.$t("tool.txTone")},{default:S(()=>[C(D,{modelValue:t.txTone,"onUpdate:modelValue":u[10]||(u[10]=w=>t.txTone=w),"allow-search":"","allow-clear":""},{default:S(()=>[C(M,{value:0},{default:S(()=>[L(v(c.$t("tool.off")),1)]),_:1}),(x(!0),q(nt,null,ot(t.CTCSSOption,w=>(x(),rt(M,{key:w,value:w},{default:S(()=>[L(v(w.toFixed(1)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},field:"rx",label:c.$t("tool.rxFreq")},{default:S(()=>[C(P,{precision:5,modelValue:t.rx,"onUpdate:modelValue":u[11]||(u[11]=w=>t.rx=w)},null,8,["modelValue"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},field:"rxTone",label:c.$t("tool.rxTone")},{default:S(()=>[C(D,{modelValue:t.rxTone,"onUpdate:modelValue":u[12]||(u[12]=w=>t.rxTone=w),"allow-search":"","allow-clear":""},{default:S(()=>[C(M,{value:0},{default:S(()=>[L(v(c.$t("tool.off")),1)]),_:1}),(x(!0),q(nt,null,ot(t.CTCSSOption,w=>(x(),rt(M,{key:w,value:w},{default:S(()=>[L(v(w.toFixed(1)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),C(p,{"label-col-style":{width:"25%"},label:""},{default:S(()=>[C(V,{type:"primary",onClick:b},{default:S(()=>[L(v(c.$t("tool.writeData")),1)]),_:1})]),_:1}),C(ht),G("div",{id:"statusArea",style:{height:"20em","background-color":"azure",color:"silver",overflow:"auto",padding:"20px"},innerHTML:t.status},null,8,On)]),_:1},8,["loading"])]),_:1},8,["title"])]),_:1})]),_:1})])}}});const io=Se(zn,[["__scopeId","data-v-10f00c06"]]);export{io as default};