@tsocial/tvweb-sdk.msb 0.0.0-beta.20260106-111700 → 0.0.0-beta.20260113-112310
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/build/tvweb-sdk.cjs.min.js +52 -52
- package/build/tvweb-sdk.esm.min.js +52 -52
- package/build/tvweb-sdk.msb.standalone.js +273 -280
- package/build/tvweb-sdk.msb.standalone.min.js +52 -52
- package/build/types/index.d.ts +15 -2
- package/package.json +5 -5
|
@@ -33783,7 +33783,7 @@
|
|
|
33783
33783
|
}, nS$1;
|
|
33784
33784
|
}();
|
|
33785
33785
|
function nB$1() {
|
|
33786
|
-
return "0.0.0-beta.
|
|
33786
|
+
return "0.0.0-beta.20260113-112310";
|
|
33787
33787
|
}
|
|
33788
33788
|
function nI$1() {
|
|
33789
33789
|
return {
|
|
@@ -41260,52 +41260,52 @@
|
|
|
41260
41260
|
}(), uG);
|
|
41261
41261
|
}();
|
|
41262
41262
|
function dm(e, t) {
|
|
41263
|
-
let r =
|
|
41263
|
+
let r = dv();
|
|
41264
41264
|
return (dm = function(e, t) {
|
|
41265
|
-
return r[e -=
|
|
41265
|
+
return r[e -= 317];
|
|
41266
41266
|
})(e, t);
|
|
41267
41267
|
}
|
|
41268
|
-
|
|
41268
|
+
let dg = dm, dy = dm, db = dv();
|
|
41269
|
+
for(;;)try {
|
|
41270
|
+
if (parseInt(dy(339)) / 1 + -parseInt(dy(321)) / 2 * (parseInt(dy(331)) / 3) + parseInt(dy(319)) / 4 * (parseInt(dy(335)) / 5) + -parseInt(dy(322)) / 6 + parseInt(dy(326)) / 7 * (parseInt(dy(323)) / 8) + parseInt(dy(334)) / 9 * (-parseInt(dy(332)) / 10) + -parseInt(dy(324)) / 11 * (-parseInt(dy(337)) / 12) === 239699) break;
|
|
41271
|
+
db.push(db.shift());
|
|
41272
|
+
} catch (e) {
|
|
41273
|
+
db.push(db.shift());
|
|
41274
|
+
}
|
|
41275
|
+
function dv() {
|
|
41269
41276
|
let e = [
|
|
41270
|
-
"
|
|
41271
|
-
"3325580IJRjfa",
|
|
41272
|
-
"1962rbKEwo",
|
|
41273
|
-
"359892gaKbdX",
|
|
41274
|
-
"DepBO8t60S",
|
|
41277
|
+
"MFkwEwYHKo",
|
|
41275
41278
|
"2a8648ce3d",
|
|
41276
|
-
"0301070342",
|
|
41277
41279
|
"Mjci1ul8mm",
|
|
41278
|
-
"
|
|
41280
|
+
"ZIzj0CAQYI",
|
|
41281
|
+
"8AzvxTw",
|
|
41279
41282
|
"KoZIzj0DAQ",
|
|
41280
|
-
"
|
|
41283
|
+
"13522XetbDO",
|
|
41284
|
+
"49104pREmCz",
|
|
41285
|
+
"8ifaAZX",
|
|
41286
|
+
"95689TLpVMg",
|
|
41287
|
+
"072a8648ce",
|
|
41288
|
+
"1419082NKlgHK",
|
|
41289
|
+
"0301070342",
|
|
41290
|
+
"3059301306",
|
|
41281
41291
|
"+faHkP3QC3",
|
|
41292
|
+
"cDQgAE9h6Z",
|
|
41293
|
+
"183zCtLuB",
|
|
41294
|
+
"2925870RahsTq",
|
|
41295
|
+
"MfPrcYTM70",
|
|
41296
|
+
"9cvkkNK",
|
|
41297
|
+
"412345ggqcuY",
|
|
41298
|
+
"DepBO8t60S",
|
|
41299
|
+
"684DooIYO",
|
|
41282
41300
|
"ssRdXLZEX8",
|
|
41283
|
-
"
|
|
41284
|
-
"
|
|
41285
|
-
"2474NuulkO",
|
|
41286
|
-
"000",
|
|
41287
|
-
"9xZGYZu",
|
|
41288
|
-
"MFkwEwYHKo",
|
|
41289
|
-
"35640hpKjQn",
|
|
41290
|
-
"D9EKOWS+U4",
|
|
41291
|
-
"1362880fRAHgM",
|
|
41292
|
-
"44P0rKKsZK",
|
|
41293
|
-
"3d02010608",
|
|
41294
|
-
"ZIzj0CAQYI",
|
|
41295
|
-
"072a8648ce"
|
|
41301
|
+
"89384WSmvmG",
|
|
41302
|
+
"44P0rKKsZK"
|
|
41296
41303
|
];
|
|
41297
|
-
return (
|
|
41304
|
+
return (dv = function() {
|
|
41298
41305
|
return e;
|
|
41299
41306
|
})();
|
|
41300
41307
|
}
|
|
41301
|
-
let
|
|
41302
|
-
for(;;)try {
|
|
41303
|
-
if (parseInt(db(376)) / 1 + parseInt(db(372)) / 2 * (parseInt(db(370)) / 3) + parseInt(db(360)) / 4 + parseInt(db(371)) / 5 * (parseInt(db(359)) / 6) + parseInt(db(367)) / 7 + parseInt(db(378)) / 8 + -parseInt(db(374)) / 9 * (parseInt(db(358)) / 10) === 123814) break;
|
|
41304
|
-
dv.push(dv.shift());
|
|
41305
|
-
} catch (e) {
|
|
41306
|
-
dv.push(dv.shift());
|
|
41307
|
-
}
|
|
41308
|
-
let d_ = "3059301306" + dy(356) + dy(354) + dy(362) + dy(363) + dy(373), dx = dy(375) + dy(355) + dy(366) + "cDQgAE9h6Z" + dy(361) + dy(357) + dy(368) + dy(379) + dy(364) + dy(377) + "MfPrcYTM70" + dy(369) + dy(365);
|
|
41308
|
+
let d_ = dg(328) + dg(325) + "3d02010608" + dg(342) + dg(327) + "000", dx = dg(341) + dg(318) + dg(320) + dg(330) + dg(336) + "ytJdcsPxrD" + dg(329) + dg(340) + dg(317) + "D9EKOWS+U4" + dg(333) + dg(338) + "KA==";
|
|
41309
41309
|
async function dC(e) {
|
|
41310
41310
|
let t = new TextEncoder().encode(e);
|
|
41311
41311
|
return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", t))).map((e)=>e.toString(16).padStart(2, "0")).join("");
|
|
@@ -45324,7 +45324,7 @@
|
|
|
45324
45324
|
return this.getKey().getPublicKey();
|
|
45325
45325
|
}, e.prototype.getPublicKeyB64 = function() {
|
|
45326
45326
|
return this.getKey().getPublicBaseKeyB64();
|
|
45327
|
-
}, e.version = "5.34.
|
|
45327
|
+
}, e.version = "5.34.5", e;
|
|
45328
45328
|
}();
|
|
45329
45329
|
let hO = [
|
|
45330
45330
|
"-",
|
|
@@ -88762,204 +88762,6 @@
|
|
|
88762
88762
|
return videoCanvas;
|
|
88763
88763
|
};
|
|
88764
88764
|
|
|
88765
|
-
const MODE = {
|
|
88766
|
-
LANDSCAPE: 'landscape',
|
|
88767
|
-
PORTRAIT: 'portrait',
|
|
88768
|
-
DESKTOP: 'desktop'
|
|
88769
|
-
};
|
|
88770
|
-
const useDetectOrientation = (onOrientationChange)=>{
|
|
88771
|
-
const portraitQuery = reactExports.useRef(window.matchMedia('(orientation: portrait)'));
|
|
88772
|
-
const initOrientation = reactExports.useRef(portraitQuery.current.matches ? MODE.PORTRAIT : MODE.LANDSCAPE);
|
|
88773
|
-
const [curOrientation, setCurOrientation] = reactExports.useState(initOrientation.current);
|
|
88774
|
-
reactExports.useEffect(()=>{
|
|
88775
|
-
function handleResizeForScreen() {
|
|
88776
|
-
const orientationType = get(screen, 'orientation.type')?.split('-')?.[0];
|
|
88777
|
-
setCurOrientation(orientationType);
|
|
88778
|
-
if (typeof onOrientationChange === 'function') {
|
|
88779
|
-
onOrientationChange(orientationType);
|
|
88780
|
-
}
|
|
88781
|
-
}
|
|
88782
|
-
function handleResizeForQuery(e) {
|
|
88783
|
-
let orientation;
|
|
88784
|
-
if (e.matches) {
|
|
88785
|
-
orientation = MODE.PORTRAIT;
|
|
88786
|
-
} else {
|
|
88787
|
-
orientation = MODE.LANDSCAPE;
|
|
88788
|
-
}
|
|
88789
|
-
setCurOrientation(orientation);
|
|
88790
|
-
if (typeof onOrientationChange === 'function') {
|
|
88791
|
-
onOrientationChange(orientation);
|
|
88792
|
-
}
|
|
88793
|
-
}
|
|
88794
|
-
if (screen.orientation) {
|
|
88795
|
-
screen.orientation.addEventListener('change', handleResizeForScreen);
|
|
88796
|
-
} else {
|
|
88797
|
-
// screen.orientation only available on ios > 16.4
|
|
88798
|
-
// fallback to window.matchMedia
|
|
88799
|
-
portraitQuery.current.addEventListener('change', handleResizeForQuery);
|
|
88800
|
-
}
|
|
88801
|
-
return ()=>{
|
|
88802
|
-
if (screen.orientation) {
|
|
88803
|
-
screen.orientation.removeEventListener('change', handleResizeForScreen);
|
|
88804
|
-
} else {
|
|
88805
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
88806
|
-
portraitQuery.current.removeEventListener('change', handleResizeForQuery);
|
|
88807
|
-
}
|
|
88808
|
-
};
|
|
88809
|
-
}, [
|
|
88810
|
-
onOrientationChange
|
|
88811
|
-
]);
|
|
88812
|
-
return libExports.isMobile ? {
|
|
88813
|
-
curOrientation,
|
|
88814
|
-
initOrientation: initOrientation.current
|
|
88815
|
-
} : {
|
|
88816
|
-
curOrientation: MODE.DESKTOP
|
|
88817
|
-
};
|
|
88818
|
-
};
|
|
88819
|
-
|
|
88820
|
-
/**
|
|
88821
|
-
* Custom hook to delay rendering when transitioning from hidden to visible state.
|
|
88822
|
-
* Useful for waiting for browser dimension updates after orientation changes.
|
|
88823
|
-
*
|
|
88824
|
-
* @param params - Hook parameters
|
|
88825
|
-
* @param params.isVisible - Whether the component is currently visible
|
|
88826
|
-
* @param params.enableDelay - Whether to apply delay logic for show transitions
|
|
88827
|
-
* @param params.delayMs - Delay in milliseconds before showing (default: 500)
|
|
88828
|
-
* @returns Delayed visibility state
|
|
88829
|
-
*/ function useDelayedRender({ isVisible, enableDelay, delayMs = 500 }) {
|
|
88830
|
-
const [isVisibleDelayed, setIsVisibleDelayed] = reactExports.useState(isVisible);
|
|
88831
|
-
const prevIsVisibleRef = reactExports.useRef(isVisible);
|
|
88832
|
-
const timeoutRef = reactExports.useRef(null);
|
|
88833
|
-
reactExports.useEffect(()=>{
|
|
88834
|
-
const prevIsVisible = prevIsVisibleRef.current;
|
|
88835
|
-
// When delay is disabled, always sync immediately
|
|
88836
|
-
if (!enableDelay) {
|
|
88837
|
-
setIsVisibleDelayed(isVisible);
|
|
88838
|
-
prevIsVisibleRef.current = isVisible;
|
|
88839
|
-
return undefined;
|
|
88840
|
-
}
|
|
88841
|
-
// Handle transitions when delay is enabled
|
|
88842
|
-
const isTransitionToShow = !prevIsVisible && isVisible;
|
|
88843
|
-
const isTransitionToHide = prevIsVisible && !isVisible;
|
|
88844
|
-
if (isTransitionToShow) {
|
|
88845
|
-
// Delay showing when transitioning from hidden to visible
|
|
88846
|
-
timeoutRef.current = setTimeout(()=>{
|
|
88847
|
-
setIsVisibleDelayed(true);
|
|
88848
|
-
}, delayMs);
|
|
88849
|
-
} else if (isTransitionToHide) {
|
|
88850
|
-
// Immediately hide and cancel pending show
|
|
88851
|
-
if (timeoutRef.current) {
|
|
88852
|
-
clearTimeout(timeoutRef.current);
|
|
88853
|
-
timeoutRef.current = null;
|
|
88854
|
-
}
|
|
88855
|
-
setIsVisibleDelayed(false);
|
|
88856
|
-
}
|
|
88857
|
-
prevIsVisibleRef.current = isVisible;
|
|
88858
|
-
return ()=>{
|
|
88859
|
-
if (timeoutRef.current) {
|
|
88860
|
-
clearTimeout(timeoutRef.current);
|
|
88861
|
-
}
|
|
88862
|
-
};
|
|
88863
|
-
}, [
|
|
88864
|
-
isVisible,
|
|
88865
|
-
enableDelay,
|
|
88866
|
-
delayMs
|
|
88867
|
-
]);
|
|
88868
|
-
return isVisibleDelayed;
|
|
88869
|
-
}
|
|
88870
|
-
|
|
88871
|
-
const PopupContent$1 = dt$1.div`
|
|
88872
|
-
text-align: center;
|
|
88873
|
-
font-size: 20px;
|
|
88874
|
-
font-weight: 600;
|
|
88875
|
-
`;
|
|
88876
|
-
const ChildrenWrapper$1 = dt$1.div`
|
|
88877
|
-
width: 100%;
|
|
88878
|
-
height: 100%;
|
|
88879
|
-
opacity: ${({ $showChildren })=>$showChildren ? 1 : 0};
|
|
88880
|
-
`;
|
|
88881
|
-
const defaultPreferredOrientations = [
|
|
88882
|
-
MODE.PORTRAIT,
|
|
88883
|
-
MODE.DESKTOP
|
|
88884
|
-
];
|
|
88885
|
-
function OrientationDetectionV2({ onOrientationChange = noop$1, unmountOnHidden = false, remountDelayMs = 500, preferredOrientations = defaultPreferredOrientations, children }) {
|
|
88886
|
-
const t = gB();
|
|
88887
|
-
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
88888
|
-
const hasCorrectOrientation = preferredOrientations.includes(curOrientation);
|
|
88889
|
-
const isVisible = useDelayedRender({
|
|
88890
|
-
isVisible: hasCorrectOrientation,
|
|
88891
|
-
enableDelay: unmountOnHidden,
|
|
88892
|
-
delayMs: remountDelayMs
|
|
88893
|
-
});
|
|
88894
|
-
const shouldMountChildrenOnDom = unmountOnHidden ? isVisible : true;
|
|
88895
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
88896
|
-
children: [
|
|
88897
|
-
!preferredOrientations.includes(curOrientation) && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
88898
|
-
open: true,
|
|
88899
|
-
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent$1, {
|
|
88900
|
-
children: t('wrong_orientation')
|
|
88901
|
-
})
|
|
88902
|
-
}),
|
|
88903
|
-
shouldMountChildrenOnDom && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper$1, {
|
|
88904
|
-
$showChildren: hasCorrectOrientation,
|
|
88905
|
-
children: children
|
|
88906
|
-
})
|
|
88907
|
-
]
|
|
88908
|
-
});
|
|
88909
|
-
}
|
|
88910
|
-
|
|
88911
|
-
const PopupContent = dt$1.div`
|
|
88912
|
-
text-align: center;
|
|
88913
|
-
font-size: 20px;
|
|
88914
|
-
font-weight: 600;
|
|
88915
|
-
`;
|
|
88916
|
-
const ChildrenWrapper = dt$1.div`
|
|
88917
|
-
width: 100%;
|
|
88918
|
-
height: 100%;
|
|
88919
|
-
opacity: ${({ showChildren })=>showChildren ? 1 : 0};
|
|
88920
|
-
`;
|
|
88921
|
-
// eslint-disable-next-line react/require-default-props
|
|
88922
|
-
function OrientationDetectionV1({ onOrientationChange, unmountOnHidden, children }) {
|
|
88923
|
-
const t = gB();
|
|
88924
|
-
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
88925
|
-
const shouldShowChildren = curOrientation === MODE.PORTRAIT || curOrientation === MODE.DESKTOP;
|
|
88926
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
88927
|
-
children: [
|
|
88928
|
-
curOrientation === MODE.LANDSCAPE && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
88929
|
-
open: true,
|
|
88930
|
-
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent, {
|
|
88931
|
-
children: t('wrong_orientation')
|
|
88932
|
-
})
|
|
88933
|
-
}),
|
|
88934
|
-
(unmountOnHidden ? shouldShowChildren : true) && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper, {
|
|
88935
|
-
showChildren: shouldShowChildren,
|
|
88936
|
-
children: children
|
|
88937
|
-
})
|
|
88938
|
-
]
|
|
88939
|
-
});
|
|
88940
|
-
}
|
|
88941
|
-
OrientationDetectionV1.defaultProps = {
|
|
88942
|
-
onOrientationChange: ()=>{},
|
|
88943
|
-
unmountOnHidden: false
|
|
88944
|
-
};
|
|
88945
|
-
OrientationDetectionV1.propTypes = {
|
|
88946
|
-
onOrientationChange: PropTypes.func,
|
|
88947
|
-
unmountOnHidden: PropTypes.bool
|
|
88948
|
-
};
|
|
88949
|
-
|
|
88950
|
-
function OrientationDetection({ version = 'v1', children, ...rest }) {
|
|
88951
|
-
if (version === 'v2') {
|
|
88952
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV2, {
|
|
88953
|
-
...rest,
|
|
88954
|
-
children: children
|
|
88955
|
-
});
|
|
88956
|
-
}
|
|
88957
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV1, {
|
|
88958
|
-
...rest,
|
|
88959
|
-
children: children
|
|
88960
|
-
});
|
|
88961
|
-
}
|
|
88962
|
-
|
|
88963
88765
|
const useEkycSession = ()=>{
|
|
88964
88766
|
const [sessionId, setSessionId] = reactExports.useState(Date.now());
|
|
88965
88767
|
const updateSessionId = reactExports.useCallback(()=>{
|
|
@@ -89179,7 +88981,7 @@
|
|
|
89179
88981
|
width: 6px;
|
|
89180
88982
|
height: 6px;
|
|
89181
88983
|
border-radius: 50%;
|
|
89182
|
-
background-color: ${getTheme('FlashLiveness.progressBar.
|
|
88984
|
+
background-color: ${getTheme('FlashLiveness.progressBar.textColor')};
|
|
89183
88985
|
margin-right: 5px;
|
|
89184
88986
|
margin-bottom: 2px;
|
|
89185
88987
|
}
|
|
@@ -91451,15 +91253,6 @@
|
|
|
91451
91253
|
useRunEffectWhen(()=>logEvent('selfie_flash', 'user_activity.start_flash'), step === STEP.START_FLASHING);
|
|
91452
91254
|
const progressPercentage = colorIndex === STOP_COLOR ? 0 : Math.min(Math.round((colorIndex + 1) / (colors.length * framesPerColor) * 100), 100);
|
|
91453
91255
|
const { Loading } = styledComponent;
|
|
91454
|
-
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
91455
|
-
if (curOrientation === MODE.LANDSCAPE) {
|
|
91456
|
-
videoRef.current?.pause();
|
|
91457
|
-
} else {
|
|
91458
|
-
videoRef.current?.play();
|
|
91459
|
-
}
|
|
91460
|
-
}, [
|
|
91461
|
-
videoRef
|
|
91462
|
-
]);
|
|
91463
91256
|
// ============================= Timer =============================
|
|
91464
91257
|
const onTimeout = reactExports.useCallback(()=>{
|
|
91465
91258
|
setIsAutoCapturing(false);
|
|
@@ -91496,8 +91289,7 @@
|
|
|
91496
91289
|
const errorMessage = getErrorMessage(faceError);
|
|
91497
91290
|
// error message should be centered in the oval
|
|
91498
91291
|
const errorY = cropArea.y + cropArea.height / 2 + ovalVerticalOffset;
|
|
91499
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsxs(
|
|
91500
|
-
onOrientationChange: onOrientationChange,
|
|
91292
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91501
91293
|
children: [
|
|
91502
91294
|
/*#__PURE__*/ jsxRuntimeExports.jsx(NormalCamera, {
|
|
91503
91295
|
frontCamera: frontCamera,
|
|
@@ -91983,17 +91775,219 @@
|
|
|
91983
91775
|
});
|
|
91984
91776
|
};
|
|
91985
91777
|
|
|
91778
|
+
const MODE = {
|
|
91779
|
+
LANDSCAPE: 'landscape',
|
|
91780
|
+
PORTRAIT: 'portrait',
|
|
91781
|
+
DESKTOP: 'desktop'
|
|
91782
|
+
};
|
|
91783
|
+
const useDetectOrientation = (onOrientationChange)=>{
|
|
91784
|
+
const portraitQuery = reactExports.useRef(window.matchMedia('(orientation: portrait)'));
|
|
91785
|
+
const initOrientation = reactExports.useRef(portraitQuery.current.matches ? MODE.PORTRAIT : MODE.LANDSCAPE);
|
|
91786
|
+
const [curOrientation, setCurOrientation] = reactExports.useState(initOrientation.current);
|
|
91787
|
+
reactExports.useEffect(()=>{
|
|
91788
|
+
function handleResizeForScreen() {
|
|
91789
|
+
const orientationType = get(screen, 'orientation.type')?.split('-')?.[0];
|
|
91790
|
+
setCurOrientation(orientationType);
|
|
91791
|
+
if (typeof onOrientationChange === 'function') {
|
|
91792
|
+
onOrientationChange(orientationType);
|
|
91793
|
+
}
|
|
91794
|
+
}
|
|
91795
|
+
function handleResizeForQuery(e) {
|
|
91796
|
+
let orientation;
|
|
91797
|
+
if (e.matches) {
|
|
91798
|
+
orientation = MODE.PORTRAIT;
|
|
91799
|
+
} else {
|
|
91800
|
+
orientation = MODE.LANDSCAPE;
|
|
91801
|
+
}
|
|
91802
|
+
setCurOrientation(orientation);
|
|
91803
|
+
if (typeof onOrientationChange === 'function') {
|
|
91804
|
+
onOrientationChange(orientation);
|
|
91805
|
+
}
|
|
91806
|
+
}
|
|
91807
|
+
if (screen.orientation) {
|
|
91808
|
+
screen.orientation.addEventListener('change', handleResizeForScreen);
|
|
91809
|
+
} else {
|
|
91810
|
+
// screen.orientation only available on ios > 16.4
|
|
91811
|
+
// fallback to window.matchMedia
|
|
91812
|
+
portraitQuery.current.addEventListener('change', handleResizeForQuery);
|
|
91813
|
+
}
|
|
91814
|
+
return ()=>{
|
|
91815
|
+
if (screen.orientation) {
|
|
91816
|
+
screen.orientation.removeEventListener('change', handleResizeForScreen);
|
|
91817
|
+
} else {
|
|
91818
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91819
|
+
portraitQuery.current.removeEventListener('change', handleResizeForQuery);
|
|
91820
|
+
}
|
|
91821
|
+
};
|
|
91822
|
+
}, [
|
|
91823
|
+
onOrientationChange
|
|
91824
|
+
]);
|
|
91825
|
+
return libExports.isMobile ? {
|
|
91826
|
+
curOrientation,
|
|
91827
|
+
initOrientation: initOrientation.current
|
|
91828
|
+
} : {
|
|
91829
|
+
curOrientation: MODE.DESKTOP
|
|
91830
|
+
};
|
|
91831
|
+
};
|
|
91832
|
+
|
|
91833
|
+
/**
|
|
91834
|
+
* Custom hook to delay rendering when transitioning from hidden to visible state.
|
|
91835
|
+
* Useful for waiting for browser dimension updates after orientation changes.
|
|
91836
|
+
*
|
|
91837
|
+
* @param params - Hook parameters
|
|
91838
|
+
* @param params.isVisible - Whether the component is currently visible
|
|
91839
|
+
* @param params.enableDelay - Whether to apply delay logic for show transitions
|
|
91840
|
+
* @param params.delayMs - Delay in milliseconds before showing (default: 500)
|
|
91841
|
+
* @returns Delayed visibility state
|
|
91842
|
+
*/ function useDelayedRender({ isVisible, enableDelay, delayMs = 500 }) {
|
|
91843
|
+
const [isVisibleDelayed, setIsVisibleDelayed] = reactExports.useState(isVisible);
|
|
91844
|
+
const prevIsVisibleRef = reactExports.useRef(isVisible);
|
|
91845
|
+
const timeoutRef = reactExports.useRef(null);
|
|
91846
|
+
reactExports.useEffect(()=>{
|
|
91847
|
+
const prevIsVisible = prevIsVisibleRef.current;
|
|
91848
|
+
// When delay is disabled, always sync immediately
|
|
91849
|
+
if (!enableDelay) {
|
|
91850
|
+
setIsVisibleDelayed(isVisible);
|
|
91851
|
+
prevIsVisibleRef.current = isVisible;
|
|
91852
|
+
return undefined;
|
|
91853
|
+
}
|
|
91854
|
+
// Handle transitions when delay is enabled
|
|
91855
|
+
const isTransitionToShow = !prevIsVisible && isVisible;
|
|
91856
|
+
const isTransitionToHide = prevIsVisible && !isVisible;
|
|
91857
|
+
if (isTransitionToShow) {
|
|
91858
|
+
// Delay showing when transitioning from hidden to visible
|
|
91859
|
+
timeoutRef.current = setTimeout(()=>{
|
|
91860
|
+
setIsVisibleDelayed(true);
|
|
91861
|
+
}, delayMs);
|
|
91862
|
+
} else if (isTransitionToHide) {
|
|
91863
|
+
// Immediately hide and cancel pending show
|
|
91864
|
+
if (timeoutRef.current) {
|
|
91865
|
+
clearTimeout(timeoutRef.current);
|
|
91866
|
+
timeoutRef.current = null;
|
|
91867
|
+
}
|
|
91868
|
+
setIsVisibleDelayed(false);
|
|
91869
|
+
}
|
|
91870
|
+
prevIsVisibleRef.current = isVisible;
|
|
91871
|
+
return ()=>{
|
|
91872
|
+
if (timeoutRef.current) {
|
|
91873
|
+
clearTimeout(timeoutRef.current);
|
|
91874
|
+
}
|
|
91875
|
+
};
|
|
91876
|
+
}, [
|
|
91877
|
+
isVisible,
|
|
91878
|
+
enableDelay,
|
|
91879
|
+
delayMs
|
|
91880
|
+
]);
|
|
91881
|
+
return isVisibleDelayed;
|
|
91882
|
+
}
|
|
91883
|
+
|
|
91884
|
+
const PopupContent$1 = dt$1.div`
|
|
91885
|
+
text-align: center;
|
|
91886
|
+
font-size: 20px;
|
|
91887
|
+
font-weight: 600;
|
|
91888
|
+
`;
|
|
91889
|
+
const ChildrenWrapper$1 = dt$1.div`
|
|
91890
|
+
width: 100%;
|
|
91891
|
+
height: 100%;
|
|
91892
|
+
opacity: ${({ $showChildren })=>$showChildren ? 1 : 0};
|
|
91893
|
+
`;
|
|
91894
|
+
const defaultPreferredOrientations = [
|
|
91895
|
+
MODE.PORTRAIT,
|
|
91896
|
+
MODE.DESKTOP
|
|
91897
|
+
];
|
|
91898
|
+
function OrientationDetectionV2({ onOrientationChange = noop$1, unmountOnHidden = false, remountDelayMs = 500, preferredOrientations = defaultPreferredOrientations, children }) {
|
|
91899
|
+
const t = gB();
|
|
91900
|
+
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
91901
|
+
const hasCorrectOrientation = preferredOrientations.includes(curOrientation);
|
|
91902
|
+
const isVisible = useDelayedRender({
|
|
91903
|
+
isVisible: hasCorrectOrientation,
|
|
91904
|
+
enableDelay: unmountOnHidden,
|
|
91905
|
+
delayMs: remountDelayMs
|
|
91906
|
+
});
|
|
91907
|
+
const shouldMountChildrenOnDom = unmountOnHidden ? isVisible : true;
|
|
91908
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91909
|
+
children: [
|
|
91910
|
+
!preferredOrientations.includes(curOrientation) && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
91911
|
+
open: true,
|
|
91912
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent$1, {
|
|
91913
|
+
children: t('wrong_orientation')
|
|
91914
|
+
})
|
|
91915
|
+
}),
|
|
91916
|
+
shouldMountChildrenOnDom && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper$1, {
|
|
91917
|
+
$showChildren: hasCorrectOrientation,
|
|
91918
|
+
children: children
|
|
91919
|
+
})
|
|
91920
|
+
]
|
|
91921
|
+
});
|
|
91922
|
+
}
|
|
91923
|
+
|
|
91924
|
+
const PopupContent = dt$1.div`
|
|
91925
|
+
text-align: center;
|
|
91926
|
+
font-size: 20px;
|
|
91927
|
+
font-weight: 600;
|
|
91928
|
+
`;
|
|
91929
|
+
const ChildrenWrapper = dt$1.div`
|
|
91930
|
+
width: 100%;
|
|
91931
|
+
height: 100%;
|
|
91932
|
+
opacity: ${({ showChildren })=>showChildren ? 1 : 0};
|
|
91933
|
+
`;
|
|
91934
|
+
// eslint-disable-next-line react/require-default-props
|
|
91935
|
+
function OrientationDetectionV1({ onOrientationChange, unmountOnHidden, children }) {
|
|
91936
|
+
const t = gB();
|
|
91937
|
+
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
91938
|
+
const shouldShowChildren = curOrientation === MODE.PORTRAIT || curOrientation === MODE.DESKTOP;
|
|
91939
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91940
|
+
children: [
|
|
91941
|
+
curOrientation === MODE.LANDSCAPE && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
91942
|
+
open: true,
|
|
91943
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent, {
|
|
91944
|
+
children: t('wrong_orientation')
|
|
91945
|
+
})
|
|
91946
|
+
}),
|
|
91947
|
+
(unmountOnHidden ? shouldShowChildren : true) && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper, {
|
|
91948
|
+
showChildren: shouldShowChildren,
|
|
91949
|
+
children: children
|
|
91950
|
+
})
|
|
91951
|
+
]
|
|
91952
|
+
});
|
|
91953
|
+
}
|
|
91954
|
+
OrientationDetectionV1.defaultProps = {
|
|
91955
|
+
onOrientationChange: ()=>{},
|
|
91956
|
+
unmountOnHidden: false
|
|
91957
|
+
};
|
|
91958
|
+
OrientationDetectionV1.propTypes = {
|
|
91959
|
+
onOrientationChange: PropTypes.func,
|
|
91960
|
+
unmountOnHidden: PropTypes.bool
|
|
91961
|
+
};
|
|
91962
|
+
|
|
91963
|
+
function OrientationDetection({ version = 'v1', children, ...rest }) {
|
|
91964
|
+
if (version === 'v2') {
|
|
91965
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV2, {
|
|
91966
|
+
...rest,
|
|
91967
|
+
children: children
|
|
91968
|
+
});
|
|
91969
|
+
}
|
|
91970
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV1, {
|
|
91971
|
+
...rest,
|
|
91972
|
+
children: children
|
|
91973
|
+
});
|
|
91974
|
+
}
|
|
91975
|
+
|
|
91986
91976
|
// eslint-disable-next-line react/require-default-props
|
|
91987
91977
|
const FlashLiveness = (props)=>{
|
|
91988
91978
|
const { apiCredentials, outputEncryptionSettings, mode } = props;
|
|
91989
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(
|
|
91990
|
-
|
|
91991
|
-
|
|
91992
|
-
|
|
91993
|
-
|
|
91994
|
-
|
|
91995
|
-
|
|
91996
|
-
|
|
91979
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
91980
|
+
version: "v2",
|
|
91981
|
+
unmountOnHidden: true,
|
|
91982
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(ApiClientProvider, {
|
|
91983
|
+
apiCredentials: apiCredentials,
|
|
91984
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(FlashModeProvider, {
|
|
91985
|
+
flashMode: mode,
|
|
91986
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(OutputEncryptionProvider, {
|
|
91987
|
+
settings: outputEncryptionSettings,
|
|
91988
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(FlashLivenessContainer, {
|
|
91989
|
+
...props
|
|
91990
|
+
})
|
|
91997
91991
|
})
|
|
91998
91992
|
})
|
|
91999
91993
|
})
|
|
@@ -110712,13 +110706,11 @@
|
|
|
110712
110706
|
}
|
|
110713
110707
|
return apiClient.detectIDTampering(payload);
|
|
110714
110708
|
}
|
|
110715
|
-
async function readIdCard({ cardType, apiClient,
|
|
110709
|
+
async function readIdCard({ cardType, apiClient, cardImageId, qrImageId }) {
|
|
110716
110710
|
const payload = {
|
|
110717
110711
|
card_type: cardType,
|
|
110718
|
-
image1:
|
|
110719
|
-
id:
|
|
110720
|
-
} : {
|
|
110721
|
-
id: backCardId
|
|
110712
|
+
image1: {
|
|
110713
|
+
id: cardImageId
|
|
110722
110714
|
}
|
|
110723
110715
|
};
|
|
110724
110716
|
if (qrImageId) {
|
|
@@ -110731,10 +110723,6 @@
|
|
|
110731
110723
|
return apiClient.readIDCard(payload);
|
|
110732
110724
|
}
|
|
110733
110725
|
async function handleApiCheck({ image, frontCardId: existingFrontCardId, qrImageId: existingQRImageId, onError, recordedVideos, apiClient, cardType, cardSide, qrScannedResult, outputEncryptionSettings, enabledServices, fullVideo, capturingVideo, previousCapturingVideoId, previousFullVideoId }) {
|
|
110734
|
-
if (cardSide === IDCardSide$2.BACK && !existingFrontCardId) {
|
|
110735
|
-
onError(Errors$3.missing_front_id_card);
|
|
110736
|
-
return;
|
|
110737
|
-
}
|
|
110738
110726
|
const uploadPromises = [
|
|
110739
110727
|
uploadIdCard({
|
|
110740
110728
|
image,
|
|
@@ -110774,15 +110762,6 @@
|
|
|
110774
110762
|
}
|
|
110775
110763
|
const imageId = uploadIdCardResult.data.image_id;
|
|
110776
110764
|
const qrImageId = uploadQrResult?.data?.image_id || existingQRImageId;
|
|
110777
|
-
let frontCardId;
|
|
110778
|
-
let backCardId;
|
|
110779
|
-
const isCapturingFrontSide = cardSide === IDCardSide$2.FRONT;
|
|
110780
|
-
if (isCapturingFrontSide) {
|
|
110781
|
-
frontCardId = imageId;
|
|
110782
|
-
} else {
|
|
110783
|
-
frontCardId = existingFrontCardId;
|
|
110784
|
-
backCardId = imageId;
|
|
110785
|
-
}
|
|
110786
110765
|
const sanityResult = {
|
|
110787
110766
|
data: null
|
|
110788
110767
|
};
|
|
@@ -110808,9 +110787,7 @@
|
|
|
110808
110787
|
const result = await readIdCard({
|
|
110809
110788
|
cardType,
|
|
110810
110789
|
apiClient,
|
|
110811
|
-
|
|
110812
|
-
backCardId,
|
|
110813
|
-
isCapturingFrontSide,
|
|
110790
|
+
cardImageId: imageId,
|
|
110814
110791
|
qrImageId
|
|
110815
110792
|
});
|
|
110816
110793
|
if (result.errors) {
|
|
@@ -110828,6 +110805,20 @@
|
|
|
110828
110805
|
data: null
|
|
110829
110806
|
};
|
|
110830
110807
|
if (enabledServices?.enableDetectIDCardTampering) {
|
|
110808
|
+
// Detect ID Tampering requires front ID card image
|
|
110809
|
+
if (cardSide === IDCardSide$2.BACK && !existingFrontCardId) {
|
|
110810
|
+
onError(Errors$3.missing_front_id_card);
|
|
110811
|
+
return;
|
|
110812
|
+
}
|
|
110813
|
+
let frontCardId;
|
|
110814
|
+
let backCardId;
|
|
110815
|
+
const isCapturingFrontSide = cardSide === IDCardSide$2.FRONT;
|
|
110816
|
+
if (isCapturingFrontSide) {
|
|
110817
|
+
frontCardId = imageId;
|
|
110818
|
+
} else {
|
|
110819
|
+
frontCardId = existingFrontCardId;
|
|
110820
|
+
backCardId = imageId;
|
|
110821
|
+
}
|
|
110831
110822
|
const result = await detectIDTampering({
|
|
110832
110823
|
apiClient,
|
|
110833
110824
|
cardType,
|
|
@@ -110867,8 +110858,8 @@
|
|
|
110867
110858
|
const { Errors: Errors$2 } = ra$1;
|
|
110868
110859
|
// eslint-disable-next-line react/require-default-props
|
|
110869
110860
|
const ReadIDCardWithApiCall = ({ readIDCardUIOnlyComponent: ReadIDCardUIOnly, ...props })=>{
|
|
110870
|
-
const { onError: onErrorFromProp, onStepDone: onStepDoneFromProp, apiCredentials, logCredentials, outputEncryptionSettings, serviceSettings, flowId, ...rest } = props;
|
|
110871
|
-
const [clientSettings, setClientSettings] = reactExports.useState(
|
|
110861
|
+
const { onError: onErrorFromProp, onStepDone: onStepDoneFromProp, apiCredentials, logCredentials, outputEncryptionSettings, serviceSettings, flowId, clientSettings: propClientSettings, ...rest } = props;
|
|
110862
|
+
const [clientSettings, setClientSettings] = reactExports.useState(propClientSettings);
|
|
110872
110863
|
const [isClientSettingsFetched, setIsClientSettingsFetched] = reactExports.useState(false);
|
|
110873
110864
|
const { apiClient } = fU.useApiClient({
|
|
110874
110865
|
apiCredentials,
|
|
@@ -111032,7 +111023,7 @@
|
|
|
111032
111023
|
onStepDoneWithBilling,
|
|
111033
111024
|
outputEncryptionSettings
|
|
111034
111025
|
]);
|
|
111035
|
-
if (!isClientSettingsFetched) {
|
|
111026
|
+
if (enabledServices.enableGetClientSettings && !isClientSettingsFetched) {
|
|
111036
111027
|
return null;
|
|
111037
111028
|
}
|
|
111038
111029
|
return /*#__PURE__*/ jsxRuntimeExports.jsx(dV.LicenseProvider, {
|
|
@@ -111063,7 +111054,8 @@
|
|
|
111063
111054
|
outputEncryptionSettings: PropTypes.shape({}),
|
|
111064
111055
|
readIDCardUIOnlyComponent: PropTypes.func,
|
|
111065
111056
|
serviceSettings: PropTypes.shape({}),
|
|
111066
|
-
flowId: PropTypes.string
|
|
111057
|
+
flowId: PropTypes.string,
|
|
111058
|
+
clientSettings: PropTypes.shape({})
|
|
111067
111059
|
};
|
|
111068
111060
|
ReadIDCardWithApiCall.defaultProps = {
|
|
111069
111061
|
onError: ()=>{},
|
|
@@ -111089,7 +111081,8 @@
|
|
|
111089
111081
|
enableDetectIDCardTampering: true,
|
|
111090
111082
|
enableReadIDCardInfo: true
|
|
111091
111083
|
},
|
|
111092
|
-
flowId: ''
|
|
111084
|
+
flowId: '',
|
|
111085
|
+
clientSettings: null
|
|
111093
111086
|
};
|
|
111094
111087
|
|
|
111095
111088
|
/**
|
|
@@ -114495,7 +114488,7 @@
|
|
|
114495
114488
|
});
|
|
114496
114489
|
}
|
|
114497
114490
|
|
|
114498
|
-
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.msb/0.0.0-beta.
|
|
114491
|
+
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk.msb/0.0.0-beta.20260113-112310/assets";
|
|
114499
114492
|
class TVWebSDK extends gU {
|
|
114500
114493
|
constructor(props){
|
|
114501
114494
|
super({
|