@gataca/qr 0.0.20 → 0.0.21
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.
- package/dist/gatacaqr/app-globals-0f993ce5.js +3 -0
- package/dist/gatacaqr/css-shim-8eec97b3.js +4 -0
- package/dist/gatacaqr/dom-1b0cf05d.js +73 -0
- package/dist/{esm/gat-icon-alert-7b06ef3a.js → gatacaqr/gat-icon-alert-13a1894e.js} +1 -3
- package/dist/{esm → gatacaqr}/gataca-autoqr.entry.js +1 -1
- package/dist/{esm/gataca-qr_2.entry.js → gatacaqr/gataca-qr.entry.js} +14 -78
- package/dist/gatacaqr/gataca-qrdisplay-55780157.js +97 -0
- package/dist/gatacaqr/gataca-qrdisplay.entry.js +2 -0
- package/dist/{esm → gatacaqr}/gataca-qrws.entry.js +3 -3
- package/dist/{components/gataca-ssibutton2.js → gatacaqr/gataca-ssibutton.entry.js} +10 -84
- package/dist/{components/gataca-ssibuttonws2.js → gatacaqr/gataca-ssibuttonws.entry.js} +7 -53
- package/dist/gatacaqr/gatacaqr.esm.js +129 -1
- package/dist/gatacaqr/index-4bc6f36b.js +3262 -0
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/shadow-css-146f2f6f.js +387 -0
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +0 -1
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +0 -5
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +0 -5
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +0 -5
- package/dist/types/components.d.ts +0 -24
- package/package.json +1 -1
- package/dist/cjs/gat-icon-alert-0ad19b26.js +0 -14
- package/dist/cjs/gataca-autoqr.cjs.entry.js +0 -105
- package/dist/cjs/gataca-qr_2.cjs.entry.js +0 -318
- package/dist/cjs/gataca-qrws.cjs.entry.js +0 -252
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -320
- package/dist/cjs/gatacaqr.cjs.js +0 -19
- package/dist/cjs/index-8638645b.js +0 -1482
- package/dist/cjs/index.cjs.js +0 -16
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/qr-code-styling-412bbc7a.js +0 -28
- package/dist/cjs/utils-ef28b844.js +0 -27
- package/dist/collection/assets/icons/gat-icon-alert.svg +0 -5
- package/dist/collection/assets/icons/gat-icon-check.svg +0 -5
- package/dist/collection/assets/icons/gat-icon-refresh.svg +0 -4
- package/dist/collection/assets/images/logo_gataca.svg +0 -7
- package/dist/collection/collection-manifest.json +0 -17
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +0 -116
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +0 -323
- package/dist/collection/components/gataca-qr/components/qr/QR.js +0 -5
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +0 -11
- package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +0 -4
- package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +0 -13
- package/dist/collection/components/gataca-qr/components/success/Success.js +0 -8
- package/dist/collection/components/gataca-qr/gataca-qr.css +0 -399
- package/dist/collection/components/gataca-qr/gataca-qr.js +0 -1001
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +0 -176
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +0 -5
- package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +0 -11
- package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +0 -4
- package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +0 -13
- package/dist/collection/components/gataca-qrws/components/success/Success.js +0 -8
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +0 -400
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +0 -974
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +0 -116
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +0 -979
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +0 -116
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +0 -410
- package/dist/collection/index.js +0 -2
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/utils/utils.js +0 -22
- package/dist/components/gat-icon-alert.js +0 -30
- package/dist/components/gataca-autoqr.js +0 -161
- package/dist/components/gataca-qr.js +0 -6
- package/dist/components/gataca-qr2.js +0 -329
- package/dist/components/gataca-qrdisplay.js +0 -6
- package/dist/components/gataca-qrdisplay2.js +0 -99
- package/dist/components/gataca-qrws.js +0 -6
- package/dist/components/gataca-qrws2.js +0 -310
- package/dist/components/gataca-ssibutton.js +0 -6
- package/dist/components/gataca-ssibuttonws.js +0 -6
- package/dist/components/index.js +0 -8
- package/dist/esm/gataca-ssibutton_2.entry.js +0 -315
- package/dist/esm/gatacaqr.js +0 -17
- package/dist/esm/index-af2994f7.js +0 -1455
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/qr-code-styling-0eeb38d5.js +0 -26
- package/dist/gatacaqr/p-0be4566d.js +0 -1
- package/dist/gatacaqr/p-2cd7b062.js +0 -1
- package/dist/gatacaqr/p-3ca3bb1a.entry.js +0 -1
- package/dist/gatacaqr/p-49424123.entry.js +0 -1
- package/dist/gatacaqr/p-88af482f.entry.js +0 -1
- package/dist/gatacaqr/p-ba0417e2.js +0 -2
- package/dist/gatacaqr/p-d59ae0ab.entry.js +0 -1
- package/dist/gatacaqr/p-ea783014.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → gatacaqr}/utils-63e7a33b.js +0 -0
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$6 } from './gataca-qr2.js';
|
|
3
|
-
import { d as defineCustomElement$5 } from './gataca-qrdisplay2.js';
|
|
4
|
-
import { d as defineCustomElement$4 } from './gataca-qrws2.js';
|
|
5
|
-
import { d as defineCustomElement$3 } from './gataca-ssibutton2.js';
|
|
6
|
-
import { d as defineCustomElement$2 } from './gataca-ssibuttonws2.js';
|
|
7
|
-
|
|
8
|
-
const gatacaAutoqrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
|
|
9
|
-
|
|
10
|
-
const DEFAULT_REPOSITORY = "https://studio.gataca.io/api/v1/qrconfigs";
|
|
11
|
-
const fixFunctions = (data) => {
|
|
12
|
-
var _a, _b, _c, _d, _e, _f;
|
|
13
|
-
data.errorCallback = deserializeFunction((_a = data.errorCallback) === null || _a === void 0 ? void 0 : _a.toString());
|
|
14
|
-
data.successCallback = deserializeFunction((_b = data.successCallback) === null || _b === void 0 ? void 0 : _b.toString());
|
|
15
|
-
data.wsOnMessage = deserializeFunction((_c = data.wsOnMessage) === null || _c === void 0 ? void 0 : _c.toString());
|
|
16
|
-
data.wsOnOpen = deserializeFunction((_d = data.wsOnOpen) === null || _d === void 0 ? void 0 : _d.toString());
|
|
17
|
-
data.checkStatus = deserializeFunction((_e = data.checkStatus) === null || _e === void 0 ? void 0 : _e.toString());
|
|
18
|
-
data.createSession = deserializeFunction((_f = data.createSession) === null || _f === void 0 ? void 0 : _f.toString());
|
|
19
|
-
return data;
|
|
20
|
-
};
|
|
21
|
-
const deserializeFunction = (data) => {
|
|
22
|
-
if (data) {
|
|
23
|
-
return new Function("return " + data)();
|
|
24
|
-
}
|
|
25
|
-
return undefined;
|
|
26
|
-
};
|
|
27
|
-
const GatacaAutoQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this.__registerHost();
|
|
31
|
-
this.__attachShadow();
|
|
32
|
-
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
33
|
-
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
34
|
-
this.configId = undefined;
|
|
35
|
-
this.configRepository = DEFAULT_REPOSITORY;
|
|
36
|
-
this.successCallback = undefined;
|
|
37
|
-
this.errorCallback = undefined;
|
|
38
|
-
this.checkStatus = undefined;
|
|
39
|
-
this.createSession = undefined;
|
|
40
|
-
this.wsOnOpen = undefined;
|
|
41
|
-
this.wsOnMessage = undefined;
|
|
42
|
-
this.config = undefined;
|
|
43
|
-
this.loading = undefined;
|
|
44
|
-
this.loading = true;
|
|
45
|
-
fetch(this.configRepository + "/" + this.configId, {
|
|
46
|
-
method: "GET",
|
|
47
|
-
headers: {
|
|
48
|
-
"Content-Type": "application/json",
|
|
49
|
-
},
|
|
50
|
-
})
|
|
51
|
-
.then((response) => {
|
|
52
|
-
response
|
|
53
|
-
.json()
|
|
54
|
-
.then((data) => {
|
|
55
|
-
data = fixFunctions(data);
|
|
56
|
-
this.config = data;
|
|
57
|
-
this.loading = false;
|
|
58
|
-
})
|
|
59
|
-
.catch((err) => {
|
|
60
|
-
console.log("Cannot retrieve selected config", err);
|
|
61
|
-
this.loading = false;
|
|
62
|
-
});
|
|
63
|
-
})
|
|
64
|
-
.catch((err) => {
|
|
65
|
-
console.log("Cannot retrieve selected config", err);
|
|
66
|
-
this.loading = false;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Retrieve manually the session data on a successful login
|
|
71
|
-
*/
|
|
72
|
-
async getSessionData() {
|
|
73
|
-
return this.qr.getSessionData();
|
|
74
|
-
}
|
|
75
|
-
selectQR() {
|
|
76
|
-
if (this.config.useButton) {
|
|
77
|
-
if (this.config.useWs) {
|
|
78
|
-
this.qr = (h("gataca-ssibuttonws", { buttonText: this.config.buttonText, wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: true, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this.qr = (h("gataca-ssibutton", { buttonText: this.config.buttonText, checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
if (this.config.useWs) {
|
|
86
|
-
this.qr = (h("gataca-qrws", { wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
this.qr = (h("gataca-qr", { checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
render() {
|
|
94
|
-
if (this.loading) {
|
|
95
|
-
//TODO: Improve loading message
|
|
96
|
-
return h("div", null, "Loading...");
|
|
97
|
-
}
|
|
98
|
-
if (this.config) {
|
|
99
|
-
this.selectQR();
|
|
100
|
-
return this.qr;
|
|
101
|
-
}
|
|
102
|
-
//TODO: Improve error message
|
|
103
|
-
return h("div", null, "Error loading your config...");
|
|
104
|
-
}
|
|
105
|
-
static get style() { return gatacaAutoqrCss; }
|
|
106
|
-
}, [1, "gataca-autoqr", {
|
|
107
|
-
"configId": [1, "config-id"],
|
|
108
|
-
"configRepository": [1, "config-repository"],
|
|
109
|
-
"successCallback": [16],
|
|
110
|
-
"errorCallback": [16],
|
|
111
|
-
"checkStatus": [16],
|
|
112
|
-
"createSession": [16],
|
|
113
|
-
"wsOnOpen": [16],
|
|
114
|
-
"wsOnMessage": [16],
|
|
115
|
-
"config": [32],
|
|
116
|
-
"loading": [32],
|
|
117
|
-
"getSessionData": [64]
|
|
118
|
-
}]);
|
|
119
|
-
function defineCustomElement$1() {
|
|
120
|
-
if (typeof customElements === "undefined") {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
const components = ["gataca-autoqr", "gataca-qr", "gataca-qrdisplay", "gataca-qrws", "gataca-ssibutton", "gataca-ssibuttonws"];
|
|
124
|
-
components.forEach(tagName => { switch (tagName) {
|
|
125
|
-
case "gataca-autoqr":
|
|
126
|
-
if (!customElements.get(tagName)) {
|
|
127
|
-
customElements.define(tagName, GatacaAutoQR);
|
|
128
|
-
}
|
|
129
|
-
break;
|
|
130
|
-
case "gataca-qr":
|
|
131
|
-
if (!customElements.get(tagName)) {
|
|
132
|
-
defineCustomElement$6();
|
|
133
|
-
}
|
|
134
|
-
break;
|
|
135
|
-
case "gataca-qrdisplay":
|
|
136
|
-
if (!customElements.get(tagName)) {
|
|
137
|
-
defineCustomElement$5();
|
|
138
|
-
}
|
|
139
|
-
break;
|
|
140
|
-
case "gataca-qrws":
|
|
141
|
-
if (!customElements.get(tagName)) {
|
|
142
|
-
defineCustomElement$4();
|
|
143
|
-
}
|
|
144
|
-
break;
|
|
145
|
-
case "gataca-ssibutton":
|
|
146
|
-
if (!customElements.get(tagName)) {
|
|
147
|
-
defineCustomElement$3();
|
|
148
|
-
}
|
|
149
|
-
break;
|
|
150
|
-
case "gataca-ssibuttonws":
|
|
151
|
-
if (!customElements.get(tagName)) {
|
|
152
|
-
defineCustomElement$2();
|
|
153
|
-
}
|
|
154
|
-
break;
|
|
155
|
-
} });
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const GatacaAutoqr = GatacaAutoQR;
|
|
159
|
-
const defineCustomElement = defineCustomElement$1;
|
|
160
|
-
|
|
161
|
-
export { GatacaAutoqr, defineCustomElement };
|
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
import { h, proxyCustomElement, HTMLElement, createEvent, forceUpdate } from '@stencil/core/internal/client';
|
|
2
|
-
import { l as logoGatacaSvg, d as defineCustomElement$1 } from './gataca-qrdisplay2.js';
|
|
3
|
-
import { g as gatIconCheckSvg, a as gatIconRefreshSvg, d as gatIconAlertSvg, R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode } from './gat-icon-alert.js';
|
|
4
|
-
|
|
5
|
-
const Success = (props) => {
|
|
6
|
-
const { modalHeight, successLoginLabel } = props;
|
|
7
|
-
return (h("div", { class: "success", style: {
|
|
8
|
-
height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) + "px" : "300px",
|
|
9
|
-
} },
|
|
10
|
-
h("img", { src: gatIconCheckSvg, height: 52, width: 52 }),
|
|
11
|
-
h("p", { class: "successMsg" }, successLoginLabel)));
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const RetryButton = (props) => {
|
|
15
|
-
var _a;
|
|
16
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR, } = props;
|
|
17
|
-
return (h("div", { class: "reload", style: {
|
|
18
|
-
width: (modalWidth - 48).toString() + "px",
|
|
19
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + "px" : "",
|
|
20
|
-
} },
|
|
21
|
-
h("div", { id: "notify", onClick: () => display() },
|
|
22
|
-
h("img", { src: gatIconRefreshSvg, height: 24, width: 24 }),
|
|
23
|
-
h("p", { class: "notify-text" },
|
|
24
|
-
clickInsideBoxLabel,
|
|
25
|
-
" "),
|
|
26
|
-
errorMessage ? (h("p", { class: "notify-text bold" }, refreshQrLabel)) : (h("p", { class: "notify-text bold" }, scanQrLabel)),
|
|
27
|
-
errorMessage && (h("div", { class: "alert", style: {
|
|
28
|
-
width: (modalWidth - 48).toString() + "px",
|
|
29
|
-
} },
|
|
30
|
-
h("img", { src: gatIconAlertSvg, height: 24, width: 24 }),
|
|
31
|
-
h("p", null, errorMessage)))),
|
|
32
|
-
h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const AnimatedLoader = () => {
|
|
36
|
-
return (h("div", { class: "containerLoader" },
|
|
37
|
-
h("div", { class: "loader" },
|
|
38
|
-
h("div", { class: "loader__item loader__item__1" }),
|
|
39
|
-
h("div", { class: "loader__item loader__item__2" }),
|
|
40
|
-
h("div", { class: "loader__item loader__item__3" }),
|
|
41
|
-
h("div", { class: "loader__item loader__item__4" }),
|
|
42
|
-
h("div", { class: "loader__item loader__item__5" }),
|
|
43
|
-
h("div", { class: "loader__item loader__item__6" }),
|
|
44
|
-
h("div", { class: "loader__item loader__item__7" }),
|
|
45
|
-
h("div", { class: "loader__item loader__item__8" }))));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const ReadQR = (props) => {
|
|
49
|
-
var _a;
|
|
50
|
-
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
51
|
-
return (h("div", { class: "blured", style: {
|
|
52
|
-
width: (modalWidth - 48).toString() + "px",
|
|
53
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + "px" : "",
|
|
54
|
-
} },
|
|
55
|
-
h("div", { id: "notify" },
|
|
56
|
-
h(AnimatedLoader, null),
|
|
57
|
-
h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
58
|
-
readQrMessages.title,
|
|
59
|
-
" "),
|
|
60
|
-
h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)),
|
|
61
|
-
h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const QR = (props) => {
|
|
65
|
-
const { value, useLogo, logoSrc, size, qrId } = props;
|
|
66
|
-
return (h("gataca-qrdisplay", { id: qrId, qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc }));
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
|
|
70
|
-
|
|
71
|
-
const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
|
|
72
|
-
//Default values
|
|
73
|
-
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
74
|
-
const DEFAULT_POLLING_FREQ = 3;
|
|
75
|
-
const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
76
|
-
constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7); this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrId = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v = "3"; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
|
|
77
|
-
disconnectedCallback() {
|
|
78
|
-
this.stop();
|
|
79
|
-
}
|
|
80
|
-
async componentDidLoad() {
|
|
81
|
-
if (this.autostart) {
|
|
82
|
-
await this.display();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Force manually the display of a QR
|
|
87
|
-
*/
|
|
88
|
-
async display() {
|
|
89
|
-
await this.getSessionId();
|
|
90
|
-
this.result = RESULT_STATUS.ONGOING;
|
|
91
|
-
console.log("display0", "this.result", this.result);
|
|
92
|
-
forceUpdate(this);
|
|
93
|
-
console.log("display1", "this.result", this.result);
|
|
94
|
-
this.poll()
|
|
95
|
-
.then((data) => {
|
|
96
|
-
this.result = RESULT_STATUS.SUCCESS;
|
|
97
|
-
console.log("display2", "this.result", this.result);
|
|
98
|
-
forceUpdate(this);
|
|
99
|
-
console.log("display3", "this.result", this.result);
|
|
100
|
-
this.sessionData = data;
|
|
101
|
-
this.gatacaLoginCompleted.emit(data);
|
|
102
|
-
this.successCallback(data);
|
|
103
|
-
})
|
|
104
|
-
.catch((err) => {
|
|
105
|
-
this.clean();
|
|
106
|
-
let expired = err === RESULT_STATUS.EXPIRED;
|
|
107
|
-
if (expired && this.autorefresh) {
|
|
108
|
-
this.display();
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
if (err !== RESULT_STATUS.NOT_STARTED) {
|
|
112
|
-
let error = expired
|
|
113
|
-
? new Error(this.userNotScanInTimeErrorLabel)
|
|
114
|
-
: new Error(this.credsNotValidatedErrorLabel);
|
|
115
|
-
this.result = err;
|
|
116
|
-
console.log("display4", "this.result", this.result);
|
|
117
|
-
forceUpdate(this);
|
|
118
|
-
console.log("display5", "this.result", this.result);
|
|
119
|
-
this.gatacaLoginFailed.emit(error);
|
|
120
|
-
this.errorCallback(error);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
if (checkMobile() && this.dynamicLink) {
|
|
125
|
-
window.location.href = this.getLink();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Stop manually an ongoing session
|
|
130
|
-
*/
|
|
131
|
-
async stop() {
|
|
132
|
-
this.clean();
|
|
133
|
-
if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
|
|
134
|
-
this.result = RESULT_STATUS.NOT_STARTED;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
clean() {
|
|
138
|
-
this.sessionData = undefined;
|
|
139
|
-
this.sessionId = undefined;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Retrieve manually the session data on a successful login
|
|
143
|
-
*/
|
|
144
|
-
async getSessionData() {
|
|
145
|
-
return this.sessionData
|
|
146
|
-
? Promise.resolve(this.sessionData)
|
|
147
|
-
: Promise.reject(new Error(this.failedLoginErrorLabel));
|
|
148
|
-
}
|
|
149
|
-
async getSessionId() {
|
|
150
|
-
if (this.sessionId) {
|
|
151
|
-
return this.sessionId;
|
|
152
|
-
}
|
|
153
|
-
// console.log("111 getSessionId", "this.sessionId", this.sessionId);
|
|
154
|
-
if (this.createSession) {
|
|
155
|
-
let { sessionId, authenticationRequest } = await this.createSession();
|
|
156
|
-
// console.log("222 getSessionId", "sessionId", sessionId);
|
|
157
|
-
this.sessionId = sessionId;
|
|
158
|
-
this.authenticationRequest = authenticationRequest;
|
|
159
|
-
}
|
|
160
|
-
// console.log("333 getSessionId", "this.sessionId", this.sessionId);
|
|
161
|
-
return this.sessionId;
|
|
162
|
-
}
|
|
163
|
-
getLink() {
|
|
164
|
-
if (this.v === "2") {
|
|
165
|
-
return this.authenticationRequest;
|
|
166
|
-
}
|
|
167
|
-
const authRequestEncoded = "?dl=" + base64UrlEncode(this.authenticationRequest);
|
|
168
|
-
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
169
|
-
}
|
|
170
|
-
async poll() {
|
|
171
|
-
let endTime = new Date().getTime() +
|
|
172
|
-
(this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
173
|
-
let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
|
|
174
|
-
let checkFunc = async (component) => {
|
|
175
|
-
if (component.result === RESULT_STATUS.NOT_STARTED) {
|
|
176
|
-
return { result: RESULT_STATUS.NOT_STARTED };
|
|
177
|
-
}
|
|
178
|
-
let id = await component.getSessionId();
|
|
179
|
-
return component.checkStatus(id);
|
|
180
|
-
};
|
|
181
|
-
let component = this;
|
|
182
|
-
let checkCondition = async function (resolve, reject) {
|
|
183
|
-
// If the condition is met, we're done!
|
|
184
|
-
let { result, data } = await checkFunc(component);
|
|
185
|
-
switch (result) {
|
|
186
|
-
case RESULT_STATUS.SUCCESS:
|
|
187
|
-
resolve(data);
|
|
188
|
-
break;
|
|
189
|
-
case RESULT_STATUS.READ:
|
|
190
|
-
component.result = RESULT_STATUS.READ;
|
|
191
|
-
case RESULT_STATUS.ONGOING:
|
|
192
|
-
if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
|
|
193
|
-
setTimeout(checkCondition, interval, resolve, reject);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
reject(RESULT_STATUS.EXPIRED);
|
|
197
|
-
}
|
|
198
|
-
break;
|
|
199
|
-
default:
|
|
200
|
-
reject(result);
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
return new Promise(checkCondition);
|
|
205
|
-
}
|
|
206
|
-
renderQRSection() {
|
|
207
|
-
console.log("renderQRSection", "this.result", this.result);
|
|
208
|
-
switch (this.result) {
|
|
209
|
-
case RESULT_STATUS.NOT_STARTED:
|
|
210
|
-
return this.renderRetryButton();
|
|
211
|
-
case RESULT_STATUS.ONGOING:
|
|
212
|
-
return this.renderQR(this.getLink(), true);
|
|
213
|
-
case RESULT_STATUS.EXPIRED:
|
|
214
|
-
return this.renderRetryButton(this.qrCodeExpiredLabel);
|
|
215
|
-
case RESULT_STATUS.FAILED:
|
|
216
|
-
return this.renderRetryButton(this.credentialsNotValidatedLabel);
|
|
217
|
-
case RESULT_STATUS.SUCCESS:
|
|
218
|
-
return this.renderSuccess();
|
|
219
|
-
case RESULT_STATUS.READ:
|
|
220
|
-
return this.renderReadQR({
|
|
221
|
-
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
222
|
-
description: this === null || this === void 0 ? void 0 : this.readQrDescription,
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
renderSuccess() {
|
|
227
|
-
console.log("renderSuccess", "this.result", this.result);
|
|
228
|
-
return (h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel }));
|
|
229
|
-
}
|
|
230
|
-
renderRetryButton(errorMessage) {
|
|
231
|
-
return (h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
|
|
232
|
-
}
|
|
233
|
-
renderReadQR(readQrMessages) {
|
|
234
|
-
console.log("renderReadQR", readQrMessages);
|
|
235
|
-
return (h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR.bind(this) }));
|
|
236
|
-
}
|
|
237
|
-
renderQR(value, useLogo) {
|
|
238
|
-
console.log("renderQR", value, useLogo);
|
|
239
|
-
return (h(QR, { qrId: this.qrId, value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
|
|
240
|
-
}
|
|
241
|
-
renderRetryQR(value, useLogo) {
|
|
242
|
-
// console.log("this.qrId", this.qrId);
|
|
243
|
-
return (h(QR, { qrId: this.qrId, value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
|
|
244
|
-
}
|
|
245
|
-
render() {
|
|
246
|
-
var _a, _b;
|
|
247
|
-
return (h("div", { class: "popUpContainer" }, h("div", { class: `is-visible modal-window ${this.hideModalTexts ? "" : "large-modal"} ${this.hideModalBoxShadow ? "noBoxShadow" : ""}`, style: {
|
|
248
|
-
width: (this.modalWidth - 2).toString() + "px",
|
|
249
|
-
height: this.modalHeight
|
|
250
|
-
? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + "px"
|
|
251
|
-
: "",
|
|
252
|
-
}, onClick: (event) => {
|
|
253
|
-
event.stopPropagation();
|
|
254
|
-
} }, h("div", { class: "modal-window__content" }, h("div", { class: `qrTitleContainer ${this.hideModalTexts ? "hidenText" : ""}` }, h("p", { class: "qrTitle modalText", style: { color: this.modalTitleColor || "#1e1e20" } }, this.qrModalTitle), !this.hideBrandTitle && (h("p", { class: "qrBrand modalText" }, this.byBrandLabel, " ", h("span", null, h("img", { src: logoGatacaSvg })))), this.result !== RESULT_STATUS.SUCCESS &&
|
|
255
|
-
!this.hideQrModalDescription && (h("p", { class: "qrDescription modalText" }, this.qrModalDescription))), h("div", { class: "qrSection", style: {
|
|
256
|
-
width: this.modalWidth.toString() + "px",
|
|
257
|
-
height: this.modalWidth
|
|
258
|
-
? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + "px"
|
|
259
|
-
: "",
|
|
260
|
-
} }, this.renderQRSection())))));
|
|
261
|
-
}
|
|
262
|
-
static get style() { return gatacaQrCss; }
|
|
263
|
-
}, [1, "gataca-qr", {
|
|
264
|
-
"checkStatus": [16],
|
|
265
|
-
"createSession": [16],
|
|
266
|
-
"successCallback": [16],
|
|
267
|
-
"errorCallback": [16],
|
|
268
|
-
"qrId": [1, "qr-id"],
|
|
269
|
-
"qrRole": [1, "qr-role"],
|
|
270
|
-
"callbackServer": [1, "callback-server"],
|
|
271
|
-
"autostart": [4],
|
|
272
|
-
"autorefresh": [4],
|
|
273
|
-
"v": [1],
|
|
274
|
-
"qrModalTitle": [1, "qr-modal-title"],
|
|
275
|
-
"modalTitleColor": [1, "modal-title-color"],
|
|
276
|
-
"qrModalDescription": [1, "qr-modal-description"],
|
|
277
|
-
"hideModalTexts": [4, "hide-modal-texts"],
|
|
278
|
-
"hideModalBoxShadow": [4, "hide-modal-box-shadow"],
|
|
279
|
-
"hideBrandTitle": [4, "hide-brand-title"],
|
|
280
|
-
"logoSize": [2, "logo-size"],
|
|
281
|
-
"logoSrc": [1, "logo-src"],
|
|
282
|
-
"qrSize": [2, "qr-size"],
|
|
283
|
-
"modalWidth": [2, "modal-width"],
|
|
284
|
-
"modalHeight": [2, "modal-height"],
|
|
285
|
-
"qrCodeExpiredLabel": [1, "qr-code-expired-label"],
|
|
286
|
-
"credentialsNotValidatedLabel": [1, "credentials-not-validated-label"],
|
|
287
|
-
"clickInsideBoxLabel": [1, "click-inside-box-label"],
|
|
288
|
-
"refreshQrLabel": [1, "refresh-qr-label"],
|
|
289
|
-
"scanQrLabel": [1, "scan-qr-label"],
|
|
290
|
-
"userNotScanInTimeErrorLabel": [1, "user-not-scan-in-time-error-label"],
|
|
291
|
-
"credsNotValidatedErrorLabel": [1, "creds-not-validated-error-label"],
|
|
292
|
-
"failedLoginErrorLabel": [1, "failed-login-error-label"],
|
|
293
|
-
"successLoginLabel": [1, "success-login-label"],
|
|
294
|
-
"byBrandLabel": [1, "by-brand-label"],
|
|
295
|
-
"waitingStartSessionLabel": [1, "waiting-start-session-label"],
|
|
296
|
-
"readQrTitle": [1, "read-qr-title"],
|
|
297
|
-
"readQrDescription": [1, "read-qr-description"],
|
|
298
|
-
"hideQrModalDescription": [4, "hide-qr-modal-description"],
|
|
299
|
-
"sessionTimeout": [2, "session-timeout"],
|
|
300
|
-
"pollingFrequency": [2, "polling-frequency"],
|
|
301
|
-
"dynamicLink": [4, "dynamic-link"],
|
|
302
|
-
"sessionId": [32],
|
|
303
|
-
"authenticationRequest": [32],
|
|
304
|
-
"sessionData": [32],
|
|
305
|
-
"result": [32],
|
|
306
|
-
"display": [64],
|
|
307
|
-
"stop": [64],
|
|
308
|
-
"getSessionData": [64]
|
|
309
|
-
}]);
|
|
310
|
-
function defineCustomElement() {
|
|
311
|
-
if (typeof customElements === "undefined") {
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
const components = ["gataca-qr", "gataca-qrdisplay"];
|
|
315
|
-
components.forEach(tagName => { switch (tagName) {
|
|
316
|
-
case "gataca-qr":
|
|
317
|
-
if (!customElements.get(tagName)) {
|
|
318
|
-
customElements.define(tagName, GatacaQR);
|
|
319
|
-
}
|
|
320
|
-
break;
|
|
321
|
-
case "gataca-qrdisplay":
|
|
322
|
-
if (!customElements.get(tagName)) {
|
|
323
|
-
defineCustomElement$1();
|
|
324
|
-
}
|
|
325
|
-
break;
|
|
326
|
-
} });
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
export { GatacaQR as G, defineCustomElement as d };
|