@tsocial/tvweb-sdk 5.34.5 → 5.34.7
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 +245 -253
- 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.7";
|
|
33787
33787
|
}
|
|
33788
33788
|
function nI$1() {
|
|
33789
33789
|
return {
|
|
@@ -41259,51 +41259,49 @@
|
|
|
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 = d_, dg = d_, dy = dv();
|
|
41270
41263
|
for(;;)try {
|
|
41271
|
-
if (
|
|
41272
|
-
|
|
41264
|
+
if (parseInt(dg(290)) / 1 + parseInt(dg(291)) / 2 + parseInt(dg(289)) / 3 * (parseInt(dg(298)) / 4) + parseInt(dg(293)) / 5 + parseInt(dg(292)) / 6 * (-parseInt(dg(299)) / 7) + -parseInt(dg(285)) / 8 + -parseInt(dg(295)) / 9 === 848564) break;
|
|
41265
|
+
dy.push(dy.shift());
|
|
41273
41266
|
} catch (e) {
|
|
41274
|
-
|
|
41267
|
+
dy.push(dy.shift());
|
|
41275
41268
|
}
|
|
41269
|
+
let db = dm(283) + dm(288) + dm(287) + "2a8648ce3d" + dm(286) + "000";
|
|
41276
41270
|
function dv() {
|
|
41277
41271
|
let e = [
|
|
41278
|
-
"ssRdXLZEX8",
|
|
41279
|
-
"0301070342",
|
|
41280
|
-
"KoZIzj0DAQ",
|
|
41281
|
-
"ytJdcsPxrD",
|
|
41282
41272
|
"ZIzj0CAQYI",
|
|
41283
|
-
"
|
|
41284
|
-
"
|
|
41285
|
-
"
|
|
41286
|
-
"000",
|
|
41273
|
+
"ytJdcsPxrD",
|
|
41274
|
+
"cDQgAE9h6Z",
|
|
41275
|
+
"KA==",
|
|
41287
41276
|
"3059301306",
|
|
41288
|
-
"5437410AYDgCq",
|
|
41289
|
-
"+faHkP3QC3",
|
|
41290
|
-
"Mjci1ul8mm",
|
|
41291
|
-
"37124379gQRvRs",
|
|
41292
|
-
"MFkwEwYHKo",
|
|
41293
|
-
"7ZYIbTa",
|
|
41294
|
-
"4421568SgMIDk",
|
|
41295
|
-
"1587704kuyojg",
|
|
41296
|
-
"850895lAaPpT",
|
|
41297
41277
|
"DepBO8t60S",
|
|
41298
|
-
"
|
|
41299
|
-
"
|
|
41300
|
-
"
|
|
41278
|
+
"5781856ASdVnB",
|
|
41279
|
+
"0301070342",
|
|
41280
|
+
"3d02010608",
|
|
41281
|
+
"072a8648ce",
|
|
41282
|
+
"4666479rjrWyS",
|
|
41283
|
+
"110707ijpBPi",
|
|
41284
|
+
"762470mjWkJP",
|
|
41285
|
+
"42mNPKlj",
|
|
41286
|
+
"3656320tEDxFW",
|
|
41287
|
+
"KoZIzj0DAQ",
|
|
41288
|
+
"9579789ARHRJm",
|
|
41289
|
+
"Mjci1ul8mm",
|
|
41290
|
+
"D9EKOWS+U4",
|
|
41291
|
+
"4jyWTrx",
|
|
41292
|
+
"142982jYbZDz"
|
|
41301
41293
|
];
|
|
41302
41294
|
return (dv = function() {
|
|
41303
41295
|
return e;
|
|
41304
41296
|
})();
|
|
41305
41297
|
}
|
|
41306
|
-
|
|
41298
|
+
function d_(e, t) {
|
|
41299
|
+
let r = dv();
|
|
41300
|
+
return (d_ = function(e, t) {
|
|
41301
|
+
return r[e -= 282];
|
|
41302
|
+
})(e, t);
|
|
41303
|
+
}
|
|
41304
|
+
let dx = "MFkwEwYHKo" + dm(300) + dm(294) + dm(302) + dm(284) + dm(301) + "+faHkP3QC344P0rKKsZK" + dm(296) + dm(297) + "MfPrcYTM70ssRdXLZEX8" + dm(282);
|
|
41307
41305
|
async function dC(e) {
|
|
41308
41306
|
let t = new TextEncoder().encode(e);
|
|
41309
41307
|
return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256", t))).map((e)=>e.toString(16).padStart(2, "0")).join("");
|
|
@@ -41408,7 +41406,7 @@
|
|
|
41408
41406
|
isValid: !1,
|
|
41409
41407
|
error: i0$1.invalid_license
|
|
41410
41408
|
};
|
|
41411
|
-
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t || dx, n = i4$1(r).replace(
|
|
41409
|
+
let { mode: a, license: o, signature: s } = dS(e), c = dw(i4$1(o)), l = (r = t || dx, n = i4$1(r).replace(db, ""), i = new dp.ec("p256").keyFromPublic(n, "hex"), {
|
|
41412
41410
|
verifySignature: async (e, t)=>{
|
|
41413
41411
|
try {
|
|
41414
41412
|
let r = await dC(e), n = i4$1(t);
|
|
@@ -45322,7 +45320,7 @@
|
|
|
45322
45320
|
return this.getKey().getPublicKey();
|
|
45323
45321
|
}, e.prototype.getPublicKeyB64 = function() {
|
|
45324
45322
|
return this.getKey().getPublicBaseKeyB64();
|
|
45325
|
-
}, e.version = "5.34.
|
|
45323
|
+
}, e.version = "5.34.6", e;
|
|
45326
45324
|
}();
|
|
45327
45325
|
let hO = [
|
|
45328
45326
|
"-",
|
|
@@ -88698,204 +88696,6 @@
|
|
|
88698
88696
|
return videoCanvas;
|
|
88699
88697
|
};
|
|
88700
88698
|
|
|
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
88699
|
const useEkycSession = ()=>{
|
|
88900
88700
|
const [sessionId, setSessionId] = reactExports.useState(Date.now());
|
|
88901
88701
|
const updateSessionId = reactExports.useCallback(()=>{
|
|
@@ -91387,15 +91187,6 @@
|
|
|
91387
91187
|
useRunEffectWhen(()=>logEvent('selfie_flash', 'user_activity.start_flash'), step === STEP.START_FLASHING);
|
|
91388
91188
|
const progressPercentage = colorIndex === STOP_COLOR ? 0 : Math.min(Math.round((colorIndex + 1) / (colors.length * framesPerColor) * 100), 100);
|
|
91389
91189
|
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
91190
|
// ============================= Timer =============================
|
|
91400
91191
|
const onTimeout = reactExports.useCallback(()=>{
|
|
91401
91192
|
setIsAutoCapturing(false);
|
|
@@ -91432,8 +91223,7 @@
|
|
|
91432
91223
|
const errorMessage = getErrorMessage(faceError);
|
|
91433
91224
|
// error message should be centered in the oval
|
|
91434
91225
|
const errorY = cropArea.y + cropArea.height / 2 + ovalVerticalOffset;
|
|
91435
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsxs(
|
|
91436
|
-
onOrientationChange: onOrientationChange,
|
|
91226
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91437
91227
|
children: [
|
|
91438
91228
|
/*#__PURE__*/ jsxRuntimeExports.jsx(NormalCamera, {
|
|
91439
91229
|
frontCamera: frontCamera,
|
|
@@ -91919,17 +91709,219 @@
|
|
|
91919
91709
|
});
|
|
91920
91710
|
};
|
|
91921
91711
|
|
|
91712
|
+
const MODE = {
|
|
91713
|
+
LANDSCAPE: 'landscape',
|
|
91714
|
+
PORTRAIT: 'portrait',
|
|
91715
|
+
DESKTOP: 'desktop'
|
|
91716
|
+
};
|
|
91717
|
+
const useDetectOrientation = (onOrientationChange)=>{
|
|
91718
|
+
const portraitQuery = reactExports.useRef(window.matchMedia('(orientation: portrait)'));
|
|
91719
|
+
const initOrientation = reactExports.useRef(portraitQuery.current.matches ? MODE.PORTRAIT : MODE.LANDSCAPE);
|
|
91720
|
+
const [curOrientation, setCurOrientation] = reactExports.useState(initOrientation.current);
|
|
91721
|
+
reactExports.useEffect(()=>{
|
|
91722
|
+
function handleResizeForScreen() {
|
|
91723
|
+
const orientationType = get(screen, 'orientation.type')?.split('-')?.[0];
|
|
91724
|
+
setCurOrientation(orientationType);
|
|
91725
|
+
if (typeof onOrientationChange === 'function') {
|
|
91726
|
+
onOrientationChange(orientationType);
|
|
91727
|
+
}
|
|
91728
|
+
}
|
|
91729
|
+
function handleResizeForQuery(e) {
|
|
91730
|
+
let orientation;
|
|
91731
|
+
if (e.matches) {
|
|
91732
|
+
orientation = MODE.PORTRAIT;
|
|
91733
|
+
} else {
|
|
91734
|
+
orientation = MODE.LANDSCAPE;
|
|
91735
|
+
}
|
|
91736
|
+
setCurOrientation(orientation);
|
|
91737
|
+
if (typeof onOrientationChange === 'function') {
|
|
91738
|
+
onOrientationChange(orientation);
|
|
91739
|
+
}
|
|
91740
|
+
}
|
|
91741
|
+
if (screen.orientation) {
|
|
91742
|
+
screen.orientation.addEventListener('change', handleResizeForScreen);
|
|
91743
|
+
} else {
|
|
91744
|
+
// screen.orientation only available on ios > 16.4
|
|
91745
|
+
// fallback to window.matchMedia
|
|
91746
|
+
portraitQuery.current.addEventListener('change', handleResizeForQuery);
|
|
91747
|
+
}
|
|
91748
|
+
return ()=>{
|
|
91749
|
+
if (screen.orientation) {
|
|
91750
|
+
screen.orientation.removeEventListener('change', handleResizeForScreen);
|
|
91751
|
+
} else {
|
|
91752
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
91753
|
+
portraitQuery.current.removeEventListener('change', handleResizeForQuery);
|
|
91754
|
+
}
|
|
91755
|
+
};
|
|
91756
|
+
}, [
|
|
91757
|
+
onOrientationChange
|
|
91758
|
+
]);
|
|
91759
|
+
return libExports.isMobile ? {
|
|
91760
|
+
curOrientation,
|
|
91761
|
+
initOrientation: initOrientation.current
|
|
91762
|
+
} : {
|
|
91763
|
+
curOrientation: MODE.DESKTOP
|
|
91764
|
+
};
|
|
91765
|
+
};
|
|
91766
|
+
|
|
91767
|
+
/**
|
|
91768
|
+
* Custom hook to delay rendering when transitioning from hidden to visible state.
|
|
91769
|
+
* Useful for waiting for browser dimension updates after orientation changes.
|
|
91770
|
+
*
|
|
91771
|
+
* @param params - Hook parameters
|
|
91772
|
+
* @param params.isVisible - Whether the component is currently visible
|
|
91773
|
+
* @param params.enableDelay - Whether to apply delay logic for show transitions
|
|
91774
|
+
* @param params.delayMs - Delay in milliseconds before showing (default: 500)
|
|
91775
|
+
* @returns Delayed visibility state
|
|
91776
|
+
*/ function useDelayedRender({ isVisible, enableDelay, delayMs = 500 }) {
|
|
91777
|
+
const [isVisibleDelayed, setIsVisibleDelayed] = reactExports.useState(isVisible);
|
|
91778
|
+
const prevIsVisibleRef = reactExports.useRef(isVisible);
|
|
91779
|
+
const timeoutRef = reactExports.useRef(null);
|
|
91780
|
+
reactExports.useEffect(()=>{
|
|
91781
|
+
const prevIsVisible = prevIsVisibleRef.current;
|
|
91782
|
+
// When delay is disabled, always sync immediately
|
|
91783
|
+
if (!enableDelay) {
|
|
91784
|
+
setIsVisibleDelayed(isVisible);
|
|
91785
|
+
prevIsVisibleRef.current = isVisible;
|
|
91786
|
+
return undefined;
|
|
91787
|
+
}
|
|
91788
|
+
// Handle transitions when delay is enabled
|
|
91789
|
+
const isTransitionToShow = !prevIsVisible && isVisible;
|
|
91790
|
+
const isTransitionToHide = prevIsVisible && !isVisible;
|
|
91791
|
+
if (isTransitionToShow) {
|
|
91792
|
+
// Delay showing when transitioning from hidden to visible
|
|
91793
|
+
timeoutRef.current = setTimeout(()=>{
|
|
91794
|
+
setIsVisibleDelayed(true);
|
|
91795
|
+
}, delayMs);
|
|
91796
|
+
} else if (isTransitionToHide) {
|
|
91797
|
+
// Immediately hide and cancel pending show
|
|
91798
|
+
if (timeoutRef.current) {
|
|
91799
|
+
clearTimeout(timeoutRef.current);
|
|
91800
|
+
timeoutRef.current = null;
|
|
91801
|
+
}
|
|
91802
|
+
setIsVisibleDelayed(false);
|
|
91803
|
+
}
|
|
91804
|
+
prevIsVisibleRef.current = isVisible;
|
|
91805
|
+
return ()=>{
|
|
91806
|
+
if (timeoutRef.current) {
|
|
91807
|
+
clearTimeout(timeoutRef.current);
|
|
91808
|
+
}
|
|
91809
|
+
};
|
|
91810
|
+
}, [
|
|
91811
|
+
isVisible,
|
|
91812
|
+
enableDelay,
|
|
91813
|
+
delayMs
|
|
91814
|
+
]);
|
|
91815
|
+
return isVisibleDelayed;
|
|
91816
|
+
}
|
|
91817
|
+
|
|
91818
|
+
const PopupContent$1 = dt$1.div`
|
|
91819
|
+
text-align: center;
|
|
91820
|
+
font-size: 20px;
|
|
91821
|
+
font-weight: 600;
|
|
91822
|
+
`;
|
|
91823
|
+
const ChildrenWrapper$1 = dt$1.div`
|
|
91824
|
+
width: 100%;
|
|
91825
|
+
height: 100%;
|
|
91826
|
+
opacity: ${({ $showChildren })=>$showChildren ? 1 : 0};
|
|
91827
|
+
`;
|
|
91828
|
+
const defaultPreferredOrientations = [
|
|
91829
|
+
MODE.PORTRAIT,
|
|
91830
|
+
MODE.DESKTOP
|
|
91831
|
+
];
|
|
91832
|
+
function OrientationDetectionV2({ onOrientationChange = noop$1, unmountOnHidden = false, remountDelayMs = 500, preferredOrientations = defaultPreferredOrientations, children }) {
|
|
91833
|
+
const t = gB();
|
|
91834
|
+
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
91835
|
+
const hasCorrectOrientation = preferredOrientations.includes(curOrientation);
|
|
91836
|
+
const isVisible = useDelayedRender({
|
|
91837
|
+
isVisible: hasCorrectOrientation,
|
|
91838
|
+
enableDelay: unmountOnHidden,
|
|
91839
|
+
delayMs: remountDelayMs
|
|
91840
|
+
});
|
|
91841
|
+
const shouldMountChildrenOnDom = unmountOnHidden ? isVisible : true;
|
|
91842
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91843
|
+
children: [
|
|
91844
|
+
!preferredOrientations.includes(curOrientation) && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
91845
|
+
open: true,
|
|
91846
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent$1, {
|
|
91847
|
+
children: t('wrong_orientation')
|
|
91848
|
+
})
|
|
91849
|
+
}),
|
|
91850
|
+
shouldMountChildrenOnDom && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper$1, {
|
|
91851
|
+
$showChildren: hasCorrectOrientation,
|
|
91852
|
+
children: children
|
|
91853
|
+
})
|
|
91854
|
+
]
|
|
91855
|
+
});
|
|
91856
|
+
}
|
|
91857
|
+
|
|
91858
|
+
const PopupContent = dt$1.div`
|
|
91859
|
+
text-align: center;
|
|
91860
|
+
font-size: 20px;
|
|
91861
|
+
font-weight: 600;
|
|
91862
|
+
`;
|
|
91863
|
+
const ChildrenWrapper = dt$1.div`
|
|
91864
|
+
width: 100%;
|
|
91865
|
+
height: 100%;
|
|
91866
|
+
opacity: ${({ showChildren })=>showChildren ? 1 : 0};
|
|
91867
|
+
`;
|
|
91868
|
+
// eslint-disable-next-line react/require-default-props
|
|
91869
|
+
function OrientationDetectionV1({ onOrientationChange, unmountOnHidden, children }) {
|
|
91870
|
+
const t = gB();
|
|
91871
|
+
const { curOrientation } = useDetectOrientation(onOrientationChange);
|
|
91872
|
+
const shouldShowChildren = curOrientation === MODE.PORTRAIT || curOrientation === MODE.DESKTOP;
|
|
91873
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
91874
|
+
children: [
|
|
91875
|
+
curOrientation === MODE.LANDSCAPE && /*#__PURE__*/ jsxRuntimeExports.jsx(PopupComponent, {
|
|
91876
|
+
open: true,
|
|
91877
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(PopupContent, {
|
|
91878
|
+
children: t('wrong_orientation')
|
|
91879
|
+
})
|
|
91880
|
+
}),
|
|
91881
|
+
(unmountOnHidden ? shouldShowChildren : true) && /*#__PURE__*/ jsxRuntimeExports.jsx(ChildrenWrapper, {
|
|
91882
|
+
showChildren: shouldShowChildren,
|
|
91883
|
+
children: children
|
|
91884
|
+
})
|
|
91885
|
+
]
|
|
91886
|
+
});
|
|
91887
|
+
}
|
|
91888
|
+
OrientationDetectionV1.defaultProps = {
|
|
91889
|
+
onOrientationChange: ()=>{},
|
|
91890
|
+
unmountOnHidden: false
|
|
91891
|
+
};
|
|
91892
|
+
OrientationDetectionV1.propTypes = {
|
|
91893
|
+
onOrientationChange: PropTypes.func,
|
|
91894
|
+
unmountOnHidden: PropTypes.bool
|
|
91895
|
+
};
|
|
91896
|
+
|
|
91897
|
+
function OrientationDetection({ version = 'v1', children, ...rest }) {
|
|
91898
|
+
if (version === 'v2') {
|
|
91899
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV2, {
|
|
91900
|
+
...rest,
|
|
91901
|
+
children: children
|
|
91902
|
+
});
|
|
91903
|
+
}
|
|
91904
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetectionV1, {
|
|
91905
|
+
...rest,
|
|
91906
|
+
children: children
|
|
91907
|
+
});
|
|
91908
|
+
}
|
|
91909
|
+
|
|
91922
91910
|
// eslint-disable-next-line react/require-default-props
|
|
91923
91911
|
const FlashLiveness = (props)=>{
|
|
91924
91912
|
const { apiCredentials, outputEncryptionSettings, mode } = props;
|
|
91925
|
-
return /*#__PURE__*/ jsxRuntimeExports.jsx(
|
|
91926
|
-
|
|
91927
|
-
|
|
91928
|
-
|
|
91929
|
-
|
|
91930
|
-
|
|
91931
|
-
|
|
91932
|
-
|
|
91913
|
+
return /*#__PURE__*/ jsxRuntimeExports.jsx(OrientationDetection, {
|
|
91914
|
+
version: "v2",
|
|
91915
|
+
unmountOnHidden: true,
|
|
91916
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(ApiClientProvider, {
|
|
91917
|
+
apiCredentials: apiCredentials,
|
|
91918
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(FlashModeProvider, {
|
|
91919
|
+
flashMode: mode,
|
|
91920
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(OutputEncryptionProvider, {
|
|
91921
|
+
settings: outputEncryptionSettings,
|
|
91922
|
+
children: /*#__PURE__*/ jsxRuntimeExports.jsx(FlashLivenessContainer, {
|
|
91923
|
+
...props
|
|
91924
|
+
})
|
|
91933
91925
|
})
|
|
91934
91926
|
})
|
|
91935
91927
|
})
|
|
@@ -113616,7 +113608,7 @@
|
|
|
113616
113608
|
};
|
|
113617
113609
|
};
|
|
113618
113610
|
|
|
113619
|
-
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk/5.34.
|
|
113611
|
+
const defaultAssetRoot = "https://vision-cdn.trustingsocial.com/tvweb-sdk/5.34.7/assets";
|
|
113620
113612
|
class TVWebSDK extends gU {
|
|
113621
113613
|
constructor(props){
|
|
113622
113614
|
super({
|