gbc-kyc-kit 1.4.2 → 1.5.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/README.md +14 -8
- package/dist/gbc-kyc-kit.es.js +128 -42
- package/dist/gbc-kyc-kit.umd.js +55 -55
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -96,14 +96,15 @@ async function getAccessToken() {
|
|
|
96
96
|
If you use this components with TypeScript, you should create a customType.d.ts into src folder with:
|
|
97
97
|
`declare module 'gbc-kyc-kit'`
|
|
98
98
|
|
|
99
|
-
| Props
|
|
100
|
-
|
|
|
101
|
-
| inProduction
|
|
102
|
-
| mode
|
|
103
|
-
| clientId
|
|
104
|
-
| authorize
|
|
105
|
-
| dual
|
|
106
|
-
| picBase64
|
|
99
|
+
| Props | Type | Values | Description |
|
|
100
|
+
| ------------------ | --------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| inProduction | string | prd, stg, dev | Isn't required, the default value is "prd". You should use "dev" to test integration and then pass to "stg". This env return real data, finally you can delete this prop or change to "prd" |
|
|
102
|
+
| mode | string | dark, light | Isn't required, the default value is "light". |
|
|
103
|
+
| clientId | string | Global Bridge Connections send you for email | This value is unique for each client and will be sent for email. |
|
|
104
|
+
| authorize | promise | () => Promise() | This Function verify clientId vs TOKEN and return accessToken. |
|
|
105
|
+
| dual | boolean | false | Isn't required and the default value is false. Just would used to enable dual upload of ID Document in Document Reader component (Two sides) |
|
|
106
|
+
| picBase64 | string | | Is required. It would be used to compare the selfie image with this picture |
|
|
107
|
+
| countryCodeAllowed | array of string | | Isn't required. If exist this props, the component will validate the client geolocation vs the code country thay is used as country allowed. You can use several countries but remember to use the country code aording to the ISO |
|
|
107
108
|
|
|
108
109
|
## Document Reader Component
|
|
109
110
|
|
|
@@ -117,6 +118,7 @@ Props Available:
|
|
|
117
118
|
- dual: bool default is false
|
|
118
119
|
- inProduction: string default is prd
|
|
119
120
|
- dataDocument: function to get response
|
|
121
|
+
- countryCodeAllowed: array of string
|
|
120
122
|
|
|
121
123
|
```js
|
|
122
124
|
const getDataDocument = async (info) => {
|
|
@@ -144,6 +146,7 @@ Props Available:
|
|
|
144
146
|
|
|
145
147
|
- mode: string 'dark' || 'light' default is 'light'
|
|
146
148
|
- inProduction: string default is prd
|
|
149
|
+
- countryCodeAllowed: array of string
|
|
147
150
|
|
|
148
151
|
```js
|
|
149
152
|
const listener = (event) => {
|
|
@@ -180,6 +183,7 @@ Props Available:
|
|
|
180
183
|
|
|
181
184
|
- mode: string 'dark' || 'light' default is 'light'
|
|
182
185
|
- inProduction: string default is prd
|
|
186
|
+
- countryCodeAllowed: array of string
|
|
183
187
|
|
|
184
188
|
```js
|
|
185
189
|
<BlackList
|
|
@@ -202,6 +206,7 @@ Props Available:
|
|
|
202
206
|
- inProduction: string default is prd
|
|
203
207
|
- picBase64: string img to compare with selfie in base64 format
|
|
204
208
|
- dataFaceMatch: function to get response
|
|
209
|
+
- countryCodeAllowed: array of string
|
|
205
210
|
|
|
206
211
|
```js
|
|
207
212
|
const getDataFaceMatch = async (info) => {
|
|
@@ -218,5 +223,6 @@ const picbase64 = " ...This is the base64 image to be compared with the selfie.
|
|
|
218
223
|
authorize={getAccessToken}
|
|
219
224
|
inProduction="prd"
|
|
220
225
|
picBase64={picbase64}
|
|
226
|
+
countryCodeAllowed={["PY"]}
|
|
221
227
|
/>;
|
|
222
228
|
```
|
package/dist/gbc-kyc-kit.es.js
CHANGED
|
@@ -18781,13 +18781,31 @@ function isEmpty$2(val) {
|
|
|
18781
18781
|
return false;
|
|
18782
18782
|
}
|
|
18783
18783
|
var lib$1 = isEmpty$2;
|
|
18784
|
-
|
|
18784
|
+
function useGeolocation() {
|
|
18785
|
+
const [geolocation, setGeolocation] = useState(null);
|
|
18786
|
+
useEffect(() => {
|
|
18787
|
+
fetch("https://ipapi.co/json").then((res) => res.json()).then((res) => setGeolocation(res)).catch((error) => console.log(error));
|
|
18788
|
+
}, []);
|
|
18789
|
+
return geolocation;
|
|
18790
|
+
}
|
|
18791
|
+
const BlackListController = (clientId, authorize, inProduction, countryCodeAllowed) => {
|
|
18785
18792
|
const [isLoading, setIsLoading] = useState(false);
|
|
18786
18793
|
const [status, setStatus] = useState(clientId === void 0 ? "CLIENTID" : authorize === void 0 ? "TOKEN" : "");
|
|
18787
18794
|
const [message, setMessage] = useState("");
|
|
18788
18795
|
const [listMatch, setListMatch] = useState([]);
|
|
18789
18796
|
const [select, setSelect] = useState("");
|
|
18790
18797
|
const [dataReq, setDataReq] = useState({});
|
|
18798
|
+
const [countryCode, setCountryCode] = useState(null);
|
|
18799
|
+
const geolocation = useGeolocation();
|
|
18800
|
+
useEffect(() => {
|
|
18801
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
18802
|
+
if (countryCodeAllowed && geolocation) {
|
|
18803
|
+
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
18804
|
+
setStatus("COUNTRY_NOT_ALLOWED");
|
|
18805
|
+
setMessage("Pa\xEDs no autorizado");
|
|
18806
|
+
}
|
|
18807
|
+
}
|
|
18808
|
+
}, [geolocation, countryCodeAllowed]);
|
|
18791
18809
|
const clearState = () => {
|
|
18792
18810
|
reset();
|
|
18793
18811
|
complementarySearch();
|
|
@@ -18797,6 +18815,7 @@ const BlackListController = (clientId, authorize, inProduction) => {
|
|
|
18797
18815
|
setMessage("");
|
|
18798
18816
|
setListMatch([]);
|
|
18799
18817
|
setSelect("");
|
|
18818
|
+
setIsLoading(false);
|
|
18800
18819
|
};
|
|
18801
18820
|
const schema = create({
|
|
18802
18821
|
fname: create$1().required("Este campo es requerido."),
|
|
@@ -18894,7 +18913,8 @@ const BlackListController = (clientId, authorize, inProduction) => {
|
|
|
18894
18913
|
setSelect,
|
|
18895
18914
|
clearState,
|
|
18896
18915
|
complementarySearch,
|
|
18897
|
-
dataReq
|
|
18916
|
+
dataReq,
|
|
18917
|
+
countryCode
|
|
18898
18918
|
};
|
|
18899
18919
|
};
|
|
18900
18920
|
var jsxRuntime = { exports: {} };
|
|
@@ -20108,7 +20128,7 @@ function StatusComponent({
|
|
|
20108
20128
|
clearState,
|
|
20109
20129
|
dataReq
|
|
20110
20130
|
}) {
|
|
20111
|
-
const arrWarning = ["TOKEN", "CLIENTID", "MATCH", "NOT_VERIFY", "0", 400, 404, 0, 429, 500];
|
|
20131
|
+
const arrWarning = ["TOKEN", "CLIENTID", "MATCH", "NOT_VERIFY", "COUNTRY_NOT_ALLOWED", "0", 400, 404, 0, 429, 500];
|
|
20112
20132
|
const arrSuccess = ["ACCEPT", "Success", "FACER_OK"];
|
|
20113
20133
|
const [report, setReport] = useState({});
|
|
20114
20134
|
const handleReport = (list) => {
|
|
@@ -20148,15 +20168,17 @@ function StatusComponent({
|
|
|
20148
20168
|
}) : null, !lib$1(lists) && /* @__PURE__ */ jsx(ListsAccordion, {
|
|
20149
20169
|
lists,
|
|
20150
20170
|
handleReport
|
|
20151
|
-
}), /* @__PURE__ */
|
|
20152
|
-
|
|
20153
|
-
|
|
20154
|
-
|
|
20155
|
-
|
|
20156
|
-
|
|
20157
|
-
|
|
20158
|
-
|
|
20159
|
-
|
|
20171
|
+
}), status !== "COUNTRY_NOT_ALLOWED" ? /* @__PURE__ */ jsxs(Fragment, {
|
|
20172
|
+
children: [/* @__PURE__ */ jsx(CustomButton, {
|
|
20173
|
+
className: "my-2 col-6 warning-button",
|
|
20174
|
+
onClick: () => clearState(),
|
|
20175
|
+
children: "Verificar nuevamente"
|
|
20176
|
+
}), complementarySearch && /* @__PURE__ */ jsx(CustomButton, {
|
|
20177
|
+
className: "my-2 col-6",
|
|
20178
|
+
onClick: complementarySearch,
|
|
20179
|
+
children: "Ampliar criterios de consulta"
|
|
20180
|
+
})]
|
|
20181
|
+
}) : null]
|
|
20160
20182
|
})
|
|
20161
20183
|
});
|
|
20162
20184
|
}
|
|
@@ -20167,7 +20189,7 @@ function BlackList({
|
|
|
20167
20189
|
clientId,
|
|
20168
20190
|
authorize,
|
|
20169
20191
|
inProduction,
|
|
20170
|
-
|
|
20192
|
+
countryCodeAllowed
|
|
20171
20193
|
}) {
|
|
20172
20194
|
const {
|
|
20173
20195
|
onSendSubmitDocument,
|
|
@@ -20182,8 +20204,10 @@ function BlackList({
|
|
|
20182
20204
|
setSelect,
|
|
20183
20205
|
clearState,
|
|
20184
20206
|
complementarySearch,
|
|
20185
|
-
dataReq
|
|
20186
|
-
|
|
20207
|
+
dataReq,
|
|
20208
|
+
countryCode
|
|
20209
|
+
} = BlackListController(clientId, authorize, inProduction, countryCodeAllowed);
|
|
20210
|
+
useGeolocation();
|
|
20187
20211
|
return /* @__PURE__ */ jsxs("div", {
|
|
20188
20212
|
className: `kit-gbc ${mode}`,
|
|
20189
20213
|
children: [/* @__PURE__ */ jsx(k$1, {
|
|
@@ -20196,7 +20220,7 @@ function BlackList({
|
|
|
20196
20220
|
pauseOnFocusLoss: true,
|
|
20197
20221
|
draggable: true,
|
|
20198
20222
|
pauseOnHover: true
|
|
20199
|
-
}), isLoading && /* @__PURE__ */ jsx(BackDropLoader, {}), /* @__PURE__ */ jsx("form", {
|
|
20223
|
+
}), isLoading || countryCodeAllowed !== null && !countryCode ? /* @__PURE__ */ jsx(BackDropLoader, {}) : null, /* @__PURE__ */ jsx("form", {
|
|
20200
20224
|
onSubmit: simpleHandleSubmit(onSendSubmitDocument),
|
|
20201
20225
|
id: "blacklist",
|
|
20202
20226
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -20275,7 +20299,8 @@ function BlackList({
|
|
|
20275
20299
|
BlackList.defaultProps = {
|
|
20276
20300
|
mode: "light",
|
|
20277
20301
|
loader: false,
|
|
20278
|
-
inProduction: "prd"
|
|
20302
|
+
inProduction: "prd",
|
|
20303
|
+
countryCodeAllowed: null
|
|
20279
20304
|
};
|
|
20280
20305
|
BlackList.propTypes = {
|
|
20281
20306
|
mode: propTypes.exports.PropTypes.string,
|
|
@@ -20283,18 +20308,32 @@ BlackList.propTypes = {
|
|
|
20283
20308
|
icon: propTypes.exports.PropTypes.func,
|
|
20284
20309
|
clientId: propTypes.exports.PropTypes.string.isRequired,
|
|
20285
20310
|
authorize: propTypes.exports.PropTypes.func.isRequired,
|
|
20286
|
-
inProduction: propTypes.exports.PropTypes.string
|
|
20311
|
+
inProduction: propTypes.exports.PropTypes.string,
|
|
20312
|
+
countryCodeAllowed: propTypes.exports.PropTypes.array
|
|
20287
20313
|
};
|
|
20288
|
-
const DocumentReaderController = (dataDocument, clientId, authorize, inProduction) => {
|
|
20314
|
+
const DocumentReaderController = (dataDocument, clientId, authorize, inProduction, countryCodeAllowed) => {
|
|
20289
20315
|
const [docImage, setDocImage] = useState({});
|
|
20290
20316
|
const [base64, setBase64] = useState({});
|
|
20291
20317
|
const [message, setMessage] = useState("");
|
|
20292
20318
|
const [isLoading, setIsLoading] = useState(false);
|
|
20293
20319
|
const [status, setStatus] = useState(clientId === void 0 ? "CLIENTID" : authorize === void 0 ? "TOKEN" : "");
|
|
20320
|
+
const [countryCode, setCountryCode] = useState(null);
|
|
20321
|
+
const geolocation = useGeolocation();
|
|
20322
|
+
useEffect(() => {
|
|
20323
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
20324
|
+
if (countryCodeAllowed && geolocation) {
|
|
20325
|
+
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
20326
|
+
setStatus("COUNTRY_NOT_ALLOWED");
|
|
20327
|
+
setMessage("Pa\xEDs no autorizado");
|
|
20328
|
+
}
|
|
20329
|
+
}
|
|
20330
|
+
}, [geolocation, countryCodeAllowed]);
|
|
20294
20331
|
const clearState = () => {
|
|
20295
20332
|
setDocImage({});
|
|
20296
20333
|
setBase64({});
|
|
20297
20334
|
setStatus("");
|
|
20335
|
+
setMessage("");
|
|
20336
|
+
setIsLoading(false);
|
|
20298
20337
|
};
|
|
20299
20338
|
const {
|
|
20300
20339
|
handleSubmit: simpleHandleSubmit
|
|
@@ -20380,7 +20419,8 @@ const DocumentReaderController = (dataDocument, clientId, authorize, inProductio
|
|
|
20380
20419
|
status,
|
|
20381
20420
|
message,
|
|
20382
20421
|
base64,
|
|
20383
|
-
clearState
|
|
20422
|
+
clearState,
|
|
20423
|
+
countryCode
|
|
20384
20424
|
};
|
|
20385
20425
|
};
|
|
20386
20426
|
const UploadIcon = () => {
|
|
@@ -20415,7 +20455,8 @@ function DocumentReader({
|
|
|
20415
20455
|
clientId,
|
|
20416
20456
|
authorize,
|
|
20417
20457
|
inProduction,
|
|
20418
|
-
dual
|
|
20458
|
+
dual,
|
|
20459
|
+
countryCodeAllowed
|
|
20419
20460
|
}) {
|
|
20420
20461
|
const {
|
|
20421
20462
|
onSendSubmitDocument,
|
|
@@ -20426,8 +20467,9 @@ function DocumentReader({
|
|
|
20426
20467
|
status,
|
|
20427
20468
|
message,
|
|
20428
20469
|
clearState,
|
|
20429
|
-
base64
|
|
20430
|
-
|
|
20470
|
+
base64,
|
|
20471
|
+
countryCode
|
|
20472
|
+
} = DocumentReaderController(dataDocument, clientId, authorize, inProduction, countryCodeAllowed);
|
|
20431
20473
|
return /* @__PURE__ */ jsxs("div", {
|
|
20432
20474
|
className: `kit-gbc ${mode}`,
|
|
20433
20475
|
children: [/* @__PURE__ */ jsx(k$1, {
|
|
@@ -20440,7 +20482,7 @@ function DocumentReader({
|
|
|
20440
20482
|
pauseOnFocusLoss: true,
|
|
20441
20483
|
draggable: true,
|
|
20442
20484
|
pauseOnHover: true
|
|
20443
|
-
}), isLoading && /* @__PURE__ */ jsx(BackDropLoader, {}), /* @__PURE__ */ jsx("form", {
|
|
20485
|
+
}), isLoading || countryCodeAllowed !== null && !countryCode ? /* @__PURE__ */ jsx(BackDropLoader, {}) : null, /* @__PURE__ */ jsx("form", {
|
|
20444
20486
|
onSubmit: simpleHandleSubmit(onSendSubmitDocument),
|
|
20445
20487
|
children: /* @__PURE__ */ jsxs("div", {
|
|
20446
20488
|
className: "sub",
|
|
@@ -20527,7 +20569,8 @@ DocumentReader.defaultProps = {
|
|
|
20527
20569
|
mode: "light",
|
|
20528
20570
|
loader: false,
|
|
20529
20571
|
inProduction: "prd",
|
|
20530
|
-
dual: false
|
|
20572
|
+
dual: false,
|
|
20573
|
+
countryCodeAllowed: null
|
|
20531
20574
|
};
|
|
20532
20575
|
DocumentReader.propTypes = {
|
|
20533
20576
|
mode: propTypes.exports.PropTypes.string,
|
|
@@ -20537,9 +20580,10 @@ DocumentReader.propTypes = {
|
|
|
20537
20580
|
authorize: propTypes.exports.PropTypes.func.isRequired,
|
|
20538
20581
|
dataDocument: propTypes.exports.PropTypes.func.isRequired,
|
|
20539
20582
|
inProduction: propTypes.exports.PropTypes.string,
|
|
20540
|
-
dual: propTypes.exports.PropTypes.bool
|
|
20583
|
+
dual: propTypes.exports.PropTypes.bool,
|
|
20584
|
+
countryCodeAllowed: propTypes.exports.PropTypes.array
|
|
20541
20585
|
};
|
|
20542
|
-
const FaceMatchController = (dataFaceMatch, clientId, authorize, inProduction, picBase64, setTakePic) => {
|
|
20586
|
+
const FaceMatchController = (dataFaceMatch, clientId, authorize, inProduction, picBase64, setTakePic, countryCodeAllowed) => {
|
|
20543
20587
|
const [docImage, setDocImage] = useState({});
|
|
20544
20588
|
const [image, setImage] = useState("");
|
|
20545
20589
|
const [message, setMessage] = useState("");
|
|
@@ -20547,6 +20591,8 @@ const FaceMatchController = (dataFaceMatch, clientId, authorize, inProduction, p
|
|
|
20547
20591
|
const [status, setStatus] = useState(clientId === void 0 ? "CLIENTID" : authorize === void 0 ? "TOKEN" : "");
|
|
20548
20592
|
const webcamRef = useRef(null);
|
|
20549
20593
|
const [url, setUrl] = useState(null);
|
|
20594
|
+
const [countryCode, setCountryCode] = useState(null);
|
|
20595
|
+
const geolocation = useGeolocation();
|
|
20550
20596
|
const capturePhoto = useCallback(async () => {
|
|
20551
20597
|
const imageSrc = webcamRef.current.getScreenshot({
|
|
20552
20598
|
width: 480,
|
|
@@ -20556,12 +20602,23 @@ const FaceMatchController = (dataFaceMatch, clientId, authorize, inProduction, p
|
|
|
20556
20602
|
});
|
|
20557
20603
|
setUrl(imageSrc);
|
|
20558
20604
|
}, [webcamRef]);
|
|
20605
|
+
useEffect(() => {
|
|
20606
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
20607
|
+
if (countryCodeAllowed && geolocation) {
|
|
20608
|
+
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
20609
|
+
setStatus("COUNTRY_NOT_ALLOWED");
|
|
20610
|
+
setMessage("Pa\xEDs no autorizado");
|
|
20611
|
+
}
|
|
20612
|
+
}
|
|
20613
|
+
}, [geolocation, countryCodeAllowed]);
|
|
20559
20614
|
const clearState = () => {
|
|
20560
20615
|
setDocImage({});
|
|
20561
20616
|
setImage("");
|
|
20562
20617
|
setStatus("");
|
|
20618
|
+
setMessage("");
|
|
20563
20619
|
setUrl(null);
|
|
20564
20620
|
setTakePic(false);
|
|
20621
|
+
setIsLoading(false);
|
|
20565
20622
|
};
|
|
20566
20623
|
const {
|
|
20567
20624
|
handleSubmit: simpleHandleSubmit
|
|
@@ -20625,7 +20682,8 @@ const FaceMatchController = (dataFaceMatch, clientId, authorize, inProduction, p
|
|
|
20625
20682
|
webcamRef,
|
|
20626
20683
|
url,
|
|
20627
20684
|
setUrl,
|
|
20628
|
-
capturePhoto
|
|
20685
|
+
capturePhoto,
|
|
20686
|
+
countryCode
|
|
20629
20687
|
};
|
|
20630
20688
|
};
|
|
20631
20689
|
var dummyImage = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw0NDQ0NDQ0ICA0IDQ0NDQ0NDQ8IDQ0NFREWFhURExMYHSggGBolGxMTITEhJSkrLi4uFx8zODMsNygtLisBCgoKDQ0NDg0PDy0ZFRk3KzctKysrKy03LTctKzcrKystKystKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAPYAzQMBIgACEQEDEQH/xAAZAAEBAQEBAQAAAAAAAAAAAAAAAQMEAgf/xAAqEAEBAAECBQQCAgIDAAAAAAAAAQIDERIhQWFxBDFRgZGhYrEi8BMUQv/EABcBAQEBAQAAAAAAAAAAAAAAAAABAgP/xAAWEQEBAQAAAAAAAAAAAAAAAAAAARH/2gAMAwEAAhEDEQA/APqYDq5gAAAAAIAAioAAACAAgAACKgAABEWA1AAAAAABAAecspPeyAoxvqJ0lv6eL6i/GM/ZhrpHL/z5fx/C/wDYy/iuGugYT1HzPxWmOrjeu3nkmD2hQAAEAARUAIUgNgAAAAAQGHqNT/zOvuBq6/TH8ue37BpAAQQAAAe8NSzvPh045SzeON608+G/2liutDf9iKAAgAIsRQbAAAAIAJldpb8OG3e7/Lq9Tf8AHzXKsSgCoAgAAAAAAN/T5ctvhq5dG7ZTvydSVqCAgIqAKhAbgAAAgAOf1XT7YNvVe88Vi1EoAIIUAAAAAQAXG855jscUdiVYAiKAAECA3AAQoAioDn9V0+2Lf1PT7YNRKAggAAAACAAAs955dbkw955jrSrBARQEAWIQHQioAACAA49TLe2/7s8g0ygAAAAACFAAAHRpZbzxyc7f0/tfKVY0ARRFQAgQG4ACAAADj1MdsrHh16unxdrHLnjZyrURABAABKqAAAAAOnSm0882eGl1v4bJVgCIoAARCA6AQAAAEAYepntfpu86mO8s+QrjAaZAQAAAABcJvZPlGuhj1+hWwDKoAACAECA6EKCgAggAIqA59fDa79L/AGydmU3m3y5M8drtViIgKgAAACyb8vl04zabfDxo4bc771olagiogAAIUAIEBuAACAAgAADPWxll7c2jPWu2N/AOUBpkAAaaOMt59GbTQvPzBW4DKoAACAAAhAgOgABAAqDznnJ7366g9Fv058te9OX7rLK2++9XE105a2M7+GOrqcXaRmLhoAIAAEu3P4AG01p13n7e5lL7VzCYuuoc+OpZ38tMdWXsmK9gAIqAERYDoRUtAec85Pdlqa/TH8sLftcTWuetb7f4z9sgUEVBAAAAAAAABFQAEB6xzsa46svvy/pgGK6hz452d42xylZxVWIQVvnlJzrl1NS5dp8Jnlbd68rIzoAqAAIAAAAAAAAACAAIAAABL9ADbDU35X3/ALe45mmGp880salQBWQABAAAAAAAAAAQAAQAAAAAAAAGvBexwXsApwXsnBeygJwXscF7ABwXscPgAOG9k4b2UBOG9jhvYAOG9jhvYAOHwcN7ACcHg4PAAcN7HDewAcPg4fAJonD4OHwAHD4OHwoaP//Z";
|
|
@@ -24431,7 +24489,8 @@ function FaceMatch({
|
|
|
24431
24489
|
clientId,
|
|
24432
24490
|
authorize,
|
|
24433
24491
|
inProduction,
|
|
24434
|
-
picBase64
|
|
24492
|
+
picBase64,
|
|
24493
|
+
countryCodeAllowed
|
|
24435
24494
|
}) {
|
|
24436
24495
|
const [takePic, setTakePic] = useState(false);
|
|
24437
24496
|
const {
|
|
@@ -24445,8 +24504,9 @@ function FaceMatch({
|
|
|
24445
24504
|
capturePhoto,
|
|
24446
24505
|
webcamRef,
|
|
24447
24506
|
url,
|
|
24448
|
-
setUrl
|
|
24449
|
-
|
|
24507
|
+
setUrl,
|
|
24508
|
+
countryCode
|
|
24509
|
+
} = FaceMatchController(dataFaceMatch, clientId, authorize, inProduction, picBase64, setTakePic, countryCodeAllowed);
|
|
24450
24510
|
const onUserMedia = (e2) => {
|
|
24451
24511
|
console.log(e2, "userMedia");
|
|
24452
24512
|
};
|
|
@@ -24468,7 +24528,7 @@ function FaceMatch({
|
|
|
24468
24528
|
pauseOnFocusLoss: true,
|
|
24469
24529
|
draggable: true,
|
|
24470
24530
|
pauseOnHover: true
|
|
24471
|
-
}), isLoading && /* @__PURE__ */ jsx(BackDropLoader, {}), /* @__PURE__ */ jsx("form", {
|
|
24531
|
+
}), isLoading || countryCodeAllowed !== null && !countryCode ? /* @__PURE__ */ jsx(BackDropLoader, {}) : null, /* @__PURE__ */ jsx("form", {
|
|
24472
24532
|
onSubmit: simpleHandleSubmit(onSendSubmitSelfie),
|
|
24473
24533
|
children: /* @__PURE__ */ jsxs("div", {
|
|
24474
24534
|
className: "sub",
|
|
@@ -24567,7 +24627,8 @@ FaceMatch.defaultProps = {
|
|
|
24567
24627
|
mode: "light",
|
|
24568
24628
|
loader: false,
|
|
24569
24629
|
inProduction: "prd",
|
|
24570
|
-
picBase64: ""
|
|
24630
|
+
picBase64: "",
|
|
24631
|
+
countryCodeAllowed: null
|
|
24571
24632
|
};
|
|
24572
24633
|
FaceMatch.propTypes = {
|
|
24573
24634
|
mode: propTypes.exports.PropTypes.string,
|
|
@@ -24577,12 +24638,15 @@ FaceMatch.propTypes = {
|
|
|
24577
24638
|
authorize: propTypes.exports.PropTypes.func.isRequired,
|
|
24578
24639
|
dataFaceMatch: propTypes.exports.PropTypes.func.isRequired,
|
|
24579
24640
|
inProduction: propTypes.exports.PropTypes.string,
|
|
24580
|
-
picBase64: propTypes.exports.PropTypes.string.isRequired
|
|
24641
|
+
picBase64: propTypes.exports.PropTypes.string.isRequired,
|
|
24642
|
+
countryCodeAllowed: propTypes.exports.PropTypes.array
|
|
24581
24643
|
};
|
|
24582
|
-
const LivenessCheckController = (clientId, authorize, inProduction) => {
|
|
24644
|
+
const LivenessCheckController = (clientId, authorize, inProduction, countryCodeAllowed) => {
|
|
24583
24645
|
const [isLoading, setIsLoading] = useState(false);
|
|
24584
24646
|
const [status, setStatus] = useState(clientId === void 0 ? "CLIENTID" : authorize === void 0 ? "TOKEN" : "");
|
|
24585
24647
|
const [message, setMessage] = useState("");
|
|
24648
|
+
const [countryCode, setCountryCode] = useState(null);
|
|
24649
|
+
const geolocation = useGeolocation();
|
|
24586
24650
|
const listener = (event) => {
|
|
24587
24651
|
if (event.detail) {
|
|
24588
24652
|
if (event.detail.action === "PROCESS_FINISHED") {
|
|
@@ -24608,9 +24672,19 @@ const LivenessCheckController = (clientId, authorize, inProduction) => {
|
|
|
24608
24672
|
}
|
|
24609
24673
|
}
|
|
24610
24674
|
};
|
|
24675
|
+
useEffect(() => {
|
|
24676
|
+
countryCodeAllowed && geolocation && setCountryCode(geolocation == null ? void 0 : geolocation.country_code);
|
|
24677
|
+
if (countryCodeAllowed && geolocation) {
|
|
24678
|
+
if (!countryCodeAllowed.includes(geolocation == null ? void 0 : geolocation.country_code)) {
|
|
24679
|
+
setStatus("COUNTRY_NOT_ALLOWED");
|
|
24680
|
+
setMessage("Pa\xEDs no autorizado");
|
|
24681
|
+
}
|
|
24682
|
+
}
|
|
24683
|
+
}, [geolocation, countryCodeAllowed]);
|
|
24611
24684
|
const clearState = () => {
|
|
24612
24685
|
setStatus("");
|
|
24613
24686
|
setMessage("");
|
|
24687
|
+
setIsLoading(false);
|
|
24614
24688
|
};
|
|
24615
24689
|
const onSendSubmitLiveness = async (response) => {
|
|
24616
24690
|
setIsLoading(true);
|
|
@@ -24653,7 +24727,8 @@ const LivenessCheckController = (clientId, authorize, inProduction) => {
|
|
|
24653
24727
|
listener,
|
|
24654
24728
|
onSendSubmitLiveness,
|
|
24655
24729
|
clearState,
|
|
24656
|
-
message
|
|
24730
|
+
message,
|
|
24731
|
+
countryCode
|
|
24657
24732
|
};
|
|
24658
24733
|
};
|
|
24659
24734
|
var lib = {};
|
|
@@ -25798,7 +25873,8 @@ function LivenessCheck({
|
|
|
25798
25873
|
mode,
|
|
25799
25874
|
clientId,
|
|
25800
25875
|
authorize,
|
|
25801
|
-
inProduction
|
|
25876
|
+
inProduction,
|
|
25877
|
+
countryCodeAllowed
|
|
25802
25878
|
}) {
|
|
25803
25879
|
const {
|
|
25804
25880
|
status,
|
|
@@ -25806,8 +25882,9 @@ function LivenessCheck({
|
|
|
25806
25882
|
listener,
|
|
25807
25883
|
clearState,
|
|
25808
25884
|
onSendSubmitLiveness,
|
|
25809
|
-
message
|
|
25810
|
-
|
|
25885
|
+
message,
|
|
25886
|
+
countryCode
|
|
25887
|
+
} = LivenessCheckController(clientId, authorize, inProduction, countryCodeAllowed);
|
|
25811
25888
|
useEffect(() => {
|
|
25812
25889
|
const component = document.getElementsByTagName("face-liveness")[0];
|
|
25813
25890
|
if (component) {
|
|
@@ -25831,7 +25908,14 @@ function LivenessCheck({
|
|
|
25831
25908
|
pauseOnFocusLoss: true,
|
|
25832
25909
|
draggable: true,
|
|
25833
25910
|
pauseOnHover: true
|
|
25834
|
-
}), isLoading && /* @__PURE__ */ jsx(BackDropLoader, {}), /* @__PURE__ */ jsx("
|
|
25911
|
+
}), isLoading || countryCodeAllowed !== null && !countryCode ? /* @__PURE__ */ jsx(BackDropLoader, {}) : null, status === "COUNTRY_NOT_ALLOWED" ? /* @__PURE__ */ jsx("div", {
|
|
25912
|
+
className: "kit-gbc",
|
|
25913
|
+
children: /* @__PURE__ */ jsx(StatusComponent, {
|
|
25914
|
+
status,
|
|
25915
|
+
message,
|
|
25916
|
+
clearState
|
|
25917
|
+
})
|
|
25918
|
+
}) : /* @__PURE__ */ jsx("face-liveness", {
|
|
25835
25919
|
locale: "es",
|
|
25836
25920
|
class: "liveness",
|
|
25837
25921
|
url: "https://regula.globalbridgeconnections.com.py/face-sdk"
|
|
@@ -25841,13 +25925,15 @@ function LivenessCheck({
|
|
|
25841
25925
|
}
|
|
25842
25926
|
LivenessCheck.defaultProps = {
|
|
25843
25927
|
mode: "light",
|
|
25844
|
-
inProduction: "prd"
|
|
25928
|
+
inProduction: "prd",
|
|
25929
|
+
countryCodeAllowed: null
|
|
25845
25930
|
};
|
|
25846
25931
|
LivenessCheck.propTypes = {
|
|
25847
25932
|
mode: propTypes.exports.PropTypes.string,
|
|
25848
25933
|
clientId: propTypes.exports.PropTypes.string.isRequired,
|
|
25849
25934
|
authorize: propTypes.exports.PropTypes.func.isRequired,
|
|
25850
|
-
inProduction: propTypes.exports.PropTypes.string
|
|
25935
|
+
inProduction: propTypes.exports.PropTypes.string,
|
|
25936
|
+
countryCodeAllowed: propTypes.exports.PropTypes.array
|
|
25851
25937
|
};
|
|
25852
25938
|
var bootstrap_min = "";
|
|
25853
25939
|
var bootstrap_bundle_min = { exports: {} };
|