Demo entry 6782153

ghast.io

   

Submitted by ghast on Jan 09, 2019 at 08:08
Language: JavaScript. Code size: 5.9 kB.

	"./app/views/pages/home/index.js": function (e, t, n) {
		"use strict";
		Object.defineProperty(t, "__esModule", {
			value: !0
		});
		var r, o = Object.assign || function (e) {
			for (var t = 1; t < arguments.length; t++) {
				var n = arguments[t];
				for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r])
			}
			return e
		},
			i = (r = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, function (e, t, n, o) {
				var i = e && e.defaultProps,
					a = arguments.length - 3;
				if (t || 0 === a || (t = {}), t && i)
					for (var s in i) void 0 === t[s] && (t[s] = i[s]);
				else t || (t = i || {});
				if (1 === a) t.children = o;
				else if (a > 1) {
					for (var u = Array(a), c = 0; c < a; c++) u[c] = arguments[c + 3];
					t.children = u
				}
				return {
					$$typeof: r,
					type: e,
					key: void 0 === n ? null : "" + n,
					ref: null,
					props: t,
					_owner: null
				}
			}),
			a = w(n("./node_modules/react/react.js")),
			s = n("./node_modules/react-redux/es/index.js"),
			u = w(n("./node_modules/lodash/lodash.js")),
			c = n("./app/core/auth/index.js"),
			l = n("./node_modules/reselect/lib/index.js"),
			d = n("./app/core/premium/index.js"),
			f = n("./app/core/user/index.js"),
			h = n("./app/core/run/index.js"),
			p = n("./app/core/firebase/index.js"),
			m = w(n("./app/views/components/logo/index.js")),
			v = w(n("./app/views/components/button/index.js")),
			g = w(n("./app/views/components/input/index.js")),
			y = w(n("./app/views/components/a/index.js")),
			b = w(n("./app/views/components/p/index.js")),
			_ = w(n("./app/views/components/err/index.js"));

		function w(e) {
			return e && e.__esModule ? e : {
				default: e
			}
		}
		var j = i(m.default, {}),
			E = i(b.default, {
				className: "center"
			}, void 0, "To get started with Ghast please sign in with one of our supported providers"),
			S = i("div", {
				className: "google-circle"
			}),
			C = i("div", {}, void 0, "Please upgrade to premium at", " ", i("a", {
				href: "https://ghast.io/"
			}, void 0, "https://ghast.io/")),
			x = i(m.default, {}),
			k = i(b.default, {
				className: "center big-margin-bottom"
			}, void 0, "Enter a latency setting, and then click run algorithm, 3 is a good starting point");
		const O = (0, l.createSelector)(d.getPremium, c.getAuth, f.getUser, h.getRun, (e, t, n, r) => ({
			premium: e,
			auth: t,
			user: n,
			run: r
		})),
			T = o({}, c.authActions, h.runActions);
		t.default = (0, s.connect)(O, T)(class extends a.default.PureComponent {
			constructor(e) {
				super(e), this.state = {
					latency: 3
				}, this.onLatencyChange = this.onLatencyChange.bind(this)
			}
			onLatencyChange(e) {
				this.setState({
					latency: Number(e.target.value)
				})
			}
			render() {
				const {
					premium: e,
					auth: t,
					user: n,
					run: r,
					signInWithGithub: o,
					signInWithGoogle: a,
					signInWithFacebook: s,
					runAlgorithm: c,
					signOut: l
				} = this.props, {
					latency: d
				} = this.state;
				let f;
				return r.error && !u.default.isEqual(r.error, f) && (f = r.error, p.firebaseDb.ref(`errors/${t.id}`).push({
					date: (new Date).toString(),
					error: r.error
				})), t.authenticated ? "true" !== e ? i("div", {}, void 0, i(y.default, {
					className: "sign-out",
					onClick: l
				}, void 0, "Sign out"), C) : i("div", {
					className: "flex-center-content"
				}, void 0, i(y.default, {
					className: "sign-out",
					onClick: l
				}, void 0, "Sign out"), x, k, i("div", {
					style: {
						position: "relative"
					}
				}, void 0, r.success && !r.running ? i("p", {
					style: {
						color: "#07FF41",
						fontSize: "14px",
						position: "absolute",
						top: "-45%",
						width: "100%",
						textAlign: "center"
					}
				}, void 0, "Success, no need to restart!") : null, r.error && "update app" !== r.error && "invalid mid" !== r.error && !r.running ? i("p", {
					style: {
						color: "#FF0000",
						fontSize: "14px",
						position: "absolute",
						top: "-45%",
						width: "100%",
						textAlign: "center"
					}
				}, void 0, "Error, something has gone wrong!") : null, r.error && "update app" === r.error ? i("p", {
					style: {
						color: "#35B9FF",
						fontSize: "14px",
						position: "absolute",
						top: "-45%",
						width: "100%",
						textAlign: "center"
					}
				}, void 0, "Failed! Please update the application from ghast.io/download") : null, r.error && "invalid mid" === r.error ? i("p", {
					style: {
						color: "#FF0000",
						fontSize: "14px",
						position: "absolute",
						top: "-45%",
						width: "100%",
						textAlign: "center"
					}
				}, void 0, "You can only run Ghast in 1 PC! Contact support to change PC.") : null, i(g.default, {
					placeholder: "LATENCY",
					type: "text",
					value: this.state.latency,
					onChange: this.onLatencyChange
				})), i(v.default, {
					className: "equal-pad",
					style: {
						marginBottom: "5px"
					},
					onClick: () => c({
						latency: d
					})
				}, void 0, r.running ? "RUNNING..." : "RUN ALGORITHM"), i("p", {
					className: "P",
					style: {
						color: "#ede9e4",
						fontSize: "14px",
						opacity: .4,
						width: "100%",
						cursor: "pointer"
					},
					onClick: () => c({
						latency: d,
						defaultSettings: "true"
					}, !0)
				}, void 0, r.restoring ? "Restoring..." : "Restore to default settings")) : i("div", {
					className: "flex-center-content"
				}, void 0, t.error ? i(_.default, {}, void 0, t.error) : null, j, E, i("div", {}, void 0, i(v.default, {
					onClick: a,
					className: "m-right no-m-bottom google-bg-color"
				}, void 0, S, " GOOGLE")))
			}
		}), e.exports = t.default
	},

This snippet took 0.02 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).