@tapni/auth 1.0.5 → 1.0.6-4.dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +2 -0
  2. package/dist/.vite/manifest.json +16 -43
  3. package/dist/.well-known/assetlinks.json +10 -12
  4. package/dist/.well-known/microsoft-identity-association.json +5 -5
  5. package/dist/{Apps-DMds3Dv-.js → Apps-DRhdYq0_.js} +34 -34
  6. package/dist/Billing-DkXdzGvS.js +256 -0
  7. package/dist/CustomApp-Dw80xmqU.js +83 -0
  8. package/dist/QR-ByY4IUiV.js +41 -0
  9. package/dist/TapniAuth.es.js +1 -1
  10. package/dist/TapniAuth.umd.js +49 -23
  11. package/dist/{install-L-cxSovH.js → install-Cb6nCJn_.js} +6265 -4741
  12. package/dist/site.webmanifest +11 -1
  13. package/dist/style.css +1 -1
  14. package/dist/{web-IFGkBi0t.js → web-UrTMimK1.js} +2 -2
  15. package/package.json +66 -55
  16. package/src/.prettierrc.json +16 -0
  17. package/src/App.vue +326 -269
  18. package/src/eslint.config.js +15 -0
  19. package/src/index.js +4 -0
  20. package/src/install.js +9 -10
  21. package/src/main.js +54 -57
  22. package/src/mixins/apple.mixin.js +56 -54
  23. package/src/mixins/auth.mixin.js +3 -2
  24. package/src/mixins/global.mixin.js +3 -3
  25. package/src/mixins/google.mixin.js +53 -54
  26. package/src/mixins/microsoft.mixin.js +2 -5
  27. package/src/mixins/okta.mixin.js +1 -1
  28. package/src/mixins/qr-auth.mixin.js +111 -107
  29. package/src/mixins/saml.mixin.js +82 -45
  30. package/src/router/index.js +6 -6
  31. package/src/routes.js +1 -1
  32. package/src/services/Api.js +56 -58
  33. package/src/services/AuthService.js +7 -9
  34. package/src/services/CompanyService.js +10 -10
  35. package/src/services/DeviceService.js +3 -3
  36. package/src/services/UserService.js +48 -45
  37. package/src/services/UtilService.js +317 -225
  38. package/src/store/auth.js +485 -549
  39. package/src/store/constants.js +2 -2
  40. package/src/store/event-bus.js +22 -22
  41. package/src/store/locales/cn.js +476 -458
  42. package/src/store/locales/de.js +478 -517
  43. package/src/store/locales/en.js +454 -513
  44. package/src/store/locales/es.js +477 -524
  45. package/src/store/locales/fr.js +477 -516
  46. package/src/store/locales/it.js +477 -514
  47. package/src/store/locales/ja.js +488 -0
  48. package/src/store/locales/kr.js +477 -491
  49. package/src/store/locales/lang.js +51 -43
  50. package/src/store/locales/pt.js +488 -0
  51. package/src/store/locales/sr.js +477 -492
  52. package/src/store/locales/tr.js +477 -487
  53. package/src/store/store.js +6 -6
  54. package/src/views/Account.vue +36 -8
  55. package/src/views/Billing.vue +464 -34
  56. package/src/views/Callback.vue +36 -33
  57. package/src/views/General.vue +151 -185
  58. package/src/views/Login.vue +2 -25
  59. package/src/views/Register.vue +2 -12
  60. package/src/views/Reset.vue +132 -135
  61. package/src/views/Security.vue +13 -7
  62. package/src/views/Verify.vue +153 -151
  63. package/src/views/Welcome.vue +85 -71
  64. package/dist/Account-Cuz87g_8.js +0 -153
  65. package/dist/Billing-BXlQEuNy.js +0 -113
  66. package/dist/CustomApp-CLCMXmMO.js +0 -83
  67. package/dist/General-dW73bMoR.js +0 -479
  68. package/dist/QR-D6ZGcPM0.js +0 -41
  69. package/dist/index.css +0 -193
  70. package/dist/web-AXRKjAOB.js +0 -92
  71. package/src/components/DELETE_Language.vue +0 -168
  72. package/src/components/DELETE_LinkIcon.vue +0 -288
  73. package/src/components/DELETE_ModalOverlay.vue +0 -68
  74. package/src/components/DELETE_OTP.vue +0 -105
  75. package/src/components/DELETE_SSO.vue +0 -120
  76. package/src/components/DELETE_SSOPick.vue +0 -166
  77. package/src/mixins/DELETE_mfa-auth.mixin.js +0 -53
  78. package/src/mixins/facebook.mixin.js +0 -78
@@ -1,113 +0,0 @@
1
- import { _ as d, A as u, b as g, E as _ } from "./install-L-cxSovH.js";
2
- import { resolveComponent as h, openBlock as e, createElementBlock as n, createCommentVNode as a, createElementVNode as s, createBlock as b, withCtx as m, toDisplayString as i, createTextVNode as f, Fragment as v, renderList as y, pushScopeId as w, popScopeId as k } from "vue";
3
- const I = {
4
- name: "AuthBilling",
5
- mixins: [u],
6
- props: {
7
- payload: {
8
- type: Object,
9
- default: {}
10
- }
11
- },
12
- data() {
13
- return {
14
- loading: !1,
15
- subscriptions: []
16
- };
17
- },
18
- async mounted() {
19
- this.isLoggedIn || this.$router.push("/login");
20
- const t = await g.getRecords({
21
- objectId: "6dc545ea-2e2f-4720-b4fe-c5ebdd8af066",
22
- query: {
23
- where: {
24
- account: this.account.id
25
- },
26
- fields: ["t_subscriptions_name", "t_subscriptions_desc", "t_subscriptions_type", "t_subscriptions_active", "t_subscriptions_app"],
27
- relations: {
28
- t_subscriptions_app: {
29
- fields: [
30
- "t_apps_name",
31
- "t_apps_icon",
32
- "t_apps_url"
33
- ],
34
- relations: {}
35
- }
36
- }
37
- }
38
- });
39
- this.subscriptions = t.data.records;
40
- },
41
- methods: {
42
- close() {
43
- _.$emit("ssoEvent", { name: "toggleAuthModal", data: !0 });
44
- }
45
- }
46
- }, B = (t) => (w("data-v-4d3e1bec"), t = t(), k(), t), x = { class: "page-login content-boxed content-boxed-padding" }, L = /* @__PURE__ */ B(() => /* @__PURE__ */ s("i", { class: "font-17 color-black" }, [
47
- /* @__PURE__ */ s("img", {
48
- src: "https://cdn.tapni.co/icons/down-arrow.png",
49
- class: "responsive-image",
50
- style: { width: "35%" }
51
- })
52
- ], -1)), A = [
53
- L
54
- ], C = { class: "subheaderContainer full-top" }, E = ["src"], S = {
55
- class: "center-text",
56
- style: { "flex-grow": "1", "text-align": "center", margin: "0", "font-weight": "600" }
57
- }, M = { class: "container left-text" }, N = { class: "center-text" }, R = { class: "full-top" }, V = { class: "firstRow" }, $ = ["src"], j = ["src"];
58
- function q(t, c, D, F, l, r) {
59
- const p = h("router-link");
60
- return e(), n("div", x, [
61
- t.isModal ? (e(), n("a", {
62
- key: 0,
63
- onClick: c[0] || (c[0] = (...o) => r.close && r.close(...o)),
64
- class: "color-black pull-right pointer",
65
- style: { "margin-top": "0px", position: "absolute", right: "-20px", "text-align": "right" }
66
- }, A)) : a("", !0),
67
- s("div", C, [
68
- t.isModal ? a("", !0) : (e(), b(p, {
69
- key: 0,
70
- to: "/account",
71
- class: "button gray-button pointer left-button"
72
- }, {
73
- default: m(() => [
74
- s("img", {
75
- src: t.getIcon("arrow-gray-right.svg"),
76
- height: "20",
77
- width: "20",
78
- class: "btn-icon",
79
- style: { rotate: "180deg" }
80
- }, null, 8, E)
81
- ]),
82
- _: 1
83
- })),
84
- s("h2", S, i(t.ssoLang[t.appLanguage].billing), 1)
85
- ]),
86
- s("div", M, [
87
- s("p", N, i(t.ssoLang[t.appLanguage].billing_p), 1),
88
- s("div", R, [
89
- a("", !0),
90
- f(" " + i(t.account.billing) + " ", 1),
91
- (e(!0), n(v, null, y(l.subscriptions, (o) => (e(), n("div", {
92
- key: o.id,
93
- class: "settingRow half-bottom"
94
- }, [
95
- s("div", V, [
96
- s("img", {
97
- src: t.getIcon(t.app.t_apps_icon),
98
- class: "withBackground"
99
- }, null, 8, $),
100
- s("h4", null, i(o.t_subscriptions_name), 1),
101
- s("img", {
102
- src: t.getIcon("arrow-gray-right.svg")
103
- }, null, 8, j)
104
- ])
105
- ]))), 128))
106
- ])
107
- ])
108
- ]);
109
- }
110
- const z = /* @__PURE__ */ d(I, [["render", q], ["__scopeId", "data-v-4d3e1bec"]]);
111
- export {
112
- z as default
113
- };
@@ -1,83 +0,0 @@
1
- import { _ as u, A as _, b as g, E as h } from "./install-L-cxSovH.js";
2
- import { resolveComponent as m, openBlock as o, createElementBlock as n, createCommentVNode as i, createElementVNode as e, createBlock as f, withCtx as b, toDisplayString as r, pushScopeId as y, popScopeId as v } from "vue";
3
- const x = {
4
- name: "AuthCustomApp",
5
- mixins: [_],
6
- props: {
7
- payload: {
8
- type: Object,
9
- default: {}
10
- }
11
- },
12
- data() {
13
- return {
14
- loading: !1,
15
- app: {}
16
- };
17
- },
18
- async mounted() {
19
- this.isLoggedIn || this.$router.push("/login");
20
- const t = await g.getRecordById({
21
- id: this.$route.params.app,
22
- query: {
23
- fields: ["t_apps_name", "t_apps_icon", "t_apps_url"],
24
- relations: []
25
- }
26
- });
27
- this.app = t.data.record;
28
- },
29
- methods: {
30
- close() {
31
- h.$emit("ssoEvent", { name: "toggleAuthModal", data: !0 });
32
- }
33
- }
34
- }, p = (t) => (y("data-v-36b27d1f"), t = t(), v(), t), k = { class: "page-login content-boxed content-boxed-padding" }, w = /* @__PURE__ */ p(() => /* @__PURE__ */ e("i", { class: "font-17 color-black" }, [
35
- /* @__PURE__ */ e("img", {
36
- src: "https://cdn.tapni.co/icons/down-arrow.png",
37
- class: "responsive-image",
38
- style: { width: "35%" }
39
- })
40
- ], -1)), A = [
41
- w
42
- ], C = { class: "subheaderContainer full-top" }, I = ["src"], B = {
43
- class: "center-text",
44
- style: { "flex-grow": "1", "text-align": "center", margin: "0", "font-weight": "600" }
45
- }, E = { class: "container left-text" }, S = { class: "center-text" }, M = /* @__PURE__ */ p(() => /* @__PURE__ */ e("div", { class: "full-top" }, null, -1));
46
- function $(t, s, L, N, c, a) {
47
- const l = m("router-link");
48
- return o(), n("div", k, [
49
- t.isModal ? (o(), n("a", {
50
- key: 0,
51
- onClick: s[0] || (s[0] = (...d) => a.close && a.close(...d)),
52
- class: "color-black pull-right pointer",
53
- style: { "margin-top": "0px", position: "absolute", right: "-20px", "text-align": "right" }
54
- }, A)) : i("", !0),
55
- e("div", C, [
56
- t.isModal ? i("", !0) : (o(), f(l, {
57
- key: 0,
58
- to: "/apps",
59
- class: "button gray-button pointer left-button"
60
- }, {
61
- default: b(() => [
62
- e("img", {
63
- src: t.getIcon("arrow-gray-right.svg"),
64
- height: "20",
65
- width: "20",
66
- class: "btn-icon",
67
- style: { rotate: "180deg" }
68
- }, null, 8, I)
69
- ]),
70
- _: 1
71
- })),
72
- e("h2", B, r(c.app.t_apps_name), 1)
73
- ]),
74
- e("div", E, [
75
- e("p", S, r(t.ssoLang[t.appLanguage].apps_p), 1),
76
- M
77
- ])
78
- ]);
79
- }
80
- const q = /* @__PURE__ */ u(x, [["render", $], ["__scopeId", "data-v-36b27d1f"]]);
81
- export {
82
- q as default
83
- };
@@ -1,479 +0,0 @@
1
- import { _ as le, A as oe, E as te } from "./install-L-cxSovH.js";
2
- import "await-to-js";
3
- import { defineComponent as R, mergeModels as q, useModel as ne, ref as S, computed as G, watch as Z, onMounted as ie, onBeforeUnmount as se, openBlock as p, createElementBlock as b, normalizeClass as V, createElementVNode as i, renderSlot as C, createTextVNode as B, toDisplayString as L, createCommentVNode as z, Fragment as N, renderList as j, createVNode as I, withDirectives as E, vModelText as O, createBlock as _, Teleport as re, normalizeStyle as ue, withCtx as H, withKeys as de, resolveComponent as K, withModifiers as ve, pushScopeId as pe, popScopeId as ce } from "vue";
4
- (function() {
5
- try {
6
- if (typeof document < "u") {
7
- var e = document.createElement("style");
8
- e.appendChild(document.createTextNode(":root{--vs-input-bg: #fff;--vs-input-outline: #3b82f6;--vs-input-placeholder-color: #52525b;--vs-padding: .25rem .5rem;--vs-border: 1px solid #e4e4e7;--vs-border-radius: 4px;--vs-font-size: 16px;--vs-font-weight: 400;--vs-font-family: inherit;--vs-text-color: #18181b;--vs-line-height: 1.5;--vs-menu-offset-top: 8px;--vs-menu-height: 200px;--vs-menu-padding: 0;--vs-menu-border: 1px solid #e4e4e7;--vs-menu-bg: #fff;--vs-menu-box-shadow: none;--vs-menu-z-index: 2;--vs-option-padding: 8px 12px;--vs-option-font-size: var(--vs-font-size);--vs-option-font-weight: var(--vs-font-weight);--vs-option-text-color: var(--vs-text-color);--vs-option-bg: var(--vs-menu-bg);--vs-option-hover-color: #dbeafe;--vs-option-focused-color: var(--vs-option-hover-color);--vs-option-selected-color: #93c5fd;--vs-option-disabled-color: #f4f4f5;--vs-option-disabled-text-color: #52525b;--vs-multi-value-gap: 4px;--vs-multi-value-padding: 4px;--vs-multi-value-font-size: 14px;--vs-multi-value-font-weight: 400;--vs-multi-value-line-height: 1;--vs-multi-value-text-color: #3f3f46;--vs-multi-value-bg: #f4f4f5;--vs-multi-value-xmark-size: 16px;--vs-multi-value-xmark-color: var(--vs-multi-value-text-color);--vs-indicators-gap: 4px;--vs-icon-size: 20px;--vs-icon-color: var(--vs-text-color);--vs-dropdown-transition: transform .25s ease-out}.vue-select[data-v-8ce3e5e3]{position:relative;box-sizing:border-box;width:100%}.vue-select[data-v-8ce3e5e3] *{box-sizing:border-box}.vue-select.open .single-value[data-v-8ce3e5e3]{position:absolute;opacity:.4}.vue-select.open .dropdown-icon[data-v-8ce3e5e3]{transform:rotate(180deg)}.vue-select.typing .single-value[data-v-8ce3e5e3]{opacity:0}.control[data-v-8ce3e5e3]{display:flex;min-height:32px;border:var(--vs-border);border-radius:var(--vs-border-radius);background-color:var(--vs-input-bg)}.control.focused[data-v-8ce3e5e3]{box-shadow:0 0 0 1px var(--vs-input-outline);border-color:var(--vs-input-outline)}.value-container[data-v-8ce3e5e3]{position:relative;display:flex;flex-wrap:wrap;align-items:center;flex-basis:100%;flex-grow:1;padding:var(--vs-padding)}.value-container.multi[data-v-8ce3e5e3]{gap:var(--vs-multi-value-gap)}.single-value[data-v-8ce3e5e3]{display:flex;align-items:center;font-size:var(--vs-font-size);font-weight:var(--vs-font-weight);font-family:var(--vs-font-family);line-height:var(--vs-line-height);color:var(--vs-text-color);z-index:0}.multi-value[data-v-8ce3e5e3]{appearance:none;display:flex;align-items:center;gap:var(--vs-multi-value-gap);padding:var(--vs-multi-value-padding);margin:0;border:0;font-size:var(--vs-multi-value-font-size);font-weight:var(--vs-multi-value-font-weight);color:var(--vs-multi-value-text-color);line-height:var(--vs-multi-value-line-height);background:var(--vs-multi-value-bg);outline:none;cursor:pointer}.multi-value svg[data-v-8ce3e5e3]{width:var(--vs-multi-value-xmark-size);height:var(--vs-multi-value-xmark-size);fill:var(--vs-multi-value-xmark-color)}.search-input[data-v-8ce3e5e3]{appearance:none;display:inline-block;max-width:100%;flex-grow:1;width:0;margin:0;padding:0;border:0;background:none;font-size:var(--vs-font-size);font-family:var(--vs-font-family);line-height:var(--vs-line-height);color:var(--vs-text-color);outline:none;z-index:1}.search-input[data-v-8ce3e5e3]::placeholder{color:var(--vs-input-placeholder-color)}.indicators-container[data-v-8ce3e5e3]{display:flex;align-items:center;flex-shrink:0;gap:var(--vs-indicators-gap);padding:var(--vs-padding)}.clear-button[data-v-8ce3e5e3]{appearance:none;display:inline-block;padding:0;margin:0;border:0;width:var(--vs-icon-size);height:var(--vs-icon-size);fill:var(--vs-icon-color);background:none;outline:none;cursor:pointer}.dropdown-icon[data-v-8ce3e5e3]{appearance:none;display:inline-block;padding:0;margin:0;border:0;width:var(--vs-icon-size);height:var(--vs-icon-size);fill:var(--vs-icon-color);background:none;outline:none;cursor:pointer;transition:var(--vs-dropdown-transition)}.menu[data-v-8ce3e5e3]{position:absolute;left:0;right:0;padding:var(--vs-menu-padding);margin-top:var(--vs-menu-offset-top);max-height:var(--vs-menu-height);overflow-y:auto;border:var(--vs-menu-border);border-radius:var(--vs-border-radius);box-shadow:var(--vs-menu-box-shadow);background-color:var(--vs-menu-bg);z-index:var(--vs-menu-z-index)}.menu-option[data-v-8ce3e5e3]{display:flex;width:100%;border:0;margin:0;padding:var(--vs-option-padding);font-size:var(--vs-option-font-size);font-weight:var(--vs-option-font-weight);font-family:var(--vs-font-family);color:var(--vs-option-text-color);background-color:var(--vs-option-bg);text-align:-webkit-auto;cursor:pointer}.menu-option[data-v-8ce3e5e3]:hover{background-color:var(--vs-option-hover-color)}.menu-option.focused[data-v-8ce3e5e3]{background-color:var(--vs-option-focused-color)}.menu-option.selected[data-v-8ce3e5e3]{background-color:var(--vs-option-selected-color)}.menu-option.disabled[data-v-8ce3e5e3]{background-color:var(--vs-option-disabled-color);color:var(--vs-option-disabled-text-color)}.no-results[data-v-8ce3e5e3]{padding:var(--vs-option-padding);font-size:var(--vs-font-size);font-family:var(--vs-font-family);color:var(--vs-text-color)}")), document.head.appendChild(e);
9
- }
10
- } catch (o) {
11
- console.error("vite-plugin-css-injected-by-js", o);
12
- }
13
- })();
14
- const U = (e, o) => {
15
- const l = e.__vccOpts || e;
16
- for (const [f, t] of o)
17
- l[f] = t;
18
- return l;
19
- }, ge = {}, be = {
20
- xmlns: "http://www.w3.org/2000/svg",
21
- viewBox: "0 0 20 20",
22
- fill: "currentColor"
23
- }, fe = /* @__PURE__ */ i("path", {
24
- "fill-rule": "evenodd",
25
- d: "M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",
26
- "clip-rule": "evenodd"
27
- }, null, -1), me = [
28
- fe
29
- ];
30
- function he(e, o) {
31
- return p(), b("svg", be, me);
32
- }
33
- const ye = /* @__PURE__ */ U(ge, [["render", he]]), we = {}, ke = {
34
- xmlns: "http://www.w3.org/2000/svg",
35
- viewBox: "0 0 20 20",
36
- fill: "currentColor"
37
- }, Le = /* @__PURE__ */ i("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" }, null, -1), xe = [
38
- Le
39
- ];
40
- function Me(e, o) {
41
- return p(), b("svg", ke, xe);
42
- }
43
- const P = /* @__PURE__ */ U(we, [["render", Me]]), ze = ["aria-disabled", "aria-selected"], Se = /* @__PURE__ */ R({
44
- __name: "MenuOption",
45
- props: {
46
- menu: {},
47
- index: {},
48
- isFocused: { type: Boolean },
49
- isSelected: { type: Boolean },
50
- isDisabled: { type: Boolean }
51
- },
52
- emits: ["select"],
53
- setup(e, { emit: o }) {
54
- const l = e, f = o, t = S(null);
55
- return Z(
56
- () => l.isFocused,
57
- () => {
58
- if (l.isFocused && l.menu) {
59
- const r = l.menu.children[l.index], c = r.offsetTop, y = c + r.clientHeight, s = l.menu.scrollTop, u = l.menu.clientHeight;
60
- c < s ? l.menu.scrollTop = c : y > s + u && (l.menu.scrollTop = y - u);
61
- }
62
- }
63
- ), (r, c) => (p(), b("div", {
64
- ref_key: "option",
65
- ref: t,
66
- tabindex: "-1",
67
- role: "option",
68
- class: V({ focused: r.isFocused, selected: r.isSelected, disabled: r.isDisabled }),
69
- "aria-disabled": r.isDisabled,
70
- "aria-selected": r.isSelected,
71
- onClick: c[0] || (c[0] = (y) => f("select")),
72
- onKeydown: c[1] || (c[1] = de((y) => f("select"), ["enter"]))
73
- }, [
74
- C(r.$slots, "default")
75
- ], 42, ze));
76
- }
77
- }), Ce = ["aria-expanded", "aria-describedby", "aria-description", "aria-labelledby", "aria-label", "aria-required"], De = ["onClick"], Ve = ["id", "disabled", "placeholder"], Be = { class: "indicators-container" }, Ie = ["disabled"], _e = ["disabled"], Ae = ["aria-label", "aria-multiselectable"], Ee = {
78
- key: 0,
79
- class: "no-results"
80
- }, Oe = /* @__PURE__ */ R({
81
- __name: "Select",
82
- props: /* @__PURE__ */ q({
83
- options: {},
84
- displayedOptions: {},
85
- placeholder: { default: "Select an option" },
86
- isClearable: { type: Boolean, default: !0 },
87
- isDisabled: { type: Boolean, default: !1 },
88
- isSearchable: { type: Boolean, default: !0 },
89
- isMulti: { type: Boolean, default: !1 },
90
- closeOnSelect: { type: Boolean, default: !0 },
91
- teleport: { default: void 0 },
92
- inputId: { default: void 0 },
93
- aria: { default: void 0 },
94
- filterBy: { type: Function, default: (e, o, l) => o.toLowerCase().includes(l.toLowerCase()) },
95
- getOptionLabel: { type: Function, default: (e) => e.label },
96
- getMultiValueLabel: { type: Function, default: (e) => e.label }
97
- }, {
98
- modelValue: {
99
- required: !0,
100
- validator: (e, o) => o.isMulti ? Array.isArray(e) : !Array.isArray(e)
101
- },
102
- modelModifiers: {}
103
- }),
104
- emits: /* @__PURE__ */ q(["optionSelected", "optionDeselected", "search"], ["update:modelValue"]),
105
- setup(e, { emit: o }) {
106
- const l = e, f = o, t = ne(e, "modelValue"), r = S(null), c = S(null), y = S(null), s = S(""), u = S(!1), g = S(-1), x = G(() => {
107
- const a = l.displayedOptions || l.options, n = (m) => m.filter(
108
- (d) => !t.value.includes(d.value)
109
- );
110
- if (l.isSearchable && s.value) {
111
- const m = a.filter((d) => {
112
- const M = l.isMulti ? l.getMultiValueLabel(d) : l.getOptionLabel(d);
113
- return l.filterBy(d, M, s.value);
114
- });
115
- return l.isMulti ? n(m) : m;
116
- }
117
- return l.isMulti ? n(a) : a;
118
- }), w = G(() => {
119
- if (l.isMulti && Array.isArray(t.value))
120
- return t.value.map(
121
- (n) => l.options.find((m) => m.value === n)
122
- );
123
- l.isMulti && !Array.isArray(t.value) && console.warn(`[vue3-select-component warn]: The v-model provided should be an array when using \`isMulti\` prop, instead it was: ${t.value}`);
124
- const a = l.options.find((n) => n.value === t.value);
125
- return a ? [a] : [];
126
- }), D = (a) => {
127
- u.value = !0, g.value = l.options.findIndex((n) => !n.disabled), a != null && a.focusInput && c.value && c.value.focus();
128
- }, X = () => {
129
- u.value = !1, s.value = "";
130
- }, A = (a) => {
131
- a.disabled || (l.isMulti ? t.value.push(a.value) : t.value = a.value, f("optionSelected", a), s.value = "", l.closeOnSelect && (u.value = !1), c.value && c.value.blur());
132
- }, Q = (a) => {
133
- l.isMulti && !l.isDisabled && (t.value = t.value.filter((n) => n !== a.value), f("optionDeselected", a));
134
- }, W = () => {
135
- l.isMulti ? (t.value = [], f("optionDeselected", null)) : (t.value = void 0, f("optionDeselected", w.value[0])), u.value = !1, s.value = "", c.value && c.value.blur();
136
- }, $ = (a) => {
137
- if (u.value) {
138
- const n = g.value;
139
- if (a.key === "ArrowDown") {
140
- a.preventDefault();
141
- const d = x.value.findIndex((k, v) => !k.disabled && v > n), M = x.value.findIndex((k) => !k.disabled);
142
- g.value = d === -1 ? M : d;
143
- }
144
- if (a.key === "ArrowUp") {
145
- a.preventDefault();
146
- const d = x.value.reduce(
147
- (k, v, h) => !v.disabled && h < n ? h : k,
148
- -1
149
- ), M = x.value.reduce(
150
- (k, v, h) => v.disabled ? k : h,
151
- -1
152
- );
153
- g.value = d === -1 ? M : d;
154
- }
155
- if (a.key === "Enter") {
156
- const d = x.value[n];
157
- a.preventDefault(), d && A(d);
158
- }
159
- if (a.code === "Space" && s.value.length === 0) {
160
- const d = x.value[n];
161
- a.preventDefault(), d && A(d);
162
- }
163
- a.key === "Escape" && (a.preventDefault(), u.value = !1, s.value = "");
164
- const m = l.isMulti ? t.value.length > 0 : !!t.value;
165
- a.key === "Backspace" && s.value.length === 0 && m && (a.preventDefault(), l.isMulti ? t.value = t.value.slice(0, -1) : t.value = void 0);
166
- }
167
- }, Y = (a) => {
168
- !u.value && s.value.length === 0 && (a.preventDefault(), a.stopImmediatePropagation(), D());
169
- }, ee = (a) => {
170
- a.key === "Tab" ? X() : a.key === "Space" && Y(a);
171
- }, T = (a) => {
172
- r.value && !r.value.contains(a.target) && (u.value = !1, s.value = "");
173
- }, F = () => {
174
- if (r.value) {
175
- const a = r.value.getBoundingClientRect();
176
- return {
177
- left: `${a.x}px`,
178
- top: `${a.y + a.height}px`
179
- };
180
- }
181
- return console.warn("Unable to calculate dynamic menu position because of missing internal DOM reference."), { top: "0px", left: "0px" };
182
- };
183
- return Z(
184
- () => s.value,
185
- () => {
186
- f("search", s.value), s.value && !u.value && D();
187
- }
188
- ), ie(() => {
189
- document.addEventListener("click", T), document.addEventListener("keydown", $);
190
- }), se(() => {
191
- document.removeEventListener("click", T), document.removeEventListener("keydown", $);
192
- }), (a, n) => {
193
- var m, d, M, k;
194
- return p(), b("div", {
195
- ref_key: "container",
196
- ref: r,
197
- dir: "auto",
198
- class: V(["vue-select", { open: u.value, typing: u.value && s.value.length > 0, disabled: a.isDisabled }])
199
- }, [
200
- i("div", {
201
- class: V(["control", { focused: u.value }])
202
- }, [
203
- i("div", {
204
- class: V(["value-container", { multi: a.isMulti }]),
205
- role: "combobox",
206
- "aria-expanded": u.value,
207
- "aria-describedby": a.placeholder,
208
- "aria-description": a.placeholder,
209
- "aria-labelledby": (m = a.aria) == null ? void 0 : m.labelledby,
210
- "aria-label": w.value.length ? w.value.map(a.isMulti ? a.getMultiValueLabel : a.getOptionLabel).join(", ") : "",
211
- "aria-required": (d = a.aria) == null ? void 0 : d.required
212
- }, [
213
- !l.isMulti && w.value[0] ? (p(), b("div", {
214
- key: 0,
215
- class: "single-value",
216
- onClick: n[0] || (n[0] = (v) => l.isDisabled ? null : D({ focusInput: !0 }))
217
- }, [
218
- C(a.$slots, "value", {
219
- option: w.value[0]
220
- }, () => [
221
- B(L(a.getOptionLabel(w.value[0])), 1)
222
- ], !0)
223
- ])) : z("", !0),
224
- l.isMulti && w.value.length ? (p(!0), b(N, { key: 1 }, j(w.value, (v, h) => (p(), b("button", {
225
- key: h,
226
- type: "button",
227
- class: "multi-value",
228
- onClick: (ae) => Q(v)
229
- }, [
230
- B(L(a.getMultiValueLabel(v)), 1),
231
- I(P)
232
- ], 8, De))), 128)) : z("", !0),
233
- E(i("input", {
234
- id: a.inputId,
235
- ref_key: "input",
236
- ref: c,
237
- "onUpdate:modelValue": n[1] || (n[1] = (v) => s.value = v),
238
- class: "search-input",
239
- type: "text",
240
- "aria-autocomplete": "list",
241
- autocapitalize: "none",
242
- autocomplete: "off",
243
- autocorrect: "off",
244
- spellcheck: "false",
245
- tabindex: "0",
246
- disabled: a.isDisabled,
247
- placeholder: w.value.length === 0 ? a.placeholder : "",
248
- onMousedown: n[2] || (n[2] = (v) => D()),
249
- onKeydown: ee
250
- }, null, 40, Ve), [
251
- [O, s.value]
252
- ])
253
- ], 10, Ce),
254
- i("div", Be, [
255
- w.value.length > 0 && a.isClearable ? (p(), b("button", {
256
- key: 0,
257
- type: "button",
258
- class: "clear-button",
259
- tabindex: "-1",
260
- disabled: a.isDisabled,
261
- onClick: W
262
- }, [
263
- C(a.$slots, "clear", {}, () => [
264
- I(P)
265
- ], !0)
266
- ], 8, Ie)) : z("", !0),
267
- i("button", {
268
- type: "button",
269
- class: "dropdown-icon",
270
- tabindex: "-1",
271
- disabled: a.isDisabled,
272
- onClick: n[3] || (n[3] = (v) => D({ focusInput: !0 }))
273
- }, [
274
- C(a.$slots, "dropdown", {}, () => [
275
- I(ye)
276
- ], !0)
277
- ], 8, _e)
278
- ])
279
- ], 2),
280
- (p(), _(re, {
281
- to: a.teleport,
282
- disabled: !a.teleport
283
- }, [
284
- u.value ? (p(), b("div", {
285
- key: 0,
286
- ref_key: "menu",
287
- ref: y,
288
- class: "menu",
289
- role: "listbox",
290
- "aria-label": (M = a.aria) == null ? void 0 : M.labelledby,
291
- "aria-multiselectable": a.isMulti,
292
- style: ue({
293
- width: l.teleport ? `${(k = r.value) == null ? void 0 : k.getBoundingClientRect().width}px` : "100%",
294
- top: l.teleport ? F().top : "unset",
295
- left: l.teleport ? F().left : "unset"
296
- })
297
- }, [
298
- C(a.$slots, "menu-header", {}, void 0, !0),
299
- (p(!0), b(N, null, j(x.value, (v, h) => (p(), _(Se, {
300
- key: h,
301
- type: "button",
302
- class: V(["menu-option", { focused: g.value === h, selected: v.value === t.value }]),
303
- menu: y.value,
304
- index: h,
305
- "is-focused": g.value === h,
306
- "is-selected": v.value === t.value,
307
- "is-disabled": v.disabled || !1,
308
- onSelect: (ae) => A(v)
309
- }, {
310
- default: H(() => [
311
- C(a.$slots, "option", { option: v }, () => [
312
- B(L(a.getOptionLabel(v)), 1)
313
- ], !0)
314
- ]),
315
- _: 2
316
- }, 1032, ["class", "menu", "index", "is-focused", "is-selected", "is-disabled", "onSelect"]))), 128)),
317
- x.value.length === 0 ? (p(), b("div", Ee, [
318
- C(a.$slots, "no-options", {}, () => [
319
- B(" No results found ")
320
- ], !0)
321
- ])) : z("", !0)
322
- ], 12, Ae)) : z("", !0)
323
- ], 8, ["to", "disabled"]))
324
- ], 2);
325
- };
326
- }
327
- }), Ue = /* @__PURE__ */ U(Oe, [["__scopeId", "data-v-8ce3e5e3"]]), $e = {
328
- name: "AuthGeneral",
329
- mixins: [oe],
330
- components: {
331
- VueSelect: Ue
332
- },
333
- props: {
334
- payload: {
335
- type: Object,
336
- default: {}
337
- }
338
- },
339
- data() {
340
- return {
341
- loading: !1
342
- };
343
- },
344
- async mounted() {
345
- this.isLoggedIn || this.$router.push("/login"), this.isEmpty(this.account) && this.$router.push("/account");
346
- },
347
- methods: {
348
- close() {
349
- te.$emit("ssoEvent", { name: "toggleAuthModal", data: !0 });
350
- },
351
- async submitGeneralUpdate() {
352
- if (this.password.length < 8) return this.errorSnack(this.ssoLang[this.appLanguage].password_8_chars);
353
- this.loading = !0, await this.newPassword({}) === !0 && (this.successSnack(this.ssoLang[this.appLanguage].password_change_success), this.changePassword = !1), this.loading = !1;
354
- }
355
- }
356
- }, J = (e) => (pe("data-v-9dc93691"), e = e(), ce(), e), Te = { class: "page-login content-boxed content-boxed-padding" }, Fe = /* @__PURE__ */ J(() => /* @__PURE__ */ i("i", { class: "font-17 color-black" }, [
357
- /* @__PURE__ */ i("img", {
358
- src: "https://cdn.tapni.co/icons/down-arrow.png",
359
- class: "responsive-image",
360
- style: { width: "35%" }
361
- })
362
- ], -1)), qe = [
363
- Fe
364
- ], Ge = { class: "subheaderContainer full-top" }, Ne = ["src"], je = {
365
- class: "center-text",
366
- style: { "flex-grow": "1", "text-align": "center", margin: "0", "font-weight": "600" }
367
- }, Ke = { class: "container left-text" }, Pe = { class: "center-text" }, Re = { class: "full-top bold small-bottom" }, Ze = ["placeholder"], He = ["placeholder"], Je = { class: "full-top bold" }, Xe = { class: "full-top bold" }, Qe = /* @__PURE__ */ J(() => /* @__PURE__ */ i("p", null, "Translate the app on your preferred language.", -1)), We = {
368
- type: "submit",
369
- class: "button black-button button-full google-button bg-tapni-grey button-90 button-center uppercase bold full-top pointer"
370
- }, Ye = { key: 0 }, ea = {
371
- key: 1,
372
- class: "button--loading button__loader"
373
- };
374
- function aa(e, o, l, f, t, r) {
375
- var s, u;
376
- const c = K("router-link"), y = K("VueSelect");
377
- return p(), b("div", Te, [
378
- e.isModal ? (p(), b("a", {
379
- key: 0,
380
- onClick: o[0] || (o[0] = (...g) => r.close && r.close(...g)),
381
- class: "color-black pull-right pointer",
382
- style: { "margin-top": "0px", position: "absolute", right: "-20px", "text-align": "right" }
383
- }, qe)) : z("", !0),
384
- i("div", Ge, [
385
- e.isModal ? z("", !0) : (p(), _(c, {
386
- key: 0,
387
- to: "/account",
388
- class: "button gray-button pointer left-button"
389
- }, {
390
- default: H(() => [
391
- i("img", {
392
- src: e.getIcon("arrow-gray-right.svg"),
393
- height: "20",
394
- width: "20",
395
- class: "btn-icon",
396
- style: { rotate: "180deg" }
397
- }, null, 8, Ne)
398
- ]),
399
- _: 1
400
- })),
401
- i("h2", je, L(e.ssoLang[e.appLanguage].general), 1)
402
- ]),
403
- i("div", Ke, [
404
- i("p", Pe, L(e.ssoLang[e.appLanguage].general_p), 1),
405
- i("form", {
406
- class: "full-top",
407
- onSubmit: o[5] || (o[5] = ve((...g) => r.submitGeneralUpdate && r.submitGeneralUpdate(...g), ["prevent"]))
408
- }, [
409
- i("h3", Re, L(e.ssoLang[e.appLanguage].personal_details), 1),
410
- E(i("input", {
411
- type: "text",
412
- "onUpdate:modelValue": o[1] || (o[1] = (g) => e.account.name = g),
413
- placeholder: e.ssoLang[e.appLanguage].name,
414
- class: "edit-input h-40 lh-40 small-bottom",
415
- required: "",
416
- style: { width: "100%" }
417
- }, null, 8, Ze), [
418
- [O, e.account.name]
419
- ]),
420
- E(i("input", {
421
- disabled: "",
422
- type: "email",
423
- "onUpdate:modelValue": o[2] || (o[2] = (g) => e.account.email = g),
424
- placeholder: e.ssoLang[e.appLanguage].email,
425
- class: "bg-white edit-input h-40 lh-40 small-bottom",
426
- required: "",
427
- style: { width: "100%" }
428
- }, null, 8, He), [
429
- [O, e.account.email]
430
- ]),
431
- i("h3", Je, L(e.ssoLang[e.appLanguage].app_region), 1),
432
- e.account.billing ? (p(), _(y, {
433
- key: 0,
434
- modelValue: e.account.billing.region,
435
- "onUpdate:modelValue": o[3] || (o[3] = (g) => e.account.billing.region = g),
436
- options: [
437
- { label: "United States", value: "us" },
438
- { label: "United Kingdom", value: "uk" },
439
- { label: "European Union", value: "eu" },
440
- { label: "Mexico", value: "mx" },
441
- { label: "Mauritius", value: "mu" },
442
- { label: "Colombia", value: "co" },
443
- { label: "Serbia", value: "sr" },
444
- { label: "China", value: "cn" }
445
- ],
446
- isClearable: !1,
447
- placeholder: "Select region"
448
- }, null, 8, ["modelValue"])) : z("", !0),
449
- i("p", null, "Default currency for this region is " + L((u = (s = e.account.billing) == null ? void 0 : s.currency) == null ? void 0 : u.toUpperCase()), 1),
450
- i("h3", Xe, L(e.ssoLang[e.appLanguage].app_language), 1),
451
- I(y, {
452
- modelValue: e.account.lang,
453
- "onUpdate:modelValue": o[4] || (o[4] = (g) => e.account.lang = g),
454
- options: [
455
- { label: e.ssoLang[e.appLanguage].english, value: "en" },
456
- { label: e.ssoLang[e.appLanguage].german, value: "de" },
457
- { label: e.ssoLang[e.appLanguage].spanish, value: "es" },
458
- { label: e.ssoLang[e.appLanguage].italian, value: "it" },
459
- { label: e.ssoLang[e.appLanguage].french, value: "fr" },
460
- { label: e.ssoLang[e.appLanguage].turkish, value: "tr" },
461
- { label: e.ssoLang[e.appLanguage].serbian, value: "sr" },
462
- { label: e.ssoLang[e.appLanguage].korean, value: "kr" },
463
- { label: e.ssoLang[e.appLanguage].chinese, value: "cn" }
464
- ],
465
- isClearable: !1,
466
- placeholder: "Select language"
467
- }, null, 8, ["modelValue", "options"]),
468
- Qe,
469
- i("button", We, [
470
- t.loading ? (p(), b("span", ea)) : (p(), b("span", Ye, L(e.ssoLang[e.appLanguage].save), 1))
471
- ])
472
- ], 32)
473
- ])
474
- ]);
475
- }
476
- const na = /* @__PURE__ */ le($e, [["render", aa], ["__scopeId", "data-v-9dc93691"]]);
477
- export {
478
- na as default
479
- };