Files
Snigdha-OS.github.io/assets/Download-DWvMFQZR.js
eshanized 73116ce707 Updates
2024-12-27 22:05:44 +05:30

9 lines
11 KiB
JavaScript

import{c as y,j as e,D as g,r as l,f as j,a as N}from"../main.js";import{m}from"./proxy-DPp9lXkG.js";import{C as S}from"./check-GdsoDH1T.js";import{S as v,G as k,W as p}from"./wifi-CD8OR96J.js";import{M}from"./map-pin-FndLqqsR.js";/**
* @license lucide-react v0.344.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h=y("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);function C({version:s,size:r,url:a}){return e.jsxs(m.a,{href:a,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.98},className:"flex items-center justify-between w-full p-4 bg-gradient-to-r from-cornflower-blue/10 to-white rounded-lg border border-gray-200 hover:border-cornflower-blue transition-all duration-300 ease-in-out transform hover:scale-105 focus:ring-2 focus:ring-cornflower-blue focus:outline-none","aria-label":`Download Snigdha OS ${s} - ${r}`,children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:["Snigdha OS ",s]}),e.jsx("p",{className:"text-sm text-gray-500",children:r})]}),e.jsx(g,{className:"h-6 w-6 text-cornflower-blue"})]})}const E=["Minimum 2GB RAM (4GB recommended)","20GB disk space","CPU with virtualization support","DVD drive / USB boot support","Internet connectivity for updates"];function G(){return e.jsxs("div",{className:"bg-white/80 backdrop-blur-sm p-6 rounded-lg",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"System Requirements"}),e.jsx("ul",{className:"space-y-3",children:E.map(s=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-5 w-5 text-green-500 flex-shrink-0"}),e.jsx("span",{className:"text-gray-600",children:s})]},s))})]})}function L({sha256:s,gpg:r}){const[a,t]=l.useState(null),n=(i,c)=>{navigator.clipboard.writeText(i).then(()=>{t(c),setTimeout(()=>t(null),2e3)})};return e.jsxs("div",{className:"bg-white/90 backdrop-blur-sm p-8 rounded-lg shadow-lg max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(v,{className:"h-6 w-6 text-cornflower-blue"}),e.jsx("h2",{className:"text-2xl font-extrabold text-gray-900",children:"Verify Download"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"SHA256 Checksum"}),e.jsx("code",{className:"block p-3 bg-gray-50 rounded-lg text-sm break-all text-gray-800 border border-gray-200",children:s})]}),e.jsxs("button",{onClick:()=>n(s,"sha256"),className:"ml-3 p-2 text-cornflower-blue hover:bg-gray-100 rounded-lg transition","aria-label":"Copy SHA256 checksum",children:[e.jsx(h,{className:"h-5 w-5"}),a==="sha256"&&e.jsx("span",{className:"text-xs text-green-500 ml-2",children:"Copied!"})]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"GPG Signature"}),e.jsx("code",{className:"block p-3 bg-gray-50 rounded-lg text-sm break-all text-gray-800 border border-gray-200",children:r})]}),e.jsxs("button",{onClick:()=>n(r,"gpg"),className:"ml-3 p-2 text-cornflower-blue hover:bg-gray-100 rounded-lg transition","aria-label":"Copy GPG signature",children:[e.jsx(h,{className:"h-5 w-5"}),a==="gpg"&&e.jsx("span",{className:"text-xs text-green-500 ml-2",children:"Copied!"})]})]})]})]})}function T({mirrors:s,onSelect:r}){return e.jsx("div",{className:"space-y-4",children:s.map((a,t)=>e.jsx(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:t*.1},className:"bg-white/80 backdrop-blur-sm p-4 rounded-lg border border-gray-200 hover:border-cornflower-blue transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{className:"h-5 w-5 text-cornflower-blue"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-gray-900",children:a.name}),e.jsx("p",{className:"text-sm text-gray-500",children:a.location})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1 text-sm text-gray-600",children:[e.jsx(p,{className:"h-4 w-4"}),j(a.speed)]}),e.jsxs("button",{onClick:()=>r(a),className:"flex items-center gap-2 px-4 py-2 bg-cornflower-blue text-white rounded-lg hover:bg-blue-600 transition-colors",children:[e.jsx(g,{className:"h-4 w-4"}),"Select"]})]})]})},a.id))})}function B({speed:s}){const r=t=>t>=100?"Excellent for fast downloads":t>=50?"Good for normal downloads":t>=20?"Moderate speed, downloads may take longer":"Slow connection, consider using a different mirror",a=t=>t>=100?"text-green-500":t>=50?"text-blue-500":t>=20?"text-yellow-500":"text-red-500";return e.jsxs("div",{className:"bg-white/90 backdrop-blur-lg p-8 rounded-xl shadow-lg hover:scale-105 transform transition-all",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx(p,{className:"h-7 w-7 text-cornflower-blue"}),e.jsx("h2",{className:"text-2xl font-extrabold text-gray-900",children:"Network Speed"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs("span",{className:`text-4xl font-bold ${a(s)}`,children:[s," Mbps"]})}),e.jsx("p",{className:"text-lg text-gray-700",children:r(s)})]}),e.jsx("div",{className:"mt-6 flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`font-medium ${a(s)}`,children:"Speed Quality:"}),e.jsx("span",{className:`${a(s)} font-semibold`,children:s>=100?"Excellent":s>=50?"Good":s>=20?"Moderate":"Poor"})]})})]})}function D({mirror:s,userLocation:r,onSelect:a}){return e.jsxs("div",{className:"bg-white/90 backdrop-blur-lg p-6 rounded-lg shadow-lg border-2 border-cornflower-blue hover:shadow-xl transition-shadow",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-5",children:[e.jsx(M,{className:"h-6 w-6 text-cornflower-blue"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-semibold text-gray-900",children:"Suggested Mirror"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Based on your location: ",r.city,", ",r.country]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"font-semibold text-gray-900 text-lg",children:s.name}),e.jsx("p",{className:"text-sm text-gray-600",children:s.location}),e.jsx("button",{onClick:()=>a(s),className:"w-full mt-4 px-5 py-3 bg-cornflower-blue text-white rounded-lg hover:bg-blue-600 transition-colors ease-in-out",children:"Use This Mirror"})]})]})}const A=[{version:"Arctic V",size:"1.4 GB",url:"https://snigdhaos.org/downloads/snigdhaos-2024.1-installer-amd64.iso",sha256:"e4654e5633f4e1f8f57a9fb3dca02f9db06e9acb5e346f0fae9d9f5c3a9c0e9",gpg:`-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
...`}],P=[{id:"us-east",name:"US East Mirror",location:"New York, USA 🇺🇸",url:"https://mirror-east.snigdhaos.org",speed:120},{id:"eu-central",name:"EU Central Mirror",location:"Frankfurt, Germany 🇩🇪",url:"https://mirror-eu.snigdhaos.org",speed:100},{id:"asia-east",name:"Asia East Mirror",location:"Singapore 🇸🇬",url:"https://mirror-asia.snigdhaos.org",speed:80},{id:"uk-london",name:"UK London Mirror",location:"London, United Kingdom 🇬🇧",url:"https://mirror-uk.snigdhaos.org",speed:95},{id:"india-bangalore",name:"India Bangalore Mirror",location:"Bangalore, India 🇮🇳",url:"https://mirror-india.snigdhaos.org",speed:75},{id:"australia-sydney",name:"Australia Sydney Mirror",location:"Sydney, Australia 🇦🇺",url:"https://mirror-aus.snigdhaos.org",speed:85},{id:"canada-toronto",name:"Canada Toronto Mirror",location:"Toronto, Canada 🇨🇦",url:"https://mirror-canada.snigdhaos.org",speed:110},{id:"brazil-sao-paulo",name:"Brazil São Paulo Mirror",location:"São Paulo, Brazil 🇧🇷",url:"https://mirror-brazil.snigdhaos.org",speed:60},{id:"japan-tokyo",name:"Japan Tokyo Mirror",location:"Tokyo, Japan 🇯🇵",url:"https://mirror-japan.snigdhaos.org",speed:90},{id:"south-korea-seoul",name:"South Korea Seoul Mirror",location:"Seoul, South Korea 🇰🇷",url:"https://mirror-korea.snigdhaos.org",speed:95},{id:"south-africa-cape-town",name:"South Africa Cape Town Mirror",location:"Cape Town, South Africa 🇿🇦",url:"https://mirror-sa.snigdhaos.org",speed:50}];async function U(){const s=performance.now(),r=await fetch("https://www.cloudflare.com/cdn-cgi/trace",{cache:"no-store"}),t=performance.now()-s;if(!r.ok)throw new Error("Failed to measure network speed");const n=await r.text(),c=new Blob([n]).size*8/(t/1e3)/1e6;return Math.round(c*100)/100}function z(){const[s,r]=l.useState(null),[a,t]=l.useState(!0),[n,i]=l.useState(null);return l.useEffect(()=>{async function c(){try{const o=await U();r(o)}catch(o){i(o instanceof Error?o:new Error("Failed to measure network speed"))}finally{t(!1)}}c()},[]),{speed:s,isLoading:a,error:n}}async function I(){const s=await fetch("https://ipapi.co/json/");if(!s.ok)throw new Error("Failed to fetch location");const r=await s.json();return{country:r.country_name,city:r.city,continent:r.continent_code}}function R(){const[s,r]=l.useState(null),[a,t]=l.useState(!0),[n,i]=l.useState(null);return l.useEffect(()=>{async function c(){try{const o=await I();r(o)}catch(o){i(o instanceof Error?o:new Error("Failed to get location"))}finally{t(!1)}}c()},[]),{location:s,isLoading:a,error:n}}function O(){const s=A[0],[r,a]=l.useState(null),{speed:t,isLoading:n}=z(),{location:i,isLoading:c}=R(),o=d=>{a(d)},x=[...P].sort((d,f)=>{if(!t)return 0;const b=Math.abs(d.speed-t),w=Math.abs(f.speed-t);return b-w}),u=i?x[0]:null;return n||c?e.jsx("div",{className:"min-h-[50vh] flex items-center justify-center",children:e.jsx(N,{className:"h-8 w-8 animate-spin text-cornflower-blue"})}):e.jsx("div",{className:"py-12",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-12",children:[e.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Download Snigdha OS"}),e.jsx("p",{className:"mt-4 text-lg text-gray-600",children:"Get the latest version of the most advanced penetration testing distribution"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsx(C,{...s}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:"Download Mirrors"}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Mirrors are sorted by compatibility with your connection speed for optimal download performance"}),e.jsx(T,{mirrors:x,onSelect:o})]}),e.jsx(L,{sha256:s.sha256,gpg:s.gpg})]}),e.jsxs("div",{className:"space-y-6",children:[t!==null&&e.jsx(B,{speed:t}),i&&u&&e.jsx(D,{mirror:u,userLocation:i,onSelect:o}),e.jsx(G,{})]})]})]})})}export{O as default};