UNPKG

@eotl/core

Version:

Assortment of data structures, Vue.js components, and utilities across EOTL apps and sites.

122 lines (121 loc) 5.32 kB
"use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const vue = require("vue"); const simpleSignedRecords = require("@eotl/simple-signed-records"); const AccountNew = require("./AccountNew-iEKG4C1F.cjs"); const AccountRestore = require("./AccountRestore-DDasrBaI.cjs"); const store = require("./store.cjs"); const authSsr = require("./authSsr-Aa_pi4mF.cjs"); const _pluginVue_exportHelper = require("./_plugin-vue_export-helper-DM9IkUGy.cjs"); const _sfc_main = { components: { AccountNew: AccountNew.AccountNew, AccountRestore: AccountRestore.AccountRestore }, data: function() { const store$1 = store.useEotlCore(); const authSsr$1 = authSsr.useAuthSsr(); if (authSsr$1.account.status == "active") { this.$router.push({ path: "home" }); } return { store: store$1, authSsr: authSsr$1, start: { title: "Welcome", welcomeText: "Welcome to an EOTL application", about: "This Is A Tool", aboutText: "EOTL is not a business or startup, it is a collection of open-source tools to connect people who have items for sale and/or transport with other suppliers or logistics workers. EOTL software can be run by communities, collectives, individuals, or companies." }, restoreSeed: "", account: authSsr$1.account }; }, methods: { restoreAccount() { let status = "active"; let keys = { secretKey: this.authSsr.identity.secretKey, publicKey: this.authSsr.identity.publicKey }; let cert = simpleSignedRecords.ssrIdentity.generateCert(keys); this.store.dispatch("restoreAccount", { status, cert }); }, btnShowRestore() { this.authSsr.account.status = "restore"; } } }; const _hoisted_1 = { key: 0 }; const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("h3", null, "Authenticated", -1); const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("p", null, "You are being redirected now...", -1); const _hoisted_4 = [ _hoisted_2, _hoisted_3 ]; const _hoisted_5 = { key: 1, class: "mt-5 row" }; const _hoisted_6 = { class: "col-md-6 mb-5" }; const _hoisted_7 = /* @__PURE__ */ vue.createElementVNode("div", { class: "bg-light mb-5 p-4" }, " [Image or other media] ", -1); const _hoisted_8 = { class: "col-md-5 offset-md-1 mb-5" }; const _hoisted_9 = /* @__PURE__ */ vue.createElementVNode("h2", null, "Get Started", -1); const _hoisted_10 = { class: "form-group" }; const _hoisted_11 = { key: 2 }; const _hoisted_12 = { key: 3 }; const _hoisted_13 = /* @__PURE__ */ vue.createElementVNode("h4", null, "Oops", -1); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_router_link = vue.resolveComponent("router-link"); const _component_AccountNew = vue.resolveComponent("AccountNew"); const _component_AccountRestore = vue.resolveComponent("AccountRestore"); return vue.openBlock(), vue.createElementBlock("div", null, [ _ctx.authSsr.account.status == "active" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, _hoisted_4)) : _ctx.authSsr.account.status == "new" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [ vue.createElementVNode("div", _hoisted_6, [ vue.createElementVNode("h2", null, vue.toDisplayString(_ctx.start.title), 1), vue.createElementVNode("p", null, vue.toDisplayString(_ctx.start.welcomeText), 1), _hoisted_7, vue.createElementVNode("h4", null, vue.toDisplayString(_ctx.start.about), 1), vue.createElementVNode("p", null, vue.toDisplayString(_ctx.start.aboutText), 1), vue.createVNode(_component_router_link, { to: { path: "/about" }, class: "btn btn-primary" }, { default: vue.withCtx(() => [ vue.createTextVNode(" Learn More ") ]), _: 1 }) ]), vue.createElementVNode("div", _hoisted_8, [ _hoisted_9, vue.createVNode(_component_AccountNew, { account: _ctx.authSsr.account, config: _ctx.store.config }, null, 8, ["account", "config"]), vue.createElementVNode("div", _hoisted_10, [ vue.createElementVNode("button", { onClick: _cache[0] || (_cache[0] = (...args) => $options.btnShowRestore && $options.btnShowRestore(...args)), class: "btn btn-link btn-block" }, " Restore an account ") ]) ]) ])) : _ctx.authSsr.account.status == "restore" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [ vue.createElementVNode("h2", null, vue.toDisplayString(_ctx.$t("auth.myAccount")), 1), vue.createElementVNode("p", null, vue.toDisplayString(_ctx.$t("auth.haveKey")), 1), vue.createVNode(_component_AccountRestore, { account: _ctx.authSsr.account, config: _ctx.store.config }, null, 8, ["account", "config"]) ])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [ _hoisted_13, vue.createElementVNode("p", null, vue.toDisplayString(_ctx.$t("auth.restoreError")), 1) ])) ]); } const Gateway = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]); exports.default = Gateway; //# sourceMappingURL=Gateway-Dq5B_SC_.cjs.map