@gataca/qr 4.1.0 → 4.2.1
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/gatacaqr/gat-icon-check-9132c0ad.js +5 -0
- package/dist/{esm → gatacaqr}/gataca-autoqr.entry.js +1 -1
- package/dist/{components/gataca-qr2.js → gatacaqr/gataca-qr.entry.js} +10 -77
- package/dist/gatacaqr/gataca-qrdisplay-9a22c242.js +123 -0
- package/dist/gatacaqr/gataca-qrdisplay.entry.js +2 -0
- package/dist/{esm → gatacaqr}/gataca-qrws.entry.js +3 -2
- package/dist/{components/gataca-ssibutton2.js → gatacaqr/gataca-ssibutton.entry.js} +39 -89
- package/dist/{esm → gatacaqr}/gataca-ssibuttonws.entry.js +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +129 -1
- package/dist/gatacaqr/index-aea56eb8.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-autoqr/gataca-autoqr.e2e.d.ts +1 -0
- package/dist/types/components/gataca-qr/gataca-qr.e2e.d.ts +1 -0
- package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.e2e.d.ts +1 -0
- package/dist/types/components/gataca-qrws/gataca-qrws.e2e.d.ts +1 -0
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +2 -1
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.e2e.d.ts +1 -0
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.e2e.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/gat-icon-check-6b6780eb.js +0 -37
- package/dist/cjs/gataca-autoqr.cjs.entry.js +0 -106
- package/dist/cjs/gataca-qr_3.cjs.entry.js +0 -743
- package/dist/cjs/gataca-qrws.cjs.entry.js +0 -366
- package/dist/cjs/gataca-ssibuttonws.cjs.entry.js +0 -61
- package/dist/cjs/gatacaqr.cjs.js +0 -19
- package/dist/cjs/index-d8d3dfde.js +0 -1532
- package/dist/cjs/index.cjs.js +0 -17
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/utils-17b0a5ba.js +0 -72
- 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 -347
- package/dist/collection/components/gataca-qr/components/qr/QR.js +0 -13
- package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +0 -16
- package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +0 -6
- package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +0 -19
- package/dist/collection/components/gataca-qr/components/success/Success.js +0 -9
- package/dist/collection/components/gataca-qr/gataca-qr.css +0 -415
- package/dist/collection/components/gataca-qr/gataca-qr.js +0 -1069
- package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +0 -224
- package/dist/collection/components/gataca-qrws/components/qr/QR.js +0 -13
- 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 -16
- package/dist/collection/components/gataca-qrws/components/success/Success.js +0 -8
- package/dist/collection/components/gataca-qrws/gataca-qrws.css +0 -407
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +0 -1098
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +0 -116
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +0 -1151
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +0 -116
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +0 -434
- package/dist/collection/components/icons/RefreshIcon.js +0 -6
- package/dist/collection/index.js +0 -2
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/utils/utils.js +0 -66
- package/dist/components/gat-icon-check.js +0 -72
- package/dist/components/gataca-autoqr.js +0 -163
- package/dist/components/gataca-qr.js +0 -6
- package/dist/components/gataca-qrdisplay.js +0 -6
- package/dist/components/gataca-qrdisplay2.js +0 -121
- package/dist/components/gataca-qrws.js +0 -6
- package/dist/components/gataca-qrws2.js +0 -430
- package/dist/components/gataca-ssibutton.js +0 -6
- package/dist/components/gataca-ssibuttonws.js +0 -6
- package/dist/components/gataca-ssibuttonws2.js +0 -104
- package/dist/components/index.js +0 -8
- package/dist/esm/gat-icon-check-7320c81b.js +0 -32
- package/dist/esm/gataca-qr_3.entry.js +0 -737
- package/dist/esm/gatacaqr.js +0 -17
- package/dist/esm/index-dca2ab22.js +0 -1506
- 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/gatacaqr/p-143c0080.js +0 -1
- package/dist/gatacaqr/p-29119208.js +0 -1
- package/dist/gatacaqr/p-2dc7190a.entry.js +0 -1
- package/dist/gatacaqr/p-2e8accf9.entry.js +0 -1
- package/dist/gatacaqr/p-85af64b1.js +0 -2
- package/dist/gatacaqr/p-d27dabe4.entry.js +0 -1
- package/dist/gatacaqr/p-e172581d.entry.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- /package/dist/{esm → gatacaqr}/utils-e4a08623.js +0 -0
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
|
|
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, s as shortenUrlIfPossible } from './gat-icon-check.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 gatIconRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIzIDRWMTBIMTciIHN0cm9rZT0iIzhCOEI4QiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTIwLjQ4OTkgMTVDMTkuODM5OSAxNi44Mzk5IDE4LjYwOTQgMTguNDE4NyAxNi45ODQgMTkuNDk4NUMxNS4zNTg2IDIwLjU3ODMgMTMuNDI2MyAyMS4xMDA2IDExLjQ3ODMgMjAuOTg2NkM5LjUzMDI2IDIwLjg3MjYgNy42NzIwMyAyMC4xMjg2IDYuMTgzNjMgMTguODY2N0M0LjY5NTI0IDE3LjYwNDcgMy42NTczIDE1Ljg5MzIgMy4yMjYyNSAxMy45OTAxQzIuNzk1MTkgMTIuMDg2OSAyLjk5NDM2IDEwLjA5NTIgMy43OTM3NCA4LjMxNTA4QzQuNTkzMTMgNi41MzQ5NiA1Ljk0OTQyIDUuMDYyODggNy42NTgyMyA0LjEyMDY1QzkuMzY3MDUgMy4xNzg0MyAxMS4zMzU4IDIuODE3MTEgMTMuMjY3OCAzLjA5MTE2QzE1LjE5OTkgMy4zNjUyIDE2Ljk5MDUgNC4yNTk3NSAxOC4zNjk5IDUuNjQwMDFMMjIuOTk5OSAxMCIgc3Ryb2tlPSIjOEI4QjhCIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
|
|
15
|
-
|
|
16
|
-
const RetryButton = (props) => {
|
|
17
|
-
var _a;
|
|
18
|
-
const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, display } = props;
|
|
19
|
-
return (h("div", { class: "reload", style: {
|
|
20
|
-
width: (modalWidth - 48).toString() + 'px',
|
|
21
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
22
|
-
} },
|
|
23
|
-
h("div", { id: "notify", onClick: () => display() },
|
|
24
|
-
h("img", { src: gatIconRefreshSvg, height: 24, width: 24 }),
|
|
25
|
-
h("p", { class: "notify-text" },
|
|
26
|
-
clickInsideBoxLabel,
|
|
27
|
-
" "),
|
|
28
|
-
errorMessage ? h("p", { class: "notify-text bold" }, refreshQrLabel) : h("p", { class: "notify-text bold" }, scanQrLabel),
|
|
29
|
-
errorMessage && (h("div", { class: "alert", style: {
|
|
30
|
-
width: (modalWidth - 48).toString() + 'px'
|
|
31
|
-
} },
|
|
32
|
-
h("img", { src: gatIconAlertSvg, height: 24, width: 24 }),
|
|
33
|
-
h("p", null, errorMessage)))),
|
|
34
|
-
h("div", { id: "qrwait", class: "qr-placeholder-slot", style: {
|
|
35
|
-
width: (modalWidth - 48).toString() + 'px',
|
|
36
|
-
height: modalWidth ? (modalWidth - 48).toString() + 'px' : ''
|
|
37
|
-
} })));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const QR = (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
|
-
}
|
|
50
|
-
return h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, qrType: qrType, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc });
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const AnimatedLoader = () => {
|
|
54
|
-
return (h("div", { class: "containerLoader" },
|
|
55
|
-
h("div", { class: "loader" },
|
|
56
|
-
h("div", { class: "loader__item loader__item__1" }),
|
|
57
|
-
h("div", { class: "loader__item loader__item__2" }),
|
|
58
|
-
h("div", { class: "loader__item loader__item__3" }),
|
|
59
|
-
h("div", { class: "loader__item loader__item__4" }),
|
|
60
|
-
h("div", { class: "loader__item loader__item__5" }),
|
|
61
|
-
h("div", { class: "loader__item loader__item__6" }),
|
|
62
|
-
h("div", { class: "loader__item loader__item__7" }),
|
|
63
|
-
h("div", { class: "loader__item loader__item__8" }))));
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const ReadQR = (props) => {
|
|
67
|
-
var _a;
|
|
68
|
-
const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
|
|
69
|
-
return (h("div", { class: "blured", style: {
|
|
70
|
-
width: (modalWidth - 48).toString() + 'px',
|
|
71
|
-
height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
72
|
-
} },
|
|
73
|
-
h("div", { id: "notify" },
|
|
74
|
-
h(AnimatedLoader, null),
|
|
75
|
-
h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
|
|
76
|
-
readQrMessages.title,
|
|
77
|
-
" "),
|
|
78
|
-
h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)),
|
|
79
|
-
h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
|
|
80
|
-
};
|
|
81
|
-
|
|
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)}}";
|
|
83
|
-
|
|
84
|
-
const DEEP_LINK_PREFIX = 'https://api.gataca.io/qr/redirect.html';
|
|
85
|
-
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
86
|
-
const QR_ROLE_CONNECT = 'connect';
|
|
87
|
-
const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
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
|
-
}
|
|
141
|
-
disconnectedCallback() {
|
|
142
|
-
this.stop();
|
|
143
|
-
}
|
|
144
|
-
async componentDidLoad() {
|
|
145
|
-
if (this.autostart) {
|
|
146
|
-
await this.display();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Force manually the display of a QR
|
|
151
|
-
*/
|
|
152
|
-
async display() {
|
|
153
|
-
this.qrHref = '';
|
|
154
|
-
this.qrShortenPending = false;
|
|
155
|
-
this.lastShortenRaw = null;
|
|
156
|
-
this.qrRefreshGeneration++;
|
|
157
|
-
let socket = new WebSocket(this.socketEndpoint);
|
|
158
|
-
setTimeout(() => {
|
|
159
|
-
this.socket.close(1000, '');
|
|
160
|
-
}, 1000 * this.sessionTimeout);
|
|
161
|
-
this.socket = socket;
|
|
162
|
-
socket.onopen = () => {
|
|
163
|
-
if (this.wsOnOpen)
|
|
164
|
-
this.wsOnOpen(this.socket);
|
|
165
|
-
};
|
|
166
|
-
socket.onmessage = (msg) => {
|
|
167
|
-
if (this.wsOnMessage) {
|
|
168
|
-
this.wsOnMessage(this.socket, msg);
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
let wsresp = JSON.parse(msg.data);
|
|
172
|
-
if (!!wsresp.sessionId) {
|
|
173
|
-
this.handleWSResponse(wsresp);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
socket.onerror = () => {
|
|
178
|
-
let error = new Error('Error connecting with server');
|
|
179
|
-
this.result = RESULT_STATUS.FAILED;
|
|
180
|
-
this.gatacaLoginFailed.emit(error);
|
|
181
|
-
this.errorCallback(error);
|
|
182
|
-
socket.close(1000, '');
|
|
183
|
-
};
|
|
184
|
-
socket.onclose = () => {
|
|
185
|
-
if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
|
|
186
|
-
this.result = RESULT_STATUS.EXPIRED;
|
|
187
|
-
}
|
|
188
|
-
if (this.result === RESULT_STATUS.EXPIRED) {
|
|
189
|
-
if (this.autorefresh) {
|
|
190
|
-
this.display();
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
let error = new Error('User did not scan the QR in the alloted time');
|
|
194
|
-
this.gatacaLoginFailed.emit(error);
|
|
195
|
-
this.errorCallback(error);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
if (checkMobile() && this.dynamicLink) {
|
|
200
|
-
window.location.href = this.getLink();
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
sessionMsgReceived(event) {
|
|
204
|
-
let wsresp = event.detail;
|
|
205
|
-
this.handleWSResponse(wsresp);
|
|
206
|
-
}
|
|
207
|
-
handleWSResponse(wsresp) {
|
|
208
|
-
this.result = wsresp.result;
|
|
209
|
-
switch (wsresp.result) {
|
|
210
|
-
case RESULT_STATUS.ONGOING:
|
|
211
|
-
case RESULT_STATUS.READ: {
|
|
212
|
-
this.sessionId = wsresp.sessionId;
|
|
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
|
-
}
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
case RESULT_STATUS.SUCCESS:
|
|
222
|
-
this.sessionData = wsresp.authenticatedUserData;
|
|
223
|
-
this.gatacaLoginCompleted.emit(wsresp.authenticatedUserData);
|
|
224
|
-
this.successCallback(wsresp.authenticatedUserData);
|
|
225
|
-
this.socket.close(1000, '');
|
|
226
|
-
break;
|
|
227
|
-
case RESULT_STATUS.FAILED:
|
|
228
|
-
this.socket.close();
|
|
229
|
-
let error = new Error("Provided user credentials couldn't be validated");
|
|
230
|
-
this.gatacaLoginFailed.emit(error);
|
|
231
|
-
this.errorCallback(error);
|
|
232
|
-
break;
|
|
233
|
-
case RESULT_STATUS.EXPIRED:
|
|
234
|
-
this.socket.close();
|
|
235
|
-
if (this.autorefresh) {
|
|
236
|
-
this.display();
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
let error = new Error('User did not scan the QR in the alloted time');
|
|
240
|
-
this.gatacaLoginFailed.emit(error);
|
|
241
|
-
this.errorCallback(error);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Stop manually an ongoing session
|
|
247
|
-
*/
|
|
248
|
-
async stop() {
|
|
249
|
-
this.sessionData = undefined;
|
|
250
|
-
this.sessionId = undefined;
|
|
251
|
-
this.qrHref = '';
|
|
252
|
-
this.qrShortenPending = false;
|
|
253
|
-
this.lastShortenRaw = null;
|
|
254
|
-
this.socket.close(1000, 'Client stopped the connection');
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Retrieve manually the session data on a successful login
|
|
258
|
-
*/
|
|
259
|
-
async getSessionData() {
|
|
260
|
-
return this.sessionData ? Promise.resolve(this.sessionData) : Promise.reject(new Error('No successful login'));
|
|
261
|
-
}
|
|
262
|
-
buildRawLink() {
|
|
263
|
-
var _a;
|
|
264
|
-
if (this.v === '2' && this.qrRole == QR_ROLE_CONNECT) {
|
|
265
|
-
return (_a = this.authenticationRequest) !== null && _a !== void 0 ? _a : '';
|
|
266
|
-
}
|
|
267
|
-
const authRequestEncoded = '?dl=' + base64UrlEncode(this.authenticationRequest);
|
|
268
|
-
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
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
|
-
}
|
|
305
|
-
renderQRSection() {
|
|
306
|
-
var _a, _b, _c;
|
|
307
|
-
switch (this.result) {
|
|
308
|
-
case RESULT_STATUS.NOT_STARTED:
|
|
309
|
-
return this.renderRetryButton();
|
|
310
|
-
case RESULT_STATUS.ONGOING:
|
|
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()));
|
|
312
|
-
case RESULT_STATUS.EXPIRED:
|
|
313
|
-
return this.renderRetryButton(this.qrCodeExpiredLabel);
|
|
314
|
-
case RESULT_STATUS.FAILED:
|
|
315
|
-
return this.renderRetryButton(this.credentialsNotValidatedLabel);
|
|
316
|
-
case RESULT_STATUS.SUCCESS:
|
|
317
|
-
return this.renderSuccess();
|
|
318
|
-
case RESULT_STATUS.READ:
|
|
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
|
-
});
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
renderSuccess() {
|
|
328
|
-
return h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel });
|
|
329
|
-
}
|
|
330
|
-
renderRetryButton(errorMessage) {
|
|
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) }));
|
|
332
|
-
}
|
|
333
|
-
renderReadQR(readQrMessages) {
|
|
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) }));
|
|
337
|
-
}
|
|
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 });
|
|
340
|
-
}
|
|
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
|
-
} }));
|
|
348
|
-
}
|
|
349
|
-
render() {
|
|
350
|
-
var _a, _b;
|
|
351
|
-
return (h("div", { class: "popUpContainer" }, h("div", { class: `is-visible modal-window ${this.hideModalTexts ? '' : 'large-modal'} ${this.hideModalBoxShadow ? 'noBoxShadow' : ''}`, style: {
|
|
352
|
-
width: (this.modalWidth - 2).toString() + 'px',
|
|
353
|
-
height: this.modalHeight ? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + 'px' : ''
|
|
354
|
-
}, onClick: (event) => {
|
|
355
|
-
event.stopPropagation();
|
|
356
|
-
} }, 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 && !this.hideQrModalDescription && h("p", { class: "qrDescription modalText" }, this.qrModalDescription)), h("div", { class: "qrSection", style: {
|
|
357
|
-
width: this.modalWidth.toString() + 'px',
|
|
358
|
-
height: this.modalWidth ? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + 'px' : ''
|
|
359
|
-
} }, this.renderQRSection())))));
|
|
360
|
-
}
|
|
361
|
-
static get style() { return gatacaQrwsCss; }
|
|
362
|
-
}, [1, "gataca-qrws", {
|
|
363
|
-
"successCallback": [16],
|
|
364
|
-
"errorCallback": [16],
|
|
365
|
-
"qrRole": [1, "qr-role"],
|
|
366
|
-
"qrType": [1, "qr-type"],
|
|
367
|
-
"callbackServer": [1, "callback-server"],
|
|
368
|
-
"socketEndpoint": [1, "socket-endpoint"],
|
|
369
|
-
"sessionTimeout": [2, "session-timeout"],
|
|
370
|
-
"wsOnOpen": [16],
|
|
371
|
-
"wsOnMessage": [16],
|
|
372
|
-
"autostart": [4],
|
|
373
|
-
"autorefresh": [4],
|
|
374
|
-
"v": [1],
|
|
375
|
-
"qrModalTitle": [1, "qr-modal-title"],
|
|
376
|
-
"modalTitleColor": [1, "modal-title-color"],
|
|
377
|
-
"qrModalDescription": [1, "qr-modal-description"],
|
|
378
|
-
"hideModalTexts": [4, "hide-modal-texts"],
|
|
379
|
-
"hideModalBoxShadow": [4, "hide-modal-box-shadow"],
|
|
380
|
-
"hideBrandTitle": [4, "hide-brand-title"],
|
|
381
|
-
"logoSize": [2, "logo-size"],
|
|
382
|
-
"logoSrc": [1, "logo-src"],
|
|
383
|
-
"qrSize": [2, "qr-size"],
|
|
384
|
-
"modalWidth": [2, "modal-width"],
|
|
385
|
-
"modalHeight": [2, "modal-height"],
|
|
386
|
-
"qrCodeExpiredLabel": [1, "qr-code-expired-label"],
|
|
387
|
-
"credentialsNotValidatedLabel": [1, "credentials-not-validated-label"],
|
|
388
|
-
"clickInsideBoxLabel": [1, "click-inside-box-label"],
|
|
389
|
-
"refreshQrLabel": [1, "refresh-qr-label"],
|
|
390
|
-
"scanQrLabel": [1, "scan-qr-label"],
|
|
391
|
-
"userNotScanInTimeErrorLabel": [1, "user-not-scan-in-time-error-label"],
|
|
392
|
-
"credsNotValidatedErrorLabel": [1, "creds-not-validated-error-label"],
|
|
393
|
-
"failedLoginErrorLabel": [1, "failed-login-error-label"],
|
|
394
|
-
"successLoginLabel": [1, "success-login-label"],
|
|
395
|
-
"byBrandLabel": [1, "by-brand-label"],
|
|
396
|
-
"waitingStartSessionLabel": [1, "waiting-start-session-label"],
|
|
397
|
-
"readQrTitle": [1, "read-qr-title"],
|
|
398
|
-
"readQrDescription": [1, "read-qr-description"],
|
|
399
|
-
"hideQrModalDescription": [4, "hide-qr-modal-description"],
|
|
400
|
-
"dynamicLink": [4, "dynamic-link"],
|
|
401
|
-
"sessionId": [32],
|
|
402
|
-
"authenticationRequest": [32],
|
|
403
|
-
"sessionData": [32],
|
|
404
|
-
"result": [32],
|
|
405
|
-
"qrHref": [32],
|
|
406
|
-
"qrShortenPending": [32],
|
|
407
|
-
"display": [64],
|
|
408
|
-
"stop": [64],
|
|
409
|
-
"getSessionData": [64]
|
|
410
|
-
}, [[2, "sessionMsg", "sessionMsgReceived"]]]);
|
|
411
|
-
function defineCustomElement() {
|
|
412
|
-
if (typeof customElements === "undefined") {
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
const components = ["gataca-qrws", "gataca-qrdisplay"];
|
|
416
|
-
components.forEach(tagName => { switch (tagName) {
|
|
417
|
-
case "gataca-qrws":
|
|
418
|
-
if (!customElements.get(tagName)) {
|
|
419
|
-
customElements.define(tagName, GatacaQRWS);
|
|
420
|
-
}
|
|
421
|
-
break;
|
|
422
|
-
case "gataca-qrdisplay":
|
|
423
|
-
if (!customElements.get(tagName)) {
|
|
424
|
-
defineCustomElement$1();
|
|
425
|
-
}
|
|
426
|
-
break;
|
|
427
|
-
} });
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export { GatacaQRWS as G, defineCustomElement as d };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$2 } from './gataca-qrdisplay2.js';
|
|
3
|
-
import { d as defineCustomElement$1 } from './gataca-qrws2.js';
|
|
4
|
-
|
|
5
|
-
const gatacaSsibuttonwsCss = "@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}";
|
|
6
|
-
|
|
7
|
-
const PHONE_ICON = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=';
|
|
8
|
-
const GatacaSSIButtonWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this.__registerHost();
|
|
12
|
-
this.__attachShadow();
|
|
13
|
-
this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7);
|
|
14
|
-
this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7);
|
|
15
|
-
this.buttonText = 'Easy login';
|
|
16
|
-
this.successCallback = undefined;
|
|
17
|
-
this.errorCallback = undefined;
|
|
18
|
-
this.qrType = 'svg';
|
|
19
|
-
this.qrRole = undefined;
|
|
20
|
-
this.callbackServer = undefined;
|
|
21
|
-
this.socketEndpoint = undefined;
|
|
22
|
-
this.sessionTimeout = undefined;
|
|
23
|
-
this.wsOnOpen = undefined;
|
|
24
|
-
this.wsOnMessage = undefined;
|
|
25
|
-
this.autostart = true;
|
|
26
|
-
this.autorefresh = false;
|
|
27
|
-
this.v = '3';
|
|
28
|
-
this.qrModalTitle = 'Quick Access';
|
|
29
|
-
this.qrModalDescription = 'Sign up or sign in by scanning the QR Code with the Gataca Wallet';
|
|
30
|
-
this.hideBrandTitle = false;
|
|
31
|
-
this.dynamicLink = true;
|
|
32
|
-
this.open = false;
|
|
33
|
-
this.qr = (h("gataca-qrws", { wsOnMessage: this.wsOnMessage, wsOnOpen: this.wsOnOpen, successCallback: this.successCallback, errorCallback: this.errorCallback, qrRole: this.qrRole, qrType: this.qrType, callbackServer: this.callbackServer, sessionTimeout: this.sessionTimeout, socketEndpoint: this.socketEndpoint, autostart: true, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Retrieve manually the session data on a successful login
|
|
37
|
-
*/
|
|
38
|
-
async getSessionData() {
|
|
39
|
-
return this.qr.getSessionData();
|
|
40
|
-
}
|
|
41
|
-
renderModal() {
|
|
42
|
-
return this.qr;
|
|
43
|
-
}
|
|
44
|
-
renderButton() {
|
|
45
|
-
return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
|
|
46
|
-
this.open = !this.open;
|
|
47
|
-
if (this.open) {
|
|
48
|
-
this.qr.display();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
this.qr.stop();
|
|
52
|
-
}
|
|
53
|
-
} }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
return (h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
|
|
57
|
-
}
|
|
58
|
-
static get style() { return gatacaSsibuttonwsCss; }
|
|
59
|
-
}, [1, "gataca-ssibuttonws", {
|
|
60
|
-
"buttonText": [1, "button-text"],
|
|
61
|
-
"successCallback": [16],
|
|
62
|
-
"errorCallback": [16],
|
|
63
|
-
"qrType": [1, "qr-type"],
|
|
64
|
-
"qrRole": [1, "qr-role"],
|
|
65
|
-
"callbackServer": [1, "callback-server"],
|
|
66
|
-
"socketEndpoint": [1, "socket-endpoint"],
|
|
67
|
-
"sessionTimeout": [2, "session-timeout"],
|
|
68
|
-
"wsOnOpen": [16],
|
|
69
|
-
"wsOnMessage": [16],
|
|
70
|
-
"autostart": [4],
|
|
71
|
-
"autorefresh": [4],
|
|
72
|
-
"v": [1],
|
|
73
|
-
"qrModalTitle": [1, "qr-modal-title"],
|
|
74
|
-
"qrModalDescription": [1, "qr-modal-description"],
|
|
75
|
-
"hideBrandTitle": [4, "hide-brand-title"],
|
|
76
|
-
"dynamicLink": [4, "dynamic-link"],
|
|
77
|
-
"open": [32],
|
|
78
|
-
"getSessionData": [64]
|
|
79
|
-
}]);
|
|
80
|
-
function defineCustomElement() {
|
|
81
|
-
if (typeof customElements === "undefined") {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const components = ["gataca-ssibuttonws", "gataca-qrdisplay", "gataca-qrws"];
|
|
85
|
-
components.forEach(tagName => { switch (tagName) {
|
|
86
|
-
case "gataca-ssibuttonws":
|
|
87
|
-
if (!customElements.get(tagName)) {
|
|
88
|
-
customElements.define(tagName, GatacaSSIButtonWS);
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
case "gataca-qrdisplay":
|
|
92
|
-
if (!customElements.get(tagName)) {
|
|
93
|
-
defineCustomElement$2();
|
|
94
|
-
}
|
|
95
|
-
break;
|
|
96
|
-
case "gataca-qrws":
|
|
97
|
-
if (!customElements.get(tagName)) {
|
|
98
|
-
defineCustomElement$1();
|
|
99
|
-
}
|
|
100
|
-
break;
|
|
101
|
-
} });
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export { GatacaSSIButtonWS as G, defineCustomElement as d };
|
package/dist/components/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile, s as shortenUrlIfPossible } from './gat-icon-check.js';
|
|
3
|
-
export { GatacaAutoqr, defineCustomElement as defineCustomElementGatacaAutoqr } from './gataca-autoqr.js';
|
|
4
|
-
export { GatacaQr, defineCustomElement as defineCustomElementGatacaQr } from './gataca-qr.js';
|
|
5
|
-
export { GatacaQrdisplay, defineCustomElement as defineCustomElementGatacaQrdisplay } from './gataca-qrdisplay.js';
|
|
6
|
-
export { GatacaQrws, defineCustomElement as defineCustomElementGatacaQrws } from './gataca-qrws.js';
|
|
7
|
-
export { GatacaSsibutton, defineCustomElement as defineCustomElementGatacaSsibutton } from './gataca-ssibutton.js';
|
|
8
|
-
export { GatacaSsibuttonws, defineCustomElement as defineCustomElementGatacaSsibuttonws } from './gataca-ssibuttonws.js';
|