PageSourceSearch

https://auth.xtoscorm.com/static/js/1041.b5d67249.chunk.js

js xtoscorm.com collected 2026-10-01 13:03:31 UTC 6,664 bytes, 1 lines download raw bytes

1(self.webpackChunkweb=self.webpackChunkweb||[]).push([[1041,8],{98558:function(e,n,r){"use strict";r.r(n);var t=r(37762),i=r(74165),o=r(15861),a=r(29439),c=r(71543),s=r(47313),l=r(86445),u=r(1415),d=r(59491),f=r(90230),h=r(73074),v=r(64915),p=r(96351),g=r(59303),Z=r(3548),x=r(46417);n.default=function(e){var n=e.visible,r=e.onOk,m=e.onCancel,w=e.withImage,k=s.useState(!1),b=(0,a.Z)(k,2),j=b[0],y=b[1],P=(0,s.useState)(!1),C=(0,a.Z)(P,2),F=C[0],E=C[1],R=s.useRef(),D=s.useRef(),S=s.useRef(null),I=s.useRef(null),O=(0,s.useState)(0),U=(0,a.Z)(O,2),L=U[0],T=U[1],M=(0,s.useState)([]),N=(0,a.Z)(M,2),A=N[0],B=N[1],q=s.useState(),K=(0,a.Z)(q,2),Q=K[0],G=K[1],H=s.useState(),W=(0,a.Z)(H,2),z=W[0],J=W[1];s.useEffect((function(){if(n&&!j){var e=function(){var e=(0,o.Z)((0,i.Z)().mark((function e(){var n;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="".concat(Z.StaticBaseUrl,"/casdoor/models"),Promise.all([c.qB.tinyFaceDetector.loadFromUri(n),c.qB.faceLandmark68Net.loadFromUri(n),c.qB.faceRecognitionNet.loadFromUri(n)]).then((function(e){y(!0)})).catch((function(e){l.ZP.error(p.Z.t("login:Model loading failure")),m()}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[n,j]),s.useEffect((function(){if(!w)return n?(T(0),j&&navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}}).then((function(e){I.current=e,E(!0)})).catch((function(e){Y(e)}))):(clearInterval(S.current),S.current=null,E(!1)),function(){clearInterval(S.current),S.current=null,E(!1)}}),[n,j]),s.useEffect((function(){var e;if(!w)if(F)var n=0,r=setInterval((function(){n++,R.current&&(R.current.srcObject=I.current,R.current.play(),clearInterval(r)),n>=30&&(clearInterval(r),m())}),100);else null===(e=I.current)||void 0===e||e.getTracks().forEach((function(e){return e.stop()})),R.current&&(R.current.srcObject=null)}),[F]);var V,X,Y=function(e){m(),e instanceof DOMException&&("NotFoundError"===e.name||"DevicesNotFoundError"===e.name?l.ZP.error(p.Z.t("login:Please ensure that you have a camera device for facial recognition")):"NotAllowedError"===e.name||"PermissionDeniedError"===e.name?l.ZP.error(p.Z.t("login:Please provide permission to access the camera")):"NotReadableError"===e.name||"TrackStartError"===e.name?l.ZP.error(p.Z.t("login:The camera is currently in use by another webpage")):"TypeError"===e.name?l.ZP.error(p.Z.t("login:Please load the webpage using HTTPS, otherwise the camera cannot be accessed")):l.ZP.error(e.message))};return w?(0,x.jsx)("div",{children:(0,x.jsxs)(u.Z,{closable:!1,maskClosable:!1,destroyOnClose:!0,open:n,title:p.Z.t("login:Face Recognition"),width:350,footer:[(0,x.jsx)(d.ZP,{type:"primary",disabled:!Q||0===(null===Q||void 0===Q?void 0:Q.length),onClick:function(){r(Array.from(Q.descriptor))},children:"Ok"},"ok"),(0,x.jsx)(d.ZP,{onClick:m,children:"Cancel"},"back")],children:[(0,x.jsxs)(h.Z,{direction:"vertical",style:{width:"100%"},children:[(0,x.jsx)(g.Z,{multiple:!0,defaultFileList:A,style:{width:"100%"},beforeUpload:function(e){return function(e){return new Promise((function(n,r){var t=new FileReader;t.readAsDataURL(e),t.onload=function(){return n(t.result)},t.onerror=function(e){return r(e)}}))}(e).then((function(n){e.base64=n,A.push(e)})),G([]),!1},onRemove:function(e){var n=A.indexOf(e),r=A.slice();r.splice(n,1),B(r),G([])},children:(0,x.jsx)("p",{children:p.Z.t("general:Click to Upload")})}),j?(0,x.jsxs)(d.ZP,{style:{width:"100%"},onClick:(0,o.Z)((0,i.Z)().mark((function e(){var n,r,o,a,s,u,d,f,h,v;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,r=(0,t.Z)(A),e.prev=2,r.s();case 4:if((o=r.n()).done){e.next=15;break}return u=o.value,d=A.indexOf(u),(f=new Image).src=u.base64,e.next=11,c.Qr(f,new c.aK).withFaceLandmarks().withFaceDescriptors();case 11:h=e.sent,(null===(a=h[0])||void 0===a?void 0:a.detection.score)>.9&&(null===(s=h[0])||void 0===s?void 0:s.detection.score)>n&&(n=null===(v=h[0])||void 0===v?void 0:v.detection.score,G(h[0]),J(d));case 13:e.next=4;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(2),r.e(e.t0);case 20:return e.prev=20,r.f(),e.finish(20);case 23:n<.9&&l.ZP.error(p.Z.t("login:Face recognition failed"));case 24:case"end":return e.stop()}}),e,null,[[2,17,20,23]])}))),children:[" ",p.Z.t("general:Generate")]}):null]}),Q&&0!==Q.length?(0,x.jsxs)(s.Fragment,{children:[(0,x.jsxs)("div",{children:[p.Z.t("application:Select"),":",null===(V=A[z])||void 0===V?void 0:V.name]}),(0,x.jsx)("div",{children:(0,x.jsx)("img",{src:null===(X=A[z])||void 0===X?void 0:X.base64,alt:"selected",style:{width:"100%"}})})]}):null]})}):(0,x.jsx)("div",{children:(0,x.jsxs)(u.Z,{closable:!1,maskClosable:!1,destroyOnClose:!0,open:n&&F,title:p.Z.t("login:Face Recognition"),width:350,footer:[(0,x.jsx)(d.ZP,{onClick:m,children:"Cancel"},"back")],children:[(0,x.jsx)(f.Z,{percent:L}),(0,x.jsx)("div",{style:{marginTop:"20px",marginBottom:"50px",justifyContent:"center",alignContent:"center",position:"relative",flexDirection:"column"},children:j?(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignContent:"center"},children:[(0,x.jsx)("video",{ref:R,onPlay:function(){if(!w){var e=0,t=0;S.current||(S.current=setInterval((0,o.Z)((0,i.Z)().mark((function o(){var a,s,u;return(0,i.Z)().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!(j&&R.current&&n)){i.next=7;break}return i.next=3,c.Qr(R.current,new c.aK).withFaceLandmarks().withFaceDescriptors();case 3:a=i.sent,++e%50===0?l.ZP.warning(p.Z.t("login:Please ensure sufficient lighting and align your face in the center of the recognition box")):e>300&&(l.ZP.error(p.Z.t("login:Face recognition failed")),m()),1===a.length?(s=a[0],T(Math.round(100*s.detection.score)),u=Array.from(s.descriptor),s.detection.score>.9&&(t++,(s.detection.score>.99||t>10)&&(clearInterval(S.current),r(u)))):T(Math.round(L/2));case 7:case"end":return i.stop()}}),o)}))),100))}},style:{borderRadius:"50%",height:"220px",verticalAlign:"middle",width:"220px",objectFit:"cover"}}),(0,x.jsx)("div",{style:{position:"absolute",width:"240px",height:"240px",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},children:(0,x.jsx)("svg",{width:"240",height:"240",fill:"none",children:(0,x.jsx)("circle",{strokeDasharray:"700",strokeDashoffset:700-6.9115*L,strokeWidth:"4",cx:"120",cy:"120",r:"110",stroke:"#5734d3",transform:"rotate(-90, 120, 120)",strokeLinecap:"round",style:{transition:"all .2s linear"}})})}),(0,x.jsx)("canvas",{ref:D,style:{position:"absolute"}})]}):(0,x.jsx)("div",{children:(0,x.jsx)(v.Z,{tip:p.Z.t("login:Loading")})})})]})})}},64902:function(){},40522:function(){},90753:function(){},68730:function(){}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.