├── docker ├── bare-server │ ├── .dockerignore │ ├── Dockerfile │ ├── package.json │ ├── index.js │ └── package-lock.json ├── caddy │ └── Caddyfile └── docker-compose.yaml ├── images ├── logo.png ├── banner.ai ├── banner.png ├── favicon.ico ├── apple-icon-180.png ├── manifest-icon-192.maskable.png ├── manifest-icon-512.maskable.png ├── logo.svg └── banner.svg ├── replit.nix ├── .replit ├── static ├── public │ ├── favicon.ico │ ├── assets │ │ ├── icons │ │ │ ├── apple-icon-180.png │ │ │ ├── manifest-icon-192.maskable.png │ │ │ └── manifest-icon-512.maskable.png │ │ ├── screenshots │ │ │ └── screenshot.png │ │ ├── announcement.json │ │ └── manifest.json │ ├── uv.js │ ├── js │ │ ├── uv │ │ │ ├── uv.config.js │ │ │ ├── uv.sw.js │ │ │ └── uv.handler.js │ │ ├── register-uv.js │ │ ├── sw.js │ │ └── index.js │ ├── pages │ │ ├── about.html │ │ ├── tos.html │ │ └── privacy-policy.html │ ├── arc-sw.js │ ├── index.html │ └── index.css ├── tailwind.config.js ├── src │ └── input.css └── construction │ ├── index.html │ └── index.css ├── render.yaml ├── app.json ├── package.json ├── README.md ├── src └── index.js └── LICENSE /docker/bare-server/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/images/logo.png -------------------------------------------------------------------------------- /replit.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | deps = [ 3 | pkgs.nodejs-16_x 4 | ]; 5 | } -------------------------------------------------------------------------------- /.replit: -------------------------------------------------------------------------------- 1 | entrypoint = "README.md" 2 | language = "nodejs" 3 | run = ["npm", "start"] -------------------------------------------------------------------------------- /images/banner.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/images/banner.ai -------------------------------------------------------------------------------- /images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/images/banner.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/images/favicon.ico -------------------------------------------------------------------------------- /images/apple-icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/images/apple-icon-180.png -------------------------------------------------------------------------------- /static/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/static/public/favicon.ico -------------------------------------------------------------------------------- /images/manifest-icon-192.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/images/manifest-icon-192.maskable.png -------------------------------------------------------------------------------- /images/manifest-icon-512.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/images/manifest-icon-512.maskable.png -------------------------------------------------------------------------------- /static/public/assets/icons/apple-icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/static/public/assets/icons/apple-icon-180.png -------------------------------------------------------------------------------- /static/public/assets/screenshots/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/static/public/assets/screenshots/screenshot.png -------------------------------------------------------------------------------- /docker/caddy/Caddyfile: -------------------------------------------------------------------------------- 1 | CHANGE.TO.YOUR.DOMAIN { 2 | root * /static 3 | reverse_proxy /bare/* bare-server:8080 4 | file_server 5 | } -------------------------------------------------------------------------------- /render.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | - type: web 3 | name: elixir 4 | env: node 5 | buildCommand: npm install 6 | startCommand: npm start 7 | -------------------------------------------------------------------------------- /static/public/assets/icons/manifest-icon-192.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/static/public/assets/icons/manifest-icon-192.maskable.png -------------------------------------------------------------------------------- /static/public/assets/icons/manifest-icon-512.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whos-evan/elixir/HEAD/static/public/assets/icons/manifest-icon-512.maskable.png -------------------------------------------------------------------------------- /static/public/uv.js: -------------------------------------------------------------------------------- 1 | importScripts('/js/uv/uv.bundle.js'); 2 | importScripts('/js/uv/uv.config.js'); 3 | importScripts('/js/uv/uv.sw.js'); 4 | 5 | const sw = new UVServiceWorker(); 6 | 7 | self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event))); 8 | -------------------------------------------------------------------------------- /docker/bare-server/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:current-slim 2 | 3 | WORKDIR /usr/src/app 4 | COPY package*.json ./ 5 | 6 | RUN npm install 7 | RUN npm ci --only=production --omit=dev 8 | 9 | COPY . . 10 | 11 | EXPOSE 8080 12 | 13 | CMD [ "node", "index.js" ] 14 | -------------------------------------------------------------------------------- /static/public/js/uv/uv.config.js: -------------------------------------------------------------------------------- 1 | self.__uv$config = { 2 | prefix: '/service/', 3 | bare: '/bare/', 4 | encodeUrl: Ultraviolet.codec.xor.encode, 5 | decodeUrl: Ultraviolet.codec.xor.decode, 6 | handler: '/js/uv/uv.handler.js', 7 | bundle: '/js/uv/uv.bundle.js', 8 | config: '/js/uv/uv.config.js', 9 | sw: '/js/uv/uv.sw.js', 10 | }; 11 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Elixir Proxy", 3 | "description": "Ultraviolet proxy ultiziing Ultraviolet and bare-server", 4 | "repository": "https://github.com/whos-evan/elixir", 5 | "logo": "https://github.com/whos-evan/elixir/blob/c4fbe8e87fb0567e041db20391da36e1b64b0151/images/favicon.ico", 6 | "keywords": ["node", "elixir", "ultraviolet", "bare-server"] 7 | } -------------------------------------------------------------------------------- /static/public/js/register-uv.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Global util 4 | * Used in index.html 5 | */ 6 | async function registerSW() { 7 | if (!navigator.serviceWorker) 8 | throw new Error("Your browser doesn't support service workers."); 9 | 10 | await navigator.serviceWorker.register("../js/uv.js", { 11 | scope: __uv$config.prefix, 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /docker/bare-server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bare-server", 3 | "version": "1.2.2", 4 | "description": "bare-server-node in docker", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "node index.js" 8 | }, 9 | "keywords": [ 10 | "bare-server-node" 11 | ], 12 | "author": "", 13 | "license": "ISC", 14 | "type": "module", 15 | "dependencies": { 16 | "@tomphttp/bare-server-node": "^1.2.2" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /static/public/js/sw.js: -------------------------------------------------------------------------------- 1 | var cacheName = 'elixir'; 2 | var filesToCache = [ 3 | '/js/sw.js' 4 | ]; 5 | 6 | self.addEventListener('install', function(e) { 7 | e.waitUntil( 8 | caches.open(cacheName).then(function(cache) { 9 | return cache.addAll(filesToCache); 10 | }) 11 | ); 12 | self.skipWaiting(); 13 | }); 14 | 15 | self.addEventListener('fetch', function(e) { 16 | e.respondWith( 17 | caches.match(e.request).then(function(response) { 18 | return response || fetch(e.request); 19 | }) 20 | ); 21 | }); -------------------------------------------------------------------------------- /static/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | content: { 3 | relative: true, 4 | files: ['./public/index.html', './public/about.html'], 5 | // files: ['./construction/index.html'] 6 | }, 7 | theme: { 8 | extend: { 9 | darkMode: true, 10 | fontFamily: { 11 | 'Inter': ['Inter', 'sans-serif'] 12 | }, 13 | colors: { 14 | 'primary': '#0d2c4c', 15 | 'secondary': '#d36135', 16 | 'jet-black': '#0c0c0c', 17 | 'ghost-white': '#f4f4f9' 18 | } 19 | }, 20 | }, 21 | plugins: [ 22 | ], 23 | } 24 | -------------------------------------------------------------------------------- /docker/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | caddy: 4 | image: caddy:latest 5 | restart: unless-stopped 6 | command: caddy run --config /etc/caddy/Caddyfile 7 | ports: 8 | - "80:80" 9 | - "443:443" 10 | volumes: 11 | - ./caddy/Caddyfile:/etc/caddy/Caddyfile 12 | - /route/to/static:/static #change this to the folder where your static files are 13 | bare-server: 14 | build: ./bare-server 15 | restart: unless-stopped 16 | ports: 17 | - "8080:8080" 18 | # dns: 192.168.0.1 # change this to pihole if you want to run that -------------------------------------------------------------------------------- /static/public/assets/announcement.json: -------------------------------------------------------------------------------- 1 | { 2 | "announcements": [ 3 | "Set your own custom password so no one else can access it.", 4 | "Turn on about:blank cloaking in the settings!", 5 | "You can change the default search engine in the settings!", 6 | "You can now pay for premium features! Just join the Discord and subcribe to get access!", 7 | "You can set a custom shortcut in the settings!" 8 | ], 9 | "important": [ 10 | "You can now pay for premium features! Just join the Discord and subcribe to get access!" 11 | ], 12 | "super": [ 13 | "Spotify doesn't seem to be working right now." 14 | ] 15 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elixir", 3 | "version": "1.0.0", 4 | "description": "Official Elxiir deployment with TompHTTP bare server included.", 5 | "type": "module", 6 | "scripts": { 7 | "start": "node src/index.js" 8 | }, 9 | "files": ["static", "src"], 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/whos-evan/elxiir.git" 13 | }, 14 | "keywords": ["official", "ultraviolet", "elixir", "bare-server", "bypass-filter", "unblocker", "evan"], 15 | "author": "", 16 | "license": "GPL-3.0-or-later", 17 | "dependencies": { 18 | "@tomphttp/bare-server-node": "^1.2.2", 19 | "serve-static": "^1.15.0" 20 | }, 21 | "engines": { 22 | "npm": ">=8.0.0", 23 | "node": ">=16.0.0" 24 | } 25 | } -------------------------------------------------------------------------------- /docker/bare-server/index.js: -------------------------------------------------------------------------------- 1 | import createBareServer from '@tomphttp/bare-server-node'; 2 | import http from 'node:http'; 3 | 4 | const httpServer = http.createServer(); 5 | 6 | const bareServer = createBareServer('/bare/', { 7 | logErrors: false, 8 | localAddress: undefined, 9 | maintainer: { 10 | email: 'tomphttp@sys32.dev', 11 | website: 'https://github.com/tomphttp/', 12 | }, 13 | }); 14 | 15 | httpServer.on('request', (req, res) => { 16 | if (bareServer.shouldRoute(req)) { 17 | bareServer.routeRequest(req, res); 18 | } else { 19 | res.writeHead(400); 20 | res.end('Not found.'); 21 | } 22 | }); 23 | 24 | httpServer.on('upgrade', (req, socket, head) => { 25 | if (bareServer.shouldRoute(req)) { 26 | bareServer.routeUpgrade(req, socket, head); 27 | } else { 28 | socket.end(); 29 | } 30 | }); 31 | 32 | httpServer.on('listening', () => { 33 | console.log('HTTP server listening'); 34 | }); 35 | 36 | httpServer.listen({ 37 | port: 8080, 38 | }); -------------------------------------------------------------------------------- /static/public/assets/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Elixir", 3 | "short_name": "Elixir - Instant Math Help", 4 | "start_url": "/", 5 | "scope": "/", 6 | "display": "standalone", 7 | "description": "Get world class support for K-12 mathematics and more!", 8 | "lang": "en", 9 | "dir": "auto", 10 | "theme_color": "#ffffff", 11 | "background_color": "#ffffff", 12 | "orientation": "any", 13 | "icons": [ 14 | { 15 | "src": "https://elixirofficial.com/assets/icons/manifest-icon-192.maskable.png", 16 | "sizes": "192x192", 17 | "type": "image/png", 18 | "purpose": "maskable" 19 | }, 20 | { 21 | "src": "https://elixirofficial.com/assets/icons/manifest-icon-512.maskable.png", 22 | "sizes": "512x512", 23 | "type": "image/png", 24 | "purpose": "maskable" 25 | }, 26 | { 27 | "src": "https://elixirofficial.com/assets/icons/apple-icon-180.png", 28 | "sizes": "180x180", 29 | "type": "image/png", 30 | "purpose": "any" 31 | } 32 | ], 33 | "screenshots": [ 34 | { 35 | "src": "https://elixirofficial.com/assets/screenshots/screenshot.png", 36 | "sizes": "1920x983", 37 | "type": "image/png", 38 | "description": "A screenshot of the home page" 39 | } 40 | ], 41 | "prefer_related_applications": false 42 | } -------------------------------------------------------------------------------- /static/src/input.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | html { 7 | font-family: "Inter", system-ui, sans-serif; 8 | } 9 | } 10 | 11 | @layer components { 12 | .sidebar-icon { 13 | @apply relative flex items-center justify-center 14 | h-12 w-12 p-[10px] mt-2 mb-2 mx-auto 15 | bg-gray-900 fill-white 16 | hover:bg-orange-400 17 | rounded-3xl hover:rounded-xl 18 | cursor-pointer 19 | transition-all duration-300 ease-linear; 20 | } 21 | .sidebar-tooltip { 22 | @apply absolute w-auto p-2 m-2 min-w-max left-14 23 | rounded-md shadow-md 24 | text-white bg-gray-900 25 | text-xs font-bold 26 | transition-all duration-100 scale-0 origin-left; 27 | } 28 | .sidebar-icon-selected { 29 | @apply relative flex items-center justify-center 30 | h-12 w-12 p-[10px] mt-2 mb-2 mx-auto 31 | bg-orange-400 fill-white 32 | rounded-xl 33 | cursor-pointer 34 | transition-all duration-300 ease-linear; 35 | } 36 | .sidebar-hr { 37 | @apply bg-orange-400 38 | border border-orange-400 rounded-full 39 | mx-2; 40 | } 41 | .content-items { 42 | @apply flex mx-auto items-center justify-evenly; 43 | } 44 | .input-bar { 45 | @apply bg-white text-black 46 | rounded-lg 47 | hover:bg-orange-400 hover:text-black hover:placeholder:text-black 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /static/construction/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Elixir - Currently Under Construction 12 | 14 | 15 | 16 |
20 | 26 | Elixir: 27 |
We are currently under construction.
Please check back in a few minutes!
28 |
29 | 34 | 35 | -------------------------------------------------------------------------------- /images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | elixir 4 | 5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

15 | 16 |
17 | 18 | ## Features 19 | - A very nice looking proxy built using Tailwind CSS! 20 | - Super fast! (most of the time) 21 | - Constant updates! 22 | - Easy to use shortcut buttons! 23 | - Ability to disable analytics for those that actually care about their privacy. 24 | - Customizable search engine (Google, DuckDuckGo, Brave Search, or Bing). 25 | - about:blank or tab cloaking! 26 | - Installable as a PWA (Progressive Web App)! 27 | 28 | ## Official Links 29 | - https://elixirofficial.com 30 | 31 | ## Screenshots 32 | ![brave_aKBpCyVjYI](https://user-images.githubusercontent.com/72959444/203647512-a582b7ba-bee0-4134-96c1-fe4c11e76395.png) 33 | ![brave_1LiTDX2uZX](https://user-images.githubusercontent.com/72959444/203647517-28d94f3b-3adc-44ea-a5ec-4141505d5f90.png) 34 | ![brave_uGniUxj9j5](https://user-images.githubusercontent.com/72959444/203647519-d4d0e6ad-ad16-4a27-b4f8-43754f1ca8eb.png) -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import createBareServer from "@tomphttp/bare-server-node"; 2 | import { fileURLToPath } from "url"; 3 | import { createServer as createHttpsServer } from "node:https"; 4 | import { createServer as createHttpServer } from "node:http"; 5 | import { readFileSync, existsSync } from "node:fs"; 6 | import serveStatic from "serve-static"; 7 | 8 | const bare = createBareServer("/bare/"); 9 | 10 | const serve = serveStatic( 11 | fileURLToPath(new URL("../static/public", import.meta.url)), 12 | { fallthrough: false } 13 | ); 14 | 15 | var server; 16 | if (existsSync("../ssl/key.pem") && existsSync("../ssl/cert.pem")) { 17 | server = createHttpsServer({ 18 | key: readFileSync("../ssl/key.pem"), 19 | cert: readFileSync("../ssl/cert.pem"), 20 | }); 21 | } else server = createHttpServer(); 22 | 23 | server.on("request", (req, res) => { 24 | if (bare.shouldRoute(req)) bare.routeRequest(req, res); 25 | else { 26 | if (req.url.startsWith("/data")) { 27 | analytics(req, res, data); 28 | } else { 29 | serve(req, res, (err) => { 30 | res.writeHead(err?.statusCode || 500, null, { 31 | "Content-Type": "text/plain", 32 | }); 33 | res.end("Error"); 34 | }); 35 | } 36 | } 37 | }); 38 | 39 | server.on("upgrade", (req, socket, head) => { 40 | if (bare.shouldRoute(req, socket, head)) bare.routeUpgrade(req, socket, head); 41 | else socket.end(); 42 | }); 43 | 44 | server.on("listening", () => { 45 | const addr = server.address(); 46 | 47 | console.log(`Elixir running on port ${addr.port}`); 48 | console.log(""); 49 | console.log("You may now access it using your browser!"); 50 | 51 | console.log( 52 | `Local: http://${ 53 | addr.family === "IPv6" ? `[${addr.address}]` : addr.address 54 | }:${addr.port}` 55 | ); 56 | try { 57 | console.log(`On Your Network: http://${address.ip()}:${addr.port}`); 58 | } catch (err) { 59 | /* Can't find LAN interface */ 60 | } 61 | if (process.env.REPL_SLUG && process.env.REPL_OWNER) 62 | console.log( 63 | `Replit: https://${process.env.REPL_SLUG}.${process.env.REPL_OWNER}.repl.co` 64 | ); 65 | }); 66 | 67 | server.listen({ port: process.env.PORT || 8080 }); 68 | -------------------------------------------------------------------------------- /static/public/pages/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Elixir - Blazingly Fast Math Help! 12 | 13 | 14 | 15 |
19 |

It works by using fork of Ultraviolet, Ultraviolet's Developers say that it works by intercepting HTTP requests with a service worker script that follows the TompHTTP specifications.

This was made using Tailwind CSS and bare-server to make it as beautiful as possible! If you want to see the source code for this site please visit the Github at https://github.com/whos-evan/elixir. If you have any questions about it please join the Discord server at: https://discord.gg/TXBxFM4rEJ.

23 |
24 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /images/banner.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | Elixir 82 | a beautiful proxy madeusing Tailwind CSS, Ultravioletand bare-server! 83 | 84 | 85 | -------------------------------------------------------------------------------- /static/public/pages/tos.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Elixir - Terms of Service 10 | 11 | 12 |
15 |

Website Terms and Conditions of Use

16 | 17 |

1. Terms

18 | 19 |

By accessing this Website, accessible from https://elixirofficial.com, you are agreeing to be bound by these Website Terms and Conditions of Use and agree that you are responsible for the agreement with any applicable local laws. If you disagree with any of these terms, you are prohibited from accessing this site. The materials contained in this Website are protected by copyright and trade mark law.

20 | 21 |

2. Use License

22 | 23 |

Permission is granted to temporarily download one copy of the materials on Elixir's Website for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:

24 | 25 | 32 | 33 |

This will let Elixir to terminate upon violations of any of these restrictions. Upon termination, your viewing right will also be terminated and you should destroy any downloaded materials in your possession whether it is printed or electronic format.

34 | 35 |

3. Disclaimer

36 | 37 |

All the materials on Elixir’s Website are provided "as is". Elixir makes no warranties, may it be expressed or implied, therefore negates all other warranties. Furthermore, Elixir does not make any representations concerning the accuracy or reliability of the use of the materials on its Website or otherwise relating to such materials or any sites linked to this Website.

38 | 39 |

4. Limitations

40 | 41 |

Elixir or its suppliers will not be hold accountable for any damages that will arise with the use or inability to use the materials on Elixir’s Website, even if Elixir or an authorize representative of this Website has been notified, orally or written, of the possibility of such damage. Some jurisdiction does not allow limitations on implied warranties or limitations of liability for incidental damages, these limitations may not apply to you.

42 | 43 |

5. Revisions and Errata

44 | 45 |

The materials appearing on Elixir’s Website may include technical, typographical, or photographic errors. Elixir will not promise that any of the materials in this Website are accurate, complete, or current. Elixir may change the materials contained on its Website at any time without notice. Elixir does not make any commitment to update the materials.

46 | 47 |

6. Links

48 | 49 |

Elixir has not reviewed all of the sites linked to its Website and is not responsible for the contents of any such linked site. The presence of any link does not imply endorsement by Elixir of the site. The use of any linked website is at the user’s own risk.

50 | 51 |

7. Site Terms of Use Modifications

52 | 53 |

Elixir may revise these Terms of Use for its Website at any time without prior notice. By using this Website, you are agreeing to be bound by the current version of these Terms and Conditions of Use.

54 | 55 |

8. Your Privacy

56 | 57 |

Please read our Privacy Policy.

58 | 59 |

9. Governing Law

60 | 61 |

Any claim related to Elixir's Website shall be governed by the laws of us without regards to its conflict of law provisions.

62 |
63 | 64 | 65 | -------------------------------------------------------------------------------- /static/public/arc-sw.js: -------------------------------------------------------------------------------- 1 | !(function (t) { 2 | var e = {}; 3 | function n(r) { 4 | if (e[r]) return e[r].exports; 5 | var o = (e[r] = { i: r, l: !1, exports: {} }); 6 | return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; 7 | } 8 | (n.m = t), 9 | (n.c = e), 10 | (n.d = function (t, e, r) { 11 | n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); 12 | }), 13 | (n.r = function (t) { 14 | "undefined" != typeof Symbol && 15 | Symbol.toStringTag && 16 | Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), 17 | Object.defineProperty(t, "__esModule", { value: !0 }); 18 | }), 19 | (n.t = function (t, e) { 20 | if ((1 & e && (t = n(t)), 8 & e)) return t; 21 | if (4 & e && "object" == typeof t && t && t.__esModule) return t; 22 | var r = Object.create(null); 23 | if ( 24 | (n.r(r), 25 | Object.defineProperty(r, "default", { enumerable: !0, value: t }), 26 | 2 & e && "string" != typeof t) 27 | ) 28 | for (var o in t) 29 | n.d( 30 | r, 31 | o, 32 | function (e) { 33 | return t[e]; 34 | }.bind(null, o) 35 | ); 36 | return r; 37 | }), 38 | (n.n = function (t) { 39 | var e = 40 | t && t.__esModule 41 | ? function () { 42 | return t.default; 43 | } 44 | : function () { 45 | return t; 46 | }; 47 | return n.d(e, "a", e), e; 48 | }), 49 | (n.o = function (t, e) { 50 | return Object.prototype.hasOwnProperty.call(t, e); 51 | }), 52 | (n.p = ""), 53 | n((n.s = 93)); 54 | })({ 55 | 3: function (t, e, n) { 56 | "use strict"; 57 | n.d(e, "a", function () { 58 | return r; 59 | }), 60 | n.d(e, "c", function () { 61 | return o; 62 | }), 63 | n.d(e, "g", function () { 64 | return i; 65 | }), 66 | n.d(e, "j", function () { 67 | return a; 68 | }), 69 | n.d(e, "i", function () { 70 | return d; 71 | }), 72 | n.d(e, "b", function () { 73 | return f; 74 | }), 75 | n.d(e, "k", function () { 76 | return u; 77 | }), 78 | n.d(e, "d", function () { 79 | return p; 80 | }), 81 | n.d(e, "e", function () { 82 | return l; 83 | }), 84 | n.d(e, "f", function () { 85 | return m; 86 | }), 87 | n.d(e, "h", function () { 88 | return v; 89 | }); 90 | var r = { 91 | images: [ 92 | "bmp", 93 | "jpeg", 94 | "jpg", 95 | "ttf", 96 | "pict", 97 | "svg", 98 | "webp", 99 | "eps", 100 | "svgz", 101 | "gif", 102 | "png", 103 | "ico", 104 | "tif", 105 | "tiff", 106 | "bpg", 107 | "avif", 108 | "jxl", 109 | ], 110 | video: [ 111 | "mp4", 112 | "3gp", 113 | "webm", 114 | "mkv", 115 | "flv", 116 | "f4v", 117 | "f4p", 118 | "f4bogv", 119 | "drc", 120 | "avi", 121 | "mov", 122 | "qt", 123 | "wmv", 124 | "amv", 125 | "mpg", 126 | "mp2", 127 | "mpeg", 128 | "mpe", 129 | "m2v", 130 | "m4v", 131 | "3g2", 132 | "gifv", 133 | "mpv", 134 | "av1", 135 | "ts", 136 | "tsv", 137 | "tsa", 138 | "m2t", 139 | "m3u8", 140 | ], 141 | audio: [ 142 | "mid", 143 | "midi", 144 | "aac", 145 | "aiff", 146 | "flac", 147 | "m4a", 148 | "m4p", 149 | "mp3", 150 | "ogg", 151 | "oga", 152 | "mogg", 153 | "opus", 154 | "ra", 155 | "rm", 156 | "wav", 157 | "webm", 158 | "f4a", 159 | "pat", 160 | ], 161 | interchange: [ 162 | "json", 163 | "yaml", 164 | "xml", 165 | "csv", 166 | "toml", 167 | "ini", 168 | "bson", 169 | "asn1", 170 | "ubj", 171 | ], 172 | archives: [ 173 | "jar", 174 | "iso", 175 | "tar", 176 | "tgz", 177 | "tbz2", 178 | "tlz", 179 | "gz", 180 | "bz2", 181 | "xz", 182 | "lz", 183 | "z", 184 | "7z", 185 | "apk", 186 | "dmg", 187 | "rar", 188 | "lzma", 189 | "txz", 190 | "zip", 191 | "zipx", 192 | ], 193 | documents: [ 194 | "pdf", 195 | "ps", 196 | "doc", 197 | "docx", 198 | "ppt", 199 | "pptx", 200 | "xls", 201 | "otf", 202 | "xlsx", 203 | ], 204 | other: ["srt", "swf"], 205 | }, 206 | o = ["js", "cjs", "mjs", "css"], 207 | c = "arc:", 208 | i = { 209 | COMLINK_INIT: "".concat(c, "comlink:init"), 210 | NODE_ID: "".concat(c, ":nodeId"), 211 | CLIENT_TEARDOWN: "".concat(c, "client:teardown"), 212 | CLIENT_TAB_ID: "".concat(c, "client:tabId"), 213 | CDN_CONFIG: "".concat(c, "cdn:config"), 214 | P2P_CLIENT_READY: "".concat(c, "cdn:ready"), 215 | STORED_FIDS: "".concat(c, "cdn:storedFids"), 216 | SW_HEALTH_CHECK: "".concat(c, "cdn:healthCheck"), 217 | WIDGET_CONFIG: "".concat(c, "widget:config"), 218 | WIDGET_INIT: "".concat(c, "widget:init"), 219 | WIDGET_UI_LOAD: "".concat(c, "widget:load"), 220 | BROKER_LOAD: "".concat(c, "broker:load"), 221 | RENDER_FILE: "".concat(c, "inlay:renderFile"), 222 | FILE_RENDERED: "".concat(c, "inlay:fileRendered"), 223 | }, 224 | a = "serviceWorker", 225 | d = "/".concat("shared-worker", ".js"), 226 | f = "/".concat("dedicated-worker", ".js"), 227 | u = "/".concat("arc-sw-core", ".js"), 228 | s = "".concat("arc-sw", ".js"), 229 | p = ("/".concat(s), "/".concat("arc-sw"), "arc-db"), 230 | l = "key-val-store", 231 | m = 2 ** 17, 232 | v = "".concat("https://warden.arc.io", "/mailbox/propertySession"); 233 | "".concat("https://warden.arc.io", "/mailbox/transfers"); 234 | }, 235 | 93: function (t, e, n) { 236 | "use strict"; 237 | n.r(e); 238 | var r = n(3); 239 | if ("undefined" != typeof ServiceWorkerGlobalScope) { 240 | var o = "https://arc.io" + r.k; 241 | importScripts(o); 242 | } else if ("undefined" != typeof SharedWorkerGlobalScope) { 243 | var c = "https://arc.io" + r.i; 244 | importScripts(c); 245 | } else if ("undefined" != typeof DedicatedWorkerGlobalScope) { 246 | var i = "https://arc.io" + r.b; 247 | importScripts(i); 248 | } 249 | }, 250 | }); 251 | -------------------------------------------------------------------------------- /static/public/pages/privacy-policy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Elixir - Privacy Policy 10 | 11 | 12 |
15 |

Privacy Policy for Elixir

16 | 17 |

At Elixir, accessible from https://elixirofficial.com, one of our main priorities is the privacy of our visitors. This Privacy Policy document contains types of information that is collected and recorded by Elixir and how we use it.

18 | 19 |

If you have additional questions or require more information about our Privacy Policy, do not hesitate to contact us.

20 | 21 |

This Privacy Policy applies only to our online activities and is valid for visitors to our website with regards to the information that they shared and/or collect in Elixir. This policy is not applicable to any information collected offline or via channels other than this website.

22 | 23 |

Consent

24 | 25 |

By using our website, you hereby consent to our Privacy Policy and agree to its terms.

26 | 27 |

Information we collect

28 | 29 |

The personal information that you are asked to provide, and the reasons why you are asked to provide it, will be made clear to you at the point we ask you to provide your personal information.

30 |

If you contact us directly, we may receive additional information about you such as your name, email address, phone number, the contents of the message and/or attachments you may send us, and any other information you may choose to provide.

31 |

When you register for an Account, we may ask for your contact information, including items such as name, company name, address, email address, and telephone number.

32 | 33 |

How we use your information

34 | 35 |

We use the information we collect in various ways, including to:

36 | 37 | 46 | 47 |

Log Files

48 | 49 |

Elixir follows a standard procedure of using log files. These files log visitors when they visit websites. All hosting companies do this and a part of hosting services' analytics. The information collected by log files include internet protocol (IP) addresses, browser type, Internet Service Provider (ISP), date and time stamp, referring/exit pages, and possibly the number of clicks. These are not linked to any information that is personally identifiable. The purpose of the information is for analyzing trends, administering the site, tracking users' movement on the website, and gathering demographic information.

50 | 51 |

Cookies and Web Beacons

52 | 53 |

Like any other website, Elixir uses 'cookies'. These cookies are used to store information including visitors' preferences, and the pages on the website that the visitor accessed or visited. The information is used to optimize the users' experience by customizing our web page content based on visitors' browser type and/or other information.

54 | 55 | 56 | 57 |

Advertising Partners Privacy Policies

58 | 59 |

You may consult this list to find the Privacy Policy for each of the advertising partners of Elixir.

60 | 61 |

Third-party ad servers or ad networks uses technologies like cookies, JavaScript, or Web Beacons that are used in their respective advertisements and links that appear on Elixir, which are sent directly to users' browser. They automatically receive your IP address when this occurs. These technologies are used to measure the effectiveness of their advertising campaigns and/or to personalize the advertising content that you see on websites that you visit.

62 | 63 |

Note that Elixir has no access to or control over these cookies that are used by third-party advertisers.

64 | 65 |

Third Party Privacy Policies

66 | 67 |

Elixir's Privacy Policy does not apply to other advertisers or websites. Thus, we are advising you to consult the respective Privacy Policies of these third-party ad servers for more detailed information. It may include their practices and instructions about how to opt-out of certain options.

68 | 69 |

You can choose to disable cookies through your individual browser options. To know more detailed information about cookie management with specific web browsers, it can be found at the browsers' respective websites.

70 | 71 |

CCPA Privacy Rights (Do Not Sell My Personal Information)

72 | 73 |

Under the CCPA, among other rights, California consumers have the right to:

74 |

Request that a business that collects a consumer's personal data disclose the categories and specific pieces of personal data that a business has collected about consumers.

75 |

Request that a business delete any personal data about the consumer that a business has collected.

76 |

Request that a business that sells a consumer's personal data, not sell the consumer's personal data.

77 |

If you make a request, we have one month to respond to you. If you would like to exercise any of these rights, please contact us.

78 | 79 |

GDPR Data Protection Rights

80 | 81 |

We would like to make sure you are fully aware of all of your data protection rights. Every user is entitled to the following:

82 |

The right to access – You have the right to request copies of your personal data. We may charge you a small fee for this service.

83 |

The right to rectification – You have the right to request that we correct any information you believe is inaccurate. You also have the right to request that we complete the information you believe is incomplete.

84 |

The right to erasure – You have the right to request that we erase your personal data, under certain conditions.

85 |

The right to restrict processing – You have the right to request that we restrict the processing of your personal data, under certain conditions.

86 |

The right to object to processing – You have the right to object to our processing of your personal data, under certain conditions.

87 |

The right to data portability – You have the right to request that we transfer the data that we have collected to another organization, or directly to you, under certain conditions.

88 |

If you make a request, we have one month to respond to you. If you would like to exercise any of these rights, please contact us.

89 | 90 |

Children's Information

91 | 92 |

Another part of our priority is adding protection for children while using the internet. We encourage parents and guardians to observe, participate in, and/or monitor and guide their online activity.

93 | 94 |

Elixir does not knowingly collect any Personal Identifiable Information from children under the age of 13. If you think that your child provided this kind of information on our website, we strongly encourage you to contact us immediately and we will do our best efforts to promptly remove such information from our records.

95 |
96 | 97 | 98 | -------------------------------------------------------------------------------- /docker/bare-server/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bare-server", 3 | "version": "1.2.2", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "bare-server", 9 | "version": "1.2.2", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@tomphttp/bare-server-node": "^1.2.2" 13 | } 14 | }, 15 | "node_modules/@tomphttp/bare-server-node": { 16 | "version": "1.2.2", 17 | "resolved": "https://registry.npmjs.org/@tomphttp/bare-server-node/-/bare-server-node-1.2.2.tgz", 18 | "integrity": "sha512-iaH2SiznLjc6vqHZd9/33ec3P+0u7kWHuK1BQ/hOE+E09MdYrlO2H8Tu8vS2Ha665OvsYjKNpF1G/j8cGNW3oA==", 19 | "dependencies": { 20 | "commander": "^9.4.1", 21 | "dotenv": "^16.0.3", 22 | "headers-polyfill": "3.0.9", 23 | "http-errors": "^2.0.0", 24 | "source-map-support": "^0.5.21" 25 | }, 26 | "bin": { 27 | "bare-server-node": "bin.js" 28 | }, 29 | "engines": { 30 | "node": ">=18.0.0" 31 | } 32 | }, 33 | "node_modules/buffer-from": { 34 | "version": "1.1.2", 35 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 36 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" 37 | }, 38 | "node_modules/commander": { 39 | "version": "9.4.1", 40 | "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", 41 | "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==", 42 | "engines": { 43 | "node": "^12.20.0 || >=14" 44 | } 45 | }, 46 | "node_modules/depd": { 47 | "version": "2.0.0", 48 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 49 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 50 | "engines": { 51 | "node": ">= 0.8" 52 | } 53 | }, 54 | "node_modules/dotenv": { 55 | "version": "16.0.3", 56 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", 57 | "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", 58 | "engines": { 59 | "node": ">=12" 60 | } 61 | }, 62 | "node_modules/headers-polyfill": { 63 | "version": "3.0.9", 64 | "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.0.9.tgz", 65 | "integrity": "sha512-FFIXpxbA9HZJXofXqS4IBRa7Z8F1Y+/DwxHSEOOTswZxym8Kz+f6DNhrtnCRcjWcTN7LjjbE5stz0UnoUPNprQ==" 66 | }, 67 | "node_modules/http-errors": { 68 | "version": "2.0.0", 69 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 70 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 71 | "dependencies": { 72 | "depd": "2.0.0", 73 | "inherits": "2.0.4", 74 | "setprototypeof": "1.2.0", 75 | "statuses": "2.0.1", 76 | "toidentifier": "1.0.1" 77 | }, 78 | "engines": { 79 | "node": ">= 0.8" 80 | } 81 | }, 82 | "node_modules/inherits": { 83 | "version": "2.0.4", 84 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 85 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 86 | }, 87 | "node_modules/setprototypeof": { 88 | "version": "1.2.0", 89 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 90 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 91 | }, 92 | "node_modules/source-map": { 93 | "version": "0.6.1", 94 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 95 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 96 | "engines": { 97 | "node": ">=0.10.0" 98 | } 99 | }, 100 | "node_modules/source-map-support": { 101 | "version": "0.5.21", 102 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 103 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 104 | "dependencies": { 105 | "buffer-from": "^1.0.0", 106 | "source-map": "^0.6.0" 107 | } 108 | }, 109 | "node_modules/statuses": { 110 | "version": "2.0.1", 111 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 112 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 113 | "engines": { 114 | "node": ">= 0.8" 115 | } 116 | }, 117 | "node_modules/toidentifier": { 118 | "version": "1.0.1", 119 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 120 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 121 | "engines": { 122 | "node": ">=0.6" 123 | } 124 | } 125 | }, 126 | "dependencies": { 127 | "@tomphttp/bare-server-node": { 128 | "version": "1.2.2", 129 | "resolved": "https://registry.npmjs.org/@tomphttp/bare-server-node/-/bare-server-node-1.2.2.tgz", 130 | "integrity": "sha512-iaH2SiznLjc6vqHZd9/33ec3P+0u7kWHuK1BQ/hOE+E09MdYrlO2H8Tu8vS2Ha665OvsYjKNpF1G/j8cGNW3oA==", 131 | "requires": { 132 | "commander": "^9.4.1", 133 | "dotenv": "^16.0.3", 134 | "headers-polyfill": "3.0.9", 135 | "http-errors": "^2.0.0", 136 | "source-map-support": "^0.5.21" 137 | } 138 | }, 139 | "buffer-from": { 140 | "version": "1.1.2", 141 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 142 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" 143 | }, 144 | "commander": { 145 | "version": "9.4.1", 146 | "resolved": "https://registry.npmjs.org/commander/-/commander-9.4.1.tgz", 147 | "integrity": "sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw==" 148 | }, 149 | "depd": { 150 | "version": "2.0.0", 151 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 152 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" 153 | }, 154 | "dotenv": { 155 | "version": "16.0.3", 156 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", 157 | "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" 158 | }, 159 | "headers-polyfill": { 160 | "version": "3.0.9", 161 | "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-3.0.9.tgz", 162 | "integrity": "sha512-FFIXpxbA9HZJXofXqS4IBRa7Z8F1Y+/DwxHSEOOTswZxym8Kz+f6DNhrtnCRcjWcTN7LjjbE5stz0UnoUPNprQ==" 163 | }, 164 | "http-errors": { 165 | "version": "2.0.0", 166 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 167 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 168 | "requires": { 169 | "depd": "2.0.0", 170 | "inherits": "2.0.4", 171 | "setprototypeof": "1.2.0", 172 | "statuses": "2.0.1", 173 | "toidentifier": "1.0.1" 174 | } 175 | }, 176 | "inherits": { 177 | "version": "2.0.4", 178 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 179 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 180 | }, 181 | "setprototypeof": { 182 | "version": "1.2.0", 183 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 184 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" 185 | }, 186 | "source-map": { 187 | "version": "0.6.1", 188 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 189 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" 190 | }, 191 | "source-map-support": { 192 | "version": "0.5.21", 193 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 194 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 195 | "requires": { 196 | "buffer-from": "^1.0.0", 197 | "source-map": "^0.6.0" 198 | } 199 | }, 200 | "statuses": { 201 | "version": "2.0.1", 202 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 203 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" 204 | }, 205 | "toidentifier": { 206 | "version": "1.0.1", 207 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 208 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" 209 | } 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /static/public/js/index.js: -------------------------------------------------------------------------------- 1 | const form = document.querySelector("form"); 2 | const input = document.getElementById("searchInput"); 3 | 4 | // start of password protection 5 | if (getPassword() == null) { 6 | openPage('home'); 7 | } else { 8 | openPage('password'); 9 | document.getElementById('sidebar').style.display = 'none'; 10 | } 11 | 12 | function getPassword() { 13 | return localStorage.getItem('password') || null; 14 | } 15 | 16 | function setPassword() { 17 | const $password = document.getElementById('password-set'); 18 | const password = $password.value; 19 | if (password == null || password == '') { 20 | alert('Removed password'); 21 | localStorage.removeItem('password'); 22 | return; 23 | } 24 | if (confirm("Are you sure you want to password protect this page? If you do, you will not be able to access this page without the password. If you do not want to password protect this page, click cancel.") == true) { 25 | localStorage.setItem('password', password); 26 | } 27 | } 28 | 29 | function checkPassword() { 30 | const $password = document.getElementById('password-prompt'); 31 | const password = $password.value; 32 | if (password == getPassword()) { 33 | openPage('home'); 34 | document.getElementById('sidebar').style.display = 'flex'; 35 | } else { 36 | window.location.href = getSearchEngineURL(); 37 | } 38 | } 39 | 40 | function togglePassword() { 41 | var x = document.getElementById("passwordToggle"); 42 | if (x.type === "password") { 43 | x.type = "text"; 44 | } else { 45 | x.type = "password"; 46 | } 47 | } 48 | 49 | // end of password protection 50 | 51 | form.addEventListener("submit", async (event) => { 52 | event.preventDefault(); 53 | let url = input.value.trim(); 54 | openURL(url); 55 | }); 56 | 57 | function isUrl(val = "") { 58 | if ( 59 | /^http(s?):\/\//.test(val) || 60 | (val.includes(".") && val.substr(0, 1) !== " ") 61 | ) 62 | return true; 63 | return false; 64 | } 65 | 66 | 67 | // open url function 68 | function openURL(url) { 69 | window.navigator.serviceWorker 70 | .register("./uv.js", { 71 | scope: __uv$config.prefix, 72 | }) 73 | .then(() => { 74 | if (!isUrl(url)) url = getSearchEngineURL() + url; 75 | else if (!(url.startsWith("https://") || url.startsWith("http://"))) 76 | url = "http://" + url; 77 | 78 | if (getAboutBlank() === 'on') { 79 | openAboutBlank(window.location.href.slice(0, -1) + __uv$config.prefix + __uv$config.encodeUrl(url)); 80 | } else { 81 | window.location.href = __uv$config.prefix + __uv$config.encodeUrl(url); 82 | } 83 | }); 84 | }; 85 | 86 | selectedIcon('icon-home'); 87 | 88 | setupCloak(); 89 | 90 | if (getAboutBlank() === 'on') { 91 | openPage('search'); 92 | selectedIcon('icon-search'); 93 | } 94 | 95 | setupCustomShortcut(); 96 | 97 | const $searchSelect = document.getElementById('searchSelect'); 98 | $searchSelect.value = getSearchEngine(); 99 | 100 | const $analyticsSelect = document.getElementById('analyticsSelect'); 101 | $analyticsSelect.value = getAnalytics(); 102 | 103 | const $aboutBlankSelect = document.getElementById('aboutBlankSelect'); 104 | $aboutBlankSelect.value = getAboutBlank(); 105 | 106 | // Check their preferred search engine 107 | function getSearchEngine () { 108 | return localStorage.getItem('searchEngine') || 'Google'; 109 | } 110 | 111 | // start of anaylitics functions 112 | 113 | function getAnalytics() { 114 | return localStorage.getItem('analytics') || 'on'; 115 | } 116 | 117 | function setAnalytics() { 118 | const $analyticsSelect = document.getElementById('analyticsSelect'); 119 | const analyticsPref = $analyticsSelect.value; 120 | if (analyticsPref === 'on') { 121 | localStorage.setItem('analytics', 'on'); 122 | } else if (analyticsPref === 'off') { 123 | localStorage.setItem('analytics', 'off'); 124 | } 125 | location.reload(); 126 | } 127 | 128 | // analytics (change it if you want to enable it) 129 | if(localStorage.getItem('analytics') != 'off') { 130 | var scriptTagGTAG = document.createElement('script'); 131 | scriptTagGTAG.setAttribute('async', ''); 132 | scriptTagGTAG.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=G-CX3B4NHEG0'); 133 | document.head.appendChild(scriptTagGTAG); 134 | // gtag 135 | window.dataLayer = window.dataLayer || []; 136 | function gtag(){dataLayer.push(arguments)}; 137 | gtag('js', new Date()); 138 | 139 | gtag('config', 'G-CX3B4NHEG0'); 140 | 141 | // arc 142 | var scriptTagARC = document.createElement('script'); 143 | scriptTagARC.setAttribute('async', ''); 144 | scriptTagARC.setAttribute('src', 'https://arc.io/widget.min.js#85sFzH5m'); 145 | document.head.appendChild(scriptTagARC); 146 | } 147 | 148 | // end of anaylitics functions 149 | 150 | // Set their preferred search engine 151 | function setSearchEngine () { 152 | const $searchSelect = document.getElementById('searchSelect'); 153 | const searchEngine = $searchSelect.value; 154 | if (searchEngine === 'Google') { 155 | localStorage.setItem('searchEngineURL', 'https://google.com/search?q='); 156 | localStorage.setItem('searchEngine', 'Google'); 157 | } else if (searchEngine === 'DuckDuckGo') { 158 | localStorage.setItem('searchEngineURL', 'https://duckduckgo.com/?q='); 159 | localStorage.setItem('searchEngine', 'DuckDuckGo'); 160 | } else if (searchEngine === 'Bing') { 161 | localStorage.setItem('searchEngineURL', 'https://bing.com/search?q='); 162 | localStorage.setItem('searchEngine', 'Bing'); 163 | } else if (searchEngine === 'Brave Search') { 164 | localStorage.setItem('searchEngineURL', 'https://search.brave.com/search?q='); 165 | localStorage.setItem('searchEngine', 'Brave Search'); 166 | } 167 | } 168 | 169 | // get search engine url 170 | function getSearchEngineURL() { 171 | return localStorage.getItem('searchEngineURL') || 'https://google.com/search?q='; 172 | } 173 | 174 | // Start of about:blank functions 175 | 176 | function getAboutBlank() { 177 | if (localStorage.getItem('aboutBlank') === 'on') { 178 | var introText = document.getElementById("introText"); 179 | introText.innerHTML = "Elixir:
Search the web without censorship or tracking." 180 | 181 | var searchPlaceholder = document.querySelector("input"); 182 | searchPlaceholder.placeholder = "Search here without tracking"; 183 | 184 | return 'on'; 185 | } else { 186 | return 'off'; 187 | } 188 | } 189 | 190 | // Opens page in a new about:blank tab 191 | function setAboutBlank() { 192 | const $aboutBlankSelect = document.getElementById('aboutBlankSelect'); 193 | const aboutBlankSelect = $aboutBlankSelect.value; 194 | if (aboutBlankSelect === 'on') { 195 | localStorage.setItem('aboutBlank', 'on'); 196 | openAboutBlank(); 197 | } else if (aboutBlankSelect === 'off') { 198 | localStorage.setItem('aboutBlank', 'off'); 199 | } 200 | } 201 | 202 | // opens page in about:blank 203 | function openAboutBlank(url) { 204 | if (url === undefined) { 205 | var encoded_url = window.location.origin; 206 | } 207 | else { 208 | var encoded_url = url; 209 | } 210 | var w = open('about:blank', '_blank') || alert("It seems like you are blocking pop-ups. Please try again once you have allowed pop-ups.") 211 | w.document.write(``) 212 | w.document.body.style.margin = '0' 213 | window.location.replace(getSearchEngineURL()); 214 | } 215 | // end of about:blank functions 216 | 217 | // changes the selected icon 218 | function selectedIcon(icon) { 219 | const icons = document.querySelectorAll(`[id^="icon"]`); 220 | icons.forEach(element =>{ 221 | element.classList.remove('sidebar-icon-selected'); 222 | }); 223 | document.getElementById(icon).classList.toggle('sidebar-icon-selected') 224 | } 225 | 226 | // opens a certain page using css and hides the others 227 | function openPage(page) { 228 | if (page === 'home') { 229 | document.getElementById("search").style.display = "none"; 230 | document.getElementById("settings").style.display = "none"; 231 | document.getElementById("home").style.display = "flex"; 232 | document.getElementById("footer").style.display = "block"; 233 | document.getElementById("password").style.display = "none"; 234 | } else if (page === 'search') { 235 | document.getElementById("home").style.display = "none"; 236 | document.getElementById("settings").style.display = "none"; 237 | document.getElementById("search").style.display = "flex"; 238 | document.getElementById("footer").style.display = "block"; 239 | document.getElementById("password").style.display = "none"; 240 | } else if (page === 'settings') { 241 | document.getElementById("home").style.display = "none"; 242 | document.getElementById("search").style.display = "none"; 243 | document.getElementById("settings").style.display = "flex"; 244 | document.getElementById("footer").style.display = "none"; 245 | document.getElementById("password").style.display = "none"; 246 | } else if (page === 'password') { 247 | document.getElementById("home").style.display = "none"; 248 | document.getElementById("search").style.display = "none"; 249 | document.getElementById("settings").style.display = "none"; 250 | document.getElementById("footer").style.display = "none"; 251 | document.getElementById("password").style.display = "flex"; 252 | } 253 | } 254 | 255 | // sets the custom shortcut 256 | function setCustomShortcut() { 257 | const $shortcutURL = document.getElementById('shortcutURL'); 258 | const $shortcutLogo = document.getElementById('shortcutLogo'); 259 | 260 | if ($shortcutURL.value === '' && $shortcutLogo.value === '') { 261 | alert('Cleared custom shortcut'); 262 | localStorage.removeItem('shortcutURL'); 263 | localStorage.removeItem('shortcutLogo'); 264 | setupCustomShortcut(); 265 | } else if ($shortcutURL.value === '' || $shortcutLogo.value === '') { 266 | alert('Please fill out both fields'); 267 | } else { 268 | if ($shortcutURL.value.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi)) { 269 | localStorage.setItem('shortcutURL', $shortcutURL.value); 270 | localStorage.setItem('shortcutLogo', $shortcutLogo.value.charAt(0)); 271 | alert('Shortcut set!'); 272 | setupCustomShortcut(); 273 | } else { 274 | alert('Please enter a valid URL'); 275 | } 276 | } 277 | } 278 | 279 | // changes the text on the custom shortcut and changes the onclick function to open the shortcut url 280 | function setupCustomShortcut() { 281 | if (localStorage.getItem('shortcutURL') != null) { 282 | document.getElementById('customShortcutIcon').innerHTML = localStorage.getItem('shortcutLogo'); 283 | document.getElementById('customShortcutDiv').onclick = function() {openURL(localStorage.getItem('shortcutURL'))}; 284 | } 285 | } 286 | 287 | // sets the cloak 288 | function setCloak() { 289 | const $cloakTitle = document.getElementById('cloakTitle'); 290 | const $cloakFavicon = document.getElementById('cloakFavicon'); 291 | 292 | if ($cloakTitle.value === '' && $cloakFavicon.value === '') { 293 | alert('Cleared cloak'); 294 | localStorage.removeItem('cloakTitle'); 295 | localStorage.removeItem('cloakFavicon'); 296 | } else if ($cloakTitle.value === '' && $cloakFavicon.value != '') { 297 | if ($cloakFavicon.value.match(/(https?:\/\/).*/gi)) { 298 | localStorage.setItem('cloakFavicon', $cloakFavicon.value); 299 | } 300 | } else if ($cloakTitle.value != '' && $cloakFavicon.value === '') { 301 | localStorage.setItem('cloakTitle', $cloakTitle.value); 302 | } else { 303 | localStorage.setItem('cloakTitle', $cloakTitle.value); 304 | if ($cloakFavicon.value.match(/(https?:\/\/).*/gi)) { 305 | localStorage.setItem('cloakFavicon', $cloakFavicon.value); 306 | } else { 307 | alert('Please enter a valid URL like: https://example.com/favicon.ico'); 308 | } 309 | } 310 | setupCloak(); 311 | } 312 | 313 | // changes the text on the custom shortcut and changes the onclick function to open the shortcut url 314 | function setupCloak() { 315 | if (localStorage.getItem('cloakTitle') != null) { 316 | document.title = localStorage.getItem('cloakTitle'); 317 | } 318 | if (localStorage.getItem('cloakFavicon') != null) { 319 | changeFavicon(localStorage.getItem('cloakFavicon')); 320 | } 321 | if (localStorage.getItem('cloakTitle') == null && localStorage.getItem('cloakFavicon') == null) { 322 | document.title = 'Elixir - Blazingly Fast Math Help!'; 323 | changeFavicon('favicon.ico'); 324 | } 325 | } 326 | 327 | // changes the favicon 328 | function changeFavicon(src) { 329 | var link = document.createElement('link'), 330 | oldLink = document.getElementById('dynamic-favicon'); 331 | link.id = 'dynamic-favicon'; 332 | link.rel = 'shortcut icon'; 333 | link.href = src; 334 | if (oldLink) { 335 | document.head.removeChild(oldLink); 336 | } 337 | document.head.appendChild(link); 338 | } 339 | 340 | if ('serviceWorker' in navigator) { 341 | navigator.serviceWorker.register(window.location.origin + "/js/sw.js"); 342 | } 343 | 344 | // announcement code 345 | function announcement(text) { 346 | document.getElementById("notification-text").innerHTML = text; 347 | document.getElementById("announcement").style.display = "block"; 348 | } 349 | 350 | function fetchAnnouncement() { 351 | fetch("./assets/announcement.json") 352 | .then(response => response.json()) 353 | .then(data => { 354 | // randonly selects an announcement 355 | const announcementText = data.announcements.sort(); 356 | const randomAnnouncement = announcementText[Math.floor(Math.random() * announcementText.length)]; 357 | const importantAnnouncement = data['important'][0] 358 | const superAnnouncement = data['super'][0] 359 | if (superAnnouncement != null) { 360 | announcement(superAnnouncement); 361 | } else { 362 | // randomly choose between important and normal announcement 363 | const random = Math.floor(Math.random() * 2); 364 | if (random === 0) { 365 | announcement(randomAnnouncement); 366 | } else { 367 | announcement(importantAnnouncement); 368 | } 369 | } 370 | }); 371 | } 372 | 373 | function closeAnnouncement() { 374 | document.getElementById("announcement").style.display = "none"; 375 | // dont show for 24 hours 376 | localStorage.setItem('announcement', Date.now()); 377 | } 378 | 379 | function showAnnouncement() { 380 | // check if announcement has been shown in the last 24 hours 381 | if (localStorage.getItem('announcement') != null) { 382 | const lastShown = localStorage.getItem('announcement'); 383 | const now = Date.now(); 384 | const diff = now - lastShown; 385 | const hours = Math.floor(diff / 1000 / 60 / 60); 386 | if (hours > 2) { 387 | fetchAnnouncement(); 388 | } 389 | } else { 390 | fetchAnnouncement(); 391 | } 392 | } 393 | 394 | showAnnouncement(); 395 | 396 | // end of announcement code -------------------------------------------------------------------------------- /static/public/js/uv/uv.sw.js: -------------------------------------------------------------------------------- 1 | importScripts('/js/uv/uv.bundle.js');importScripts('/js/uv/uv.config.js');class UVServiceWorker extends EventEmitter{constructor(config=__uv$config){super();if(!config.bare)config.bare='/bare/';this.addresses=typeof config.bare==='string'?[new URL(config.bare,location)]:config.bare.map(str=>new URL(str,location));this.headers={csp:['cross-origin-embedder-policy','cross-origin-opener-policy','cross-origin-resource-policy','content-security-policy','content-security-policy-report-only','expect-ct','feature-policy','origin-isolation','strict-transport-security','upgrade-insecure-requests','x-content-type-options','x-download-options','x-frame-options','x-permitted-cross-domain-policies','x-powered-by','x-xss-protection',],forward:['accept-encoding','connection','content-length',],};this.method={empty:['GET','HEAD']};this.statusCode={empty:[204,304,],};this.config=config;this.browser=Ultraviolet.Bowser.getParser(self.navigator.userAgent).getBrowserName();if(this.browser==='Firefox'){this.headers.forward.push('user-agent');this.headers.forward.push('content-type');};};async fetch({request}){if(!request.url.startsWith(location.origin+(this.config.prefix||'/service/'))){return fetch(request);};try{const ultraviolet=new Ultraviolet(this.config);if(typeof this.config.construct==='function'){this.config.construct(ultraviolet,'service');};const db=await ultraviolet.cookie.db();ultraviolet.meta.origin=location.origin;ultraviolet.meta.base=ultraviolet.meta.url=new URL(ultraviolet.sourceUrl(request.url));const requestCtx=new RequestContext(request,this,ultraviolet,!this.method.empty.includes(request.method.toUpperCase())?await request.blob():null);if(ultraviolet.meta.url.protocol==='blob:'){requestCtx.blob=true;requestCtx.base=requestCtx.url=new URL(requestCtx.url.pathname);};if(request.referrer&&request.referrer.startsWith(location.origin)){const referer=new URL(ultraviolet.sourceUrl(request.referrer));if(requestCtx.headers.origin||ultraviolet.meta.url.origin!==referer.origin&&request.mode==='cors'){requestCtx.headers.origin=referer.origin;};requestCtx.headers.referer=referer.href;};const cookies=await ultraviolet.cookie.getCookies(db)||[];const cookieStr=ultraviolet.cookie.serialize(cookies,ultraviolet.meta,false);if(this.browser==='Firefox'&&!(request.destination==='iframe'||request.destination==='document')){requestCtx.forward.shift();};if(cookieStr)requestCtx.headers.cookie=cookieStr;requestCtx.headers.Host=requestCtx.url.host;const reqEvent=new HookEvent(requestCtx,null,null);this.emit('request',reqEvent);if(reqEvent.intercepted)return reqEvent.returnValue;const response=await fetch(requestCtx.send);if(response.status===500){return Promise.reject('');};const responseCtx=new ResponseContext(requestCtx,response,this);const resEvent=new HookEvent(responseCtx,null,null);this.emit('beforemod',resEvent);if(resEvent.intercepted)return resEvent.returnValue;for(const name of this.headers.csp){if(responseCtx.headers[name])delete responseCtx.headers[name];};if(responseCtx.headers.location){responseCtx.headers.location=ultraviolet.rewriteUrl(responseCtx.headers.location);};if(responseCtx.headers['set-cookie']){Promise.resolve(ultraviolet.cookie.setCookies(responseCtx.headers['set-cookie'],db,ultraviolet.meta)).then(()=>{self.clients.matchAll().then(function(clients){clients.forEach(function(client){client.postMessage({msg:'updateCookies',url:ultraviolet.meta.url.href,});});});});delete responseCtx.headers['set-cookie'];};if(responseCtx.body){switch(request.destination){case 'script':case 'worker':responseCtx.body=`if (!self.__uv && self.importScripts) importScripts('${__uv$config.bundle}', '${__uv$config.config}', '${__uv$config.handler}');\n`;responseCtx.body+=ultraviolet.js.rewrite(await response.text());break;case 'style':responseCtx.body=ultraviolet.rewriteCSS(await response.text());break;case 'iframe':case 'document':if(isHtml(ultraviolet.meta.url,(responseCtx.headers['content-type']||''))){responseCtx.body=ultraviolet.rewriteHtml(await response.text(),{document:true,injectHead:ultraviolet.createHtmlInject(this.config.handler,this.config.bundle,this.config.config,ultraviolet.cookie.serialize(cookies,ultraviolet.meta,true),request.referrer)});};};};if(requestCtx.headers.accept==='text/event-stream'){responseCtx.headers['content-type']='text/event-stream';};this.emit('response',resEvent);if(resEvent.intercepted)return resEvent.returnValue;return new Response(responseCtx.body,{headers:responseCtx.headers,status:responseCtx.status,statusText:responseCtx.statusText,});}catch(err){return new Response(err.toString(),{status:500,});};};getBarerResponse(response){const headers={};const raw=JSON.parse(response.headers.get('x-bare-headers'));for(const key in raw){headers[key.toLowerCase()]=raw[key];};return{headers,status:+response.headers.get('x-bare-status'),statusText:response.headers.get('x-bare-status-text'),body:!this.statusCode.empty.includes(+response.headers.get('x-bare-status'))?response.body:null,};};get address(){return this.addresses[Math.floor(Math.random()*this.addresses.length)];};static Ultraviolet=Ultraviolet;};self.UVServiceWorker=UVServiceWorker;class ResponseContext{constructor(request,response,worker){const{headers,status,statusText,body}=!request.blob?worker.getBarerResponse(response):{status:response.status,statusText:response.statusText,headers:Object.fromEntries([...response.headers.entries()]),body:response.body,};this.request=request;this.raw=response;this.ultraviolet=request.ultraviolet;this.headers=headers;this.status=status;this.statusText=statusText;this.body=body;};get url(){return this.request.url;} 2 | get base(){return this.request.base;};set base(val){this.request.base=val;};};class RequestContext{constructor(request,worker,ultraviolet,body=null){this.ultraviolet=ultraviolet;this.request=request;this.headers=Object.fromEntries([...request.headers.entries()]);this.method=request.method;this.forward=[...worker.headers.forward];this.address=worker.address;this.body=body||null;this.redirect=request.redirect;this.credentials='omit';this.mode=request.mode==='cors'?request.mode:'same-origin';this.blob=false;};get send(){return new Request((!this.blob?this.address.href+'v1/':'blob:'+location.origin+this.url.pathname),{method:this.method,headers:{'x-bare-protocol':this.url.protocol,'x-bare-host':this.url.hostname,'x-bare-path':this.url.pathname+this.url.search,'x-bare-port':this.url.port||(this.url.protocol==='https:'?'443':'80'),'x-bare-headers':JSON.stringify(this.headers),'x-bare-forward-headers':JSON.stringify(this.forward),},redirect:this.redirect,credentials:this.credentials,mode:location.origin!==this.address.origin?'cors':this.mode,body:this.body});};get url(){return this.ultraviolet.meta.url;};set url(val){this.ultraviolet.meta.url=val;};get base(){return this.ultraviolet.meta.base;};set base(val){this.ultraviolet.meta.base=val;};} 3 | function isHtml(url,contentType=''){return(Ultraviolet.mime.contentType((contentType||url.pathname))||'text/html').split(';')[0]==='text/html';};class HookEvent{#intercepted;#returnValue;constructor(data={},target=null,that=null){this.#intercepted=false;this.#returnValue=null;this.data=data;this.target=target;this.that=that;};get intercepted(){return this.#intercepted;};get returnValue(){return this.#returnValue;};respondWith(input){this.#returnValue=input;this.#intercepted=true;};};var R=typeof Reflect==='object'?Reflect:null 4 | var ReflectApply=R&&typeof R.apply==='function'?R.apply:function ReflectApply(target,receiver,args){return Function.prototype.apply.call(target,receiver,args);} 5 | var ReflectOwnKeys 6 | if(R&&typeof R.ownKeys==='function'){ReflectOwnKeys=R.ownKeys}else if(Object.getOwnPropertySymbols){ReflectOwnKeys=function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));};}else{ReflectOwnKeys=function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target);};} 7 | function ProcessEmitWarning(warning){if(console&&console.warn)console.warn(warning);} 8 | var NumberIsNaN=Number.isNaN||function NumberIsNaN(value){return value!==value;} 9 | function EventEmitter(){EventEmitter.init.call(this);} 10 | EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._eventsCount=0;EventEmitter.prototype._maxListeners=undefined;var defaultMaxListeners=10;function checkListener(listener){if(typeof listener!=='function'){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener);}} 11 | Object.defineProperty(EventEmitter,'defaultMaxListeners',{enumerable:true,get:function(){return defaultMaxListeners;},set:function(arg){if(typeof arg!=='number'||arg<0||NumberIsNaN(arg)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+arg+'.');} 12 | defaultMaxListeners=arg;}});EventEmitter.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0;} 13 | this._maxListeners=this._maxListeners||undefined;};EventEmitter.prototype.setMaxListeners=function setMaxListeners(n){if(typeof n!=='number'||n<0||NumberIsNaN(n)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+'.');} 14 | this._maxListeners=n;return this;};function _getMaxListeners(that){if(that._maxListeners===undefined) 15 | return EventEmitter.defaultMaxListeners;return that._maxListeners;} 16 | EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return _getMaxListeners(this);};EventEmitter.prototype.emit=function emit(type){var args=[];for(var i=1;i0) 19 | er=args[0];if(er instanceof Error){throw er;} 20 | var err=new Error('Unhandled error.'+(er?' ('+er.message+')':''));err.context=er;throw err;} 21 | var handler=events[type];if(handler===undefined) 22 | return false;if(typeof handler==='function'){ReflectApply(handler,this,args);}else{var len=handler.length;var listeners=arrayClone(handler,len);for(var i=0;i0&&existing.length>m&&!existing.warned){existing.warned=true;var w=new Error('Possible EventEmitter memory leak detected. '+ 28 | existing.length+' '+String(type)+' listeners '+ 29 | 'added. Use emitter.setMaxListeners() to '+ 30 | 'increase limit');w.name='MaxListenersExceededWarning';w.emitter=target;w.type=type;w.count=existing.length;ProcessEmitWarning(w);}} 31 | return target;} 32 | EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,false);};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,true);};function onceWrapper(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0) 33 | return this.listener.call(this.target);return this.listener.apply(this.target,arguments);}} 34 | function _onceWrap(target,type,listener){var state={fired:false,wrapFn:undefined,target:target,type:type,listener:listener};var wrapped=onceWrapper.bind(state);wrapped.listener=listener;state.wrapFn=wrapped;return wrapped;} 35 | EventEmitter.prototype.once=function once(type,listener){checkListener(listener);this.on(type,_onceWrap(this,type,listener));return this;};EventEmitter.prototype.prependOnceListener=function prependOnceListener(type,listener){checkListener(listener);this.prependListener(type,_onceWrap(this,type,listener));return this;};EventEmitter.prototype.removeListener=function removeListener(type,listener){var list,events,position,i,originalListener;checkListener(listener);events=this._events;if(events===undefined) 36 | return this;list=events[type];if(list===undefined) 37 | return this;if(list===listener||list.listener===listener){if(--this._eventsCount===0) 38 | this._events=Object.create(null);else{delete events[type];if(events.removeListener) 39 | this.emit('removeListener',type,list.listener||listener);}}else if(typeof list!=='function'){position=-1;for(i=list.length-1;i>=0;i--){if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener;position=i;break;}} 40 | if(position<0) 41 | return this;if(position===0) 42 | list.shift();else{spliceOne(list,position);} 43 | if(list.length===1) 44 | events[type]=list[0];if(events.removeListener!==undefined) 45 | this.emit('removeListener',type,originalListener||listener);} 46 | return this;};EventEmitter.prototype.off=EventEmitter.prototype.removeListener;EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;events=this._events;if(events===undefined) 47 | return this;if(events.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0;}else if(events[type]!==undefined){if(--this._eventsCount===0) 48 | this._events=Object.create(null);else 49 | delete events[type];} 50 | return this;} 51 | if(arguments.length===0){var keys=Object.keys(events);var key;for(i=0;i=0;i--){this.removeListener(type,listeners[i]);}} 54 | return this;};function _listeners(target,type,unwrap){var events=target._events;if(events===undefined) 55 | return[];var evlistener=events[type];if(evlistener===undefined) 56 | return[];if(typeof evlistener==='function') 57 | return unwrap?[evlistener.listener||evlistener]:[evlistener];return unwrap?unwrapListeners(evlistener):arrayClone(evlistener,evlistener.length);} 58 | EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,true);};EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,false);};EventEmitter.listenerCount=function(emitter,type){if(typeof emitter.listenerCount==='function'){return emitter.listenerCount(type);}else{return listenerCount.call(emitter,type);}};EventEmitter.prototype.listenerCount=listenerCount;function listenerCount(type){var events=this._events;if(events!==undefined){var evlistener=events[type];if(typeof evlistener==='function'){return 1;}else if(evlistener!==undefined){return evlistener.length;}} 59 | return 0;} 60 | EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?ReflectOwnKeys(this._events):[];};function arrayClone(arr,n){var copy=new Array(n);for(var i=0;i