import{d as h,O as m,o as b,a as g,g as s,L as c}from"./index-6ef77773.js";const y="_download_1muwj_1",A="_center_1muwj_8",_="_btn_1muwj_15",C="_wxpopup_1muwj_21",i={download:y,center:A,btn:_,wxpopup:C},U=""+new URL("center-d0317ec4.png",import.meta.url).href,B=""+new URL("btn-bg-57116e79.png",import.meta.url).href,F=""+new URL("wx_bg-214fe502.png",import.meta.url).href,S=typeof atob=="function",l=typeof Buffer=="function",u=typeof TextDecoder=="function"?new TextDecoder:void 0;typeof TextEncoder=="function"&&new TextEncoder;const D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",T=Array.prototype.slice.call(D),d=(t=>{let e={};return t.forEach((o,n)=>e[o]=n),e})(T),E=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,r=String.fromCharCode.bind(String),p=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),x=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),v=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),o=e-65536;return r((o>>>10)+55296)+r((o&1023)+56320);case 3:return r((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return r((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},P=t=>t.replace(v,L),j=t=>{if(t=t.replace(/\s+/g,""),!E.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,o="",n,f;for(let a=0;a<t.length;)e=d[t.charAt(a++)]<<18|d[t.charAt(a++)]<<12|(n=d[t.charAt(a++)])<<6|(f=d[t.charAt(a++)]),o+=n===64?r(e>>16&255):f===64?r(e>>16&255,e>>8&255):r(e>>16&255,e>>8&255,e&255);return o},w=S?t=>atob(x(t)):l?t=>Buffer.from(t,"base64").toString("binary"):j,z=l?t=>p(Buffer.from(t,"base64")):t=>p(w(t).split("").map(e=>e.charCodeAt(0))),O=l?t=>Buffer.from(t,"base64").toString("utf8"):u?t=>u.decode(z(t)):t=>P(w(t)),R=t=>x(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),Z=t=>O(R(t)),I=h({name:"download-page",setup(){const t=m({wxStatus:!1,type:"student",androidUrl:"",buttonText:"下载学校端"}),e=()=>{if(c().weixin){t.wxStatus=!0;return}let o="",n="";location.origin.indexOf("manonline")>-1||location.origin.indexOf("https://gym.lexiaoya.cn")>-1?(o="https://itunes.apple.com/cn/app/id6449429354",n=t.androidUrl):(o="https://www.pgyer.com/gnTDCk",n=t.androidUrl),c().ios||/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)?o&&(window.location.href=o):window.location.href=n};return b(async()=>{try{const{data:o}=await g.get("/api-web/open/appVersionInfo/queryLatestByPlatform",{params:{platform:"android-education",status:"history"}});t.androidUrl=Z(o.downloadUrl)}catch(o){}}),()=>s("div",{class:i.download},[s("img",{src:U,class:i.center},null),s("img",{src:B,class:i.btn,onClick:e},null),t.wxStatus&&s("div",{class:i.wxpopup,onClick:()=>{t.wxStatus=!1}},[s("img",{src:F,alt:""},null)])])}});export{I as default};
