@idscan/onboarding
Version:
Wrapper of the IDVC library for DIVE Online.
1 lines • 123 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self)["IDVC-DVSO"]=t()}(this,function(){"use strict";var e=document.createElement("style");e.textContent=".idvc-preload-element{min-width:320px;height:520px}.vh-100{height:100vh}.d-none{display:none!important}.no-scroll{overflow:hidden;-webkit-overflow-scrolling:auto;position:fixed;width:100%}.qr-code__header{width:100%}.idvc-modal-background{--color-primary: #5185F3;top:0;left:0;z-index:2000;background-color:#0006;display:flex;align-items:center;justify-content:center}.idvc-after-submit{width:100%;height:100%;position:absolute}.pos-relative{position:relative}.hidden-element{visibility:hidden;position:absolute}.idvc-modal{font-family:Inter,sans-serif;box-sizing:border-box;position:absolute;top:50%;left:50%;background:#fff;box-shadow:0 1px 3px #0000004d;transform:translate(-50%,-50%);z-index:2001;display:flex;gap:20px;align-items:center;justify-content:center;flex-direction:column;padding:20px;border-radius:12px;min-height:150px}.idvc-modal *{box-sizing:border-box}.idvc-modal_validation{min-width:300px;width:30%;max-width:500px}.idvc-modal_qr-code{max-width:480px}.idvc-modal .color-danger{color:#cb0b00;fill:#cb0b00}.idvc-modal .color-success{color:#67c23a;fill:#67c23a}.idvc-modal .color-primary{color:#409eff;fill:#409eff}.idvc-modal .w-100{width:100%}.idvc-modal .w-45{width:45%}.idvc-modal .exclamation-sign{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE2LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjQ1LjMxMXB4IiBoZWlnaHQ9IjQ1LjMxMXB4IiB2aWV3Qm94PSIwIDAgNDUuMzExIDQ1LjMxMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDUuMzExIDQ1LjMxMTsiDQoJIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZD0iTTIyLjY3NSwwLjAyYy0wLjAwNiwwLTAuMDE0LDAuMDAxLTAuMDIsMC4wMDFjLTAuMDA3LDAtMC4wMTMtMC4wMDEtMC4wMi0wLjAwMUMxMC4xMzUsMC4wMiwwLDEwLjE1NCwwLDIyLjY1Ng0KCQljMCwxMi41LDEwLjEzNSwyMi42MzUsMjIuNjM1LDIyLjYzNWMwLjAwNywwLDAuMDEzLDAsMC4wMiwwYzAuMDA2LDAsMC4wMTQsMCwwLjAyLDBjMTIuNSwwLDIyLjYzNS0xMC4xMzUsMjIuNjM1LTIyLjYzNQ0KCQlDNDUuMzExLDEwLjE1NCwzNS4xNzYsMC4wMiwyMi42NzUsMC4wMnogTTIyLjY3NSwzOC44MTFjLTAuMDA2LDAtMC4wMTQtMC4wMDEtMC4wMi0wLjAwMWMtMC4wMDcsMC0wLjAxMywwLjAwMS0wLjAyLDAuMDAxDQoJCWMtMi4wNDYsMC0zLjcwNS0xLjY1OC0zLjcwNS0zLjcwNWMwLTIuMDQ1LDEuNjU5LTMuNzAzLDMuNzA1LTMuNzAzYzAuMDA3LDAsMC4wMTMsMCwwLjAyLDBjMC4wMDYsMCwwLjAxNCwwLDAuMDIsMA0KCQljMi4wNDUsMCwzLjcwNiwxLjY1OCwzLjcwNiwzLjcwM0MyNi4zODEsMzcuMTUyLDI0LjcyMywzOC44MTEsMjIuNjc1LDM4LjgxMXogTTI3Ljk4OCwxMC41NzgNCgkJYy0wLjI0MiwzLjY5Ny0xLjkzMiwxNC42OTItMS45MzIsMTQuNjkyYzAsMS44NTQtMS41MTksMy4zNTYtMy4zNzMsMy4zNTZjLTAuMDEsMC0wLjAyLDAtMC4wMjksMGMtMC4wMDksMC0wLjAyLDAtMC4wMjksMA0KCQljLTEuODUzLDAtMy4zNzItMS41MDQtMy4zNzItMy4zNTZjMCwwLTEuNjg5LTEwLjk5NS0xLjkzMS0xNC42OTJDMTcuMjAyLDguNzI3LDE4LjYyLDUuMjksMjIuNjI2LDUuMjkNCgkJYzAuMDEsMCwwLjAyLDAuMDAxLDAuMDI5LDAuMDAxYzAuMDA5LDAsMC4wMTktMC4wMDEsMC4wMjktMC4wMDFDMjYuNjg5LDUuMjksMjguMTA5LDguNzI3LDI3Ljk4OCwxMC41Nzh6Ii8+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8L3N2Zz4NCg==)}.idvc-modal__close-btn{width:20px;height:20px;cursor:pointer;margin-left:auto}.idvc-modal__close-btn:hover{background-color:var(--el-color-primary)}.idvc-modal__header{display:flex;align-items:center;justify-content:center;width:100%}.idvc-modal__header__body{display:flex;column-gap:12px}.idvc-modal__header__sign{transform:translateY(2px)}.idvc-modal__header__content{line-height:24px;font-size:20px;margin:0;font-weight:500}.idvc-modal__header__content_qr-code{line-height:44px;font-size:30px;color:#303133}.idvc-modal__header.center{justify-content:center;padding:0}.idvc-modal__body{padding:20px 24px;font-size:16px;word-break:break-word;color:#1c1c1c}.idvc-modal__body__list{margin-left:0;padding-left:20px;text-align:justify;margin-top:0;margin-bottom:0}.idvc-modal__body__list--no-numbers{list-style-type:none;padding-left:0}.idvc-modal__body__list__item{margin-bottom:12px;line-height:22px}.idvc-modal__body__list__item:last-child{margin-bottom:0}.idvc-modal__body_qr-code{color:#000;text-align:left;min-height:250px;position:relative;width:100%;display:flex;align-items:center;justify-content:center}.idvc-modal__body_process_ready-header{font-weight:600;font-size:15px;margin:20px auto 5px}.idvc-modal__body_process_ready-text{display:inline-block;font-style:normal;font-weight:400;font-size:14px;line-height:19px;color:#5a5b62}.idvc-modal__body_process_ready__canvas-container{margin:10px auto}.idvc-modal__body_process_ready-canvas{display:block;margin:0 auto;padding:40px}.idvc-modal__body_process_ready-info{margin:20px auto;padding:8px 12px;border-radius:6px}.idvc-modal__body_process_ready-info__text{margin-left:8px}.idvc-modal__body_process_validating-info__text{text-align:center}.idvc-modal__body_process_done-container{display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:20px}.idvc-modal__body_process_done__text{text-align:center;font-style:normal;font-weight:600;font-size:28px;line-height:48px}.idvc-modal__footer{display:grid;grid-template-columns:1fr 1fr;gap:25px;width:100%}.idvc-modal__footer.is-single-button{grid-template-columns:1fr}.idvc-modal__footer_qr-code{text-align:center}.idvc-modal.center{justify-content:center}.idvc-consent-form{font-family:Inter,sans-serif;background:#fff;display:flex;flex-direction:column;max-width:480px;z-index:1010;width:100%;height:100%}.idvc-consent-form__header{padding:32px 40px;background:#f5f6f9;border-radius:4px 4px 0 0}.idvc-consent-form__header__content{font-size:30px;line-height:36px;font-weight:500;margin:0}.idvc-consent-form__body{display:flex;flex-direction:column;padding:20px 40px;font-size:16px!important;word-break:break-word;line-height:22px}.idvc-consent-form__body a{text-decoration-line:none}.idvc-consent-form__body a:visited{color:#00e}.idvc-consent-form__body .input-wrapper{display:flex;flex-direction:column;align-items:flex-start}.idvc-consent-form__body .input-wrapper label{color:#555e65;font-weight:500}.idvc-consent-form__body .input-wrapper input[type=text]{box-sizing:border-box;border-radius:6px;border:2px solid #dedfe1;height:40px;font-size:20px;margin-top:10px;width:100%}.idvc-consent-form__body .input-wrapper input[type=text]:focus{outline:none}.idvc-consent-form__body .checkbox-wrapper{display:flex;margin-top:20px;align-items:flex-start}.idvc-consent-form__body .checkbox-wrapper input[type=checkbox]{transform:scale(1.3);margin:7px 3px 3px -3px}.idvc-consent-form__body .checkbox-wrapper__text{margin-left:-20px;line-height:24px;padding-left:25px}.idvc-consent-form__body .checkbox-wrapper__star{margin-right:10px;align-self:flex-start}.idvc-consent-form__footer{display:flex;justify-content:flex-end;column-gap:25px;padding:0 40px 40px;margin-top:30px}.idvc-fixed{position:fixed}.color-red{color:red}.btn{line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #DCDFE6;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:.1s;transition:.1s;font-weight:500;padding:12px 20px;font-size:14px;border-radius:8px}.btn--default:focus,.btn--default:hover{color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.btn--default:active{color:#3a8ee6;border-color:#3a8ee6;outline:0}.btn--primary{color:#fff;background-color:#5185f3;border-color:#5185f3}.btn--primary:focus,.btn--primary:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}.btn--primary:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff;outline:0}.btn--info{color:#fff;background-color:#4e5d6e;border-color:#4e5d6e}.btn--disabled{color:#fff;background-color:#a0cfff;border-color:#a0cfff}.btn--disabled:hover{cursor:not-allowed;color:#fff;background-color:#a0cfff;border-color:#a0cfff}.qr-code-wrap{z-index:1000;margin:-10px auto 40px}.qr-code-wrap__button{background:#515d6c;border-radius:4px;width:100%;display:inline-block;white-space:nowrap;cursor:pointer;border:1px solid #515D6C;color:var(--color-white);-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:none;margin:0;transition:.1s;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;padding:18px 20px;font-style:normal;font-weight:500;font-size:14px;line-height:1.4}.qr-code-wrap__content{display:flex;justify-content:center;align-items:center;column-gap:13px}.qr-code-wrap__button:hover{background-color:#909399;border-color:#909399}.el-loading-spinner{display:flex;align-items:center;justify-content:center;width:100%;min-height:120px}.el-loading-spinner .circular{width:60px;height:60px;animation:loading-rotate 2s linear infinite}.el-loading-spinner .circular .path{stroke:#5185f3;stroke-width:2;stroke-linecap:round;stroke-dasharray:90,150;stroke-dashoffset:0;animation:loading-dash 1.5s ease-in-out infinite}.el-loading-spinner_qr-code{display:flex;align-items:center;flex-direction:column;row-gap:25px;padding:10px}.el-loading-spinner_qr-code .circular{height:100px;width:100px;stroke:#5185f3}.el-loading-spinner_qr-code .circular__background{animation:none;position:absolute}.el-loading-spinner_qr-code .circular .path{stroke-width:1}.el-loading-spinner_qr-code .circular .path__background{stroke:#c6c6c6;stroke-dasharray:none}@keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40}to{stroke-dasharray:90,150;stroke-dashoffset:-120}}#idvc-wrapper-container{position:relative}\n/*$vite$:1*/",document.head.appendChild(e);function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,o={exports:{}};n||(n=1,function(e){var t=function(e){var t,n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(x){d=function(e,t,n){return e[t]=n}}function c(e,t,n,o){var a=t&&t.prototype instanceof v?t:v,r=Object.create(a.prototype),s=new L(o||[]);return i(r,"_invoke",{value:T(e,n,s)}),r}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(x){return{type:"throw",arg:x}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",g="executing",m="completed",f={};function v(){}function y(){}function b(){}var S={};d(S,r,function(){return this});var M=Object.getPrototypeOf,E=M&&M(M(B([])));E&&E!==n&&o.call(E,r)&&(S=E);var w=b.prototype=v.prototype=Object.create(S);function C(e){["next","throw","return"].forEach(function(t){d(e,t,function(e){return this._invoke(t,e)})})}function _(e,t){function n(i,a,r,s){var l=u(e[i],e,a);if("throw"!==l.type){var d=l.arg,c=d.value;return c&&"object"==typeof c&&o.call(c,"__await")?t.resolve(c.__await).then(function(e){n("next",e,r,s)},function(e){n("throw",e,r,s)}):t.resolve(c).then(function(e){d.value=e,r(d)},function(e){return n("throw",e,r,s)})}s(l.arg)}var a;i(this,"_invoke",{value:function(e,o){function i(){return new t(function(t,i){n(e,o,t,i)})}return a=a?a.then(i,i):i()}})}function T(e,t,n){var o=h;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return R()}for(n.method=i,n.arg=a;;){var r=n.delegate;if(r){var s=A(r,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=u(e,t,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function A(e,n){var o=n.method,i=e.iterator[o];if(i===t)return n.delegate=null,"throw"===o&&e.iterator.return&&(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),f;var a=u(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,f;var r=a.arg;return r?r.done?(n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,f):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function B(e){if(e){var n=e[r];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:R}}function R(){return{value:t,done:!0}}return y.prototype=b,i(w,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:y,configurable:!0}),y.displayName=d(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,d(e,l,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},C(_.prototype),d(_.prototype,s,function(){return this}),e.AsyncIterator=_,e.async=function(t,n,o,i,a){void 0===a&&(a=Promise);var r=new _(c(t,n,o,i),a);return e.isGeneratorFunction(n)?r:r.next().then(function(e){return e.done?e.value:r.next()})},C(w),d(w,l,"Generator"),d(w,r,function(){return this}),d(w,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},e.values=B,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(o,i){return s.type="throw",s.arg=e,n.next=o,i&&(n.method="next",n.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],s=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var l=o.call(r,"catchLoc"),d=o.call(r,"finallyLoc");if(l&&d){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var r=a?a.completion:{};return r.type=e,r.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;N(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,o){return this.delegate={iterator:B(e),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),f}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(o));const i=e=>!!e,a=e=>!!/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}/.test(e),r=e=>e.toLowerCase().startsWith("pk_")&&a(e),s=e=>!!document.getElementById(e);class l extends Error{}class d extends l{constructor(e){super(e),this.message=`Configuration parameter error: ${e}`,this.name="ConfigError",this.header="Configuration Error!",this.content=e||""}}const c=[{type:"DL",steps:[{type:"front",name:"Document Front",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1},{type:"pdf",name:"Document Back",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1,enableFourCornerCapture:!1},{type:"face",name:"Face",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1}]},{type:"IC",steps:[{type:"front",name:"Document Front",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1},{type:"pdf",name:"Document Back",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1,enableFourCornerCapture:!0},{type:"face",name:"Face",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1}]},{type:"Passport",steps:[{type:"mrz",name:"Document Front",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1},{type:"face",name:"Face",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1}]},{type:"PassportCard",steps:[{type:"front",name:"Document Front",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1},{type:"mrz",name:"Document Back",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1},{type:"face",name:"Face",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1}]},{type:"GreenCard",steps:[{type:"front",name:"Document Front",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1},{type:"mrz",name:"Document Back",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1},{type:"face",name:"Face",mode:{uploader:!0,video:!0},autocaptureDelay:0,enableDesktopNotification:!1}]},{type:"EmploymentAuthorization",steps:[{type:"front",name:"Document Front",mode:{uploader:!0,video:!0}},{type:"mrz",name:"Document Back",mode:{uploader:!0,video:!0}},{type:"face",name:"Face",mode:{uploader:!0,video:!0}}]}],u=e=>{let t;const n=(o=e.documentTypes)?o.map(e=>({...e,steps:e.steps.filter(e=>!e.mode||Object.values(e.mode).some(Boolean))})).filter(e=>e.steps.length).map(e=>({type:e.type,steps:e.steps})):[];var o;const i=n.find(e=>"Passport"===e.type);if(i){const e={type:"mrz",name:"Passport MRZ",mode:{uploader:!0,video:!0}},t=i.steps.findIndex(e=>"front"===e.type);-1!==t&&i.steps.splice(t,1,e)}return t=0===n.length?c:n,t},h=e=>new URLSearchParams(window.location.search).get(e),p=({name:e,value:t,validationFunctions:n})=>{if(!n.reduce((e,n)=>e&&n(t),!0))throw new d(e)};class g{constructor(e){this.validate=()=>{(({demoMode:e,applicantId:t,domainId:n,domainApi:o,publicKey:l,el:d="videoCapturingEl"})=>{const c=[i,a];[e?null:{name:"applicantId",value:t,validationFunctions:c},{name:"domainId",value:n,validationFunctions:c},{name:"publicKey",value:l,validationFunctions:[i,r]},{name:"el",value:d,validationFunctions:[i,s]},{name:"domainApi should not be empty",value:o,validationFunctions:[i]}].filter(Boolean).forEach(e=>p(e))})(this.wrapper)},this.wrapper={...e},e.getApplicantIdFromURL&&(this.wrapper.applicantId=h("requestId")||e.applicantId)}parseFromWeb(e){const t=JSON.parse(null==e?void 0:e.jsonSettings);this.isAuth||this.faceOnly?this.libConfig=this.faceAuthorizationConfig(t):(t.documentTypes=u(t),this.libConfig=t),this.cssStyles=null==e?void 0:e.cssStyles,this.cssVariables=null==e?void 0:e.cssVariables}faceAuthorizationConfig(e){return e.isShowDocumentTypeSelect=!1,e.documentTypes=[{type:"DL",steps:[{type:"face",name:"Face",mode:{uploader:!0,video:!0}}]}],e}getFirstStepModeState(){const e=structuredClone(this.firstStepMode);return()=>e}get firstStepMode(){var e,t,n;return null==(n=null==(t=null==(e=this.libConfig)?void 0:e.documentTypes[0])?void 0:t.steps[0])?void 0:n.mode}set applicantId(e){(e=>{p({name:"applicantId",value:e,validationFunctions:[i,a]})})(e),this.wrapper.applicantId=e}get applicantId(){return this.wrapper.applicantId}get domainId(){return this.wrapper.domainId}get publicKey(){return this.wrapper.publicKey}get domainApi(){return this.wrapper.domainApi}get onValidate(){var e,t;return(null==(t=null==(e=this.wrapper)?void 0:e.callbacks)?void 0:t.onValidate)?this.wrapper.callbacks.onValidate:()=>{}}get onError(){var e,t;return(null==(t=null==(e=this.wrapper)?void 0:e.callbacks)?void 0:t.onError)?this.wrapper.callbacks.onError:()=>{}}get onGetOptionsStart(){var e,t;return(null==(t=null==(e=this.wrapper)?void 0:e.callbacks)?void 0:t.onGetOptionsStart)?this.wrapper.callbacks.onGetOptionsStart:()=>{}}get onGetOptionsComplete(){var e,t;return(null==(t=null==(e=this.wrapper)?void 0:e.callbacks)?void 0:t.onGetOptionsComplete)?this.wrapper.callbacks.onGetOptionsComplete:()=>{}}set libConfig(e){var t;const n=null==(t=this.IDVCConfig)?void 0:t.licenseKey;this.wrapper.preferApiConfig?this.IDVCConfig={...this.IDVCConfig,...e,...this.wrapper.callbacks}:this.IDVCConfig={...this.IDVCConfig,...e,...this.wrapper,...this.wrapper.callbacks},n&&(this.IDVCConfig.licenseKey=n)}get libConfig(){return this.IDVCConfig||{}}get cssStylesConfig(){return this.cssStyles}get cssVariablesConfig(){return this.cssVariables}get mountElement(){return this.wrapper.el||"videoCapturingEl"}get demoMode(){return this.wrapper.demoMode||!1}get isAuth(){return this.wrapper.isAuth||!1}get faceOnly(){return this.wrapper.faceOnly||!1}get qrCodeLinkOrigin(){return this.wrapper.qrCodeLinkOrigin||"https://diveonline.idscan.net"}get IDVCDownloadVersion(){return e=this.wrapper.IDVCDownloadVersion||"",/^([1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(e)?this.wrapper.IDVCDownloadVersion:"latest";var e}}class m extends l{constructor(e){super(e),this.message="This application is closed",this.name="NotValidApplicant",this.header="Request Closed",this.content="This application is closed"}}class f extends l{constructor(e){const t="RequestValidationError"===e.code?e.code:"ValidationError";if(super(t),this.message=e.message||"Try again later",this.name=t,this.setHeader(e),this.content=e.message||"Try again later",null==e?void 0:e.propertyErrors){const t=Object.values(e.propertyErrors).reduce((e,t)=>`${e}<li class="idvc-modal__body__list__item">${t}</li>`,"");this.content=`<ol class="idvc-modal__body__list">${t}</ol>`}}setHeader({code:e=""}){e&&["ApiError","ValidationError","MultipleErrors","BadRequest"].includes(e)?this.header="Something Went Wrong!":this.header="Data invalid"}}class v extends l{constructor(e){super(e.status.toString());const{status:t}=e;let n;switch(t){case 400:n="Bad Request";break;case 401:n="Unauthorized";break;case 403:n="Forbidden";break;case 404:n="Not Found";break;case 500:n="Server Error";break;default:n="Something Went Wrong!"}this.message=`Status code: ${t}. ${n}`,this.name="HttpError",this.statusCode=t,this.header="Server Side Problems",this.content="Please try again later"}}class y extends l{constructor(e){super(e),this.message="This application is closed",this.name="RequestTimeoutError",this.header="Request Timeout",this.content="This application is closed"}}const b={validationResponseId:0,validationRequestId:"",documentType:0,document:null,attemptsLeft:0,attemptsCount:0,status:0,validationStatus:{expired:!1,documentIsValid:!1,faceIsValid:!1},invalidDataErrors:null,faceSuccess:null,documentSuccess:null,documentHasNotExpired:null,documentValidationTests:null,callBackUrl:null,notificationType:0,isCompleted:!1},S=(e={})=>({...b,...e}),M=S({validationResponseId:6223,validationRequestId:"8151f48d-bab1-4491-037d-08d9b3c5cfec",documentType:1,document:{abbr3Country:"USA",abbrCountry:"US",address:"25805 VAN LEUVEN ST 136",city:"LOMA LINDA",class:"C",country:"United States of America",dob:"1961-01-07",expires:"2024-01-07",eyes:"Brown",familyName:"GILMER",firstName:"DARIENNE",fullName:"DARIENNE ELIZABETH GILMER",gender:"Female",hair:"Black",height:"064 IN",id:"C3568758",idType:"DL",issued:"2019-01-07",middleName:"ELIZABETH",postalBox:null,privateName:"ELIZABETH",state:"CA",template:"09",weight:"77",zip:"92354-0000"},validationStatus:{expired:!1,documentIsValid:!0,faceIsValid:!0},documentValidationTests:[{displayName:"DMV",name:"DMVValidation",status:0,statusString:"Failed",reason:"Internal Server Error"},{displayName:"IdentiFraud",name:"IdentiFraudValidation",status:-1,statusString:"Disabled",reason:"Integration was turned off"}]});S({validationResponseId:6224,validationRequestId:"fa33df4c-7d5c-4485-037e-08d9b3c5cfec",attemptsLeft:19,status:2,invalidDataErrors:[{code:"FaceDocNotDetectError",message:"The face has not been found on the document"},{code:"PDF417Error",message:"Unable to capture data from the back of the document"},{code:"OCRError",message:"Unable to capture data from the front of the document"}]}),S({validationResponseId:6230,validationRequestId:"eae11ae1-1c8f-40bd-0381-08d9b3c5cfec",documentType:2,document:{abbr3Country:"USA",abbrCountry:"US",address:null,city:null,class:null,country:"United States of America",dob:"1986-07-24",expires:"2030-07-13",eyes:null,familyName:"LEVELS",firstName:"DAVID HARRISON",fullName:"LEVELS DAVID HARRISON",gender:"M",hair:null,height:null,id:"659328258",idType:"PASSPORT",issued:null,middleName:null,postalBox:null,privateName:null,state:null,template:null,weight:null,zip:null},attemptsLeft:18,status:1,validationStatus:{expired:!1,documentIsValid:!0,faceIsValid:!1}}),S({applicantId:"bb165b57-e8b1-412a-b848-2e4669da58e0",attemptId:71441,documentType:1,attemptsCount:5,attemptsLeft:5,status:2,validationStatus:{expired:null,documentIsValid:null,faceIsValid:!0,antiSpoofingIsValid:null},invalidDataErrors:[{code:"QualityWarning",message:null}],hasRiskEvents:!0,documentValidationTests:[]});class E extends l{constructor(e){if(super("FaceAuthorizationError"),this.message=e.message||"Try again later",this.name="FaceAuthorizationError",this.setHeader(e),this.content=e.message||"Try again later",null==e?void 0:e.propertyErrors){const t=Object.values(e.propertyErrors).reduce((e,t)=>`${e}<li class="idvc-modal__body__list__item">${t}</li>`,"");this.content=`<ol class="idvc-modal__body__list">${t}</ol>`}}setHeader({code:e=""}){e&&["ApiError","ValidationError","MultipleErrors","BadRequest"].includes(e)?this.header="Something Went Wrong!":this.header="Data invalid"}}var w=(e=>(e.DANGER="danger",e.SUCCESS="success",e.PRIMARY="primary",e))(w||{}),C=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.FAIL=1]="FAIL",e[e.INVALID_DATA=2]="INVALID_DATA",e[e.ERROR=3]="ERROR",e[e.COMPLETE=4]="COMPLETE",e))(C||{}),_=(e=>(e.READY="ready",e.VALIDATING="validating",e.DONE_WITH_SUCCESS="doneWithSuccess",e.DONE_WITH_ERROR="doneWithError",e))(_||{}),T=(e=>(e[e.NEVER_OPEN=0]="NEVER_OPEN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED",e[e.CLOSED_FOREVER=3]="CLOSED_FOREVER",e))(T||{}),A=(e=>(e[e.WebLibStandalone=0]="WebLibStandalone",e[e.WebLibDashboard=1]="WebLibDashboard",e[e.Android=2]="Android",e[e.Ios=3]="Ios",e))(A||{}),I=(e=>(e[e[""]=0]="",e[e["sent via SMS"]=1]="sent via SMS",e[e["sent via email"]=2]="sent via email",e[e["sent via SMS or email"]=3]="sent via SMS or email",e))(I||{}),N=(e=>(e[e.DL=1]="DL",e[e.Passport=2]="Passport",e[e.PassportCard=3]="PassportCard",e[e.GreenCard=6]="GreenCard",e[e.InternationalId=7]="InternationalId",e[e.Barcode=11]="Barcode",e[e.FaceAuthorization=10]="FaceAuthorization",e[e.EmploymentAuthorization=9]="EmploymentAuthorization",e))(N||{}),L=(e=>(e[e.OK=200]="OK",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.Gone=410]="Gone",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.LengthRequired=411]="LengthRequired",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.RequestURITooLong=414]="RequestURITooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.Locked=423]="Locked",e[e.MisdirectedRequest=421]="MisdirectedRequest",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HTTPVersionNotSupported=505]="HTTPVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.NetworkConnectTimeoutError=524]="NetworkConnectTimeoutError",e))(L||{});class B{constructor(e,t="https://api-dvsonline.idscan.net"){this.idvcManifestUrl="https://neurons.cdn.idscan.net/manifest.json",this.HEADERS={"Content-Type":"application/json"};const n=`${t}/api/v2/`;this.baseUrl=`${n}public/`,this.baseEmbeddedUrl=`${n}EmbeddedApp/`,this.HEADERS.Authorization=`Bearer ${e}`}async checkApplicantIdIsNotClosed({applicantId:e="",demoMode:t=!1,faceAuth:n=!1,faceOnly:o=!1}){if(t)return!0;const i=`${this.baseUrl}Applicants/${e}/Completed`,a=await fetch(i,{method:"GET",headers:this.HEADERS});if(a.ok&&!n)throw new m("request closed");if(a.ok&&n)return!0;if(L.NotFound===a.status&&n)throw new m("validation not completed");if(L.NotFound===a.status&&(!n||o))return!0;if(L.BadRequest===a.status){const e=await a.json();throw new f(e)}throw new v(a)}async getCurrentIdvcVersion(){try{const e=await fetch(this.idvcManifestUrl);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return(await e.json()).latestVersion}catch(e){throw console.error("Error fetching data:",e),e}}async getOptions(e){const t=`${this.baseUrl}Integrations/${e}/Configuration`;try{const e=await fetch(t,{method:"GET",headers:this.HEADERS});if(e.ok)return await e.json();throw new v(e)}catch(n){throw n instanceof v?n:new v(n)}}async validateApplicant(e,t=!1,n=!1){if(t)return M;const o=`${this.baseUrl}Validation`,i=await fetch(o,{method:"POST",headers:this.HEADERS,body:JSON.stringify(e)});if(i.ok)return i.json();if(L.BadRequest===i.status){const e=await i.json();if(n)throw new E(e);throw new f(e)}if(L.NotFound===i.status){const e=await i.json();throw new E(e)}throw new v(i)}async forceClose(e){const t=`${this.baseUrl}Applicants/${e}/Complete`,n=await fetch(t,{method:"POST",headers:this.HEADERS});if(n.ok)return n.json();if(L.BadRequest===n.status){const e=await n.json();throw new f(e)}throw new v(n)}async closeEmbeddedApplication(e,t){let n;try{const o=`${this.baseEmbeddedUrl}Close/${e}`;if(n=await fetch(o,{method:"POST",headers:this.HEADERS}),!n.ok)throw new Error(`Request Error: ${n.status}`);t()}catch(o){throw o instanceof v?o:new v(n)}}async longPollingRequest(e,t,n){try{const o=`${this.baseEmbeddedUrl}${e}`,i=await fetch(o,t);if(L.RequestTimeout===i.status||L.NetworkConnectTimeoutError===i.status)throw new y("Request Timeout");if(!i.ok)throw new Error(`Request Error: ${i.status}`);n(await i.json())}catch(o){o instanceof y&&await this.longPollingRequest(e,t,n)}}}const R={back:[N.DL,N.InternationalId],mrz:[N.PassportCard,N.GreenCard,N.Passport,N.EmploymentAuthorization],pdf:[N.DL,N.InternationalId]},x=(e,t)=>{var n;const o=t.find(e=>Object.keys(R).includes(e.type));if(!o)return!1;return(null==(n=R[o.type])?void 0:n.some(t=>t===e))??!1},D=(e,t)=>{const n=t.some(e=>"mrz"===e.type);if(e===N.Passport&&n)return!0;return!!t.find(e=>"front"===e.type)};class k{constructor(){this.cleanBase64=e=>{if(!e||"string"!=typeof e)return"";const t=e.split(/:image\/\w+;base64,/);return t.length>0?t.at(-1)??"":""},this.validationModel=e=>{var t;const n=e.documentType===N.Passport,o=(()=>{const t=e.steps.find(e=>"pdf"===e.type||"mrz"===e.type||"back"===e.type),o=(null==t?void 0:t.mrzText)||(null==t?void 0:t.trackString)||"";return n?{img:"",trackString:o}:{img:(null==t?void 0:t.img)||"",trackString:o}})();return{frontImageBase64:this.cleanBase64((()=>{var t;if(n){const t=e.steps.find(e=>"mrz"===e.type);if(t)return t.img}return null==(t=e.steps.find(e=>"front"===e.type))?void 0:t.img})()),backOrSecondImageBase64:this.cleanBase64(null==o?void 0:o.img),faceImageBase64:this.cleanBase64(null==(t=e.steps.find(e=>"face"===e.type))?void 0:t.img),trackString:o.trackString,ssn:"",verifyFace:e.steps.some(e=>"face"===e.type),documentType:e.documentType,captureMethod:e.steps.reduce((e,t)=>`${e}${Number(t.isAuto??!1)}`,""),userAgent:window.navigator.userAgent,frontEndMetadata:e.metaData,isBackOrSecondImageProcessingEnabled:x(e.documentType,e.steps),isOcrEnabled:D(e.documentType,e.steps)}}}async initializeLibrary(e,t,n){if(!this.library){if(e)await this.loadFromCDN(t);else{if(!n)throw new Error("IDVCModule must be provided when not loading from CDN");this.loadFromNodeModules(n)}this.postInitialize()}}loadFromNodeModules(e){this.library=new e(this.IdvcConfig)}async loadFromCDN(e){return new Promise((t,n)=>{const o=document.createElement("script");o.src=`https://neurons.cdn.idscan.net/${e}-next/idvc.js`,o.async=!0,o.addEventListener("load",()=>t(window.IDVC)),o.addEventListener("error",n),document.body.append(o)}).then(e=>{this.library=new e(this.IdvcConfig)}).catch(e=>{console.log(e)})}get initialized(){return!!this.library}get version(){return this.library.version}set configs({IdvcConfig:e,CSSStylesConfig:t,CSSVariablesConfig:n}){this.IdvcConfig=e,this.CSSStylesConfig=t,this.CSSVariablesConfig=n}set loading(e){this.library&&this.library.showSpinner(e)}postInitialize(){document.head.insertAdjacentHTML("beforeend",`\n <style id="onboarding-css-variables">${this.CSSVariablesConfig??""}</style>\n <style id="onboarding-css-config">${this.CSSStylesConfig??""}</style>\n `)}reloadComponent(e){this.library.reloadComponent(e)}updateDocumentTypes(e){this.library.updateDocumentTypes(e)}restart(){this.library.resetAllSteps()}showLoader(e,t,n){this.library.showLoader(e,t,n)}mixSubmit(e,t){const n=this.IdvcConfig[e];this.IdvcConfig[e]=e=>{if(n){Promise.resolve(n(e)).then(()=>{t(this.validationModel(e))}).catch(()=>{t(this.validationModel(e))})}else t(this.validationModel(e))}}}class P{constructor(e){this._closable=!0,this.mountEl="string"==typeof e?document.getElementById(e):e,this.init()}init(e='<div class="idvc-modal d-none" id="idvc-modal">\n <div class="el-loading-spinner d-none" id="idvc-loading-spinner">\n <svg viewBox="25 25 50 50" class="circular">\n <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>\n </svg>\n </div>\n <div class="idvc-modal__close-btn" id="idvc-close-modal-btn"></div>\n <div class="idvc-modal__header">\n <h2 class="idvc-modal__header__content"></h2>\n </div>\n <div class="idvc-modal__body"></div>\n <div class="idvc-modal__footer"></div>\n</div>\n<div class="idvc-modal-background" id="idvc-modal-background">\n</div>\n'){this.modalContainer=document.createElement("div"),this.mountEl.append(this.modalContainer),this.modalContainer.insertAdjacentHTML("beforeend",e),this.container=this.modalContainer.querySelector("#idvc-modal"),this.headerContainer=this.container.querySelector(".idvc-modal__header"),this.headerText=this.headerContainer.querySelector(".idvc-modal__header__content"),this.background=this.modalContainer.querySelector("#idvc-modal-background"),this.spinner=this.modalContainer.querySelector("#idvc-loading-spinner"),this.closeBtn=this.modalContainer.querySelector("#idvc-close-modal-btn"),this.mountEl.classList.add("pos-relative"),this.body=this.container.querySelector(".idvc-modal__body"),this.footer=this.container.querySelector(".idvc-modal__footer"),this.closeHandler(),this.background.classList.add("idvc-preload-element")}set closable(e){this._closable=e,this.toggleCloseBtn()}set header(e){e?(this.headerText.textContent=e.toString(),this.headerContainer.classList.remove("d-none")):this.headerContainer.classList.add("d-none")}set showBackground(e){e?this.background.classList.remove("d-none"):this.background.classList.add("d-none")}set content(e){e?(this.body.innerHTML=e.toString(),this.body.classList.remove("d-none")):this.body.classList.add("d-none")}toggleCloseBtn(){this._closable?this.closeBtn.classList.remove("d-none"):this.closeBtn.classList.add("d-none")}closeHandler(){this.background.addEventListener("click",e=>{const t=e.target;this._closable&&t.classList.contains("idvc-modal-background")&&this.hide()}),this.closeBtn.addEventListener("click",()=>{this.hide()})}hideSpinner(){this.hide(),this.spinner.classList.add("d-none")}hide(){this.showBackground=!1,this.container.classList.add("d-none"),this.background.classList.remove("idvc-preload-element")}show(){this.showBackground=!0,this.container.classList.remove("d-none")}showSpinner(e){e?(this.spinner.classList.remove("d-none"),this.headerContainer.classList.add("d-none"),this.body.classList.add("d-none"),this.footer.classList.add("d-none")):(this.spinner.classList.add("d-none"),this.headerContainer.classList.remove("d-none"),this.body.classList.remove("d-none"),this.footer.classList.remove("d-none"))}prepareBackgroundStyles(){this.background.classList.add("idvc-after-submit"),this.mountEl.classList.add("pos-relative")}}class O extends P{init(e='<div class="idvc-modal-background" id="idvc-modal-background">\n</div>\n<div class="idvc-modal idvc-modal_validation d-none" id="idvc-modal">\n <div class="el-loading-spinner d-none" id="idvc-loading-spinner">\n <svg viewBox="25 25 50 50" class="circular">\n <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>\n </svg>\n </div>\n <div class="idvc-modal__header">\n <div class="idvc-modal__header__body">\n <div class="idvc-modal__header__sign">\n <div id="idvc-modal-header-sign-info"></div>\n <div id="idvc-modal-header-sign-check" class="d-none"></div>\n </div>\n <h2 class="idvc-modal__header__content">\n Header\n </h2>\n </div>\n <div class="idvc-modal__close-btn" id="idvc-close-modal-btn">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path></svg>\n </div>\n </div>\n <div class="idvc-modal__body">\n Please try again\n </div>\n <div class="idvc-modal__footer">\n <button type="button" class="btn btn--primary" id="idvc-modal-try-again-btn"><span>Try again</span></button>\n <button type="button" class="btn btn--default" id="idvc-modal-complete-btn"><span>Complete </span></button>\n </div>\n</div>\n'){super.init(e),this.headerInfoContainer=this.headerContainer.querySelector("#idvc-modal-header-sign-info"),this.headerCheckContainer=this.headerContainer.querySelector("#idvc-modal-header-sign-check"),this.headerInfoContainer.innerHTML='<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8 1C9.97933 1.052 11.6278 1.73683 12.9455 3.0545C14.2632 4.37217 14.948 6.02067 15 8C14.948 9.97933 14.2632 11.6278 12.9455 12.9455C11.6278 14.2632 9.97933 14.948 8 15C6.02067 14.948 4.37217 14.2632 3.0545 12.9455C1.73683 11.6278 1.052 9.97933 1 8C1.052 6.02067 1.73683 4.37217 3.0545 3.0545C4.37217 1.73683 6.02067 1.052 8 1ZM8 4C7.729 4 7.505 4.099 7.328 4.297C7.151 4.495 7.07283 4.72933 7.0935 5L7.453 9C7.474 9.146 7.53383 9.26317 7.6325 9.3515C7.73117 9.43983 7.8535 9.48417 7.9995 9.4845C8.1455 9.48483 8.26783 9.4405 8.3665 9.3515C8.46517 9.2625 8.525 9.14533 8.546 9L8.9055 5C8.9265 4.729 8.84833 4.49467 8.671 4.297C8.49367 4.09933 8.27067 4.00033 8 4ZM8 12C8.22933 11.9897 8.4195 11.9115 8.5705 11.7655C8.7215 11.6195 8.797 11.432 8.797 11.203C8.797 10.974 8.7215 10.7838 8.5705 10.6325C8.4195 10.4812 8.22933 10.4057 8 10.406C7.77067 10.4063 7.5805 10.4818 7.4295 10.6325C7.2785 10.7832 7.203 10.9733 7.203 11.203C7.203 11.4327 7.2785 11.6202 7.4295 11.7655C7.5805 11.9108 7.77067 11.989 8 12Z"/>\n</svg>\n',this.headerCheckContainer.innerHTML='<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path class="color-success" d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>\n</svg>\n',this.headerInfoSvg=this.headerInfoContainer.querySelector("svg"),this.tryAgainBtn=this.container.querySelector("#idvc-modal-try-again-btn"),this.completeBtn=this.container.querySelector("#idvc-modal-complete-btn"),this.tryAgainBtn.addEventListener("click",()=>this.hide()),this.addCompleteHandler()}set type(e){e===w.SUCCESS?this.applySuccessStyles():this.applyFailureStyles(e)}set buttons({tryAgain:e=!1,complete:t=!1}){const n=+e+ +t,o=n>0,i=1===n;this.setVisible(this.tryAgainBtn,e),this.setVisible(this.completeBtn,t),o?this.footer.classList.remove("d-none"):this.footer.classList.add("d-none"),i?this.footer.classList.add("is-single-button"):this.footer.classList.remove("is-single-button")}applySuccessStyles(){this.container.classList.add("center"),this.headerContainer.classList.add("center"),this.headerInfoContainer.classList.add("d-none"),this.headerCheckContainer.classList.remove("d-none")}applyFailureStyles(e){this.headerCheckContainer.classList.add("d-none"),this.headerInfoContainer.classList.remove("d-none"),this.headerInfoSvg.setAttribute("class",`color-${e}`)}setVisible(e,t){t?e.classList.remove("d-none"):e.classList.add("d-none")}addCompleteHandler(e=()=>{}){this.completeBtn.addEventListener("click",()=>{this.hide(),e()})}}class F{constructor({mountElementID:e,consentBodyText:t,consentCheckboxText:n}){this.target={inputState:"",checkboxState:!1};document.getElementById(e).insertAdjacentHTML("afterbegin",'<div class="idvc-consent-form" id="idvc-consent-form">\n <div class="idvc-consent-form__header">\n <h2 class="idvc-consent-form__header__content">\n Consent Agreement\n </h2>\n </div>\n <div class="idvc-consent-form__body" id="idvc-consent-form-body">\n <p id="idvc-consent-form-text">\n </p>\n <div class="input-wrapper">\n <label for="idvc-full-name-input">\n <span>\n <sup class="color-red">*</sup>\n Full Name\n </span>\n </label>\n <input\n type="text"\n name="fullName"\n id="idvc-full-name-input"\n >\n </div>\n <div class="checkbox-wrapper">\n <label class="checkbox-wrapper__star" for="idvc-consent">\n <span>\n <sup class="color-red">*</sup>\n </span>\n </label>\n <input type="checkbox" id="idvc-consent">\n <span class="checkbox-wrapper__text" id="checkbox-wrapper__text"></span>\n </div>\n </div>\n <div class="idvc-consent-form__footer">\n <button type="button" class="btn btn--info" id="idvc-consent-form-cancel-btn">\n <span>Cancel</span>\n </button>\n <button type="button" class="btn btn--primary btn--disabled" id="idvc-consent-form-proceed-btn">\n <span>Proceed</span>\n </button>\n </div>\n</div>\n\n');document.getElementById("idvc-consent-form-text").innerHTML=t;document.getElementById("checkbox-wrapper__text").innerHTML=n,this.init()}init(){this.el=document.getElementById("idvc-consent-form"),this.proceedBtn=document.getElementById("idvc-consent-form-proceed-btn"),this.cancelBtn=document.getElementById("idvc-consent-form-cancel-btn"),this.inputEl=document.getElementById("idvc-full-name-input"),this.checkboxEl=document.getElementById("idvc-consent");const e={set:(e,t,n,o)=>(Reflect.set(e,t,n,o),this.isValidInput()&&this.target.checkboxState?(this.proceedBtn.disabled=!1,this.proceedBtn.classList.remove("btn--disabled")):(this.proceedBtn.disabled=!0,this.proceedBtn.classList.add("btn--disabled")),!0),get:(e,t)=>e[t]};this.state=new Proxy(this.target,e),this.proceedBtn.disabled=!0,this.proceedBtn.addEventListener("click",()=>{const e=new Event("proceedEvent",{bubbles:!0});this.el.remove(),this.proceedBtn.dispatchEvent(e)},{once:!0}),this.cancelBtn.addEventListener("click",()=>{this.inputEl.value="",this.checkboxEl.checked=!1}),this.inputEl.addEventListener("input",e=>{const t=e.target;this.state.inputState=t.value}),this.checkboxEl.addEventListener("click",e=>{const t=e.target;this.state.checkboxState=t.checked})}get form(){return this.el}isValidInput(){return this.state.inputState.trim().length>=3&&this.state.inputState.trim().length<100}}class U{constructor(e,t){this.statuses={[C.SUCCESS]:"Verification complete!",[C.FAIL]:"Validation failed!",[C.INVALID_DATA]:"Data invalid!",[C.ERROR]:"Something went wrong",4:"Request closed"},this.result={type:w.PRIMARY,header:"",content:"",buttons:{tryAgain:!1,complete:!1}},this.modal=t,this.parseResponse(e)}parseResponse(e){const{code:t="",message:n="",status:o=-1,attemptsLeft:i=-1,attemptsCount:a=-1,invalidDataErrors:r=[],notificationType:s=0,isCompleted:l}=e;this.code=t,this.message=n,this.status=o,this.isCompleted=l,this.attemptsLeft=i,this.attemptsCount=a,this.invalidDataErrors=r||[],this.notificationType=s}calculateType(){let e;e=this.status===C.SUCCESS?w.SUCCESS:this.status===C.ERROR?w.PRIMARY:w.DANGER,this.result.type=e}calculateHeader(){this.result.header=this.statuses[this.status]||this.statuses[3]}calculateContent(){if((this.status===C.FAIL&&this.attemptsLeft>0||this.status===C.ERROR)&&(this.result.content="Please try again"),this.status===C.INVALID_DATA){const e="Image may be blurry. Please try taking photo again in a different room or with different lighting.",t=this.invalidDataErrors.reduce((t,{code:n,message:o})=>`${t}<li class="idvc-modal__body__list__item">${"OCRError"===n?e:o??""}</li>`,""),n=1===this.invalidDataErrors.length?"idvc-modal__body__list--no-numbers":"";this.result.content=`<ol class="idvc-modal__body__list ${n}">${t}</ol>`}this.status===C.FAIL&&0===this.attemptsLeft&&this.attemptsCount>0&&(this.result.content=`No more attempts can be made.<br>You have made all ${this.attemptsCount}<br>of the allowed submissions.<br>Please have a new request link<br>${I[this.notificationType]}`),this.code&&this.message&&(this.result.content=this.message)}calculateFooter(){if(this.status===C.COMPLETE||this.status===C.SUCCESS||this.isCompleted)return;const e=this.attemptsLeft>0;this.result.buttons.tryAgain=e,this.result.buttons.complete=e}prepareModal(){this.calculateType(),this.calculateHeader(),this.calculateContent(),this.calculateFooter()}showModal(){this.modal.type=this.result.type,this.modal.header=this.result.header,this.modal.content=this.result.content,this.modal.buttons=this.result.buttons,this.modal.prepareBackgroundStyles(),this.modal.show()}hideModal(){this.modal.hide()}}const G={apiKeys:["scheduling","userActivation","geolocation","webkitTemporaryStorage","webkitPersistentStorage","getGamepads","javaEnabled","sendBeacon","vibrate","clipboard","credentials","keyboard","managed","mediaDevices","storage","serviceWorker","virtualKeyboard","wakeLock","ink","hid","locks","mediaCapabilities","mediaSession","presentation","serial","usb","windowControlsOverlay","xr","userAgentData","canShare","share","clearAppBadge","getBattery","getUserMedia","requestMIDIAccess","requestMediaKeySystemAccess","setAppBadge","webkitGetUserMedia","getInstalledRelatedApps","registerProtocolHandler","unregisterProtocolHandler"]};function H(){const e=navigator.language;if(e&&window.Intl){const t=new Intl.DateTimeFormat(e,{dateStyle:"full",timeStyle:"long"}),{calendar:n,numberingSystem:o}=t.resolvedOptions(),{weekInfo:i,collations:a}=new Intl.Locale(e);return{locale:e,calendar:n,numberingSystem:o,weekInfo:i,collations:a}}return{}}function V(){const{userAgent:e,cookieEnabled:t,platform:n,hardwareConcurrency:o,languages:i}=navigator;return{userAgent:e,cookieEnabled:t,platform:n,hardwareConcurrency:o,languages:i}}async function j(e=""){if(window.crypto){const t=(new TextEncoder).encode(e),n=crypto.subtle||crypto.webkitSubtle,o=await n.digest("SHA-256",t);return Array.from(new Uint8Array(o)).map(e=>e.toString(16).padStart(2,"0")).join("")}return e}const z={fonts:JSON.parse('[".Aqua Kana",".Helvetica LT MM",".Times LT MM","18thCentury","8514oem","AR BERKLEY","AR JULIAN","AR PL UKai CN","AR PL UMing CN","AR PL UMing HK","AR PL UMing TW","AR PL UMing TW MBE","Aakar","Abadi MT Condensed Extra Bold","Abadi MT Condensed Light","Abyssinica SIL","AcmeFont","Adobe Arabic","Agency FB","Aharoni","Aharoni Bold","Al Bayan","Al Bayan Bold","Al Bayan Plain","Al Nile","Al Tarikh","Aldhabi","Alfredo","Algerian","Alien Encounters","Almonte Snow","American Ty