@gataca/qr 3.0.10 → 3.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/cjs/gataca-autoqr.cjs.entry.js +9 -9
  2. package/dist/cjs/gataca-qr_2.cjs.entry.js +36 -46
  3. package/dist/cjs/gataca-qrws.cjs.entry.js +35 -42
  4. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +34 -38
  5. package/dist/cjs/index.cjs.js +1 -1
  6. package/dist/cjs/{utils-ef28b844.js → utils-b4e62bc0.js} +1 -1
  7. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +13 -13
  8. package/dist/collection/components/gataca-qr/components/qr/QR.js +2 -2
  9. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +4 -4
  10. package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +1 -1
  11. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +8 -8
  12. package/dist/collection/components/gataca-qr/components/success/Success.js +4 -4
  13. package/dist/collection/components/gataca-qr/gataca-qr.js +45 -55
  14. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +12 -12
  15. package/dist/collection/components/gataca-qrws/components/qr/QR.js +2 -2
  16. package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +4 -4
  17. package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +1 -1
  18. package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +8 -8
  19. package/dist/collection/components/gataca-qrws/components/success/Success.js +4 -4
  20. package/dist/collection/components/gataca-qrws/gataca-qrws.js +49 -56
  21. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +62 -52
  22. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +12 -12
  23. package/dist/collection/index.js +2 -2
  24. package/dist/collection/utils/index.js +1 -1
  25. package/dist/collection/utils/utils.js +1 -1
  26. package/dist/components/gat-icon-alert.js +1 -1
  27. package/dist/components/gataca-autoqr.js +9 -9
  28. package/dist/components/gataca-qr2.js +28 -38
  29. package/dist/components/gataca-qrdisplay2.js +7 -7
  30. package/dist/components/gataca-qrws2.js +34 -41
  31. package/dist/components/gataca-ssibutton2.js +27 -31
  32. package/dist/components/gataca-ssibuttonws2.js +6 -6
  33. package/dist/esm/gataca-autoqr.entry.js +9 -9
  34. package/dist/esm/gataca-qr_2.entry.js +36 -46
  35. package/dist/esm/gataca-qrws.entry.js +35 -42
  36. package/dist/esm/gataca-ssibutton_2.entry.js +34 -38
  37. package/dist/esm/index.js +1 -1
  38. package/dist/esm/{utils-63e7a33b.js → utils-21ffcc1e.js} +1 -1
  39. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  40. package/dist/gatacaqr/index.esm.js +1 -1
  41. package/dist/gatacaqr/{p-3500ae66.entry.js → p-2adc0bcc.entry.js} +1 -1
  42. package/dist/gatacaqr/p-2ddbc2fc.entry.js +1 -0
  43. package/dist/gatacaqr/{p-68272823.entry.js → p-d2dd7c85.entry.js} +1 -1
  44. package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +7 -7
  45. package/dist/types/components/gataca-qr/components/qr/QR.d.ts +2 -2
  46. package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +1 -1
  47. package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +1 -1
  48. package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +1 -1
  49. package/dist/types/components/gataca-qr/components/success/Success.d.ts +1 -1
  50. package/dist/types/components/gataca-qr/gataca-qr.d.ts +4 -4
  51. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +1 -1
  52. package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +2 -2
  53. package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +1 -1
  54. package/dist/types/components/gataca-qrws/components/readQR/components/AnimatedLoader.d.ts +1 -1
  55. package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +1 -1
  56. package/dist/types/components/gataca-qrws/components/success/Success.d.ts +1 -1
  57. package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +4 -4
  58. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +9 -5
  59. package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +3 -3
  60. package/dist/types/components.d.ts +28 -36
  61. package/dist/types/index.d.ts +2 -2
  62. package/dist/types/utils/index.d.ts +1 -1
  63. package/package.json +30 -7
  64. package/dist/gatacaqr/p-92a2e6f0.entry.js +0 -1
  65. /package/dist/gatacaqr/{p-2cd7b062.js → p-bce7e590.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { EventEmitter } from "../../stencil-public-runtime";
2
- import { GatacaQRWS } from "../gataca-qrws/gataca-qrws";
3
- import { DrawType } from "qr-code-styling";
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { GatacaQRWS } from '../gataca-qrws/gataca-qrws';
3
+ import { DrawType } from 'qr-code-styling';
4
4
  export declare class GatacaSSIButtonWS {
5
5
  qr: GatacaQRWS;
6
6
  constructor();
@@ -13,9 +13,7 @@ export namespace Components {
13
13
  /**
14
14
  * ___Just for polling flavour___ ***Mandatory*** Check status function to query the current status of the session The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
15
15
  */
16
- "checkStatus"?: (
17
- id?: string
18
- ) => Promise<{ result: RESULT_STATUS; data?: any }>;
16
+ "checkStatus"?: (id?: string) => Promise<{result: RESULT_STATUS; data?: any}>;
19
17
  /**
20
18
  * ***Mandatory*** ID of the QR configuration to display
21
19
  */
@@ -28,9 +26,9 @@ export namespace Components {
28
26
  * ***Mandatory*** Create session function to generate a new Session Using v="3", it can provide just a session Id Using another version, it must provide also the authentication request. The session Id is the id of the presentation definition
29
27
  */
30
28
  "createSession"?: () => Promise<{
31
- sessionId: string;
32
- authenticationRequest?: string;
33
- }>;
29
+ sessionId: string;
30
+ authenticationRequest?: string;
31
+ }>;
34
32
  /**
35
33
  * ___Just for polling flavour___ ***Mandatory*** Callback fired upon session expired or invalid If not set, session error would not be handled An error containing information will be passed as parameter
36
34
  */
@@ -76,9 +74,7 @@ export namespace Components {
76
74
  /**
77
75
  * ***Mandatory*** Check status function to query the current status of the session The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
78
76
  */
79
- "checkStatus"?: (
80
- id?: string
81
- ) => Promise<{ result: RESULT_STATUS1; data?: any }>;
77
+ "checkStatus"?: (id?: string) => Promise<{result: RESULT_STATUS1; data?: any}>;
82
78
  /**
83
79
  * _[Optional]_ String to show "click inside" label
84
80
  */
@@ -87,9 +83,9 @@ export namespace Components {
87
83
  * ***Mandatory*** Create session function to generate a new Session Using v="3", it can provide just a session Id Using another version, it must provide also the authentication request. The session Id is the id of the presentation definition
88
84
  */
89
85
  "createSession"?: () => Promise<{
90
- sessionId: string;
91
- authenticationRequest?: string;
92
- }>;
86
+ sessionId: string;
87
+ authenticationRequest?: string;
88
+ }>;
93
89
  /**
94
90
  * _[Optional]_ String to show when credentials not validatedd
95
91
  */
@@ -451,9 +447,7 @@ export namespace Components {
451
447
  /**
452
448
  * ***Mandatory*** Check status function to query the current status of the session The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
453
449
  */
454
- "checkStatus"?: (
455
- id?: string
456
- ) => Promise<{ result: RESULT_STATUS1; data?: any }>;
450
+ "checkStatus"?: (id?: string) => Promise<{result: RESULT_STATUS1; data?: any}>;
457
451
  /**
458
452
  * _[Optional]_ String to show "click inside" label
459
453
  */
@@ -462,9 +456,9 @@ export namespace Components {
462
456
  * ***Mandatory*** Create session function to generate a new Session Using v="3", it can provide just a session Id Using another version, it must provide also the authentication request. The session Id is the id of the presentation definition
463
457
  */
464
458
  "createSession"?: () => Promise<{
465
- sessionId: string;
466
- authenticationRequest?: string;
467
- }>;
459
+ sessionId: string;
460
+ authenticationRequest?: string;
461
+ }>;
468
462
  /**
469
463
  * _[Optional]_ String to show when credentials not validatedd
470
464
  */
@@ -724,9 +718,7 @@ declare namespace LocalJSX {
724
718
  /**
725
719
  * ___Just for polling flavour___ ***Mandatory*** Check status function to query the current status of the session The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
726
720
  */
727
- "checkStatus"?: (
728
- id?: string
729
- ) => Promise<{ result: RESULT_STATUS; data?: any }>;
721
+ "checkStatus"?: (id?: string) => Promise<{result: RESULT_STATUS; data?: any}>;
730
722
  /**
731
723
  * ***Mandatory*** ID of the QR configuration to display
732
724
  */
@@ -739,9 +731,9 @@ declare namespace LocalJSX {
739
731
  * ***Mandatory*** Create session function to generate a new Session Using v="3", it can provide just a session Id Using another version, it must provide also the authentication request. The session Id is the id of the presentation definition
740
732
  */
741
733
  "createSession"?: () => Promise<{
742
- sessionId: string;
743
- authenticationRequest?: string;
744
- }>;
734
+ sessionId: string;
735
+ authenticationRequest?: string;
736
+ }>;
745
737
  /**
746
738
  * ___Just for polling flavour___ ***Mandatory*** Callback fired upon session expired or invalid If not set, session error would not be handled An error containing information will be passed as parameter
747
739
  */
@@ -791,9 +783,7 @@ declare namespace LocalJSX {
791
783
  /**
792
784
  * ***Mandatory*** Check status function to query the current status of the session The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
793
785
  */
794
- "checkStatus"?: (
795
- id?: string
796
- ) => Promise<{ result: RESULT_STATUS1; data?: any }>;
786
+ "checkStatus"?: (id?: string) => Promise<{result: RESULT_STATUS1; data?: any}>;
797
787
  /**
798
788
  * _[Optional]_ String to show "click inside" label
799
789
  */
@@ -802,9 +792,9 @@ declare namespace LocalJSX {
802
792
  * ***Mandatory*** Create session function to generate a new Session Using v="3", it can provide just a session Id Using another version, it must provide also the authentication request. The session Id is the id of the presentation definition
803
793
  */
804
794
  "createSession"?: () => Promise<{
805
- sessionId: string;
806
- authenticationRequest?: string;
807
- }>;
795
+ sessionId: string;
796
+ authenticationRequest?: string;
797
+ }>;
808
798
  /**
809
799
  * _[Optional]_ String to show when credentials not validatedd
810
800
  */
@@ -1158,9 +1148,7 @@ declare namespace LocalJSX {
1158
1148
  /**
1159
1149
  * ***Mandatory*** Check status function to query the current status of the session The function must query a client endpoint to check the status. That endpoint must return an error if the session has expired.
1160
1150
  */
1161
- "checkStatus"?: (
1162
- id?: string
1163
- ) => Promise<{ result: RESULT_STATUS1; data?: any }>;
1151
+ "checkStatus"?: (id?: string) => Promise<{result: RESULT_STATUS1; data?: any}>;
1164
1152
  /**
1165
1153
  * _[Optional]_ String to show "click inside" label
1166
1154
  */
@@ -1169,9 +1157,9 @@ declare namespace LocalJSX {
1169
1157
  * ***Mandatory*** Create session function to generate a new Session Using v="3", it can provide just a session Id Using another version, it must provide also the authentication request. The session Id is the id of the presentation definition
1170
1158
  */
1171
1159
  "createSession"?: () => Promise<{
1172
- sessionId: string;
1173
- authenticationRequest?: string;
1174
- }>;
1160
+ sessionId: string;
1161
+ authenticationRequest?: string;
1162
+ }>;
1175
1163
  /**
1176
1164
  * _[Optional]_ String to show when credentials not validatedd
1177
1165
  */
@@ -1216,6 +1204,10 @@ declare namespace LocalJSX {
1216
1204
  * _[Optional]_ String to set Modal title color
1217
1205
  */
1218
1206
  "modalTitleColor"?: string;
1207
+ /**
1208
+ * GatacaLoginCompleted event, triggered with session data upon login success
1209
+ */
1210
+ "onGatacaButtonPushed"?: (event: GatacaSsibuttonCustomEvent<any>) => void;
1219
1211
  /**
1220
1212
  * GatacaLoginCompleted event, triggered with session data upon login success
1221
1213
  */
@@ -1,2 +1,2 @@
1
- export * from "./components";
2
- export * from "./utils";
1
+ export * from './components';
2
+ export * from './utils';
@@ -1 +1 @@
1
- export * from "./utils";
1
+ export * from './utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gataca/qr",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
4
4
  "description": "Gataca component to display presentation requests in QR",
5
5
  "author": "Gataca <it@gataca.io>",
6
6
  "licenses": [
@@ -21,25 +21,48 @@
21
21
  "loader/"
22
22
  ],
23
23
  "scripts": {
24
+ "audit": "./audit.sh",
24
25
  "build": "stencil build --docs",
26
+ "format": "prettier --write 'src/**/*.{ts,tsx,js,jsx}'",
27
+ "generate": "stencil generate",
28
+ "licenses": "npx license-checker --direct --relativeLicensePath > licenses.txt && npx license-checker --direct --summary > licenses-summary.txt",
25
29
  "start": "stencil build --dev --watch --serve",
26
30
  "test": "stencil test --spec --e2e",
27
31
  "test.watch": "stencil test --spec --e2e --watchAll",
28
- "generate": "stencil generate"
32
+ "typescript": "tsc --noEmit --composite false"
29
33
  },
30
34
  "devDependencies": {
31
35
  "@stencil/core": "^2.9.0",
32
36
  "@stencil/sass": "^1.4.0",
33
37
  "@types/jest": "^27.0.3",
34
38
  "@types/react": "^18.2.67",
35
- "jest": "^27.0.3",
36
- "jest-cli": "^27.4.5",
37
- "puppeteer": "^10.0.0",
38
- "rollup-plugin-node-polyfills": "^0.2.1"
39
+ "jest": "^29.7.0",
40
+ "jest-cli": "^29.7.0",
41
+ "prettier": "^3.5.3",
42
+ "puppeteer": "^24.4.0",
43
+ "rollup-plugin-node-polyfills": "^0.2.1",
44
+ "typescript": "^5.8.3"
39
45
  },
40
46
  "license": "MIT",
41
47
  "dependencies": {
42
- "@stencil/react-output-target": "^0.4.0",
48
+ "@stencil/react-output-target": "^0.5.3",
49
+ "pre-commit": "^1.2.2",
43
50
  "qr-code-styling": "1.6.0-rc.1"
51
+ },
52
+ "pre-commit": [
53
+ "format",
54
+ "typescript",
55
+ "audit",
56
+ "licenses"
57
+ ],
58
+ "resolutions": {
59
+ "micromatch": "^4.0.8",
60
+ "cross-spawn": "^7.0.5",
61
+ "@babel/helpers": "^7.26.10"
62
+ },
63
+ "overrides": {
64
+ "micromatch": "^4.0.8",
65
+ "cross-spawn": "^7.0.5",
66
+ "@babel/helpers": "^7.26.10"
44
67
  }
45
68
  }
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as a}from"./p-5ae5f952.js";import"./p-0be4566d.js";import{R as s}from"./p-2cd7b062.js";const e="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=",o=class{constructor(e){t(this,e),this.gatacaLoginCompleted=i(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=i(this,"gatacaLoginFailed",7),this.buttonText="Easy login",this.qrType="svg",this.autostart=!0,this.checkStatus=void 0,this.createSession=void 0,this.successCallback=void 0,this.errorCallback=void 0,this.handleCheckAppLoading=void 0,this.checkAppTimeout=6,this.qrRole=void 0,this.callbackServer=void 0,this.sessionTimeout=void 0,this.pollingFrequency=void 0,this.autorefresh=!1,this.v="3",this.qrModalTitle="Quick Access",this.modalTitleColor="#4745B7",this.qrModalDescription="Sign up or sign in by scanning the QR Code with the Gataca Wallet",this.hideBrandTitle=!1,this.dynamicLink=!0,this.logoSize=0,this.logoSrc=void 0,this.qrCodeExpiredLabel="QR Code expired",this.credentialsNotValidatedLabel="User credentials not validated",this.clickInsideBoxLabel="Click inside the box to",this.refreshQrLabel="Refresh QR Code",this.scanQrLabel="Scan QR Code",this.userNotScanInTimeErrorLabel="User did not scan the QR in the allowed time",this.credsNotValidatedErrorLabel="Provided user credentials couldn't be validated",this.failedLoginErrorLabel="No successful login",this.successLoginLabel="Successful Connection!",this.byBrandLabel="by Gataca",this.waitingStartSessionLabel="waiting to start a session",this.hideQrModalDescription=!1,this.open=!1,this.sessionId=void 0,this.authenticationRequest=void 0,this.sessionData=void 0,this.result=s.NOT_STARTED,this.qr=a("gataca-qr",{ref:t=>this.qrElement=t,checkStatus:this.checkStatus,createSession:this.createSession,successCallback:this.successCallback,errorCallback:this.errorCallback,qrRole:this.qrRole,qrType:this.qrType,callbackServer:this.callbackServer,sessionTimeout:this.sessionTimeout,pollingFrequency:this.pollingFrequency,autostart:this.autostart,autorefresh:this.autorefresh,v:this.v,qrModalTitle:this.qrModalTitle,qrModalDescription:this.qrModalDescription,hideBrandTitle:this.hideBrandTitle,dynamicLink:this.dynamicLink,logoSize:this.logoSize,logoSrc:this.logoSrc,modalTitleColor:this.modalTitleColor,qrCodeExpiredLabel:this.qrCodeExpiredLabel,credentialsNotValidatedLabel:this.credentialsNotValidatedLabel,clickInsideBoxLabel:this.clickInsideBoxLabel,refreshQrLabel:this.refreshQrLabel,scanQrLabel:this.scanQrLabel,userNotScanInTimeErrorLabel:this.userNotScanInTimeErrorLabel,credsNotValidatedErrorLabel:this.credsNotValidatedErrorLabel,failedLoginErrorLabel:this.failedLoginErrorLabel,successLoginLabel:this.successLoginLabel,byBrandLabel:this.byBrandLabel,waitingStartSessionLabel:this.waitingStartSessionLabel,hideQrModalDescription:this.hideQrModalDescription})}async getSessionData(){return this.qr.getSessionData()}async getSessionId(){if(this.sessionId)return this.sessionId;let{sessionId:t,authenticationRequest:i}=await this.createSession();return this.sessionId=t,this.authenticationRequest=i,this.sessionId}async startMobilePolling(){await this.getSessionId(),this.result=s.ONGOING,this.poll().then((t=>{this.result=s.SUCCESS,this.sessionData=t,this.gatacaLoginCompleted.emit(t),this.successCallback(t)})).catch((t=>{this.clean();let i=t===s.EXPIRED;if(i&&this.autorefresh)this.startMobilePolling();else if(t!==s.NOT_STARTED){let a=i?new Error(this.userNotScanInTimeErrorLabel):new Error(this.credsNotValidatedErrorLabel);this.result=t,this.gatacaLoginFailed.emit(a),this.errorCallback(a)}}))}async stop(){this.clean(),(this.result===s.ONGOING||s.READ)&&(this.result=s.NOT_STARTED)}clean(){this.sessionData=void 0,this.sessionId=void 0}renderModal(){return this.qr}async poll(){let t=(new Date).getTime()+1e3*(this.sessionTimeout||300),i=1e3*(this.pollingFrequency||3),a=this,e=async function(o,n){let{result:r,data:h}=await(async t=>{if(t.result===s.NOT_STARTED)return{result:s.NOT_STARTED};let i=await t.getSessionId();return t.checkStatus(i)})(a);switch(r){case s.SUCCESS:o(h);break;case s.READ:a.result=s.READ;case s.ONGOING:a.sessionTimeout>0&&(new Date).getTime()<t?setTimeout(e,i,o,n):n(s.EXPIRED);break;default:n(r)}};return new Promise(e)}isAppInstalled(t,i){let a,s=!1;(null==t?void 0:t.length)&&(window.location.href=t),a=setTimeout((()=>{s||i(!1),o()}),1e3*this.checkAppTimeout);const e=()=>{document.hidden&&(s=!0,i(!0),this.autostart||this.startMobilePolling(),o())};function o(){clearTimeout(a),document.removeEventListener("visibilitychange",e)}document.addEventListener("visibilitychange",e)}renderDesktopButton(){return a("div",{class:"gatacaButtonWrapper"},a("button",{class:"gatacaButton",onClick:()=>{this.open=!this.open,setTimeout((()=>{var t,i;this.open?null===(t=this.qrElement)||void 0===t||t.display():null===(i=this.qrElement)||void 0===i||i.stop()}),0)}},a("img",{src:e,class:"buttonImg",alt:this.buttonText}),a("span",null,this.buttonText)))}async getAuthRequest(){let{authenticationRequest:t}=await this.createSession();return t}renderMobileButton(t,i){this.autostart&&this.startMobilePolling();let s=!1;const o=t=>{s=t,this.handleCheckAppLoading&&this.handleCheckAppLoading(t)},n=async()=>{o(!0);try{const a=await this.getAuthRequest();this.isAppInstalled(a,(a=>{a||(this.stop(),t?window.location.href="https://play.google.com/store/apps/details?id=com.gataca.identity":i&&(window.location.href="https://apps.apple.com/us/app/gataca/id1498607616")),o(!1)}))}catch(t){this.stop(),o(!1)}};return a("div",{class:"gatacaButtonWrapper"},a("button",{class:"gatacaButton",onClick:()=>{n()},disabled:s},a("img",{src:e,class:"buttonImg",alt:this.buttonText}),a("span",null,this.buttonText)))}render(){const t=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||(null===navigator||void 0===navigator?void 0:navigator.vendor)||(null===window||void 0===window?void 0:window.opera),i=/android/i.test(t),s=/iPad|iPhone|iPod/.test(t)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,e=i||s;return a("div",{class:"buttonContainer"},e&&"3"===this.v?this.renderMobileButton(i,s):this.renderDesktopButton(),this.open&&(!e||"3"===this.v)&&this.renderModal())}};o.style='@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}';const n=class{constructor(s){t(this,s),this.gatacaLoginCompleted=i(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=i(this,"gatacaLoginFailed",7),this.buttonText="Easy login",this.successCallback=void 0,this.errorCallback=void 0,this.qrType="svg",this.qrRole=void 0,this.callbackServer=void 0,this.socketEndpoint=void 0,this.sessionTimeout=void 0,this.wsOnOpen=void 0,this.wsOnMessage=void 0,this.autostart=!0,this.autorefresh=!1,this.v="3",this.qrModalTitle="Quick Access",this.qrModalDescription="Sign up or sign in by scanning the QR Code with the Gataca Wallet",this.hideBrandTitle=!1,this.dynamicLink=!0,this.open=!1,this.qr=a("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:!0,autorefresh:this.autorefresh,v:this.v,qrModalTitle:this.qrModalTitle,qrModalDescription:this.qrModalDescription,hideBrandTitle:this.hideBrandTitle,dynamicLink:this.dynamicLink})}async getSessionData(){return this.qr.getSessionData()}renderModal(){return this.qr}renderButton(){return a("div",{class:"gatacaButtonWrapper"},a("button",{class:"gatacaButton",onClick:()=>{this.open=!this.open,this.open?this.qr.display():this.qr.stop()}},a("img",{src:"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=",class:"buttonImg",alt:this.buttonText}),a("span",null,this.buttonText)))}render(){return a("div",{class:"buttonContainer"},this.renderButton(),this.open&&this.renderModal())}};n.style='@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}';export{o as gataca_ssibutton,n as gataca_ssibuttonws}
File without changes