aesirx-analytics 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +35 -2
- package/dist/{Consent-7KHERFGJ.js → Consent-6SCX7LT4.js} +457 -268
- package/dist/analytics.js +8496 -134
- package/dist/index.js +4 -4
- package/package.json +5 -2
@@ -3,6 +3,7 @@ import {
|
|
3
3
|
} from "./chunk-JQ6CXYV4.js";
|
4
4
|
|
5
5
|
// src/utils/consent.ts
|
6
|
+
import { stringMessage } from "@concordium/react-components";
|
6
7
|
import axios from "axios";
|
7
8
|
var agreeConsents = async (endpoint, level, uuid, consent, wallet, signature, web3id, jwt, network = "concordium") => {
|
8
9
|
const url = `${endpoint}/consent/v1/level${level}/${uuid}`;
|
@@ -59,7 +60,7 @@ var getSignature = async (endpoint, address, provider, text, network = "concordi
|
|
59
60
|
}
|
60
61
|
};
|
61
62
|
var getSignedNonce = async (nonce, address, provider) => {
|
62
|
-
const signature = await provider.signMessage(address,
|
63
|
+
const signature = await provider.signMessage(address, stringMessage(`${nonce}`));
|
63
64
|
return Buffer.from(
|
64
65
|
typeof signature === "object" && signature !== null ? JSON.stringify(signature) : signature,
|
65
66
|
"utf-8"
|
@@ -96,12 +97,11 @@ var revokeConsents = async (endpoint, level, uuid, wallet, signature, web3id, jw
|
|
96
97
|
};
|
97
98
|
|
98
99
|
// src/Components/Consent.tsx
|
99
|
-
import
|
100
|
-
import { Button, Form } from "react-bootstrap";
|
100
|
+
import React3, { useState as useState3 } from "react";
|
101
|
+
import { Button as Button2, Form } from "react-bootstrap";
|
101
102
|
|
102
103
|
// src/Hooks/useConsentStatus.ts
|
103
104
|
import { useCallback, useContext, useEffect, useState } from "react";
|
104
|
-
import { detectConcordiumProvider } from "@concordium/browser-wallet-api-helpers";
|
105
105
|
|
106
106
|
// src/utils/Concordium.ts
|
107
107
|
import {
|
@@ -184,13 +184,43 @@ var getWeb3ID = async (provider, account) => {
|
|
184
184
|
|
185
185
|
// src/Hooks/useConsentStatus.ts
|
186
186
|
import { toast } from "react-toastify";
|
187
|
-
|
187
|
+
import { isMobile, isDesktop, osName, OsTypes } from "react-device-detect";
|
188
|
+
|
189
|
+
// src/Hooks/config.ts
|
190
|
+
import {
|
191
|
+
BrowserWalletConnector,
|
192
|
+
CONCORDIUM_WALLET_CONNECT_PROJECT_ID,
|
193
|
+
WalletConnectConnector,
|
194
|
+
ephemeralConnectorType
|
195
|
+
} from "@concordium/react-components";
|
196
|
+
var WALLET_CONNECT_OPTS = {
|
197
|
+
projectId: CONCORDIUM_WALLET_CONNECT_PROJECT_ID,
|
198
|
+
metadata: {
|
199
|
+
name: "Sign Message",
|
200
|
+
description: "Example dApp for signing an arbitrary message.",
|
201
|
+
url: "#",
|
202
|
+
icons: ["https://walletconnect.com/walletconnect-logo.png"]
|
203
|
+
}
|
204
|
+
};
|
205
|
+
var BROWSER_WALLET = ephemeralConnectorType(BrowserWalletConnector.create);
|
206
|
+
var WALLET_CONNECT = ephemeralConnectorType(
|
207
|
+
WalletConnectConnector.create.bind(void 0, WALLET_CONNECT_OPTS)
|
208
|
+
);
|
209
|
+
|
210
|
+
// src/Hooks/useConsentStatus.ts
|
211
|
+
import {
|
212
|
+
MAINNET,
|
213
|
+
useConnection,
|
214
|
+
useConnect,
|
215
|
+
withJsonRpcClient
|
216
|
+
} from "@concordium/react-components";
|
217
|
+
var useConsentStatus = (endpoint, props) => {
|
188
218
|
const [show, setShow] = useState(false);
|
189
219
|
const [showRevoke, setShowRevoke] = useState(false);
|
190
220
|
const [level, setLevel] = useState();
|
191
|
-
const [provider, setProvider] = useState(null);
|
192
221
|
const [web3ID, setWeb3ID] = useState();
|
193
222
|
const analyticsContext = useContext(AnalyticsContext);
|
223
|
+
const { activeConnector, network, connectedAccounts, genesisHashes, setActiveConnectorType } = props;
|
194
224
|
useEffect(() => {
|
195
225
|
const allow = sessionStorage.getItem("aesirx-analytics-allow");
|
196
226
|
const currentUuid = sessionStorage.getItem("aesirx-analytics-uuid");
|
@@ -204,7 +234,7 @@ var useConsentStatus = (endpoint) => {
|
|
204
234
|
if (level > 1) {
|
205
235
|
sessionStorage.setItem("aesirx-analytics-uuid", analyticsContext.visitor_uuid);
|
206
236
|
sessionStorage.setItem("aesirx-analytics-allow", "1");
|
207
|
-
|
237
|
+
handleRevoke(true, "1");
|
208
238
|
}
|
209
239
|
consentList.forEach((consent) => {
|
210
240
|
if (consent.expiration && new Date(consent.expiration) < /* @__PURE__ */ new Date()) {
|
@@ -214,48 +244,114 @@ var useConsentStatus = (endpoint) => {
|
|
214
244
|
} else {
|
215
245
|
sessionStorage.setItem("aesirx-analytics-uuid", analyticsContext.visitor_uuid);
|
216
246
|
sessionStorage.setItem("aesirx-analytics-allow", "1");
|
247
|
+
if (consent) {
|
248
|
+
const revokeTier = !consent?.consent_uuid ? "1" : consent?.web3id && consent?.address ? "4" : consent?.address && !consent?.web3id ? "3" : "2";
|
249
|
+
handleRevoke(true, revokeTier);
|
250
|
+
}
|
217
251
|
}
|
218
252
|
});
|
219
253
|
}
|
220
254
|
})();
|
221
255
|
}
|
222
256
|
}, [analyticsContext.visitor_uuid]);
|
257
|
+
const { connection, setConnection, account, genesisHash } = useConnection(
|
258
|
+
connectedAccounts,
|
259
|
+
genesisHashes
|
260
|
+
);
|
261
|
+
const { connect, connectError } = useConnect(activeConnector, setConnection);
|
262
|
+
const [, setRpcGenesisHash] = useState();
|
263
|
+
const [, setRpcError] = useState("");
|
264
|
+
useEffect(() => {
|
265
|
+
if (connection) {
|
266
|
+
setRpcGenesisHash(void 0);
|
267
|
+
withJsonRpcClient(connection, async (rpc) => {
|
268
|
+
const status = await rpc.getConsensusStatus();
|
269
|
+
return status.genesisBlock;
|
270
|
+
}).then((hash) => {
|
271
|
+
const network2 = "mainnet";
|
272
|
+
let r = false;
|
273
|
+
switch (network2) {
|
274
|
+
default:
|
275
|
+
r = hash === MAINNET.genesisHash;
|
276
|
+
}
|
277
|
+
if (!r) {
|
278
|
+
const network3 = "mainnet";
|
279
|
+
throw new Error(`Please change the network to ${network3} in Wallet`);
|
280
|
+
}
|
281
|
+
setRpcGenesisHash(hash);
|
282
|
+
setRpcError("");
|
283
|
+
}).catch((err) => {
|
284
|
+
setRpcGenesisHash(void 0);
|
285
|
+
toast(err.message);
|
286
|
+
setRpcError(err.message);
|
287
|
+
});
|
288
|
+
}
|
289
|
+
}, [connection, genesisHash, network]);
|
290
|
+
useEffect(() => {
|
291
|
+
if (activeConnector) {
|
292
|
+
connect();
|
293
|
+
}
|
294
|
+
}, [activeConnector]);
|
295
|
+
useEffect(() => {
|
296
|
+
if (connectError) {
|
297
|
+
toast.error(connectError);
|
298
|
+
}
|
299
|
+
}, [connectError]);
|
300
|
+
useEffect(() => {
|
301
|
+
if (isDesktop && sessionStorage.getItem("aesirx-analytics-revoke") !== "1" && sessionStorage.getItem("aesirx-analytics-revoke") !== "2") {
|
302
|
+
setActiveConnectorType(BROWSER_WALLET);
|
303
|
+
}
|
304
|
+
}, []);
|
223
305
|
useEffect(() => {
|
224
306
|
(async () => {
|
225
307
|
try {
|
226
308
|
let l = level;
|
227
|
-
|
228
|
-
|
229
|
-
provider2.on("accountDisconnected", () => {
|
230
|
-
setLevel(3);
|
231
|
-
});
|
232
|
-
provider2.on("accountChanged", () => setLevel(4));
|
309
|
+
if (connection) {
|
310
|
+
setLevel(null);
|
233
311
|
l = 3;
|
234
312
|
let web3ID2 = "";
|
235
|
-
|
236
|
-
|
237
|
-
web3ID2 = await getWeb3ID(provider2, accountAddress);
|
313
|
+
if (account) {
|
314
|
+
web3ID2 = await getWeb3ID(connection, account);
|
238
315
|
if (web3ID2) {
|
239
316
|
l = 4;
|
240
317
|
}
|
241
318
|
}
|
242
|
-
setProvider(provider2);
|
243
|
-
setLevel(l);
|
244
319
|
setWeb3ID(web3ID2);
|
320
|
+
setLevel(l);
|
321
|
+
} else {
|
322
|
+
setLevel(level ?? 1);
|
245
323
|
}
|
246
324
|
} catch (error) {
|
247
325
|
setLevel(level ?? 1);
|
248
326
|
}
|
249
327
|
})();
|
250
|
-
}, [
|
328
|
+
}, [account]);
|
251
329
|
const handleLevel = useCallback(
|
252
330
|
async (_level) => {
|
253
331
|
if (_level === 2) {
|
254
332
|
setLevel(_level);
|
255
333
|
} else if (_level === 3) {
|
256
334
|
try {
|
257
|
-
|
258
|
-
|
335
|
+
if (isDesktop) {
|
336
|
+
setActiveConnectorType(BROWSER_WALLET);
|
337
|
+
setLevel(null);
|
338
|
+
if (!activeConnector) {
|
339
|
+
setLevel(1);
|
340
|
+
toast("Browser Wallet extension not detected");
|
341
|
+
} else {
|
342
|
+
setLevel(_level);
|
343
|
+
}
|
344
|
+
} else {
|
345
|
+
if (osName === OsTypes?.IOS && isMobile) {
|
346
|
+
setLevel(1);
|
347
|
+
toast("Wallet Connect not support on IOS");
|
348
|
+
} else if (isMobile) {
|
349
|
+
setActiveConnectorType(WALLET_CONNECT);
|
350
|
+
setLevel(_level);
|
351
|
+
} else {
|
352
|
+
setLevel(_level);
|
353
|
+
}
|
354
|
+
}
|
259
355
|
} catch (error) {
|
260
356
|
setLevel(1);
|
261
357
|
toast("Browser Wallet extension not detected");
|
@@ -263,8 +359,7 @@ var useConsentStatus = (endpoint) => {
|
|
263
359
|
} else if (_level === 4) {
|
264
360
|
setLevel(null);
|
265
361
|
try {
|
266
|
-
const
|
267
|
-
const web3ID2 = await getWeb3ID(provider, accountAddress);
|
362
|
+
const web3ID2 = await getWeb3ID(connection, account);
|
268
363
|
if (web3ID2) {
|
269
364
|
setLevel(_level);
|
270
365
|
setWeb3ID(web3ID2);
|
@@ -286,7 +381,8 @@ var useConsentStatus = (endpoint) => {
|
|
286
381
|
return [
|
287
382
|
analyticsContext.visitor_uuid,
|
288
383
|
level,
|
289
|
-
|
384
|
+
connection,
|
385
|
+
account,
|
290
386
|
show,
|
291
387
|
setShow,
|
292
388
|
web3ID,
|
@@ -1027,63 +1123,10 @@ var css = `:root {
|
|
1027
1123
|
--aesirxconsent-form-invalid-border-color: #dc3545;
|
1028
1124
|
}
|
1029
1125
|
|
1030
|
-
[data-bs-theme=dark] {
|
1031
|
-
color-scheme: dark;
|
1032
|
-
--aesirxconsent-body-color: #adb5bd;
|
1033
|
-
--aesirxconsent-body-color-rgb: 173, 181, 189;
|
1034
|
-
--aesirxconsent-body-bg: #212529;
|
1035
|
-
--aesirxconsent-body-bg-rgb: 33, 37, 41;
|
1036
|
-
--aesirxconsent-emphasis-color: #fff;
|
1037
|
-
--aesirxconsent-emphasis-color-rgb: 255, 255, 255;
|
1038
|
-
--aesirxconsent-secondary-color: rgba(173, 181, 189, 0.75);
|
1039
|
-
--aesirxconsent-secondary-color-rgb: 173, 181, 189;
|
1040
|
-
--aesirxconsent-secondary-bg: #343a40;
|
1041
|
-
--aesirxconsent-secondary-bg-rgb: 52, 58, 64;
|
1042
|
-
--aesirxconsent-tertiary-color: rgba(173, 181, 189, 0.5);
|
1043
|
-
--aesirxconsent-tertiary-color-rgb: 173, 181, 189;
|
1044
|
-
--aesirxconsent-tertiary-bg: #2b3035;
|
1045
|
-
--aesirxconsent-tertiary-bg-rgb: 43, 48, 53;
|
1046
|
-
--aesirxconsent-primary-text-emphasis: #6ea8fe;
|
1047
|
-
--aesirxconsent-secondary-text-emphasis: #a7acb1;
|
1048
|
-
--aesirxconsent-success-text-emphasis: #76d1bf;
|
1049
|
-
--aesirxconsent-info-text-emphasis: #6edff6;
|
1050
|
-
--aesirxconsent-warning-text-emphasis: #ffda6a;
|
1051
|
-
--aesirxconsent-danger-text-emphasis: #ea868f;
|
1052
|
-
--aesirxconsent-light-text-emphasis: #f8f9fa;
|
1053
|
-
--aesirxconsent-dark-text-emphasis: #dee2e6;
|
1054
|
-
--aesirxconsent-primary-bg-subtle: #031633;
|
1055
|
-
--aesirxconsent-secondary-bg-subtle: #161719;
|
1056
|
-
--aesirxconsent-success-bg-subtle: #05241e;
|
1057
|
-
--aesirxconsent-info-bg-subtle: #032830;
|
1058
|
-
--aesirxconsent-warning-bg-subtle: #332701;
|
1059
|
-
--aesirxconsent-danger-bg-subtle: #2c0b0e;
|
1060
|
-
--aesirxconsent-light-bg-subtle: #343a40;
|
1061
|
-
--aesirxconsent-dark-bg-subtle: #1a1d20;
|
1062
|
-
--aesirxconsent-primary-border-subtle: #084298;
|
1063
|
-
--aesirxconsent-secondary-border-subtle: #41464b;
|
1064
|
-
--aesirxconsent-success-border-subtle: #106b59;
|
1065
|
-
--aesirxconsent-info-border-subtle: #087990;
|
1066
|
-
--aesirxconsent-warning-border-subtle: #997404;
|
1067
|
-
--aesirxconsent-danger-border-subtle: #842029;
|
1068
|
-
--aesirxconsent-light-border-subtle: #495057;
|
1069
|
-
--aesirxconsent-dark-border-subtle: #343a40;
|
1070
|
-
--aesirxconsent-heading-color: inherit;
|
1071
|
-
--aesirxconsent-link-color: #6ea8fe;
|
1072
|
-
--aesirxconsent-link-hover-color: #8bb9fe;
|
1073
|
-
--aesirxconsent-link-color-rgb: 110, 168, 254;
|
1074
|
-
--aesirxconsent-link-hover-color-rgb: 139, 185, 254;
|
1075
|
-
--aesirxconsent-code-color: #e685b5;
|
1076
|
-
--aesirxconsent-border-color: #495057;
|
1077
|
-
--aesirxconsent-border-color-translucent: rgba(255, 255, 255, 0.15);
|
1078
|
-
--aesirxconsent-form-valid-color: #75b798;
|
1079
|
-
--aesirxconsent-form-valid-border-color: #75b798;
|
1080
|
-
--aesirxconsent-form-invalid-color: #ea868f;
|
1081
|
-
--aesirxconsent-form-invalid-border-color: #ea868f;
|
1082
|
-
}
|
1083
|
-
|
1084
1126
|
.aesirxconsent {
|
1085
1127
|
/* rtl:begin:remove */
|
1086
1128
|
/* rtl:end:remove */
|
1129
|
+
color: #5f5e70;
|
1087
1130
|
}
|
1088
1131
|
.aesirxconsent .offcanvas, .aesirxconsent .offcanvas-xxl, .aesirxconsent .offcanvas-xl, .aesirxconsent .offcanvas-lg, .aesirxconsent .offcanvas-md, .aesirxconsent .offcanvas-sm {
|
1089
1132
|
--aesirxconsent-offcanvas-zindex: 1045;
|
@@ -1977,9 +2020,6 @@ var css = `:root {
|
|
1977
2020
|
.aesirxconsent .btn-close-white {
|
1978
2021
|
filter: var(--aesirxconsent-btn-close-white-filter);
|
1979
2022
|
}
|
1980
|
-
.aesirxconsent [data-bs-theme=dark] .btn-close {
|
1981
|
-
filter: var(--aesirxconsent-btn-close-white-filter);
|
1982
|
-
}
|
1983
2023
|
.aesirxconsent .clearfix::after {
|
1984
2024
|
display: block;
|
1985
2025
|
clear: both;
|
@@ -1987,35 +2027,35 @@ var css = `:root {
|
|
1987
2027
|
}
|
1988
2028
|
.aesirxconsent .text-bg-primary {
|
1989
2029
|
color: #fff;
|
1990
|
-
background-color: RGBA(
|
2030
|
+
background-color: RGBA(var(--aesirxconsent-primary-rgb), var(--aesirxconsent-bg-opacity, 1));
|
1991
2031
|
}
|
1992
2032
|
.aesirxconsent .text-bg-secondary {
|
1993
2033
|
color: #fff;
|
1994
|
-
background-color: RGBA(
|
2034
|
+
background-color: RGBA(var(--aesirxconsent-secondary-rgb), var(--aesirxconsent-bg-opacity, 1));
|
1995
2035
|
}
|
1996
2036
|
.aesirxconsent .text-bg-success {
|
1997
2037
|
color: #000;
|
1998
|
-
background-color: RGBA(
|
2038
|
+
background-color: RGBA(var(--aesirxconsent-success-rgb), var(--aesirxconsent-bg-opacity, 1));
|
1999
2039
|
}
|
2000
2040
|
.aesirxconsent .text-bg-info {
|
2001
2041
|
color: #000;
|
2002
|
-
background-color: RGBA(
|
2042
|
+
background-color: RGBA(var(--aesirxconsent-info-rgb), var(--aesirxconsent-bg-opacity, 1));
|
2003
2043
|
}
|
2004
2044
|
.aesirxconsent .text-bg-warning {
|
2005
2045
|
color: #000;
|
2006
|
-
background-color: RGBA(
|
2046
|
+
background-color: RGBA(var(--aesirxconsent-warning-rgb), var(--aesirxconsent-bg-opacity, 1));
|
2007
2047
|
}
|
2008
2048
|
.aesirxconsent .text-bg-danger {
|
2009
2049
|
color: #fff;
|
2010
|
-
background-color: RGBA(
|
2050
|
+
background-color: RGBA(var(--aesirxconsent-danger-rgb), var(--aesirxconsent-bg-opacity, 1));
|
2011
2051
|
}
|
2012
2052
|
.aesirxconsent .text-bg-light {
|
2013
2053
|
color: #000;
|
2014
|
-
background-color: RGBA(
|
2054
|
+
background-color: RGBA(var(--aesirxconsent-light-rgb), var(--aesirxconsent-bg-opacity, 1));
|
2015
2055
|
}
|
2016
2056
|
.aesirxconsent .text-bg-dark {
|
2017
2057
|
color: #fff;
|
2018
|
-
background-color: RGBA(
|
2058
|
+
background-color: RGBA(var(--aesirxconsent-dark-rgb), var(--aesirxconsent-bg-opacity, 1));
|
2019
2059
|
}
|
2020
2060
|
.aesirxconsent .link-primary {
|
2021
2061
|
color: RGBA(var(--aesirxconsent-primary-rgb), var(--aesirxconsent-link-opacity, 1));
|
@@ -2272,7 +2312,7 @@ var css = `:root {
|
|
2272
2312
|
.aesirxconsent .vr {
|
2273
2313
|
display: inline-block;
|
2274
2314
|
align-self: stretch;
|
2275
|
-
width:
|
2315
|
+
width: var(--aesirxconsent-border-width);
|
2276
2316
|
min-height: 1em;
|
2277
2317
|
background-color: currentcolor;
|
2278
2318
|
opacity: 0.25;
|
@@ -7598,9 +7638,64 @@ var css = `:root {
|
|
7598
7638
|
display: none;
|
7599
7639
|
}
|
7600
7640
|
}
|
7641
|
+
.aesirxconsent .btn.text-white {
|
7642
|
+
color: #fff;
|
7643
|
+
}
|
7644
|
+
.aesirxconsent .btn-dark {
|
7645
|
+
--aesirxconsent-btn-color: #fff;
|
7646
|
+
--aesirxconsent-btn-bg: #222328;
|
7647
|
+
--aesirxconsent-btn-border-color: #222328;
|
7648
|
+
--aesirxconsent-btn-hover-color: #fff;
|
7649
|
+
--aesirxconsent-btn-hover-bg: #222328;
|
7650
|
+
--aesirxconsent-btn-hover-border-color: #222328;
|
7651
|
+
--aesirxconsent-btn-focus-shadow-rgb: 67, 68, 72;
|
7652
|
+
--aesirxconsent-btn-active-color: #fff;
|
7653
|
+
--aesirxconsent-btn-active-bg: #1b1c20;
|
7654
|
+
--aesirxconsent-btn-active-border-color: #1a1a1e;
|
7655
|
+
--aesirxconsent-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
7656
|
+
--aesirxconsent-btn-disabled-color: #fff;
|
7657
|
+
--aesirxconsent-btn-disabled-bg: #222328;
|
7658
|
+
--aesirxconsent-btn-disabled-border-color: #222328;
|
7659
|
+
}
|
7660
|
+
.aesirxconsent .btn-success-outline {
|
7661
|
+
--aesirxconsent-btn-color: #1ab394;
|
7662
|
+
--aesirxconsent-btn-bg: transparent;
|
7663
|
+
--aesirxconsent-btn-border-color: #1ab394;
|
7664
|
+
--aesirxconsent-btn-hover-color: #1ab394;
|
7665
|
+
--aesirxconsent-btn-hover-bg: transparent;
|
7666
|
+
--aesirxconsent-btn-hover-border-color: #1ab394;
|
7667
|
+
--aesirxconsent-btn-focus-shadow-rgb: 26, 179, 148;
|
7668
|
+
--aesirxconsent-btn-active-color: #000;
|
7669
|
+
--aesirxconsent-btn-active-bg: rgba(255, 255, 255, 0.2);
|
7670
|
+
--aesirxconsent-btn-active-border-color: #31bb9f;
|
7671
|
+
--aesirxconsent-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
|
7672
|
+
--aesirxconsent-btn-disabled-color: #fff;
|
7673
|
+
--aesirxconsent-btn-disabled-bg: transparent;
|
7674
|
+
--aesirxconsent-btn-disabled-border-color: #1ab394;
|
7675
|
+
color: #1ab394;
|
7676
|
+
}
|
7601
7677
|
.aesirxconsent .btn-success:hover {
|
7602
7678
|
color: var(--aesirxconsent-white);
|
7603
7679
|
}
|
7680
|
+
.aesirxconsent .toast {
|
7681
|
+
--aesirxconsent-toast-zindex: 1049;
|
7682
|
+
border: 0;
|
7683
|
+
box-shadow: none;
|
7684
|
+
}
|
7685
|
+
.aesirxconsent .toast .toast-body {
|
7686
|
+
border: var(--aesirxconsent-toast-border-width) solid var(--aesirxconsent-toast-border-color);
|
7687
|
+
box-shadow: var(--aesirxconsent-toast-box-shadow);
|
7688
|
+
border-radius: var(--aesirxconsent-toast-border-radius);
|
7689
|
+
}
|
7690
|
+
@media (max-width: 991.98px) {
|
7691
|
+
.aesirxconsent .toast .toast-body button {
|
7692
|
+
font-size: 14px;
|
7693
|
+
}
|
7694
|
+
}
|
7695
|
+
.aesirxconsent .toast-container {
|
7696
|
+
box-sizing: border-box;
|
7697
|
+
--aesirxconsent-toast-zindex: 1049;
|
7698
|
+
}
|
7604
7699
|
.aesirxconsent .status-tier {
|
7605
7700
|
width: 18px;
|
7606
7701
|
height: 18px;
|
@@ -7623,46 +7718,34 @@ var css = `:root {
|
|
7623
7718
|
border-radius: 0.5rem;
|
7624
7719
|
min-width: 120px;
|
7625
7720
|
}
|
7626
|
-
.aesirxconsent .
|
7627
|
-
|
7628
|
-
background: transparent !important;
|
7629
|
-
}
|
7630
|
-
.aesirxconsent .ssoBtnWrapper .position-fixed > span {
|
7631
|
-
width: 25.7143px !important;
|
7632
|
-
height: 25.7143px !important;
|
7721
|
+
.aesirxconsent .revoke-toast {
|
7722
|
+
width: 500px;
|
7633
7723
|
}
|
7634
|
-
.aesirxconsent .
|
7635
|
-
|
7636
|
-
|
7637
|
-
|
7638
|
-
|
7724
|
+
.aesirxconsent .revoke-toast .toast-body .minimize-revoke {
|
7725
|
+
position: absolute;
|
7726
|
+
top: 5px;
|
7727
|
+
right: 5px;
|
7728
|
+
cursor: pointer;
|
7639
7729
|
}
|
7640
|
-
.aesirxconsent .
|
7641
|
-
|
7642
|
-
height: 20px !important;
|
7643
|
-
border: 2.85714px solid rgb(255, 255, 255) !important;
|
7644
|
-
background: transparent !important;
|
7645
|
-
top: 0 !important;
|
7730
|
+
.aesirxconsent .revoke-toast .toast-body .manage-consent {
|
7731
|
+
margin-right: 10px;
|
7646
7732
|
}
|
7647
|
-
.aesirxconsent .
|
7733
|
+
.aesirxconsent .toast.minimize {
|
7648
7734
|
width: auto;
|
7649
7735
|
}
|
7650
|
-
.aesirxconsent .
|
7651
|
-
width: 480px;
|
7652
|
-
}
|
7653
|
-
.aesirxconsent .revoke-toast .toast-body .revoke-wrapper {
|
7736
|
+
.aesirxconsent .minimize-shield-wrapper {
|
7654
7737
|
border-radius: 0.5rem;
|
7655
7738
|
position: relative;
|
7656
7739
|
overflow: hidden;
|
7657
7740
|
}
|
7658
|
-
.aesirxconsent .
|
7741
|
+
.aesirxconsent .minimize-shield-wrapper .cover-img {
|
7659
7742
|
z-index: -1;
|
7660
7743
|
position: absolute;
|
7661
7744
|
object-fit: cover;
|
7662
7745
|
top: 0;
|
7663
7746
|
left: 0;
|
7664
7747
|
}
|
7665
|
-
.aesirxconsent .
|
7748
|
+
.aesirxconsent .minimize-shield-wrapper .minimize-shield {
|
7666
7749
|
cursor: pointer;
|
7667
7750
|
padding: 11.5px 10px;
|
7668
7751
|
display: flex;
|
@@ -7670,22 +7753,91 @@ var css = `:root {
|
|
7670
7753
|
justify-content: center;
|
7671
7754
|
color: #fff;
|
7672
7755
|
}
|
7673
|
-
.aesirxconsent .
|
7756
|
+
.aesirxconsent .minimize-shield-wrapper .minimize-shield img {
|
7674
7757
|
margin-right: 5px;
|
7675
7758
|
}
|
7676
|
-
.aesirxconsent .
|
7759
|
+
.aesirxconsent .minimize-shield-wrapper .text {
|
7677
7760
|
font-weight: 500;
|
7678
7761
|
}
|
7679
7762
|
.aesirxconsent .read-more {
|
7680
7763
|
text-align: right;
|
7681
7764
|
}
|
7682
7765
|
.aesirxconsent .read-more .read-more-btn {
|
7683
|
-
display: inline-
|
7766
|
+
display: inline-flex;
|
7767
|
+
align-items: center;
|
7684
7768
|
color: #132342;
|
7685
7769
|
cursor: pointer;
|
7686
7770
|
font-size: 14px;
|
7687
7771
|
font-weight: 500;
|
7688
7772
|
padding-top: 10px;
|
7773
|
+
}
|
7774
|
+
.aesirxconsent .read-more .read-more-btn img.revert {
|
7775
|
+
transform: rotate(180deg);
|
7776
|
+
}
|
7777
|
+
.aesirxconsent .loading-status {
|
7778
|
+
margin-bottom: 10px;
|
7779
|
+
}
|
7780
|
+
.aesirxconsent .loading-status .btn:disabled {
|
7781
|
+
opacity: 1;
|
7782
|
+
}
|
7783
|
+
.aesirxconsent .loading-status .text {
|
7784
|
+
max-width: calc(100% - 1.75rem);
|
7785
|
+
}
|
7786
|
+
.aesirxconsent .lightning {
|
7787
|
+
-webkit-filter: brightness(8);
|
7788
|
+
filter: brightness(8);
|
7789
|
+
-o-filter: brightness(8);
|
7790
|
+
-moz-filter: brightness(8);
|
7791
|
+
opacity: 0;
|
7792
|
+
}
|
7793
|
+
.aesirxconsent .flash-effect {
|
7794
|
+
-webkit-animation: flash ease-out 5s infinite;
|
7795
|
+
-moz-animation: flash ease-out 5s infinite;
|
7796
|
+
animation: flash ease-out 5s infinite;
|
7797
|
+
}
|
7798
|
+
@-webkit-keyframes flash {
|
7799
|
+
from {
|
7800
|
+
opacity: 0;
|
7801
|
+
}
|
7802
|
+
20% {
|
7803
|
+
opacity: 0;
|
7804
|
+
}
|
7805
|
+
22% {
|
7806
|
+
opacity: 0.6;
|
7807
|
+
}
|
7808
|
+
24% {
|
7809
|
+
opacity: 0.2;
|
7810
|
+
}
|
7811
|
+
26% {
|
7812
|
+
opacity: 0.9;
|
7813
|
+
}
|
7814
|
+
30% {
|
7815
|
+
opacity: 0;
|
7816
|
+
}
|
7817
|
+
}
|
7818
|
+
@keyframes flash {
|
7819
|
+
from {
|
7820
|
+
opacity: 0;
|
7821
|
+
}
|
7822
|
+
20% {
|
7823
|
+
opacity: 0;
|
7824
|
+
}
|
7825
|
+
22% {
|
7826
|
+
opacity: 0.6;
|
7827
|
+
}
|
7828
|
+
24% {
|
7829
|
+
opacity: 0.2;
|
7830
|
+
}
|
7831
|
+
26% {
|
7832
|
+
opacity: 1;
|
7833
|
+
}
|
7834
|
+
30% {
|
7835
|
+
opacity: 0;
|
7836
|
+
}
|
7837
|
+
}
|
7838
|
+
|
7839
|
+
.aesirxsso {
|
7840
|
+
color: #5f5e70;
|
7689
7841
|
}`;
|
7690
7842
|
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
7691
7843
|
|
@@ -7760,12 +7912,29 @@ var terms = [
|
|
7760
7912
|
}
|
7761
7913
|
];
|
7762
7914
|
var TermsComponent = ({ children, level, handleLevel }) => {
|
7763
|
-
const handleReadmore = () => {
|
7764
|
-
setShowReadmore(
|
7915
|
+
const handleReadmore = (status) => {
|
7916
|
+
setShowReadmore(status);
|
7765
7917
|
};
|
7766
7918
|
const [showReadmore, setShowReadmore] = useState2(false);
|
7767
7919
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, terms.map(
|
7768
|
-
(term, key) => term.level === level && /* @__PURE__ */ React.createElement(Fragment, { key }, /* @__PURE__ */ React.createElement("div", { className: "rounded-top d-flex justify-content-between bg-light p-3 fw-bold" }, /* @__PURE__ */ React.createElement("div", null, term.name), /* @__PURE__ */ React.createElement("div", { className: "d-flex align-items-center" }, /* @__PURE__ */ React.createElement("div", { className: `status-tier tier-${term.level} rounded-circle` }), term.tier, " - ", term.levelname)), /* @__PURE__ */ React.createElement("div", { className: "p-3 bg-white" }, /* @__PURE__ */ React.createElement("span", { className: "fw-bold" }, term.content), " ", /* @__PURE__ */ React.createElement("span", { className: "fw-light" }, term.term),
|
7920
|
+
(term, key) => term.level === level && /* @__PURE__ */ React.createElement(Fragment, { key }, /* @__PURE__ */ React.createElement("div", { className: "rounded-top d-flex justify-content-between bg-light p-3 fw-bold flex-wrap" }, /* @__PURE__ */ React.createElement("div", null, term.name), /* @__PURE__ */ React.createElement("div", { className: "d-flex align-items-center" }, /* @__PURE__ */ React.createElement("div", { className: `status-tier tier-${term.level} rounded-circle` }), term.tier, " - ", term.levelname)), /* @__PURE__ */ React.createElement("div", { className: "p-3 bg-white" }, /* @__PURE__ */ React.createElement("span", { className: "fw-bold" }, term.content), " ", /* @__PURE__ */ React.createElement("span", { className: "fw-light" }, term.term), /* @__PURE__ */ React.createElement("div", { className: "read-more" }, /* @__PURE__ */ React.createElement(
|
7921
|
+
"div",
|
7922
|
+
{
|
7923
|
+
className: "read-more-btn",
|
7924
|
+
onClick: () => {
|
7925
|
+
handleReadmore(!showReadmore ? true : false);
|
7926
|
+
}
|
7927
|
+
},
|
7928
|
+
!showReadmore ? "Show details" : "Hide details",
|
7929
|
+
" ",
|
7930
|
+
/* @__PURE__ */ React.createElement("img", { src: arrow_default, className: `ms-1 ${showReadmore ? "revert" : ""}` })
|
7931
|
+
))), /* @__PURE__ */ React.createElement("div", { className: "rounded-bottom position-relative overflow-hidden text-white" }, /* @__PURE__ */ React.createElement("img", { className: "position-absolute h-100 w-100 object-fit-cover", src: bg_default }), /* @__PURE__ */ React.createElement(
|
7932
|
+
"img",
|
7933
|
+
{
|
7934
|
+
className: "position-absolute h-100 w-100 object-fit-cover lightning flash-effect",
|
7935
|
+
src: bg_default
|
7936
|
+
}
|
7937
|
+
), /* @__PURE__ */ React.createElement("div", { className: "position-relative p-3" }, showReadmore && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "d-flex align-items-center" }, term.logos.map((logo, i) => /* @__PURE__ */ React.createElement(Fragment, { key: i }, /* @__PURE__ */ React.createElement("img", { className: "me-2", src: logo, alt: term.levelname })))), /* @__PURE__ */ React.createElement("div", { className: "d-flex align-items-start my-3" }, /* @__PURE__ */ React.createElement("img", { src: upgrade_default }), /* @__PURE__ */ React.createElement("div", { className: "ms-3" }, term.upgrade && /* @__PURE__ */ React.createElement(
|
7769
7938
|
"a",
|
7770
7939
|
{
|
7771
7940
|
className: "text-white",
|
@@ -7784,16 +7953,92 @@ import { ToastContainer, toast as toast2 } from "react-toastify";
|
|
7784
7953
|
var yes_default = 'data:image/svg+xml,<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M9 1C7.41775 1 5.87103 1.46919 4.55544 2.34824C3.23985 3.22729 2.21447 4.47672 1.60897 5.93853C1.00347 7.40034 0.84504 9.00887 1.15372 10.5607C1.4624 12.1126 2.22433 13.538 3.34315 14.6569C4.46197 15.7757 5.88743 16.5376 7.43928 16.8463C8.99113 17.155 10.5997 16.9965 12.0615 16.391C13.5233 15.7855 14.7727 14.7602 15.6518 13.4446C16.5308 12.129 17 10.5823 17 9C17 6.87827 16.1571 4.84344 14.6569 3.34315C13.1566 1.84285 11.1217 1 9 1V1ZM9 16C7.61553 16 6.26216 15.5895 5.11101 14.8203C3.95987 14.0511 3.06266 12.9579 2.53285 11.6788C2.00303 10.3997 1.86441 8.99223 2.13451 7.63437C2.4046 6.2765 3.07129 5.02922 4.05026 4.05025C5.02922 3.07128 6.2765 2.4046 7.63437 2.1345C8.99224 1.86441 10.3997 2.00303 11.6788 2.53284C12.9579 3.06266 14.0511 3.95986 14.8203 5.11101C15.5895 6.26215 16 7.61553 16 9C16 10.8565 15.2625 12.637 13.9498 13.9497C12.637 15.2625 10.8565 16 9 16Z" fill="white"/>%0A<path d="M13.9985 6.04969C13.9048 5.95657 13.7781 5.9043 13.646 5.9043C13.5139 5.9043 13.3872 5.95657 13.2935 6.04969L7.7435 11.5747L4.7435 8.57469C4.652 8.4759 4.52501 8.4175 4.39045 8.41234C4.25589 8.40719 4.1248 8.45569 4.026 8.54719C3.92721 8.63869 3.86881 8.76569 3.86365 8.90025C3.8585 9.03481 3.907 9.1659 3.9985 9.26469L7.7435 12.9997L13.9985 6.75969C14.0454 6.71321 14.0826 6.65791 14.108 6.59698C14.1333 6.53605 14.1464 6.4707 14.1464 6.40469C14.1464 6.33869 14.1333 6.27333 14.108 6.21241C14.0826 6.15148 14.0454 6.09618 13.9985 6.04969Z" fill="white"/>%0A</svg>%0A';
|
7785
7954
|
|
7786
7955
|
// src/Assets/no.svg
|
7787
|
-
var no_default = 'data:image/svg+xml,<svg width="18" height="
|
7956
|
+
var no_default = 'data:image/svg+xml,<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<path d="M9 2C13.1421 2 16.5 5.35786 16.5 9.5C16.5 13.6421 13.1421 17 9 17C4.85786 17 1.5 13.6421 1.5 9.5C1.5 5.35786 4.85786 2 9 2ZM9 3.125C5.47918 3.125 2.625 5.97918 2.625 9.5C2.625 13.0208 5.47918 15.875 9 15.875C12.5208 15.875 15.375 13.0208 15.375 9.5C15.375 5.97918 12.5208 3.125 9 3.125ZM11.5847 6.79779L11.6477 6.85225C11.8474 7.05195 11.8656 7.36445 11.7022 7.58466L11.6477 7.64775L9.79575 9.5L11.6477 11.3523C11.8474 11.552 11.8656 11.8645 11.7022 12.0847L11.6477 12.1477C11.448 12.3474 11.1355 12.3656 10.9153 12.2022L10.8523 12.1477L9 10.2957L7.14775 12.1477C6.94805 12.3474 6.63555 12.3656 6.41534 12.2022L6.35225 12.1477C6.15255 11.948 6.1344 11.6355 6.29779 11.4153L6.35225 11.3523L8.20425 9.5L6.35225 7.64775C6.15255 7.44805 6.1344 7.13555 6.29779 6.91534L6.35225 6.85225C6.55195 6.65255 6.86445 6.6344 7.08466 6.79779L7.14775 6.85225L9 8.70425L10.8523 6.85225C11.052 6.65255 11.3645 6.6344 11.5847 6.79779Z" fill="%231AB394"/>%0A</svg>%0A';
|
7788
7957
|
|
7789
7958
|
// src/Components/Consent.tsx
|
7790
7959
|
import ContentLoader from "react-content-loader";
|
7791
|
-
import { SSOButton
|
7960
|
+
import { SSOButton } from "aesirx-sso";
|
7961
|
+
import { MAINNET as MAINNET2, WithWalletConnector } from "@concordium/react-components";
|
7962
|
+
import { OsTypes as OsTypes2, isMobile as isMobile2, osName as osName2 } from "react-device-detect";
|
7963
|
+
|
7964
|
+
// src/Components/LoadingStatus.tsx
|
7965
|
+
import React2 from "react";
|
7966
|
+
import { Button } from "react-bootstrap";
|
7967
|
+
var LoadingStatus = ({ loading }) => {
|
7968
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, loading === "connect" ? /* @__PURE__ */ React2.createElement("div", { className: "loading-status" }, /* @__PURE__ */ React2.createElement(
|
7969
|
+
Button,
|
7970
|
+
{
|
7971
|
+
variant: "dark",
|
7972
|
+
disabled: true,
|
7973
|
+
className: "d-flex align-items-center justify-content-center text-white w-100"
|
7974
|
+
},
|
7975
|
+
/* @__PURE__ */ React2.createElement(
|
7976
|
+
"span",
|
7977
|
+
{
|
7978
|
+
className: "spinner-border spinner-border-sm me-1",
|
7979
|
+
role: "status",
|
7980
|
+
"aria-hidden": "true"
|
7981
|
+
}
|
7982
|
+
),
|
7983
|
+
/* @__PURE__ */ React2.createElement("span", { className: "text" }, "Please connect your Concordium wallet")
|
7984
|
+
)) : loading === "sign" ? /* @__PURE__ */ React2.createElement("div", { className: "loading-status" }, /* @__PURE__ */ React2.createElement(
|
7985
|
+
Button,
|
7986
|
+
{
|
7987
|
+
variant: "dark",
|
7988
|
+
disabled: true,
|
7989
|
+
className: "d-flex align-items-center justify-content-center text-white w-100"
|
7990
|
+
},
|
7991
|
+
/* @__PURE__ */ React2.createElement(
|
7992
|
+
"span",
|
7993
|
+
{
|
7994
|
+
className: "spinner-border spinner-border-sm me-1",
|
7995
|
+
role: "status",
|
7996
|
+
"aria-hidden": "true"
|
7997
|
+
}
|
7998
|
+
),
|
7999
|
+
/* @__PURE__ */ React2.createElement("span", { className: "text" }, "Please sign the message on your wallet twice and wait for it to be saved.")
|
8000
|
+
)) : loading === "saving" ? /* @__PURE__ */ React2.createElement("div", { className: "loading-status" }, /* @__PURE__ */ React2.createElement(
|
8001
|
+
Button,
|
8002
|
+
{
|
8003
|
+
variant: "dark",
|
8004
|
+
disabled: true,
|
8005
|
+
className: "d-flex align-items-center justify-content-center text-white w-100"
|
8006
|
+
},
|
8007
|
+
/* @__PURE__ */ React2.createElement(
|
8008
|
+
"span",
|
8009
|
+
{
|
8010
|
+
className: "spinner-border spinner-border-sm me-1",
|
8011
|
+
role: "status",
|
8012
|
+
"aria-hidden": "true"
|
8013
|
+
}
|
8014
|
+
),
|
8015
|
+
/* @__PURE__ */ React2.createElement("span", { className: "text" }, "Saving...")
|
8016
|
+
)) : /* @__PURE__ */ React2.createElement(React2.Fragment, null));
|
8017
|
+
};
|
8018
|
+
|
8019
|
+
// src/Components/Consent.tsx
|
7792
8020
|
var ConsentComponent = ({ endpoint }) => {
|
7793
|
-
|
8021
|
+
return /* @__PURE__ */ React3.createElement(WithWalletConnector, { network: MAINNET2 }, (props) => /* @__PURE__ */ React3.createElement(ConsentComponentApp, { ...props, endpoint }));
|
8022
|
+
};
|
8023
|
+
var ConsentComponentApp = (props) => {
|
8024
|
+
const { endpoint, setActiveConnectorType } = props;
|
8025
|
+
const [
|
8026
|
+
uuid,
|
8027
|
+
level,
|
8028
|
+
connection,
|
8029
|
+
account,
|
8030
|
+
show,
|
8031
|
+
setShow,
|
8032
|
+
web3ID,
|
8033
|
+
handleLevel,
|
8034
|
+
showRevoke,
|
8035
|
+
handleRevoke
|
8036
|
+
] = useConsentStatus_default(endpoint, props);
|
7794
8037
|
const [consents, setConsents] = useState3([1, 2]);
|
7795
8038
|
const [loading, setLoading] = useState3("done");
|
8039
|
+
const [showExpandConsent, setShowExpandConsent] = useState3(true);
|
7796
8040
|
const [showExpandRevoke, setShowExpandRevoke] = useState3(false);
|
8041
|
+
const [showBackdrop, setShowBackdrop] = useState3(true);
|
7797
8042
|
const handleChange = async ({ target: { value } }) => {
|
7798
8043
|
if (consents.indexOf(parseInt(value)) === -1) {
|
7799
8044
|
setConsents([...consents, ...[parseInt(value)]]);
|
@@ -7805,12 +8050,10 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7805
8050
|
try {
|
7806
8051
|
if (level > 2) {
|
7807
8052
|
setLoading("connect");
|
7808
|
-
const address = await provider.connect();
|
7809
8053
|
setLoading("sign");
|
7810
|
-
const signature = await getSignature(endpoint,
|
8054
|
+
const signature = await getSignature(endpoint, account, connection, "Give consent:{}");
|
7811
8055
|
setLoading("saving");
|
7812
|
-
await agreeConsents(endpoint, level, uuid, consents,
|
7813
|
-
handleRevoke(true, level);
|
8056
|
+
await agreeConsents(endpoint, level, uuid, consents, account, signature, web3ID);
|
7814
8057
|
} else {
|
7815
8058
|
setLoading("saving");
|
7816
8059
|
consents.forEach(async (consent) => {
|
@@ -7821,10 +8064,12 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7821
8064
|
sessionStorage.setItem("aesirx-analytics-allow", "1");
|
7822
8065
|
setShow(false);
|
7823
8066
|
setLoading("done");
|
8067
|
+
handleRevoke(true, level);
|
8068
|
+
setShowBackdrop(false);
|
7824
8069
|
} catch (error) {
|
7825
|
-
|
8070
|
+
handleNotAllow();
|
7826
8071
|
setLoading("done");
|
7827
|
-
toast2.error(error.message);
|
8072
|
+
toast2.error(error?.response?.data?.error ?? error.message);
|
7828
8073
|
}
|
7829
8074
|
};
|
7830
8075
|
const onGetData = async (response) => {
|
@@ -7838,13 +8083,13 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7838
8083
|
} catch (error) {
|
7839
8084
|
setShow(false);
|
7840
8085
|
setLoading("done");
|
7841
|
-
toast2.error(error.message);
|
8086
|
+
toast2.error(error?.response?.data?.error ?? error.message);
|
7842
8087
|
}
|
7843
8088
|
};
|
7844
8089
|
const handleNotAllow = () => {
|
7845
8090
|
sessionStorage.setItem("aesirx-analytics-uuid", uuid);
|
7846
|
-
|
7847
|
-
|
8091
|
+
setShowExpandConsent(false);
|
8092
|
+
setShowBackdrop(false);
|
7848
8093
|
};
|
7849
8094
|
const handleRevokeBtn = async () => {
|
7850
8095
|
const levelRevoke = sessionStorage.getItem("aesirx-analytics-revoke");
|
@@ -7852,9 +8097,8 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7852
8097
|
if (levelRevoke) {
|
7853
8098
|
if (parseInt(levelRevoke) > 2) {
|
7854
8099
|
setLoading("connect");
|
7855
|
-
const address = await provider.connect();
|
7856
8100
|
setLoading("sign");
|
7857
|
-
const signature = await getSignature(endpoint,
|
8101
|
+
const signature = await getSignature(endpoint, account, connection, "Revoke consent:{}");
|
7858
8102
|
setLoading("saving");
|
7859
8103
|
const consentList = await getConsents(endpoint, uuid);
|
7860
8104
|
consentList.forEach(async (consent) => {
|
@@ -7862,12 +8106,13 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7862
8106
|
endpoint,
|
7863
8107
|
levelRevoke,
|
7864
8108
|
consent?.consent_uuid,
|
7865
|
-
|
8109
|
+
account,
|
7866
8110
|
signature,
|
7867
8111
|
web3ID
|
7868
8112
|
);
|
7869
8113
|
});
|
7870
8114
|
setLoading("done");
|
8115
|
+
handleRevoke(false);
|
7871
8116
|
} else {
|
7872
8117
|
setLoading("saving");
|
7873
8118
|
const consentList = await getConsents(endpoint, uuid);
|
@@ -7882,39 +8127,54 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7882
8127
|
sessionStorage.getItem("aesirx-analytics-jwt")
|
7883
8128
|
);
|
7884
8129
|
});
|
7885
|
-
sessionStorage.removeItem("aesirx-analytics-jwt");
|
7886
8130
|
setLoading("done");
|
8131
|
+
handleRevoke(false);
|
7887
8132
|
}
|
8133
|
+
setShowExpandConsent(false);
|
8134
|
+
setShow(true);
|
8135
|
+
setShowBackdrop(false);
|
8136
|
+
sessionStorage.removeItem("aesirx-analytics-allow");
|
7888
8137
|
}
|
7889
|
-
handleRevoke(false);
|
7890
8138
|
} catch (error) {
|
7891
8139
|
setLoading("done");
|
7892
|
-
|
7893
|
-
toast2.error(error.message);
|
8140
|
+
toast2.error(error?.response?.data?.error ?? error.message);
|
7894
8141
|
}
|
7895
8142
|
};
|
7896
|
-
return /* @__PURE__ */
|
8143
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "aesirxconsent" }, /* @__PURE__ */ React3.createElement(ToastContainer, null), /* @__PURE__ */ React3.createElement("div", { className: `offcanvas-backdrop fade ${showBackdrop && show ? "show" : "d-none"}` }), /* @__PURE__ */ React3.createElement("div", { tabIndex: -1, className: `toast-container position-fixed bottom-0 end-0 p-3` }, /* @__PURE__ */ React3.createElement(
|
7897
8144
|
"div",
|
7898
8145
|
{
|
7899
|
-
className: `toast revoke-toast ${showRevoke || sessionStorage.getItem("aesirx-analytics-revoke") &&
|
8146
|
+
className: `toast revoke-toast ${showRevoke || sessionStorage.getItem("aesirx-analytics-revoke") && sessionStorage.getItem("aesirx-analytics-revoke") !== "0" ? "show" : ""} ${showExpandRevoke ? "" : "minimize"}`
|
7900
8147
|
},
|
7901
|
-
/* @__PURE__ */
|
8148
|
+
/* @__PURE__ */ React3.createElement(LoadingStatus, { loading }),
|
8149
|
+
/* @__PURE__ */ React3.createElement("div", { className: "toast-body p-0 " }, /* @__PURE__ */ React3.createElement("div", { className: "revoke-wrapper minimize-shield-wrapper position-relative" }, !showExpandRevoke && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
7902
8150
|
"img",
|
7903
8151
|
{
|
7904
8152
|
className: "cover-img position-absolute h-100 w-100 object-fit-cover",
|
7905
8153
|
src: bg_default
|
7906
8154
|
}
|
7907
|
-
), /* @__PURE__ */
|
8155
|
+
), /* @__PURE__ */ React3.createElement(
|
7908
8156
|
"div",
|
7909
8157
|
{
|
7910
|
-
className: "
|
8158
|
+
className: "minimize-shield",
|
7911
8159
|
onClick: () => {
|
8160
|
+
if (osName2 !== OsTypes2?.IOS && isMobile2 && !connection && sessionStorage.getItem("aesirx-analytics-revoke") && parseInt(sessionStorage.getItem("aesirx-analytics-revoke")) > 2) {
|
8161
|
+
setActiveConnectorType(WALLET_CONNECT);
|
8162
|
+
}
|
7912
8163
|
setShowExpandRevoke(true);
|
7913
8164
|
}
|
7914
8165
|
},
|
7915
|
-
/* @__PURE__ */
|
8166
|
+
/* @__PURE__ */ React3.createElement("img", { src: privacy_default, alt: "Shield of Privacy" }),
|
7916
8167
|
"Shield of Privacy"
|
7917
|
-
)), showExpandRevoke && /* @__PURE__ */
|
8168
|
+
)), showExpandRevoke && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
8169
|
+
"div",
|
8170
|
+
{
|
8171
|
+
className: "minimize-revoke",
|
8172
|
+
onClick: () => {
|
8173
|
+
setShowExpandRevoke(false);
|
8174
|
+
}
|
8175
|
+
},
|
8176
|
+
/* @__PURE__ */ React3.createElement("img", { src: no_default })
|
8177
|
+
), /* @__PURE__ */ React3.createElement("div", { className: "p-3 bg-white text" }, "You can revoke your consent for data usage at any time. ", /* @__PURE__ */ React3.createElement("br", null), "Go to", " ", /* @__PURE__ */ React3.createElement(
|
7918
8178
|
"a",
|
7919
8179
|
{
|
7920
8180
|
href: "https://nft.web3id.aesirx.io",
|
@@ -7923,70 +8183,47 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7923
8183
|
rel: "noreferrer"
|
7924
8184
|
},
|
7925
8185
|
"link"
|
7926
|
-
), " ", "for more information."), /* @__PURE__ */
|
8186
|
+
), " ", "for more information."), /* @__PURE__ */ React3.createElement("div", { className: "rounded-bottom position-relative overflow-hidden text-white" }, /* @__PURE__ */ React3.createElement(
|
7927
8187
|
"img",
|
7928
8188
|
{
|
7929
8189
|
className: "cover-img position-absolute h-100 w-100 object-fit-cover",
|
7930
8190
|
src: bg_default
|
7931
8191
|
}
|
7932
|
-
), /* @__PURE__ */
|
7933
|
-
|
8192
|
+
), /* @__PURE__ */ React3.createElement("div", { className: "position-relative p-3" }, /* @__PURE__ */ React3.createElement("div", { className: "d-flex align-items-center justify-content-between flex-wrap" }, /* @__PURE__ */ React3.createElement("div", { className: "me-2" }, /* @__PURE__ */ React3.createElement("img", { src: privacy_default, alt: "Shield of Privacy" }), " Shield of Privacy"), sessionStorage.getItem("aesirx-analytics-revoke") !== "1" && /* @__PURE__ */ React3.createElement("div", { className: "d-flex align-items-center" }, /* @__PURE__ */ React3.createElement(
|
8193
|
+
"a",
|
8194
|
+
{
|
8195
|
+
className: "text-success text-decoration-underline manage-consent",
|
8196
|
+
href: "https://dapp.web3id.aesirx.io/revoke-consent",
|
8197
|
+
target: "_blank",
|
8198
|
+
rel: "noreferrer"
|
8199
|
+
},
|
8200
|
+
"Manage Consent"
|
8201
|
+
), loading === "done" ? /* @__PURE__ */ React3.createElement(
|
8202
|
+
Button2,
|
7934
8203
|
{
|
7935
8204
|
variant: "success",
|
7936
8205
|
onClick: handleRevokeBtn,
|
7937
8206
|
className: "text-white d-flex align-items-center revoke-btn"
|
7938
8207
|
},
|
7939
8208
|
"Revoke Consent"
|
7940
|
-
) :
|
7941
|
-
|
7942
|
-
|
7943
|
-
|
7944
|
-
|
7945
|
-
|
7946
|
-
|
7947
|
-
|
7948
|
-
|
7949
|
-
|
7950
|
-
|
7951
|
-
|
7952
|
-
|
7953
|
-
|
7954
|
-
|
7955
|
-
|
7956
|
-
|
7957
|
-
|
7958
|
-
{
|
7959
|
-
variant: "success",
|
7960
|
-
disabled: true,
|
7961
|
-
className: "d-flex align-items-center text-white"
|
7962
|
-
},
|
7963
|
-
/* @__PURE__ */ React2.createElement(
|
7964
|
-
"span",
|
7965
|
-
{
|
7966
|
-
className: "spinner-border spinner-border-sm me-1",
|
7967
|
-
role: "status",
|
7968
|
-
"aria-hidden": "true"
|
7969
|
-
}
|
7970
|
-
),
|
7971
|
-
"Please sign the message on your wallet twice and wait for it to be saved."
|
7972
|
-
) : /* @__PURE__ */ React2.createElement(
|
7973
|
-
Button,
|
7974
|
-
{
|
7975
|
-
variant: "success",
|
7976
|
-
disabled: true,
|
7977
|
-
className: "d-flex align-items-center text-white"
|
7978
|
-
},
|
7979
|
-
/* @__PURE__ */ React2.createElement(
|
7980
|
-
"span",
|
7981
|
-
{
|
7982
|
-
className: "spinner-border spinner-border-sm me-1",
|
7983
|
-
role: "status",
|
7984
|
-
"aria-hidden": "true"
|
7985
|
-
}
|
7986
|
-
),
|
7987
|
-
"Saving..."
|
7988
|
-
)))))))
|
7989
|
-
)), /* @__PURE__ */ React2.createElement("div", { tabIndex: -1, className: `toast-container position-fixed bottom-0 end-0 p-3` }, /* @__PURE__ */ React2.createElement("div", { className: `toast ${show ? "show" : ""}` }, /* @__PURE__ */ React2.createElement(SSOContextProvider, null, /* @__PURE__ */ React2.createElement("div", { className: "toast-body p-0" }, level ? /* @__PURE__ */ React2.createElement(TermsComponent, { level, handleLevel }, /* @__PURE__ */ React2.createElement(Form, null, /* @__PURE__ */ React2.createElement(
|
8209
|
+
) : /* @__PURE__ */ React3.createElement(React3.Fragment, null))))))))
|
8210
|
+
)), /* @__PURE__ */ React3.createElement("div", { tabIndex: -1, className: `toast-container position-fixed bottom-0 end-0 p-3` }, /* @__PURE__ */ React3.createElement("div", { className: `toast ${show ? "show" : ""} ${showExpandConsent ? "" : "minimize"}` }, /* @__PURE__ */ React3.createElement(LoadingStatus, { loading }), /* @__PURE__ */ React3.createElement("div", { className: "toast-body p-0" }, !showExpandConsent ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("div", { className: "minimize-shield-wrapper position-relative" }, /* @__PURE__ */ React3.createElement(
|
8211
|
+
"img",
|
8212
|
+
{
|
8213
|
+
className: "cover-img position-absolute h-100 w-100 object-fit-cover",
|
8214
|
+
src: bg_default
|
8215
|
+
}
|
8216
|
+
), /* @__PURE__ */ React3.createElement(
|
8217
|
+
"div",
|
8218
|
+
{
|
8219
|
+
className: "minimize-shield",
|
8220
|
+
onClick: () => {
|
8221
|
+
setShowExpandConsent(true);
|
8222
|
+
}
|
8223
|
+
},
|
8224
|
+
/* @__PURE__ */ React3.createElement("img", { src: privacy_default, alt: "Shield of Privacy" }),
|
8225
|
+
"Shield of Privacy"
|
8226
|
+
))) : /* @__PURE__ */ React3.createElement(React3.Fragment, null, level ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(TermsComponent, { level, handleLevel }, /* @__PURE__ */ React3.createElement(Form, { className: "mb-0" }, /* @__PURE__ */ React3.createElement(
|
7990
8227
|
Form.Check,
|
7991
8228
|
{
|
7992
8229
|
checked: consents.includes(1),
|
@@ -7996,7 +8233,7 @@ var ConsentComponent = ({ endpoint }) => {
|
|
7996
8233
|
onChange: handleChange,
|
7997
8234
|
className: "d-none"
|
7998
8235
|
}
|
7999
|
-
), /* @__PURE__ */
|
8236
|
+
), /* @__PURE__ */ React3.createElement(
|
8000
8237
|
Form.Check,
|
8001
8238
|
{
|
8002
8239
|
checked: consents.includes(2),
|
@@ -8006,81 +8243,33 @@ var ConsentComponent = ({ endpoint }) => {
|
|
8006
8243
|
onChange: handleChange,
|
8007
8244
|
className: "d-none"
|
8008
8245
|
}
|
8009
|
-
), /* @__PURE__ */
|
8246
|
+
), /* @__PURE__ */ React3.createElement("div", { className: "d-flex justify-content-end" }, loading === "done" ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, level === 2 ? /* @__PURE__ */ React3.createElement("div", { className: "ssoBtnWrapper me-1 bg-success" }, /* @__PURE__ */ React3.createElement(
|
8010
8247
|
SSOButton,
|
8011
8248
|
{
|
8012
8249
|
className: "btn btn-success text-white d-flex align-items-center",
|
8013
|
-
text: /* @__PURE__ */
|
8250
|
+
text: /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("img", { src: yes_default, className: "me-1" }), "Yes, I consent"),
|
8014
8251
|
ssoState: "noscopes",
|
8015
8252
|
onGetData
|
8016
8253
|
}
|
8017
|
-
)) : /* @__PURE__ */
|
8018
|
-
|
8254
|
+
)) : /* @__PURE__ */ React3.createElement(
|
8255
|
+
Button2,
|
8019
8256
|
{
|
8020
8257
|
variant: "success",
|
8021
8258
|
onClick: handleAgree,
|
8022
8259
|
className: "me-1 text-white d-flex align-items-center"
|
8023
8260
|
},
|
8024
|
-
/* @__PURE__ */
|
8261
|
+
/* @__PURE__ */ React3.createElement("img", { src: yes_default, className: "me-1" }),
|
8025
8262
|
"Yes, I consent"
|
8026
|
-
), /* @__PURE__ */
|
8027
|
-
|
8263
|
+
), /* @__PURE__ */ React3.createElement(
|
8264
|
+
Button2,
|
8028
8265
|
{
|
8029
|
-
variant: "
|
8266
|
+
variant: "success-outline",
|
8030
8267
|
onClick: handleNotAllow,
|
8031
|
-
className: "
|
8268
|
+
className: "d-flex align-items-center"
|
8032
8269
|
},
|
8033
|
-
/* @__PURE__ */
|
8270
|
+
/* @__PURE__ */ React3.createElement("img", { src: no_default, className: "me-1" }),
|
8034
8271
|
"Reject Consent"
|
8035
|
-
)) :
|
8036
|
-
Button,
|
8037
|
-
{
|
8038
|
-
variant: "success",
|
8039
|
-
disabled: true,
|
8040
|
-
className: "d-flex align-items-center text-white"
|
8041
|
-
},
|
8042
|
-
/* @__PURE__ */ React2.createElement(
|
8043
|
-
"span",
|
8044
|
-
{
|
8045
|
-
className: "spinner-border spinner-border-sm me-1",
|
8046
|
-
role: "status",
|
8047
|
-
"aria-hidden": "true"
|
8048
|
-
}
|
8049
|
-
),
|
8050
|
-
"Please connect your Concordium wallet"
|
8051
|
-
) : loading === "sign" ? /* @__PURE__ */ React2.createElement(
|
8052
|
-
Button,
|
8053
|
-
{
|
8054
|
-
variant: "success",
|
8055
|
-
disabled: true,
|
8056
|
-
className: "d-flex align-items-center text-white"
|
8057
|
-
},
|
8058
|
-
/* @__PURE__ */ React2.createElement(
|
8059
|
-
"span",
|
8060
|
-
{
|
8061
|
-
className: "spinner-border spinner-border-sm me-1",
|
8062
|
-
role: "status",
|
8063
|
-
"aria-hidden": "true"
|
8064
|
-
}
|
8065
|
-
),
|
8066
|
-
"Please sign the message on your wallet twice and wait for it to be saved."
|
8067
|
-
) : /* @__PURE__ */ React2.createElement(
|
8068
|
-
Button,
|
8069
|
-
{
|
8070
|
-
variant: "success",
|
8071
|
-
disabled: true,
|
8072
|
-
className: "d-flex align-items-center text-white"
|
8073
|
-
},
|
8074
|
-
/* @__PURE__ */ React2.createElement(
|
8075
|
-
"span",
|
8076
|
-
{
|
8077
|
-
className: "spinner-border spinner-border-sm me-1",
|
8078
|
-
role: "status",
|
8079
|
-
"aria-hidden": "true"
|
8080
|
-
}
|
8081
|
-
),
|
8082
|
-
"Saving..."
|
8083
|
-
)))) : /* @__PURE__ */ React2.createElement("div", { className: "p-4" }, /* @__PURE__ */ React2.createElement(
|
8272
|
+
)) : /* @__PURE__ */ React3.createElement(React3.Fragment, null))))) : /* @__PURE__ */ React3.createElement("div", { className: "p-4" }, /* @__PURE__ */ React3.createElement(
|
8084
8273
|
ContentLoader,
|
8085
8274
|
{
|
8086
8275
|
speed: 2,
|
@@ -8090,14 +8279,14 @@ var ConsentComponent = ({ endpoint }) => {
|
|
8090
8279
|
backgroundColor: "#f3f3f3",
|
8091
8280
|
foregroundColor: "#ecebeb"
|
8092
8281
|
},
|
8093
|
-
/* @__PURE__ */
|
8094
|
-
/* @__PURE__ */
|
8095
|
-
/* @__PURE__ */
|
8096
|
-
/* @__PURE__ */
|
8097
|
-
/* @__PURE__ */
|
8098
|
-
/* @__PURE__ */
|
8099
|
-
/* @__PURE__ */
|
8100
|
-
/* @__PURE__ */
|
8282
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "0", y: "0", rx: "3", ry: "3", width: "67", height: "11" }),
|
8283
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "76", y: "0", rx: "3", ry: "3", width: "140", height: "11" }),
|
8284
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "127", y: "48", rx: "3", ry: "3", width: "53", height: "11" }),
|
8285
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "187", y: "48", rx: "3", ry: "3", width: "72", height: "11" }),
|
8286
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "18", y: "48", rx: "3", ry: "3", width: "100", height: "11" }),
|
8287
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "0", y: "71", rx: "3", ry: "3", width: "37", height: "11" }),
|
8288
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "18", y: "23", rx: "3", ry: "3", width: "140", height: "11" }),
|
8289
|
+
/* @__PURE__ */ React3.createElement("rect", { x: "166", y: "23", rx: "3", ry: "3", width: "173", height: "11" })
|
8101
8290
|
)))))));
|
8102
8291
|
};
|
8103
8292
|
var Consent_default = ConsentComponent;
|