Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@id3/face-pad

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@id3/face-pad - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

2

bundles/id3-face-pad.umd.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("@id3/facedetector"),require("downloadjs"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@id3/face-pad",["exports","@angular/core","@angular/common/http","@id3/facedetector","downloadjs","@angular/common","@angular/platform-browser"],t):t(((e=e||self).id3=e.id3||{},e.id3["face-pad"]={}),e.ng.core,e.ng.common.http,e.FaceDetector,e.Downloadjs,e.ng.common,e.ng.platformBrowser)}(this,function(e,t,i,r,a,n,s){"use strict";function o(e,t,i,r){return new(i||(i=Promise))(function(a,n){function s(e){try{c(r.next(e))}catch(e){n(e)}}function o(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){e.done?a(e.value):new i(function(t){t(e.value)}).then(s,o)}c((r=r.apply(e,t||[])).next())})}function c(e,t){var i,r,a,n,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(a=2&n[0]?r.return:n[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;switch(r=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,r=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],r=0}finally{i=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}}a=a&&a.hasOwnProperty("default")?a.default:a;var h=function(){function e(){}return e.prototype.connect=function(e,t){var i=this;return new Promise(function(r,a){i.ws=new WebSocket(e+"/pad/session"),i.ws.onopen=function(){console.log("Info: Connection PAD Established."),r(!0)},i.ws.onmessage=t,i.ws.onclose=function(e){console.log("Info: Closing PAD Connection."),a(!1)}})},e.prototype.disconnect=function(){null!=this.ws&&(this.ws.close(),this.ws=null)},e.prototype.isConnected=function(){return null!=this.ws&&this.ws.readyState===this.ws.OPEN},e.prototype.sendMessage=function(e){null!=this.ws?this.ws.bufferedAmount>2e5?console.log("Image not sent : Web socket buffer is too big. We have to wait the previous messages to be send before sending a new message."):this.ws.send(JSON.stringify(e)):console.warn("connection to web socket not established, please connect.")},e.prototype.waitForSocketConnection=function(e,t){var i=this;setTimeout(function(){1===e.readyState?(console.log("Connection is made"),null!=t&&t()):(console.log("wait for connection..."),i.waitForSocketConnection(e,t))},5)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),d={REQUEST_PERMISSIONS:0,INITIAL:1,STARTED:2,PROCESS:3,SUCCESS:4,ERROR_KEY:5,ERROR_SESSION:6,ERROR_NO_FACE:7,ERROR_MULTIPLE_FACE:8,ERROR_NO_INTERNET_CONNECTION:9,ERROR_USER_TOO_FAR:10,ERROR_USER_NOT_CENTER:11,MATCH_READY:12,MATCH_SUCCESS:13,MATCH_ERROR:14};d[d.REQUEST_PERMISSIONS]="REQUEST_PERMISSIONS",d[d.INITIAL]="INITIAL",d[d.STARTED]="STARTED",d[d.PROCESS]="PROCESS",d[d.SUCCESS]="SUCCESS",d[d.ERROR_KEY]="ERROR_KEY",d[d.ERROR_SESSION]="ERROR_SESSION",d[d.ERROR_NO_FACE]="ERROR_NO_FACE",d[d.ERROR_MULTIPLE_FACE]="ERROR_MULTIPLE_FACE",d[d.ERROR_NO_INTERNET_CONNECTION]="ERROR_NO_INTERNET_CONNECTION",d[d.ERROR_USER_TOO_FAR]="ERROR_USER_TOO_FAR",d[d.ERROR_USER_NOT_CENTER]="ERROR_USER_NOT_CENTER",d[d.MATCH_READY]="MATCH_READY",d[d.MATCH_SUCCESS]="MATCH_SUCCESS",d[d.MATCH_ERROR]="MATCH_ERROR";var l=function(){function e(){}return e.messages=new Map([["START_TIPS_LABEL","Cliquez sur Démarrer lorsque vous êtes prêt"],["PROCESS_FACE_CENTER_LABEL","Visage detecté, mais non centré. Veuillez regarder la caméra en mettant votre visage bien en face"],["PROCESS_NO_FACE_LABEL","Pas de visage detecté. Veuillez vous positionner au centre de l'écran."],["PROCESS_MULTIPLE_FACE_LABEL","Plusieurs visages detectés. La detection ne fonctionne qu'avec un seul visage."],["TURN_FACE_LABEL","Maintenant, tournez lentement la tête (vers la droite ou vers la gauche)"],["EXPIRED_SESSION_ERROR_LABEL","La session a expiré. Veuillez réessayer"],["NO_FACE_ERROR_LABEL","Pas de visage detecté. Veuillez réessayer"],["NO_INTERNET_CONNECTION_LABEL","Connection internet perdue. Veuillez réessayer"],["MULTIPLE_FACE_ERROR_LABEL","Plusieurs visages detectés. Veuillez réessayer"],["MATCHING_SUCCESS_LABEL","Le visage correspond bien à la photo de référence"],["MATCHING_READY_LABEL",'La photo est prête à être comparée avec une référence.Veuillez cliquer sur le bouton "Verifier" puis choisir une photo de référence.'],["MATCHING_ERROR_LABEL","Le visage ne correspond pas à la photo de référence"],["SUCCESS_LABEL","La detection du visage a réussi."],["START_BUTTON_LABEL","Démarrer"],["RESTART_BUTTON_LABEL","Recommencer"],["COMPARE_BUTTON_LABEL","Vérifier"],["ENABLE_CAM_BUTTON_LABEL","Activer la webcam"],["RETRY_BUTTON_LABEL","Réessayer"],["USER_TOO_FAR_LABEL","Vous êtes trop loin, veuillez vous rapprocher de la caméra"],["USER_NOT_CENTER_LABEL","Veuillez vous positionner à l'intérieur de la zone cible"]]),e}(),p=function(){function e(){}return e.messages=new Map([["START_TIPS_LABEL","Press on Start button when you are ready"],["PROCESS_FACE_CENTER_LABEL","Face detected, but not centered. Please look straight to the camera"],["PROCESS_NO_FACE_LABEL","No face detected. Please look straight to the camera."],["PROCESS_MULTIPLE_FACE_LABEL","Multiple faces detected. Only one person is allowed in the detection."],["TURN_FACE_LABEL","Now, please turn your face (look at the right or at the left)"],["EXPIRED_SESSION_ERROR_LABEL","Session has expired. Please try again."],["NO_FACE_ERROR_LABEL","No face detected. Please try again."],["NO_INTERNET_CONNECTION_LABEL","Internet connection lost. Please try again"],["MULTIPLE_FACE_ERROR_LABEL","Multiple faces detected. Please try again."],["MATCHING_SUCCESS_LABEL","Detected face successfully match the reference picture."],["MATCHING_READY_LABEL",'Picture is ready to be compared with a reference picture.Please click on the "Compare" button to upload the reference picture.'],["MATCHING_ERROR_LABEL","Detected face does not match the reference picture"],["SUCCESS_LABEL","Live face successfully detected."],["START_BUTTON_LABEL","Start"],["RESTART_BUTTON_LABEL","Restart"],["COMPARE_BUTTON_LABEL","Compare"],["ENABLE_CAM_BUTTON_LABEL","Start the webcam"],["RETRY_BUTTON_LABEL","Retry"],["USER_TOO_FAR_LABEL","Too far away, please move closer"],["USER_NOT_CENTER_LABEL","Please, move on the target area"]]),e}(),u=function(){function e(){}return e.messages=new Map([["START_TIPS_LABEL","Pressione no botão Iniciar quando estiver pronto"],["PROCESS_FACE_CENTER_LABEL","Rosto detectado, mas não centrado. Por favor, olhe diretamente para a câmera"],["PROCESS_NO_FACE_LABEL","Nenhum rosto detectado. Por favor, olhe diretamente para a câmera."],["PROCESS_MULTIPLE_FACE_LABEL","Múltiplos rostos detectados. Apenas uma pessoa é permitida na detecção."],["TURN_FACE_LABEL","Agora, por favor, vire seu rosto (olhe para a direita ou para a esquerda)"],["EXPIRED_SESSION_ERROR_LABEL","Sessão expirou. Por favor, tente novamente."],["NO_FACE_ERROR_LABEL","Nenhum rosto detectado. Por favor, tente novamente."],["NO_INTERNET_CONNECTION_LABEL","Conexão perdida com a internet. Por favor, tente novamente."],["MULTIPLE_FACE_ERROR_LABEL","Múltiplos rostos detectados. Por favor, tente novamente."],["MATCHING_SUCCESS_LABEL","A face detectada corresponde com sucesso à imagem de referência."],["MATCHING_READY_LABEL",'A imagem está pronta para ser comparada com uma imagem de referência.Por favor, clique no botão "Comparar" para carregar a imagem de referência.'],["MATCHING_ERROR_LABEL","Detected face does not match the reference picture"],["SUCCESS_LABEL","O rosto detectado não corresponde à imagem de referência"],["START_BUTTON_LABEL","Iniciar"],["RESTART_BUTTON_LABEL","Começar de novo"],["COMPARE_BUTTON_LABEL","Comparar"],["ENABLE_CAM_BUTTON_LABEL","Comece a webcam"],["RETRY_BUTTON_LABEL","Tente novamente"],["USER_TOO_FAR_LABEL","Você está longe demais, por favor, aproxime-se da câmera"],["USER_NOT_CENTER_LABEL","Por favor posicione-se dentro da área alvo"]]),e}(),E=function(){function e(e,i){this.facePadService=e,this.httpClient=i,this.mapLanguage=new Map,this.wsEndpoint="http://localhost:8085",this.wsFormatPicture="/api/face/rotate-and-crop",this.wsFaceVerification="/api/face/match/pictures",this.wsImageSize="/api/parameters",this.apiKey="",this.autoStart=!1,this.faceTracking=!1,this.faceTrackingOptionDesign=!1,this.mirror=!1,this.processProgressCircle=!1,this.circleRadius=200,this.formatFinalPicture=!1,this.downloadFinalPictureOnSuccess=!1,this.resultPictureWidth=600,this.enableAutoMatching=!1,this.allowsMultipleRetries=!1,this.videoWidth=800,this.videoHeight=600,this.videoWidthMobile=600,this.videoHeightMobile=800,this.frameWidth=120,this.minHeadSize=0,this.messagesEnabled=!0,this.padFrequency=100,this.faceDetectedHandler=new t.EventEmitter,this.cameraHandler=new t.EventEmitter,this.sessionExpiredHandler=new t.EventEmitter,this.changeStateHandler=new t.EventEmitter,this.matchingHandler=new t.EventEmitter,this.messages=new Map,this.padState=d.REQUEST_PERMISSIONS,this.videoConstraints={audio:!1,video:!0},this.processInstruction="",this.mapLanguage.set("fr",l.messages),this.mapLanguage.set("en",p.messages),this.mapLanguage.set("pt",u.messages)}return e.prototype.ngOnInit=function(){this.isDeviceMobile(),this.languageFile=this.mapLanguage.get(navigator.language.substr(0,2)),this.languageFile||(this.languageFile=p),this.messages.set("START_TIPS_LABEL",this.startTipsLabel),this.messages.set("PROCESS_FACE_CENTER_LABEL",this.processFaceCenterLabel),this.messages.set("PROCESS_NO_FACE_LABEL",this.processNoFaceLabel),this.messages.set("PROCESS_MULTIPLE_FACE_LABEL",this.processMultipleFaceLabel),this.messages.set("TURN_FACE_LABEL",this.turnFaceLabel),this.messages.set("EXPIRED_SESSION_ERROR_LABEL",this.expiredSessionErrorLabel),this.messages.set("NO_FACE_ERROR_LABEL",this.noFaceErrorLabel),this.messages.set("MULTIPLE_FACE_ERROR_LABEL",this.multipleFaceErrorLabel),this.messages.set("SUCCESS_LABEL",this.successLabel),this.messages.set("START_BUTTON_LABEL",this.startButtonLabel),this.messages.set("RESTART_BUTTON_LABEL",this.restartButtonLabel),this.messages.set("COMPARE_BUTTON_LABEL",this.compareButtonLabel),this.messages.set("ENABLE_CAM_BUTTON_LABEL",this.enableCamButtonLabel),this.messages.set("RETRY_BUTTON_LABEL",this.retryButtonLabel),this.messages.set("MATCHING_SUCCESS_LABEL",this.matchingSuccessLabel),this.messages.set("MATCHING_READY_LABEL",this.matchingReadyLabel),this.messages.set("MATCHING_ERROR_LABEL",this.matchingErrorLabel),this.messages.set("NO_INTERNET_CONNECTION_LABEL",this.noInternetConnectionLabel),this.messages.set("USER_TOO_FAR_LABEL",this.userTooFarLabel),this.messages.set("USER_NOT_CENTER_LABEL",this.userNotCenterLabel)},e.prototype.ngOnDestroy=function(){this.facePadService.disconnect(),this.faceDetector&&this.faceDetector.stop()},e.prototype.ngAfterViewInit=function(){this.autoStart&&(this.initPadSource(),this.getDatasVideoPAD())},e.prototype.processServerResponse=function(e){var t=this;this.processCompletion=e.processCompletion,e.result?(this.padState=d.SUCCESS,this.endSessionPad(),this.manageFinalPicture()):(this.processInstruction="",e.errorType||this.padState!==d.STARTED?"INVALID_YAW"===e.errorType||"INVALID_PITCH"===e.errorType?(this.processInstruction=this.getMessage("PROCESS_FACE_CENTER_LABEL"),setTimeout(function(){return t.prepareCallPADStart()},500)):"INVALID_KEY"===e.errorType?(this.padState=d.ERROR_KEY,this.emitInvalidKeyEvent()):"INVALID_FACE"===e.errorType?this.padState===d.PROCESS?(0===e.faceCount?this.padState=d.ERROR_NO_FACE:e.faceCount>1&&(this.padState=d.ERROR_MULTIPLE_FACE),this.endSessionPad()):this.padState===d.STARTED&&(0===e.faceCount?this.processProgressCircle?this.processInstruction=this.getMessage("USER_NOT_CENTER_LABEL"):this.processInstruction=this.getMessage("PROCESS_NO_FACE_LABEL"):e.faceCount>1&&(this.processInstruction=this.getMessage("PROCESS_MULTIPLE_FACE_LABEL")),setTimeout(function(){return t.prepareCallPADStart()},500)):"INVALID_SESSION"===e.errorType&&(this.padState=d.ERROR_SESSION,this.endSessionPad(),this.emitSessionExpiredEvent()):(this.padState=d.PROCESS,this.alarmThread=setInterval(function(){return t.prepareCallPADContinue()},this.padFrequency)))},e.prototype.endSessionPad=function(){clearInterval(this.alarmThread),this.alarmThread=void 0,this.xCoord=void 0,this.yCoord=void 0,this.wCoord=void 0,this.hCoord=void 0,this.ngOnDestroy()},e.prototype.getMessage=function(e){return!this.messages.get(e)&&this.languageFile?this.languageFile.get(e):this.messages.get(e)},e.prototype.getDatasVideoPAD=function(){var e=this;this.videoPAD.nativeElement.addEventListener("loadedmetadata",function(t){e.width=e.videoPAD.nativeElement.videoWidth,e.height=e.videoPAD.nativeElement.videoHeight,e.ratioWidth=e.width/e.videoWidth,e.ratioHeight=e.height/e.videoHeight},!1)},e.prototype.isRequestPermissionState=function(){return this.padState===d.REQUEST_PERMISSIONS},e.prototype.isInitialState=function(){return this.padState===d.INITIAL},e.prototype.isStartedState=function(){return this.padState===d.STARTED},e.prototype.isProcessingState=function(){return this.padState===d.PROCESS},e.prototype.isErrorSessionState=function(){return this.padState===d.ERROR_SESSION},e.prototype.isErrorNoFaceState=function(){return this.padState===d.ERROR_NO_FACE},e.prototype.isErrorNoInternetConnection=function(){return this.padState===d.ERROR_NO_INTERNET_CONNECTION},e.prototype.isErrorUserTooFar=function(){return this.padState===d.ERROR_USER_TOO_FAR},e.prototype.isErrorUserNotCenter=function(){return this.padState===d.ERROR_USER_NOT_CENTER},e.prototype.isErrorMultipleFaceState=function(){return this.padState===d.ERROR_MULTIPLE_FACE},e.prototype.isSuccessState=function(){return this.padState===d.SUCCESS},e.prototype.isInvalidKeyState=function(){return this.padState===d.ERROR_KEY},e.prototype.isMatchingReadyState=function(){return this.padState===d.MATCH_READY},e.prototype.isMatchingSuccessState=function(){return this.padState===d.MATCH_SUCCESS},e.prototype.isMatchingErrorState=function(){return this.padState===d.MATCH_ERROR},e.prototype.isDeviceMobile=function(){return window.innerHeight>window.innerWidth&&(this.videoWidth=this.videoWidthMobile,this.videoHeight=this.videoHeightMobile),window.innerHeight>window.innerWidth},e.prototype.initPadSource=function(){return o(this,void 0,void 0,function(){var e,t,i=this;return c(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=this,[4,navigator.mediaDevices.getUserMedia(this.videoConstraints)];case 1:return e.videoPADStream=r.sent(),this.videoPAD&&(this.videoPAD.nativeElement.srcObject=this.videoPADStream),this.handleSuccess(),this.padState=d.INITIAL,this.getMinHeadSize(),window.addEventListener("beforeunload",function(){return i.leaving()}),[3,3];case 2:return t=r.sent(),console.log("Error : "+t),[3,3];case 3:return[2]}})})},e.prototype.leaving=function(){this.videoPADStream.stop()},e.prototype.handleSuccess=function(){var e=this.videoPADStream.getVideoTracks();this.emitCameraEvent("Got stream with constraints: "+JSON.stringify(this.videoConstraints)),this.emitCameraEvent("Using video device: "+JSON.stringify(e[0].label))},e.prototype.prepareCallPADStart=function(){var e=this;this.facePadService.isConnected()?this.callPADStart():this.facePadService.connect(this.wsEndpoint.replace("http","ws"),function(t){return e.processServerResponse(JSON.parse(t.data))}).then(function(t){e.callPADStart()}).catch(function(t){e.padState=d.ERROR_NO_INTERNET_CONNECTION,e.endSessionPad()})},e.prototype.callPADStart=function(){var e=this;try{!this.faceTracking||this.faceDetector&&this.faceDetector.isRunning()?this.processProgressCircle&&!this.faceTracking&&(this.isCircleRunning||(this.progressCircle(),this.isCircleRunning=!0)):this.faceTracker();var t=this.frameWidth/this.videoPAD.nativeElement.clientWidth;this.padState=d.STARTED;var i=document.createElement("canvas");if(this.faceTracking&&this.faceDetector.isRunning()&&this.xCoord&&!this.processProgressCircle){i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight;var r=1.5*this.wCoord*this.ratioWidth,a=(this.xCoord-(r-this.wCoord))*this.ratioWidth,n=1.5*this.hCoord*this.ratioHeight,s=(this.yCoord-(n-this.hCoord))*this.ratioHeight;i.height*this.hCoord/this.videoHeight<this.minHeadSize?this.padState=d.ERROR_USER_TOO_FAR:(i.getContext("2d").drawImage(this.videoPAD.nativeElement,+a,s,r,n,0,0,i.width,i.height),i.toBlob(function(t){e.photoPADStart=t,e.emitChangeStateEvent("PAD Start photo blob generated"),e.doPADStart()},"image/jpeg"))}else this.processProgressCircle&&!this.faceTracking?(i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight,i.getContext("2d").drawImage(this.videoPAD.nativeElement,this.width/2-2*this.circleRadius*this.ratioWidth/2,this.height/2-2*this.circleRadius*this.ratioHeight/2,2*this.circleRadius*this.ratioWidth,2*this.circleRadius*this.ratioHeight,0,0,i.width,i.height),i.toBlob(function(t){e.photoPADStart=t,e.emitChangeStateEvent("PAD Start photo blob generated"),e.doPADStart()},"image/jpeg")):(i.width=this.frameWidth,i.height=this.videoPAD.nativeElement.clientHeight*t,i.getContext("2d").drawImage(this.videoPAD.nativeElement,0,0,i.width,i.height),i.toBlob(function(t){e.photoPADStart=t,e.emitChangeStateEvent("PAD Start photo blob generated"),e.doPADStart()},"image/jpeg"));var o=this.resultPictureWidth/this.videoPAD.nativeElement.clientWidth,c=document.createElement("canvas");this.faceTracking&&this.faceDetector.isRunning()&&this.xCoord?(c.width=1.5*this.wCoord,c.height=1.5*this.hCoord,this.xCoord-=c.width-this.wCoord,this.yCoord-=c.height-this.hCoord,c.getContext("2d").drawImage(this.videoPAD.nativeElement,+this.xCoord,this.yCoord,c.width,c.height,0,0,c.width,c.height)):(c.width=this.resultPictureWidth,c.height=this.videoPAD.nativeElement.clientHeight*o,c.getContext("2d").drawImage(this.videoPAD.nativeElement,0,0,c.width,c.height)),c.toBlob(function(t){e.photoPADStartOriginal=t,e.emitChangeStateEvent("PAD Start photo original blob generated")},"image/jpeg")}catch(e){console.error(e),this.emitChangeStateEvent("Exception at prepareCallPADStart(): "+JSON.stringify(e))}},e.prototype.doPADStart=function(){return o(this,void 0,void 0,function(){var e;return c(this,function(t){switch(t.label){case 0:return[4,new Response(this.photoPADStart).arrayBuffer()];case 1:return e=t.sent(),this.facePadService.sendMessage({faceImage:this.arrayBufferToBase64(e),typeMessagePad:"START",apiKey:this.apiKey}),[2]}})})},e.prototype.prepareCallPADContinue=function(){var e=this;if(this.facePadService.isConnected())try{var t=this.frameWidth/this.videoPAD.nativeElement.clientWidth,i=document.createElement("canvas");if(this.faceTracking&&this.faceDetector.isRunning()&&this.xCoord){i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight;var r=1.5*this.wCoord*this.ratioWidth,a=(this.xCoord-(r-this.wCoord))*this.ratioWidth,n=1.5*this.hCoord*this.ratioHeight,s=(this.yCoord-(n-this.hCoord))*this.ratioHeight;i.height*this.hCoord/this.videoHeight<this.minHeadSize?this.processInstruction=this.getMessage("USER_TOO_FAR_LABEL"):(i.getContext("2d").drawImage(this.videoPAD.nativeElement,+a,s,r,n,0,0,i.width,i.height),this.tempToBlob(i))}else this.processProgressCircle&&!this.faceTracking?(i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight,i.getContext("2d").drawImage(this.videoPAD.nativeElement,this.width/2-2*this.circleRadius*this.ratioWidth/2,this.height/2-2*this.circleRadius*this.ratioHeight/2,2*this.circleRadius*this.ratioWidth,2*this.circleRadius*this.ratioHeight,0,0,i.width,i.height),this.tempToBlob(i)):(i.width=this.frameWidth,i.height=this.videoPAD.nativeElement.clientHeight*t,i.getContext("2d").drawImage(this.videoPAD.nativeElement,0,0,i.width,i.height),this.tempToBlob(i))}catch(e){this.emitChangeStateEvent("Exception at prepareCallPADContinue(): "+JSON.stringify(e))}else this.endSessionPad(),this.padState=d.ERROR_NO_INTERNET_CONNECTION,setTimeout(function(){return e.initPadSource()},5e3)},e.prototype.arrayBufferToBase64=function(e){for(var t="",i=new Uint8Array(e),r=i.byteLength,a=0;a<r;a++)t+=String.fromCharCode(i[a]);return window.btoa(t)},e.prototype.manageFinalPicture=function(){this.formatFinalPicture?this.rotateAndCropFinalPicture():(this.generatedPicture=this.photoPADStartOriginal,this.emitFaceDetectedEvent(),!this.enableAutoMatching&&this.downloadFinalPictureOnSuccess?this.downloadPicture():this.enableAutoMatching&&this.showInstructionToUploadReference())},e.prototype.showInstructionToUploadReference=function(){this.padState=d.MATCH_READY},e.prototype.rotateAndCropFinalPicture=function(){var e=this,t=new i.HttpHeaders;t=(t=t.append("Accept","application/json")).append("ApiKeyAuth",this.apiKey);var r=new FormData;r.append("picture",this.photoPADStartOriginal),this.httpClient.post(this.wsEndpoint+this.wsFormatPicture,r,{headers:t}).subscribe(function(t){if(t.length>0){var i=e.b64toBlob("data:image/png;base64,"+t[0].picture);e.generatedPicture=i,e.faceDetectedHandler.emit(i),e.enableAutoMatching?e.showInstructionToUploadReference():e.downloadFinalPictureOnSuccess&&e.downloadPicture()}else console.warn("No picture generated from the original picture by the rotate-and-crop method")},function(t){417===t.status?(e.padState=d.ERROR_MULTIPLE_FACE,e.endSessionPad()):404===t.status?(e.padState=d.ERROR_NO_FACE,e.endSessionPad()):0===t.status?(e.padState=d.ERROR_NO_INTERNET_CONNECTION,e.endSessionPad()):console.error("No picture generated from the original picture by the rotate-and-crop method. Error : "+t)})},e.prototype.b64toBlob=function(e){for(var t=atob(e.split(",")[1]),i=new ArrayBuffer(t.length),r=new Uint8Array(i),a=0;a<t.length;a++)r[a]=t.charCodeAt(a);return new Blob([i],{type:"image/png"})},e.prototype.emitFaceDetectedEvent=function(){this.faceDetectedHandler.emit(this.photoPADStartOriginal)},e.prototype.emitInvalidKeyEvent=function(){},e.prototype.emitSessionExpiredEvent=function(){this.sessionExpiredHandler.emit(!0)},e.prototype.emitCameraEvent=function(e){this.cameraHandler.emit(e)},e.prototype.emitChangeStateEvent=function(e){this.changeStateHandler.emit(e)},e.prototype.resetUI=function(){this.padState=d.INITIAL},e.prototype.compareWithReference=function(e){if(e||(e=this.generatedPicture),e)document.getElementById("id3-fileForMatching").click();else{var t="PAD Result picture is missing. You have to execute the entire PAD process before calling the Matching Javascript function.\n";t+="IMPORTANT NOTE : If you are using the pureJS component, you have to provide the picture in argument (mandatory).",console.error(t),this.matchingHandler&&this.matchingHandler.error(t)}},e.prototype.handleFiles=function(e){var t=this,r=new i.HttpHeaders;r=(r=r.append("Accept","application/json")).append("ApiKeyAuth",this.apiKey);var a=URL.createObjectURL(e.target.files[0]),n=new Image;n.onload=function(){var e=500/n.width,i=document.createElement("canvas");i.width=500,i.height=n.height*e,i.getContext("2d").drawImage(n,0,0,i.width,i.height),i.toBlob(function(e){return o(t,void 0,void 0,function(){var t,i=this;return c(this,function(a){return(t=new FormData).append("reference",e),t.append("probe",this.photoPADStartOriginal),this.httpClient.post(this.wsEndpoint+this.wsFaceVerification,t,{headers:r}).subscribe(function(e){i.matchingHandler.emit(e),e.decision?i.padState=d.MATCH_SUCCESS:i.padState=d.MATCH_ERROR,e.decision&&i.downloadFinalPictureOnSuccess&&i.downloadPicture()},function(e){i.padState=d.MATCH_ERROR,i.matchingHandler.error("An error occured during the Matching process. Please retry later.")}),[2]})})},"image/jpeg")},n.src=a},e.prototype.downloadPicture=function(){return o(this,void 0,void 0,function(){var e,t;return c(this,function(i){switch(i.label){case 0:return[4,new Response(this.generatedPicture).arrayBuffer()];case 1:return e=i.sent(),t="data:image/jpeg;base64,"+this.arrayBufferToBase64(e),a(t,"face-result.jpeg","image/jpeg"),[2]}})})},e.prototype.faceTracker=function(){var e=this,t=this.videoPAD.nativeElement,i=this.canvasResult.nativeElement,a=i.getContext("2d");i.width=this.videoWidth,i.height=this.videoHeight,this.faceDetector=new r({video:t,flipLeftRight:!1,flipUpsideDown:!1}),this.faceDetector.startDetecting(),this.faceDetector.setOnFaceLostCallback(function(e,t){a.clearRect(0,0,i.width,i.height)}),this.faceDetector.setOnFaceUpdatedCallback(function(t){a.clearRect(0,0,i.width,i.height),e.faceTrackingOptionDesign?(a.strokeStyle="rgba(0,200,200,0)",a.fillStyle="rgba(0,200,200,0)"):(a.strokeStyle="rgba(0,221,52,1.0)",a.fillStyle="rgba(0,221,52,0.08)"),a.lineWidth=2,t.forEach(function(t){a.beginPath();var r=t.width*i.width/2,n=1.5*t.height*i.height/2;a.ellipse(t.x*i.width+r,t.y*i.height+n-n/2,r,n,0,0,2*Math.PI),a.stroke(),a.fill(),e.faceTrackingOptionDesign&&(a.strokeStyle="rgba(0,200,200,0)",a.lineWidth="10",a.fillStyle="rgba(0, 0, 0, 0.7)",a.beginPath(),a.moveTo(0,0),a.lineTo(0,i.height),a.lineTo(i.width/2,i.height),a.lineTo(t.x*i.width+2*r,t.y*i.height+2*n),a.ellipse(t.x*i.width+r,t.y*i.height+n-n/2,r,n,0,Math.PI/2,Math.PI/2.000001),a.lineTo(i.height/2,i.height),a.lineTo(i.width,i.height),a.lineTo(i.width,0),a.lineTo(i.width/2,0),a.lineTo(i.width/2,e.circleRadius/2),a.lineTo(i.width/2,0),a.lineTo(0,0),a.stroke(),a.fill()),e.xCoord=t.x*i.width,e.yCoord=t.y*i.height,e.wCoord=t.width*i.width,e.hCoord=t.height*i.height})})},e.prototype.getMinHeadSize=function(){var e=this,t=new i.HttpHeaders;t=(t=t.append("Accept","application/json")).append("ApiKeyAuth",this.apiKey),this.httpClient.get(this.wsEndpoint+this.wsImageSize,{headers:t}).subscribe(function(t){e.minHeadSize=t.minHeadSize},function(e){console.error(e)})},e.prototype.tempToBlob=function(e){var t=this;e.toBlob(function(e){return o(t,void 0,void 0,function(){var t;return c(this,function(i){switch(i.label){case 0:return this.emitChangeStateEvent("PAD Continue photo blob generated"),this.photoPADContinue=e,[4,new Response(this.photoPADContinue).arrayBuffer()];case 1:return t=i.sent(),this.facePadService.sendMessage({faceImage:this.arrayBufferToBase64(t),typeMessagePad:"CONTINUE",apiKey:this.apiKey}),[2]}})})},"image/jpeg")},e.prototype.progressCircle=function(){var e=this,t=this.canvasResult.nativeElement;t.width=this.videoWidth,t.height=this.videoHeight;var i=t.getContext("2d"),r=t.width/2,a=t.height/2;i.lineCap="round";var n=0,s=setInterval(function(){i.clearRect(0,0,t.width,t.height),i.strokeStyle="rgba(0,200,200,0)",i.lineWidth="10",i.fillStyle="rgba(0, 0, 0, 0.7)",i.beginPath(),i.moveTo(0,0),i.lineTo(0,t.height),i.lineTo(r,t.height),i.lineTo(r,t.height-e.circleRadius/2),i.arc(r,a,e.circleRadius,Math.PI/2,Math.PI/2.000001),i.lineTo(r,t.height),i.lineTo(t.width,t.height),i.lineTo(t.width,0),i.lineTo(r,0),i.lineTo(r,e.circleRadius/2),i.lineTo(r,0),i.lineTo(0,0),i.stroke(),i.fill(),i.beginPath(),i.strokeStyle=e.colorProgressCircle,i.lineWidth="10",i.arc(r,a,e.circleRadius,Math.PI/180*270,Math.PI/180*(270+n)),i.stroke(),e.processCompletion>=100?(i.arc(r,a,e.circleRadius,Math.PI/180*(270+n),Math.PI/180*630),i.stroke(),e.processCompletion=0,n=0,clearInterval(s),e.isCircleRunning=!1):n<e.processCompletion/100*360?n+=10:e.padState===d.ERROR_NO_FACE&&(i.clearRect(0,0,t.width,t.height),e.processCompletion=0,n=0,clearInterval(s),e.isCircleRunning=!1)},60)},e.decorators=[{type:t.Component,args:[{selector:"id3-face-pad",template:'<id3-face-pad-messages *ngIf="messagesEnabled" class="show-small-screen" [startTipsLabel]="getMessage(\'START_TIPS_LABEL\')"\r\n [turnFaceLabel]="getMessage(\'TURN_FACE_LABEL\')" [expiredSessionErrorLabel]="getMessage(\'EXPIRED_SESSION_ERROR_LABEL\')" \r\n [noFaceErrorLabel]="getMessage(\'NO_FACE_ERROR_LABEL\')" [noInternetConnectionLabel]="getMessage(\'NO_INTERNET_CONNECTION_LABEL\')"\r\n [multipleFaceErrorLabel]="getMessage(\'MULTIPLE_FACE_ERROR_LABEL\')" [successLabel]="getMessage(\'SUCCESS_LABEL\')" \r\n [processInstruction]="processInstruction" [padState]="padState" [matchingSuccessLabel]="getMessage(\'MATCHING_SUCCESS_LABEL\')"\r\n [matchingErrorLabel]="getMessage(\'MATCHING_ERROR_LABEL\')" [matchingReadyLabel]="getMessage(\'MATCHING_READY_LABEL\')"\r\n [userTooFarLabel]="getMessage(\'USER_TOO_FAR_LABEL\')" [userNotCenterLabel]="getMessage(\'USER_NOT_CENTER_LABEL\')">\r\n</id3-face-pad-messages>\r\n\r\n<input id="id3-fileForMatching" type="file" name="fileForMatch" class="d-none" (change)="handleFiles($event)"/>\r\n<div class="padContainer" [style.max-height]="videoHeight + \'px\'" [style.max-width]="videoWidth + \'px\'">\r\n <canvas class="canvas {{mirror && !processProgressCircle ? \'mirror\': \'\'}}" #resultCanvas></canvas>\r\n <video class="liveStream {{mirror ? \'mirror\': \'\'}}" #videoPAD autoplay playsinline></video>\r\n <div class="id3-pad-overlay">\r\n <div class="extras">\r\n <img class="text-left" id="id3Logo" src="/assets/images/id3_logo_white_40.png" height="40" width="40" *ngIf="apiKey === \'test-token-id3-webcapture\'">\r\n </div>\r\n <div id="mainContent" class="pad-content d-block">\r\n\r\n <id3-face-pad-messages *ngIf="messagesEnabled" class="show-big-screen" [startTipsLabel]="getMessage(\'START_TIPS_LABEL\')"\r\n [turnFaceLabel]="getMessage(\'TURN_FACE_LABEL\')" [expiredSessionErrorLabel]="getMessage(\'EXPIRED_SESSION_ERROR_LABEL\')" \r\n [noFaceErrorLabel]="getMessage(\'NO_FACE_ERROR_LABEL\')" [noInternetConnectionLabel]="getMessage(\'NO_INTERNET_CONNECTION_LABEL\')"\r\n [multipleFaceErrorLabel]="getMessage(\'MULTIPLE_FACE_ERROR_LABEL\')" [successLabel]="getMessage(\'SUCCESS_LABEL\')" \r\n [processInstruction]="processInstruction" [padState]="padState" [matchingSuccessLabel]="getMessage(\'MATCHING_SUCCESS_LABEL\')"\r\n [matchingErrorLabel]="getMessage(\'MATCHING_ERROR_LABEL\')" [matchingReadyLabel]="getMessage(\'MATCHING_READY_LABEL\')"\r\n [userTooFarLabel]="getMessage(\'USER_TOO_FAR_LABEL\')" [userNotCenterLabel]="getMessage(\'USER_NOT_CENTER_LABEL\')">\r\n </id3-face-pad-messages>\r\n\r\n <br>\r\n <div class="d-flex">\r\n <h4 id="padAlert" class="text-white"></h4>\r\n </div>\r\n </div>\r\n <div id="mainButtons" class="pad-buttons d-block">\r\n <button type="button" *ngIf="isRequestPermissionState()" (click)="initPadSource()" class="btn btn-primary btn-id3 mt-5">\r\n <em class="pi pi-caret-right"></em>{{getMessage(\'ENABLE_CAM_BUTTON_LABEL\')}}\r\n </button>\r\n <button type="button" *ngIf="isInitialState()" (click)="prepareCallPADStart()" class="btn btn-primary btn-id3 mt-5">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'START_BUTTON_LABEL\')}}\r\n </button>\r\n <button type="button" *ngIf="isErrorSessionState() || isErrorNoFaceState() || isErrorNoInternetConnection() || isErrorUserTooFar() || isErrorUserNotCenter() || isErrorMultipleFaceState() || (allowsMultipleRetries && isSuccessState())" (click)="resetUI()" class="btn btn-primary btn-id3 mt-3">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'RETRY_BUTTON_LABEL\')}}\r\n </button>\r\n\r\n <button type="button" *ngIf="isMatchingReadyState()" class="btn btn-primary btn-id3 mt-3" (click)="compareWithReference()">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'COMPARE_BUTTON_LABEL\')}}\r\n </button>\r\n <button type="button" *ngIf="isMatchingSuccessState()|| isMatchingErrorState()" class="btn btn-primary btn-id3 mt-3" (click)="resetUI()">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'RESTART_BUTTON_LABEL\')}}\r\n </button>\r\n\r\n </div>\r\n </div>\r\n </div>',styles:['.padContainer{position:relative;margin:auto}.padContainer .h1,.padContainer .h2,.padContainer .h3,.padContainer .h4,.padContainer .h5,.padContainer .h6,.padContainer h1,.padContainer h2,.padContainer h3,.padContainer h4,.padContainer h5,.padContainer h6{font-family:"PT Sans",sans-serif;font-weight:700;font-size:50px}.padContainer .liveStream{z-index:1;top:0;left:0;width:100%;height:auto}.padContainer .btn-id3{border-radius:10px}.padContainer .font-weight-normal{width:250px;text-align:left}.padContainer .id3-pad-overlay{z-index:3;position:absolute;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;color:#fff;font-size:20px;flex-direction:column;border:1px solid #ddd}.padContainer .extras{display:flex;top:15;right:15;left:15;width:100%;align-items:left}.padContainer .pad-content{position:absolute;display:block;text-align:center}.padContainer .pad-buttons{position:absolute;display:block;text-align:center;bottom:5%}.padContainer .padBehaviorLabel{font-size:20px}.padContainer .breathe{margin:6px 10px}.padContainer .id3-overlay{position:absolute}.padContainer .canvas{z-index:2;top:0;left:0;width:100%;height:100%;position:absolute}.padContainer .mirror{transform:rotateY(180deg);-webkit-transform:rotateY(180deg);-moz-transform:rotateY(180deg)}@media only screen and (max-width:500px){.show-big-screen{display:none}}@media only screen and (min-width:500px){.show-small-screen{display:none}}@media only screen and (min-width:601px){h4{font-size:25px}}@media only screen and (max-width:600px){h1{font-size:27px!important;margin-left:15%}h4{font-size:25px}}']}]}],e.ctorParameters=function(){return[{type:h},{type:i.HttpClient}]},e.propDecorators={canvasResult:[{type:t.ViewChild,args:["resultCanvas",{static:!1}]}],videoPAD:[{type:t.ViewChild,args:["videoPAD",{static:!1}]}],fileForMatching:[{type:t.ViewChild,args:["fileForMatching",{static:!1}]}],wsEndpoint:[{type:t.Input}],wsFormatPicture:[{type:t.Input}],wsFaceVerification:[{type:t.Input}],wsImageSize:[{type:t.Input}],apiKey:[{type:t.Input}],autoStart:[{type:t.Input}],faceTracking:[{type:t.Input}],faceTrackingOptionDesign:[{type:t.Input}],mirror:[{type:t.Input}],processProgressCircle:[{type:t.Input}],colorProgressCircle:[{type:t.Input}],circleRadius:[{type:t.Input}],formatFinalPicture:[{type:t.Input}],downloadFinalPictureOnSuccess:[{type:t.Input}],resultPictureWidth:[{type:t.Input}],enableAutoMatching:[{type:t.Input}],allowsMultipleRetries:[{type:t.Input}],videoWidth:[{type:t.Input}],videoHeight:[{type:t.Input}],videoWidthMobile:[{type:t.Input}],videoHeightMobile:[{type:t.Input}],frameWidth:[{type:t.Input}],minHeadSize:[{type:t.Input}],messagesEnabled:[{type:t.Input}],padFrequency:[{type:t.Input}],startTipsLabel:[{type:t.Input}],processFaceCenterLabel:[{type:t.Input}],processNoFaceLabel:[{type:t.Input}],processMultipleFaceLabel:[{type:t.Input}],turnFaceLabel:[{type:t.Input}],expiredSessionErrorLabel:[{type:t.Input}],noFaceErrorLabel:[{type:t.Input}],multipleFaceErrorLabel:[{type:t.Input}],successLabel:[{type:t.Input}],startButtonLabel:[{type:t.Input}],restartButtonLabel:[{type:t.Input}],compareButtonLabel:[{type:t.Input}],enableCamButtonLabel:[{type:t.Input}],retryButtonLabel:[{type:t.Input}],matchingSuccessLabel:[{type:t.Input}],matchingReadyLabel:[{type:t.Input}],matchingErrorLabel:[{type:t.Input}],noInternetConnectionLabel:[{type:t.Input}],userTooFarLabel:[{type:t.Input}],userNotCenterLabel:[{type:t.Input}],faceDetectedHandler:[{type:t.Output}],cameraHandler:[{type:t.Output}],sessionExpiredHandler:[{type:t.Output}],changeStateHandler:[{type:t.Output}],matchingHandler:[{type:t.Output}],compareWithReference:[{type:t.Input}]},e}(),g=function(){function e(){this.processInstruction=""}return e.prototype.ngOnInit=function(){},e.prototype.isRequestPermissionState=function(){return this.padState===d.REQUEST_PERMISSIONS},e.prototype.isInitialState=function(){return this.padState===d.INITIAL},e.prototype.isStartedState=function(){return this.padState===d.STARTED},e.prototype.isProcessingState=function(){return this.padState===d.PROCESS},e.prototype.isErrorSessionState=function(){return this.padState===d.ERROR_SESSION},e.prototype.isErrorNoFaceState=function(){return this.padState===d.ERROR_NO_FACE},e.prototype.isErrorNoInternetConnection=function(){return this.padState===d.ERROR_NO_INTERNET_CONNECTION},e.prototype.isErrorUserTooFar=function(){return this.padState===d.ERROR_USER_TOO_FAR},e.prototype.isErrorUserNotCenter=function(){return this.padState===d.ERROR_USER_NOT_CENTER},e.prototype.isErrorMultipleFaceState=function(){return this.padState===d.ERROR_MULTIPLE_FACE},e.prototype.isSuccessState=function(){return this.padState===d.SUCCESS},e.prototype.isMatchingReadyState=function(){return this.padState===d.MATCH_READY},e.prototype.isMatchingSuccessState=function(){return this.padState===d.MATCH_SUCCESS},e.prototype.isMatchingErrorState=function(){return this.padState===d.MATCH_ERROR},e.prototype.isInvalidKeyState=function(){return this.padState===d.ERROR_KEY},e.decorators=[{type:t.Component,args:[{selector:"id3-face-pad-messages",template:'<div class="mt-2">\r\n <div *ngIf="isInitialState()" class="alert alert-primary" role="alert">\r\n {{startTipsLabel}}\r\n </div>\r\n <div *ngIf="isStartedState() || (isProcessingState() && processInstruction.length>0)" class="alert alert-danger" role="alert">\r\n {{processInstruction}}\r\n </div>\r\n <div *ngIf="isProcessingState() && processInstruction.length==0" class="alert alert-primary" role="alert">\r\n {{turnFaceLabel}}\r\n </div>\r\n <div *ngIf="isErrorSessionState()" class="alert alert-danger" role="alert">\r\n {{expiredSessionErrorLabel}}\r\n </div>\r\n <div *ngIf="isErrorNoFaceState()" class="alert alert-danger" role="alert">\r\n {{noFaceErrorLabel}}\r\n </div>\r\n <div *ngIf="isErrorNoInternetConnection()" class="alert alert-danger" role="alert">\r\n {{noInternetConnectionLabel}}\r\n </div>\r\n <div *ngIf="isErrorUserTooFar()" class="alert alert-primary" role="alert">\r\n {{userTooFarLabel}}\r\n </div>\r\n <div *ngIf="isErrorUserNotCenter()" class="alert alert-danger" role="alert">\r\n {{userNotCenterLabel}}\r\n </div>\r\n <div *ngIf="isErrorMultipleFaceState()" class="alert alert-danger" role="alert">\r\n {{multipleFaceErrorLabel}}\r\n </div>\r\n <div *ngIf="isSuccessState()" class="alert alert-success" role="alert">\r\n {{successLabel}}\r\n </div>\r\n <div *ngIf="isMatchingReadyState()" class="alert alert-primary" role="alert">\r\n {{matchingReadyLabel}}\r\n </div>\r\n <div *ngIf="isMatchingSuccessState()" class="alert alert-success" role="alert">\r\n {{matchingSuccessLabel}}\r\n </div>\r\n <div *ngIf="isMatchingErrorState()" class="alert alert-danger" role="alert">\r\n {{matchingErrorLabel}}\r\n </div>\r\n <div *ngIf="isInvalidKeyState()" class="alert alert-danger" role="alert">\r\n The API Key is invalid. Please check your API key.\r\n </div>\r\n</div>'}]}],e.ctorParameters=function(){return[]},e.propDecorators={startTipsLabel:[{type:t.Input}],turnFaceLabel:[{type:t.Input}],expiredSessionErrorLabel:[{type:t.Input}],noFaceErrorLabel:[{type:t.Input}],noInternetConnectionLabel:[{type:t.Input}],userTooFarLabel:[{type:t.Input}],userNotCenterLabel:[{type:t.Input}],multipleFaceErrorLabel:[{type:t.Input}],successLabel:[{type:t.Input}],matchingSuccessLabel:[{type:t.Input}],matchingReadyLabel:[{type:t.Input}],matchingErrorLabel:[{type:t.Input}],padState:[{type:t.Input}],processInstruction:[{type:t.Input}]},e}(),S=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{declarations:[E,g],imports:[i.HttpClientModule,n.CommonModule,s.BrowserModule],exports:[E],entryComponents:[E]}]}],e}();e.FacePadComponent=E,e.FacePadModule=S,e.FacePadService=h,e.ɵa=g,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("@id3/facedetector"),require("downloadjs"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@id3/face-pad",["exports","@angular/core","@angular/common/http","@id3/facedetector","downloadjs","@angular/common","@angular/platform-browser"],t):t(((e=e||self).id3=e.id3||{},e.id3["face-pad"]={}),e.ng.core,e.ng.common.http,e.FaceDetector,e.Downloadjs,e.ng.common,e.ng.platformBrowser)}(this,function(e,t,i,r,a,n,s){"use strict";function o(e,t,i,r){return new(i||(i=Promise))(function(a,n){function s(e){try{c(r.next(e))}catch(e){n(e)}}function o(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){e.done?a(e.value):new i(function(t){t(e.value)}).then(s,o)}c((r=r.apply(e,t||[])).next())})}function c(e,t){var i,r,a,n,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,r&&(a=2&n[0]?r.return:n[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,n[1])).done)return a;switch(r=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,r=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=(a=s.trys).length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],r=0}finally{i=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}}a=a&&a.hasOwnProperty("default")?a.default:a;var h=function(){function e(){}return e.prototype.connect=function(e,t){var i=this;return new Promise(function(r,a){i.ws=new WebSocket(e+"/pad/session"),i.ws.onopen=function(){console.log("Info: Connection PAD Established."),r(!0)},i.ws.onmessage=t,i.ws.onclose=function(e){console.log("Info: Closing PAD Connection."),a(!1)}})},e.prototype.disconnect=function(){null!=this.ws&&(this.ws.close(),this.ws=null)},e.prototype.isConnected=function(){return null!=this.ws&&this.ws.readyState===this.ws.OPEN},e.prototype.sendMessage=function(e){null!=this.ws?this.ws.bufferedAmount>2e5?console.log("Image not sent : Web socket buffer is too big. We have to wait the previous messages to be send before sending a new message."):this.ws.send(JSON.stringify(e)):console.warn("connection to web socket not established, please connect.")},e.prototype.waitForSocketConnection=function(e,t){var i=this;setTimeout(function(){1===e.readyState?(console.log("Connection is made"),null!=t&&t()):(console.log("wait for connection..."),i.waitForSocketConnection(e,t))},5)},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}(),d={REQUEST_PERMISSIONS:0,INITIAL:1,STARTED:2,PROCESS:3,SUCCESS:4,ERROR_KEY:5,ERROR_SESSION:6,ERROR_NO_FACE:7,ERROR_MULTIPLE_FACE:8,ERROR_NO_INTERNET_CONNECTION:9,ERROR_USER_TOO_FAR:10,ERROR_USER_NOT_CENTER:11,MATCH_READY:12,MATCH_SUCCESS:13,MATCH_ERROR:14};d[d.REQUEST_PERMISSIONS]="REQUEST_PERMISSIONS",d[d.INITIAL]="INITIAL",d[d.STARTED]="STARTED",d[d.PROCESS]="PROCESS",d[d.SUCCESS]="SUCCESS",d[d.ERROR_KEY]="ERROR_KEY",d[d.ERROR_SESSION]="ERROR_SESSION",d[d.ERROR_NO_FACE]="ERROR_NO_FACE",d[d.ERROR_MULTIPLE_FACE]="ERROR_MULTIPLE_FACE",d[d.ERROR_NO_INTERNET_CONNECTION]="ERROR_NO_INTERNET_CONNECTION",d[d.ERROR_USER_TOO_FAR]="ERROR_USER_TOO_FAR",d[d.ERROR_USER_NOT_CENTER]="ERROR_USER_NOT_CENTER",d[d.MATCH_READY]="MATCH_READY",d[d.MATCH_SUCCESS]="MATCH_SUCCESS",d[d.MATCH_ERROR]="MATCH_ERROR";var l=function(){function e(){}return e.messages=new Map([["START_TIPS_LABEL","Cliquez sur Démarrer lorsque vous êtes prêt"],["PROCESS_FACE_CENTER_LABEL","Visage detecté, mais non centré. Veuillez regarder la caméra en mettant votre visage bien en face"],["PROCESS_NO_FACE_LABEL","Pas de visage detecté. Veuillez vous positionner au centre de l'écran."],["PROCESS_MULTIPLE_FACE_LABEL","Plusieurs visages detectés. La detection ne fonctionne qu'avec un seul visage."],["TURN_FACE_LABEL","Maintenant, tournez lentement la tête (vers la droite ou vers la gauche)"],["EXPIRED_SESSION_ERROR_LABEL","La session a expiré. Veuillez réessayer"],["NO_FACE_ERROR_LABEL","Pas de visage detecté. Veuillez réessayer"],["NO_INTERNET_CONNECTION_LABEL","Connection internet perdue. Veuillez réessayer"],["MULTIPLE_FACE_ERROR_LABEL","Plusieurs visages detectés. Veuillez réessayer"],["MATCHING_SUCCESS_LABEL","Le visage correspond bien à la photo de référence"],["MATCHING_READY_LABEL",'La photo est prête à être comparée avec une référence.Veuillez cliquer sur le bouton "Verifier" puis choisir une photo de référence.'],["MATCHING_ERROR_LABEL","Le visage ne correspond pas à la photo de référence"],["SUCCESS_LABEL","La detection du visage a réussi."],["START_BUTTON_LABEL","Démarrer"],["RESTART_BUTTON_LABEL","Recommencer"],["COMPARE_BUTTON_LABEL","Vérifier"],["ENABLE_CAM_BUTTON_LABEL","Activer la webcam"],["RETRY_BUTTON_LABEL","Réessayer"],["USER_TOO_FAR_LABEL","Vous êtes trop loin, veuillez vous rapprocher de la caméra"],["USER_NOT_CENTER_LABEL","Veuillez vous positionner à l'intérieur de la zone cible"]]),e}(),p=function(){function e(){}return e.messages=new Map([["START_TIPS_LABEL","Press on Start button when you are ready"],["PROCESS_FACE_CENTER_LABEL","Face detected, but not centered. Please look straight to the camera"],["PROCESS_NO_FACE_LABEL","No face detected. Please look straight to the camera."],["PROCESS_MULTIPLE_FACE_LABEL","Multiple faces detected. Only one person is allowed in the detection."],["TURN_FACE_LABEL","Now, please turn your face (look at the right or at the left)"],["EXPIRED_SESSION_ERROR_LABEL","Session has expired. Please try again."],["NO_FACE_ERROR_LABEL","No face detected. Please try again."],["NO_INTERNET_CONNECTION_LABEL","Internet connection lost. Please try again"],["MULTIPLE_FACE_ERROR_LABEL","Multiple faces detected. Please try again."],["MATCHING_SUCCESS_LABEL","Detected face successfully match the reference picture."],["MATCHING_READY_LABEL",'Picture is ready to be compared with a reference picture.Please click on the "Compare" button to upload the reference picture.'],["MATCHING_ERROR_LABEL","Detected face does not match the reference picture"],["SUCCESS_LABEL","Live face successfully detected."],["START_BUTTON_LABEL","Start"],["RESTART_BUTTON_LABEL","Restart"],["COMPARE_BUTTON_LABEL","Compare"],["ENABLE_CAM_BUTTON_LABEL","Start the webcam"],["RETRY_BUTTON_LABEL","Retry"],["USER_TOO_FAR_LABEL","Too far away, please move closer"],["USER_NOT_CENTER_LABEL","Please, move on the target area"]]),e}(),u=function(){function e(){}return e.messages=new Map([["START_TIPS_LABEL","Pressione no botão Iniciar quando estiver pronto"],["PROCESS_FACE_CENTER_LABEL","Rosto detectado, mas não centrado. Por favor, olhe diretamente para a câmera"],["PROCESS_NO_FACE_LABEL","Nenhum rosto detectado. Por favor, olhe diretamente para a câmera."],["PROCESS_MULTIPLE_FACE_LABEL","Múltiplos rostos detectados. Apenas uma pessoa é permitida na detecção."],["TURN_FACE_LABEL","Agora, por favor, vire seu rosto (olhe para a direita ou para a esquerda)"],["EXPIRED_SESSION_ERROR_LABEL","Sessão expirou. Por favor, tente novamente."],["NO_FACE_ERROR_LABEL","Nenhum rosto detectado. Por favor, tente novamente."],["NO_INTERNET_CONNECTION_LABEL","Conexão perdida com a internet. Por favor, tente novamente."],["MULTIPLE_FACE_ERROR_LABEL","Múltiplos rostos detectados. Por favor, tente novamente."],["MATCHING_SUCCESS_LABEL","A face detectada corresponde com sucesso à imagem de referência."],["MATCHING_READY_LABEL",'A imagem está pronta para ser comparada com uma imagem de referência.Por favor, clique no botão "Comparar" para carregar a imagem de referência.'],["MATCHING_ERROR_LABEL","Detected face does not match the reference picture"],["SUCCESS_LABEL","O rosto detectado não corresponde à imagem de referência"],["START_BUTTON_LABEL","Iniciar"],["RESTART_BUTTON_LABEL","Começar de novo"],["COMPARE_BUTTON_LABEL","Comparar"],["ENABLE_CAM_BUTTON_LABEL","Comece a webcam"],["RETRY_BUTTON_LABEL","Tente novamente"],["USER_TOO_FAR_LABEL","Você está longe demais, por favor, aproxime-se da câmera"],["USER_NOT_CENTER_LABEL","Por favor posicione-se dentro da área alvo"]]),e}(),E=function(){function e(e,i){this.facePadService=e,this.httpClient=i,this.mapLanguage=new Map,this.wsEndpoint="http://localhost:8085",this.wsFormatPicture="/api/face/rotate-and-crop",this.wsFaceVerification="/api/face/match/pictures",this.wsImageSize="/api/parameters",this.apiKey="",this.autoStart=!1,this.faceTracking=!1,this.faceTrackingOptionDesign=!1,this.mirror=!1,this.processProgressCircle=!1,this.circleRadius=200,this.formatFinalPicture=!1,this.downloadFinalPictureOnSuccess=!1,this.resultPictureWidth=600,this.enableAutoMatching=!1,this.allowsMultipleRetries=!1,this.videoWidth=800,this.videoHeight=600,this.videoWidthMobile=600,this.videoHeightMobile=800,this.frameWidth=120,this.minHeadSize=0,this.messagesEnabled=!0,this.padFrequency=100,this.faceDetectedHandler=new t.EventEmitter,this.cameraHandler=new t.EventEmitter,this.sessionExpiredHandler=new t.EventEmitter,this.changeStateHandler=new t.EventEmitter,this.matchingHandler=new t.EventEmitter,this.messages=new Map,this.padState=d.REQUEST_PERMISSIONS,this.videoConstraints={audio:!1,video:!0},this.processInstruction="",this.mapLanguage.set("fr",l.messages),this.mapLanguage.set("en",p.messages),this.mapLanguage.set("pt",u.messages)}return e.prototype.ngOnInit=function(){this.isDeviceMobile(),this.languageFile=this.mapLanguage.get(navigator.language.substr(0,2)),this.languageFile||(this.languageFile=p),this.messages.set("START_TIPS_LABEL",this.startTipsLabel),this.messages.set("PROCESS_FACE_CENTER_LABEL",this.processFaceCenterLabel),this.messages.set("PROCESS_NO_FACE_LABEL",this.processNoFaceLabel),this.messages.set("PROCESS_MULTIPLE_FACE_LABEL",this.processMultipleFaceLabel),this.messages.set("TURN_FACE_LABEL",this.turnFaceLabel),this.messages.set("EXPIRED_SESSION_ERROR_LABEL",this.expiredSessionErrorLabel),this.messages.set("NO_FACE_ERROR_LABEL",this.noFaceErrorLabel),this.messages.set("MULTIPLE_FACE_ERROR_LABEL",this.multipleFaceErrorLabel),this.messages.set("SUCCESS_LABEL",this.successLabel),this.messages.set("START_BUTTON_LABEL",this.startButtonLabel),this.messages.set("RESTART_BUTTON_LABEL",this.restartButtonLabel),this.messages.set("COMPARE_BUTTON_LABEL",this.compareButtonLabel),this.messages.set("ENABLE_CAM_BUTTON_LABEL",this.enableCamButtonLabel),this.messages.set("RETRY_BUTTON_LABEL",this.retryButtonLabel),this.messages.set("MATCHING_SUCCESS_LABEL",this.matchingSuccessLabel),this.messages.set("MATCHING_READY_LABEL",this.matchingReadyLabel),this.messages.set("MATCHING_ERROR_LABEL",this.matchingErrorLabel),this.messages.set("NO_INTERNET_CONNECTION_LABEL",this.noInternetConnectionLabel),this.messages.set("USER_TOO_FAR_LABEL",this.userTooFarLabel),this.messages.set("USER_NOT_CENTER_LABEL",this.userNotCenterLabel)},e.prototype.ngOnDestroy=function(){clearTimeout(this.retryCallPadStart),this.facePadService.disconnect(),this.faceDetector&&this.faceDetector.stop()},e.prototype.ngAfterViewInit=function(){this.autoStart&&(this.initPadSource(),this.getDatasVideoPAD())},e.prototype.processServerResponse=function(e){var t=this;this.processCompletion=e.processCompletion,e.result?(this.padState=d.SUCCESS,this.endSessionPad(),this.manageFinalPicture()):(this.processInstruction="",e.errorType||this.padState!==d.STARTED?"INVALID_YAW"===e.errorType||"INVALID_PITCH"===e.errorType?(this.processInstruction=this.getMessage("PROCESS_FACE_CENTER_LABEL"),this.retryCallPadStart=setTimeout(function(){return t.prepareCallPADStart()},500)):"INVALID_KEY"===e.errorType?(this.padState=d.ERROR_KEY,this.emitInvalidKeyEvent()):"INVALID_FACE"===e.errorType?this.padState===d.PROCESS?(0===e.faceCount?this.padState=d.ERROR_NO_FACE:e.faceCount>1&&(this.padState=d.ERROR_MULTIPLE_FACE),this.endSessionPad()):this.padState===d.STARTED&&(0===e.faceCount?this.processProgressCircle?this.processInstruction=this.getMessage("USER_NOT_CENTER_LABEL"):this.processInstruction=this.getMessage("PROCESS_NO_FACE_LABEL"):e.faceCount>1&&(this.processInstruction=this.getMessage("PROCESS_MULTIPLE_FACE_LABEL")),setTimeout(function(){return t.prepareCallPADStart()},500)):"INVALID_SESSION"===e.errorType&&(this.padState=d.ERROR_SESSION,this.endSessionPad(),this.emitSessionExpiredEvent()):(this.padState=d.PROCESS,this.alarmThread=setInterval(function(){return t.prepareCallPADContinue()},this.padFrequency)))},e.prototype.endSessionPad=function(){clearInterval(this.alarmThread),this.alarmThread=void 0,this.xCoord=void 0,this.yCoord=void 0,this.wCoord=void 0,this.hCoord=void 0,this.ngOnDestroy()},e.prototype.getMessage=function(e){return!this.messages.get(e)&&this.languageFile?this.languageFile.get(e):this.messages.get(e)},e.prototype.getDatasVideoPAD=function(){var e=this;this.videoPAD.nativeElement.addEventListener("loadedmetadata",function(t){e.width=e.videoPAD.nativeElement.videoWidth,e.height=e.videoPAD.nativeElement.videoHeight,e.ratioWidth=e.width/e.videoWidth,e.ratioHeight=e.height/e.videoHeight},!1)},e.prototype.isRequestPermissionState=function(){return this.padState===d.REQUEST_PERMISSIONS},e.prototype.isInitialState=function(){return this.padState===d.INITIAL},e.prototype.isStartedState=function(){return this.padState===d.STARTED},e.prototype.isProcessingState=function(){return this.padState===d.PROCESS},e.prototype.isErrorSessionState=function(){return this.padState===d.ERROR_SESSION},e.prototype.isErrorNoFaceState=function(){return this.padState===d.ERROR_NO_FACE},e.prototype.isErrorNoInternetConnection=function(){return this.padState===d.ERROR_NO_INTERNET_CONNECTION},e.prototype.isErrorUserTooFar=function(){return this.padState===d.ERROR_USER_TOO_FAR},e.prototype.isErrorUserNotCenter=function(){return this.padState===d.ERROR_USER_NOT_CENTER},e.prototype.isErrorMultipleFaceState=function(){return this.padState===d.ERROR_MULTIPLE_FACE},e.prototype.isSuccessState=function(){return this.padState===d.SUCCESS},e.prototype.isInvalidKeyState=function(){return this.padState===d.ERROR_KEY},e.prototype.isMatchingReadyState=function(){return this.padState===d.MATCH_READY},e.prototype.isMatchingSuccessState=function(){return this.padState===d.MATCH_SUCCESS},e.prototype.isMatchingErrorState=function(){return this.padState===d.MATCH_ERROR},e.prototype.isDeviceMobile=function(){return window.innerHeight>window.innerWidth&&(this.videoWidth=this.videoWidthMobile,this.videoHeight=this.videoHeightMobile),window.innerHeight>window.innerWidth},e.prototype.initPadSource=function(){return o(this,void 0,void 0,function(){var e,t,i=this;return c(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=this,[4,navigator.mediaDevices.getUserMedia(this.videoConstraints)];case 1:return e.videoPADStream=r.sent(),this.videoPAD&&(this.videoPAD.nativeElement.srcObject=this.videoPADStream),this.handleSuccess(),this.padState=d.INITIAL,this.getMinHeadSize(),window.addEventListener("beforeunload",function(){return i.leaving()}),[3,3];case 2:return t=r.sent(),console.log("Error : "+t),[3,3];case 3:return[2]}})})},e.prototype.leaving=function(){this.videoPADStream.stop()},e.prototype.handleSuccess=function(){var e=this.videoPADStream.getVideoTracks();this.emitCameraEvent("Got stream with constraints: "+JSON.stringify(this.videoConstraints)),this.emitCameraEvent("Using video device: "+JSON.stringify(e[0].label))},e.prototype.prepareCallPADStart=function(){var e=this;this.facePadService.isConnected()?this.callPADStart():this.facePadService.connect(this.wsEndpoint.replace("http","ws"),function(t){return e.processServerResponse(JSON.parse(t.data))}).then(function(t){e.callPADStart()}).catch(function(t){e.padState=d.ERROR_NO_INTERNET_CONNECTION,e.endSessionPad()})},e.prototype.callPADStart=function(){var e=this;try{!this.faceTracking||this.faceDetector&&this.faceDetector.isRunning()?this.processProgressCircle&&!this.faceTracking&&(this.isCircleRunning||(this.progressCircle(),this.isCircleRunning=!0)):this.faceTracker();var t=this.frameWidth/this.videoPAD.nativeElement.clientWidth;this.padState=d.STARTED;var i=document.createElement("canvas");if(this.faceTracking&&this.faceDetector.isRunning()&&this.xCoord&&!this.processProgressCircle){i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight;var r=1.5*this.wCoord*this.ratioWidth,a=(this.xCoord-(r-this.wCoord))*this.ratioWidth,n=1.5*this.hCoord*this.ratioHeight,s=(this.yCoord-(n-this.hCoord))*this.ratioHeight;i.height*this.hCoord/this.videoHeight<this.minHeadSize?this.padState=d.ERROR_USER_TOO_FAR:(i.getContext("2d").drawImage(this.videoPAD.nativeElement,+a,s,r,n,0,0,i.width,i.height),i.toBlob(function(t){e.photoPADStart=t,e.emitChangeStateEvent("PAD Start photo blob generated"),e.doPADStart()},"image/jpeg"))}else this.processProgressCircle&&!this.faceTracking?(i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight,i.getContext("2d").drawImage(this.videoPAD.nativeElement,this.width/2-2*this.circleRadius*this.ratioWidth/2,this.height/2-2*this.circleRadius*this.ratioHeight/2,2*this.circleRadius*this.ratioWidth,2*this.circleRadius*this.ratioHeight,0,0,i.width,i.height),i.toBlob(function(t){e.photoPADStart=t,e.emitChangeStateEvent("PAD Start photo blob generated"),e.doPADStart()},"image/jpeg")):(i.width=this.frameWidth,i.height=this.videoPAD.nativeElement.clientHeight*t,i.getContext("2d").drawImage(this.videoPAD.nativeElement,0,0,i.width,i.height),i.toBlob(function(t){e.photoPADStart=t,e.emitChangeStateEvent("PAD Start photo blob generated"),e.doPADStart()},"image/jpeg"));var o=this.resultPictureWidth/this.videoPAD.nativeElement.clientWidth,c=document.createElement("canvas");this.faceTracking&&this.faceDetector.isRunning()&&this.xCoord?(c.width=1.5*this.wCoord,c.height=1.5*this.hCoord,this.xCoord-=c.width-this.wCoord,this.yCoord-=c.height-this.hCoord,c.getContext("2d").drawImage(this.videoPAD.nativeElement,+this.xCoord,this.yCoord,c.width,c.height,0,0,c.width,c.height)):(c.width=this.resultPictureWidth,c.height=this.videoPAD.nativeElement.clientHeight*o,c.getContext("2d").drawImage(this.videoPAD.nativeElement,0,0,c.width,c.height)),c.toBlob(function(t){e.photoPADStartOriginal=t,e.emitChangeStateEvent("PAD Start photo original blob generated")},"image/jpeg")}catch(e){console.error(e),this.emitChangeStateEvent("Exception at prepareCallPADStart(): "+JSON.stringify(e))}},e.prototype.doPADStart=function(){return o(this,void 0,void 0,function(){var e;return c(this,function(t){switch(t.label){case 0:return[4,new Response(this.photoPADStart).arrayBuffer()];case 1:return e=t.sent(),this.facePadService.sendMessage({faceImage:this.arrayBufferToBase64(e),typeMessagePad:"START",apiKey:this.apiKey}),[2]}})})},e.prototype.prepareCallPADContinue=function(){var e=this;if(this.facePadService.isConnected())try{var t=this.frameWidth/this.videoPAD.nativeElement.clientWidth,i=document.createElement("canvas");if(this.faceTracking&&this.faceDetector.isRunning()&&this.xCoord){i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight;var r=1.5*this.wCoord*this.ratioWidth,a=(this.xCoord-(r-this.wCoord))*this.ratioWidth,n=1.5*this.hCoord*this.ratioHeight,s=(this.yCoord-(n-this.hCoord))*this.ratioHeight;i.height*this.hCoord/this.videoHeight<this.minHeadSize?this.processInstruction=this.getMessage("USER_TOO_FAR_LABEL"):(i.getContext("2d").drawImage(this.videoPAD.nativeElement,+a,s,r,n,0,0,i.width,i.height),this.tempToBlob(i))}else this.processProgressCircle&&!this.faceTracking?(i.width=3*this.minHeadSize*this.ratioWidth,i.height=3*this.minHeadSize*this.ratioHeight,i.getContext("2d").drawImage(this.videoPAD.nativeElement,this.width/2-2*this.circleRadius*this.ratioWidth/2,this.height/2-2*this.circleRadius*this.ratioHeight/2,2*this.circleRadius*this.ratioWidth,2*this.circleRadius*this.ratioHeight,0,0,i.width,i.height),this.tempToBlob(i)):(i.width=this.frameWidth,i.height=this.videoPAD.nativeElement.clientHeight*t,i.getContext("2d").drawImage(this.videoPAD.nativeElement,0,0,i.width,i.height),this.tempToBlob(i))}catch(e){this.emitChangeStateEvent("Exception at prepareCallPADContinue(): "+JSON.stringify(e))}else this.endSessionPad(),this.padState=d.ERROR_NO_INTERNET_CONNECTION,setTimeout(function(){return e.initPadSource()},5e3)},e.prototype.arrayBufferToBase64=function(e){for(var t="",i=new Uint8Array(e),r=i.byteLength,a=0;a<r;a++)t+=String.fromCharCode(i[a]);return window.btoa(t)},e.prototype.manageFinalPicture=function(){this.formatFinalPicture?this.rotateAndCropFinalPicture():(this.generatedPicture=this.photoPADStartOriginal,this.emitFaceDetectedEvent(),!this.enableAutoMatching&&this.downloadFinalPictureOnSuccess?this.downloadPicture():this.enableAutoMatching&&this.showInstructionToUploadReference())},e.prototype.showInstructionToUploadReference=function(){this.padState=d.MATCH_READY},e.prototype.rotateAndCropFinalPicture=function(){var e=this,t=new i.HttpHeaders;t=(t=t.append("Accept","application/json")).append("ApiKeyAuth",this.apiKey);var r=new FormData;r.append("picture",this.photoPADStartOriginal),this.httpClient.post(this.wsEndpoint+this.wsFormatPicture,r,{headers:t}).subscribe(function(t){if(t.length>0){var i=e.b64toBlob("data:image/png;base64,"+t[0].picture);e.generatedPicture=i,e.faceDetectedHandler.emit(i),e.enableAutoMatching?e.showInstructionToUploadReference():e.downloadFinalPictureOnSuccess&&e.downloadPicture()}else console.warn("No picture generated from the original picture by the rotate-and-crop method")},function(t){417===t.status?(e.padState=d.ERROR_MULTIPLE_FACE,e.endSessionPad()):404===t.status?(e.padState=d.ERROR_NO_FACE,e.endSessionPad()):0===t.status?(e.padState=d.ERROR_NO_INTERNET_CONNECTION,e.endSessionPad()):console.error("No picture generated from the original picture by the rotate-and-crop method. Error : "+t)})},e.prototype.b64toBlob=function(e){for(var t=atob(e.split(",")[1]),i=new ArrayBuffer(t.length),r=new Uint8Array(i),a=0;a<t.length;a++)r[a]=t.charCodeAt(a);return new Blob([i],{type:"image/png"})},e.prototype.emitFaceDetectedEvent=function(){this.faceDetectedHandler.emit(this.photoPADStartOriginal)},e.prototype.emitInvalidKeyEvent=function(){},e.prototype.emitSessionExpiredEvent=function(){this.sessionExpiredHandler.emit(!0)},e.prototype.emitCameraEvent=function(e){this.cameraHandler.emit(e)},e.prototype.emitChangeStateEvent=function(e){this.changeStateHandler.emit(e)},e.prototype.resetUI=function(){this.padState=d.INITIAL},e.prototype.compareWithReference=function(e){if(e||(e=this.generatedPicture),e)document.getElementById("id3-fileForMatching").click();else{var t="PAD Result picture is missing. You have to execute the entire PAD process before calling the Matching Javascript function.\n";t+="IMPORTANT NOTE : If you are using the pureJS component, you have to provide the picture in argument (mandatory).",console.error(t),this.matchingHandler&&this.matchingHandler.error(t)}},e.prototype.handleFiles=function(e){var t=this,r=new i.HttpHeaders;r=(r=r.append("Accept","application/json")).append("ApiKeyAuth",this.apiKey);var a=URL.createObjectURL(e.target.files[0]),n=new Image;n.onload=function(){var e=500/n.width,i=document.createElement("canvas");i.width=500,i.height=n.height*e,i.getContext("2d").drawImage(n,0,0,i.width,i.height),i.toBlob(function(e){return o(t,void 0,void 0,function(){var t,i=this;return c(this,function(a){return(t=new FormData).append("reference",e),t.append("probe",this.photoPADStartOriginal),this.httpClient.post(this.wsEndpoint+this.wsFaceVerification,t,{headers:r}).subscribe(function(e){i.matchingHandler.emit(e),e.decision?i.padState=d.MATCH_SUCCESS:i.padState=d.MATCH_ERROR,e.decision&&i.downloadFinalPictureOnSuccess&&i.downloadPicture()},function(e){i.padState=d.MATCH_ERROR,i.matchingHandler.error("An error occured during the Matching process. Please retry later.")}),[2]})})},"image/jpeg")},n.src=a},e.prototype.downloadPicture=function(){return o(this,void 0,void 0,function(){var e,t;return c(this,function(i){switch(i.label){case 0:return[4,new Response(this.generatedPicture).arrayBuffer()];case 1:return e=i.sent(),t="data:image/jpeg;base64,"+this.arrayBufferToBase64(e),a(t,"face-result.jpeg","image/jpeg"),[2]}})})},e.prototype.faceTracker=function(){var e=this,t=this.videoPAD.nativeElement,i=this.canvasResult.nativeElement,a=i.getContext("2d");i.width=this.videoWidth,i.height=this.videoHeight,this.faceDetector=new r({video:t,flipLeftRight:!1,flipUpsideDown:!1}),this.faceDetector.startDetecting(),this.faceDetector.setOnFaceLostCallback(function(e,t){a.clearRect(0,0,i.width,i.height)}),this.faceDetector.setOnFaceUpdatedCallback(function(t){a.clearRect(0,0,i.width,i.height),e.faceTrackingOptionDesign?(a.strokeStyle="rgba(0,200,200,0)",a.fillStyle="rgba(0,200,200,0)"):(a.strokeStyle="rgba(0,221,52,1.0)",a.fillStyle="rgba(0,221,52,0.08)"),a.lineWidth=2,t.forEach(function(t){a.beginPath();var r=t.width*i.width/2,n=1.5*t.height*i.height/2;a.ellipse(t.x*i.width+r,t.y*i.height+n-n/2,r,n,0,0,2*Math.PI),a.stroke(),a.fill(),e.faceTrackingOptionDesign&&(a.strokeStyle="rgba(0,200,200,0)",a.lineWidth="10",a.fillStyle="rgba(0, 0, 0, 0.7)",a.beginPath(),a.moveTo(0,0),a.lineTo(0,i.height),a.lineTo(i.width/2,i.height),a.lineTo(t.x*i.width+2*r,t.y*i.height+2*n),a.ellipse(t.x*i.width+r,t.y*i.height+n-n/2,r,n,0,Math.PI/2,Math.PI/2.000001),a.lineTo(i.height/2,i.height),a.lineTo(i.width,i.height),a.lineTo(i.width,0),a.lineTo(i.width/2,0),a.lineTo(i.width/2,e.circleRadius/2),a.lineTo(i.width/2,0),a.lineTo(0,0),a.stroke(),a.fill()),e.xCoord=t.x*i.width,e.yCoord=t.y*i.height,e.wCoord=t.width*i.width,e.hCoord=t.height*i.height})})},e.prototype.getMinHeadSize=function(){var e=this,t=new i.HttpHeaders;t=(t=t.append("Accept","application/json")).append("ApiKeyAuth",this.apiKey),this.httpClient.get(this.wsEndpoint+this.wsImageSize,{headers:t}).subscribe(function(t){e.minHeadSize=t.minHeadSize},function(e){console.error(e)})},e.prototype.tempToBlob=function(e){var t=this;e.toBlob(function(e){return o(t,void 0,void 0,function(){var t;return c(this,function(i){switch(i.label){case 0:return this.emitChangeStateEvent("PAD Continue photo blob generated"),this.photoPADContinue=e,[4,new Response(this.photoPADContinue).arrayBuffer()];case 1:return t=i.sent(),this.facePadService.sendMessage({faceImage:this.arrayBufferToBase64(t),typeMessagePad:"CONTINUE",apiKey:this.apiKey}),[2]}})})},"image/jpeg")},e.prototype.progressCircle=function(){var e=this,t=this.canvasResult.nativeElement;t.width=this.videoWidth,t.height=this.videoHeight;var i=t.getContext("2d"),r=t.width/2,a=t.height/2;i.lineCap="round";var n=0,s=setInterval(function(){i.clearRect(0,0,t.width,t.height),i.strokeStyle="rgba(0,200,200,0)",i.lineWidth="10",i.fillStyle="rgba(0, 0, 0, 0.7)",i.beginPath(),i.moveTo(0,0),i.lineTo(0,t.height),i.lineTo(r,t.height),i.lineTo(r,t.height-e.circleRadius/2),i.arc(r,a,e.circleRadius,Math.PI/2,Math.PI/2.000001),i.lineTo(r,t.height),i.lineTo(t.width,t.height),i.lineTo(t.width,0),i.lineTo(r,0),i.lineTo(r,e.circleRadius/2),i.lineTo(r,0),i.lineTo(0,0),i.stroke(),i.fill(),i.beginPath(),i.strokeStyle=e.colorProgressCircle,i.lineWidth="10",i.arc(r,a,e.circleRadius,Math.PI/180*270,Math.PI/180*(270+n)),i.stroke(),e.processCompletion>=100?(i.arc(r,a,e.circleRadius,Math.PI/180*(270+n),Math.PI/180*630),i.stroke(),e.processCompletion=0,n=0,clearInterval(s),e.isCircleRunning=!1):n<e.processCompletion/100*360?n+=10:e.padState===d.ERROR_NO_FACE&&(i.clearRect(0,0,t.width,t.height),e.processCompletion=0,n=0,clearInterval(s),e.isCircleRunning=!1)},60)},e.decorators=[{type:t.Component,args:[{selector:"id3-face-pad",template:'<id3-face-pad-messages *ngIf="messagesEnabled" class="show-small-screen" [startTipsLabel]="getMessage(\'START_TIPS_LABEL\')"\r\n [turnFaceLabel]="getMessage(\'TURN_FACE_LABEL\')" [expiredSessionErrorLabel]="getMessage(\'EXPIRED_SESSION_ERROR_LABEL\')" \r\n [noFaceErrorLabel]="getMessage(\'NO_FACE_ERROR_LABEL\')" [noInternetConnectionLabel]="getMessage(\'NO_INTERNET_CONNECTION_LABEL\')"\r\n [multipleFaceErrorLabel]="getMessage(\'MULTIPLE_FACE_ERROR_LABEL\')" [successLabel]="getMessage(\'SUCCESS_LABEL\')" \r\n [processInstruction]="processInstruction" [padState]="padState" [matchingSuccessLabel]="getMessage(\'MATCHING_SUCCESS_LABEL\')"\r\n [matchingErrorLabel]="getMessage(\'MATCHING_ERROR_LABEL\')" [matchingReadyLabel]="getMessage(\'MATCHING_READY_LABEL\')"\r\n [userTooFarLabel]="getMessage(\'USER_TOO_FAR_LABEL\')" [userNotCenterLabel]="getMessage(\'USER_NOT_CENTER_LABEL\')">\r\n</id3-face-pad-messages>\r\n\r\n<input id="id3-fileForMatching" type="file" name="fileForMatch" class="d-none" (change)="handleFiles($event)"/>\r\n<div class="padContainer" [style.max-height]="videoHeight + \'px\'" [style.max-width]="videoWidth + \'px\'">\r\n <canvas class="canvas {{mirror && !processProgressCircle ? \'mirror\': \'\'}}" #resultCanvas></canvas>\r\n <video class="liveStream {{mirror ? \'mirror\': \'\'}}" #videoPAD autoplay playsinline></video>\r\n <div class="id3-pad-overlay">\r\n <div class="extras">\r\n <img class="text-left" id="id3Logo" src="/assets/images/id3_logo_white_40.png" height="40" width="40" *ngIf="apiKey === \'test-token-id3-webcapture\'">\r\n </div>\r\n <div id="mainContent" class="pad-content d-block">\r\n\r\n <id3-face-pad-messages *ngIf="messagesEnabled" class="show-big-screen" [startTipsLabel]="getMessage(\'START_TIPS_LABEL\')"\r\n [turnFaceLabel]="getMessage(\'TURN_FACE_LABEL\')" [expiredSessionErrorLabel]="getMessage(\'EXPIRED_SESSION_ERROR_LABEL\')" \r\n [noFaceErrorLabel]="getMessage(\'NO_FACE_ERROR_LABEL\')" [noInternetConnectionLabel]="getMessage(\'NO_INTERNET_CONNECTION_LABEL\')"\r\n [multipleFaceErrorLabel]="getMessage(\'MULTIPLE_FACE_ERROR_LABEL\')" [successLabel]="getMessage(\'SUCCESS_LABEL\')" \r\n [processInstruction]="processInstruction" [padState]="padState" [matchingSuccessLabel]="getMessage(\'MATCHING_SUCCESS_LABEL\')"\r\n [matchingErrorLabel]="getMessage(\'MATCHING_ERROR_LABEL\')" [matchingReadyLabel]="getMessage(\'MATCHING_READY_LABEL\')"\r\n [userTooFarLabel]="getMessage(\'USER_TOO_FAR_LABEL\')" [userNotCenterLabel]="getMessage(\'USER_NOT_CENTER_LABEL\')">\r\n </id3-face-pad-messages>\r\n\r\n <br>\r\n <div class="d-flex">\r\n <h4 id="padAlert" class="text-white"></h4>\r\n </div>\r\n </div>\r\n <div id="mainButtons" class="pad-buttons d-block">\r\n <button type="button" *ngIf="isRequestPermissionState()" (click)="initPadSource()" class="btn btn-primary btn-id3 mt-5">\r\n <em class="pi pi-caret-right"></em>{{getMessage(\'ENABLE_CAM_BUTTON_LABEL\')}}\r\n </button>\r\n <button type="button" *ngIf="isInitialState()" (click)="prepareCallPADStart()" class="btn btn-primary btn-id3 mt-5">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'START_BUTTON_LABEL\')}}\r\n </button>\r\n <button type="button" *ngIf="isErrorSessionState() || isErrorNoFaceState() || isErrorNoInternetConnection() || isErrorUserTooFar() || isErrorUserNotCenter() || isErrorMultipleFaceState() || (allowsMultipleRetries && isSuccessState())" (click)="resetUI()" class="btn btn-primary btn-id3 mt-3">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'RETRY_BUTTON_LABEL\')}}\r\n </button>\r\n\r\n <button type="button" *ngIf="isMatchingReadyState()" class="btn btn-primary btn-id3 mt-3" (click)="compareWithReference()">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'COMPARE_BUTTON_LABEL\')}}\r\n </button>\r\n <button type="button" *ngIf="isMatchingSuccessState()|| isMatchingErrorState()" class="btn btn-primary btn-id3 mt-3" (click)="resetUI()">\r\n <em class="pi pi-caret-right"></em> {{getMessage(\'RESTART_BUTTON_LABEL\')}}\r\n </button>\r\n\r\n </div>\r\n </div>\r\n </div>',styles:['.padContainer{position:relative;margin:auto}.padContainer .h1,.padContainer .h2,.padContainer .h3,.padContainer .h4,.padContainer .h5,.padContainer .h6,.padContainer h1,.padContainer h2,.padContainer h3,.padContainer h4,.padContainer h5,.padContainer h6{font-family:"PT Sans",sans-serif;font-weight:700;font-size:50px}.padContainer .liveStream{z-index:1;top:0;left:0;width:100%;height:auto}.padContainer .btn-id3{border-radius:10px}.padContainer .font-weight-normal{width:250px;text-align:left}.padContainer .id3-pad-overlay{z-index:3;position:absolute;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;color:#fff;font-size:20px;flex-direction:column;border:1px solid #ddd}.padContainer .extras{display:flex;top:15;right:15;left:15;width:100%;align-items:left}.padContainer .pad-content{position:absolute;display:block;text-align:center}.padContainer .pad-buttons{position:absolute;display:block;text-align:center;bottom:5%}.padContainer .padBehaviorLabel{font-size:20px}.padContainer .breathe{margin:6px 10px}.padContainer .id3-overlay{position:absolute}.padContainer .canvas{z-index:2;top:0;left:0;width:100%;height:100%;position:absolute}.padContainer .mirror{transform:rotateY(180deg);-webkit-transform:rotateY(180deg);-moz-transform:rotateY(180deg)}@media only screen and (max-width:500px){.show-big-screen{display:none}}@media only screen and (min-width:500px){.show-small-screen{display:none}}@media only screen and (min-width:601px){h4{font-size:25px}}@media only screen and (max-width:600px){h1{font-size:27px!important;margin-left:15%}h4{font-size:25px}}']}]}],e.ctorParameters=function(){return[{type:h},{type:i.HttpClient}]},e.propDecorators={canvasResult:[{type:t.ViewChild,args:["resultCanvas",{static:!1}]}],videoPAD:[{type:t.ViewChild,args:["videoPAD",{static:!1}]}],fileForMatching:[{type:t.ViewChild,args:["fileForMatching",{static:!1}]}],wsEndpoint:[{type:t.Input}],wsFormatPicture:[{type:t.Input}],wsFaceVerification:[{type:t.Input}],wsImageSize:[{type:t.Input}],apiKey:[{type:t.Input}],autoStart:[{type:t.Input}],faceTracking:[{type:t.Input}],faceTrackingOptionDesign:[{type:t.Input}],mirror:[{type:t.Input}],processProgressCircle:[{type:t.Input}],colorProgressCircle:[{type:t.Input}],circleRadius:[{type:t.Input}],formatFinalPicture:[{type:t.Input}],downloadFinalPictureOnSuccess:[{type:t.Input}],resultPictureWidth:[{type:t.Input}],enableAutoMatching:[{type:t.Input}],allowsMultipleRetries:[{type:t.Input}],videoWidth:[{type:t.Input}],videoHeight:[{type:t.Input}],videoWidthMobile:[{type:t.Input}],videoHeightMobile:[{type:t.Input}],frameWidth:[{type:t.Input}],minHeadSize:[{type:t.Input}],messagesEnabled:[{type:t.Input}],padFrequency:[{type:t.Input}],startTipsLabel:[{type:t.Input}],processFaceCenterLabel:[{type:t.Input}],processNoFaceLabel:[{type:t.Input}],processMultipleFaceLabel:[{type:t.Input}],turnFaceLabel:[{type:t.Input}],expiredSessionErrorLabel:[{type:t.Input}],noFaceErrorLabel:[{type:t.Input}],multipleFaceErrorLabel:[{type:t.Input}],successLabel:[{type:t.Input}],startButtonLabel:[{type:t.Input}],restartButtonLabel:[{type:t.Input}],compareButtonLabel:[{type:t.Input}],enableCamButtonLabel:[{type:t.Input}],retryButtonLabel:[{type:t.Input}],matchingSuccessLabel:[{type:t.Input}],matchingReadyLabel:[{type:t.Input}],matchingErrorLabel:[{type:t.Input}],noInternetConnectionLabel:[{type:t.Input}],userTooFarLabel:[{type:t.Input}],userNotCenterLabel:[{type:t.Input}],faceDetectedHandler:[{type:t.Output}],cameraHandler:[{type:t.Output}],sessionExpiredHandler:[{type:t.Output}],changeStateHandler:[{type:t.Output}],matchingHandler:[{type:t.Output}],compareWithReference:[{type:t.Input}]},e}(),g=function(){function e(){this.processInstruction=""}return e.prototype.ngOnInit=function(){},e.prototype.isRequestPermissionState=function(){return this.padState===d.REQUEST_PERMISSIONS},e.prototype.isInitialState=function(){return this.padState===d.INITIAL},e.prototype.isStartedState=function(){return this.padState===d.STARTED},e.prototype.isProcessingState=function(){return this.padState===d.PROCESS},e.prototype.isErrorSessionState=function(){return this.padState===d.ERROR_SESSION},e.prototype.isErrorNoFaceState=function(){return this.padState===d.ERROR_NO_FACE},e.prototype.isErrorNoInternetConnection=function(){return this.padState===d.ERROR_NO_INTERNET_CONNECTION},e.prototype.isErrorUserTooFar=function(){return this.padState===d.ERROR_USER_TOO_FAR},e.prototype.isErrorUserNotCenter=function(){return this.padState===d.ERROR_USER_NOT_CENTER},e.prototype.isErrorMultipleFaceState=function(){return this.padState===d.ERROR_MULTIPLE_FACE},e.prototype.isSuccessState=function(){return this.padState===d.SUCCESS},e.prototype.isMatchingReadyState=function(){return this.padState===d.MATCH_READY},e.prototype.isMatchingSuccessState=function(){return this.padState===d.MATCH_SUCCESS},e.prototype.isMatchingErrorState=function(){return this.padState===d.MATCH_ERROR},e.prototype.isInvalidKeyState=function(){return this.padState===d.ERROR_KEY},e.decorators=[{type:t.Component,args:[{selector:"id3-face-pad-messages",template:'<div class="mt-2">\r\n <div *ngIf="isInitialState()" class="alert alert-primary" role="alert">\r\n {{startTipsLabel}}\r\n </div>\r\n <div *ngIf="isStartedState() || (isProcessingState() && processInstruction.length>0)" class="alert alert-danger" role="alert">\r\n {{processInstruction}}\r\n </div>\r\n <div *ngIf="isProcessingState() && processInstruction.length==0" class="alert alert-primary" role="alert">\r\n {{turnFaceLabel}}\r\n </div>\r\n <div *ngIf="isErrorSessionState()" class="alert alert-danger" role="alert">\r\n {{expiredSessionErrorLabel}}\r\n </div>\r\n <div *ngIf="isErrorNoFaceState()" class="alert alert-danger" role="alert">\r\n {{noFaceErrorLabel}}\r\n </div>\r\n <div *ngIf="isErrorNoInternetConnection()" class="alert alert-danger" role="alert">\r\n {{noInternetConnectionLabel}}\r\n </div>\r\n <div *ngIf="isErrorUserTooFar()" class="alert alert-primary" role="alert">\r\n {{userTooFarLabel}}\r\n </div>\r\n <div *ngIf="isErrorUserNotCenter()" class="alert alert-danger" role="alert">\r\n {{userNotCenterLabel}}\r\n </div>\r\n <div *ngIf="isErrorMultipleFaceState()" class="alert alert-danger" role="alert">\r\n {{multipleFaceErrorLabel}}\r\n </div>\r\n <div *ngIf="isSuccessState()" class="alert alert-success" role="alert">\r\n {{successLabel}}\r\n </div>\r\n <div *ngIf="isMatchingReadyState()" class="alert alert-primary" role="alert">\r\n {{matchingReadyLabel}}\r\n </div>\r\n <div *ngIf="isMatchingSuccessState()" class="alert alert-success" role="alert">\r\n {{matchingSuccessLabel}}\r\n </div>\r\n <div *ngIf="isMatchingErrorState()" class="alert alert-danger" role="alert">\r\n {{matchingErrorLabel}}\r\n </div>\r\n <div *ngIf="isInvalidKeyState()" class="alert alert-danger" role="alert">\r\n The API Key is invalid. Please check your API key.\r\n </div>\r\n</div>'}]}],e.ctorParameters=function(){return[]},e.propDecorators={startTipsLabel:[{type:t.Input}],turnFaceLabel:[{type:t.Input}],expiredSessionErrorLabel:[{type:t.Input}],noFaceErrorLabel:[{type:t.Input}],noInternetConnectionLabel:[{type:t.Input}],userTooFarLabel:[{type:t.Input}],userNotCenterLabel:[{type:t.Input}],multipleFaceErrorLabel:[{type:t.Input}],successLabel:[{type:t.Input}],matchingSuccessLabel:[{type:t.Input}],matchingReadyLabel:[{type:t.Input}],matchingErrorLabel:[{type:t.Input}],padState:[{type:t.Input}],processInstruction:[{type:t.Input}]},e}(),S=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{declarations:[E,g],imports:[i.HttpClientModule,n.CommonModule,s.BrowserModule],exports:[E],entryComponents:[E]}]}],e}();e.FacePadComponent=E,e.FacePadModule=S,e.FacePadService=h,e.ɵa=g,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=id3-face-pad.umd.min.js.map

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"FacePadService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"connect":[{"__symbolic":"method"}],"disconnect":[{"__symbolic":"method"}],"isConnected":[{"__symbolic":"method"}],"sendMessage":[{"__symbolic":"method"}],"waitForSocketConnection":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"FacePadComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":25,"character":1},"arguments":[{"selector":"id3-face-pad","template":"<id3-face-pad-messages *ngIf=\"messagesEnabled\" class=\"show-small-screen\" [startTipsLabel]=\"getMessage('START_TIPS_LABEL')\"\r\n [turnFaceLabel]=\"getMessage('TURN_FACE_LABEL')\" [expiredSessionErrorLabel]=\"getMessage('EXPIRED_SESSION_ERROR_LABEL')\" \r\n [noFaceErrorLabel]=\"getMessage('NO_FACE_ERROR_LABEL')\" [noInternetConnectionLabel]=\"getMessage('NO_INTERNET_CONNECTION_LABEL')\"\r\n [multipleFaceErrorLabel]=\"getMessage('MULTIPLE_FACE_ERROR_LABEL')\" [successLabel]=\"getMessage('SUCCESS_LABEL')\" \r\n [processInstruction]=\"processInstruction\" [padState]=\"padState\" [matchingSuccessLabel]=\"getMessage('MATCHING_SUCCESS_LABEL')\"\r\n [matchingErrorLabel]=\"getMessage('MATCHING_ERROR_LABEL')\" [matchingReadyLabel]=\"getMessage('MATCHING_READY_LABEL')\"\r\n [userTooFarLabel]=\"getMessage('USER_TOO_FAR_LABEL')\" [userNotCenterLabel]=\"getMessage('USER_NOT_CENTER_LABEL')\">\r\n</id3-face-pad-messages>\r\n\r\n<input id=\"id3-fileForMatching\" type=\"file\" name=\"fileForMatch\" class=\"d-none\" (change)=\"handleFiles($event)\"/>\r\n<div class=\"padContainer\" [style.max-height]=\"videoHeight + 'px'\" [style.max-width]=\"videoWidth + 'px'\">\r\n <canvas class=\"canvas {{mirror && !processProgressCircle ? 'mirror': ''}}\" #resultCanvas></canvas>\r\n <video class=\"liveStream {{mirror ? 'mirror': ''}}\" #videoPAD autoplay playsinline></video>\r\n <div class=\"id3-pad-overlay\">\r\n <div class=\"extras\">\r\n <img class=\"text-left\" id=\"id3Logo\" src=\"/assets/images/id3_logo_white_40.png\" height=\"40\" width=\"40\" *ngIf=\"apiKey === 'test-token-id3-webcapture'\">\r\n </div>\r\n <div id=\"mainContent\" class=\"pad-content d-block\">\r\n\r\n <id3-face-pad-messages *ngIf=\"messagesEnabled\" class=\"show-big-screen\" [startTipsLabel]=\"getMessage('START_TIPS_LABEL')\"\r\n [turnFaceLabel]=\"getMessage('TURN_FACE_LABEL')\" [expiredSessionErrorLabel]=\"getMessage('EXPIRED_SESSION_ERROR_LABEL')\" \r\n [noFaceErrorLabel]=\"getMessage('NO_FACE_ERROR_LABEL')\" [noInternetConnectionLabel]=\"getMessage('NO_INTERNET_CONNECTION_LABEL')\"\r\n [multipleFaceErrorLabel]=\"getMessage('MULTIPLE_FACE_ERROR_LABEL')\" [successLabel]=\"getMessage('SUCCESS_LABEL')\" \r\n [processInstruction]=\"processInstruction\" [padState]=\"padState\" [matchingSuccessLabel]=\"getMessage('MATCHING_SUCCESS_LABEL')\"\r\n [matchingErrorLabel]=\"getMessage('MATCHING_ERROR_LABEL')\" [matchingReadyLabel]=\"getMessage('MATCHING_READY_LABEL')\"\r\n [userTooFarLabel]=\"getMessage('USER_TOO_FAR_LABEL')\" [userNotCenterLabel]=\"getMessage('USER_NOT_CENTER_LABEL')\">\r\n </id3-face-pad-messages>\r\n\r\n <br>\r\n <div class=\"d-flex\">\r\n <h4 id=\"padAlert\" class=\"text-white\"></h4>\r\n </div>\r\n </div>\r\n <div id=\"mainButtons\" class=\"pad-buttons d-block\">\r\n <button type=\"button\" *ngIf=\"isRequestPermissionState()\" (click)=\"initPadSource()\" class=\"btn btn-primary btn-id3 mt-5\">\r\n <em class=\"pi pi-caret-right\"></em>{{getMessage('ENABLE_CAM_BUTTON_LABEL')}}\r\n </button>\r\n <button type=\"button\" *ngIf=\"isInitialState()\" (click)=\"prepareCallPADStart()\" class=\"btn btn-primary btn-id3 mt-5\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('START_BUTTON_LABEL')}}\r\n </button>\r\n <button type=\"button\" *ngIf=\"isErrorSessionState() || isErrorNoFaceState() || isErrorNoInternetConnection() || isErrorUserTooFar() || isErrorUserNotCenter() || isErrorMultipleFaceState() || (allowsMultipleRetries && isSuccessState())\" (click)=\"resetUI()\" class=\"btn btn-primary btn-id3 mt-3\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('RETRY_BUTTON_LABEL')}}\r\n </button>\r\n\r\n <button type=\"button\" *ngIf=\"isMatchingReadyState()\" class=\"btn btn-primary btn-id3 mt-3\" (click)=\"compareWithReference()\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('COMPARE_BUTTON_LABEL')}}\r\n </button>\r\n <button type=\"button\" *ngIf=\"isMatchingSuccessState()|| isMatchingErrorState()\" class=\"btn btn-primary btn-id3 mt-3\" (click)=\"resetUI()\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('RESTART_BUTTON_LABEL')}}\r\n </button>\r\n\r\n </div>\r\n </div>\r\n </div>","styles":[".padContainer{position:relative;margin:auto}.padContainer .h1,.padContainer .h2,.padContainer .h3,.padContainer .h4,.padContainer .h5,.padContainer .h6,.padContainer h1,.padContainer h2,.padContainer h3,.padContainer h4,.padContainer h5,.padContainer h6{font-family:\"PT Sans\",sans-serif;font-weight:700;font-size:50px}.padContainer .liveStream{z-index:1;top:0;left:0;width:100%;height:auto}.padContainer .btn-id3{border-radius:10px}.padContainer .font-weight-normal{width:250px;text-align:left}.padContainer .id3-pad-overlay{z-index:3;position:absolute;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;color:#fff;font-size:20px;flex-direction:column;border:1px solid #ddd}.padContainer .extras{display:flex;top:15;right:15;left:15;width:100%;align-items:left}.padContainer .pad-content{position:absolute;display:block;text-align:center}.padContainer .pad-buttons{position:absolute;display:block;text-align:center;bottom:5%}.padContainer .padBehaviorLabel{font-size:20px}.padContainer .breathe{margin:6px 10px}.padContainer .id3-overlay{position:absolute}.padContainer .canvas{z-index:2;top:0;left:0;width:100%;height:100%;position:absolute}.padContainer .mirror{transform:rotateY(180deg);-webkit-transform:rotateY(180deg);-moz-transform:rotateY(180deg)}@media only screen and (max-width:500px){.show-big-screen{display:none}}@media only screen and (min-width:500px){.show-small-screen{display:none}}@media only screen and (min-width:601px){h4{font-size:25px}}@media only screen and (max-width:600px){h1{font-size:27px!important;margin-left:15%}h4{font-size:25px}}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"FacePadService"},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":32,"character":74}]}],"canvasResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":40,"character":3},"arguments":["resultCanvas",{"static":false}]}]}],"videoPAD":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":42,"character":3},"arguments":["videoPAD",{"static":false}]}]}],"fileForMatching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":44,"character":3},"arguments":["fileForMatching",{"static":false}]}]}],"wsEndpoint":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"wsFormatPicture":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3}}]}],"wsFaceVerification":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":52,"character":3}}]}],"wsImageSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":3}}]}],"apiKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":58,"character":3}}]}],"autoStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":3}}]}],"faceTracking":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":3}}]}],"faceTrackingOptionDesign":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":3}}]}],"mirror":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":3}}]}],"processProgressCircle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":3}}]}],"colorProgressCircle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":3}}]}],"circleRadius":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":79,"character":3}}]}],"formatFinalPicture":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":82,"character":3}}]}],"downloadFinalPictureOnSuccess":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":3}}]}],"resultPictureWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":88,"character":3}}]}],"enableAutoMatching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":91,"character":3}}]}],"allowsMultipleRetries":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":94,"character":3}}]}],"videoWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":3}}]}],"videoHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":100,"character":3}}]}],"videoWidthMobile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":103,"character":3}}]}],"videoHeightMobile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":106,"character":3}}]}],"frameWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":109,"character":3}}]}],"minHeadSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":112,"character":3}}]}],"messagesEnabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":115,"character":3}}]}],"padFrequency":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":3}}]}],"startTipsLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":121,"character":3}}]}],"processFaceCenterLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":124,"character":3}}]}],"processNoFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":127,"character":3}}]}],"processMultipleFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":130,"character":3}}]}],"turnFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":133,"character":3}}]}],"expiredSessionErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":136,"character":3}}]}],"noFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":139,"character":3}}]}],"multipleFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":142,"character":3}}]}],"successLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":145,"character":3}}]}],"startButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":148,"character":3}}]}],"restartButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":151,"character":3}}]}],"compareButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":154,"character":3}}]}],"enableCamButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":157,"character":3}}]}],"retryButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":160,"character":3}}]}],"matchingSuccessLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":163,"character":3}}]}],"matchingReadyLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":166,"character":3}}]}],"matchingErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":169,"character":3}}]}],"noInternetConnectionLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":172,"character":3}}]}],"userTooFarLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":175,"character":3}}]}],"userNotCenterLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":178,"character":3}}]}],"faceDetectedHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":181,"character":3}}]}],"cameraHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":184,"character":3}}]}],"sessionExpiredHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":187,"character":3}}]}],"changeStateHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":190,"character":3}}]}],"matchingHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":193,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"processServerResponse":[{"__symbolic":"method"}],"endSessionPad":[{"__symbolic":"method"}],"getMessage":[{"__symbolic":"method"}],"getDatasVideoPAD":[{"__symbolic":"method"}],"isRequestPermissionState":[{"__symbolic":"method"}],"isInitialState":[{"__symbolic":"method"}],"isStartedState":[{"__symbolic":"method"}],"isProcessingState":[{"__symbolic":"method"}],"isErrorSessionState":[{"__symbolic":"method"}],"isErrorNoFaceState":[{"__symbolic":"method"}],"isErrorNoInternetConnection":[{"__symbolic":"method"}],"isErrorUserTooFar":[{"__symbolic":"method"}],"isErrorUserNotCenter":[{"__symbolic":"method"}],"isErrorMultipleFaceState":[{"__symbolic":"method"}],"isSuccessState":[{"__symbolic":"method"}],"isInvalidKeyState":[{"__symbolic":"method"}],"isMatchingReadyState":[{"__symbolic":"method"}],"isMatchingSuccessState":[{"__symbolic":"method"}],"isMatchingErrorState":[{"__symbolic":"method"}],"isDeviceMobile":[{"__symbolic":"method"}],"initPadSource":[{"__symbolic":"method"}],"leaving":[{"__symbolic":"method"}],"handleSuccess":[{"__symbolic":"method"}],"prepareCallPADStart":[{"__symbolic":"method"}],"callPADStart":[{"__symbolic":"method"}],"doPADStart":[{"__symbolic":"method"}],"prepareCallPADContinue":[{"__symbolic":"method"}],"arrayBufferToBase64":[{"__symbolic":"method"}],"manageFinalPicture":[{"__symbolic":"method"}],"showInstructionToUploadReference":[{"__symbolic":"method"}],"rotateAndCropFinalPicture":[{"__symbolic":"method"}],"b64toBlob":[{"__symbolic":"method"}],"emitFaceDetectedEvent":[{"__symbolic":"method"}],"emitInvalidKeyEvent":[{"__symbolic":"method"}],"emitSessionExpiredEvent":[{"__symbolic":"method"}],"emitCameraEvent":[{"__symbolic":"method"}],"emitChangeStateEvent":[{"__symbolic":"method"}],"resetUI":[{"__symbolic":"method"}],"compareWithReference":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":698,"character":3}}]}],"handleFiles":[{"__symbolic":"method"}],"downloadPicture":[{"__symbolic":"method"}],"faceTracker":[{"__symbolic":"method"}],"getMinHeadSize":[{"__symbolic":"method"}],"tempToBlob":[{"__symbolic":"method"}],"progressCircle":[{"__symbolic":"method"}]}},"FacePadModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"FacePadComponent"},{"__symbolic":"reference","name":"ɵa"}],"imports":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClientModule","line":10,"character":4},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":4},{"__symbolic":"reference","module":"@angular/platform-browser","name":"BrowserModule","line":12,"character":4}],"exports":[{"__symbolic":"reference","name":"FacePadComponent"}],"entryComponents":[{"__symbolic":"reference","name":"FacePadComponent"}]}]}],"members":{}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"id3-face-pad-messages","template":"<div class=\"mt-2\">\r\n <div *ngIf=\"isInitialState()\" class=\"alert alert-primary\" role=\"alert\">\r\n {{startTipsLabel}}\r\n </div>\r\n <div *ngIf=\"isStartedState() || (isProcessingState() && processInstruction.length>0)\" class=\"alert alert-danger\" role=\"alert\">\r\n {{processInstruction}}\r\n </div>\r\n <div *ngIf=\"isProcessingState() && processInstruction.length==0\" class=\"alert alert-primary\" role=\"alert\">\r\n {{turnFaceLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorSessionState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{expiredSessionErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorNoFaceState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{noFaceErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorNoInternetConnection()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{noInternetConnectionLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorUserTooFar()\" class=\"alert alert-primary\" role=\"alert\">\r\n {{userTooFarLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorUserNotCenter()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{userNotCenterLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorMultipleFaceState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{multipleFaceErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isSuccessState()\" class=\"alert alert-success\" role=\"alert\">\r\n {{successLabel}}\r\n </div>\r\n <div *ngIf=\"isMatchingReadyState()\" class=\"alert alert-primary\" role=\"alert\">\r\n {{matchingReadyLabel}}\r\n </div>\r\n <div *ngIf=\"isMatchingSuccessState()\" class=\"alert alert-success\" role=\"alert\">\r\n {{matchingSuccessLabel}}\r\n </div>\r\n <div *ngIf=\"isMatchingErrorState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{matchingErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isInvalidKeyState()\" class=\"alert alert-danger\" role=\"alert\">\r\n The API Key is invalid. Please check your API key.\r\n </div>\r\n</div>"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"startTipsLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"turnFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"expiredSessionErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"noFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"noInternetConnectionLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"userTooFarLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3}}]}],"userNotCenterLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"multipleFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}}]}],"successLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"matchingSuccessLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":3}}]}],"matchingReadyLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"matchingErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"padState":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}}]}],"processInstruction":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}],"isRequestPermissionState":[{"__symbolic":"method"}],"isInitialState":[{"__symbolic":"method"}],"isStartedState":[{"__symbolic":"method"}],"isProcessingState":[{"__symbolic":"method"}],"isErrorSessionState":[{"__symbolic":"method"}],"isErrorNoFaceState":[{"__symbolic":"method"}],"isErrorNoInternetConnection":[{"__symbolic":"method"}],"isErrorUserTooFar":[{"__symbolic":"method"}],"isErrorUserNotCenter":[{"__symbolic":"method"}],"isErrorMultipleFaceState":[{"__symbolic":"method"}],"isSuccessState":[{"__symbolic":"method"}],"isMatchingReadyState":[{"__symbolic":"method"}],"isMatchingSuccessState":[{"__symbolic":"method"}],"isMatchingErrorState":[{"__symbolic":"method"}],"isInvalidKeyState":[{"__symbolic":"method"}]}}},"origins":{"FacePadService":"./lib/face-pad.service","FacePadComponent":"./lib/component/face-pad.component","FacePadModule":"./lib/face-pad.module","ɵa":"./lib/component/face-pad-messages.component"},"importAs":"@id3/face-pad"}
{"__symbolic":"module","version":4,"metadata":{"FacePadService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"connect":[{"__symbolic":"method"}],"disconnect":[{"__symbolic":"method"}],"isConnected":[{"__symbolic":"method"}],"sendMessage":[{"__symbolic":"method"}],"waitForSocketConnection":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}},"FacePadComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":25,"character":1},"arguments":[{"selector":"id3-face-pad","template":"<id3-face-pad-messages *ngIf=\"messagesEnabled\" class=\"show-small-screen\" [startTipsLabel]=\"getMessage('START_TIPS_LABEL')\"\r\n [turnFaceLabel]=\"getMessage('TURN_FACE_LABEL')\" [expiredSessionErrorLabel]=\"getMessage('EXPIRED_SESSION_ERROR_LABEL')\" \r\n [noFaceErrorLabel]=\"getMessage('NO_FACE_ERROR_LABEL')\" [noInternetConnectionLabel]=\"getMessage('NO_INTERNET_CONNECTION_LABEL')\"\r\n [multipleFaceErrorLabel]=\"getMessage('MULTIPLE_FACE_ERROR_LABEL')\" [successLabel]=\"getMessage('SUCCESS_LABEL')\" \r\n [processInstruction]=\"processInstruction\" [padState]=\"padState\" [matchingSuccessLabel]=\"getMessage('MATCHING_SUCCESS_LABEL')\"\r\n [matchingErrorLabel]=\"getMessage('MATCHING_ERROR_LABEL')\" [matchingReadyLabel]=\"getMessage('MATCHING_READY_LABEL')\"\r\n [userTooFarLabel]=\"getMessage('USER_TOO_FAR_LABEL')\" [userNotCenterLabel]=\"getMessage('USER_NOT_CENTER_LABEL')\">\r\n</id3-face-pad-messages>\r\n\r\n<input id=\"id3-fileForMatching\" type=\"file\" name=\"fileForMatch\" class=\"d-none\" (change)=\"handleFiles($event)\"/>\r\n<div class=\"padContainer\" [style.max-height]=\"videoHeight + 'px'\" [style.max-width]=\"videoWidth + 'px'\">\r\n <canvas class=\"canvas {{mirror && !processProgressCircle ? 'mirror': ''}}\" #resultCanvas></canvas>\r\n <video class=\"liveStream {{mirror ? 'mirror': ''}}\" #videoPAD autoplay playsinline></video>\r\n <div class=\"id3-pad-overlay\">\r\n <div class=\"extras\">\r\n <img class=\"text-left\" id=\"id3Logo\" src=\"/assets/images/id3_logo_white_40.png\" height=\"40\" width=\"40\" *ngIf=\"apiKey === 'test-token-id3-webcapture'\">\r\n </div>\r\n <div id=\"mainContent\" class=\"pad-content d-block\">\r\n\r\n <id3-face-pad-messages *ngIf=\"messagesEnabled\" class=\"show-big-screen\" [startTipsLabel]=\"getMessage('START_TIPS_LABEL')\"\r\n [turnFaceLabel]=\"getMessage('TURN_FACE_LABEL')\" [expiredSessionErrorLabel]=\"getMessage('EXPIRED_SESSION_ERROR_LABEL')\" \r\n [noFaceErrorLabel]=\"getMessage('NO_FACE_ERROR_LABEL')\" [noInternetConnectionLabel]=\"getMessage('NO_INTERNET_CONNECTION_LABEL')\"\r\n [multipleFaceErrorLabel]=\"getMessage('MULTIPLE_FACE_ERROR_LABEL')\" [successLabel]=\"getMessage('SUCCESS_LABEL')\" \r\n [processInstruction]=\"processInstruction\" [padState]=\"padState\" [matchingSuccessLabel]=\"getMessage('MATCHING_SUCCESS_LABEL')\"\r\n [matchingErrorLabel]=\"getMessage('MATCHING_ERROR_LABEL')\" [matchingReadyLabel]=\"getMessage('MATCHING_READY_LABEL')\"\r\n [userTooFarLabel]=\"getMessage('USER_TOO_FAR_LABEL')\" [userNotCenterLabel]=\"getMessage('USER_NOT_CENTER_LABEL')\">\r\n </id3-face-pad-messages>\r\n\r\n <br>\r\n <div class=\"d-flex\">\r\n <h4 id=\"padAlert\" class=\"text-white\"></h4>\r\n </div>\r\n </div>\r\n <div id=\"mainButtons\" class=\"pad-buttons d-block\">\r\n <button type=\"button\" *ngIf=\"isRequestPermissionState()\" (click)=\"initPadSource()\" class=\"btn btn-primary btn-id3 mt-5\">\r\n <em class=\"pi pi-caret-right\"></em>{{getMessage('ENABLE_CAM_BUTTON_LABEL')}}\r\n </button>\r\n <button type=\"button\" *ngIf=\"isInitialState()\" (click)=\"prepareCallPADStart()\" class=\"btn btn-primary btn-id3 mt-5\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('START_BUTTON_LABEL')}}\r\n </button>\r\n <button type=\"button\" *ngIf=\"isErrorSessionState() || isErrorNoFaceState() || isErrorNoInternetConnection() || isErrorUserTooFar() || isErrorUserNotCenter() || isErrorMultipleFaceState() || (allowsMultipleRetries && isSuccessState())\" (click)=\"resetUI()\" class=\"btn btn-primary btn-id3 mt-3\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('RETRY_BUTTON_LABEL')}}\r\n </button>\r\n\r\n <button type=\"button\" *ngIf=\"isMatchingReadyState()\" class=\"btn btn-primary btn-id3 mt-3\" (click)=\"compareWithReference()\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('COMPARE_BUTTON_LABEL')}}\r\n </button>\r\n <button type=\"button\" *ngIf=\"isMatchingSuccessState()|| isMatchingErrorState()\" class=\"btn btn-primary btn-id3 mt-3\" (click)=\"resetUI()\">\r\n <em class=\"pi pi-caret-right\"></em> {{getMessage('RESTART_BUTTON_LABEL')}}\r\n </button>\r\n\r\n </div>\r\n </div>\r\n </div>","styles":[".padContainer{position:relative;margin:auto}.padContainer .h1,.padContainer .h2,.padContainer .h3,.padContainer .h4,.padContainer .h5,.padContainer .h6,.padContainer h1,.padContainer h2,.padContainer h3,.padContainer h4,.padContainer h5,.padContainer h6{font-family:\"PT Sans\",sans-serif;font-weight:700;font-size:50px}.padContainer .liveStream{z-index:1;top:0;left:0;width:100%;height:auto}.padContainer .btn-id3{border-radius:10px}.padContainer .font-weight-normal{width:250px;text-align:left}.padContainer .id3-pad-overlay{z-index:3;position:absolute;top:0;bottom:0;left:0;right:0;display:flex;align-items:center;color:#fff;font-size:20px;flex-direction:column;border:1px solid #ddd}.padContainer .extras{display:flex;top:15;right:15;left:15;width:100%;align-items:left}.padContainer .pad-content{position:absolute;display:block;text-align:center}.padContainer .pad-buttons{position:absolute;display:block;text-align:center;bottom:5%}.padContainer .padBehaviorLabel{font-size:20px}.padContainer .breathe{margin:6px 10px}.padContainer .id3-overlay{position:absolute}.padContainer .canvas{z-index:2;top:0;left:0;width:100%;height:100%;position:absolute}.padContainer .mirror{transform:rotateY(180deg);-webkit-transform:rotateY(180deg);-moz-transform:rotateY(180deg)}@media only screen and (max-width:500px){.show-big-screen{display:none}}@media only screen and (min-width:500px){.show-small-screen{display:none}}@media only screen and (min-width:601px){h4{font-size:25px}}@media only screen and (max-width:600px){h1{font-size:27px!important;margin-left:15%}h4{font-size:25px}}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"FacePadService"},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":32,"character":74}]}],"canvasResult":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":40,"character":3},"arguments":["resultCanvas",{"static":false}]}]}],"videoPAD":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":42,"character":3},"arguments":["videoPAD",{"static":false}]}]}],"fileForMatching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":44,"character":3},"arguments":["fileForMatching",{"static":false}]}]}],"wsEndpoint":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"wsFormatPicture":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":49,"character":3}}]}],"wsFaceVerification":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":52,"character":3}}]}],"wsImageSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":3}}]}],"apiKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":58,"character":3}}]}],"autoStart":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":3}}]}],"faceTracking":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":3}}]}],"faceTrackingOptionDesign":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":3}}]}],"mirror":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":3}}]}],"processProgressCircle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":3}}]}],"colorProgressCircle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":76,"character":3}}]}],"circleRadius":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":79,"character":3}}]}],"formatFinalPicture":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":82,"character":3}}]}],"downloadFinalPictureOnSuccess":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":85,"character":3}}]}],"resultPictureWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":88,"character":3}}]}],"enableAutoMatching":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":91,"character":3}}]}],"allowsMultipleRetries":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":94,"character":3}}]}],"videoWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":97,"character":3}}]}],"videoHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":100,"character":3}}]}],"videoWidthMobile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":103,"character":3}}]}],"videoHeightMobile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":106,"character":3}}]}],"frameWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":109,"character":3}}]}],"minHeadSize":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":112,"character":3}}]}],"messagesEnabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":115,"character":3}}]}],"padFrequency":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":118,"character":3}}]}],"startTipsLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":121,"character":3}}]}],"processFaceCenterLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":124,"character":3}}]}],"processNoFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":127,"character":3}}]}],"processMultipleFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":130,"character":3}}]}],"turnFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":133,"character":3}}]}],"expiredSessionErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":136,"character":3}}]}],"noFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":139,"character":3}}]}],"multipleFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":142,"character":3}}]}],"successLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":145,"character":3}}]}],"startButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":148,"character":3}}]}],"restartButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":151,"character":3}}]}],"compareButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":154,"character":3}}]}],"enableCamButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":157,"character":3}}]}],"retryButtonLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":160,"character":3}}]}],"matchingSuccessLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":163,"character":3}}]}],"matchingReadyLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":166,"character":3}}]}],"matchingErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":169,"character":3}}]}],"noInternetConnectionLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":172,"character":3}}]}],"userTooFarLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":175,"character":3}}]}],"userNotCenterLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":178,"character":3}}]}],"faceDetectedHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":181,"character":3}}]}],"cameraHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":184,"character":3}}]}],"sessionExpiredHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":187,"character":3}}]}],"changeStateHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":190,"character":3}}]}],"matchingHandler":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":193,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"processServerResponse":[{"__symbolic":"method"}],"endSessionPad":[{"__symbolic":"method"}],"getMessage":[{"__symbolic":"method"}],"getDatasVideoPAD":[{"__symbolic":"method"}],"isRequestPermissionState":[{"__symbolic":"method"}],"isInitialState":[{"__symbolic":"method"}],"isStartedState":[{"__symbolic":"method"}],"isProcessingState":[{"__symbolic":"method"}],"isErrorSessionState":[{"__symbolic":"method"}],"isErrorNoFaceState":[{"__symbolic":"method"}],"isErrorNoInternetConnection":[{"__symbolic":"method"}],"isErrorUserTooFar":[{"__symbolic":"method"}],"isErrorUserNotCenter":[{"__symbolic":"method"}],"isErrorMultipleFaceState":[{"__symbolic":"method"}],"isSuccessState":[{"__symbolic":"method"}],"isInvalidKeyState":[{"__symbolic":"method"}],"isMatchingReadyState":[{"__symbolic":"method"}],"isMatchingSuccessState":[{"__symbolic":"method"}],"isMatchingErrorState":[{"__symbolic":"method"}],"isDeviceMobile":[{"__symbolic":"method"}],"initPadSource":[{"__symbolic":"method"}],"leaving":[{"__symbolic":"method"}],"handleSuccess":[{"__symbolic":"method"}],"prepareCallPADStart":[{"__symbolic":"method"}],"callPADStart":[{"__symbolic":"method"}],"doPADStart":[{"__symbolic":"method"}],"prepareCallPADContinue":[{"__symbolic":"method"}],"arrayBufferToBase64":[{"__symbolic":"method"}],"manageFinalPicture":[{"__symbolic":"method"}],"showInstructionToUploadReference":[{"__symbolic":"method"}],"rotateAndCropFinalPicture":[{"__symbolic":"method"}],"b64toBlob":[{"__symbolic":"method"}],"emitFaceDetectedEvent":[{"__symbolic":"method"}],"emitInvalidKeyEvent":[{"__symbolic":"method"}],"emitSessionExpiredEvent":[{"__symbolic":"method"}],"emitCameraEvent":[{"__symbolic":"method"}],"emitChangeStateEvent":[{"__symbolic":"method"}],"resetUI":[{"__symbolic":"method"}],"compareWithReference":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":700,"character":3}}]}],"handleFiles":[{"__symbolic":"method"}],"downloadPicture":[{"__symbolic":"method"}],"faceTracker":[{"__symbolic":"method"}],"getMinHeadSize":[{"__symbolic":"method"}],"tempToBlob":[{"__symbolic":"method"}],"progressCircle":[{"__symbolic":"method"}]}},"FacePadModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":7,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"FacePadComponent"},{"__symbolic":"reference","name":"ɵa"}],"imports":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClientModule","line":10,"character":4},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":4},{"__symbolic":"reference","module":"@angular/platform-browser","name":"BrowserModule","line":12,"character":4}],"exports":[{"__symbolic":"reference","name":"FacePadComponent"}],"entryComponents":[{"__symbolic":"reference","name":"FacePadComponent"}]}]}],"members":{}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"id3-face-pad-messages","template":"<div class=\"mt-2\">\r\n <div *ngIf=\"isInitialState()\" class=\"alert alert-primary\" role=\"alert\">\r\n {{startTipsLabel}}\r\n </div>\r\n <div *ngIf=\"isStartedState() || (isProcessingState() && processInstruction.length>0)\" class=\"alert alert-danger\" role=\"alert\">\r\n {{processInstruction}}\r\n </div>\r\n <div *ngIf=\"isProcessingState() && processInstruction.length==0\" class=\"alert alert-primary\" role=\"alert\">\r\n {{turnFaceLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorSessionState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{expiredSessionErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorNoFaceState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{noFaceErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorNoInternetConnection()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{noInternetConnectionLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorUserTooFar()\" class=\"alert alert-primary\" role=\"alert\">\r\n {{userTooFarLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorUserNotCenter()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{userNotCenterLabel}}\r\n </div>\r\n <div *ngIf=\"isErrorMultipleFaceState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{multipleFaceErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isSuccessState()\" class=\"alert alert-success\" role=\"alert\">\r\n {{successLabel}}\r\n </div>\r\n <div *ngIf=\"isMatchingReadyState()\" class=\"alert alert-primary\" role=\"alert\">\r\n {{matchingReadyLabel}}\r\n </div>\r\n <div *ngIf=\"isMatchingSuccessState()\" class=\"alert alert-success\" role=\"alert\">\r\n {{matchingSuccessLabel}}\r\n </div>\r\n <div *ngIf=\"isMatchingErrorState()\" class=\"alert alert-danger\" role=\"alert\">\r\n {{matchingErrorLabel}}\r\n </div>\r\n <div *ngIf=\"isInvalidKeyState()\" class=\"alert alert-danger\" role=\"alert\">\r\n The API Key is invalid. Please check your API key.\r\n </div>\r\n</div>"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"startTipsLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":11,"character":3}}]}],"turnFaceLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":14,"character":3}}]}],"expiredSessionErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}}]}],"noFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"noInternetConnectionLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"userTooFarLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":26,"character":3}}]}],"userNotCenterLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"multipleFaceErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}}]}],"successLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"matchingSuccessLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":3}}]}],"matchingReadyLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"matchingErrorLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"padState":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}}]}],"processInstruction":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}],"isRequestPermissionState":[{"__symbolic":"method"}],"isInitialState":[{"__symbolic":"method"}],"isStartedState":[{"__symbolic":"method"}],"isProcessingState":[{"__symbolic":"method"}],"isErrorSessionState":[{"__symbolic":"method"}],"isErrorNoFaceState":[{"__symbolic":"method"}],"isErrorNoInternetConnection":[{"__symbolic":"method"}],"isErrorUserTooFar":[{"__symbolic":"method"}],"isErrorUserNotCenter":[{"__symbolic":"method"}],"isErrorMultipleFaceState":[{"__symbolic":"method"}],"isSuccessState":[{"__symbolic":"method"}],"isMatchingReadyState":[{"__symbolic":"method"}],"isMatchingSuccessState":[{"__symbolic":"method"}],"isMatchingErrorState":[{"__symbolic":"method"}],"isInvalidKeyState":[{"__symbolic":"method"}]}}},"origins":{"FacePadService":"./lib/face-pad.service","FacePadComponent":"./lib/component/face-pad.component","FacePadModule":"./lib/face-pad.module","ɵa":"./lib/component/face-pad-messages.component"},"importAs":"@id3/face-pad"}

@@ -75,2 +75,3 @@ import { AfterViewInit, ElementRef, OnDestroy, OnInit } from '@angular/core';

alarmThread: any;
retryCallPadStart: any;
generatedPicture: any;

@@ -77,0 +78,0 @@ xCoord: any;

{
"name": "@id3/face-pad",
"version": "1.5.3",
"version": "1.5.4",
"license": "MIT",

@@ -5,0 +5,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc