@tsocial/tvweb-sdk 5.34.5 → 5.34.6
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 +50 -50
- package/build/tvweb-sdk.esm.min.js +50 -50
- package/build/tvweb-sdk.standalone.js +250 -254
- package/build/tvweb-sdk.standalone.min.js +50 -50
- package/package.json +5 -5
|
@@ -33783,7 +33783,7 @@
|
|
|
33783
33783
|
}, nS$1;
|
|
33784
33784
|
}();
|
|
33785
33785
|
function nB$1() {
|
|
33786
|
-
return "5.34.
|
|
33786
|
+
return "5.34.6";
|
|
33787
33787
|
}
|
|
33788
33788
|
function nI$1() {
|
|
33789
33789
|
return {
|
|
@@ -41259,51 +41259,53 @@
|
|
|
41259
41259
|
}, uz;
|
|
41260
41260
|
}(), uG);
|
|
41261
41261
|
}();
|
|
41262
|
-
let dm = dg;
|
|
41263
|
-
function dg(e, t) {
|
|
41264
|
-
let r = dv();
|
|
41265
|
-
return (dg = function(e, t) {
|
|
41266
|
-
return r[e -= 187];
|
|
41267
|
-
})(e, t);
|
|
41268
|
-
}
|
|
41269
|
-
let dy = dg, db = dv();
|
|
41262
|
+
let dm = dv, dg = dv, dy = dx();
|
|
41270
41263
|
for(;;)try {
|
|
41271
|
-
if (-parseInt(
|
|
41272
|
-
|
|
41264
|
+
if (-parseInt(dg(400)) / 1 + -parseInt(dg(412)) / 2 * (parseInt(dg(413)) / 3) + -parseInt(dg(398)) / 4 + parseInt(dg(393)) / 5 * (-parseInt(dg(403)) / 6) + -parseInt(dg(414)) / 7 + parseInt(dg(404)) / 8 * (-parseInt(dg(405)) / 9) + parseInt(dg(410)) / 10 === 675039) break;
|
|
41265
|
+
dy.push(dy.shift());
|
|
41273
41266
|
} catch (e) {
|
|
41274
|
-
|
|
41267
|
+
dy.push(dy.shift());
|
|
41268
|
+
}
|
|
41269
|
+
let db = dm(399) + dm(397) + "3d02010608" + dm(402) + dm(409) + dm(417);
|
|
41270
|
+
function dv(e, t) {
|
|
41271
|
+
let r = dx();
|
|
41272
|
+
return (dv = function(e, t) {
|
|
41273
|
+
return r[e -= 393];
|
|
41274
|
+
})(e, t);
|
|
41275
41275
|
}
|
|
41276
|
-
|
|
41276
|
+
let d_ = dm(396) + dm(415) + dm(406) + dm(407) + dm(416) + dm(394) + "+faHkP3QC3" + dm(408) + dm(411) + "D9EKOWS+U4" + dm(395) + dm(401) + "KA==";
|
|
41277
|
+
function dx() {
|
|
41277
41278
|
let e = [
|
|
41278
|
-
"
|
|
41279
|
-
"
|
|
41280
|
-
"
|
|
41281
|
-
"ytJdcsPxrD",
|
|
41279
|
+
"754034MVAlGX",
|
|
41280
|
+
"9qfvzvF",
|
|
41281
|
+
"9231341WBMLOs",
|
|
41282
41282
|
"ZIzj0CAQYI",
|
|
41283
|
-
"
|
|
41284
|
-
"78oZoJhH",
|
|
41285
|
-
"2a8648ce3d",
|
|
41283
|
+
"DepBO8t60S",
|
|
41286
41284
|
"000",
|
|
41287
|
-
"
|
|
41288
|
-
"
|
|
41289
|
-
"
|
|
41290
|
-
"Mjci1ul8mm",
|
|
41291
|
-
"37124379gQRvRs",
|
|
41285
|
+
"575PumApD",
|
|
41286
|
+
"ytJdcsPxrD",
|
|
41287
|
+
"MfPrcYTM70",
|
|
41292
41288
|
"MFkwEwYHKo",
|
|
41293
|
-
"
|
|
41294
|
-
"
|
|
41295
|
-
"
|
|
41296
|
-
"
|
|
41297
|
-
"
|
|
41289
|
+
"072a8648ce",
|
|
41290
|
+
"4960704BbpIae",
|
|
41291
|
+
"3059301306",
|
|
41292
|
+
"1049264TQjxFs",
|
|
41293
|
+
"ssRdXLZEX8",
|
|
41294
|
+
"2a8648ce3d",
|
|
41295
|
+
"12156RnmUwF",
|
|
41296
|
+
"40rodesL",
|
|
41297
|
+
"1651338WhfRhr",
|
|
41298
|
+
"KoZIzj0DAQ",
|
|
41298
41299
|
"cDQgAE9h6Z",
|
|
41299
|
-
"
|
|
41300
|
-
"
|
|
41300
|
+
"44P0rKKsZK",
|
|
41301
|
+
"0301070342",
|
|
41302
|
+
"65646930BDCMCU",
|
|
41303
|
+
"Mjci1ul8mm"
|
|
41301
41304
|
];
|
|
41302
|
-
return (
|
|
41305
|
+
return (dx = function() {
|
|
41303
41306
|
return e;
|
|
41304
41307
|
})();
|
|
41305
41308
|
}
|
|
41306
|
-
let d_ = dm(206) + "072a8648ce3d02010608" + dm(204) + dm(198) + dm(205), dx = dm(188) + dm(201) + dm(199) + dm(194) + dm(193) + dm(200) + dm(208) + dm(202) + dm(209) + "D9EKOWS+U4MfPrcYTM70" + dm(197) + "KA==";
|
|
41307
41309
|
async function dC(e) {
|
|
41308
41310
|
let t = new TextEncoder().encode(e);
|
|
41309
41311
|
return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", t))).map((e)=>e.toString(16).padStart(2, "0")).join("");
|
|
@@ -41408,7 +41410,7 @@
|
|
|
41408
41410
|
isValid: !1,
|
|
41409
41411
|
error: i0$1.invalid_license
|
|
41410
41412
|
};
|
|
41411
|
-
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t ||
|
|
41413
|
+
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t || d_, n = i4$1(r).replace(db, ""), i = new dp.ec("p256").keyFromPublic(n, "hex"), {
|
|
41412
41414
|
verifySignature: async (e, t)=>{
|
|
41413
41415
|
try {
|
|
41414
41416
|
let r = await dC(e), n = i4$1(t);
|
|
@@ -45322,7 +45324,7 @@
|
|
|
45322
45324
|
return this.getKey().getPublicKey();
|
|
45323
45325
|
}, e.prototype.getPublicKeyB64 = function() {
|
|
45324
45326
|
return this.getKey().getPublicBaseKeyB64();
|
|
45325
|
-
}, e.version = "5.34.
|
|
45327
|
+
}, e.version = "5.34.5", e;
|
|
45326
45328
|
}();
|
|
45327
45329
|
let hO = [
|
|
45328
45330
|
"-",
|
|
@@ -88698,204 +88700,6 @@
|
|
|
88698
88700
|
return videoCanvas;
|
|
88699
88701
|
};
|
|
88700
88702
|
|
|
88701
|
-
const MODE = {
|
|
88702
|
-
LANDSCAPE: 'landscape',
|
|
88703
|
-
PORTRAIT: 'portrait',
|
|
88704
|
-
DESKTOP: 'desktop'
|
|
88705
|
-
};
|
|
88706
|
-
const useDetectOrientation = (onOrientationChange)=>{
|
|
88707
|
-
const portraitQuery = reactExports.useRef(window.matchMedia('(orientation: portrait)'));
|
|
88708
|
-
const initOrientation = reactExports.useRef(portraitQuery.current.matches ? MODE.PORTRAIT : MODE.LANDSCAPE);
|
|
88709
|
-
const [curOrientation, setCurOrientation] = reactExports.useState(initOrientation.current);
|
|
88710
|
-
reactExports.useEffect(()=>{
|
|
88711
|
-
function handleResizeForScreen() {
|
|
88712
|
-
const orientationType = get(screen, 'orientation.type')?.split('-')?.[0];
|
|
88713
|
-
setCurOrientation(orientationType);
|
|
88714
|
-
if (typeof onOrientationChange === 'function') {
|
|
88715
|
-
onOrientationChange(orientationType);
|
|
88716
|
-
}
|
|
88717
|
-
}
|
|
88718
|
-
function handleResizeForQuery(e) {
|
|
88719
|
-
let orientation;
|
|
88720
|
-
if (e.matches) {
|
|
88721
|
-
orientation = MODE.PORTRAIT;
|
|
88722
|
-
} else {
|
|
88723
|
-
orientation = MODE.LANDSCAPE;
|
|
88724
|
-
}
|
|
88725
|
-
setCurOrientation(orientation);
|
|
88726
|
-
if (typeof onOrientationChange === 'function') {
|
|
88727
|
-
onOrientationChange(orientation);
|
|
88728
|
-
}
|
|
88729
|
-
}
|
|
88730
|
-
if (screen.orientation) {
|
|
88731
|
-
screen.orientation.addEventListener('change', handleResizeForScreen);
|
|
88732
|
-
} else {
|
|
88733
|
-
// screen.orientation only available on ios > 16.4
|
|
88734
|
-
// fallback to window.matchMedia
|
|
88735
|
-
portraitQuery.current.addEventListener('change', handleResizeForQuery);
|
|
88736
|
-
}
|
|
88737
|
-
return ()=>{
|
|
88738
|
-
if (screen.orientation) {
|
|
88739
|
-
screen.orientation.removeEventListener('change', handleResizeForScreen);
|
|
88740
|
-
} else {
|
|
88741
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
88742
|
-
portraitQuery.current.removeEventListener('change', handleResizeForQuery);
|
|
88743
|
-
}
|
|
88744
|
-
};
|
|
88745
|
-
}, [
|
|
88746
|
-
onOrientationChange
|
|
88747
|
-
]);
|
|
88748
|
-
return libExports.isMobile ? {
|
|
88749
|
-
curOrientation,
|
|
88750
|
-
initOrientation: initOrientation.current
|
|
88751
|
-
} : {
|
|
88752
|
-
curOrientation: MODE.DESKTOP
|
|
88753
|
-
};
|
|
88754
|
-
};
|
|
88755
|
-
|
|
88756
|
-
/**
|
|
88757
|
-
* Custom hook to delay rendering when transitioning from hidden to visible state.
|
|
88758
|
-
* Useful for waiting for browser dimension updates after orientation changes.
|
|
88759
|
-
*
|
|
88760
|
-
* @param params - Hook parameters
|
|
88761
|
-
* @param params.isVisible - Whether the component is currently visible
|
|
88762
|
-
* @param params.enableDelay - Whether to apply delay logic for show transitions
|
|
88763
|
-
* @param params.delayMs - Delay in milliseconds before showing (default: 500)
|
|
88764
|
-
* @returns Delayed visibility state
|
|
88765
|
-
*/ function useDelayedRender({ isVisible, enableDelay, delayMs = 500 }) {
|
|
88766
|
-
const [isVisibleDelayed, setIsVisibleDelayed] = reactExports.useState(isVisible);
|
|
88767
|
-
const prevIsVisibleRef = reactExports.useRef(isVisible);
|
|
88768
|
-
const timeoutRef = reactExports.useRef(null);
|
|
88769
|
-
reactExports.useEffect(()=>{
|
|
88770
|
-
const prevIsVisible = prevIsVisibleRef.current;
|
|
88771
|
-
// When delay is disabled, always sync immediately
|
|
88772
|
-
if (!enableDelay) {
|
|
88773
|
-
setIsVisibleDelayed(isVisible);
|
|
88774
|
-
prevIsVisibleRef.current = isVisible;
|
|
88775
|
-
return undefined;
|
|
88776
|
-
}
|
|
88777
|
-
// Handle transitions when delay is enabled
|
|
88778
|
-
const isTransitionToShow = !prevIsVisible && isVisible;
|
|
88779
|
-
const isTransitionToHide = prevIsVisible && !isVisible;
|
|
88780
|
-
if (isTransitionToShow) {
|
|
88781
|
-
// Delay showing when transitioning from hidden to visible
|
|
88782
|
-
timeoutRef.current = setTimeout(()=>{
|
|
88783
|
-
setIsVisibleDelayed(true);
|
|
88784
|
-
}, delayMs);
|
|
88785
|
-
} else if (isTransitionToHide) {
|
|
88786
|
-
// Immediately hide and cancel pending show
|
|
88787
|
-
if (timeoutRef.current) {
|
|
88788
|
-
clearTimeout(timeoutRef.current);
|
|
88789
|
-
timeoutRef.current = null;
|
|
88790
|
-
}
|
|
88791
|
-
setIsVisibleDelayed(false);
|
|
88792
|
-
}
|
|
88793
|
-
prevIsVisibleRef.current = isVisible;
|
|
88794
|
-
return ()=>{
|
|
88795
|
-
if (timeoutRef.current) {
|
|
88796
|
-
clearTimeout(timeoutRef.current);
|
|
88797
|
-
}
|
|
88798
|
-
};
|
|
88799
|
-
}, [
|
|
88800
|
-
isVisible,
|
|
88801
|
-
enableDelay,
|
|
88802
|
-
delayMs
|
|
88803
|
-
]);
|
|
88804
|
-
return isVisibleDelayed;
|
|
88805
|
-
}
|
|
88806
|
-
|
|
88807
|
-
const PopupContent$1 = dt$1.div`
|
|
88808
|
-
text-align: center;
|
|
88809
|
-
font-size: 20px;
|
|
88810
|
-
font-weight: 600;
|
|
88811
|
-
`;
|
|
88812
|
-
const ChildrenWrapper$1 = dt$1.div`
|
|
88813
|
-
width: 100%;
|
|
88814
|
-
height: 100%;
|
|
88815
|
-
opacity: ${({ $showChildren })=>$showChildren ? 1 : 0};
|
|
88816
|
-
`;
|
|
88817
|
-
const defaultPreferredOrientations = [
|
|
88818
|
-
MODE.PORTRAIT,
|
|
88819
|
-
MODE.DESKTOP
|
|
88820
|
-
];
|
|
88821
|
-
function OrientationDetectionV2({ onOrientationChange = noop$1, unmountOnHidden = false, remountDelayMs = 500, preferredOrientations = defaultPreferredOrientations, children }) {
|
|
88822
|
-
const t = gB();
|
|
88823
|
-
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
88824
|
-
const hasCorrectOrientation = preferredOrientations.includes(curOrientation);
|
|
88825
|
-
const isVisible = useDelayedRender({
|
|
88826
|
-
isVisible: hasCorrectOrientation,
|
|
88827
|
-
enableDelay: unmountOnHidden,
|
|
88828
|
-
delayMs: remountDelayMs
|
|
88829
|
-
});
|
|
88830
|
-
const shouldMountChildrenOnDom = unmountOnHidden ? isVisible : true;
|
|
88831
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
88832
|
-
children: [
|
|
88833
|
-
!preferredOrientations.includes(curOrientation) && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
88834
|
-
open: true,
|
|
88835
|
-
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent$1, {
|
|
88836
|
-
children: t('wrong_orientation')
|
|
88837
|
-
})
|
|
88838
|
-
}),
|
|
88839
|
-
shouldMountChildrenOnDom && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper$1, {
|
|
88840
|
-
$showChildren: hasCorrectOrientation,
|
|
88841
|
-
children: children
|
|
88842
|
-
})
|
|
88843
|
-
]
|
|
88844
|
-
});
|
|
88845
|
-
}
|
|
88846
|
-
|
|
88847
|
-
const PopupContent = dt$1.div`
|
|
88848
|
-
text-align: center;
|
|
88849
|
-
font-size: 20px;
|
|
88850
|
-
font-weight: 600;
|
|
88851
|
-
`;
|
|
88852
|
-
const ChildrenWrapper = dt$1.div`
|
|
88853
|
-
width: 100%;
|
|
88854
|
-
height: 100%;
|
|
88855
|
-
opacity: ${({ showChildren })=>showChildren ? 1 : 0};
|
|
88856
|
-
`;
|
|
88857
|
-
// eslint-disable-next-line react/require-default-props
|
|
88858
|
-
function OrientationDetectionV1({ onOrientationChange, unmountOnHidden, children }) {
|
|
88859
|
-
const t = gB();
|
|
88860
|
-
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
88861
|
-
const shouldShowChildren = curOrientation === MODE.PORTRAIT || curOrientation === MODE.DESKTOP;
|
|
88862
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
88863
|
-
children: [
|
|
88864
|
-
curOrientation === MODE.LANDSCAPE && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
88865
|
-
open: true,
|
|
88866
|
-
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent, {
|
|
88867
|
-
children: t('wrong_orientation')
|
|
88868
|
-
})
|
|
88869
|
-
}),
|
|
88870
|
-
(unmountOnHidden ? shouldShowChildren : true) && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper, {
|
|
88871
|
-
showChildren: shouldShowChildren,
|
|
88872
|
-
children: children
|
|
88873
|
-
})
|
|
88874
|
-
]
|
|
88875
|
-
});
|
|
88876
|
-
}
|
|
88877
|
-
OrientationDetectionV1.defaultProps = {
|
|
88878
|
-
onOrientationChange: ()=>{},
|
|
88879
|
-
unmountOnHidden: false
|
|
88880
|
-
};
|
|
88881
|
-
OrientationDetectionV1.propTypes = {
|
|
88882
|
-
onOrientationChange: PropTypes.func,
|
|
88883
|
-
unmountOnHidden: PropTypes.bool
|
|
88884
|
-
};
|
|
88885
|
-
|
|
88886
|
-
function OrientationDetection({ version = 'v1', children, ...rest }) {
|
|
88887
|
-
if (version === 'v2') {
|
|
88888
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV2, {
|
|
88889
|
-
...rest,
|
|
88890
|
-
children: children
|
|
88891
|
-
});
|
|
88892
|
-
}
|
|
88893
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV1, {
|
|
88894
|
-
...rest,
|
|
88895
|
-
children: children
|
|
88896
|
-
});
|
|
88897
|
-
}
|
|
88898
|
-
|
|
88899
88703
|
const useEkycSession = ()=>{
|
|
88900
88704
|
const [sessionId, setSessionId] = reactExports.useState(Date.now());
|
|
88901
88705
|
const updateSessionId = reactExports.useCallback(()=>{
|
|
@@ -91387,15 +91191,6 @@
|
|
|
91387
91191
|
useRunEffectWhen(()=>logEvent('selfie_flash', 'user_activity.start_flash'), step === STEP.START_FLASHING);
|
|
91388
91192
|
const progressPercentage = colorIndex === STOP_COLOR ? 0 : Math.min(Math.round((colorIndex + 1) / (colors.length * framesPerColor) * 100), 100);
|
|
91389
91193
|
const { Loading } = styledComponent;
|
|
91390
|
-
const onOrientationChange = reactExports.useCallback((curOrientation)=>{
|
|
91391
|
-
if (curOrientation === MODE.LANDSCAPE) {
|
|
91392
|
-
videoRef.current?.pause();
|
|
91393
|
-
} else {
|
|
91394
|
-
videoRef.current?.play();
|
|
91395
|
-
}
|
|
91396
|
-
}, [
|
|
91397
|
-
videoRef
|
|
91398
|
-
]);
|
|
91399
91194
|
// ============================= Timer =============================
|
|
91400
91195
|
const onTimeout = reactExports.useCallback(()=>{
|
|
91401
91196
|
setIsAutoCapturing(false);
|
|
@@ -91432,8 +91227,7 @@
|
|
|
91432
91227
|
const errorMessage = getErrorMessage(faceError);
|
|
91433
91228
|
// error message should be centered in the oval
|
|
91434
91229
|
const errorY = cropArea.y + cropArea.height / 2 + ovalVerticalOffset;
|
|
91435
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsxs(
|
|
91436
|
-
onOrientationChange: onOrientationChange,
|
|
91230
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91437
91231
|
children: [
|
|
91438
91232
|
/*#__PURE__*/ jsxRuntimeExports.jsx(NormalCamera, {
|
|
91439
91233
|
frontCamera: frontCamera,
|
|
@@ -91919,17 +91713,219 @@
|
|
|
91919
91713
|
});
|
|
91920
91714
|
};
|
|
91921
91715
|
|
|
91716
|
+
const MODE = {
|
|
91717
|
+
LANDSCAPE: 'landscape',
|
|
91718
|
+
PORTRAIT: 'portrait',
|
|
91719
|
+
DESKTOP: 'desktop'
|
|
91720
|
+
};
|
|
91721
|
+
const useDetectOrientation = (onOrientationChange)=>{
|
|
91722
|
+
const portraitQuery = reactExports.useRef(window.matchMedia('(orientation: portrait)'));
|
|
91723
|
+
const initOrientation = reactExports.useRef(portraitQuery.current.matches ? MODE.PORTRAIT : MODE.LANDSCAPE);
|
|
91724
|
+
const [curOrientation, setCurOrientation] = reactExports.useState(initOrientation.current);
|
|
91725
|
+
reactExports.useEffect(()=>{
|
|
91726
|
+
function handleResizeForScreen() {
|
|
91727
|
+
const orientationType = get(screen, 'orientation.type')?.split('-')?.[0];
|
|
91728
|
+
setCurOrientation(orientationType);
|
|
91729
|
+
if (typeof onOrientationChange === 'function') {
|
|
91730
|
+
onOrientationChange(orientationType);
|
|
91731
|
+
}
|
|
91732
|
+
}
|
|
91733
|
+
function handleResizeForQuery(e) {
|
|
91734
|
+
let orientation;
|
|
91735
|
+
if (e.matches) {
|
|
91736
|
+
orientation = MODE.PORTRAIT;
|
|
91737
|
+
} else {
|
|
91738
|
+
orientation = MODE.LANDSCAPE;
|
|
91739
|
+
}
|
|
91740
|
+
setCurOrientation(orientation);
|
|
91741
|
+
if (typeof onOrientationChange === 'function') {
|
|
91742
|
+
onOrientationChange(orientation);
|
|
91743
|
+
}
|
|
91744
|
+
}
|
|
91745
|
+
if (screen.orientation) {
|
|
91746
|
+
screen.orientation.addEventListener('change', handleResizeForScreen);
|
|
91747
|
+
} else {
|
|
91748
|
+
// screen.orientation only available on ios > 16.4
|
|
91749
|
+
// fallback to window.matchMedia
|
|
91750
|
+
portraitQuery.current.addEventListener('change', handleResizeForQuery);
|
|
91751
|
+
}
|
|
91752
|
+
return ()=>{
|
|
91753
|
+
if (screen.orientation) {
|
|
91754
|
+
screen.orientation.removeEventListener('change', handleResizeForScreen);
|
|
91755
|
+
} else {
|
|
91756
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91757
|
+
portraitQuery.current.removeEventListener('change', handleResizeForQuery);
|
|
91758
|
+
}
|
|
91759
|
+
};
|
|
91760
|
+
}, [
|
|
91761
|
+
onOrientationChange
|
|
91762
|
+
]);
|
|
91763
|
+
return libExports.isMobile ? {
|
|
91764
|
+
curOrientation,
|
|
91765
|
+
initOrientation: initOrientation.current
|
|
91766
|
+
} : {
|
|
91767
|
+
curOrientation: MODE.DESKTOP
|
|
91768
|
+
};
|
|
91769
|
+
};
|
|
91770
|
+
|
|
91771
|
+
/**
|
|
91772
|
+
* Custom hook to delay rendering when transitioning from hidden to visible state.
|
|
91773
|
+
* Useful for waiting for browser dimension updates after orientation changes.
|
|
91774
|
+
*
|
|
91775
|
+
* @param params - Hook parameters
|
|
91776
|
+
* @param params.isVisible - Whether the component is currently visible
|
|
91777
|
+
* @param params.enableDelay - Whether to apply delay logic for show transitions
|
|
91778
|
+
* @param params.delayMs - Delay in milliseconds before showing (default: 500)
|
|
91779
|
+
* @returns Delayed visibility state
|
|
91780
|
+
*/ function useDelayedRender({ isVisible, enableDelay, delayMs = 500 }) {
|
|
91781
|
+
const [isVisibleDelayed, setIsVisibleDelayed] = reactExports.useState(isVisible);
|
|
91782
|
+
const prevIsVisibleRef = reactExports.useRef(isVisible);
|
|
91783
|
+
const timeoutRef = reactExports.useRef(null);
|
|
91784
|
+
reactExports.useEffect(()=>{
|
|
91785
|
+
const prevIsVisible = prevIsVisibleRef.current;
|
|
91786
|
+
// When delay is disabled, always sync immediately
|
|
91787
|
+
if (!enableDelay) {
|
|
91788
|
+
setIsVisibleDelayed(isVisible);
|
|
91789
|
+
prevIsVisibleRef.current = isVisible;
|
|
91790
|
+
return undefined;
|
|
91791
|
+
}
|
|
91792
|
+
// Handle transitions when delay is enabled
|
|
91793
|
+
const isTransitionToShow = !prevIsVisible && isVisible;
|
|
91794
|
+
const isTransitionToHide = prevIsVisible && !isVisible;
|
|
91795
|
+
if (isTransitionToShow) {
|
|
91796
|
+
// Delay showing when transitioning from hidden to visible
|
|
91797
|
+
timeoutRef.current = setTimeout(()=>{
|
|
91798
|
+
setIsVisibleDelayed(true);
|
|
91799
|
+
}, delayMs);
|
|
91800
|
+
} else if (isTransitionToHide) {
|
|
91801
|
+
// Immediately hide and cancel pending show
|
|
91802
|
+
if (timeoutRef.current) {
|
|
91803
|
+
clearTimeout(timeoutRef.current);
|
|
91804
|
+
timeoutRef.current = null;
|
|
91805
|
+
}
|
|
91806
|
+
setIsVisibleDelayed(false);
|
|
91807
|
+
}
|
|
91808
|
+
prevIsVisibleRef.current = isVisible;
|
|
91809
|
+
return ()=>{
|
|
91810
|
+
if (timeoutRef.current) {
|
|
91811
|
+
clearTimeout(timeoutRef.current);
|
|
91812
|
+
}
|
|
91813
|
+
};
|
|
91814
|
+
}, [
|
|
91815
|
+
isVisible,
|
|
91816
|
+
enableDelay,
|
|
91817
|
+
delayMs
|
|
91818
|
+
]);
|
|
91819
|
+
return isVisibleDelayed;
|
|
91820
|
+
}
|
|
91821
|
+
|
|
91822
|
+
const PopupContent$1 = dt$1.div`
|
|
91823
|
+
text-align: center;
|
|
91824
|
+
font-size: 20px;
|
|
91825
|
+
font-weight: 600;
|
|
91826
|
+
`;
|
|
91827
|
+
const ChildrenWrapper$1 = dt$1.div`
|
|
91828
|
+
width: 100%;
|
|
91829
|
+
height: 100%;
|
|
91830
|
+
opacity: ${({ $showChildren })=>$showChildren ? 1 : 0};
|
|
91831
|
+
`;
|
|
91832
|
+
const defaultPreferredOrientations = [
|
|
91833
|
+
MODE.PORTRAIT,
|
|
91834
|
+
MODE.DESKTOP
|
|
91835
|
+
];
|
|
91836
|
+
function OrientationDetectionV2({ onOrientationChange = noop$1, unmountOnHidden = false, remountDelayMs = 500, preferredOrientations = defaultPreferredOrientations, children }) {
|
|
91837
|
+
const t = gB();
|
|
91838
|
+
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
91839
|
+
const hasCorrectOrientation = preferredOrientations.includes(curOrientation);
|
|
91840
|
+
const isVisible = useDelayedRender({
|
|
91841
|
+
isVisible: hasCorrectOrientation,
|
|
91842
|
+
enableDelay: unmountOnHidden,
|
|
91843
|
+
delayMs: remountDelayMs
|
|
91844
|
+
});
|
|
91845
|
+
const shouldMountChildrenOnDom = unmountOnHidden ? isVisible : true;
|
|
91846
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91847
|
+
children: [
|
|
91848
|
+
!preferredOrientations.includes(curOrientation) && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
91849
|
+
open: true,
|
|
91850
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent$1, {
|
|
91851
|
+
children: t('wrong_orientation')
|
|
91852
|
+
})
|
|
91853
|
+
}),
|
|
91854
|
+
shouldMountChildrenOnDom && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper$1, {
|
|
91855
|
+
$showChildren: hasCorrectOrientation,
|
|
91856
|
+
children: children
|
|
91857
|
+
})
|
|
91858
|
+
]
|
|
91859
|
+
});
|
|
91860
|
+
}
|
|
91861
|
+
|
|
91862
|
+
const PopupContent = dt$1.div`
|
|
91863
|
+
text-align: center;
|
|
91864
|
+
font-size: 20px;
|
|
91865
|
+
font-weight: 600;
|
|
91866
|
+
`;
|
|
91867
|
+
const ChildrenWrapper = dt$1.div`
|
|
91868
|
+
width: 100%;
|
|
91869
|
+
height: 100%;
|
|
91870
|
+
opacity: ${({ showChildren })=>showChildren ? 1 : 0};
|
|
91871
|
+
`;
|
|
91872
|
+
// eslint-disable-next-line react/require-default-props
|
|
91873
|
+
function OrientationDetectionV1({ onOrientationChange, unmountOnHidden, children }) {
|
|
91874
|
+
const t = gB();
|
|
91875
|
+
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
91876
|
+
const shouldShowChildren = curOrientation === MODE.PORTRAIT || curOrientation === MODE.DESKTOP;
|
|
91877
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91878
|
+
children: [
|
|
91879
|
+
curOrientation === MODE.LANDSCAPE && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
91880
|
+
open: true,
|
|
91881
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent, {
|
|
91882
|
+
children: t('wrong_orientation')
|
|
91883
|
+
})
|
|
91884
|
+
}),
|
|
91885
|
+
(unmountOnHidden ? shouldShowChildren : true) && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper, {
|
|
91886
|
+
showChildren: shouldShowChildren,
|
|
91887
|
+
children: children
|
|
91888
|
+
})
|
|
91889
|
+
]
|
|
91890
|
+
});
|
|
91891
|
+
}
|
|
91892
|
+
OrientationDetectionV1.defaultProps = {
|
|
91893
|
+
onOrientationChange: ()=>{},
|
|
91894
|
+
unmountOnHidden: false
|
|
91895
|
+
};
|
|
91896
|
+
OrientationDetectionV1.propTypes = {
|
|
91897
|
+
onOrientationChange: PropTypes.func,
|
|
91898
|
+
unmountOnHidden: PropTypes.bool
|
|
91899
|
+
};
|
|
91900
|
+
|
|
91901
|
+
function OrientationDetection({ version = 'v1', children, ...rest }) {
|
|
91902
|
+
if (version === 'v2') {
|
|
91903
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV2, {
|
|
91904
|
+
...rest,
|
|
91905
|
+
children: children
|
|
91906
|
+
});
|
|
91907
|
+
}
|
|
91908
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV1, {
|
|
91909
|
+
...rest,
|
|
91910
|
+
children: children
|
|
91911
|
+
});
|
|
91912
|
+
}
|
|
91913
|
+
|
|
91922
91914
|
// eslint-disable-next-line react/require-default-props
|
|
91923
91915
|
const FlashLiveness = (props)=>{
|
|
91924
91916
|
const { apiCredentials, outputEncryptionSettings, mode } = props;
|
|
91925
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(
|
|
91926
|
-
|
|
91927
|
-
|
|
91928
|
-
|
|
91929
|
-
|
|
91930
|
-
|
|
91931
|
-
|
|
91932
|
-
|
|
91917
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
91918
|
+
version: "v2",
|
|
91919
|
+
unmountOnHidden: true,
|
|
91920
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(ApiClientProvider, {
|
|
91921
|
+
apiCredentials: apiCredentials,
|
|
91922
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(FlashModeProvider, {
|
|
91923
|
+
flashMode: mode,
|
|
91924
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(OutputEncryptionProvider, {
|
|
91925
|
+
settings: outputEncryptionSettings,
|
|
91926
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(FlashLivenessContainer, {
|
|
91927
|
+
...props
|
|
91928
|
+
})
|
|
91933
91929
|
})
|
|
91934
91930
|
})
|
|
91935
91931
|
})
|
|
@@ -113616,7 +113612,7 @@
|
|
|
113616
113612
|
};
|
|
113617
113613
|
};
|
|
113618
113614
|
|
|
113619
|
-
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk/5.34.
|
|
113615
|
+
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk/5.34.6/assets";
|
|
113620
113616
|
class TVWebSDK extends gU {
|
|
113621
113617
|
constructor(props){
|
|
113622
113618
|
super({
|