@ekyc_qoobiss/qbs-ect-cmp 3.6.28 → 3.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/TranslationUtils-b918ffb1.js +346 -0
- package/dist/cjs/agreement-check_19.cjs.entry.js +783 -284
- package/dist/cjs/random-actions.cjs.entry.js +5 -6
- package/dist/collection/components/base-component.js +0 -4
- package/dist/collection/components/common/agreement-check/agreement-check.js +6 -2
- package/dist/collection/components/common/camera-error/camera-error.js +7 -5
- package/dist/collection/components/common/capture-error/capture-error.js +12 -10
- package/dist/collection/components/common/how-to-info/how-to-info.js +11 -9
- package/dist/collection/components/common/id-back-capture/id-back-capture.js +8 -6
- package/dist/collection/components/common/id-capture/id-capture.js +6 -4
- package/dist/collection/components/common/id-tilt/id-tilt.js +6 -4
- package/dist/collection/components/common/random-actions/random-actions.js +5 -6
- package/dist/collection/components/common/selfie-capture/selfie-capture.js +7 -5
- package/dist/collection/components/common/selfie-tilt/selfie-tilt.js +8 -6
- package/dist/collection/components/flow/agreement-info/agreement-info.js +4 -2
- package/dist/collection/components/flow/end-redirect/end-redirect.js +5 -4
- package/dist/collection/components/flow/landing-validation/landing-validation.js +5 -3
- package/dist/collection/components/flow/mobile-redirect/mobile-redirect.js +8 -6
- package/dist/collection/components/flow/sms-code-validation/sms-code-validation.js +12 -10
- package/dist/esm/TranslationUtils-8ceeb437.js +339 -0
- package/dist/esm/agreement-check_19.entry.js +575 -76
- package/dist/esm/random-actions.entry.js +5 -6
- package/dist/qbs-ect-cmp/p-473a4636.entry.js +1 -0
- package/dist/qbs-ect-cmp/{p-c32a782a.entry.js → p-b2c9c8d7.entry.js} +2 -2
- package/dist/qbs-ect-cmp/p-e568a07c.js +1 -0
- package/dist/qbs-ect-cmp/qbs-ect-cmp.esm.js +1 -1
- package/dist/types/components/base-component.d.ts +0 -2
- package/dist/types/components/common/agreement-check/agreement-check.d.ts +2 -0
- package/dist/types/components/common/camera-error/camera-error.d.ts +1 -0
- package/dist/types/components/common/capture-error/capture-error.d.ts +1 -0
- package/dist/types/components/common/how-to-info/how-to-info.d.ts +2 -1
- package/dist/types/components/common/id-back-capture/id-back-capture.d.ts +1 -0
- package/dist/types/components/common/id-capture/id-capture.d.ts +1 -0
- package/dist/types/components/common/id-tilt/id-tilt.d.ts +1 -0
- package/dist/types/components/common/random-actions/random-actions.d.ts +2 -2
- package/dist/types/components/common/selfie-capture/selfie-capture.d.ts +2 -1
- package/dist/types/components/common/selfie-tilt/selfie-tilt.d.ts +2 -1
- package/dist/types/components/flow/agreement-info/agreement-info.d.ts +2 -1
- package/dist/types/components/flow/end-redirect/end-redirect.d.ts +2 -1
- package/dist/types/components/flow/landing-validation/landing-validation.d.ts +1 -0
- package/dist/types/components/flow/mobile-redirect/mobile-redirect.d.ts +1 -0
- package/dist/types/components/flow/sms-code-validation/sms-code-validation.d.ts +2 -1
- package/package.json +1 -1
- package/dist/cjs/base-component-aa9e52bf.js +0 -832
- package/dist/esm/base-component-b7f50d31.js +0 -824
- package/dist/qbs-ect-cmp/p-215a7e76.entry.js +0 -1
- package/dist/qbs-ect-cmp/p-7bedffaa.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s}from"./p-8942656c.js";import{B as i,F as o}from"./p-7bedffaa.js";const n=class{constructor(s){t(this,s),this.baseComponent=new i(o.SelfieTilt)}componentWillLoad(){}buttonClick(){}render(){return s("div",{class:"container"},s("div",{class:"row"},s("div",{class:"text-center"},s("h1",null,this.topTitle)),s("div",{class:"pos-relative show-bottom"},s("div",{class:"btn-buletin"},s("button",{class:"main-button",onClick:()=>this.buttonClick()},this.buttonText),s("p",{class:"main-text font-size-18 text-right mb-0"},this.baseComponent.translations.GlobalValues.FooterText)))))}};n.style="";export{n as random_actions}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t,f as e}from"./p-8942656c.js";var i;!function(t){t[t.Capturing=0]="Capturing",t[t.FinishedCapturing=1]="FinishedCapturing",t[t.Waiting=2]="Waiting",t[t.NotFound=3]="NotFound",t[t.Aborted=4]="Aborted"}(i||(i={}));const s=t=>!("isConnected"in t)||t.isConnected,n=(()=>{let t;return(...e)=>{t&&clearTimeout(t),t=setTimeout((()=>{t=0,(t=>{for(let e of t.keys())t.set(e,t.get(e).filter(s))})(...e)}),2e3)}})(),o=t=>"function"==typeof t?t():t;var a;!function(t){t[t.LANDING=0]="LANDING",t[t.AGREEMENT=1]="AGREEMENT",t[t.PHONE=2]="PHONE",t[t.CODE=3]="CODE",t[t.CODEERROR=4]="CODEERROR",t[t.ID=5]="ID",t[t.LIVENESS=6]="LIVENESS",t[t.COMPLETE=7]="COMPLETE",t[t.ERROREND=8]="ERROREND",t[t.CAMERAERROR=9]="CAMERAERROR",t[t.NONE=10]="NONE"}(a||(a={}));class r{}r.IDPoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/id/id_front_tilt.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/id/id_rotate.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/id/id_back_tilt.mp4"};class c{}c.FacePoseDemoMapping={0:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_left.mp4",1:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_rotate_right.mp4",2:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_back.mp4",3:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_tilt_front.mp4",4:"https://ekyc.blob.core.windows.net/$web/animations/selfie/selfie_main.mp4"};class h{}h.FlowStatusKey="qbs-ect-flowstatus",h.RequestIdKey="qbs-ect-requestid",h.TokenKey="qbs-ect-token",h.InitialisedKey="qbs-ect-initialised",h.HasIdBackKey="qbs-ect-has-id-back",h.AgreementValidationKey="qbs-ect-agreement-validation",h.PhoneValidationKey="qbs-ect-phone-validation",h.RefreshDoneKey="qbs-ect-refresh-done";class l{constructor(){this.uriEnv="/",this.uriEnv="QA"==d.environment?"/dev_":"/",this.OtpSend=this.uriEnv+"validation/otp/send",this.OtpCheck=this.uriEnv+"validation/otp/check",this.IdentityInsert=this.uriEnv+"validation/identity/insert",this.UploadCapture=this.uriEnv+"validation/upload/capture",this.GetAgreement=this.uriEnv+"validation/agreement/content",this.GenerateAgreement=this.uriEnv+"validation/agreement/generate",this.SendLink=this.uriEnv+"validation/otp/sendlink",this.GetStatus=this.uriEnv+"validation/identity/status",this.AddLog=this.uriEnv+"validation/logs/add",this.AddStep=this.uriEnv+"validation/logs/step",this.AbortRequest=this.uriEnv+"validation/identity/abort"}}const{state:d,onChange:u}=(()=>{const i=((t,e=((t,e)=>t!==e))=>{const i=o(t);let s=new Map(Object.entries(null!=i?i:{}));const n={dispose:[],get:[],set:[],reset:[]},a=()=>{var e;s=new Map(Object.entries(null!==(e=o(t))&&void 0!==e?e:{})),n.reset.forEach((t=>t()))},r=t=>(n.get.forEach((e=>e(t))),s.get(t)),c=(t,i)=>{const o=s.get(t);e(i,o,t)&&(s.set(t,i),n.set.forEach((e=>e(t,i,o))))},h="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>r(e),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>s.has(e),set:(t,e,i)=>(c(e,i),!0)}),l=(t,e)=>(n[t].push(e),()=>{((t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)})(n[t],e)});return{state:h,get:r,set:c,on:l,onChange:(e,i)=>{const s=l("set",((t,s)=>{t===e&&i(s)})),n=l("reset",(()=>i(o(t)[e])));return()=>{s(),n()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(l("set",e.set)),e.get&&t.push(l("get",e.get)),e.reset&&t.push(l("reset",e.reset)),e.dispose&&t.push(l("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{n.dispose.forEach((t=>t())),a()},reset:a,forceUpdate:t=>{const e=s.get(t);n.set.forEach((i=>i(t,e,e)))}}})({flowStatus:a.NONE,environment:"PROD",debug:!1,requestId:"",redirectId:"",initialised:!1,token:"",cameraIds:[],cameraId:"",hasIdBack:!1,hasSelfieGesture:!1,hasIdTilt:!1,agreementsValidation:!0,phoneValidation:!0,phoneNumber:"",apiBaseUrl:"https://apiro.id-kyc.com",device:null,langIso:"ro"},void 0);return i.use((()=>{if("function"!=typeof t)return{};const i=new Map;return{dispose:()=>i.clear(),get:e=>{const s=t();s&&((t,e,i)=>{const s=t.get(e);s?s.includes(i)||s.push(i):t.set(e,[i])})(i,e,s)},set:t=>{const s=i.get(t);s&&i.set(t,s.filter(e)),n(i)},reset:()=>{i.forEach((t=>t.forEach(e))),n(i)}}})()),i})();var p,w,b,m,f;u("environment",(t=>{d.debug="QA"==t})),u("flowStatus",(t=>{sessionStorage.setItem(h.FlowStatusKey,a[t])})),u("token",(t=>{sessionStorage.setItem(h.TokenKey,t)})),u("requestId",(t=>{sessionStorage.setItem(h.RequestIdKey,t)})),u("initialised",(t=>{sessionStorage.setItem(h.InitialisedKey,String(t))})),u("hasIdBack",(t=>{sessionStorage.setItem(h.HasIdBackKey,String(t))})),u("agreementsValidation",(t=>{sessionStorage.setItem(h.AgreementValidationKey,String(t))})),u("phoneValidation",(t=>{sessionStorage.setItem(h.PhoneValidationKey,String(t))})),function(t){t[t.ComponentLoaded="component-loaded"]="ComponentLoaded",t[t.MobileRedirect="mobile-redirect"]="MobileRedirect",t[t.Landing="landing"]="Landing",t[t.Agreements="agreements"]="Agreements",t[t.OtpSend="otp-send"]="OtpSend",t[t.OtpCheck="otp-check"]="OtpCheck",t[t.CiFront="ci-front"]="CiFront",t[t.CiFrontHowTo="ci-front-how-to"]="CiFrontHowTo",t[t.CiFrontCapture="ci-front-capture"]="CiFrontCapture",t[t.CiBack="ci-back"]="CiBack",t[t.CiBackHowTo="ci-back-how-to"]="CiBackHowTo",t[t.CiBackCapture="ci-back-capture"]="CiBackCapture",t[t.CiTilt="ci-tilt"]="CiTilt",t[t.CiError="ci-error"]="CiError",t[t.SelfieHowTo="selfie-how-to"]="SelfieHowTo",t[t.SelfieTilt="selfie-tilt"]="SelfieTilt",t[t.SelfieCapture="selfie-capture"]="SelfieCapture",t[t.Selfie="selfie"]="Selfie",t[t.SelfieError="selfie-error"]="SelfieError",t[t.End="end"]="End",t[t.CameraError="camera-error"]="CameraError"}(p||(p={})),function(t){t[t.Initialized="initialized"]="Initialized",t[t.Finalized="finalized"]="Finalized",t[t.None="none"]="None"}(w||(w={}));class y{constructor(){this.serviceErrors=["Service Unavailable","Unauthorized"],this.toBase64=t=>new Promise(((e,i)=>{const s=new FileReader;s.readAsDataURL(t),s.onload=()=>e(s.result),s.onerror=t=>i(t)})),this.urls=new l}async http(t){const e=await fetch(t);if(!e.ok)throw new Error(e.statusText);try{return await e.json()}catch(t){throw new Error("No json found in response "+t)}}async post(t,e,i=!0){var s=new Request(d.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});try{return await this.http(s)}catch(s){if(!i||this.serviceErrors.includes(s.message))throw s;this.AddLog("Error in post ",s);try{var n=new Request(d.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(n)}catch(i){this.AddLog("Error in post ",i);var o=new Request(d.apiBaseUrl+t,{method:"POST",body:e,headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(o)}}}async get(t,e=!0){var i=new Request(d.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});try{return await this.http(i)}catch(i){if(!e||this.serviceErrors.includes(i.message))throw i;this.AddLog("Error in get ",i);try{var s=new Request(d.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(s)}catch(e){this.AddLog("Error in get ",e);var n=new Request(d.apiBaseUrl+t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"IDKYC-TOKEN "+d.token}});return await this.http(n)}}}async SendOTPCode(t,e){let i={requestId:t,phone:e};return(await this.post(this.urls.OtpSend,JSON.stringify(i))).sent}async CheckOTPCode(t,e){let i={requestId:t,otp:e};return(await this.post(this.urls.OtpCheck,JSON.stringify(i))).valid}async AddIdentificationRequest(t,e){d.debug&&console.log("Calling identity request with store:"+JSON.stringify(d));let i={requestId:d.requestId,clientDeviceInfo:JSON.stringify(t),redirectId:d.redirectId,phoneNumber:d.phoneNumber,version:e},s=await this.post(this.urls.IdentityInsert,JSON.stringify(i));return""==d.requestId&&(d.requestId=s.requestId),d.hasIdBack=s.hasIdBack,d.hasIdTilt=s.hasIdTilt,d.hasSelfieGesture=s.hasSelfieGesture,d.agreementsValidation=s.agreementsValidation,d.phoneValidation=s.phoneValidation,d.phoneNumber=s.phoneNumber,!0}async UploadFileForRequestB64(t,e,i){let s={requestId:t,type:e,data:await this.toBase64(i)},n=await this.post(this.urls.UploadCapture,JSON.stringify(s));return d.hasIdBack||"IdFront"!=e?d.hasIdBack&&"IdBack"==e?n.isValid:"Selfie"!=e||n.isValid:n.isValid}async GetAgreement(t){return(await this.get(this.urls.GetAgreement+"?type="+t+"&requestId="+d.requestId)).htmlText}async GenerateAgreement(t){let e={requestId:d.requestId,documentType:t};return(await this.post(this.urls.GenerateAgreement,JSON.stringify(e))).generation}async GetStatus(t){let e=await this.get(this.urls.GetStatus+"?orderId="+t);return i[e.status]}async SendLink(t,e){let i={requestId:d.requestId,link:t,phoneNumber:e};return(await this.post(this.urls.SendLink,JSON.stringify(i))).sent}async AddLog(t,e){try{let i={requestId:d.requestId,action:a[d.flowStatus],message:JSON.stringify({error:t,context:e})};return(await this.post(this.urls.AddLog,JSON.stringify(i),!1)).saved}catch(t){}}async AddStep(t,e){let i={requestId:d.requestId,redirectId:d.redirectId,step:p[t],moment:w[e],timestamp:(new Date).toISOString()};return(await this.post(this.urls.AddStep,JSON.stringify(i))).saved}async AbortRequest(){return(await this.post(this.urls.AbortRequest,JSON.stringify({requestId:d.requestId}))).saved}}!function(t){t.Android="android",t.iOS="ios",t.Unknown="unknown",t.WindowsPhone="Windows Phone"}(b||(b={})),function(t){t.Linux="linux",t.MacOS="mac_os",t.Unix="unix",t.Unknown="unknown",t.Windows="windows"}(m||(m={})),function(t){t.Chrome="chrome",t.Firefox="firefox",t.Safari="safari",t.Mi="mi",t.Unknown="unknown"}(f||(f={}));class v{constructor(){var t,e,i,s;this.supportedScreenOrientation=null!==(e=null!==(t=((null===screen||void 0===screen?void 0:screen.orientation)||{}).type)&&void 0!==t?t:screen.mozOrientation)&&void 0!==e?e:screen.msOrientation,this.safariScreenOrientation=!(null===screen||void 0===screen?void 0:screen.orientation)&&matchMedia("(orientation: portrait)").matches?"portrait-primary":"landscape-primary",this.initialScreenOrientation=null!==(s=null!==(i=this.supportedScreenOrientation)&&void 0!==i?i:this.safariScreenOrientation)&&void 0!==s?s:"portrait-primary",this.userAgent=navigator.userAgent||navigator.vendor||window.opera||void 0,this.isMobile=this.isMobileDevice(),this.isTablet=this.isTabletDevice(),this.isDesktop=!this.isMobile&&!this.isTablet}isMobileDevice(){return[/(Android)(.+)(Mobile)/i,/BlackBerry/i,/iPhone|iPod/i,/Opera Mini/i,/IEMobile/i].some((t=>this.userAgent.match(t)))}isTabletDevice(){return/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(this.userAgent.toLowerCase())}getMobileOS(){return this.isMobileDevice()?/windows phone/i.test(this.userAgent)?b.WindowsPhone:/android/i.test(this.userAgent)?b.Android:/iPad|iPhone|iPod/.test(this.userAgent)&&!window.MSStream?b.iOS:b.Unknown:void 0}getDesktopOS(){return this.isDesktop?-1!==this.userAgent.indexOf("Win")?m.Windows:-1!==this.userAgent.indexOf("Mac")?m.MacOS:-1!==this.userAgent.indexOf("X11")?m.Unix:-1!==this.userAgent.indexOf("Linux")?m.Linux:m.Unknown:void 0}getDeviceOS(){var t;return null!==(t=this.getMobileOS())&&void 0!==t?t:this.getDesktopOS()}getBrowser(){if(/XiaoMi/i.test(this.userAgent)||/MiuiBrowser/i.test(this.userAgent))return f.Mi;var t=/chrome/i.test(this.userAgent);return t?f.Chrome:/firefox/i.test(navigator.userAgent)?f.Firefox:!t&&/safari/i.test(navigator.userAgent)?f.Safari:f.Unknown}getDevice(){return{isDesktop:this.isDesktop,desktopOS:this.getDesktopOS(),isWindowsDesktop:this.getDeviceOS()===m.Windows,isLinuxOrUnixDesktop:this.getDeviceOS()===m.Linux||this.getDeviceOS()===m.Unix,isMobile:this.isMobile,mobileOS:this.getMobileOS(),isAndroidDevice:this.getDeviceOS()===b.Android,isAppleDevice:this.getDeviceOS()===b.iOS||this.getDeviceOS()===m.MacOS,isUnknownMobileDevice:this.getDeviceOS()===b.Unknown,browser:this.getBrowser(),isTablet:this.isTablet,initialScreenOrientation:this.initialScreenOrientation}}}class g{static init(t){this.callingModule=t}static flowEvent(t,e){const i=`ect-${t.toString()}-${e.toString()}-event`;this.callingModule.dispatchEvent(new CustomEvent(i,{detail:{},bubbles:!0,cancelable:!0,composed:!0}))}static flowStarted(){this.callingModule.dispatchEvent(new CustomEvent("ect-started",{detail:{},bubbles:!0,cancelable:!0,composed:!0}))}static flowAborted(){sessionStorage.clear(),this.callingModule.dispatchEvent(new CustomEvent("ect-aborted",{detail:{},bubbles:!0,cancelable:!0,composed:!0}))}static flowCompleted(){sessionStorage.clear(),this.callingModule.dispatchEvent(new CustomEvent("ect-completed",{detail:{},bubbles:!0,cancelable:!0,composed:!0}))}static flowError(t){sessionStorage.clear(),this.callingModule.dispatchEvent(new CustomEvent("ect-error",{detail:{error:t},bubbles:!0,cancelable:!0,composed:!0}))}static tokenExpired(){sessionStorage.clear(),this.callingModule.dispatchEvent(new CustomEvent("ect-session-expired",{detail:{},bubbles:!0,cancelable:!0,composed:!0}))}}const S=new class{async getValues(){return this.values||(this.values=await this.fetchTranslations()),this.values}getLocale(t=document.body){const e=t.closest("[lang]");return e?e.lang:d.langIso}async fetchTranslations(){const t=this.getLocale(),e=JSON.parse(sessionStorage.getItem(`i18n.${t}`));if(e&&Object.keys(e).length>0)return e;try{const e=await fetch(`/i18n/${t}.json`);if(e.ok){const i=await e.json();return sessionStorage.setItem(`i18n.${t}`,JSON.stringify(i)),i}}catch(e){console.error(`Error loading locale: ${t}`,e)}}};class E{constructor(t){this.apiErrorEvent=null,this.processError=null,this.apiCall=new y,t&&(this.flowStep=t),d.device||(d.device=(new v).getDevice()),S.getValues().then((t=>{this.translations=t}))}setEventEmitter(t){this.apiErrorEvent=t}setErrorCallback(t){this.processError=t}async logStep(t,e){g.flowEvent(t,e);try{await this.apiCall.AddStep(t,e)}catch(i){this.apiErrorEvent?this.apiErrorEvent.emit(i):this.processError(i,`${t}-${e}`)}}async initialize(){g.flowEvent(this.flowStep,w.Initialized);try{await this.apiCall.AddStep(this.flowStep,w.Initialized)}catch(t){this.apiErrorEvent?this.apiErrorEvent.emit(t):this.processError(t,`${this.flowStep}-${w.Initialized}`)}}async finalize(){g.flowEvent(this.flowStep,w.Finalized);try{await this.apiCall.AddStep(this.flowStep,w.Finalized)}catch(t){this.apiErrorEvent?this.apiErrorEvent.emit(t):this.processError(t,`${this.flowStep}-${w.Finalized}`)}}}export{y as A,E as B,g as E,p as F,r as I,b as M,i as O,h as S,a,f as b,w as c,c as d,d as s}
|