@seontechnologies/seon-id-verification
Version:
An advanced SDK featuring web components for natural person identification through document scanning, facial recognition, hand gesture, and face turning detection, designed for secure and efficient user verification.
798 lines (797 loc) • 26.6 kB
JavaScript
import { j as h, L as rt, a as j, S as at, l as S } from "./index-oGnhSncZ.mjs";
import { P as nt } from "./PreviousButton-C1ta7IKB.mjs";
import { p as G } from "./index-BksfbZT3.mjs";
import * as H from "react";
import K, { useState as it, useCallback as ot, useEffect as st } from "react";
import { S as lt } from "./SessionDetails-D7H83xOl.mjs";
var O = {}, F = {
L: 1,
M: 0,
Q: 3,
H: 2
}, X = {
MODE_NUMBER: 1,
MODE_ALPHA_NUM: 2,
MODE_8BIT_BYTE: 4,
MODE_KANJI: 8
}, ut = X;
function U(t) {
this.mode = ut.MODE_8BIT_BYTE, this.data = t;
}
U.prototype = {
getLength: function(t) {
return this.data.length;
},
write: function(t) {
for (var e = 0; e < this.data.length; e++)
t.put(this.data.charCodeAt(e), 8);
}
};
var ft = U, M = F;
function w(t, e) {
this.totalCount = t, this.dataCount = e;
}
w.RS_BLOCK_TABLE = [
// L
// M
// Q
// H
// 1
[1, 26, 19],
[1, 26, 16],
[1, 26, 13],
[1, 26, 9],
// 2
[1, 44, 34],
[1, 44, 28],
[1, 44, 22],
[1, 44, 16],
// 3
[1, 70, 55],
[1, 70, 44],
[2, 35, 17],
[2, 35, 13],
// 4
[1, 100, 80],
[2, 50, 32],
[2, 50, 24],
[4, 25, 9],
// 5
[1, 134, 108],
[2, 67, 43],
[2, 33, 15, 2, 34, 16],
[2, 33, 11, 2, 34, 12],
// 6
[2, 86, 68],
[4, 43, 27],
[4, 43, 19],
[4, 43, 15],
// 7
[2, 98, 78],
[4, 49, 31],
[2, 32, 14, 4, 33, 15],
[4, 39, 13, 1, 40, 14],
// 8
[2, 121, 97],
[2, 60, 38, 2, 61, 39],
[4, 40, 18, 2, 41, 19],
[4, 40, 14, 2, 41, 15],
// 9
[2, 146, 116],
[3, 58, 36, 2, 59, 37],
[4, 36, 16, 4, 37, 17],
[4, 36, 12, 4, 37, 13],
// 10
[2, 86, 68, 2, 87, 69],
[4, 69, 43, 1, 70, 44],
[6, 43, 19, 2, 44, 20],
[6, 43, 15, 2, 44, 16],
// 11
[4, 101, 81],
[1, 80, 50, 4, 81, 51],
[4, 50, 22, 4, 51, 23],
[3, 36, 12, 8, 37, 13],
// 12
[2, 116, 92, 2, 117, 93],
[6, 58, 36, 2, 59, 37],
[4, 46, 20, 6, 47, 21],
[7, 42, 14, 4, 43, 15],
// 13
[4, 133, 107],
[8, 59, 37, 1, 60, 38],
[8, 44, 20, 4, 45, 21],
[12, 33, 11, 4, 34, 12],
// 14
[3, 145, 115, 1, 146, 116],
[4, 64, 40, 5, 65, 41],
[11, 36, 16, 5, 37, 17],
[11, 36, 12, 5, 37, 13],
// 15
[5, 109, 87, 1, 110, 88],
[5, 65, 41, 5, 66, 42],
[5, 54, 24, 7, 55, 25],
[11, 36, 12],
// 16
[5, 122, 98, 1, 123, 99],
[7, 73, 45, 3, 74, 46],
[15, 43, 19, 2, 44, 20],
[3, 45, 15, 13, 46, 16],
// 17
[1, 135, 107, 5, 136, 108],
[10, 74, 46, 1, 75, 47],
[1, 50, 22, 15, 51, 23],
[2, 42, 14, 17, 43, 15],
// 18
[5, 150, 120, 1, 151, 121],
[9, 69, 43, 4, 70, 44],
[17, 50, 22, 1, 51, 23],
[2, 42, 14, 19, 43, 15],
// 19
[3, 141, 113, 4, 142, 114],
[3, 70, 44, 11, 71, 45],
[17, 47, 21, 4, 48, 22],
[9, 39, 13, 16, 40, 14],
// 20
[3, 135, 107, 5, 136, 108],
[3, 67, 41, 13, 68, 42],
[15, 54, 24, 5, 55, 25],
[15, 43, 15, 10, 44, 16],
// 21
[4, 144, 116, 4, 145, 117],
[17, 68, 42],
[17, 50, 22, 6, 51, 23],
[19, 46, 16, 6, 47, 17],
// 22
[2, 139, 111, 7, 140, 112],
[17, 74, 46],
[7, 54, 24, 16, 55, 25],
[34, 37, 13],
// 23
[4, 151, 121, 5, 152, 122],
[4, 75, 47, 14, 76, 48],
[11, 54, 24, 14, 55, 25],
[16, 45, 15, 14, 46, 16],
// 24
[6, 147, 117, 4, 148, 118],
[6, 73, 45, 14, 74, 46],
[11, 54, 24, 16, 55, 25],
[30, 46, 16, 2, 47, 17],
// 25
[8, 132, 106, 4, 133, 107],
[8, 75, 47, 13, 76, 48],
[7, 54, 24, 22, 55, 25],
[22, 45, 15, 13, 46, 16],
// 26
[10, 142, 114, 2, 143, 115],
[19, 74, 46, 4, 75, 47],
[28, 50, 22, 6, 51, 23],
[33, 46, 16, 4, 47, 17],
// 27
[8, 152, 122, 4, 153, 123],
[22, 73, 45, 3, 74, 46],
[8, 53, 23, 26, 54, 24],
[12, 45, 15, 28, 46, 16],
// 28
[3, 147, 117, 10, 148, 118],
[3, 73, 45, 23, 74, 46],
[4, 54, 24, 31, 55, 25],
[11, 45, 15, 31, 46, 16],
// 29
[7, 146, 116, 7, 147, 117],
[21, 73, 45, 7, 74, 46],
[1, 53, 23, 37, 54, 24],
[19, 45, 15, 26, 46, 16],
// 30
[5, 145, 115, 10, 146, 116],
[19, 75, 47, 10, 76, 48],
[15, 54, 24, 25, 55, 25],
[23, 45, 15, 25, 46, 16],
// 31
[13, 145, 115, 3, 146, 116],
[2, 74, 46, 29, 75, 47],
[42, 54, 24, 1, 55, 25],
[23, 45, 15, 28, 46, 16],
// 32
[17, 145, 115],
[10, 74, 46, 23, 75, 47],
[10, 54, 24, 35, 55, 25],
[19, 45, 15, 35, 46, 16],
// 33
[17, 145, 115, 1, 146, 116],
[14, 74, 46, 21, 75, 47],
[29, 54, 24, 19, 55, 25],
[11, 45, 15, 46, 46, 16],
// 34
[13, 145, 115, 6, 146, 116],
[14, 74, 46, 23, 75, 47],
[44, 54, 24, 7, 55, 25],
[59, 46, 16, 1, 47, 17],
// 35
[12, 151, 121, 7, 152, 122],
[12, 75, 47, 26, 76, 48],
[39, 54, 24, 14, 55, 25],
[22, 45, 15, 41, 46, 16],
// 36
[6, 151, 121, 14, 152, 122],
[6, 75, 47, 34, 76, 48],
[46, 54, 24, 10, 55, 25],
[2, 45, 15, 64, 46, 16],
// 37
[17, 152, 122, 4, 153, 123],
[29, 74, 46, 14, 75, 47],
[49, 54, 24, 10, 55, 25],
[24, 45, 15, 46, 46, 16],
// 38
[4, 152, 122, 18, 153, 123],
[13, 74, 46, 32, 75, 47],
[48, 54, 24, 14, 55, 25],
[42, 45, 15, 32, 46, 16],
// 39
[20, 147, 117, 4, 148, 118],
[40, 75, 47, 7, 76, 48],
[43, 54, 24, 22, 55, 25],
[10, 45, 15, 67, 46, 16],
// 40
[19, 148, 118, 6, 149, 119],
[18, 75, 47, 31, 76, 48],
[34, 54, 24, 34, 55, 25],
[20, 45, 15, 61, 46, 16]
];
w.getRSBlocks = function(t, e) {
var a = w.getRsBlockTable(t, e);
if (a == null)
throw new Error("bad rs block @ typeNumber:" + t + "/errorCorrectLevel:" + e);
for (var r = a.length / 3, n = new Array(), i = 0; i < r; i++)
for (var s = a[i * 3 + 0], o = a[i * 3 + 1], u = a[i * 3 + 2], f = 0; f < s; f++)
n.push(new w(o, u));
return n;
};
w.getRsBlockTable = function(t, e) {
switch (e) {
case M.L:
return w.RS_BLOCK_TABLE[(t - 1) * 4 + 0];
case M.M:
return w.RS_BLOCK_TABLE[(t - 1) * 4 + 1];
case M.Q:
return w.RS_BLOCK_TABLE[(t - 1) * 4 + 2];
case M.H:
return w.RS_BLOCK_TABLE[(t - 1) * 4 + 3];
default:
return;
}
};
var ht = w;
function Y() {
this.buffer = new Array(), this.length = 0;
}
Y.prototype = {
get: function(t) {
var e = Math.floor(t / 8);
return (this.buffer[e] >>> 7 - t % 8 & 1) == 1;
},
put: function(t, e) {
for (var a = 0; a < e; a++)
this.putBit((t >>> e - a - 1 & 1) == 1);
},
getLengthInBits: function() {
return this.length;
},
putBit: function(t) {
var e = Math.floor(this.length / 8);
this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++;
}
};
var vt = Y, m = {
glog: function(t) {
if (t < 1)
throw new Error("glog(" + t + ")");
return m.LOG_TABLE[t];
},
gexp: function(t) {
for (; t < 0; )
t += 255;
for (; t >= 256; )
t -= 255;
return m.EXP_TABLE[t];
},
EXP_TABLE: new Array(256),
LOG_TABLE: new Array(256)
};
for (var g = 0; g < 8; g++)
m.EXP_TABLE[g] = 1 << g;
for (var g = 8; g < 256; g++)
m.EXP_TABLE[g] = m.EXP_TABLE[g - 4] ^ m.EXP_TABLE[g - 5] ^ m.EXP_TABLE[g - 6] ^ m.EXP_TABLE[g - 8];
for (var g = 0; g < 255; g++)
m.LOG_TABLE[m.EXP_TABLE[g]] = g;
var J = m, L = J;
function N(t, e) {
if (t.length == null)
throw new Error(t.length + "/" + e);
for (var a = 0; a < t.length && t[a] == 0; )
a++;
this.num = new Array(t.length - a + e);
for (var r = 0; r < t.length - a; r++)
this.num[r] = t[r + a];
}
N.prototype = {
get: function(t) {
return this.num[t];
},
getLength: function() {
return this.num.length;
},
multiply: function(t) {
for (var e = new Array(this.getLength() + t.getLength() - 1), a = 0; a < this.getLength(); a++)
for (var r = 0; r < t.getLength(); r++)
e[a + r] ^= L.gexp(L.glog(this.get(a)) + L.glog(t.get(r)));
return new N(e, 0);
},
mod: function(t) {
if (this.getLength() - t.getLength() < 0)
return this;
for (var e = L.glog(this.get(0)) - L.glog(t.get(0)), a = new Array(this.getLength()), r = 0; r < this.getLength(); r++)
a[r] = this.get(r);
for (var r = 0; r < t.getLength(); r++)
a[r] ^= L.gexp(L.glog(t.get(r)) + e);
return new N(a, 0).mod(t);
}
};
var Z = N, c = X, z = Z, gt = J, B = {
PATTERN000: 0,
PATTERN001: 1,
PATTERN010: 2,
PATTERN011: 3,
PATTERN100: 4,
PATTERN101: 5,
PATTERN110: 6,
PATTERN111: 7
}, v = {
PATTERN_POSITION_TABLE: [
[],
[6, 18],
[6, 22],
[6, 26],
[6, 30],
[6, 34],
[6, 22, 38],
[6, 24, 42],
[6, 26, 46],
[6, 28, 50],
[6, 30, 54],
[6, 32, 58],
[6, 34, 62],
[6, 26, 46, 66],
[6, 26, 48, 70],
[6, 26, 50, 74],
[6, 30, 54, 78],
[6, 30, 56, 82],
[6, 30, 58, 86],
[6, 34, 62, 90],
[6, 28, 50, 72, 94],
[6, 26, 50, 74, 98],
[6, 30, 54, 78, 102],
[6, 28, 54, 80, 106],
[6, 32, 58, 84, 110],
[6, 30, 58, 86, 114],
[6, 34, 62, 90, 118],
[6, 26, 50, 74, 98, 122],
[6, 30, 54, 78, 102, 126],
[6, 26, 52, 78, 104, 130],
[6, 30, 56, 82, 108, 134],
[6, 34, 60, 86, 112, 138],
[6, 30, 58, 86, 114, 142],
[6, 34, 62, 90, 118, 146],
[6, 30, 54, 78, 102, 126, 150],
[6, 24, 50, 76, 102, 128, 154],
[6, 28, 54, 80, 106, 132, 158],
[6, 32, 58, 84, 110, 136, 162],
[6, 26, 54, 82, 110, 138, 166],
[6, 30, 58, 86, 114, 142, 170]
],
G15: 1335,
G18: 7973,
G15_MASK: 21522,
getBCHTypeInfo: function(t) {
for (var e = t << 10; v.getBCHDigit(e) - v.getBCHDigit(v.G15) >= 0; )
e ^= v.G15 << v.getBCHDigit(e) - v.getBCHDigit(v.G15);
return (t << 10 | e) ^ v.G15_MASK;
},
getBCHTypeNumber: function(t) {
for (var e = t << 12; v.getBCHDigit(e) - v.getBCHDigit(v.G18) >= 0; )
e ^= v.G18 << v.getBCHDigit(e) - v.getBCHDigit(v.G18);
return t << 12 | e;
},
getBCHDigit: function(t) {
for (var e = 0; t != 0; )
e++, t >>>= 1;
return e;
},
getPatternPosition: function(t) {
return v.PATTERN_POSITION_TABLE[t - 1];
},
getMask: function(t, e, a) {
switch (t) {
case B.PATTERN000:
return (e + a) % 2 == 0;
case B.PATTERN001:
return e % 2 == 0;
case B.PATTERN010:
return a % 3 == 0;
case B.PATTERN011:
return (e + a) % 3 == 0;
case B.PATTERN100:
return (Math.floor(e / 2) + Math.floor(a / 3)) % 2 == 0;
case B.PATTERN101:
return e * a % 2 + e * a % 3 == 0;
case B.PATTERN110:
return (e * a % 2 + e * a % 3) % 2 == 0;
case B.PATTERN111:
return (e * a % 3 + (e + a) % 2) % 2 == 0;
default:
throw new Error("bad maskPattern:" + t);
}
},
getErrorCorrectPolynomial: function(t) {
for (var e = new z([1], 0), a = 0; a < t; a++)
e = e.multiply(new z([1, gt.gexp(a)], 0));
return e;
},
getLengthInBits: function(t, e) {
if (1 <= e && e < 10)
switch (t) {
case c.MODE_NUMBER:
return 10;
case c.MODE_ALPHA_NUM:
return 9;
case c.MODE_8BIT_BYTE:
return 8;
case c.MODE_KANJI:
return 8;
default:
throw new Error("mode:" + t);
}
else if (e < 27)
switch (t) {
case c.MODE_NUMBER:
return 12;
case c.MODE_ALPHA_NUM:
return 11;
case c.MODE_8BIT_BYTE:
return 16;
case c.MODE_KANJI:
return 10;
default:
throw new Error("mode:" + t);
}
else if (e < 41)
switch (t) {
case c.MODE_NUMBER:
return 14;
case c.MODE_ALPHA_NUM:
return 13;
case c.MODE_8BIT_BYTE:
return 16;
case c.MODE_KANJI:
return 12;
default:
throw new Error("mode:" + t);
}
else
throw new Error("type:" + e);
},
getLostPoint: function(t) {
for (var e = t.getModuleCount(), a = 0, r = 0; r < e; r++)
for (var n = 0; n < e; n++) {
for (var i = 0, s = t.isDark(r, n), o = -1; o <= 1; o++)
if (!(r + o < 0 || e <= r + o))
for (var u = -1; u <= 1; u++)
n + u < 0 || e <= n + u || o == 0 && u == 0 || s == t.isDark(r + o, n + u) && i++;
i > 5 && (a += 3 + i - 5);
}
for (var r = 0; r < e - 1; r++)
for (var n = 0; n < e - 1; n++) {
var f = 0;
t.isDark(r, n) && f++, t.isDark(r + 1, n) && f++, t.isDark(r, n + 1) && f++, t.isDark(r + 1, n + 1) && f++, (f == 0 || f == 4) && (a += 3);
}
for (var r = 0; r < e; r++)
for (var n = 0; n < e - 6; n++)
t.isDark(r, n) && !t.isDark(r, n + 1) && t.isDark(r, n + 2) && t.isDark(r, n + 3) && t.isDark(r, n + 4) && !t.isDark(r, n + 5) && t.isDark(r, n + 6) && (a += 40);
for (var n = 0; n < e; n++)
for (var r = 0; r < e - 6; r++)
t.isDark(r, n) && !t.isDark(r + 1, n) && t.isDark(r + 2, n) && t.isDark(r + 3, n) && t.isDark(r + 4, n) && !t.isDark(r + 5, n) && t.isDark(r + 6, n) && (a += 40);
for (var l = 0, n = 0; n < e; n++)
for (var r = 0; r < e; r++)
t.isDark(r, n) && l++;
var T = Math.abs(100 * l / e / e - 50) / 5;
return a += T * 10, a;
}
}, dt = v, ct = ft, W = ht, V = vt, _ = dt, pt = Z;
function E(t, e) {
this.typeNumber = t, this.errorCorrectLevel = e, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = [];
}
var d = E.prototype;
d.addData = function(t) {
var e = new ct(t);
this.dataList.push(e), this.dataCache = null;
};
d.isDark = function(t, e) {
if (t < 0 || this.moduleCount <= t || e < 0 || this.moduleCount <= e)
throw new Error(t + "," + e);
return this.modules[t][e];
};
d.getModuleCount = function() {
return this.moduleCount;
};
d.make = function() {
if (this.typeNumber < 1) {
var t = 1;
for (t = 1; t < 40; t++) {
for (var e = W.getRSBlocks(t, this.errorCorrectLevel), a = new V(), r = 0, n = 0; n < e.length; n++)
r += e[n].dataCount;
for (var n = 0; n < this.dataList.length; n++) {
var i = this.dataList[n];
a.put(i.mode, 4), a.put(i.getLength(), _.getLengthInBits(i.mode, t)), i.write(a);
}
if (a.getLengthInBits() <= r * 8)
break;
}
this.typeNumber = t;
}
this.makeImpl(!1, this.getBestMaskPattern());
};
d.makeImpl = function(t, e) {
this.moduleCount = this.typeNumber * 4 + 17, this.modules = new Array(this.moduleCount);
for (var a = 0; a < this.moduleCount; a++) {
this.modules[a] = new Array(this.moduleCount);
for (var r = 0; r < this.moduleCount; r++)
this.modules[a][r] = null;
}
this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(t, e), this.typeNumber >= 7 && this.setupTypeNumber(t), this.dataCache == null && (this.dataCache = E.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, e);
};
d.setupPositionProbePattern = function(t, e) {
for (var a = -1; a <= 7; a++)
if (!(t + a <= -1 || this.moduleCount <= t + a))
for (var r = -1; r <= 7; r++)
e + r <= -1 || this.moduleCount <= e + r || (0 <= a && a <= 6 && (r == 0 || r == 6) || 0 <= r && r <= 6 && (a == 0 || a == 6) || 2 <= a && a <= 4 && 2 <= r && r <= 4 ? this.modules[t + a][e + r] = !0 : this.modules[t + a][e + r] = !1);
};
d.getBestMaskPattern = function() {
for (var t = 0, e = 0, a = 0; a < 8; a++) {
this.makeImpl(!0, a);
var r = _.getLostPoint(this);
(a == 0 || t > r) && (t = r, e = a);
}
return e;
};
d.createMovieClip = function(t, e, a) {
var r = t.createEmptyMovieClip(e, a), n = 1;
this.make();
for (var i = 0; i < this.modules.length; i++)
for (var s = i * n, o = 0; o < this.modules[i].length; o++) {
var u = o * n, f = this.modules[i][o];
f && (r.beginFill(0, 100), r.moveTo(u, s), r.lineTo(u + n, s), r.lineTo(u + n, s + n), r.lineTo(u, s + n), r.endFill());
}
return r;
};
d.setupTimingPattern = function() {
for (var t = 8; t < this.moduleCount - 8; t++)
this.modules[t][6] == null && (this.modules[t][6] = t % 2 == 0);
for (var e = 8; e < this.moduleCount - 8; e++)
this.modules[6][e] == null && (this.modules[6][e] = e % 2 == 0);
};
d.setupPositionAdjustPattern = function() {
for (var t = _.getPatternPosition(this.typeNumber), e = 0; e < t.length; e++)
for (var a = 0; a < t.length; a++) {
var r = t[e], n = t[a];
if (this.modules[r][n] == null)
for (var i = -2; i <= 2; i++)
for (var s = -2; s <= 2; s++)
i == -2 || i == 2 || s == -2 || s == 2 || i == 0 && s == 0 ? this.modules[r + i][n + s] = !0 : this.modules[r + i][n + s] = !1;
}
};
d.setupTypeNumber = function(t) {
for (var e = _.getBCHTypeNumber(this.typeNumber), a = 0; a < 18; a++) {
var r = !t && (e >> a & 1) == 1;
this.modules[Math.floor(a / 3)][a % 3 + this.moduleCount - 8 - 3] = r;
}
for (var a = 0; a < 18; a++) {
var r = !t && (e >> a & 1) == 1;
this.modules[a % 3 + this.moduleCount - 8 - 3][Math.floor(a / 3)] = r;
}
};
d.setupTypeInfo = function(t, e) {
for (var a = this.errorCorrectLevel << 3 | e, r = _.getBCHTypeInfo(a), n = 0; n < 15; n++) {
var i = !t && (r >> n & 1) == 1;
n < 6 ? this.modules[n][8] = i : n < 8 ? this.modules[n + 1][8] = i : this.modules[this.moduleCount - 15 + n][8] = i;
}
for (var n = 0; n < 15; n++) {
var i = !t && (r >> n & 1) == 1;
n < 8 ? this.modules[8][this.moduleCount - n - 1] = i : n < 9 ? this.modules[8][15 - n - 1 + 1] = i : this.modules[8][15 - n - 1] = i;
}
this.modules[this.moduleCount - 8][8] = !t;
};
d.mapData = function(t, e) {
for (var a = -1, r = this.moduleCount - 1, n = 7, i = 0, s = this.moduleCount - 1; s > 0; s -= 2)
for (s == 6 && s--; ; ) {
for (var o = 0; o < 2; o++)
if (this.modules[r][s - o] == null) {
var u = !1;
i < t.length && (u = (t[i] >>> n & 1) == 1);
var f = _.getMask(e, r, s - o);
f && (u = !u), this.modules[r][s - o] = u, n--, n == -1 && (i++, n = 7);
}
if (r += a, r < 0 || this.moduleCount <= r) {
r -= a, a = -a;
break;
}
}
};
E.PAD0 = 236;
E.PAD1 = 17;
E.createData = function(t, e, a) {
for (var r = W.getRSBlocks(t, e), n = new V(), i = 0; i < a.length; i++) {
var s = a[i];
n.put(s.mode, 4), n.put(s.getLength(), _.getLengthInBits(s.mode, t)), s.write(n);
}
for (var o = 0, i = 0; i < r.length; i++)
o += r[i].dataCount;
if (n.getLengthInBits() > o * 8)
throw new Error("code length overflow. (" + n.getLengthInBits() + ">" + o * 8 + ")");
for (n.getLengthInBits() + 4 <= o * 8 && n.put(0, 4); n.getLengthInBits() % 8 != 0; )
n.putBit(!1);
for (; !(n.getLengthInBits() >= o * 8 || (n.put(E.PAD0, 8), n.getLengthInBits() >= o * 8)); )
n.put(E.PAD1, 8);
return E.createBytes(n, r);
};
E.createBytes = function(t, e) {
for (var a = 0, r = 0, n = 0, i = new Array(e.length), s = new Array(e.length), o = 0; o < e.length; o++) {
var u = e[o].dataCount, f = e[o].totalCount - u;
r = Math.max(r, u), n = Math.max(n, f), i[o] = new Array(u);
for (var l = 0; l < i[o].length; l++)
i[o][l] = 255 & t.buffer[l + a];
a += u;
var T = _.getErrorCorrectPolynomial(f), y = new pt(i[o], T.getLength() - 1), P = y.mod(T);
s[o] = new Array(T.getLength() - 1);
for (var l = 0; l < s[o].length; l++) {
var D = l + P.getLength() - s[o].length;
s[o][l] = D >= 0 ? P.get(D) : 0;
}
}
for (var A = 0, l = 0; l < e.length; l++)
A += e[l].totalCount;
for (var x = new Array(A), R = 0, l = 0; l < r; l++)
for (var o = 0; o < e.length; o++)
l < i[o].length && (x[R++] = i[o][l]);
for (var l = 0; l < n; l++)
for (var o = 0; o < e.length; o++)
l < s[o].length && (x[R++] = s[o][l]);
return x;
};
var mt = E, $ = {};
Object.defineProperty($, "__esModule", {
value: !0
});
var wt = Object.assign || function(t) {
for (var e = 1; e < arguments.length; e++) {
var a = arguments[e];
for (var r in a)
Object.prototype.hasOwnProperty.call(a, r) && (t[r] = a[r]);
}
return t;
}, Et = G, p = tt(Et), q = K, k = tt(q);
function tt(t) {
return t && t.__esModule ? t : { default: t };
}
function Tt(t, e) {
var a = {};
for (var r in t)
e.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(t, r) && (a[r] = t[r]);
return a;
}
var Ct = {
bgColor: p.default.oneOfType([p.default.object, p.default.string]).isRequired,
bgD: p.default.string.isRequired,
fgColor: p.default.oneOfType([p.default.object, p.default.string]).isRequired,
fgD: p.default.string.isRequired,
size: p.default.number.isRequired,
title: p.default.string,
viewBoxSize: p.default.number.isRequired,
xmlns: p.default.string
}, Q = (0, q.forwardRef)(function(t, e) {
var a = t.bgColor, r = t.bgD, n = t.fgD, i = t.fgColor, s = t.size, o = t.title, u = t.viewBoxSize, f = t.xmlns, l = f === void 0 ? "http://www.w3.org/2000/svg" : f, T = Tt(t, ["bgColor", "bgD", "fgD", "fgColor", "size", "title", "viewBoxSize", "xmlns"]);
return k.default.createElement(
"svg",
wt({}, T, { height: s, ref: e, viewBox: "0 0 " + u + " " + u, width: s, xmlns: l }),
o ? k.default.createElement(
"title",
null,
o
) : null,
k.default.createElement("path", { d: r, fill: a }),
k.default.createElement("path", { d: n, fill: i })
);
});
Q.displayName = "QRCodeSvg";
Q.propTypes = Ct;
$.default = Q;
Object.defineProperty(O, "__esModule", {
value: !0
});
O.QRCode = void 0;
var Bt = Object.assign || function(t) {
for (var e = 1; e < arguments.length; e++) {
var a = arguments[e];
for (var r in a)
Object.prototype.hasOwnProperty.call(a, r) && (t[r] = a[r]);
}
return t;
}, _t = G, C = b(_t), xt = F, Lt = b(xt), Pt = mt, Dt = b(Pt), et = K, At = b(et), Rt = $, yt = b(Rt);
function b(t) {
return t && t.__esModule ? t : { default: t };
}
function bt(t, e) {
var a = {};
for (var r in t)
e.indexOf(r) >= 0 || Object.prototype.hasOwnProperty.call(t, r) && (a[r] = t[r]);
return a;
}
var Mt = {
bgColor: C.default.oneOfType([C.default.object, C.default.string]),
fgColor: C.default.oneOfType([C.default.object, C.default.string]),
level: C.default.string,
size: C.default.number,
value: C.default.string.isRequired
}, I = (0, et.forwardRef)(function(t, e) {
var a = t.bgColor, r = a === void 0 ? "#FFFFFF" : a, n = t.fgColor, i = n === void 0 ? "#000000" : n, s = t.level, o = s === void 0 ? "L" : s, u = t.size, f = u === void 0 ? 256 : u, l = t.value, T = bt(t, ["bgColor", "fgColor", "level", "size", "value"]), y = new Dt.default(-1, Lt.default[o]);
y.addData(l), y.make();
var P = y.modules;
return At.default.createElement(yt.default, Bt({}, T, {
bgColor: r,
bgD: P.map(function(D, A) {
return D.map(function(x, R) {
return x ? "" : "M " + R + " " + A + " l 1 0 0 1 -1 0 Z";
}).join(" ");
}).join(" "),
fgColor: i,
fgD: P.map(function(D, A) {
return D.map(function(x, R) {
return x ? "M " + R + " " + A + " l 1 0 0 1 -1 0 Z" : "";
}).join(" ");
}).join(" "),
ref: e,
size: f,
viewBoxSize: P.length
}));
});
O.QRCode = I;
I.displayName = "QRCode";
I.propTypes = Mt;
var kt = O.default = I;
const Nt = (t) => /* @__PURE__ */ H.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ H.createElement("path", { d: "M14.3516 3.64844C14.707 3.97656 14.707 4.55078 14.3516 4.87891L7.35156 11.8789C7.02344 12.2344 6.44922 12.2344 6.12109 11.8789L2.62109 8.37891C2.26562 8.05078 2.26562 7.47656 2.62109 7.14844C2.94922 6.79297 3.52344 6.79297 3.85156 7.14844L6.75 10.0195L13.1211 3.64844C13.4492 3.29297 14.0234 3.29297 14.3516 3.64844Z", fill: "currentColor" })), Ot = ({ redirectUrl: t }) => {
const [e, a] = it(!1), r = ot(() => {
navigator.clipboard.writeText(t), a(!0), setTimeout(() => {
a(!1);
}, 2500);
}, [t]);
return h.jsx(h.Fragment, { children: t ? h.jsxs(h.Fragment, { children: [h.jsxs("div", { className: "tw-relative tw-flex tw-justify-center tw-items-center", children: [h.jsx("span", { className: "tw-bg-web-secondary-white tw-absolute tw-w-[calc(100%-6px)] tw-h-[calc(100%-6px)] tw-rounded-md" }), h.jsx(kt, { className: "qr-code-frame tw-outline tw-outline-[calc(var(--t))] tw-outline-accent dark:tw-outline-accent-dark tw-transition-all tw-duration-300", size: 362, level: "L", value: t })] }), h.jsxs("div", { className: "tw-relative tw-flex tw-justify-center tw-items-center", children: [h.jsx("button", { onClick: r, id: "copy-qr-code-link", className: "label tw-text-secondary-on-light-60 dark:tw-text-secondary-on-light-60-dark tw-text-center hover:tw-bg-transparent tw-max-w-80 md:tw-max-w-96 tw-overflow-ellipsis tw-whitespace-nowrap tw-overflow-hidden tw-cursor-pointer", children: t }), e && h.jsx(Nt, { className: `tw-absolute tw-w-auto tw-h-full -tw-right-6 tw-transition-all tw-duration-300 ${e ? "tw-text-positive dark:tw-text-positive-dark" : "tw-text-separator dark:tw-text-separator"}` })] })] }) : h.jsx(rt, {}) });
}, It = async () => {
try {
const t = new lt({
includeProgress: !0
});
return await t.fetchSessionDetails(), t.getSessionDetails();
} catch {
return { userStarted: !1 };
}
}, zt = ({ onBack: t, onNext: e }) => {
const a = j.config.redirectUrl || "";
return st(() => {
const r = setInterval(async () => {
const n = await It();
n != null && n.userStarted && (clearInterval(r), e());
}, j.config.resultPollingInterval * 1e3);
return () => clearInterval(r);
}, [e]), h.jsx(at, { children: h.jsxs("div", { className: "tw-flex tw-flex-col tw-gap-12", children: [h.jsxs("div", { className: "tw-text-primary-on-light-100 dark:tw-text-primary-on-light-100-dark tw-flex tw-flex-col tw-gap-8", children: [h.jsxs("div", { className: "tw-w-full tw-text-left tw-flex tw-flex-col tw-gap-[6px]", children: [h.jsx("h1", { id: "w-title", children: S.redirect_screen_title }), h.jsx("p", { id: "w-description", className: "label tw-text-secondary-on-light-60 dark:tw-text-secondary-on-light-60-dark", children: S.redirect_screen_description })] }), h.jsx("div", { className: "tw-flex tw-flex-col tw-gap-8 tw-justify-center tw-items-center", children: h.jsx(Ot, { redirectUrl: a }) })] }), h.jsx("div", { className: "tw-flex tw-flex-col tw-gap-4", children: h.jsx(nt, { id: "back-button", onClick: t, text: S.redirect_screen_button, className: "tw-w-full tw-px-4 tw-whitespace-nowrap" }) })] }) });
};
export {
zt as default
};