@tsocial/tvweb-sdk 5.35.0 → 5.36.0

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.
@@ -0,0 +1,10 @@
1
+ let e,t;import{r as r,i as a,j as o,e as i,F as n,aE as l,J as s,au as c,aF as u,aG as h,s as d,c as f,G as m,t as g,aH as _,v as p,av as b,k as y,K as w,P as E,d as C}from"./chunk-ed832fec.js";import{W as v}from"./chunk-e0f43811.js";let A=({onVideoPlayed:e})=>{let[t,a]=r.useState(!1),[o,i]=r.useState({});return{onVideoPlayed:r.useCallback(t=>{i((e=>{let{videoAreaWidth:t,videoAreaHeight:r,lostX:a,lostY:o}=e;return{width:t,height:r,x:Math.max(a,0),y:Math.max(o,0)}})(t)),a(!0),"function"==typeof e&&e(t)},[e]),cropArea:o,isPlaying:t}},F={LOADING:"loading",FAR_FACE:"far_face",CLOSE_FACE:"close_face",START_FLASHING:"start_flashing",STOP_DECTECTING:"stop_detecting"},R={FAR_FACE:"far",CLOSE_FACE:"close",FLASHING:"flashing"},S={timeout:"timeout",no_face:"no_face"},x=({prediction:e,canvas:t,index:r,quality:a=.8})=>{let o=t.toDataURL("image/jpeg",a);return e?{label:"portrait",base64:o.split(",")[1],landmarks:e.landmarks,index:r}:{label:"portrait",base64:o.split(",")[1],index:r}},k=a.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ z-index: 1001;
8
+
9
+ background-color: ${e=>e.$overlay?"white":"transparent"};
10
+ `,T=({children:e=null,overlay:t=!1,loadingComponent:r=o.jsx(v,{})})=>o.jsxs(k,{$overlay:t,children:[t&&r,o.jsx("div",{style:{visibility:t?"hidden":"visible"},children:e})]}),L=(e,t,r)=>{let{smallScale:a,largeScale:o,ovalPadding:i}=e,n=t.width/t.height,l=a*r.height,s=o*r.height,c=i.top+i.bottom,u=i.left+i.right,h=s-c;if(parseFloat((h*n).toFixed(2))+u>r.width){let e=Number(((r.width-u)/t.width).toFixed(2));return{smallScale:Number((a/o*e).toFixed(2)),largeScale:e}}let d=Number(((l-c)/t.height).toFixed(2));return{smallScale:d,largeScale:Number((h/t.height).toFixed(2))}},M=({offset:e,ovalPadding:t,largeScale:r,ovalHeight:a,maskHeight:o})=>{let i=a/2+t.bottom;return(i+e)*r>o/2?o/2/r-i:e},P=e=>{r.useEffect(()=>()=>{e&&e.srcObject?.getTracks().forEach(e=>{e.stop()})},[e])},O=()=>{let[e,t]=r.useState(null),[a,o]=r.useState(!1),i=r.useRef(null);return r.useEffect(()=>{if(!i.current)return()=>{};let e=i.current,r=()=>{t(e.getBoundingClientRect()),o(!1)},a=()=>{o(!0)};return e.addEventListener("transitionstart",a),e.addEventListener("transitionend",r),()=>{e.removeEventListener("transitionstart",a),e.removeEventListener("transitionend",r)}},[]),[i,e??i.current?.getBoundingClientRect(),a,o]},B=()=>{let e=r.useRef(),{sendEvent:t}=i.useSDKTracking();return r.useCallback((r,a,o={})=>{let i=performance.now(),n={};"object"==typeof o&&(n={...o},e.current&&(n.interval_vs_previous_in_ms=Math.round(i-e.current))),"function"==typeof o&&(n=o({lastTimeLog:e.current})),e.current=i,t({tag:r,event:a,log:n})},[t])},D=(e,t)=>{let a=r.useRef(e);r.useEffect(()=>{a.current=e},[e]),r.useEffect(()=>{t&&"function"==typeof a.current&&a.current()},[t])},N=({compareFn:e,duration:t,minFrames:a=null})=>{let o=r.useRef(null),i=r.useRef(!1),n=r.useRef(0),l=r.useRef(()=>{}),{compareAndStoreResult:s,getBestResult:c,reset:u}=r.useMemo(()=>{var r,a;let o,i,n;return r=e,a=t,o=null,i=null,n=()=>null!==i&&performance.now()-i>a,{checkIsTimeUp:n,compareAndStoreResult:e=>{null===o&&(o=e,i=performance.now()),n()||r(o,e)&&(o=e)},getBestResult:()=>o,reset:()=>{o=null,i=null}}},[e,t]),h=r.useCallback(()=>{u(),n.current=0,i.current=!1,o.current&&(clearTimeout(o.current),o.current=null)},[u]),d=r.useCallback(()=>null!==o.current,[]),f=r.useCallback(e=>{if(s(e),n.current+=1,!i.current||"number"!=typeof a||n.current<a)return;let t=c();l.current(t),h()},[s,c,a,h]),m=r.useCallback(({initialFrame:e,onDone:r})=>{l.current=r,f(e),o.current=setTimeout(()=>{if(i.current=!0,"number"==typeof a&&n.current<a)return;let e=c();l.current(e),h()},t)},[f,t,c,a,h]);return r.useEffect(()=>()=>{clearTimeout(o.current)},[]),r.useMemo(()=>({captureFrame:f,getBestResult:c,isAutoCapturing:d,startCapturing:m,stopCapturing:h}),[f,c,d,m,h])},I=e=>{let t=document.createElement("canvas");return t.setAttribute("width",e.videoWidth.toString()),t.setAttribute("height",e.videoHeight.toString()),t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight),t},j=()=>{let[e,t]=r.useState(Date.now());return{sessionId:e,updateSessionId:r.useCallback(()=>{t(Date.now())},[])}},z=(e,t)=>{if(0===Object.keys(e).length)return{topLeft:[0,0],bottomRight:[0,0],probability:0,landmarks:[]};let r=e.topLeft??[0,0],a=e.bottomRight??[0,0],o=e.probability??0,i=e.landmarks??[];return{topLeft:[r[0]*t,r[1]*t],bottomRight:[a[0]*t,a[1]*t],probability:o,landmarks:i.map(e=>[e[0]*t,e[1]*t])}},W=200,q=({size:e,scale:t=1,video:r,baseSize:a=W})=>{let{width:o,height:i}=e,{videoWidth:n=Number.MAX_SAFE_INTEGER,videoHeight:l=Number.MAX_SAFE_INTEGER}=r??{},s=Math.min(o,i)/a,c=Math.round(o/s*t),u=Math.round(i/s*t);return c>n||u>l?{width:o,height:i}:{width:c,height:u}},G=({width:e,height:t,cameraScale:r})=>{let a=document.createElement("canvas");a.width=e,a.height=t;let o=a.getContext("2d");return o?(o.translate(e,0),o.scale(-1*r,+r)):console.error("Failed to get 2D context from canvas in createLivenessCanvas"),a},H=({maskBoundingBox:e,faceRatio:t,validFaceRatio:r,video:a,shouldCropCenterSquare:o=!0,cropArea:i,frame:l,facePrediction:s,detectionToWholeFaceRatio:c=.8})=>{let u=e.width*t/r,h=u/e.width,d=e.height*h,f={x:e.x-(u-e.width)/2,y:e.y-(d-e.height)/2,width:u,height:d};f.x+f.width>i.x+i.width&&(f.width=i.width,f.x=i.x),f.y+f.height>i.y+i.height&&(f.height=i.height,f.y=i.y);let m=null;if(o){let e=Math.min(f.width,f.height),t=(s.bottomRight[1]-s.topLeft[1])/c,r=s.bottomRight[1]-t+(t-e)/2+i.y;r+e>f.y+f.height&&(r=f.y+f.height-e);let o={x:f.x+f.width/2-e/2,y:r,width:e,height:e};m=n.analyzeVideoAndWindowSizes(a,o)}else m=n.analyzeVideoAndWindowSizes(a,f);let g=q({size:{width:m.cropWidth,height:m.cropHeight},baseSize:400,video:a}),_=G({width:g.width,height:g.height,cameraScale:1}),p=_.width,b=_.height;return _.getContext("2d").drawImage(l,m.cropX,m.cropY,m.cropWidth,m.cropHeight,0,0,p,b),_},V=l(async function e({tfScriptUrls:t,closeEyesModelUrl:r,blazefaceModelUrl:a,qualifyModelUrl:o,opencvUrl:i}={}){let n=new u(r),l=new h(o),d=new c;await s.loadTensorFlow(t),await s.initTensorFlow({preferredBackends:["wasm","cpu"]});let f=[s.loadBlazefaceModel({modelUrl:a}),n.load(),l.init({opencvUrl:i}),c.init({opencvUrl:i})],[{blazefaceModel:m}]=await Promise.all(f);return{closeEyesModel:n,blazefaceModel:m,notQualifiedModel:l,brightnessDetector:d}}),U=({width:e,height:t,cameraScale:a=1,debug:o=!1})=>{let[i,n]=r.useState(null);return r.useEffect(()=>{let r=G({width:e,height:t,cameraScale:a});return o&&(document.body.appendChild(r),r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="9999"),n(r),()=>{o&&document.body.removeChild(r)}},[a,o,t,e]),i},K=y.isMobile?200:400;function J({cameraScale:e=1,isVideoPlaying:t,step:a,cropArea:o,videoRef:i,onFarFaceDetected:l,onFarFullFaceDetected:s,onCloseFaceDetected:c,onCloseFullFaceDetected:u,onFlashingFramesCaptured:h,frameInterval:y=0,useFaceDetectorWhenFlashing:w,onFaceError:E,onError:C,maskBoundingRect:v,shouldPauseFaceDetection:A,shouldContinueOnError:R,debug:S=!1,faceDetectionSettings:x}){let{faceSettings:k,maskSettings:T,closeEyesSettings:L,captureFrameSettings:M,blurCheckFarSettings:P,blurCheckCloseSettings:O,brightnessDetectionFarSettings:B,brightnessDetectionCloseSettings:D,notQualifiedFarSettings:N,notQualifiedCloseSettings:I,frontalFaceCheckSettings:j}=x,{chinToMaskBottomPadding:W}=T,{frameScale:G}=M,{enable:H,timeout:J,forceCheck:X}=L,{enable:$,upDownBoundMin:Y,upDownBoundMax:Q}=j,{minFarFaceRatio:Z,maxFarFaceRatio:ee,closeFaceRatio:et}=k,er=(e=>{let[t,a]=r.useState(e);return r.useEffect(()=>{(async()=>{try{let t=Math.max(16.666666666666668,33.333333333333336,e);a(t)}catch(e){console.error(e),a(20)}})()},[e]),t})(y),ea=(({videoRef:e,cropArea:t})=>r.useMemo(()=>e.current&&0!==Object.keys(t).length?n.analyzeVideoAndWindowSizes(e.current,t):{},[e,t]))({videoRef:i,cropArea:o}),eo=q({size:{width:ea.cropWidth,height:ea.cropHeight},scale:G,video:i.current}),ei=(({cropArea:e,maskBoundingRect:t,baseSize:r})=>{let{width:a,height:o,x:i,y:n}=e,l=Math.min(a,o)/r,s=t?.left??0,c=t?.top??0,u=t?.right??a;return{left:Math.max((s-i)/l,0),right:Math.min((u-i)/l,a/l),top:Math.max((c-n)/l,0),bottom:Math.min(((t?.bottom??o)-n)/l,o/l)}})({cropArea:o,maskBoundingRect:v,baseSize:Math.min(eo.width,eo.height)}),en=U({width:eo.width,height:eo.height,cameraScale:e}),el=Math.min(o.width,o.height)/Math.min(eo.width,eo.height),es=U({width:K,height:K*(eo.height/eo.width),cameraScale:e,debug:S}),ec=(({width:e,height:t,debug:a})=>{let o=r.useRef(null),i=r.useMemo(()=>{let r=document.createElement("canvas");return r.width=e,r.height=t,r.style.position="fixed",r.style.bottom="0",r.style.left="0",r.style.zIndex="99999",o.current=r,a&&document.body.appendChild(r),r},[t,e,a]);return r.useEffect(()=>()=>{a&&document.body.removeChild(o.current)},[a]),i})({width:160,height:150,debug:S}),{customUrls:eu}=f.useSDKSettings(),[eh,ed]=((e,t)=>{let[a,o]=r.useState({}),i=Object.keys(a).length>0;return r.useEffect(()=>{let r=!1;return(async()=>{try{let t=await V(e);if(r)return;o(t)}catch(e){t({...d.Errors.unable_to_load_model,details:e}),console.error(e)}})(),()=>{r=!0}},[i,e,t]),[a,i]})(eu,C),ef=r.useRef(null),{markTime:em,checkIfEllapsed:eg}=(({timeout:e})=>{let t=r.useRef(null),a=r.useCallback(()=>{t.current=performance.now()},[]),o=r.useCallback(()=>null===t.current?(a(),!1):performance.now()-t.current>e,[a,e]);return{markTime:a,checkIfEllapsed:o}})({timeout:1e3*J}),e_=ed&&t,{closeEyesModel:ep,blazefaceModel:eb,notQualifiedModel:ey,brightnessDetector:ew}=eh,eE=r.useCallback(async(e,t)=>{try{if(t?.width===0||t?.height===0||null===i.current||A||a===F.STOP_DECTECTING)return;let{cropX:n,cropY:f,cropWidth:y,cropHeight:C}=e,v=t.width,x=t.height;t.getContext("2d").drawImage(i.current,n,f,y,C,0,0,v,x);let k=m.drawToSquareCanvas(t),T=K/v;if(S&&es.getContext("2d").drawImage(i.current,n,f,y,C,0,0,v*T,x*T),!w&&a===F.START_FLASHING){"function"==typeof h&&await h({prediction:null,originalRatio:el,canvas:t});return}let L=await g.getModelPredictions({model:eb,sCanvas:k}),M=[[ei.left,ei.top],[ei.right,ei.bottom]],{error:j,fullFace:q,faceRatio:G}=await _.validatePredictions({predictions:L,cropAreaCoordinates:M});if(S){var r,o;let e,t={left:ei.left*T,top:ei.top*T,right:ei.right*T,bottom:ei.bottom*T};r=es,o={x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top},e=r.getContext("2d"),e?(e.strokeStyle="red",e.lineWidth=1,e.beginPath(),e.rect(o.x,o.y,o.width,o.height),e.stroke(),e.closePath()):console.warn("drawBoundingBox: 2D context is not available.");let a=L.map(e=>z(e,T));((e,t,r=!1)=>{let a=e.getContext("2d");if(!a)return;let o=e.width;a.strokeStyle="blue",a.fillStyle="blue",a.lineWidth=1,t.forEach(e=>{e.landmarks.forEach(e=>{a.beginPath(),a.arc(r?o-e[0]:e[0],e[1],2,0,2*Math.PI),a.fill(),a.closePath()}),a.beginPath();let t={x:r?o-e.bottomRight[0]:e.bottomRight[0],y:e.topLeft[1],width:e.bottomRight[0]-e.topLeft[0],height:e.bottomRight[1]-e.topLeft[1]};a.rect(t.x,t.y,t.width,t.height),a.stroke(),a.closePath()})})(es,a,!0)}let V=d.FaceDirection.FRONTAL;if(q&&$){let e=await _.calculateFaceDirection({landmarks:q.landmarks,upDownBound:{lower:Y,upper:Q}});V=e?.gesture??""}(q||j?.code===d.Errors.partial_face.code)&&a===F.FAR_FACE&&"function"==typeof l&&await l({prediction:L[0],originalRatio:el,canvas:t}),(q||j?.code===d.Errors.partial_face.code)&&a===F.CLOSE_FACE&&"function"==typeof c&&await c({prediction:L[0],originalRatio:el,canvas:t});let U=j?.code;try{if(U===d.Errors.no_face.code)throw Error("no_face");if(U===d.Errors.multiple_faces.code){let e=_.calculateFaceArea(L[0]),t=_.calculateFaceArea(L[1]);if(e<=2*t)throw Error("multiple_faces")}if(V!==d.FaceDirection.FRONTAL)throw Error("face_not_frontal");if(U===d.Errors.partial_face.code){let e=_.cropFaceInsideBox([L[0].topLeft,L[0].bottomRight],M);if(p.rectEdgeRatio(e,M)>.95)throw Error("face_too_large")}if(a===F.FAR_FACE){if(G>ee)throw Error("face_too_large");if(G<Z)throw Error("face_too_small")}if(a===F.CLOSE_FACE&&G<et)throw Error("face_too_small");if(Array.isArray(L)&&L.length>0&&ei.bottom-L[0].bottomRight[1]>W)throw Error("face_too_high");if(U===d.Errors.face_out_of_box.code&&(a===F.FAR_FACE&&G>=Z&&G<=ee||a===F.CLOSE_FACE&&G>=et))throw Error("")}catch(e){U=e.message}let J=null;if(H)if(U)em();else{let e=await ep.predict(t,q.landmarks),r=!X&&eg();J=e.isEyeClose,e.isEyeClose&&!r&&(U="eye_close")}let er=null,ea=a===F.FAR_FACE?B:D;if((ea.enableTooBrightCheck||ea.enableTooDarkCheck)&&Array.isArray(L)&&L.length>0){let e=[[Math.max(L[0].topLeft[1],0),Math.min(L[0].bottomRight[0],t.width),Math.min(L[0].bottomRight[1],t.height),Math.max(L[0].topLeft[0],0)]],{score:r,message:a}=ew.score(t,e,ea.tooDarkThreshold,ea.tooBrightThreshold);er=r,""===U&&ea.enableTooBrightCheck&&"face_too_bright"===a&&(U="face_too_bright"),""===U&&ea.enableTooDarkCheck&&"face_too_dark"===a&&(U="face_too_dark")}let eo=0,en={enable:a===F.FAR_FACE?P.enable:O.enable,threshold:a===F.FAR_FACE?P.threshold:O.threshold};en.enable&&(eo=await b.calculateBlurScore(t),""!==U||b.hasBetterBlurScore(eo,en.threshold)||(U="blurry_face"));let eu=0,eh=0,ed="model_not_run",ef={enable:a===F.FAR_FACE?N.enable:I.enable,threshold:a===F.FAR_FACE?N.threshold:I.threshold};if(ef.enable&&q&&q.landmarks){let[e,r,a,o]=await ey.predict(t,q.landmarks,ef.threshold);eu=r,eh=o,ed=a,""!==U||e||(U="face_not_qualified")}if((S&&m.drawDebugCanvas(ec,{error:U,ovalFaceRatio:G?.toFixed(3)??"null",ovalError:j?.code??"null",step:a===F.FAR_FACE?"far":"close",blurScore:eo.toFixed(3),qualifyScore:eu.toFixed(3),brightnessScore:er?.toFixed(3)??"null"}),U)&&("function"==typeof E&&await E({error:U,currentStep:a}),!R))return;let e_=q,eE=G;if(!e_&&R&&(e_=Array.isArray(L)&&L.length>0?L[0]:{},eE=a===F.FAR_FACE?ee:et),a===F.FAR_FACE&&e_&&Z<=eE&&eE<=ee&&"function"==typeof s)return void await s({prediction:e_,originalRatio:el,canvas:t,frame:{faceRatio:eE,isEyeClosed:J,blurScore:eo,qualifyScore:eu,realQualifyScore:eh,qualifyModelMessage:ed,brightnessScore:er,faceError:U}});if(e_&&a===F.CLOSE_FACE&&eE>=et&&"function"==typeof u)return void await u({prediction:e_,originalRatio:el,canvas:t,frame:{faceRatio:eE,isEyeClosed:J,blurScore:eo,qualifyScore:eu,realQualifyScore:eh,qualifyModelMessage:ed,brightnessScore:er,faceError:U}});w&&e_&&a===F.START_FLASHING&&eE>=et&&"function"==typeof h&&await h({prediction:e_,originalRatio:el,canvas:t,faceError:U})}catch(e){console.error(e),C({error:e})}},[i,A,a,S,w,eb,ei.left,ei.top,ei.right,ei.bottom,$,H,B,D,P.enable,P.threshold,O.enable,O.threshold,N.enable,N.threshold,I.enable,I.threshold,R,Z,ee,et,es,h,el,Y,Q,l,c,W,ep,X,eg,em,ew,ey,ec,E,s,u,C]);return r.useEffect(()=>{let e=null,t=!1;return e_&&function r(){e=requestAnimationFrame(async e=>{t||null===i.current||((null===ef.current&&(ef.current=e),e-ef.current<er)?r():(ef.current=e,await eE(ea,en),r()))})}(),()=>{t=!0,cancelAnimationFrame(e)}},[en,ea,eE,e_,i,er]),{warmupDone:ed}}let X=e=>{let{shouldStart:t,totalTime:a,totalDelay:o,onError:i,onTimeout:n,onDelayEnd:l,maxRetriesSettings:s,interruptible:c=!0}=e,u=r.useRef(new w({totalTime:a,interruptible:c,totalDelayBetweenReset:o})),[h,f]=r.useState(a);return r.useEffect(()=>u.current.on("tick",({remainTime:e})=>{f(e)}),[n]),r.useEffect(()=>u.current.on("delaystart",({attemptCount:e})=>{s.enable&&e>=s.total?i(d.Errors.max_retry_reached):n()}),[s.enable,s.total,i,n]),r.useEffect(()=>u.current.on("delayend",()=>{l()}),[l]),r.useEffect(()=>u.current.on("reset",({attemptCount:e,fromBackground:t})=>{s.enable&&e>=s.total&&i(d.Errors.max_retry_reached),t&&(n(),l())}),[n,l,s.enable,s.total,i]),r.useEffect(()=>t?u.current.start():()=>{},[t]),{remaining:h}},$=e=>{switch(e){case"partial_face":return"flash_liveness.error.partial_face";case"no_face":case"face_out_of_box":return"flash_liveness.error.no_face";case"face_too_small":return"flash_liveness.error.face_too_small";case"face_too_large":return"flash_liveness.error.face_too_large";case"eye_close":return"flash_liveness.error.close_eye";case"face_not_frontal":return"flash_liveness.error.face_not_frontal";case"multiple_faces":return"flash_liveness.error.multiple_faces";case"face_too_high":return"flash_liveness.error.face_too_high";case"blurry_face":return"flash_liveness.error.face_too_blurry";case"face_not_qualified":return"flash_liveness.error.face_not_qualified";case"face_too_bright":return"flash_liveness.error.face_too_bright";case"face_too_dark":return"flash_liveness.error.face_too_dark";default:return""}},Y=e=>Array.isArray(e)?e.map(({base64:e,label:t,index:r,metadata:a})=>({base64:e,label:t,index:r,metadata:a})):e,Q=r.createContext({enable:!1,key:""}),Z=({children:e,settings:t})=>{let a=r.useMemo(()=>{let e=t?.key??"";return{enable:!!e,key:e}},[t?.key]);return o.jsx(Q.Provider,{value:a,children:e})};Z.propTypes={children:E.node.isRequired,settings:E.shape({key:E.string})},Z.defaultProps={settings:{key:""}};let ee=()=>r.useContext(Q),et=r.createContext({}),er=({apiCredentials:e,children:t})=>{let{apiClient:r}=C.useApiClient({apiCredentials:e});return o.jsx(et.Provider,{value:r,children:t})};er.propTypes={apiCredentials:E.shape({accessKey:E.string.isRequired,secretKey:E.string.isRequired,apiUrl:E.string.isRequired}),children:E.node.isRequired},er.defaultProps={apiCredentials:{}};let ea=()=>r.useContext(et);let eo=(e=[],t=async()=>(await Promise.all(e)).map(e=>({id:e?.data?.file_id??-1})),{uploadFrameBatch:(t,r,a)=>{let o=new Blob([JSON.stringify(t)]);e.push(r.uploadFile({file:o,metadata:JSON.stringify({type:"selfie"}),label:"video"},a))},getAllUploadedBatches:t,resetUploadBatches:()=>{e.length=0}});export{er as A,R as F,Z as O,S as R,F as S,T as W,O as a,N as b,j as c,A as d,I as e,x as f,J as g,P as h,D as i,X as j,H as k,M as l,$ as m,L as n,ee as o,ea as p,eo as q,Y as r,z as s,B as u};
@@ -0,0 +1,3 @@
1
+ import{i as i,P as e,s as t,A as c,T as o,m as r,b as n,j as a}from"./chunk-ed832fec.js";let s=i.img`
2
+ width: ${({width:i})=>i};
3
+ `;function l({type:i}){let e=c(),l=o(`Selfie.Active.directionIcon.${i}`,`${i}_arrow.gif`),F=o(`Selfie.Active.directionIcon.${t.FaceDirection.FRONTAL}`,"frontal_arrow.svg"),d=r(`Selfie.Active.directionIcon.${i}Width`)({theme:e}),f=n(e,`Selfie.Active.directionIcon.${i}`);return null===f?a.jsx(a.Fragment,{}):i===t.FaceDirection.FRONTAL&&F?a.jsx(s,{src:F,width:d,alt:""}):f&&null!==f?a.jsx(s,{src:n(e,`Selfie.Active.directionIcon.${i}`),width:d,alt:""}):a.jsx(s,{src:l,alt:"",width:d})}l.propTypes={type:e.oneOf([t.FaceDirection.LEFT,t.FaceDirection.RIGHT,t.FaceDirection.UP,t.FaceDirection.FRONTAL])},l.defaultProps={type:t.FaceDirection.LEFT};export{l as D};