@gataca/qr 4.0.3 → 4.1.0
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/cjs/gataca-autoqr.cjs.entry.js +1 -1
- package/dist/cjs/gataca-qr_3.cjs.entry.js +128 -24
- package/dist/cjs/gataca-qrws.cjs.entry.js +141 -21
- package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +1 -1
- package/dist/cjs/gatacaqr.cjs.js +2 -2
- package/dist/cjs/{index-1332a8ce.js → index-d8d3dfde.js} +32 -0
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{utils-c6edb275.js → utils-17b0a5ba.js} +44 -0
- package/dist/collection/components/gataca-qr/components/qr/QR.js +9 -1
- package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +5 -2
- package/dist/collection/components/gataca-qr/gataca-qr.css +6 -0
- package/dist/collection/components/gataca-qr/gataca-qr.js +86 -16
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +28 -4
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +9 -1
- package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +5 -2
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +7 -0
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +125 -17
- package/dist/collection/utils/utils.js +43 -0
- package/dist/components/gat-icon-check.js +44 -1
- package/dist/components/gataca-qr2.js +105 -19
- package/dist/components/gataca-qrdisplay2.js +25 -4
- package/dist/components/gataca-qrws2.js +144 -20
- package/dist/components/index.js +1 -1
- package/dist/esm/gataca-autoqr.entry.js +1 -1
- package/dist/esm/gataca-qr_3.entry.js +129 -25
- package/dist/esm/gataca-qrws.entry.js +141 -21
- package/dist/esm/gataca-ssibuttonws.entry.js +1 -1
- package/dist/esm/gatacaqr.js +2 -2
- package/dist/esm/{index-055790a7.js → index-dca2ab22.js} +32 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{utils-22df0ce4.js → utils-e4a08623.js} +44 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/index.esm.js +1 -1
- package/dist/gatacaqr/{p-0501e224.js → p-143c0080.js} +1 -1
- package/dist/gatacaqr/p-2dc7190a.entry.js +1 -0
- package/dist/gatacaqr/{p-49cf321c.entry.js → p-2e8accf9.entry.js} +1 -1
- package/dist/gatacaqr/p-85af64b1.js +2 -0
- package/dist/gatacaqr/{p-c65f810b.entry.js → p-d27dabe4.entry.js} +1 -1
- package/dist/gatacaqr/p-e172581d.entry.js +1 -0
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +1 -0
- package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +0 -2
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +5 -2
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +4 -0
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +1 -0
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +0 -2
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +8 -2
- package/dist/types/utils/utils.d.ts +5 -0
- package/package.json +1 -1
- package/dist/gatacaqr/p-2083dd06.entry.js +0 -1
- package/dist/gatacaqr/p-f5a4f65c.entry.js +0 -1
- package/dist/gatacaqr/p-fccf9d4d.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
2
2
|
import { l as logoGatacaSvg, d as defineCustomElement$1 } from './gataca-qrdisplay2.js';
|
|
3
|
-
import { a as gatIconCheckSvg, g as gatIconAlertSvg, R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode } from './gat-icon-check.js';
|
|
3
|
+
import { a as gatIconCheckSvg, g as gatIconAlertSvg, R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode, s as shortenUrlIfPossible } from './gat-icon-check.js';
|
|
4
4
|
|
|
5
5
|
const Success = (props) => {
|
|
6
6
|
const { modalHeight, successLoginLabel } = props;
|
|
@@ -15,7 +15,7 @@ const gatIconRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWd
|
|
|
15
15
|
|
|
16
16
|
const RetryButton = (props) => {
|
|
17
17
|
var _a;
|
|
18
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel,
|
|
18
|
+
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, display } = props;
|
|
19
19
|
return (h("div", { class: "reload", style: {
|
|
20
20
|
width: (modalWidth - 48).toString() + 'px',
|
|
21
21
|
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
@@ -31,11 +31,22 @@ const RetryButton = (props) => {
|
|
|
31
31
|
} },
|
|
32
32
|
h("img", { src: gatIconAlertSvg, height: 24, width: 24 }),
|
|
33
33
|
h("p", null, errorMessage)))),
|
|
34
|
-
h("div", { id: "qrwait"
|
|
34
|
+
h("div", { id: "qrwait", class: "qr-placeholder-slot", style: {
|
|
35
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
36
|
+
height: modalWidth ? (modalWidth - 48).toString() + 'px' : ''
|
|
37
|
+
} })));
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
const QR = (props) => {
|
|
38
|
-
const { value, useLogo, logoSrc, size, qrType } = props;
|
|
41
|
+
const { value, useLogo, logoSrc, size, qrType, linkReady = true } = props;
|
|
42
|
+
const s = size !== null && size !== void 0 ? size : 256;
|
|
43
|
+
if (!linkReady) {
|
|
44
|
+
return (h("div", { class: "qr-loading-slot", style: {
|
|
45
|
+
width: s + 'px',
|
|
46
|
+
height: s + 'px',
|
|
47
|
+
margin: '0 auto'
|
|
48
|
+
} }));
|
|
49
|
+
}
|
|
39
50
|
return h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, qrType: qrType, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
|
|
40
51
|
};
|
|
41
52
|
|
|
@@ -68,13 +79,65 @@ const ReadQR = (props) => {
|
|
|
68
79
|
h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
69
80
|
};
|
|
70
81
|
|
|
71
|
-
const gatacaQrwsCss = "@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)}}";
|
|
82
|
+
const gatacaQrwsCss = "@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}.qr-placeholder-slot,.qr-loading-slot{box-sizing:border-box;border-radius:12px;background:rgba(0, 0, 0, 0.04)}#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)}}";
|
|
72
83
|
|
|
73
84
|
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
74
85
|
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
75
86
|
const QR_ROLE_CONNECT = 'connect';
|
|
76
87
|
const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
77
|
-
constructor() {
|
|
88
|
+
constructor() {
|
|
89
|
+
super();
|
|
90
|
+
this.__registerHost();
|
|
91
|
+
this.__attachShadow();
|
|
92
|
+
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
93
|
+
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
94
|
+
this.qrRefreshGeneration = 0;
|
|
95
|
+
this.lastShortenRaw = null;
|
|
96
|
+
this.successCallback = undefined;
|
|
97
|
+
this.errorCallback = undefined;
|
|
98
|
+
this.qrRole = undefined;
|
|
99
|
+
this.qrType = 'svg';
|
|
100
|
+
this.callbackServer = undefined;
|
|
101
|
+
this.socketEndpoint = undefined;
|
|
102
|
+
this.sessionTimeout = DEFAULT_SESSION_TIMEOUT;
|
|
103
|
+
this.wsOnOpen = undefined;
|
|
104
|
+
this.wsOnMessage = undefined;
|
|
105
|
+
this.autostart = true;
|
|
106
|
+
this.autorefresh = false;
|
|
107
|
+
this.v = '3';
|
|
108
|
+
this.qrModalTitle = 'Quick Access';
|
|
109
|
+
this.modalTitleColor = '#4745B7';
|
|
110
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
111
|
+
this.hideModalTexts = false;
|
|
112
|
+
this.hideModalBoxShadow = false;
|
|
113
|
+
this.hideBrandTitle = false;
|
|
114
|
+
this.logoSize = 0;
|
|
115
|
+
this.logoSrc = logoGatacaSvg;
|
|
116
|
+
this.qrSize = 300;
|
|
117
|
+
this.modalWidth = 300;
|
|
118
|
+
this.modalHeight = undefined;
|
|
119
|
+
this.qrCodeExpiredLabel = 'QR Code expired';
|
|
120
|
+
this.credentialsNotValidatedLabel = 'User credentials not validated';
|
|
121
|
+
this.clickInsideBoxLabel = 'Click inside the box to';
|
|
122
|
+
this.refreshQrLabel = 'Refresh QR Code';
|
|
123
|
+
this.scanQrLabel = 'Scan QR Code';
|
|
124
|
+
this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
|
|
125
|
+
this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
|
|
126
|
+
this.failedLoginErrorLabel = 'No successful login';
|
|
127
|
+
this.successLoginLabel = 'Successful Connection!';
|
|
128
|
+
this.byBrandLabel = 'by Gataca';
|
|
129
|
+
this.waitingStartSessionLabel = 'waiting to start a session';
|
|
130
|
+
this.readQrTitle = 'Processing...';
|
|
131
|
+
this.readQrDescription = 'Please wait a moment';
|
|
132
|
+
this.hideQrModalDescription = false;
|
|
133
|
+
this.dynamicLink = true;
|
|
134
|
+
this.sessionId = undefined;
|
|
135
|
+
this.authenticationRequest = undefined;
|
|
136
|
+
this.sessionData = undefined;
|
|
137
|
+
this.result = RESULT_STATUS.NOT_STARTED;
|
|
138
|
+
this.qrHref = '';
|
|
139
|
+
this.qrShortenPending = false;
|
|
140
|
+
}
|
|
78
141
|
disconnectedCallback() {
|
|
79
142
|
this.stop();
|
|
80
143
|
}
|
|
@@ -87,6 +150,10 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
87
150
|
* Force manually the display of a QR
|
|
88
151
|
*/
|
|
89
152
|
async display() {
|
|
153
|
+
this.qrHref = '';
|
|
154
|
+
this.qrShortenPending = false;
|
|
155
|
+
this.lastShortenRaw = null;
|
|
156
|
+
this.qrRefreshGeneration++;
|
|
90
157
|
let socket = new WebSocket(this.socketEndpoint);
|
|
91
158
|
setTimeout(() => {
|
|
92
159
|
this.socket.close(1000, '');
|
|
@@ -141,10 +208,16 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
141
208
|
this.result = wsresp.result;
|
|
142
209
|
switch (wsresp.result) {
|
|
143
210
|
case RESULT_STATUS.ONGOING:
|
|
144
|
-
case RESULT_STATUS.READ:
|
|
211
|
+
case RESULT_STATUS.READ: {
|
|
145
212
|
this.sessionId = wsresp.sessionId;
|
|
146
213
|
this.authenticationRequest = wsresp.authenticationRequest;
|
|
214
|
+
const raw = this.buildRawLink();
|
|
215
|
+
if (raw === null || raw === void 0 ? void 0 : raw.trim()) {
|
|
216
|
+
this.qrShortenPending = true;
|
|
217
|
+
void this.refreshQrHref();
|
|
218
|
+
}
|
|
147
219
|
break;
|
|
220
|
+
}
|
|
148
221
|
case RESULT_STATUS.SUCCESS:
|
|
149
222
|
this.sessionData = wsresp.authenticatedUserData;
|
|
150
223
|
this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
|
|
@@ -175,6 +248,9 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
175
248
|
async stop() {
|
|
176
249
|
this.sessionData = undefined;
|
|
177
250
|
this.sessionId = undefined;
|
|
251
|
+
this.qrHref = '';
|
|
252
|
+
this.qrShortenPending = false;
|
|
253
|
+
this.lastShortenRaw = null;
|
|
178
254
|
this.socket.close(1000, 'Client stopped the connection');
|
|
179
255
|
}
|
|
180
256
|
/**
|
|
@@ -183,19 +259,56 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
183
259
|
async getSessionData() {
|
|
184
260
|
return this.sessionData ? Promise.resolve(this.sessionData) : Promise.reject(new Error('No successful login'));
|
|
185
261
|
}
|
|
186
|
-
|
|
262
|
+
buildRawLink() {
|
|
263
|
+
var _a;
|
|
187
264
|
if (this.v === '2' && this.qrRole == QR_ROLE_CONNECT) {
|
|
188
|
-
return this.authenticationRequest;
|
|
265
|
+
return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
|
|
189
266
|
}
|
|
190
267
|
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
191
268
|
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
192
269
|
}
|
|
270
|
+
async refreshQrHref() {
|
|
271
|
+
var _a, _b, _c;
|
|
272
|
+
const raw = this.buildRawLink();
|
|
273
|
+
if (!(raw === null || raw === void 0 ? void 0 : raw.trim())) {
|
|
274
|
+
this.qrShortenPending = false;
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (raw === this.lastShortenRaw && ((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
278
|
+
this.qrShortenPending = false;
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (this.qrShortenPending && raw === this.lastShortenRaw && !((_b = this.qrHref) === null || _b === void 0 ? void 0 : _b.trim())) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const gen = ++this.qrRefreshGeneration;
|
|
285
|
+
this.lastShortenRaw = raw;
|
|
286
|
+
try {
|
|
287
|
+
const shortened = await shortenUrlIfPossible(raw);
|
|
288
|
+
const now = this.buildRawLink();
|
|
289
|
+
if (now === raw) {
|
|
290
|
+
this.qrHref = shortened;
|
|
291
|
+
}
|
|
292
|
+
else if (!((_c = this.qrHref) === null || _c === void 0 ? void 0 : _c.trim())) {
|
|
293
|
+
this.qrHref = now;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
finally {
|
|
297
|
+
if (gen === this.qrRefreshGeneration) {
|
|
298
|
+
this.qrShortenPending = false;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
getLink() {
|
|
303
|
+
return this.qrHref || this.buildRawLink();
|
|
304
|
+
}
|
|
193
305
|
renderQRSection() {
|
|
306
|
+
var _a, _b, _c;
|
|
194
307
|
switch (this.result) {
|
|
195
308
|
case RESULT_STATUS.NOT_STARTED:
|
|
196
309
|
return this.renderRetryButton();
|
|
197
310
|
case RESULT_STATUS.ONGOING:
|
|
198
|
-
return this.renderQR(this.getLink(), true);
|
|
311
|
+
return this.qrShortenPending || !((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim()) ? this.renderQrLoadingSlot() : this.renderQR(this.getLink(), true, undefined, !!((_b = this.qrHref) === null || _b === void 0 ? void 0 : _b.trim()));
|
|
199
312
|
case RESULT_STATUS.EXPIRED:
|
|
200
313
|
return this.renderRetryButton(this.qrCodeExpiredLabel);
|
|
201
314
|
case RESULT_STATUS.FAILED:
|
|
@@ -203,26 +316,35 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
203
316
|
case RESULT_STATUS.SUCCESS:
|
|
204
317
|
return this.renderSuccess();
|
|
205
318
|
case RESULT_STATUS.READ:
|
|
206
|
-
return this.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
319
|
+
return this.qrShortenPending || !((_c = this.qrHref) === null || _c === void 0 ? void 0 : _c.trim())
|
|
320
|
+
? this.renderQrLoadingSlot()
|
|
321
|
+
: this.renderReadQR({
|
|
322
|
+
title: this === null || this === void 0 ? void 0 : this.readQrTitle,
|
|
323
|
+
description: this === null || this === void 0 ? void 0 : this.readQrDescription
|
|
324
|
+
});
|
|
210
325
|
}
|
|
211
326
|
}
|
|
212
327
|
renderSuccess() {
|
|
213
328
|
return h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel });
|
|
214
329
|
}
|
|
215
330
|
renderRetryButton(errorMessage) {
|
|
216
|
-
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,
|
|
331
|
+
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, display: this.display.bind(this) }));
|
|
217
332
|
}
|
|
218
333
|
renderReadQR(readQrMessages) {
|
|
219
|
-
|
|
334
|
+
var _a;
|
|
335
|
+
const linkReady = !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim());
|
|
336
|
+
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: (url, useLogo, size) => this.renderQR(url, useLogo, size, linkReady) }));
|
|
220
337
|
}
|
|
221
|
-
renderQR(value, useLogo, sizeQR) {
|
|
222
|
-
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc });
|
|
338
|
+
renderQR(value, useLogo, sizeQR, linkReady = true) {
|
|
339
|
+
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, linkReady: linkReady });
|
|
223
340
|
}
|
|
224
|
-
|
|
225
|
-
|
|
341
|
+
renderQrLoadingSlot() {
|
|
342
|
+
const s = this.qrSize || 300;
|
|
343
|
+
return (h("div", { class: "qr-loading-slot", style: {
|
|
344
|
+
width: s + 'px',
|
|
345
|
+
height: s + 'px',
|
|
346
|
+
margin: '0 auto'
|
|
347
|
+
} }));
|
|
226
348
|
}
|
|
227
349
|
render() {
|
|
228
350
|
var _a, _b;
|
|
@@ -280,6 +402,8 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
280
402
|
"authenticationRequest": [32],
|
|
281
403
|
"sessionData": [32],
|
|
282
404
|
"result": [32],
|
|
405
|
+
"qrHref": [32],
|
|
406
|
+
"qrShortenPending": [32],
|
|
283
407
|
"display": [64],
|
|
284
408
|
"stop": [64],
|
|
285
409
|
"getSessionData": [64]
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile } from './gat-icon-check.js';
|
|
2
|
+
export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile, s as shortenUrlIfPossible } from './gat-icon-check.js';
|
|
3
3
|
export { GatacaAutoqr, defineCustomElement as defineCustomElementGatacaAutoqr } from './gataca-autoqr.js';
|
|
4
4
|
export { GatacaQr, defineCustomElement as defineCustomElementGatacaQr } from './gataca-qr.js';
|
|
5
5
|
export { GatacaQrdisplay, defineCustomElement as defineCustomElementGatacaQrdisplay } from './gataca-qrdisplay.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-dca2ab22.js';
|
|
2
2
|
|
|
3
3
|
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}";
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, c as createEvent } from './index-
|
|
2
|
-
import {
|
|
3
|
-
import { R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode } from './utils-
|
|
1
|
+
import { r as registerInstance, h, c as createEvent } from './index-dca2ab22.js';
|
|
2
|
+
import { l as logoGatacaSvg, Q as QRCodeStyling, g as gatIconAlertSvg, a as gatIconCheckSvg } from './gat-icon-check-7320c81b.js';
|
|
3
|
+
import { R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode, s as shortenUrlIfPossible } from './utils-e4a08623.js';
|
|
4
4
|
|
|
5
5
|
const GatacaQRDisplay = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -14,8 +14,8 @@ const GatacaQRDisplay = class {
|
|
|
14
14
|
this.bgColor = '#FFFFFF';
|
|
15
15
|
this.rounded = true;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
getQrOptions() {
|
|
18
|
+
return {
|
|
19
19
|
data: this.qrData,
|
|
20
20
|
width: this.size,
|
|
21
21
|
height: this.size,
|
|
@@ -39,18 +39,47 @@ const GatacaQRDisplay = class {
|
|
|
39
39
|
backgroundOptions: {
|
|
40
40
|
color: this.bgColor
|
|
41
41
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
componentDidLoad() {
|
|
45
|
+
this.mountOrUpdateQr();
|
|
46
|
+
}
|
|
47
|
+
onQrDataChange() {
|
|
48
|
+
this.mountOrUpdateQr();
|
|
49
|
+
}
|
|
50
|
+
mountOrUpdateQr() {
|
|
51
|
+
var _a;
|
|
52
|
+
if (!((_a = this.qrData) === null || _a === void 0 ? void 0 : _a.trim()) || !this.qr) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!this.qrCode) {
|
|
56
|
+
this.qrCode = new QRCodeStyling(this.getQrOptions());
|
|
57
|
+
this.qrCode.append(this.qr);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.qrCode.update({ data: this.qrData });
|
|
61
|
+
}
|
|
44
62
|
}
|
|
45
63
|
render() {
|
|
46
64
|
return (h("div", { ref: (el) => {
|
|
47
65
|
this.qr = el;
|
|
48
66
|
} }));
|
|
49
67
|
}
|
|
68
|
+
static get watchers() { return {
|
|
69
|
+
"qrData": ["onQrDataChange"]
|
|
70
|
+
}; }
|
|
50
71
|
};
|
|
51
72
|
|
|
52
73
|
const QR = (props) => {
|
|
53
|
-
const { value, useLogo, logoSrc, size, qrType, style } = props;
|
|
74
|
+
const { value, useLogo, logoSrc, size, qrType, style, linkReady = true } = props;
|
|
75
|
+
const s = size !== null && size !== void 0 ? size : 256;
|
|
76
|
+
if (!linkReady) {
|
|
77
|
+
return (h("div", { class: "qr-loading-slot", style: {
|
|
78
|
+
width: s + 'px',
|
|
79
|
+
height: s + 'px',
|
|
80
|
+
margin: '0 auto'
|
|
81
|
+
} }));
|
|
82
|
+
}
|
|
54
83
|
return h("gataca-qrdisplay", { qrData: value, rounded: true, qrType: qrType, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc, qrColor: style === null || style === void 0 ? void 0 : style.color, bgColor: style === null || style === void 0 ? void 0 : style.bgColor });
|
|
55
84
|
};
|
|
56
85
|
|
|
@@ -100,7 +129,7 @@ const RefreshIcon = (props) => {
|
|
|
100
129
|
|
|
101
130
|
const RetryButton = (props) => {
|
|
102
131
|
var _a;
|
|
103
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel,
|
|
132
|
+
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, style, display } = props;
|
|
104
133
|
const bgStyle = { backgroundColor: (style === null || style === void 0 ? void 0 : style.bgColor) ? style === null || style === void 0 ? void 0 : style.bgColor : 'white' };
|
|
105
134
|
const alertBgStyle = { backgroundColor: (style === null || style === void 0 ? void 0 : style.alertBgColor) ? style === null || style === void 0 ? void 0 : style.alertBgColor : '#ffdedf' };
|
|
106
135
|
const alertBorderColor = { borderColor: (style === null || style === void 0 ? void 0 : style.alertBorderColor) ? style === null || style === void 0 ? void 0 : style.alertBorderColor : '#ee888c' };
|
|
@@ -119,7 +148,10 @@ const RetryButton = (props) => {
|
|
|
119
148
|
errorMessage && (h("div", { class: "alert", style: Object.assign(Object.assign({ width: (modalWidth - 48).toString() + 'px' }, alertBgStyle), { border: `1px solid ${alertBorderColor}` }) },
|
|
120
149
|
h("img", { src: gatIconAlertSvg, height: 24, width: 24 }),
|
|
121
150
|
h("p", { style: { color: (style === null || style === void 0 ? void 0 : style.color) ? style === null || style === void 0 ? void 0 : style.color : '#1e1e20' } }, errorMessage)))),
|
|
122
|
-
h("div", { id: "qrwait"
|
|
151
|
+
h("div", { id: "qrwait", class: "qr-placeholder-slot", style: {
|
|
152
|
+
width: (modalWidth - 48).toString() + 'px',
|
|
153
|
+
height: modalWidth ? (modalWidth - 48).toString() + 'px' : ''
|
|
154
|
+
} })));
|
|
123
155
|
};
|
|
124
156
|
|
|
125
157
|
const Success = (props) => {
|
|
@@ -132,14 +164,63 @@ const Success = (props) => {
|
|
|
132
164
|
h("p", { class: "successMsg", style: colorStyle }, successLoginLabel)));
|
|
133
165
|
};
|
|
134
166
|
|
|
135
|
-
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:20px;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>svg{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-color:var(--loader-color, #4745B7);border-radius:2px;--to-opacity:1;opacity:var(--to-opacity)}.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);--to-opacity:calc(1 - (0 / 8));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);--to-opacity:calc(1 - (1 / 8));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);--to-opacity:calc(1 - (2 / 8));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);--to-opacity:calc(1 - (3 / 8));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);--to-opacity:calc(1 - (4 / 8));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);--to-opacity:calc(1 - (5 / 8));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);--to-opacity:calc(1 - (6 / 8));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);--to-opacity:calc(1 - (7 / 8));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%{opacity:1}100%{opacity:var(--to-opacity)}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
|
|
167
|
+
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:20px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}.qr-placeholder-slot{box-sizing:border-box;border-radius:12px;background:rgba(0, 0, 0, 0.04)}#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>svg{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-color:var(--loader-color, #4745B7);border-radius:2px;--to-opacity:1;opacity:var(--to-opacity)}.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);--to-opacity:calc(1 - (0 / 8));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);--to-opacity:calc(1 - (1 / 8));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);--to-opacity:calc(1 - (2 / 8));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);--to-opacity:calc(1 - (3 / 8));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);--to-opacity:calc(1 - (4 / 8));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);--to-opacity:calc(1 - (5 / 8));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);--to-opacity:calc(1 - (6 / 8));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);--to-opacity:calc(1 - (7 / 8));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%{opacity:1}100%{opacity:var(--to-opacity)}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
|
|
136
168
|
|
|
137
169
|
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
138
170
|
//Default values
|
|
139
171
|
const DEFAULT_SESSION_TIMEOUT$1 = 300; //5mins as in connect
|
|
140
172
|
const DEFAULT_POLLING_FREQ$1 = 3;
|
|
141
173
|
const GatacaQR = class {
|
|
142
|
-
constructor(hostRef) {
|
|
174
|
+
constructor(hostRef) {
|
|
175
|
+
registerInstance(this, hostRef);
|
|
176
|
+
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
177
|
+
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
178
|
+
this.lastShortenRaw = null;
|
|
179
|
+
this.checkStatus = undefined;
|
|
180
|
+
this.createSession = undefined;
|
|
181
|
+
this.successCallback = undefined;
|
|
182
|
+
this.errorCallback = undefined;
|
|
183
|
+
this.qrRole = undefined;
|
|
184
|
+
this.qrType = 'svg';
|
|
185
|
+
this.callbackServer = undefined;
|
|
186
|
+
this.autostart = true;
|
|
187
|
+
this.autorefresh = false;
|
|
188
|
+
this.v = '3';
|
|
189
|
+
this.qrModalTitle = 'Quick Access';
|
|
190
|
+
this.modalTitleColor = '#4745B7';
|
|
191
|
+
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
192
|
+
this.hideModalTexts = false;
|
|
193
|
+
this.hideModalBoxShadow = false;
|
|
194
|
+
this.hideBrandTitle = false;
|
|
195
|
+
this.logoSize = 0;
|
|
196
|
+
this.logoSrc = logoGatacaSvg;
|
|
197
|
+
this.qrSize = 300;
|
|
198
|
+
this.modalWidth = 300;
|
|
199
|
+
this.modalHeight = undefined;
|
|
200
|
+
this.qrCodeExpiredLabel = 'QR Code expired';
|
|
201
|
+
this.credentialsNotValidatedLabel = 'User credentials not validated';
|
|
202
|
+
this.clickInsideBoxLabel = 'Click inside the box to';
|
|
203
|
+
this.refreshQrLabel = 'Refresh QR Code';
|
|
204
|
+
this.scanQrLabel = 'Scan QR Code';
|
|
205
|
+
this.userNotScanInTimeErrorLabel = 'User did not scan the QR in the allowed time';
|
|
206
|
+
this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated";
|
|
207
|
+
this.failedLoginErrorLabel = 'No successful login';
|
|
208
|
+
this.successLoginLabel = 'Successful Connection!';
|
|
209
|
+
this.byBrandLabel = 'by Gataca';
|
|
210
|
+
this.waitingStartSessionLabel = 'waiting to start a session';
|
|
211
|
+
this.readQrTitle = 'Processing...';
|
|
212
|
+
this.readQrDescription = 'Please wait a moment';
|
|
213
|
+
this.hideQrModalDescription = false;
|
|
214
|
+
this.sessionTimeout = DEFAULT_SESSION_TIMEOUT$1;
|
|
215
|
+
this.pollingFrequency = DEFAULT_POLLING_FREQ$1;
|
|
216
|
+
this.dynamicLink = true;
|
|
217
|
+
this.qrStyle = undefined;
|
|
218
|
+
this.sessionId = undefined;
|
|
219
|
+
this.authenticationRequest = undefined;
|
|
220
|
+
this.sessionData = undefined;
|
|
221
|
+
this.result = RESULT_STATUS.NOT_STARTED;
|
|
222
|
+
this.qrHref = '';
|
|
223
|
+
}
|
|
143
224
|
disconnectedCallback() {
|
|
144
225
|
this.stop();
|
|
145
226
|
}
|
|
@@ -153,6 +234,7 @@ const GatacaQR = class {
|
|
|
153
234
|
*/
|
|
154
235
|
async display() {
|
|
155
236
|
await this.getSessionId();
|
|
237
|
+
await this.refreshQrHref();
|
|
156
238
|
this.result = RESULT_STATUS.ONGOING;
|
|
157
239
|
this.poll()
|
|
158
240
|
.then((data) => {
|
|
@@ -180,6 +262,30 @@ const GatacaQR = class {
|
|
|
180
262
|
window.location.href = this.getLink();
|
|
181
263
|
}
|
|
182
264
|
}
|
|
265
|
+
buildRawLink() {
|
|
266
|
+
var _a;
|
|
267
|
+
if (this.v === '2') {
|
|
268
|
+
return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
|
|
269
|
+
}
|
|
270
|
+
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
271
|
+
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
272
|
+
}
|
|
273
|
+
async refreshQrHref() {
|
|
274
|
+
var _a;
|
|
275
|
+
const raw = this.buildRawLink();
|
|
276
|
+
if (raw === this.lastShortenRaw) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
this.lastShortenRaw = raw;
|
|
280
|
+
const shortened = await shortenUrlIfPossible(raw !== null && raw !== void 0 ? raw : '');
|
|
281
|
+
const now = this.buildRawLink();
|
|
282
|
+
if (now === raw) {
|
|
283
|
+
this.qrHref = shortened;
|
|
284
|
+
}
|
|
285
|
+
else if (!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
286
|
+
this.qrHref = now;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
183
289
|
/**
|
|
184
290
|
* Stop manually an ongoing session
|
|
185
291
|
*/
|
|
@@ -192,6 +298,8 @@ const GatacaQR = class {
|
|
|
192
298
|
clean() {
|
|
193
299
|
this.sessionData = undefined;
|
|
194
300
|
this.sessionId = undefined;
|
|
301
|
+
this.qrHref = '';
|
|
302
|
+
this.lastShortenRaw = null;
|
|
195
303
|
}
|
|
196
304
|
/**
|
|
197
305
|
* Retrieve manually the session data on a successful login
|
|
@@ -209,11 +317,7 @@ const GatacaQR = class {
|
|
|
209
317
|
return this.sessionId;
|
|
210
318
|
}
|
|
211
319
|
getLink() {
|
|
212
|
-
|
|
213
|
-
return this.authenticationRequest;
|
|
214
|
-
}
|
|
215
|
-
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
216
|
-
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
320
|
+
return this.qrHref || this.buildRawLink();
|
|
217
321
|
}
|
|
218
322
|
async poll() {
|
|
219
323
|
let endTime = new Date().getTime() + (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT$1) * 1000;
|
|
@@ -251,11 +355,12 @@ const GatacaQR = class {
|
|
|
251
355
|
return new Promise(checkCondition);
|
|
252
356
|
}
|
|
253
357
|
renderQRSection() {
|
|
358
|
+
var _a;
|
|
254
359
|
switch (this.result) {
|
|
255
360
|
case RESULT_STATUS.NOT_STARTED:
|
|
256
361
|
return this.renderRetryButton();
|
|
257
362
|
case RESULT_STATUS.ONGOING:
|
|
258
|
-
return this.renderQR(this.getLink(), true);
|
|
363
|
+
return this.renderQR(this.getLink(), true, undefined, !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim()));
|
|
259
364
|
case RESULT_STATUS.EXPIRED:
|
|
260
365
|
return this.renderRetryButton(this.qrCodeExpiredLabel);
|
|
261
366
|
case RESULT_STATUS.FAILED:
|
|
@@ -273,16 +378,15 @@ const GatacaQR = class {
|
|
|
273
378
|
return h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel, style: this === null || this === void 0 ? void 0 : this.qrStyle });
|
|
274
379
|
}
|
|
275
380
|
renderRetryButton(errorMessage) {
|
|
276
|
-
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,
|
|
381
|
+
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, display: this.display.bind(this), style: this === null || this === void 0 ? void 0 : this.qrStyle }));
|
|
277
382
|
}
|
|
278
383
|
renderReadQR(readQrMessages) {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, style: this === null || this === void 0 ? void 0 : this.qrStyle });
|
|
384
|
+
var _a;
|
|
385
|
+
const linkReady = !!((_a = this.qrHref) === null || _a === void 0 ? void 0 : _a.trim());
|
|
386
|
+
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: (url, useLogo, size) => this.renderQR(url, useLogo, size, linkReady), style: this.qrStyle }));
|
|
283
387
|
}
|
|
284
|
-
|
|
285
|
-
return h(QR, { value: value, useLogo: useLogo && this.logoSize !== 0,
|
|
388
|
+
renderQR(value, useLogo, sizeQR, linkReady = true) {
|
|
389
|
+
return (h(QR, { value: value, qrType: this.qrType, useLogo: useLogo && this.logoSize !== 0, size: sizeQR || (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc, style: this === null || this === void 0 ? void 0 : this.qrStyle, linkReady: linkReady }));
|
|
286
390
|
}
|
|
287
391
|
render() {
|
|
288
392
|
var _a, _b, _c, _d, _e, _f;
|