d)&&(W=($=$.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*n&&0l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var ht=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&ft(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(lt))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(lt,"active"),r.setAttribute("data-styled-version","5.3.0");var a=St();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},xt=function(){function e(e){var t=this.element=kt(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(c+=e+",")})),r+=""+s+l+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),Rt=/(a)(d)/gi,Ot=function(e){return String.fromCharCode(e+(e>25?39:97))};function Pt(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Ot(t%52)+n;return(Ot(t%52)+n).replace(Rt,"$1-$2")}var Mt=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Dt=function(e){return Mt(5381,e)};function Ft(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(o,"."+a,void 0,r);t.insertRules(r,a,s)}i.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,c=Mt(this.baseHash,n.hash),u="",f=0;f>>0);if(!t.hasNameForId(r,m)){var g=n(u,"."+m,void 0,r);t.insertRules(r,m,g)}i.push(m)}}return i.join(" ")},e}(),Wt=/^\s*\/\/.*$/gm,Lt=[":","[",".","#"];function Ht(e){var t,n,r,i,o=void 0===e?it:e,a=o.options,s=void 0===a?it:a,l=o.plugins,c=void 0===l?rt:l,u=new qe(s),f=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,s,l,c,u,f){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(i[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),d=function(e,r,o){return 0===r&&-1!==Lt.indexOf(o[n.length])||o.match(i)?e:"."+t};function p(e,o,a,s){void 0===s&&(s="&");var l=e.replace(Wt,""),c=o&&a?a+" "+o+" { "+l+" }":l;return t=s,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),u(a||!o?"":o,c)}return u.use([].concat(c,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,d))},h,function(e){if(-2===e){var t=f;return f=[],t}}])),p.hash=c.length?c.reduce((function(e,t){return t.name||ft(15),Mt(e,t.name)}),5381).toString():"",p}var $t=Ye.createContext(),Ut=($t.Consumer,Ye.createContext()),Bt=(Ut.Consumer,new Tt),Yt=Ht();function Gt(){return ue($t)||Bt}function Vt(){return ue(Ut)||Yt}function qt(e){var t=ie(e.stylisPlugins),n=t[0],r=t[1],i=Gt(),o=ce((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=ce((function(){return Ht({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return ae((function(){Ve()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),Ye.createElement($t.Provider,{value:o},Ye.createElement(Ut.Provider,{value:a},e.children))}var Zt=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Yt);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return ft(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Yt),this.name+e.hash},e}(),Xt=/([A-Z])/,Jt=/([A-Z])/g,Kt=/^ms-/,Qt=function(e){return"-"+e.toLowerCase()};function en(e){return Xt.test(e)?e.replace(Jt,Qt).replace(Kt,"-ms-"):e}var tn=function(e){return null==e||!1===e||""===e};function nn(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,sn=/(^-|-$)/g;function ln(e){return e.replace(an,"-").replace(sn,"")}var cn=function(e){return Pt(Dt(e)>>>0)};function un(e){return"string"==typeof e&&!0}var fn=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},hn=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function dn(e,t,n){var r=e[n];fn(t)&&fn(r)?pn(r,t):e[n]=t}function pn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(un(e)?e:ln(at(e)));return yn(e,et({},i,{attrs:h,componentId:o}),n)},Object.defineProperty(m,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?pn({},e.defaultProps,t):t}}),m.toString=function(){return"."+m.styledComponentId},i&&Qe()(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),m}var _n=function(e){return function e(t,n,r){if(void 0===r&&(r=it),!(0,Z.isValidElementType)(n))return ft(1,String(n));var i=function(){return t(n,r,rn.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,n,et({},r,{},i))},i.attrs=function(i){return e(t,n,et({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},i}(yn,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){_n[e]=_n(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Ft(e),Tt.registerId(this.componentId+1)}var t=e.prototype;t.createStyles=function(e,t,n,r){var i=r(nn(this.rules,t,n,r).join(""),""),o=this.componentId+e;n.insertRules(o,o,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&Tt.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}();!function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=St();return""},this.getStyleTags=function(){return e.sealed?ft(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return ft(2);var n=((t={})[lt]="",t["data-styled-version"]="5.3.0",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=St();return r&&(n.nonce=r),[Ye.createElement("style",et({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Tt({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?ft(2):Ye.createElement(qt,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return ft(3)}}();const bn=_n,wn="3.3.1";function Cn(e){return new Promise((t=>{setTimeout(t,e)}))}const Sn=e=>Number.parseFloat(e.toFixed(3)),kn=e=>JSON.parse(JSON.stringify(e,((e,t)=>"number"==typeof t?Sn(t):t)));const xn=e=>Object.entries(e).map((([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"),An=e=>500*Math.round(e/500)/1e3,zn=e=>e<=1?Math.round(20*e)/20:50*Math.round(e/50),In=e=>Math.round(2*e)/2;function En(e,t,n){return new Promise((r=>{e.toBlob((e=>{r(function(e){if(null==e)throw new Error("unwrap: value must not be null/undefined, but is: "+(null===e?"null":"undefined"));return e}(e))}),t,n)}))}const Tn=bn.div`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 0.25em;
+ margin: 0 auto;
+ padding: 0.583em 0.666em;
+ background: ${e=>e.isInCandidateSelection?`${e.theme.colors.instructionColorSuccess}`:`${e.theme.colors.instructionColor}`};
+ color: ${e=>e.theme.colors.instructionTextColor};
+ border: 0;
+ font-family: Montserrat, Arial, sans-serif;
+ font-weight: 600;
+ line-height: 1em;
+ font-size: ${e=>`${e.fontSize}px`};
+`,Rn=({instructionText:e,fontSize:t,isInCandidateSelection:n})=>e?d(Tn,{fontSize:t,isInCandidateSelection:n},e):null,On=()=>d("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M0 26C0 11.6406 11.6406 0 26 0C40.3594 0 52 11.6406 52 26C52 40.3594 40.3594 52 26 52C11.6406 52 0 40.3594 0 26Z",fill:"#131313",fillOpacity:"0.3"}),d("path",{d:"M15 21.375C15 19.7181 16.3431 18.375 18 18.375H20.3222C21.1014 18.375 21.8096 17.9225 22.137 17.2155L22.163 17.1595C22.4904 16.4525 23.1986 16 23.9778 16H28.0222C28.8014 16 29.5096 16.4525 29.837 17.1595L29.863 17.2155C30.1904 17.9225 30.8986 18.375 31.6778 18.375H34C35.6569 18.375 37 19.7181 37 21.375V33C37 34.6569 35.6569 36 34 36H18C16.3431 36 15 34.6569 15 33V21.375Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M31.25 27C31.25 24.1005 28.8995 21.75 26 21.75C24.4024 21.75 22.9715 22.4636 22.0086 23.5894M20.75 27C20.75 29.8995 23.1005 32.25 26 32.25C27.5958 32.25 29.0253 31.538 29.9881 30.4144",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),d("path",{d:"M30.0835 26.4167L31.2502 28.1667L32.4168 26.4167",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M19.5835 27.5833L20.7502 25.8333L21.9168 27.5833",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Pn=()=>d("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M0 26C0 11.6406 11.6406 0 26 0C40.3594 0 52 11.6406 52 26C52 40.3594 40.3594 52 26 52C11.6406 52 0 40.3594 0 26Z",fill:"#131313",fillOpacity:"0.3"}),d("circle",{cx:"17.5",cy:"24.5",r:"1.5",fill:"white"}),d("path",{d:"M15 17H16C19.5 17 23 21 23 29C22.5 29 21.5 29 20 29C20 29 20.25 33 19.5 34.5C18.75 36 16 36 16 36H15",stroke:"white",strokeWidth:"2"}),d("circle",{r:"1.5",transform:"matrix(-1 0 0 1 34.5 24.5)",fill:"white"}),d("path",{d:"M37 17H36C32.5 17 29 21 29 29C29.5 29 30.5 29 32 29C32 29 31.75 33 32.5 34.5C33.25 36 36 36 36 36H37",stroke:"white",strokeWidth:"2"}));function Mn(e){return Dn(e,.85)}function Dn(e,t){const n=t*Math.min(e.width,e.height),r=(e.width-n)/2,i=(e.height-n)/2;return{shiftX:r/e.width,shiftY:i/e.height,width:n/e.width,height:n/e.height}}function Fn(e,t){const n=Mn(e);return{x:t.x+n.shiftX*e.width,y:t.y+n.shiftY*e.height}}function Nn(e,t){const n=Math.min(e.width,e.height);let r,i,o,a;return e.width>e.height?(r=(e.width-n*t.faceCenteringWideSide)/2,i=(e.height-n*t.faceCenteringNarrowSide)/2,o=n*t.faceCenteringWideSide,a=n*t.faceCenteringNarrowSide):(r=(e.width-n*t.faceCenteringNarrowSide)/2,i=(e.height-n*t.faceCenteringWideSide)/2,o=n*t.faceCenteringNarrowSide,a=n*t.faceCenteringWideSide),{shiftX:r,shiftY:i,width:o,height:a}}var jn=n(994),Wn=n.n(jn);class Ln extends Error{constructor(e,t){super(e),this.name="AutoCaptureError",this.cause=t}static fromCameraError(e){if(e instanceof Ln)return e;let t;switch(e.name){case"OverconstrainedError":t="Minimum quality requirements are not met by your camera";break;case"NotReadableError":case"AbortError":t="The webcam is already in use by another application";break;case"NotAllowedError":t="To use your camera, you must allow permissions";break;case"NotFoundError":t="There is no camera available to you";break;default:t="An unknown camera error has occurred"}return new Ln(t,e)}}const Hn=new class{getOverriddenModules(e){return{locateFile:t=>e||t}}async initSamModule(e){this.samWasmModule||(this.samWasmModule=await Wn()(this.getOverriddenModules(e)))}parseRawFaceData(e){const{brightness:t,hotspots:n,sharpness:r}=e.params;return{confidence:e.probability/1e3,topLeft:{x:e.topLeftX,y:e.topLeftY},bottomRight:{x:e.bottomRightX,y:e.bottomRightY},faceCenter:{x:(e.topLeftX+e.bottomRightX)/2,y:(e.topLeftY+e.bottomRightY)/2},faceSize:Math.abs(e.bottomRightX-e.topLeftX),brightness:t,hotspots:n,sharpness:r}}async detectFace(e){if(null==this.samWasmModule)throw new Ln("SAM WASM module is not initialized");const t=function(e){const t=e.getContext("2d");if(!t)throw new Error("getImageDataForSam ctx error");return t.getImageData(0,0,e.width,e.height).data}(e),n=this.samWasmModule.detectFaceWithImageParameters(e.width,e.height,t,0,0);return this.parseRawFaceData(n)}},$n=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),Un=e=>{if(e.length<1)return 0;return e.reduce(((e,t)=>e+t),0)/e.length};function Bn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yn=class{constructor(e){Bn(this,"isDetectorInitialized",!1),Bn(this,"isInCandidateSelection",!1),Bn(this,"lastImage",null),Bn(this,"bestImage",null),Bn(this,"record",[]),Bn(this,"isNewImageBetter",((e,t,n)=>{const r=Math.min(n.width,n.height),i={x:n.width/2,y:n.height/2},o=(this.thresholds.minFaceSizeRatio+this.thresholds.maxFaceSizeRatio)/2*r,a=Math.abs(t.faceSize-o)({isPresent:((e,t)=>!(t.confidencethis.thresholds.minFaceSizeRatio,isNotLarge:e.faceSize{const r=Nn(n,e);return i=t.faceCenter,o=r,!(i.xo.shiftX+o.width||i.yo.shiftY+o.height);var i,o})(this.thresholds,e,t),isSharp:e.sharpness>this.thresholds.sharpnessThreshold,isNotDim:e.brightness>this.thresholds.brightnessLowThreshold,isNotBright:e.brightness{var n;return this.isInCandidateSelection||null!==(n=this.lastImage)&&void 0!==n&&n.isValid&&t?"candidate_selection":this.lastImage&&t?this.lastImage.instructionCode:e.isPresent?e.isCentered?e.isNotSmall?e.isNotLarge?e.isNotDim?e.hasHighHotspots?e.hasMediumHotspots?e.isNotBright?e.isSharp?"face_not_present":"sharpness_too_low":"brightness_too_high":"hotspots_medium_present":"hotspots_high_present":"brightness_too_low":"face_too_close":"face_too_far":"face_centering":"face_not_present"})),Bn(this,"modifyDetectedFace",((e,t)=>{const n=Math.min(t.width,t.height),r=e.faceSize/n;return{...e,faceSize:r}})),this.thresholds=e}async initFaceDetector(e){await Hn.initSamModule(e),this.isDetectorInitialized=!0}getBestImage(){return this.bestImage}getRecord(){return this.record}restart(){this.isInCandidateSelection=!1,this.lastImage=null,this.bestImage=null}checkIfDetectedFaceIsValid(e){return Object.values(e).every((e=>!0===e))}async processImage(e){const t={width:e.width,height:e.height},n=function(e,t){const n=document.createElement("canvas");n.width=t.width*e.width,n.height=t.height*e.height;const r=n.getContext("2d");if(!r)throw new Error("cropImage ctx error");return r.drawImage(e,t.shiftX*e.width,t.shiftY*e.height,t.width*e.width,t.height*e.height,0,0,n.width,n.height),n}(e,Mn(t));let r=await Hn.detectFace(n);r=function(e,t){return{...t,topLeft:Fn(e,t.topLeft),bottomRight:Fn(e,t.bottomRight),faceCenter:Fn(e,t.faceCenter)}}(t,r),r=this.modifyDetectedFace(r,t);const i=this.validateDetectedFace(r,t),o=this.checkIfDetectedFaceIsValid(i),a=this.getInstructionCode(i,o);var s;this.isInCandidateSelection?this.bestImage&&o&&this.isNewImageBetter(this.bestImage.detection,r,t)&&(this.bestImage={image:e,detection:kn(r)}):null!==(s=this.lastImage)&&void 0!==s&&s.isValid&&o?(this.bestImage={image:e,detection:kn(r)},this.isInCandidateSelection=!0):this.lastImage=o?{instructionCode:a,isValid:!0}:{instructionCode:a,isValid:!1};const l={detectedFace:kn(r),instructionCode:a,isInCandidateSelection:this.isInCandidateSelection};return this.record.push(l.detectedFace),l}};let Gn;function Vn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e[e.LOADING=0]="LOADING",e[e.ERROR=1]="ERROR",e[e.WAITING=2]="WAITING",e[e.RUNNING=3]="RUNNING"}(Gn||(Gn={}));const qn={width:1920,height:1080,facingMode:"user"};class Zn{constructor(e){Vn(this,"mediaStream",null),Vn(this,"videoTrack",null),this.videoRef=e}static async getDeviceList(){let e=await navigator.mediaDevices.enumerateDevices();return e=e.filter((e=>"videoinput"===e.kind)),e}async initWebcam(e={}){const t=await this.getBestCamera(e.facingMode),n=this.getConstraints(e,t);await this.startWebcam(n),function(){const e=navigator.userAgent.includes("Chrome"),t=new RegExp(/Version\/15.* Safari/).test(navigator.userAgent);return(!e||!t)&&t}()&&await this.startWebcam(n)}async startWebcam(e={}){var t;return this.stopCamera(),this.mediaStream=await navigator.mediaDevices.getUserMedia(e),this.videoRef.srcObject=this.mediaStream,await this.videoRef.play(),this.videoTrack=null===(t=this.mediaStream)||void 0===t?void 0:t.getVideoTracks()[0],this.checkVideoTrackSettings(),this.videoTrack}checkVideoTrackSettings(){var e;const t=null===(e=this.videoTrack)||void 0===e?void 0:e.getSettings();if(null==t||!t.height||null==t||!t.width)throw new Ln("Could not init camera settings");if(t.width<1e3||t.height<1e3/1.5)throw this.stopCamera(),new Ln(`Could not init video because of low camera resolution: ${t.width}x${t.height}.`)}async getBestCamera(e){if(/iPhone|iPad|iPod|Android|Mobi|BlackBerry|Silk|Windows Phone/i.test(navigator.userAgent)&&"environment"===e){this.mediaStream=await navigator.mediaDevices.getUserMedia({video:!0}),this.stopCamera();return(await Zn.getDeviceList()).find((e=>e.label.includes("back")&&e.label.includes("0")))}}getConstraints(e,t){return{video:{...qn,...e,deviceId:t?{exact:t.deviceId}:void 0},audio:!1}}takePhoto(){var e;const t=null===(e=this.videoTrack)||void 0===e?void 0:e.getSettings();if(null==t||!t.width)throw new Ln("Cant take photo - video width is undefined");if(null==t||!t.height)throw new Ln("Cant take photo - video height is undefined");const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const r=n.getContext("2d");if(!r)throw new Ln("Cant take photo - cant create context");return r.drawImage(this.videoRef,0,0),n}getCameraResolution(){var e;const t=null===(e=this.videoTrack)||void 0===e?void 0:e.getSettings();if(null==t||!t.width)throw new Ln("Video width is undefined");if(null==t||!t.height)throw new Ln("Video height is undefined");return{width:t.width,height:t.height}}getCameraSettings(){if(!this.videoTrack)throw Error("Video track must be initialized to get settings");return this.videoTrack.getSettings()}async getDeviceName(){if(!this.videoTrack)throw Error("Video track must be initialized to get device name");const e=this.videoTrack.getSettings(),t=(await navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===e.deviceId));return null==t?void 0:t.label}async applyNewConstraints(e){if(!this.videoTrack)throw Error("Video track must be initialized to set new constraints");await this.videoTrack.applyConstraints(e)}async switchCamera(){var e;if(!this.videoTrack)throw Error("Video track must be initialized to set new constraints");const t=this.videoTrack.getConstraints(),n=this.videoTrack.getSettings();let r=await navigator.mediaDevices.enumerateDevices();if(r=r.filter((e=>"videoinput"===e.kind)),r.length<=1)return;const i=r.findIndex((e=>e.deviceId===n.deviceId)),o=null!==(e=r[i+1])&&void 0!==e?e:r[0],a=this.getConstraints(t,o);await this.startWebcam(a)}stopCamera(){if(!this.mediaStream)return;this.mediaStream.getTracks().forEach((e=>{e.stop()})),this.videoRef.srcObject=null}checkIfStreamIsRunning(){return!!this.videoRef.srcObject}}const Xn=j(null),Jn=()=>{const e=ue(Xn);if(!e)throw new Error("Missing provider for CameraOptionsContext");return e},Kn=({children:e,cameraOptions:t})=>{const[n,r]=ie(null);return ae((()=>{var e,n,i,o,a,s,l,c,u,f,h,d,p,m,g,v,y,_,b,w,C,S,k,x,A,z,I,E,T;const{imageType:R,cameraFacing:O,photoTakenCb:P,onError:M,thresholds:D,uiCustomisation:F,samWasmUrl:N}=t,j=null==F?void 0:F.placeholder,W=null==F?void 0:F.instructions,L=null==F?void 0:F.appStateInstructions,H=null==F?void 0:F.colors,$={imageType:null!=R?R:"png",cameraFacing:null!=O?O:"user",photoTakenCb:P,onError:M,samWasmUrl:N,thresholds:{faceConfidence:null!==(e=null==D?void 0:D.faceConfidence)&&void 0!==e?e:.12,minFaceSizeRatio:null!==(n=null==D?void 0:D.minFaceSizeRatio)&&void 0!==n?n:.35,maxFaceSizeRatio:null!==(i=null==D?void 0:D.maxFaceSizeRatio)&&void 0!==i?i:.44,faceCenteringWideSide:null!==(o=null==D?void 0:D.faceCenteringWideSide)&&void 0!==o?o:.21,faceCenteringNarrowSide:null!==(a=null==D?void 0:D.faceCenteringNarrowSide)&&void 0!==a?a:.07,sharpnessThreshold:null!==(s=null==D?void 0:D.sharpnessThreshold)&&void 0!==s?s:400,brightnessLowThreshold:null!==(l=null==D?void 0:D.brightnessLowThreshold)&&void 0!==l?l:400,brightnessHighThreshold:null!==(c=null==D?void 0:D.brightnessHighThreshold)&&void 0!==c?c:900,hotspotsMediumThreshold:null!==(u=null==D?void 0:D.hotspotsMediumThreshold)&&void 0!==u?u:100,hotspotsHighThreshold:null!==(f=null==D?void 0:D.hotspotsHighThreshold)&&void 0!==f?f:800},uiCustomisation:{placeholder:{facePlaceholder:null!==(h=null==j?void 0:j.facePlaceholder)&&void 0!==h?h:"circle-solid",customSVG:null==j?void 0:j.customSVG},instructions:{candidate_selection:null!==(d=null==W?void 0:W.candidate_selection)&&void 0!==d?d:"Stay still…",face_too_close:null!==(p=null==W?void 0:W.face_too_close)&&void 0!==p?p:"Move back",face_too_far:null!==(m=null==W?void 0:W.face_too_far)&&void 0!==m?m:"Move closer",face_centering:null!==(g=null==W?void 0:W.face_centering)&&void 0!==g?g:"Center your face",face_not_present:null!==(v=null==W?void 0:W.face_not_present)&&void 0!==v?v:"Center your face",sharpness_too_low:null!==(y=null==W?void 0:W.sharpness_too_low)&&void 0!==y?y:"Turn face against light",brightness_too_low:null!==(_=null==W?void 0:W.brightness_too_low)&&void 0!==_?_:"Turn face against light",brightness_too_high:null!==(b=null==W?void 0:W.brightness_too_high)&&void 0!==b?b:"Less light needed",hotspots_medium_present:null!==(w=null==W?void 0:W.hotspots_medium_present)&&void 0!==w?w:"Turn face against light",hotspots_high_present:null!==(C=null==W?void 0:W.hotspots_high_present)&&void 0!==C?C:"Move away from bright light"},appStateInstructions:{loading:{text:null!==(S=null==L||null===(k=L.loading)||void 0===k?void 0:k.text)&&void 0!==S?S:"Loading. Please wait.",visible:null===(x=null==L||null===(A=L.loading)||void 0===A?void 0:A.visible)||void 0===x||x},waiting:{text:null!==(z=null==L||null===(I=L.waiting)||void 0===I?void 0:I.text)&&void 0!==z?z:"Waiting for input",visible:null===(E=null==L||null===(T=L.waiting)||void 0===T?void 0:T.visible)||void 0===E||E}},colors:H}};r($)}),[t]),n?d(Xn.Provider,{value:{faceCameraOptions:n}},e):null},Qn=bn.div`
+ background-color: #00000060;
+ color: #fff;
+ font-size: 13px;
+ width: 300px;
+ padding: 10px;
+ z-index: 1;
+ position: absolute;
+ top: 0;
+ word-break: break-word;
+`,er=bn.canvas`
+ transform: ${e=>e.isImageMirror?"rotateY(180deg)":"none"};
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+`,tr=({detectionDetails:e,isImageMirror:t,cameraResolution:n})=>{const r=le(null),{faceCameraOptions:{thresholds:i}}=Jn();return ae((()=>{if(!r.current)return;r.current.width=n.width,r.current.height=n.height;const t=Nn(n,i);((e,t)=>{const n=e.getContext("2d");if(!n)return;const{topLeft:r,bottomRight:i,faceCenter:o}=t.face;n.clearRect(0,0,n.canvas.width,n.canvas.height),n.fillStyle="rgba(255, 0, 0, 0.3)",n.fillRect(r.x,r.y,i.x-r.x,i.y-r.y),n.fillStyle="green",n.fillRect(o.x,o.y,5,5),n.beginPath(),n.strokeStyle="green",n.stroke()})(r.current,e),((e,t,n)=>{const r=e.getContext("2d");if(!r)return;const{shiftX:i,shiftY:o,width:a,height:s}=t;r.beginPath(),r.strokeStyle=n,r.moveTo(i,o),r.lineTo(i+a,o),r.lineTo(i+a,o+s),r.lineTo(i,o+s),r.closePath(),r.stroke()})(r.current,t,"green")}),[e,i]),d(m,null,d(er,{ref:r,isImageMirror:t}),d(Qn,null,e&&d(m,null,d("div",null,"Confidence: ",d("strong",null,e.face.confidence)),d("div",null,"Face center: ",d("strong",null,JSON.stringify(e.face.faceCenter))),d("div",null,"Face size: ",d("strong",null,e.face.faceSize)),d("div",null,"Brightness: ",d("strong",null,e.face.brightness)),d("div",null,"Hotspots: ",d("strong",null,e.face.hotspots)),d("div",null,"Sharpness: ",d("strong",null,e.face.sharpness)),d("div",null,"Detection time: ",d("strong",null,e.detectionTime)),d("div",null,"FPS: ",d("strong",null,e.fps)),d("div",null,"Instruction: ",d("strong",null,e.instructionCode)),d("div",null,"Resolution: ",d("strong",null,JSON.stringify(e.resolution))))))},nr=bn.div`
+ position: relative;
+`,rr=bn.div`
+ position: relative;
+`,ir=bn.video`
+ transform: ${e=>e.isImageMirror?"rotateY(180deg)":"none"};
+ display: block;
+ width: 100%;
+`,or=bn.div`
+ position: absolute;
+ top: ${e=>100*e.placeholderRect.shiftY}%;
+ bottom: ${e=>100*(1-e.placeholderRect.shiftY-e.placeholderRect.height)}%;
+ left: ${e=>100*e.placeholderRect.shiftX}%;
+ right: ${e=>100*(1-e.placeholderRect.shiftX-e.placeholderRect.width)}%;
+ color: ${e=>e.isInCandidateSelection?`${e.theme.colors.placeholderColorSuccess}`:`${e.theme.colors.placeholderColor}`};
+
+ svg {
+ width: 100%;
+ height: 100%;
+ }
+`,ar=bn.div`
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 24px;
+ z-index: 2;
+`,sr=bn.button`
+ background: none;
+ border: none;
+ padding: 0;
+ cursor: pointer;
+ margin-right: ${e=>e.marginRight?"24px":"0"};
+
+ &:disabled {
+ cursor: not-allowed;
+ }
+`,lr=bn.div`
+ position: absolute;
+ ${e=>e.cssTop?`top: ${e.cssTop}%;`:""}
+ ${e=>e.cssBottom?`bottom: ${e.cssBottom}%;`:""}
+ left: 50%;
+ transform: translateX(-50%)
+ translateY(
+ ${e=>e.cssTop||e.isPortrait?"-50%":e.isPortrait?"":"50%"}
+ );
+ z-index: 2;
+`;function cr(e){const[t,n]=ie(14);return ae((()=>{function t(){var t;const r=null===(t=e.current)||void 0===t?void 0:t.getBoundingClientRect(),i=null==(o=r)?14:o.width{window.removeEventListener("resize",t)}}),[e]),t}const ur=()=>d("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M1 52C1 23.8335 23.8335 1 52 1C80.1665 1 103 23.8335 103 52C103 80.1665 80.1665 103 52 103C23.8335 103 1 80.1665 1 52Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),fr=()=>d("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M52 103C28.4018 103 9 80.3296 9 52C9 23.6704 28.4018 1 52 1C75.5982 1 95 23.6704 95 52C95 80.3296 75.5982 103 52 103Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),hr=()=>d("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.8695 2C64.5766 2 72.0162 5.51372 75.8892 11.5634C79.8128 17.6922 80.2877 26.7236 78.2847 38.2537L78.1574 38.9866L78.8227 39.3193C79.4548 39.6354 79.9815 39.9396 80.3733 40.6279C80.7817 41.3454 81.1181 42.6226 80.9457 45.0366C80.6244 49.5349 79.3628 51.2414 78.3052 52.1008C77.8499 52.4707 77.4154 52.7045 76.9542 52.9528L76.9541 52.9528C76.8281 53.0207 76.7001 53.0896 76.5691 53.1626C76.0255 53.4658 75.2794 53.9173 74.9797 54.8162L74.9676 54.8526L74.9583 54.8899C73.5607 60.48 71.4743 62.9815 69.6217 65.2026C69.3409 65.5393 69.0655 65.8695 68.7987 66.203C67.7568 67.5053 66.8243 68.8874 66.3142 70.8584C65.8089 72.8106 65.7391 75.2547 66.2516 78.6713L66.2616 78.7381L66.2805 78.8029C68.7036 87.1107 74.8884 91.2894 81.5556 94.0919C82.0648 94.3059 82.651 94.0666 82.865 93.5575C83.079 93.0484 82.8398 92.4621 82.3306 92.2481C75.919 89.5531 70.4093 85.7288 68.2194 78.3074C67.7408 75.0786 67.8396 72.9468 68.2504 71.3596C68.6591 69.7802 69.3974 68.6562 70.3604 67.4524C70.6136 67.136 70.8804 66.8164 71.1569 66.4853C73.041 64.229 75.3749 61.4341 76.8862 55.4241C76.928 55.3236 77.0427 55.1885 77.5432 54.9093C77.6306 54.8606 77.7286 54.8082 77.835 54.7512L77.8351 54.7512C78.3082 54.4979 78.9484 54.1551 79.5664 53.653C81.1819 52.3404 82.5936 50.0371 82.9406 45.1791C83.127 42.5695 82.7951 40.8394 82.1114 39.6384C81.6107 38.7589 80.9623 38.2396 80.3759 37.8863C82.2608 26.5638 81.8327 17.1379 77.5735 10.485C73.175 3.6144 64.9019 0 51.8695 0C38.837 0 30.564 3.6144 26.1654 10.485C21.9062 17.1379 21.4781 26.5638 23.363 37.8863C22.7766 38.2396 22.1283 38.7589 21.6276 39.6384C20.9439 40.8394 20.612 42.5695 20.7984 45.1791C21.1454 50.0371 22.557 52.3404 24.1726 53.653C24.7905 54.1551 25.4308 54.4979 25.9039 54.7512L25.904 54.7512C26.0104 54.8082 26.1084 54.8606 26.1957 54.9093C26.6963 55.1885 26.8109 55.3236 26.8527 55.4241C28.3641 61.4341 30.6979 64.229 32.582 66.4853C32.8586 66.8164 33.1254 67.136 33.3785 67.4524C34.3416 68.6562 35.0798 69.7802 35.4886 71.3596C35.8994 72.9468 35.9981 75.0786 35.5195 78.3074C33.3297 85.7288 27.8199 89.5531 21.4083 92.2481C20.8992 92.4621 20.6599 93.0484 20.8739 93.5575C21.0879 94.0666 21.6742 94.3059 22.1833 94.0919C28.8505 91.2894 35.0354 87.1107 37.4585 78.8029L37.4774 78.7381L37.4874 78.6713C37.9999 75.2547 37.93 72.8106 37.4248 70.8584C36.9146 68.8874 35.9821 67.5053 34.9403 66.203C34.6734 65.8695 34.398 65.5393 34.1173 65.2026C32.2647 62.9815 30.1782 60.48 28.7807 54.8899L28.7714 54.8526L28.7592 54.8162C28.4596 53.9173 27.7135 53.4658 27.1698 53.1626C27.0389 53.0896 26.9109 53.0207 26.7849 52.9529L26.7848 52.9528L26.7848 52.9528C26.3235 52.7045 25.889 52.4707 25.4338 52.1008C24.3761 51.2414 23.1146 49.5349 22.7933 45.0366C22.6208 42.6226 22.9572 41.3454 23.3657 40.6279C23.7575 39.9396 24.2841 39.6354 24.9162 39.3193L25.5816 38.9866L25.4543 38.2537C23.4513 26.7236 23.9261 17.6922 27.8498 11.5634C31.7228 5.51372 39.1623 2 51.8695 2Z",fill:"currentColor"})),dr=()=>d("svg",{xmlns:"http://www.w3.org/2000/svg",width:"104",height:"104",fill:"none"},d("mask",{id:"A",fill:"#fff"},d("path",{fillRule:"evenodd",d:"M51.725.109l-.073-.003c-12.128 0-20.303 5.008-25.105 11.886-4.773 6.836-6.161 15.443-4.915 22.619.549 3.16 1.075 9.238.015 13.475-1.024 4.096-2.538 7.739-3.744 10.635l-.021.049h0c-.588 1.412-1.115 2.678-1.455 3.706-.172.522-.308 1.017-.377 1.465-.064.418-.086.889.049 1.328.424 1.674 1.16 2.953 2.165 3.887s2.224 1.471 3.508 1.754c2.515.553 5.474.173 8.053-.166l.191-.025h0c1.251-.165 2.417-.318 3.475-.378 1.12-.064 2.023-.015 2.704.189.645.193 1.043.508 1.281.992.256.521.393 1.376.192 2.774-1.492 5.052-4.51 7.959-8.221 9.907-3.198 1.679-6.864 2.629-10.565 3.587h0l-2.079.544a1 1 0 1 0 .516 1.932l2.011-.525c3.696-.955 7.626-1.971 11.047-3.768 4.121-2.163 7.568-5.482 9.231-11.183l.019-.065.01-.067c.245-1.631.149-2.972-.364-4.018-.535-1.091-1.45-1.712-2.502-2.027-1.017-.305-2.197-.338-3.391-.27-1.135.064-2.37.227-3.596.388h0l-.218.029c-2.664.35-5.255.659-7.363.195-1.027-.226-1.89-.627-2.576-1.265s-1.25-1.561-1.595-2.94l-.009-.037-.012-.036s-.009-.03-.011-.105a1.93 1.93 0 0 1 .027-.329c.045-.291.143-.668.3-1.143.314-.952.814-2.154 1.422-3.614l.001-.002h0c1.203-2.888 2.773-6.658 3.837-10.916 1.163-4.652.577-11.066.015-14.303-1.166-6.713.145-14.773 4.584-21.132 4.41-6.316 11.958-11.031 23.465-11.031a1.02 1.02 0 0 0 .073-.003c.024.002.048.003.073.003 11.507 0 19.056 4.715 23.465 11.031 4.439 6.358 5.75 14.419 4.584 21.132-.562 3.237-1.148 9.651.015 14.303 1.065 4.259 2.635 8.028 3.837 10.916v.002c.608 1.46 1.108 2.662 1.422 3.614.157.474.255.851.3 1.143a1.93 1.93 0 0 1 .027.329c-.002.072-.01.102-.011.105h0l-.012.036-.009.037c-.345 1.379-.913 2.305-1.595 2.94s-1.549 1.039-2.576 1.265c-2.108.464-4.699.155-7.363-.195l-.218-.029h0c-1.226-.162-2.461-.324-3.596-.388-1.194-.068-2.374-.034-3.391.27-1.053.315-1.967.936-2.502 2.027-.513 1.046-.609 2.387-.364 4.018l.01.067.019.065c1.663 5.701 5.11 9.02 9.231 11.183 3.422 1.796 7.351 2.812 11.047 3.768h.001l2.01.525a1 1 0 1 0 .516-1.932l-2.079-.544h0c-3.701-.959-7.367-1.909-10.565-3.587-3.711-1.948-6.729-4.855-8.221-9.907-.202-1.398-.064-2.253.192-2.774.238-.484.636-.799 1.281-.992.681-.204 1.584-.253 2.704-.189 1.058.06 2.224.213 3.475.378h0l.191.025c2.579.339 5.538.719 8.053.166 1.285-.283 2.501-.817 3.508-1.754s1.742-2.214 2.165-3.887c.136-.44.114-.911.049-1.328-.069-.448-.205-.943-.377-1.465-.34-1.028-.867-2.294-1.455-3.706l-.021-.049c-1.206-2.896-2.72-6.538-3.744-10.635-1.059-4.237-.534-10.316.015-13.475 1.247-7.176-.142-15.783-4.915-22.619C72.101 5.114 63.926.106 51.798.106c-.024 0-.049.001-.073.003z"})),d("g",{fill:"currentColor"},d("path",{fillRule:"evenodd",d:"M51.725.109l-.073-.003c-12.128 0-20.303 5.008-25.105 11.886-4.773 6.836-6.161 15.443-4.915 22.619.549 3.16 1.075 9.238.015 13.475-1.024 4.096-2.538 7.739-3.744 10.635l-.021.049h0c-.588 1.412-1.115 2.678-1.455 3.706-.172.522-.308 1.017-.377 1.465-.064.418-.086.889.049 1.328.424 1.674 1.16 2.953 2.165 3.887s2.224 1.471 3.508 1.754c2.515.553 5.474.173 8.053-.166l.191-.025h0c1.251-.165 2.417-.318 3.475-.378 1.12-.064 2.023-.015 2.704.189.645.193 1.043.508 1.281.992.256.521.393 1.376.192 2.774-1.492 5.052-4.51 7.959-8.221 9.907-3.198 1.679-6.864 2.629-10.565 3.587h0l-2.079.544a1 1 0 1 0 .516 1.932l2.011-.525c3.696-.955 7.626-1.971 11.047-3.768 4.121-2.163 7.568-5.482 9.231-11.183l.019-.065.01-.067c.245-1.631.149-2.972-.364-4.018-.535-1.091-1.45-1.712-2.502-2.027-1.017-.305-2.197-.338-3.391-.27-1.135.064-2.37.227-3.596.388h0l-.218.029c-2.664.35-5.255.659-7.363.195-1.027-.226-1.89-.627-2.576-1.265s-1.25-1.561-1.595-2.94l-.009-.037-.012-.036s-.009-.03-.011-.105a1.93 1.93 0 0 1 .027-.329c.045-.291.143-.668.3-1.143.314-.952.814-2.154 1.422-3.614l.001-.002h0c1.203-2.888 2.773-6.658 3.837-10.916 1.163-4.652.577-11.066.015-14.303-1.166-6.713.145-14.773 4.584-21.132 4.41-6.316 11.958-11.031 23.465-11.031a1.02 1.02 0 0 0 .073-.003c.024.002.048.003.073.003 11.507 0 19.056 4.715 23.465 11.031 4.439 6.358 5.75 14.419 4.584 21.132-.562 3.237-1.148 9.651.015 14.303 1.065 4.259 2.635 8.028 3.837 10.916v.002c.608 1.46 1.108 2.662 1.422 3.614.157.474.255.851.3 1.143a1.93 1.93 0 0 1 .027.329c-.002.072-.01.102-.011.105h0l-.012.036-.009.037c-.345 1.379-.913 2.305-1.595 2.94s-1.549 1.039-2.576 1.265c-2.108.464-4.699.155-7.363-.195l-.218-.029h0c-1.226-.162-2.461-.324-3.596-.388-1.194-.068-2.374-.034-3.391.27-1.053.315-1.967.936-2.502 2.027-.513 1.046-.609 2.387-.364 4.018l.01.067.019.065c1.663 5.701 5.11 9.02 9.231 11.183 3.422 1.796 7.351 2.812 11.047 3.768h.001l2.01.525a1 1 0 1 0 .516-1.932l-2.079-.544h0c-3.701-.959-7.367-1.909-10.565-3.587-3.711-1.948-6.729-4.855-8.221-9.907-.202-1.398-.064-2.253.192-2.774.238-.484.636-.799 1.281-.992.681-.204 1.584-.253 2.704-.189 1.058.06 2.224.213 3.475.378h0l.191.025c2.579.339 5.538.719 8.053.166 1.285-.283 2.501-.817 3.508-1.754s1.742-2.214 2.165-3.887c.136-.44.114-.911.049-1.328-.069-.448-.205-.943-.377-1.465-.34-1.028-.867-2.294-1.455-3.706l-.021-.049c-1.206-2.896-2.72-6.538-3.744-10.635-1.059-4.237-.534-10.316.015-13.475 1.247-7.176-.142-15.783-4.915-22.619C72.101 5.114 63.926.106 51.798.106c-.024 0-.049.001-.073.003z"}),d("path",{d:"M51.725.109l-.072.997.072.005.072-.005-.072-.997zM26.547 11.992l-.82-.572h0l.82.572zm-4.915 22.619l-.985.171h0l.985-.171zm.015 13.475l.97.242h0l-.97-.242zm-3.744 10.635l.923.385h0l-.923-.384zm-.021.049l-.923-.385-.005.012.928.372zm0 0l.923.384.005-.012-.928-.372zm-1.455 3.706l-.95-.313h0l.95.313zm-.377 1.465l.988.152h0l-.988-.152zm.049 1.328l.969-.245-.006-.025-.008-.025-.956.295zm2.165 3.887l.681-.732h0l-.681.732zm3.508 1.754l-.215.977h0l.215-.977zm8.053-.166l.13.992h0l-.13-.992zm.191-.025l-.119-.993-.012.002.13.992zm0 0l.119.993.012-.002-.131-.992zm3.475-.378l.057.998h0l-.057-.998zm2.704.189l.287-.958h0l-.287.958zm1.281.992l-.898.441h0l.898-.441zm.192 2.774l.959.283.02-.069.01-.071-.99-.143zm-8.221 9.907l-.465-.885h0l.465.885zm-10.565 3.587l-.251-.968-.068.018-.065.027.384.924zm0 0l.251.968.068-.018.065-.027-.384-.923zm-2.079.544l.258.966h0l-.258-.966zm-.708 1.224l.966-.258h0l-.966.258zm1.224.708l.258.966h0l-.258-.966zm2.011-.525l-.25-.968h0l.25.968zm11.047-3.768l-.465-.885h0l.465.885zm9.231-11.183l-.96-.28h0l.96.28zm.019-.065l.96.28.019-.065.01-.067-.989-.148zm.01-.067l-.989-.148h0l.989.148zm-.364-4.018l.898-.441h0l-.898.441zm-2.502-2.027l-.287.958h0l.287-.958zm-3.391-.27l-.057-.998h0l.057.998zm-3.596.388l-.131-.992-.038.005-.037.008.206.979zm0 0l.13.991.038-.005.038-.008-.206-.978zm-.218.029l.13.992h0l-.13-.991zm-7.363.195l-.215.977h0l.215-.977zm-2.576-1.265l-.681.732h0l.681-.732zm-1.604-2.977l.97-.243-.009-.037-.012-.036-.949.316zm-.012-.036l-.406-.914-.83.369.287.861.949-.316zM18 64.575l1-.022h0l-1 .022zm.027-.329l.988.152h0l-.988-.152zm.3-1.143l.95.314h0l-.95-.314zm1.422-3.614l.923.384v-.001l-.923-.384zm.001-.002l.923.384.003-.008.003-.008-.93-.368zm0 0l-.923-.384-.003.008-.003.008.93.368zm3.837-10.916l-.97-.243h0l.97.243zm.015-14.303l-.985.171h0l.985-.171zm4.584-21.132l.82.572h0l-.82-.572zM51.725 2.103l.072-.997-.072-.005-.072.005.072.997zm23.538 11.034l-.82.572h0l.82-.572zm4.584 21.132l.985.171h0l-.985-.171zm.015 14.303l.97-.243-.97.243zM83.7 59.488l.924-.382-.001-.003-.923.385zm.001.002l-.924.382.001.003.923-.384zm1.422 3.614l.95-.313h0l-.95.313zm.3 1.143l-.988.152h0l.988-.152zm.027.329l1 .022h0l-1-.022zm-.011.105l.962.275.004-.013-.965-.262zm0 0l.949.316.007-.021.006-.021-.962-.275zm-.012.036l-.949-.316-.012.036-.009.037.97.243zm-1.604 2.977l.681.732h0l-.681-.732zm-2.576 1.265l.215.977h0l-.215-.977zm-7.363-.195l-.13.991h0l.13-.992zm-.218-.029l-.179.984.024.004.024.003.13-.991zm0 0l.179-.984-.024-.004-.024-.003-.131.992zm-3.596-.388l.057-.998h0l-.057.998zm-3.391.27l.287.958h0l-.287-.958zm-2.502 2.027l-.898-.441h0l.898.441zm-.364 4.018l.989-.148h0l-.989.148zm.01.067l-.989.148.01.067.019.065.96-.28zm.019.065l.96-.28h0l-.96.28zm9.231 11.183l.465-.885h0l-.465.885zm11.047 3.768l-.25.968.008.002.243-.97zm.001 0l.25-.968-.008-.002-.242.97zm2.01.525l.258-.966h0l-.258.966zm1.224-.708l-.966-.258h0l.966.258zm-.708-1.224l.258-.966h0l-.258.966zm-2.079-.544l-.316.949.032.011.033.008.251-.968zm0 0l.316-.949-.032-.011-.033-.009-.251.968zm-10.565-3.587l.465-.885h0l-.465.885zm-8.221-9.907l-.99.143.01.071.02.069.959-.283zm.192-2.774l-.898-.441h0l.898.441zm1.281-.992l-.287-.958h0l.287.958zm2.704-.189l-.057.998h0l.057-.998zm3.475.378l-.13.992h.003l.128-.992zm0 0l.13-.992h-.002l-.128.992zm.191.025l-.13.992h0l.13-.992zm8.053.166l.215.977h0l-.215-.977zm3.508-1.754l-.681-.732h0l.681.732zm2.165-3.887l-.956-.295-.007.025-.006.025.969.245zm.049-1.328l-.988.152h0l.988-.152zm-.377-1.465l.95-.313h0l-.95.313zm-1.455-3.706l.923-.384h0l-.923.385zm-.021-.049l-.923.384h0l.923-.385zm-3.744-10.635l.97-.242h0l-.97.242zm.015-13.475l.985.171h0l-.985-.171zm-4.915-22.619l-.82.572h0l.82-.572zM51.797-.889l-.144-.005v2l.144-1.995zm-.144-.005c-12.438 0-20.927 5.154-25.925 12.314l1.64 1.145C31.973 5.967 39.835 1.106 51.652 1.106v-2zM25.727 11.42c-4.939 7.075-6.367 15.955-5.08 23.363l1.97-.342c-1.206-6.945.143-15.278 4.749-21.875l-1.64-1.145zm-5.08 23.363c.542 3.121 1.038 9.032.03 13.062l1.94.485c1.111-4.445.556-10.691 0-13.889l-1.97.342zm.03 13.062c-1.004 4.014-2.49 7.593-3.697 10.493l1.846.769c1.204-2.892 2.747-6.599 3.791-10.777l-1.94-.485zM16.98 58.337l-.021.049 1.846.769.02-.049-1.846-.769zm-.026.062h0l1.856.745h0l-1.856-.744zm.005-.012c-.583 1.4-1.127 2.705-1.481 3.777l1.899.627c.325-.984.835-2.21 1.428-3.635l-1.846-.769zm-1.481 3.777c-.18.545-.335 1.1-.416 1.626l1.977.305c.057-.369.174-.806.338-1.304l-1.899-.627zm-.416 1.626c-.074.479-.119 1.125.082 1.776l1.911-.59c-.071-.229-.071-.525-.016-.881l-1.977-.305zm.068 1.726c.463 1.828 1.285 3.288 2.454 4.374l1.362-1.465c-.841-.783-1.492-1.881-1.877-3.401l-1.939.491zm2.454 4.374c1.169 1.087 2.561 1.687 3.974 1.998l.43-1.953c-1.156-.254-2.196-.722-3.042-1.51l-1.362 1.465zm3.974 1.998c2.718.598 5.861.183 8.399-.151l-.261-1.983c-2.621.344-5.396.689-7.708.18l-.43 1.953zm8.399-.151l.191-.025-.261-1.983-.191.025.261 1.983zm.179-.024h0l-.237-1.986h0l.237 1.986zm.012-.001c1.261-.166 2.388-.314 3.401-.371l-.113-1.997c-1.102.063-2.307.222-3.549.385l.261 1.983zm3.401-.371c1.084-.061 1.847-.005 2.36.149l.574-1.916c-.849-.254-1.891-.295-3.047-.23l.113 1.997zm2.36.149c.439.131.581.292.67.475l1.796-.881c-.386-.786-1.041-1.255-1.892-1.51l-.574 1.916zm.67.475c.131.266.287.891.1 2.191l1.979.285c.216-1.496.097-2.582-.284-3.357l-1.796.881zm.13 2.05c-1.403 4.749-4.212 7.459-7.727 9.305l.93 1.771c3.907-2.051 7.134-5.154 8.716-10.509l-1.918-.567zm-7.727 9.305c-3.077 1.616-6.626 2.54-10.351 3.505l.502 1.936c3.678-.953 7.461-1.928 10.779-3.67l-.93-1.771zM18.5 86.87h0l.767 1.847h0L18.5 86.87zm.133-.045l-2.087.546.516 1.932 2.072-.542-.502-1.936zm-2.087.546a2 2 0 0 0-1.416 2.448l1.932-.516h0l-.516-1.932zm-1.416 2.448a2 2 0 0 0 2.448 1.416l-.516-1.932h0l-1.932.516zm2.448 1.416l2.003-.523-.5-1.936-2.019.527.516 1.932zm2.003-.523c3.674-.95 7.72-1.991 11.262-3.85l-.93-1.771c-3.301 1.733-7.115 2.724-10.833 3.685l.5 1.936zm11.262-3.85c4.317-2.267 7.974-5.783 9.726-11.789l-1.92-.56c-1.574 5.397-4.812 8.518-8.736 10.578l.93 1.771zm9.726-11.789l.019-.065-1.92-.56-.019.065 1.92.56zm.048-.197l.01-.067-1.978-.297-.01.067 1.978.297zm.01-.067c.259-1.728.184-3.303-.456-4.607l-1.795.881c.386.787.503 1.895.273 3.429l1.978.297zm-.456-4.607c-.684-1.395-1.857-2.168-3.113-2.544l-.574 1.916c.85.255 1.505.723 1.892 1.51l1.795-.881zm-3.113-2.544c-1.184-.355-2.503-.381-3.735-.311l.113 1.997c1.157-.066 2.198-.025 3.047.23l.574-1.916zm-3.735-.311c-1.179.067-2.452.235-3.67.395l.261 1.983c1.235-.163 2.431-.319 3.522-.381l-.113-1.997zm-3.745.408h0l.412 1.957h0l-.412-1.957zm.075-.013l-.218.029.261 1.983.218-.029-.261-1.983zm-.218.029c-2.708.356-5.114.629-7.018.21l-.43 1.953c2.312.509 5.088.164 7.708-.18l-.261-1.983zm-7.018.21c-.898-.198-1.585-.533-2.11-1.021l-1.362 1.464c.847.788 1.886 1.255 3.042 1.51l.43-1.953zm-2.11-1.021c-.518-.482-1-1.226-1.306-2.45l-1.94.485c.384 1.534 1.037 2.642 1.884 3.429l1.362-1.464zm-1.306-2.45l-.009-.037-1.94.485.009.037 1.94-.485zm-.031-.111l-.012-.036-1.897.632.012.036 1.897-.632zm-.555 1.194a1.82 1.82 0 0 0 .594-.923 1.81 1.81 0 0 0-.01-.135.99.99 0 0 0-.013-.07c-.004-.018-.008-.032-.008-.034.002.01.005.02.007.029a.73.73 0 0 1 .009.05c.004.027.004.042.004.043l-2 .044c.002.075.007.142.016.203.005.031.01.059.016.087.003.014.006.027.009.039 0 .001-.003-.013-.007-.031-.001-.005-.008-.034-.013-.07-.003-.023-.009-.091-.011-.135.006-.114.226-.643.594-.923l.812 1.828zM19 64.553a.69.69 0 0 1 .002-.04c.002-.026.006-.064.014-.114l-1.977-.305c-.029.185-.042.353-.039.503l2-.044zm.016-.155c.033-.213.112-.531.261-.981l-1.899-.627c-.164.498-.282.934-.338 1.304l1.977.305zm.261-.981c.3-.907.782-2.069 1.396-3.543l-1.846-.769c-.602 1.446-1.12 2.688-1.449 3.685l1.899.627zm1.396-3.543l.001-.002-1.847-.768-.001.002 1.847.768zm.007-.018h0l-1.86-.736h0l1.86.736zm-.007.016c1.201-2.884 2.799-6.718 3.884-11.058l-1.94-.485c-1.044 4.177-2.586 7.883-3.79 10.774l1.846.769zm3.884-11.058c1.215-4.859.599-11.441.03-14.716l-1.971.342c.556 3.198 1.111 9.445 0 13.889l1.94.485zm.03-14.716c-1.126-6.481.146-14.269 4.419-20.388l-1.64-1.145c-4.606 6.597-5.956 14.931-4.749 21.875l1.971-.342zm4.419-20.388C33.22 7.675 40.455 3.106 51.652 3.106v-2c-11.818 0-19.679 4.861-24.285 11.459l1.64 1.145zM51.652 3.106a2.01 2.01 0 0 0 .144-.005l-.143-1.995-.001 2zm.145-2l-.144 1.995c.048.003.096.005.144.005v-2zm24.285 11.459C71.477 5.967 63.615 1.106 51.798 1.106v2c11.197 0 18.432 4.568 22.645 10.603l1.64-1.145zm4.749 21.875c1.206-6.945-.143-15.278-4.749-21.875l-1.64 1.145c4.272 6.12 5.545 13.907 4.419 20.388l1.971.342zm0 13.889c-1.111-4.445-.555-10.691 0-13.889l-1.971-.342c-.569 3.275-1.184 9.858.03 14.716l1.94-.485zm3.79 10.774c-1.204-2.892-2.746-6.597-3.79-10.774l-1.94.485c1.085 4.34 2.683 8.174 3.884 11.058l1.846-.769zm.002.005l-.001-.002-1.849.764.001.002 1.849-.764zm1.448 3.682c-.329-.996-.847-2.239-1.449-3.685l-1.846.769c.614 1.474 1.096 2.635 1.396 3.543l1.899-.627zm.338 1.304c-.057-.369-.174-.806-.338-1.304l-1.899.627c.149.451.228.768.261.981l1.977-.305zm.039.503c.003-.151-.01-.319-.039-.503l-1.977.305c.008.05.012.088.014.114.001.013.002.023.002.03l2 .054zm-.045.344l.007-.027c.003-.012.006-.025.009-.038a1.34 1.34 0 0 0 .015-.084c.008-.059.014-.124.015-.196l-1.999-.044c0 0 0-.014.004-.039.002-.013.004-.028.008-.046.002-.009.004-.018.006-.028l.006-.022 1.93.524zm-.004.013h0l-1.923-.55h0l1.923.549zm-.025.078l.012-.036-1.897-.632-.012.036 1.897.632zm.012-.036l.009-.037-1.94-.485-.009.037 1.94.485zm-1.884 3.429c.847-.787 1.5-1.895 1.884-3.429l-1.94-.485c-.306 1.224-.788 1.968-1.306 2.45l1.362 1.464zm-3.042 1.51c1.156-.254 2.196-.722 3.042-1.51l-1.362-1.464c-.525.488-1.212.823-2.11 1.021l.43 1.953zm-7.708-.18c2.621.344 5.396.689 7.708.18l-.43-1.953c-1.904.419-4.31.146-7.018-.21l-.261 1.983zm-.218-.029l.218.029.261-1.983-.218-.029-.261 1.983zm-.049-.008h0l.358-1.968h0l-.358 1.968zm-3.474-.374c1.091.062 2.287.219 3.522.381l.261-1.983c-1.218-.16-2.491-.328-3.67-.395l-.113 1.997zm-3.047.23c.849-.254 1.891-.295 3.047-.23l.113-1.997c-1.231-.07-2.55-.044-3.735.311l.574 1.916zm-1.892 1.51c.386-.787 1.042-1.255 1.892-1.51l-.574-1.916c-1.256.376-2.429 1.15-3.113 2.544l1.795.881zm-.273 3.429c-.23-1.534-.113-2.642.273-3.429l-1.795-.881c-.64 1.304-.715 2.879-.456 4.607l1.978-.297zm.01.067l-.01-.067-1.978.297.01.067 1.978-.297zm-.01-.067l-.019-.065-1.92.56.019.065 1.92-.56zm8.736 10.578c-3.924-2.06-7.162-5.181-8.736-10.578l-1.92.56c1.752 6.006 5.409 9.522 9.726 11.789l.93-1.771zm10.833 3.685c-3.718-.961-7.531-1.952-10.833-3.685l-.93 1.771c3.542 1.86 7.588 2.901 11.262 3.85l.501-1.936zm-.007-.002h-.001l-.485 1.94h.001l.485-1.94zm2.026.529l-2.018-.527-.501 1.936 2.002.523.516-1.932zm0 0h0l-.516 1.932a2 2 0 0 0 2.448-1.416l-1.932-.516zm0 0h0l1.932.516a2 2 0 0 0-1.416-2.448l-.516 1.932zm-2.072-.542l2.072.542.516-1.932-2.087-.546-.501 1.936zm-.066-.019h0l.632-1.897h0l-.632 1.897zm-10.714-3.651c3.319 1.742 7.102 2.717 10.779 3.67l.502-1.936c-3.725-.965-7.274-1.889-10.351-3.505l-.93 1.771zm-8.716-10.509c1.582 5.355 4.809 8.458 8.716 10.509l.93-1.771c-3.515-1.846-6.324-4.556-7.727-9.305l-1.918.567zm.253-3.498c-.381.776-.499 1.861-.284 3.357l1.98-.285c-.187-1.3-.031-1.924.1-2.191l-1.796-.881zm1.892-1.51c-.851.255-1.506.724-1.892 1.51l1.796.881c.09-.183.231-.343.67-.475l-.574-1.916zm3.047-.23c-1.157-.066-2.198-.025-3.047.23l.574 1.916c.513-.154 1.277-.21 2.36-.149l.113-1.997zm3.549.385c-1.242-.163-2.447-.323-3.549-.385l-.113 1.997c1.014.057 2.14.205 3.401.371l.261-1.983zm-.002 0h0l-.256 1.983h0l.256-1.984zm.194.025l-.191-.025-.261 1.983.191.025.261-1.983zm7.708.18c-2.312.509-5.088.164-7.708-.18l-.261 1.983c2.537.334 5.68.749 8.399.151l-.43-1.953zm3.042-1.51c-.847.788-1.886 1.255-3.042 1.51l.43 1.953c1.413-.311 2.805-.911 3.975-1.998l-1.362-1.465zm1.877-3.401c-.385 1.519-1.035 2.618-1.877 3.401l1.362 1.465c1.168-1.087 1.991-2.546 2.454-4.374l-1.939-.491zm.03-.931c.055.356.054.653-.017.881l1.911.59c.201-.651.156-1.297.082-1.776l-1.977.305zm-.338-1.304c.164.498.282.934.338 1.304l1.977-.305c-.081-.526-.236-1.081-.416-1.626l-1.899.627zm-1.428-3.635c.594 1.425 1.103 2.651 1.428 3.635l1.899-.627c-.354-1.072-.898-2.377-1.481-3.777l-1.846.769zm-.02-.049l.02.049 1.846-.769-.021-.049-1.846.769zm-3.791-10.777c1.044 4.178 2.587 7.885 3.791 10.777l1.846-.769c-1.208-2.9-2.694-6.478-3.697-10.493l-1.94.485zm0-13.889c-.555 3.198-1.111 9.445 0 13.889l1.94-.485c-1.007-4.03-.512-9.94.03-13.062l-1.971-.342zm-4.749-21.875c4.606 6.597 5.956 14.931 4.749 21.875l1.971.342c1.287-7.408-.14-16.287-5.08-23.363l-1.64 1.145zM51.798 1.106c11.818 0 19.679 4.861 24.285 11.459l1.64-1.145C72.724 4.26 64.236-.894 51.798-.894v2zm-.001 0l.001-2a2.01 2.01 0 0 0-.144.005l.143 1.995z",mask:"url(#A)"}))),pr=()=>d("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"102",height:"102",rx:"3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeDasharray:"48 48"})),mr=()=>d("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"102",height:"102",rx:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),gr=()=>d("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"102",height:"102",rx:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeDasharray:"32 32"})),vr=()=>d("svg",{width:"104",height:"104",viewBox:"0 0 104 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"102",height:"102",rx:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),yr=()=>{const{faceCameraOptions:{uiCustomisation:e}}=Jn();switch(e.placeholder.facePlaceholder){case"circle-solid":return d(ur,null);case"ellipse-solid":return d(fr,null);case"man-solid":return d(hr,null);case"woman-solid":return d(dr,null);case"square-rounded-dash":return d(gr,null);case"square-rounded-solid":return d(vr,null);case"square-dash":return d(pr,null);case"square-solid":return d(mr,null);default:return d(ur,null)}},_r=j(void 0),br=({children:e,onError:t})=>{const[n,r]=ie(Gn.LOADING),[i,o]=ie(void 0),[a,s]=ie(!1),l={appState:n,setAppState:r,error:i,handleError:e=>{s(!1),t(e),r(Gn.ERROR),o(e)},isCameraReady:a,setIsCameraReady:s};return d(_r.Provider,{value:l},e)},wr=()=>{const e=ue(_r);if(void 0===e)throw new Error("useAppStateContext must be used within a AppStateProvider");return e};let Cr;!function(e){e.AUTO_CAPTURE="auto-capture"}(Cr||(Cr={}));const Sr={appKey:"",deviceId:"",async countlyFetch(e){if(!this.appKey||!this.deviceId)return;const t=xn({app_key:this.appKey,device_id:this.deviceId});await fetch(`https://innovatrics.count.ly/i?${t}&${e}`,{method:"GET",headers:{Accept:"application/json"}})},async init(e,t){if(!t)return;this.appKey=t,this.deviceId=e;const n={_app_version:wn},r={organization:(i=window.location.href,new URL(i).hostname.replace("www.",""))};var i;const o=xn({begin_session:"1",metrics:JSON.stringify(n),user_details:JSON.stringify(r)});await this.countlyFetch(o)},async endSession(){const e=xn({end_session:"1"});await this.countlyFetch(e)},async sendAutoCaptureEvent(e){const t=[{key:Cr.AUTO_CAPTURE,count:1,dur:e.captureTime,segmentation:e}],n=xn({events:JSON.stringify(t)});await this.countlyFetch(n)},async sendDocumentData({documentDetection:e,deviceName:t,...n}){if(e){const r={...n,hotspots:zn(e.hotspots),brightness:zn(e.brightness),confidence:zn(e.confidence),sharpness:zn(e.sharpness),smallestEdge:zn(e.smallestEdge),camera:t,imageResolution:`${n.imageResolution.width}x${n.imageResolution.height}`,averageFps:In(n.averageFps),captureTime:An(n.captureProcessDurationInMs)};this.sendAutoCaptureEvent(r)}},async sendFaceData({faceDetection:e,deviceName:t,...n}){if(e){const i={...n,faceSize:(r=e.faceSize,10*Math.round(r/10)/1e3),confidence:zn(e.confidence),camera:t,imageResolution:`${n.imageResolution.width}x${n.imageResolution.height}`,averageFps:In(n.averageFps),captureTime:An(n.captureProcessDurationInMs)};this.sendAutoCaptureEvent(i)}var r}},kr=()=>{const e=sessionStorage.getItem("dot-user-id");if(e)return e;{const e=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16);return sessionStorage.setItem("dot-user-id",e),e}},xr={init(e){const t=kr();Sr.init(t,e)},endSession(){Sr.endSession()},sendDocumentData(e){Sr.sendDocumentData(e)},sendFaceData(e){Sr.sendFaceData(e)}},Ar=({fontSize:e})=>{const{appState:t,setAppState:n,handleError:r,setIsCameraReady:i}=wr(),{faceCameraOptions:o}=Jn(),{cameraFacing:a,thresholds:s,samWasmUrl:l,imageType:c,photoTakenCb:u,uiCustomisation:f}=o,h=le(null),[p,m]=ie(null),[g,v]=ie(!1),[y,_]=ie(!1),[b,w]=ie(null),[C,S]=ie(void 0),[k,x]=ie(null),[A,z]=ie(null),[I,E]=ie(null),[T,R]=ie(null),[O,P]=ie(null),M=le(null),D=function(e){const[t,n]=ie(!1);return ae((()=>{(async()=>{(await Zn.getDeviceList()).length>1&&n(!0)})()}),[e]),t}(O);ae((()=>(window.addEventListener("beforeunload",xr.endSession),()=>{xr.endSession(),window.removeEventListener("beforeunload",xr.endSession)})),[]),ae((()=>((async()=>{if(null==h||!h.current)return void r(new Ln("Something went wrong during video initialization"));const e=new Zn(h.current);try{await e.initWebcam({facingMode:a})}catch(e){if(e instanceof Error)return void r(Ln.fromCameraError(e))}i(!0),E(e.getCameraResolution()),R(e.getCameraSettings()),P(e),M.current=e})(),function(){M.current&&M.current.stopCamera()})),[]),ae((()=>{(async()=>{const e=new Yn(s);try{await e.initFaceDetector(l)}catch(e){return void r(new Ln("Cannot init face detector"))}z(e)})()}),[s]),ae((()=>{null!=O&&O.videoTrack&&null!=A&&A.isDetectorInitialized&&n(Gn.RUNNING)}),[null==O?void 0:O.videoTrack,null==A?void 0:A.isDetectorInitialized]);const F=async(e,t,n)=>{const r={width:e.width,height:e.height},i=`image/${c}`,o=await En(e,i,90);u(o,{cameraSettings:{...null==O?void 0:O.getCameraSettings(),deviceName:await(null==O?void 0:O.getDeviceName())},detection:t,imageResolution:r,record:y?n:void 0})};ae((()=>{if(t!==Gn.RUNNING)return;if(!O||!A)throw new Ln("Cannot start detection");let e=0,i=!1,o=0;const a=[];return(async()=>{const t=Date.now();for(;O.checkIfStreamIsRunning()&&!i;){if(e&&performance.now()-e>1e3){const{image:e,detection:i}=A.getBestImage()||{},o=A.getRecord();if(e){const r=Date.now();xr.sendFaceData({faceDetection:i,imageResolution:{width:e.width,height:e.height},deviceName:await O.getDeviceName(),averageFps:Un(a),captureProcessDurationInMs:r-t}),F(e,i,o),n(Gn.WAITING),v(!1),A.restart()}else r(new Ln("Something went wrong during capturing an image"));return}const i=Date.now(),s=O.takePhoto(),l={width:s.width,height:s.height};let c;try{c=await A.processImage(s)}catch(e){return void(e instanceof Error&&r(Ln.fromCameraError(e)))}const u=Date.now()-i,h=Sn(1e3/u);a.push(h);const d={face:c.detectedFace,detectionTime:u,fps:h,resolution:l,instructionCode:c.instructionCode};x(d),y&&console.log(d),c.isInCandidateSelection&&0===e&&(e=performance.now(),v(!0),S(f.instructions[c.instructionCode]));const p=performance.now();p-o>600&&(S(f.instructions[c.instructionCode]),o=p),E(l),await Cn(Math.max(100-u,10))}})(),()=>{i=!0}}),[t,O,A,y,o]),ae((()=>{_(!!window.DOT_DEBUG_MODE)}),[window.DOT_DEBUG_MODE]),ae((()=>{I&&m(Dn(I,.75))}),[null==I?void 0:I.width,null==I?void 0:I.height]);const N=ce((()=>null==(null==T?void 0:T.facingMode)?null==b||b:null!=b?b:"user"===T.facingMode),[T,b]);const j=e=>{var r;"continue-detection"===(null===(r=e.detail)||void 0===r?void 0:r.instruction)&&t===Gn.WAITING&&n(Gn.RUNNING)};return ae((()=>(document.addEventListener("face-auto-capture",j),()=>{document.removeEventListener("face-auto-capture",j)})),[t]),d(rr,null,d(ir,{ref:h,autoPlay:!0,muted:!0,playsInline:!0,isImageMirror:N}),y&&k&&I&&t===Gn.RUNNING&&d(tr,{detectionDetails:k,isImageMirror:N,cameraResolution:I}),t===Gn.RUNNING&&d(ar,null,d(sr,{marginRight:D,onClick:function(){w(null==b?!N:!b)}},d(Pn,null)),D&&d(sr,{onClick:async function(){if(O){n(Gn.LOADING);try{await O.switchCamera()}catch(e){if(e instanceof Error)return void r(Ln.fromCameraError(e))}R(O.getCameraSettings()),w(null)}}},d(On,null))),p&&t===Gn.RUNNING&&d(or,{isInCandidateSelection:g,placeholderRect:p},d(yr,null)),p&&I&&t===Gn.RUNNING&&d(lr,{cssBottom:100*(p.height+p.shiftY),isPortrait:I.width=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,c=a):i>=3&&i<4?(l=a,c=o):i>=4&&i<5?(s=a,c=o):i>=5&&i<6&&(s=o,c=a);var u=n-o/2;return r(s+u,l+u,c+u)}var Nr={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var jr=/^#[a-fA-F0-9]{6}$/,Wr=/^#[a-fA-F0-9]{8}$/,Lr=/^#[a-fA-F0-9]{3}$/,Hr=/^#[a-fA-F0-9]{4}$/,$r=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,Ur=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,Br=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Yr=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function Gr(e){if("string"!=typeof e)throw new Pr(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return Nr[t]?"#"+Nr[t]:e}(e);if(t.match(jr))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(Wr)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(Lr))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(Hr)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=$r.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=Ur.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])};var a=Br.exec(t);if(a){var s="rgb("+Fr(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=$r.exec(s);if(!l)throw new Pr(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var c=Yr.exec(t.substring(0,50));if(c){var u="rgb("+Fr(parseInt(""+c[1],10),parseInt(""+c[2],10)/100,parseInt(""+c[3],10)/100)+")",f=$r.exec(u);if(!f)throw new Pr(4,t,u);return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10),alpha:parseFloat(""+c[4])}}throw new Pr(5)}function Vr(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=(o+a)/2;if(o===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var l=o-a,c=s>.5?l/(2-o-a):l/(o+a);switch(o){case n:t=(r-i)/l+(r=1?Kr(e,t,n):"rgba("+Fr(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?Kr(e.hue,e.saturation,e.lightness):"rgba("+Fr(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new Pr(2)}function ti(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return qr("#"+Zr(e)+Zr(t)+Zr(n));if("object"==typeof e&&void 0===t&&void 0===n)return qr("#"+Zr(e.red)+Zr(e.green)+Zr(e.blue));throw new Pr(6)}function ni(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var i=Gr(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?ti(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?ti(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Pr(7)}function ri(e){if("object"!=typeof e)throw new Pr(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return ni(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||"undefined"==typeof e.alpha)}(e))return ti(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return ei(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||"undefined"==typeof e.alpha)}(e))return Qr(e);throw new Pr(8)}function ii(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):ii(e,t,r)}}function oi(e){return ii(e,e.length,[])}function ai(e,t,n){return Math.max(e,Math.min(t,n))}function si(e,t){if("transparent"===t)return t;var n=Vr(t);return ri(zr({},n,{lightness:ai(0,1,n.lightness-parseFloat(e))}))}const li={primary:"#021B41",primaryHover:"#283D5D",primaryActive:"#415470",secondary:"#AACDEB",secondaryHover:"#C3DCF1",secondaryActive:"#D5E6F5",action:"#80DFD8",actionHover:"#6DBEB8",actionActive:"#60A7A2",error:"#FF0E00",warning:"#FFD616",success:"#11EE46",actionOnPrimary:"#214C67",primarySecondary:"#567496",white:"#FFF",white0:"#ffffff00",white15:"#ffffff26",white25:"#ffffff40",white30:"#ffffff4d",white50:"#ffffff80",placeholderColor:"white",placeholderColorSuccess:"#00BFB2",instructionColor:"#F8FBFB",instructionColorSuccess:"#00BFB2",instructionTextColor:"#021B41;"},ci={colors:li,colorStyles:{hover:{cyan:oi(si)(.1,li.secondary)}},lineHeights:{base:1.25},fontSizes:{base:16},textStyles:{s40heading:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"40px",lineHeight:"48px"},s26heading:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"26px",lineHeight:"30px"},s20heading:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"20px",lineHeight:"24px"},s20bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"16px",lineHeight:"24px","@media (min-height: 575px)":{fontSize:"20px",lineHeight:"30px"}},s20:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"16px",lineHeight:"24px","@media (min-height: 575px)":{fontSize:"20px",lineHeight:"30px"}},s18bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"18px",lineHeight:"27px"},s18:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"18px",lineHeight:"27px"},s16bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"14px",lineHeight:"20px","@media (min-height: 575px)":{fontSize:"16px",lineHeight:"24px"}},s16:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"14px",lineHeight:"20px","@media (min-height: 575px)":{fontSize:"16px",lineHeight:"24px"}},s14bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"14px",lineHeight:"21px"},s14:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"14px",lineHeight:"21px"},s12bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"12px",lineHeight:"18px"},s12:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"12px",lineHeight:"18px"},s12input:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"12px",lineHeight:"18px",textTransform:"uppercase",letterSpacing:"0.1em"},s13button:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"13px",lineHeight:"18px",textTransform:"uppercase",letterSpacing:"0.3em"},s11button:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"11px",lineHeight:"13px",textTransform:"uppercase",letterSpacing:"0.3em"}},transitions:{buttons:"ease-in-out 0.1s"},space:[0,5,10,15,20,30,40,50,60,70,80,90,100,110,120,130,140].map((e=>`${e}px`)),breakpoints:[960].map((e=>`${e}px`))},ui=({svgSize:e})=>d("svg",{width:e,height:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.3062 13.5002H1.69384C0.932655 13.5002 0.450552 12.6837 0.818264 12.0172L7.12444 0.587236C7.5047 -0.101994 8.49533 -0.101996 8.87559 0.587234L15.1818 12.0172C15.5495 12.6837 15.0674 13.5002 14.3062 13.5002ZM8.00001 3.25025C8.41423 3.25025 8.75002 3.58604 8.75002 4.00025V8.50025C8.75002 8.91446 8.41423 9.25025 8.00001 9.25025C7.5858 9.25025 7.25001 8.91446 7.25001 8.50025V4.00025C7.25001 3.58604 7.5858 3.25025 8.00001 3.25025ZM8.75002 11.2502C8.75002 11.6645 8.41423 12.0002 8.00001 12.0002C7.5858 12.0002 7.25001 11.6645 7.25001 11.2502C7.25001 10.836 7.5858 10.5002 8.00001 10.5002C8.41423 10.5002 8.75002 10.836 8.75002 11.2502Z",fill:"currentColor"})),fi=bn.div`
+ color: ${e=>e.theme.colors.instructionTextColor};
+ animation: spin 2s linear infinite;
+
+ @keyframes spin {
+ 100% {
+ transform: rotate(-360deg);
+ }
+ }
+`,hi=({svgSize:e})=>d(fi,null,d("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M30.9229 9.75026C30.9229 12.3736 28.7533 14.5002 26.0767 14.5002C23.4003 14.5002 21.2307 12.3736 21.2307 9.75026C21.2307 7.12664 23.4003 5 26.0767 5C28.7533 5 30.9229 7.12664 30.9229 9.75026Z",fill:"currentColor"}),d("path",{d:"M40.6155 15.8556C40.6155 18.1044 38.7559 19.9273 36.4618 19.9273C34.1675 19.9273 32.3079 18.1044 32.3079 15.8556C32.3079 13.607 34.1675 11.7842 36.4618 11.7842C38.7559 11.7842 40.6155 13.607 40.6155 15.8556Z",fill:"currentColor"}),d("path",{d:"M42 27.3921C42 29.2659 40.4502 30.785 38.5386 30.785C36.6267 30.785 35.0769 29.2659 35.0769 27.3921C35.0769 25.5181 36.6267 23.999 38.5386 23.999C40.4502 23.999 42 25.5181 42 27.3921Z",fill:"currentColor"}),d("path",{d:"M35.0766 37.5712C35.0766 39.0704 33.837 40.2858 32.3075 40.2858C30.7779 40.2858 29.5383 39.0704 29.5383 37.5712C29.5383 36.0723 30.7779 34.8569 32.3075 34.8569C33.837 34.8569 35.0766 36.0723 35.0766 37.5712Z",fill:"currentColor"}),d("path",{d:"M22.6154 40.2858C22.6154 41.7848 21.3756 43.0001 19.846 43.0001C18.3168 43.0001 17.0769 41.7848 17.0769 40.2858C17.0769 38.7866 18.3168 37.5713 19.846 37.5713C21.3756 37.5713 22.6154 38.7866 22.6154 40.2858Z",fill:"currentColor"}),d("path",{d:"M11.5382 32.8216C11.5382 33.9457 10.6085 34.8573 9.46137 34.8573C8.31426 34.8573 7.38452 33.9457 7.38452 32.8216C7.38452 31.6972 8.31426 30.7856 9.46137 30.7856C10.6085 30.7856 11.5382 31.6972 11.5382 32.8216Z",fill:"currentColor"}),d("path",{d:"M8.76913 21.2849C8.76913 22.0345 8.14932 22.642 7.38456 22.642C6.6198 22.642 6 22.0345 6 21.2849C6 20.5353 6.61981 19.9277 7.38456 19.9277C8.14933 19.9277 8.76913 20.5353 8.76913 21.2849Z",fill:"currentColor"}),d("path",{d:"M15.6927 11.7844C15.6927 12.534 15.0729 13.1415 14.3081 13.1415C13.5434 13.1415 12.9236 12.534 12.9236 11.7844C12.9236 11.0348 13.5434 10.4272 14.3081 10.4272C15.0729 10.4272 15.6927 11.0348 15.6927 11.7844Z",fill:"currentColor"}))),di=bn.div`
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ top: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ text-align: center;
+
+ ${e=>!e.isCameraReady&&"\n height: inherit;\n aspect-ratio: 16/9;\n\n @media (orientation: portrait) and (max-width: 1199px) {\n aspect-ratio: 9/16;\n }\n "}
+`,pi=bn.div`
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ color: ${e=>e.theme.colors.instructionTextColor};
+`,mi=bn.p`
+ background: ${e=>e.theme.colors.instructionColor};
+ border-radius: 0.25em;
+ padding: 0.583em 0.666em;
+ margin: 0.8em 0;
+ font-size: ${e=>`${e.fontSize}px`};
+ font-family: Montserrat, Arial, sans-serif;
+ font-style: normal;
+ font-weight: 600;
+ line-height: 1em;
+ max-width: 80%;
+`,gi=({text:e,fontSize:t,currentAppState:n})=>{const{isCameraReady:r}=wr();return d(di,{isCameraReady:r},d(pi,null,(()=>{switch(n){case Gn.LOADING:return d(hi,{svgSize:2*t});case Gn.ERROR:return d(ui,{svgSize:2*t});default:return null}})(),d(mi,{fontSize:t},e)))};class vi extends g{constructor(e){var t,n,r;super(e),r={error:null},(n="state")in(t=this)?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){this.setState({error:e});const t=new Ln("An unknown error has occurred");this.context.setError(t),this.props.triggerOnError(t)}render(){return this.state.error||this.context.error?d(gi,{fontSize:this.props.fontSize,text:this.context.error.message,currentAppState:Gn.ERROR}):this.props.children}}vi.contextType=_r;const yi=vi,_i=()=>{const{faceCameraOptions:{uiCustomisation:{colors:e,appStateInstructions:t},onError:n}}=Jn(),{appState:r}=wr(),i=le(null),o=cr(i);return d(gn,{theme:(a=e,{...ci,colors:{...ci.colors,...a}})},d(nr,{ref:i},d(yi,{triggerOnError:n,fontSize:o},d(Ar,{fontSize:o}),t.loading.visible&&r===Gn.LOADING&&d(gi,{text:t.loading.text,fontSize:o,currentAppState:Gn.LOADING}),t.waiting.visible&&r===Gn.WAITING&&d(gi,{text:t.waiting.text,fontSize:o,currentAppState:Gn.WAITING}))));var a};var bi=n(62),wi=n.n(bi),Ci=n(36),Si=n.n(Ci),ki=n(793),xi=n.n(ki),Ai=n(892),zi=n.n(Ai),Ii=n(173),Ei=n.n(Ii),Ti=n(464),Ri=n.n(Ti),Oi=n(820),Pi={};Pi.styleTagTransform=Ri(),Pi.setAttributes=zi(),Pi.insert=xi().bind(null,"head"),Pi.domAPI=Si(),Pi.insertStyleElement=Ei();wi()(Oi.Z,Pi);Oi.Z&&Oi.Z.locals&&Oi.Z.locals;!function(e,t,n,r){function i(){var t=Reflect.construct(HTMLElement,[],i);return t._vdomComponent=e,t._root=r&&r.shadow?t.attachShadow({mode:"open"}):t,t}(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=H,i.prototype.attributeChangedCallback=U,i.prototype.disconnectedCallback=B,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,n.forEach((function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,i)}((({cameraOptions:e})=>e?(ae((()=>{xr.init("5f83e83ee4cee1ab6e5bbf86e215644473299675")}),[]),d(Kn,{cameraOptions:e},d(br,{onError:e.onError},d(_i,null)))):null),"x-dot-face-auto-capture",["cameraOptions"])},820:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(601),i=n.n(r),o=n(609),a=n.n(o)()(i());a.push([e.id,"@import url(https://fonts.googleapis.com/css?family=Montserrat:600);"]),a.push([e.id,"\n",""]);const s=a},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r="undefined"!=typeof t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},601:e=>{"use strict";e.exports=function(e){return e[1]}},463:(e,t,n)=>{"use strict";var r=n(570),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=d(n);i&&i!==p&&e(t,i,r)}var a=u(n);f&&(a=a.concat(f(n)));for(var s=l(t),m=l(n),g=0;g{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,_=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case o:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case m:case l:return e;default:return t}}case i:return t}}}function C(e){return w(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=o,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=d,t.isAsyncMode=function(e){return C(e)||w(e)===u},t.isConcurrentMode=C,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===f||e===s||e===a||e===d||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===h||e.$$typeof===y||e.$$typeof===_||e.$$typeof===b||e.$$typeof===v)},t.typeOf=w},570:(e,t,n)=>{"use strict";e.exports=n(866)},665:e=>{e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";var t=[];function n(e){for(var n=-1,r=0;r{"use strict";var t={};e.exports=function(e,n){var r=function(e){if("undefined"==typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},173:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},892:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},36:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i="undefined"!=typeof n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},464:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},994:e=>{var t,n=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var n,r,i;e=e||{},n||(n="undefined"!=typeof e?e:{}),n.ready=new Promise((function(e,t){r=e,i=t}));var o,a={};for(o in n)n.hasOwnProperty(o)&&(a[o]=n[o]);var s,l,c="./this.program";s="object"==typeof window,l="function"==typeof importScripts;var u,f="";(s||l)&&(l?f=self.location.href:document.currentScript&&(f=document.currentScript.src),t&&(f=t),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",l&&(u=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var h,d=n.print||console.log.bind(console),p=n.printErr||console.warn.bind(console);for(o in a)a.hasOwnProperty(o)&&(n[o]=a[o]);a=null,n.thisProgram&&(c=n.thisProgram),n.wasmBinary&&(h=n.wasmBinary),n.noExitRuntime&&n.noExitRuntime,"object"!=typeof WebAssembly&&q("no native wasm support detected");var m,g=!1;function v(e){e||q("Assertion failed: undefined")}var y="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function _(e,t,n){var r=t+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function b(e,t,n,r){if(0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),127>=o){if(n>=r)break;t[n++]=o}else{if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12}else{if(n+3>=r)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63}t[n++]=128|o>>6&63}t[n++]=128|63&o}}t[n]=0}}function w(e){for(var t=0,n=0;n=r&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),127>=r?++t:t=2047>=r?t+2:65535>=r?t+3:t+4}return t}var C,S,k,x,A,z,I,E,T,R="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function O(e,t){for(var n=e>>1,r=n+t/2;!(n>=r)&&A[n];)++n;if(32<(n<<=1)-e&&R)return R.decode(k.subarray(e,n));for(n=0,r="";;){var i=x[e+2*n>>1];if(0==i||n==t/2)return r;++n,r+=String.fromCharCode(i)}}function P(e,t,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>1]=e.charCodeAt(i),t+=2;return x[t>>1]=0,t-r}function M(e){return 2*e.length}function D(e,t){for(var n=0,r="";!(n>=t/4);){var i=z[e+4*n>>2];if(0==i)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r}function F(e,t,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),z[t>>2]=o,(t+=4)+4>n)break}return z[t>>2]=0,t-r}function N(e){for(var t=0,n=0;n=r&&++n,t+=4}return t}function j(e){C=e,n.HEAP8=S=new Int8Array(e),n.HEAP16=x=new Int16Array(e),n.HEAP32=z=new Int32Array(e),n.HEAPU8=k=new Uint8Array(e),n.HEAPU16=A=new Uint16Array(e),n.HEAPU32=I=new Uint32Array(e),n.HEAPF32=E=new Float32Array(e),n.HEAPF64=T=new Float64Array(e)}var W=n.INITIAL_MEMORY||16777216;(m=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:W/65536,maximum:32768}))&&(C=m.buffer),W=C.byteLength,j(C);var L=[],H=[],$=[],U=[];function B(){var e=n.preRun.shift();L.unshift(e)}var Y=0,G=null,V=null;function q(e){throw n.onAbort&&n.onAbort(e),p(e),g=!0,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),i(e),e}function Z(e){var t=J;return String.prototype.startsWith?t.startsWith(e):0===t.indexOf(e)}function X(){return Z("data:application/octet-stream;base64,")}n.preloadedImages={},n.preloadedAudios={};var J="sam.wasm";if(!X()){var K=J;J=n.locateFile?n.locateFile(K,f):f+K}function Q(){try{if(h)return new Uint8Array(h);if(u)return u(J);throw"both async and sync fetching of the wasm failed"}catch(e){q(e)}}function ee(e){for(;0>2]=e},this.Ua=function(e){z[this.ga+0>>2]=e},this.Va=function(){z[this.ga+4>>2]=0},this.Ta=function(){S[this.ga+12>>0]=0},this.Wa=function(){S[this.ga+13>>0]=0},this.Oa=function(e,t){this.Xa(e),this.Ua(t),this.Va(),this.Ta(),this.Wa()}}function re(){return 0=t?"_"+e:e}function fe(e,t){return e=ue(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function he(e){var t=Error,n=fe(e,(function(t){this.name=e,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var de=void 0;function pe(e){throw new de(e)}var me=void 0;function ge(e){throw new me(e)}function ve(e,t,n){function r(t){(t=n(t)).length!==e.length&&ge("Mismatched type converter count");for(var r=0;r>2])}function Ne(e,t,n){return t===n?e:void 0===n.ma||null===(e=Ne(e,t,n.ma))?null:n.Ja(e)}var je={};function We(e,t){return t.ia&&t.ga||ge("makeClassHandle requires ptr and ptrType"),!!t.la!=!!t.ka&&ge("Both smartPtrType and smartPtr must be specified"),t.count={value:1},ke(Object.create(e,{A:{value:t}}))}function Le(e,t,n,r){this.name=e,this.ha=t,this.Da=n,this.xa=r,this.ya=!1,this.ra=this.Ra=this.Qa=this.Fa=this.Ya=this.Pa=void 0,void 0!==t.ma?this.toWireType=Me:(this.toWireType=r?Pe:De,this.oa=null)}function He(e,t,r){n.hasOwnProperty(e)||ge("Replacing nonexistant public symbol"),void 0!==n[e].na&&void 0!==r?n[e].na[r]=t:(n[e]=t,n[e].Ha=r)}function $e(e,t){var n=te(e=ae(e),t);return"function"!=typeof n&&pe("unknown function pointer with signature "+e+": "+t),n}var Ue=void 0;function Be(e){var t=ae(e=wt(e));return bt(e),t}function Ye(e,t){var n=[],r={};throw t.forEach((function e(t){r[t]||le[t]||(ce[t]?ce[t].forEach(e):(n.push(t),r[t]=!0))})),new Ue(e+": "+n.map(Be).join([", "]))}function Ge(e,t){for(var n=[],r=0;r>2)+r]);return n}function Ve(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function qe(e,t,n){return e instanceof Object||pe(n+' with invalid "this": '+e),e instanceof t.ha.constructor||pe(n+' incompatible with "this" of type '+e.constructor.name),e.A.ga||pe("cannot call emscripten binding method "+n+" on deleted object"),Oe(e.A.ga,e.A.ia.ha,t.ha)}var Ze=[],Xe=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Je(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Ze.length?Ze.pop():Xe.length;return Xe[t]={Sa:1,value:e},t}}function Ke(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Qe(e,t){switch(t){case 2:return function(e){return this.fromWireType(E[e>>2])};case 3:return function(e){return this.fromWireType(T[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function et(e,t,n){switch(t){case 0:return n?function(e){return S[e]}:function(e){return k[e]};case 1:return n?function(e){return x[e>>1]}:function(e){return A[e>>1]};case 2:return n?function(e){return z[e>>2]}:function(e){return I[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var tt={};function nt(){if(!rt){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(e in tt)t[e]=tt[e];var n=[];for(e in t)n.push(e+"="+t[e]);rt=n}return rt}var rt,it=[null,[],[]],ot={};function at(e){return 0==e%4&&(0!=e%100||0==e%400)}function st(e,t){for(var n=0,r=0;r<=t;n+=e[r++]);return n}var lt=[31,29,31,30,31,30,31,31,30,31,30,31],ct=[31,28,31,30,31,30,31,31,30,31,30,31];function ut(e,t){for(e=new Date(e.getTime());0r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function ft(e,t,n,r){function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.lengthe?-1:0=a(n,e)?0>=a(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var c=z[r+40>>2];for(var u in r={ab:z[r>>2],$a:z[r+4>>2],za:z[r+8>>2],va:z[r+12>>2],ta:z[r+16>>2],ja:z[r+20>>2],Aa:z[r+24>>2],Ba:z[r+28>>2],hb:z[r+32>>2],Za:z[r+36>>2],bb:c&&c?_(k,c,void 0):""},n=n?_(k,n,void 0):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(u,"g"),c[u]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(u in c={"%a":function(e){return f[e.Aa].substring(0,3)},"%A":function(e){return f[e.Aa]},"%b":function(e){return h[e.ta].substring(0,3)},"%B":function(e){return h[e.ta]},"%C":function(e){return o((e.ja+1900)/100|0,2)},"%d":function(e){return o(e.va,2)},"%e":function(e){return i(e.va,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return o(e.za,2)},"%I":function(e){return 0==(e=e.za)?e=12:12e.za?"AM":"PM"},"%S":function(e){return o(e.ab,2)},"%t":function(){return"\t"},"%u":function(e){return e.Aa||7},"%U":function(e){var t=new Date(e.ja+1900,0,1),n=0===t.getDay()?t:ut(t,7-t.getDay());return 0>a(n,e=new Date(e.ja+1900,e.ta,e.va))?o(Math.ceil((31-n.getDate()+(st(at(e.getFullYear())?lt:ct,e.getMonth()-1)-31)+e.getDate())/7),2):0===a(n,t)?"01":"00"},"%V":function(e){var t=new Date(e.ja+1901,0,4),n=s(new Date(e.ja+1900,0,4));t=s(t);var r=ut(new Date(e.ja+1900,0,1),e.Ba);return 0>a(r,n)?"53":0>=a(t,r)?"01":o(Math.ceil((n.getFullYear()a(n,e=new Date(e.ja+1900,e.ta,e.va))?o(Math.ceil((31-n.getDate()+(st(at(e.getFullYear())?lt:ct,e.getMonth()-1)-31)+e.getDate())/7),2):0===a(n,t)?"01":"00"},"%y":function(e){return(e.ja+1900).toString().substring(2)},"%Y":function(e){return e.ja+1900},"%z":function(e){var t=0<=(e=e.Za);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.bb},"%%":function(){return"%"}})0<=n.indexOf(u)&&(n=n.replace(new RegExp(u,"g"),c[u](r)));return(u=function(e){var t=Array(w(e)+1);return b(e,t,0,t.length),t}(n)).length>t?0:(S.set(u,e),u.length-1)}var ht=[];function dt(e){var t,n={};for(t in e)!function(t){var r=e[t];n[t]="function"==typeof r?function(){ht.push(t);try{return r.apply(null,arguments)}finally{if(g)return;var e=ht.pop();v(e===t)}}:r}(t);return n}for(var pt=Array(256),mt=0;256>mt;++mt)pt[mt]=String.fromCharCode(mt);oe=pt,de=n.BindingError=he("BindingError"),me=n.InternalError=he("InternalError"),Ie.prototype.isAliasOf=function(e){if(!(this instanceof Ie&&e instanceof Ie))return!1;var t=this.A.ia.ha,n=this.A.ga,r=e.A.ia.ha;for(e=e.A.ga;t.ma;)n=t.wa(n),t=t.ma;for(;r.ma;)e=r.wa(e),r=r.ma;return t===r&&n===e},Ie.prototype.clone=function(){if(this.A.ga||be(this),this.A.ua)return this.A.count.value+=1,this;var e=ke(Object.create(Object.getPrototypeOf(this),{A:{value:_e(this.A)}}));return e.A.count.value+=1,e.A.sa=!1,e},Ie.prototype.delete=function(){this.A.ga||be(this),this.A.sa&&!this.A.ua&&pe("Object already scheduled for deletion"),Ce(this),Se(this.A),this.A.ua||(this.A.ka=void 0,this.A.ga=void 0)},Ie.prototype.isDeleted=function(){return!this.A.ga},Ie.prototype.deleteLater=function(){return this.A.ga||be(this),this.A.sa&&!this.A.ua&&pe("Object already scheduled for deletion"),Ae.push(this),1===Ae.length&&xe&&xe(ze),this.A.sa=!0,this},Le.prototype.Ma=function(e){return this.Fa&&(e=this.Fa(e)),e},Le.prototype.Ea=function(e){this.ra&&this.ra(e)},Le.prototype.argPackAdvance=8,Le.prototype.readValueFromPointer=Fe,Le.prototype.deleteObject=function(e){null!==e&&e.delete()},Le.prototype.fromWireType=function(e){function t(){return this.ya?We(this.ha.qa,{ia:this.Pa,ga:n,la:this,ka:e}):We(this.ha.qa,{ia:this,ga:e})}var n=this.Ma(e);if(!n)return this.Ea(e),null;var r=function(e,t){for(void 0===t&&pe("ptr should not be undefined");e.ma;)t=e.wa(t),e=e.ma;return je[t]}(this.ha,n);if(void 0!==r)return 0===r.A.count.value?(r.A.ga=n,r.A.ka=e,r.clone()):(r=r.clone(),this.Ea(e),r);if(r=this.ha.La(n),!(r=Ee[r]))return t.call(this);r=this.xa?r.Ia:r.pointerType;var i=Ne(n,this.ha,r.ha);return null===i?t.call(this):this.ya?We(r.ha.qa,{ia:r,ga:i,la:this,ka:e}):We(r.ha.qa,{ia:r,ga:i})},n.getInheritedInstanceCount=function(){return Object.keys(je).length},n.getLiveInheritedInstances=function(){var e,t=[];for(e in je)je.hasOwnProperty(e)&&t.push(je[e]);return t},n.flushPendingDeletes=ze,n.setDelayFunction=function(e){xe=e,Ae.length&&xe&&xe(ze)},Ue=n.UnboundTypeError=he("UnboundTypeError"),n.count_emval_handles=function(){for(var e=0,t=5;t>o])},oa:null})},g:function(e,t,n,r,i,o,a,s,l,c,u,f,h){u=ae(u),o=$e(i,o),s&&(s=$e(a,s)),c&&(c=$e(l,c)),h=$e(f,h);var d=ue(u);Te(d,(function(){Ye("Cannot construct "+u+" due to unbound types",[r])})),ve([e,t,n],r?[r]:[],(function(t){if(t=t[0],r)var n=t.ha,i=n.qa;else i=Ie.prototype;t=fe(d,(function(){if(Object.getPrototypeOf(this)!==a)throw new de("Use 'new' to construct "+u);if(void 0===l.pa)throw new de(u+" has no accessible constructor");var e=l.pa[arguments.length];if(void 0===e)throw new de("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(l.pa).toString()+") parameters instead!");return e.apply(this,arguments)}));var a=Object.create(i,{constructor:{value:t}});t.prototype=a;var l=new Re(u,t,a,h,n,o,s,c);n=new Le(u,l,!0,!1),i=new Le(u+"*",l,!1,!1);var f=new Le(u+" const*",l,!1,!0);return Ee[e]={pointerType:i,Ia:f},He(d,t),[n,i,f]}))},f:function(e,t,n,r,i,o){v(0l&&pe("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=null!==n[1]&&!1,u=!1,f=1;f>>s}}var l=-1!=t.indexOf("unsigned");ye(e,{name:t,fromWireType:o,toWireType:function(e,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+Ke(n)+'" to '+this.name);if(ni)throw new TypeError('Passing a number "'+Ke(n)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+i+"]!");return l?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:et(t,a,0!==r),oa:null})},c:function(e,t,n){function r(e){var t=I;return new i(C,t[1+(e>>=2)],t[e])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];ye(e,{name:n=ae(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Na:!0})},i:function(e,t){var n="std::string"===(t=ae(t));ye(e,{name:t,fromWireType:function(e){var t=I[e>>2];if(n)for(var r=e+4,i=0;i<=t;++i){var o=e+4+i;if(i==t||0==k[o]){if(r=r?_(k,r,o-r):"",void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=o+1}}else{for(a=Array(t),i=0;i>2]=i,n&&r)b(t,k,o+4,i+1);else if(r)for(r=0;r>2],o=a(),l=e+4,c=0;c<=i;++c){var u=e+4+c*t;c!=i&&0!=o[u>>s]||(l=r(l,u-l),void 0===n?n=l:(n+=String.fromCharCode(0),n+=l),l=u+t)}return bt(e),n},toWireType:function(e,r){"string"!=typeof r&&pe("Cannot pass non-string to C++ string type "+n);var a=o(r),l=_t(4+a+t);return I[l>>2]=a>>s,i(r,l+4,a+t),null!==e&&e.push(bt,l),l},argPackAdvance:8,readValueFromPointer:Fe,oa:function(e){bt(e)}})},p:function(e,t){ye(e,{fb:!0,name:t=ae(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},n:function(){q()},s:function(e,t,n){k.copyWithin(e,t,t+n)},t:function(e){e>>>=0;var t=k.length;if(2147483648=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296),0<(r=Math.max(16777216,e,r))%65536&&(r+=65536-r%65536);e:{try{m.grow(Math.min(2147483648,r)-C.byteLength+65535>>>16),j(m.buffer);var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},v:function(e,t){var n=0;return nt().forEach((function(r,i){var o=t+n;for(i=z[e+4*i>>2]=o,o=0;o>0]=r.charCodeAt(o);S[i>>0]=0,n+=r.length+1})),0},w:function(e,t){var n=nt();z[e>>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),z[t>>2]=r,0},y:function(){return 0},x:function(e,t,n,r){return e=ot.eb(e),t=ot.cb(e,t,n),z[r>>2]=t,0},q:function(){},k:function(e,t,n,r){for(var i=0,o=0;o>2],s=z[t+(8*o+4)>>2],l=0;l>2]=i,0},a:m,r:function(){},u:function(e,t,n,r){return ft(e,t,n,r)}};!function(){function e(e){e=dt(e=e.exports),n.asm=e,Y--,n.monitorRunDependencies&&n.monitorRunDependencies(Y),0==Y&&(null!==G&&(clearInterval(G),G=null),V&&(e=V,V=null,e()))}function t(t){e(t.instance)}function r(e){return(h||!s&&!l||"function"!=typeof fetch||Z("file://")?Promise.resolve().then(Q):fetch(J,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+J+"'";return e.arrayBuffer()})).catch((function(){return Q()}))).then((function(e){return WebAssembly.instantiate(e,i)})).then(e,(function(e){p("failed to asynchronously prepare wasm: "+e),q(e)}))}var i={a:gt};if(Y++,n.monitorRunDependencies&&n.monitorRunDependencies(Y),n.instantiateWasm)try{var o=n.instantiateWasm(i,e);return dt(o)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}!function(){if(h||"function"!=typeof WebAssembly.instantiateStreaming||X()||Z("file://")||"function"!=typeof fetch)return r(t);fetch(J,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,i).then(t,(function(e){return p("wasm streaming compile failed: "+e),p("falling back to ArrayBuffer instantiation"),r(t)}))}))}()}();var vt,yt=n.___wasm_call_ctors=function(){return(yt=n.___wasm_call_ctors=n.asm.B).apply(null,arguments)},_t=n._malloc=function(){return(_t=n._malloc=n.asm.C).apply(null,arguments)},bt=n._free=function(){return(bt=n._free=n.asm.D).apply(null,arguments)},wt=n.___getTypeName=function(){return(wt=n.___getTypeName=n.asm.E).apply(null,arguments)};function Ct(){function e(){if(!vt&&(vt=!0,n.calledRun=!0,!g)){if(ee(H),ee($),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();U.unshift(e)}ee(U)}}if(!(0{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n(316)})();
\ No newline at end of file
diff --git a/jquery-components-integration/lib/main-document.js b/jquery-components-integration/lib/main-document.js
deleted file mode 100644
index b840178..0000000
--- a/jquery-components-integration/lib/main-document.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/*! For license information please see index.js.LICENSE.txt */
-(()=>{var e={687:(e,t,n)=>{"use strict";var r,i,o,a,s,l={},u=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n){var r,i,o,a=arguments,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>3)for(n=[n],o=3;o0?p(y.type,y.props,y.key,null,y.__v):y)){if(y.__=n,y.__b=n.__b+1,null===(m=L[h])||m&&y.key==m.key&&y.type===m.type)L[h]=void 0;else for(d=0;d3)for(n=[n],o=3;o=0||(i[n]=e[n]);return i}(e,["context","children"]);return H(t,n)}function W(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=d(j,N({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],i={},o=0,a=t.attributes,s=t.childNodes;for(o=a.length;o--;)"slot"!==a[o].name&&(i[a[o].name]=a[o].value,i[z(a[o].name)]=a[o].value);for(o=s.length;o--;){var l=e(s[o],null),u=s[o].slot;u?i[u]=d(U,{name:u},l):r[o]=l}var c=n?d(U,null,r):r;return d(n||t.nodeName.toLowerCase(),i,c)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?P:D)(this._vdom,this._root)}function z(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function B(e,t,n){if(this._vdom){var r={};r[e]=n=null==n?void 0:n,r[z(e)]=n,this._vdom=H(this._vdom,r),D(this._vdom,this._root)}}function $(){D(this._vdom=null,this._root)}function U(e,t){var n=this;return d("slot",N({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}r={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e},__v:0},m.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),_(this))},m.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},m.prototype.render=g,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b.__r=0,s=0;var Z,G,Y,q=n(570),X=0,J=[],K=r.__b,Q=r.__r,ee=r.diffed,te=r.__c,ne=r.unmount;function re(e,t){r.__h&&r.__h(G,e,X||t),X=0;var n=G.__H||(G.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ie(e){return X=1,oe(me,e)}function oe(e,t,n){var r=re(Z++,2);return r.t=e,r.__c||(r.__=[n?n(t):me(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=G),r.__}function ae(e,t){var n=re(Z++,3);!r.__s&&ge(n.__H,t)&&(n.__=e,n.__H=t,G.__H.__h.push(n))}function se(e,t){var n=re(Z++,4);!r.__s&&ge(n.__H,t)&&(n.__=e,n.__H=t,G.__h.push(n))}function le(e){return X=5,ue((function(){return{current:e}}),[])}function ue(e,t){var n=re(Z++,7);return ge(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ce(e){var t=G.context[e.__c],n=re(Z++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(G)),t.props.value):e.__}function fe(){J.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(de),e.__H.__h.forEach(pe),e.__H.__h=[]}catch(t){e.__H.__h=[],r.__e(t,e.__v)}})),J=[]}r.__b=function(e){G=null,K&&K(e)},r.__r=function(e){Q&&Q(e),Z=0;var t=(G=e.__c).__H;t&&(t.__h.forEach(de),t.__h.forEach(pe),t.__h=[])},r.diffed=function(e){ee&&ee(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==J.push(t)&&Y===r.requestAnimationFrame||((Y=r.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),he&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);he&&(t=requestAnimationFrame(n))})(fe)),G=void 0},r.__c=function(e,t){t.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||pe(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],r.__e(n,e.__v)}})),te&&te(e,t)},r.unmount=function(e){ne&&ne(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(de)}catch(e){r.__e(e,t.__v)}};var he="function"==typeof requestAnimationFrame;function de(e){var t=G;"function"==typeof e.__c&&e.__c(),G=t}function pe(e){var t=G;e.__c=e.__(),G=t}function ge(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function me(e,t){return"function"==typeof t?t(e):t}function ve(e,t){for(var n in t)e[n]=t[n];return e}function ye(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function _e(e){this.props=e}(_e.prototype=new m).isPureReactComponent=!0,_e.prototype.shouldComponentUpdate=function(e,t){return ye(this.props,e)||ye(this.state,t)};var be=r.__b;r.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),be&&be(e)};var we="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ce=function(e,t){return null==e?null:L(L(e).map(t))},Le={map:Ce,forEach:Ce,count:function(e){return e?L(e).length:0},only:function(e){var t=L(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:L},Se=r.__e;r.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Se(e,t,n)};var ke=r.unmount;function xe(){this.__u=0,this.t=null,this.__b=null}function Ae(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Ee(){this.u=null,this.o=null}r.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),ke&&ke(e)},(xe.prototype=new m).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=Ae(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},xe.prototype.componentWillUnmount=function(){this.t=[]},xe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=ve({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&d(g,null,e.fallback);return i&&(i.__h=null),[d(g,null,t.__e?null:e.children),i]};var Ie=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),D(d(Te,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}(Ee.prototype=new m).__e=function(e){var t=this,n=Ae(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Ie(t,e,r)):i()};n?n(o):o()}},Ee.prototype.render=function(e){this.u=null,this.o=new Map;var t=L(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ee.prototype.componentDidUpdate=Ee.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ie(e,n,t)}))};var Re="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Me=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ve=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};m.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(m.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var De=r.event;function Pe(){}function He(){return this.cancelBubble}function Fe(){return this.defaultPrevented}r.event=function(e){return De&&(e=De(e)),e.persist=Pe,e.isPropagationStopped=He,e.isDefaultPrevented=Fe,e.nativeEvent=e};var Ne,je={configurable:!0,get:function(){return this.class}},We=r.vnode;r.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){for(var i in r={},n){var o=n[i];"value"===i&&"defaultValue"in n&&null==o||("defaultValue"===i&&"value"in n&&null==n.value?i="value":"download"===i&&!0===o?o="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Ve(n.type)?i="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():Me.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[i]=o)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=L(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=L(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r}t&&n.class!=n.className&&(je.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",je)),e.$$typeof=Re,We&&We(e)};var ze=r.__r;r.__r=function(e){ze&&ze(e),Ne=e.__c};var Be={ReactCurrentDispatcher:{current:{readContext:function(e){return Ne.__n[e.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now&&performance.now.bind(performance);function $e(e){return!!e&&e.$$typeof===Re}const Ue={useState:ie,useReducer:oe,useEffect:ae,useLayoutEffect:se,useRef:le,useImperativeHandle:function(e,t,n){X=6,se((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},useMemo:ue,useCallback:function(e,t){return X=8,ue((function(){return e}),t)},useContext:ce,useDebugValue:function(e,t){r.useDebugValue&&r.useDebugValue(t?t(e):e)},version:"16.8.0",Children:Le,render:function(e,t,n){return null==t.__k&&(t.textContent=""),D(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return P(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(D(null,e),!0)},createPortal:function(e,t){return d(Oe,{__v:e,i:t})},createElement:d,createContext:F,createFactory:function(e){return d.bind(null,e)},cloneElement:function(e){return $e(e)?H.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:g,isValidElement:$e,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:m,PureComponent:_e,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:ye(this.props,e)}function r(t){return this.shouldComponentUpdate=n,d(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(t,n){var r=ve({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=we,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:g,Suspense:xe,SuspenseList:Ee,lazy:function(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return d(n,i)}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Be};var Ze=n(665),Ge=n.n(Ze);const Ye=function(e){function t(e,r,l,u,h){for(var d,p,g,m,b,C=0,L=0,S=0,k=0,x=0,R=0,V=g=d=0,P=0,H=0,F=0,N=0,j=l.length,W=j-1,z="",B="",$="",U="";Pd)&&(N=(z=z.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var ht=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&ft(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(lt))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(lt,"active"),r.setAttribute("data-styled-version","5.3.0");var a=Lt();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},kt=function(){function e(e){var t=this.element=St(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),r+=""+s+l+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),Ot=/(a)(d)/gi,Rt=function(e){return String.fromCharCode(e+(e>25?39:97))};function Mt(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Rt(t%52)+n;return(Rt(t%52)+n).replace(Ot,"$1-$2")}var Vt=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Dt=function(e){return Vt(5381,e)};function Pt(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(o,"."+a,void 0,r);t.insertRules(r,a,s)}i.push(a),this.staticRulesId=a}else{for(var l=this.rules.length,u=Vt(this.baseHash,n.hash),c="",f=0;f>>0);if(!t.hasNameForId(r,g)){var m=n(c,"."+g,void 0,r);t.insertRules(r,g,m)}i.push(g)}}return i.join(" ")},e}(),Nt=/^\s*\/\/.*$/gm,jt=[":","[",".","#"];function Wt(e){var t,n,r,i,o=void 0===e?it:e,a=o.options,s=void 0===a?it:a,l=o.plugins,u=void 0===l?rt:l,c=new Ye(s),f=[],h=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,s,l,u,c,f){switch(n){case 1:if(0===c&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(i[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),d=function(e,r,o){return 0===r&&-1!==jt.indexOf(o[n.length])||o.match(i)?e:"."+t};function p(e,o,a,s){void 0===s&&(s="&");var l=e.replace(Nt,""),u=o&&a?a+" "+o+" { "+l+" }":l;return t=s,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),c(a||!o?"":o,u)}return c.use([].concat(u,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,d))},h,function(e){if(-2===e){var t=f;return f=[],t}}])),p.hash=u.length?u.reduce((function(e,t){return t.name||ft(15),Vt(e,t.name)}),5381).toString():"",p}var zt=Ue.createContext(),Bt=(zt.Consumer,Ue.createContext()),$t=(Bt.Consumer,new Tt),Ut=Wt();function Zt(){return ce(zt)||$t}function Gt(){return ce(Bt)||Ut}function Yt(e){var t=ie(e.stylisPlugins),n=t[0],r=t[1],i=Zt(),o=ue((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=ue((function(){return Wt({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return ae((function(){Ge()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),Ue.createElement(zt.Provider,{value:o},Ue.createElement(Bt.Provider,{value:a},e.children))}var qt=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ut);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return ft(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ut),this.name+e.hash},e}(),Xt=/([A-Z])/,Jt=/([A-Z])/g,Kt=/^ms-/,Qt=function(e){return"-"+e.toLowerCase()};function en(e){return Xt.test(e)?e.replace(Jt,Qt).replace(Kt,"-ms-"):e}var tn=function(e){return null==e||!1===e||""===e};function nn(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,sn=/(^-|-$)/g;function ln(e){return e.replace(an,"-").replace(sn,"")}var un=function(e){return Mt(Dt(e)>>>0)};function cn(e){return"string"==typeof e&&!0}var fn=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},hn=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function dn(e,t,n){var r=e[n];fn(t)&&fn(r)?pn(r,t):e[n]=t}function pn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(cn(e)?e:ln(at(e)));return yn(e,et({},i,{attrs:h,componentId:o}),n)},Object.defineProperty(g,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?pn({},e.defaultProps,t):t}}),g.toString=function(){return"."+g.styledComponentId},i&&Qe()(g,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),g}var _n=function(e){return function e(t,n,r){if(void 0===r&&(r=it),!(0,q.isValidElementType)(n))return ft(1,String(n));var i=function(){return t(n,r,rn.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,n,et({},r,{},i))},i.attrs=function(i){return e(t,n,et({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},i}(yn,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){_n[e]=_n(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Pt(e),Tt.registerId(this.componentId+1)}var t=e.prototype;t.createStyles=function(e,t,n,r){var i=r(nn(this.rules,t,n,r).join(""),""),o=this.componentId+e;n.insertRules(o,o,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&Tt.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}();!function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=Lt();return""},this.getStyleTags=function(){return e.sealed?ft(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return ft(2);var n=((t={})[lt]="",t["data-styled-version"]="5.3.0",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=Lt();return r&&(n.nonce=r),[Ue.createElement("style",et({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Tt({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?ft(2):Ue.createElement(Yt,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return ft(3)}}();const bn=_n,wn=1e3,Cn=.5,Ln="3.2.0";function Sn(){return/iPhone|iPad|iPod|Android|Mobi|BlackBerry|Silk|Windows Phone/i.test(navigator.userAgent)}function kn(e){return new Promise((t=>{setTimeout(t,e)}))}const xn=e=>Number.parseFloat(e.toFixed(3)),An=e=>JSON.parse(JSON.stringify(e,((e,t)=>"number"==typeof t?xn(t):t)));const En=e=>Object.entries(e).map((([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`)).join("&"),In=e=>500*Math.round(e/500)/1e3,Tn=e=>e<=1?Math.round(20*e)/20:50*Math.round(e/50),On=e=>Math.round(2*e)/2;function Rn(e,t,n){return new Promise((r=>{e.toBlob((e=>{r(function(e){if(null==e)throw new Error("unwrap: value must not be null/undefined, but is: "+(null===e?"null":"undefined"));return e}(e))}),t,n)}))}const Mn=e=>{const t=e.getContext("2d");t&&t.clearRect(0,0,t.canvas.width,t.canvas.height)},Vn=bn.div`
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 0.25em;
- margin: 0 auto;
- padding: 0.583em 0.666em;
- background: ${e=>e.isInCandidateSelection?`${e.theme.colors.instructionColorSuccess}`:`${e.theme.colors.instructionColor}`};
- color: ${e=>e.theme.colors.instructionTextColor};
- border: 0;
- font-family: Montserrat, Arial, sans-serif;
- font-weight: 600;
- line-height: 1em;
- font-size: ${e=>`${e.fontSize}px`};
-`,Dn=({instructionText:e,fontSize:t,isInCandidateSelection:n})=>e?d(Vn,{fontSize:t,isInCandidateSelection:n},e):null,Pn=()=>d("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M0 26C0 11.6406 11.6406 0 26 0C40.3594 0 52 11.6406 52 26C52 40.3594 40.3594 52 26 52C11.6406 52 0 40.3594 0 26Z",fill:"#131313",fillOpacity:"0.3"}),d("path",{d:"M15 21.375C15 19.7181 16.3431 18.375 18 18.375H20.3222C21.1014 18.375 21.8096 17.9225 22.137 17.2155L22.163 17.1595C22.4904 16.4525 23.1986 16 23.9778 16H28.0222C28.8014 16 29.5096 16.4525 29.837 17.1595L29.863 17.2155C30.1904 17.9225 30.8986 18.375 31.6778 18.375H34C35.6569 18.375 37 19.7181 37 21.375V33C37 34.6569 35.6569 36 34 36H18C16.3431 36 15 34.6569 15 33V21.375Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M31.25 27C31.25 24.1005 28.8995 21.75 26 21.75C24.4024 21.75 22.9715 22.4636 22.0086 23.5894M20.75 27C20.75 29.8995 23.1005 32.25 26 32.25C27.5958 32.25 29.0253 31.538 29.9881 30.4144",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),d("path",{d:"M30.0835 26.4167L31.2502 28.1667L32.4168 26.4167",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M19.5835 27.5833L20.7502 25.8333L21.9168 27.5833",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Hn=()=>d("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M0 26C0 11.6406 11.6406 0 26 0C40.3594 0 52 11.6406 52 26C52 40.3594 40.3594 52 26 52C11.6406 52 0 40.3594 0 26Z",fill:"#131313",fillOpacity:"0.3"}),d("circle",{cx:"17.5",cy:"24.5",r:"1.5",fill:"white"}),d("path",{d:"M15 17H16C19.5 17 23 21 23 29C22.5 29 21.5 29 20 29C20 29 20.25 33 19.5 34.5C18.75 36 16 36 16 36H15",stroke:"white",strokeWidth:"2"}),d("circle",{r:"1.5",transform:"matrix(-1 0 0 1 34.5 24.5)",fill:"white"}),d("path",{d:"M37 17H36C32.5 17 29 21 29 29C29.5 29 30.5 29 32 29C32 29 31.75 33 32.5 34.5C33.25 36 36 36 36 36H37",stroke:"white",strokeWidth:"2"}));function Fn(e,t){return e*t}function Nn(e){let t;return t=e.width>e.height?e.height{const e=ce(Zn);if(!e)throw new Error("Missing provider for CameraOptionsContext");return e},Yn=({children:e,cameraOptions:t})=>{const[n,r]=ie(null);return ae((()=>{var e,n,i,o,a,s,l,u,c,f,h,d,p,g,m,v,y,_,b;const{imageType:w,cameraFacing:C,photoTakenCb:L,onError:S,thresholds:k,validationMode:x,detectionLayerVisible:A,uiCustomisation:E,samWasmUrl:I}=t,T=Sn()?"environment":"user",O=null==E?void 0:E.placeholder,R=null==E?void 0:E.instructions,M=null==E?void 0:E.colors,V=null==E?void 0:E.loading,D={imageType:null!=w?w:"png",cameraFacing:null!=C?C:T,photoTakenCb:L,onError:S,thresholds:{confidenceThreshold:null!==(e=null==k?void 0:k.confidenceThreshold)&&void 0!==e?e:.8,placeholderErrorScoreThreshold:null!==(n=null==k?void 0:k.placeholderErrorScoreThreshold)&&void 0!==n?n:.035,sharpnessThreshold:null!==(i=null==k?void 0:k.sharpnessThreshold)&&void 0!==i?i:500,brightnessLowThreshold:null!==(o=null==k?void 0:k.brightnessLowThreshold)&&void 0!==o?o:250,brightnessHighThreshold:null!==(a=null==k?void 0:k.brightnessHighThreshold)&&void 0!==a?a:900,hotspotsScoreThreshold:null!==(s=null==k?void 0:k.hotspotsScoreThreshold)&&void 0!==s?s:100,sizeSmallThreshold:null!==(l=null==k?void 0:k.sizeSmallThreshold)&&void 0!==l?l:.43,outOfBoundsThreshold:null!==(u=null==k?void 0:k.outOfBoundsThreshold)&&void 0!==u?u:.03},validationMode:null!=x?x:"standard",detectionLayerVisible:null!=A&&A,samWasmUrl:I,uiCustomisation:{placeholder:{documentPlaceholder:null!==(c=null==O?void 0:O.documentPlaceholder)&&void 0!==c?c:"id-rounded-rectangle-corners-front",customSVG:null==O?void 0:O.customSVG},instructions:{candidate_selection:null!==(f=null==R?void 0:R.candidate_selection)&&void 0!==f?f:"Hold still…",document_centering:null!==(h=null==R?void 0:R.document_centering)&&void 0!==h?h:"Center document",document_too_close:null!==(d=null==R?void 0:R.document_too_close)&&void 0!==d?d:"Move back",document_not_present:null!==(p=null==R?void 0:R.document_not_present)&&void 0!==p?p:"Scan document",document_too_far:null!==(g=null==R?void 0:R.document_too_far)&&void 0!==g?g:"Move closer",sharpness_too_low:null!==(m=null==R?void 0:R.sharpness_too_low)&&void 0!==m?m:"More light needed",brightness_too_low:null!==(v=null==R?void 0:R.brightness_too_low)&&void 0!==v?v:"More light needed",brightness_too_high:null!==(y=null==R?void 0:R.brightness_too_high)&&void 0!==y?y:"Less light needed",hotspots_present:null!==(_=null==R?void 0:R.hotspots_present)&&void 0!==_?_:"Avoid reflections"},loading:{text:null!==(b=null==V?void 0:V.text)&&void 0!==b?b:"Loading. Please wait."},colors:M}};r(D)}),[t]),n?d(Zn.Provider,{value:{documentCameraOptions:n}},e):null},qn=bn.canvas`
- transform: ${e=>e.isImageMirror?"rotateY(180deg)":"none"};
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-`,Xn=bn.div`
- background-color: #00000060;
- color: #fff;
- font-size: 13px;
- width: 300px;
- padding: 10px;
- z-index: 1;
- word-break: break-word;
- position: absolute;
- top: 0;
-`,Jn=(e,t,n)=>{const r=e.getContext("2d");if(!r)return;const{shiftX:i,shiftY:o,width:a,height:s}=t;r.beginPath(),r.strokeStyle=n,r.moveTo(i*e.width,o*e.height),r.lineTo((i+a)*e.width,o*e.height),r.lineTo((i+a)*e.width,(o+s)*e.height),r.lineTo(i*e.width,(o+s)*e.height),r.closePath(),r.stroke()},Kn=({detectionDetails:e,isImageMirror:t,cameraResolution:n})=>{const{documentCameraOptions:{thresholds:r}}=Gn(),[i,o]=ie(null),a=le(null);return ae((()=>{if(!a.current)return;a.current.width=n.width,a.current.height=n.height;const t=Bn(e,n);o(t);const i=jn(n),s=function(e,t){const n=jn(e);return{shiftX:n.shiftX+n.width*t,shiftY:n.shiftY+n.height*t,width:n.width-n.width*t*2,height:n.height-n.height*t*2}}(n,r.outOfBoundsThreshold);Mn(a.current),((e,t)=>{const n=e.getContext("2d");if(!n||!t)return;const{topLeft:r,topRight:i,bottomRight:o,bottomLeft:a}=t;n.beginPath(),n.strokeStyle="red",n.moveTo(r.x,r.y),n.lineTo(i.x,i.y),n.lineTo(o.x,o.y),n.lineTo(a.x,a.y),n.closePath(),n.stroke()})(a.current,t.document),Jn(a.current,i,"green"),Jn(a.current,s,"yellow")}),[e,r]),d("div",null,d(qn,{ref:a,isImageMirror:t}),d(Xn,null,i&&Object.entries(An(i)).map((([e,t])=>d("div",{key:e},`${e}: ${JSON.stringify(t)}`)))))},Qn=(e,t)=>Math.hypot(t.x-e.x,t.y-e.y),er=(e,t,n)=>{const r=(t.x-e.x)*n,i=(t.y-e.y)*n;return{x:e.x+r,y:e.y+i}},tr=(e,t,n,r)=>n*r/Qn(e,t),nr=e=>{if(e.length<1)return 0;return e.reduce(((e,t)=>e+t),0)/e.length},rr=({detectionDetails:e,isImageMirror:t,cameraResolution:n})=>{const r=le(null),{documentCameraOptions:{thresholds:i}}=Gn(),o=ce(gn),a=(e,t,n,i)=>{const a=tr(t,e,i,.24),s=tr(t,n,i,.24),l=er(t,e,a),u=er(t,n,s),c=r.current.getContext("2d");c&&(c.beginPath(),c.lineWidth=2,c.strokeStyle=o.colors.placeholderColor,c.moveTo(l.x,l.y),c.arcTo(t.x,t.y,u.x,u.y,24),c.lineTo(u.x,u.y),c.stroke())},s=e=>{const{topLeft:t,topRight:n,bottomLeft:r,bottomRight:i}=e,o=(e=>{const{topLeft:t,bottomLeft:n,topRight:r,bottomRight:i}=e,o=Qn(t,r),a=Qn(r,i),s=Qn(n,i),l=Qn(t,n);return Math.min(o,a,s,l)})(e);a(r,t,n,o),a(t,n,i,o),a(n,i,r,o),a(i,r,t,o)};return ae((()=>{if(!r.current)return;if(r.current.width=n.width,r.current.height=n.height,Mn(r.current),e.document.confidence"videoinput"===e.kind)),e}async initWebcam(e={}){const t=await this.getBestCamera(e.facingMode),n=this.getConstraints(e,t);await this.startWebcam(n),function(){const e=navigator.userAgent.includes("Chrome"),t=new RegExp(/Version\/15.* Safari/).test(navigator.userAgent);return(!e||!t)&&t}()&&await this.startWebcam(n)}async startWebcam(e={}){var t;return this.stopCamera(),this.mediaStream=await navigator.mediaDevices.getUserMedia(e),this.videoRef.srcObject=this.mediaStream,await this.videoRef.play(),this.videoTrack=null===(t=this.mediaStream)||void 0===t?void 0:t.getVideoTracks()[0],this.checkVideoTrackSettings(),this.videoTrack}checkVideoTrackSettings(){var e;const t=null===(e=this.videoTrack)||void 0===e?void 0:e.getSettings();if(null==t||!t.height||null==t||!t.width)throw new ir("Could not init camera settings");if(t.widthe.label.includes("back")&&e.label.includes("0")))}}getConstraints(e,t){return{video:{...ar,...e,deviceId:t?{exact:t.deviceId}:void 0},audio:!1}}takePhoto(){var e;const t=null===(e=this.videoTrack)||void 0===e?void 0:e.getSettings();if(null==t||!t.width)throw new ir("Cant take photo - video width is undefined");if(null==t||!t.height)throw new ir("Cant take photo - video height is undefined");const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const r=n.getContext("2d");if(!r)throw new ir("Cant take photo - cant create context");return r.drawImage(this.videoRef,0,0),n}getCameraResolution(){var e;const t=null===(e=this.videoTrack)||void 0===e?void 0:e.getSettings();if(null==t||!t.width)throw new ir("Video width is undefined");if(null==t||!t.height)throw new ir("Video height is undefined");return{width:t.width,height:t.height}}getCameraSettings(){if(!this.videoTrack)throw Error("Video track must be initialized to get settings");return this.videoTrack.getSettings()}async getDeviceName(){if(!this.videoTrack)throw Error("Video track must be initialized to get device name");const e=this.videoTrack.getSettings(),t=(await navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===e.deviceId));return null==t?void 0:t.label}async applyNewConstraints(e){if(!this.videoTrack)throw Error("Video track must be initialized to set new constraints");await this.videoTrack.applyConstraints(e)}async switchCamera(){var e;if(!this.videoTrack)throw Error("Video track must be initialized to set new constraints");const t=this.videoTrack.getConstraints(),n=this.videoTrack.getSettings();let r=await navigator.mediaDevices.enumerateDevices();if(r=r.filter((e=>"videoinput"===e.kind)),r.length<=1)return;const i=r.findIndex((e=>e.deviceId===n.deviceId)),o=null!==(e=r[i+1])&&void 0!==e?e:r[0],a=this.getConstraints(t,o);await this.startWebcam(a)}stopCamera(){if(!this.mediaStream)return;this.mediaStream.getTracks().forEach((e=>{e.stop()})),this.videoRef.srcObject=null}checkIfStreamIsRunning(){return!!this.videoRef.srcObject}}var lr=n(994),ur=n.n(lr);const cr=new class{getOverriddenModules(e){return{locateFile:t=>e||t}}async initSamModule(e){this.samWasmModule||(this.samWasmModule=await ur()(this.getOverriddenModules(e)))}parseRawDocumentData(e,t){const{brightness:n,hotspots:r,sharpness:i}=e.params;return{confidence:e.score/1e3,topLeft:{x:e.x0/t.width,y:e.y0/t.height},topRight:{x:e.x1/t.width,y:e.y1/t.height},bottomRight:{x:e.x2/t.width,y:e.y2/t.height},bottomLeft:{x:e.x3/t.width,y:e.y3/t.height},brightness:n,hotspots:r,sharpness:i}}async detectDocument(e){if(null==this.samWasmModule)throw new ir("SAM WASM module is not initialized");const t=function(e){const t=e.getContext("2d");if(!t)throw new Error("getImageDataForSam ctx error");return t.getImageData(0,0,e.width,e.height).data}(e),n=this.samWasmModule.detectDocumentWithImageParameters(e.width,e.height,t,0,0);return this.parseRawDocumentData(n,e)}},fr=(e,t)=>{const{topLeft:n,bottomLeft:r,topRight:i,bottomRight:o}=e,a=Qn(n,i)*t.width,s=Qn(i,o)*t.height,l=Qn(r,o)*t.width,u=Qn(n,r)*t.height;return Math.min(a,s,l,u)/t.width},hr=e=>e<0?-10*e:e,dr=(e,t)=>{const n=function(e,t){const n=$n(e,{x:t.shiftX,y:t.shiftY}).toDetectionPercent(),r=jn(e);return{shiftX:n.x,shiftY:n.y,width:t.width/r.width,height:t.height/r.height}}(t,Wn(t)),r=n.shiftY,i=n.shiftY+n.height,o=n.shiftX,a=n.shiftX+n.width;let s=0;return s+=2*Math.abs(e.topLeft.x-e.bottomLeft.x)+2*Math.abs(e.topRight.x-e.bottomRight.x),s+=Cn*hr(e.topLeft.x-o),s+=Cn*hr(e.bottomLeft.x-o),s+=Cn*hr(a-e.topRight.x),s+=Cn*hr(a-e.bottomRight.x),s+=2*Math.abs(e.topLeft.y-e.topRight.y)+2*Math.abs(e.bottomLeft.y-e.bottomRight.y),s+=hr(e.topLeft.y-r),s+=hr(e.topRight.y-r),s+=hr(i-e.bottomLeft.y),s+=hr(i-e.bottomRight.y),s/=16,s};function pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gr=class{constructor(e,t){pr(this,"isDetectorInitialized",!1),pr(this,"isInCandidateSelection",!1),pr(this,"lastImage",null),pr(this,"bestImage",null),pr(this,"record",[]),pr(this,"getInstructionCode",((e,t)=>{var n;return this.isInCandidateSelection||null!==(n=this.lastImage)&&void 0!==n&&n.isValid&&t?"candidate_selection":this.lastImage&&t?this.lastImage.instructionCode:e.isPresent?("strict"!==this.validationMode||e.doesFit)&&e.isNotOutOfBounds?e.isNotSmall?e.isSharp?e.isNotDim?e.isNotBright?e.noHotspots?"document_not_present":"hotspots_present":"brightness_too_high":"brightness_too_low":"sharpness_too_low":"document_too_far":"document_centering":"document_not_present"})),this.CONFIDENCE_THRESHOLD=e.confidenceThreshold,this.PLACEHOLDER_ERROR_SCORE_THRESHOLD=e.placeholderErrorScoreThreshold,this.SHARPNESS_THRESHOLD=e.sharpnessThreshold,this.BRIGHTNESS_LOW_THRESHOLD=e.brightnessLowThreshold,this.BRIGHTNESS_HIGH_THRESHOLD=e.brightnessHighThreshold,this.HOTSPOTS_SCORE_THRESHOLD=e.hotspotsScoreThreshold,this.OUT_OF_BOUNDS_THRESHOLD=e.outOfBoundsThreshold,this.SIZE_SMALL_THRESHOLD=e.sizeSmallThreshold,this.validationMode=t}async initDocumentDetector(e){await cr.initSamModule(e),this.isDetectorInitialized=!0}getBestImage(){return this.bestImage}getRecord(){return this.record}isNewImageBetter(e,t){return t.sharpness>e.sharpness}restart(){this.isInCandidateSelection=!1,this.lastImage=null,this.bestImage=null}validateDetectedDocument(e){const t=e.confidence>this.CONFIDENCE_THRESHOLD,n=e.placeholderFitErrorthis.SHARPNESS_THRESHOLD,i=e.brightness>this.BRIGHTNESS_LOW_THRESHOLD,o=e.brightnessthis.SIZE_SMALL_THRESHOLD;return{isPresent:t,doesFit:n,isSharp:r,isNotDim:i,isNotBright:o,noHotspots:a,isNotOutOfBounds:((e,t)=>{const{topLeft:n,bottomLeft:r,topRight:i,bottomRight:o}=t;return!(n.x1-e||o.x>1-e||i.y1-e||r.y>1-e)})(this.OUT_OF_BOUNDS_THRESHOLD,e),isNotSmall:s}}checkIfDetectedDocumentIsValid(e){const t=e.isPresent&&e.isSharp&&e.isNotDim&&e.isNotBright&&e.noHotspots&&e.isNotOutOfBounds&&e.isNotSmall;return"strict"===this.validationMode?t&&e.doesFit:t}async processImage(e){const t={width:e.width,height:e.height},n=function(e,t){const n=document.createElement("canvas");n.width=t.width*e.width,n.height=t.height*e.height;const r=n.getContext("2d");if(!r)throw new Error("cropImage ctx error");return r.drawImage(e,t.shiftX*e.width,t.shiftY*e.height,t.width*e.width,t.height*e.height,0,0,n.width,n.height),n}(e,jn(t)),r={width:n.width,height:n.height},i=((e,t,n)=>{const r=dr(e,t),i=fr(e,n);return{...e,placeholderFitError:r,smallestEdge:i}})(await cr.detectDocument(n),t,r),o=this.validateDetectedDocument(i),a=this.checkIfDetectedDocumentIsValid(o),s=this.getInstructionCode(o,a);var l;this.isInCandidateSelection?this.bestImage&&a&&this.isNewImageBetter(this.bestImage.detection,i)&&(this.bestImage={image:n,detection:An(i)}):null!==(l=this.lastImage)&&void 0!==l&&l.isValid&&a?(this.bestImage={image:n,detection:An(i)},this.isInCandidateSelection=!0):this.lastImage=a?{instructionCode:s,isValid:!0}:{instructionCode:s,isValid:!1};const u={detectedDocument:An(i),instructionCode:s,isInCandidateSelection:this.isInCandidateSelection};return this.record.push(u.detectedDocument),u}},mr=bn.div`
- width: 100%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
-`,vr=bn.div`
- position: relative;
- isolation: isolate; // To create stacking context
- overflow: hidden;
- width: ${e=>e.wrapperWidth?e.wrapperWidth:0}px;
- height: ${e=>e.wrapperHeight?e.wrapperHeight:0}px;
-`,yr=bn.video`
- transform: ${e=>e.isImageMirror?"rotateY(180deg)":"none"};
- display: block;
- width: 100%;
-`,_r=bn.div`
- position: absolute;
- top: ${e=>100*e.placeholderRect.shiftY}%;
- bottom: ${e=>100*(1-e.placeholderRect.shiftY-e.placeholderRect.height)}%;
- left: ${e=>100*e.placeholderRect.shiftX}%;
- right: ${e=>100*(1-e.placeholderRect.shiftX-e.placeholderRect.width)}%;
- color: ${e=>e.isInCandidateSelection?`${e.theme.colors.placeholderColorSuccess}`:`${e.theme.colors.placeholderColor}`};
-
- svg {
- width: 100%;
- height: 100%;
- }
-`,br=bn.div`
- position: absolute;
- top: 0;
- right: 0;
- padding: 24px;
- z-index: 2;
-`,wr=bn.button`
- background: none;
- border: none;
- padding: 0;
- cursor: pointer;
- margin-right: ${e=>e.marginRight?"24px":"0"};
-
- &:disabled {
- cursor: not-allowed;
- }
-`,Cr=bn.div`
- position: absolute;
- ${e=>e.cssTop?`top: ${e.cssTop}%;`:""}
- ${e=>e.cssBottom?`bottom: ${e.cssBottom}%;`:""}
- left: 50%;
- transform: translateX(-50%)
- translateY(
- ${e=>e.cssTop||e.isPortrait?"-50%":e.isPortrait?"":"50%"}
- );
- z-index: 2;
-`;function Lr(e){const[t,n]=ie(14);return ae((()=>{function t(){var t;const r=null===(t=e.current)||void 0===t?void 0:t.getBoundingClientRect(),i=null==(o=r)?14:o.width{window.removeEventListener("resize",t)}}),[e]),t}const Sr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{opacity:"0.1",width:"163",height:"104",rx:"4",fill:"white"}),d("path",{d:"M138.294 1H160C161.105 1 162 1.89543 162 3V24.5385M24.7055 1H3C1.89543 1 1 1.89543 1 3V24.5385M1 79.4615V101C1 102.105 1.89543 103 3 103H24.7055M162 79.4615V101C162 102.105 161.105 103 160 103H138.294",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round"})),kr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"161",height:"102",rx:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeDasharray:"8 8"})),xr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"161",height:"102",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeDasharray:"1 10 1 10"})),Ar=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"161",height:"102",rx:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),Er=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{opacity:"0.1",width:"163",height:"104",rx:"16",fill:"white"}),d("path",{d:"M138 1H146C154.837 1 162 8.16344 162 17V25M25 1H17C8.16344 1 1 8.16344 1 17V25M1 79V87C1 95.8366 8.16344 103 17 103H25M162 79V87C162 95.8366 154.837 103 146 103H138",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),d("rect",{x:"11",y:"24",width:"48",height:"58",rx:"4",stroke:"currentColor"})),Ir=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{opacity:"0.1",width:"163",height:"104",rx:"16",fill:"white"}),d("path",{d:"M138 1H146C154.837 1 162 8.16344 162 17V25M25 1H17C8.16344 1 1 8.16344 1 17V25M1 79V87C1 95.8366 8.16344 103 17 103H25M162 79V87C162 95.8366 154.837 103 146 103H138",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),Tr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"161",height:"102",rx:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeDasharray:"16 16"})),Or=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{x:"1",y:"1",width:"161",height:"102",rx:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"square",strokeDasharray:"1 10 1 10"})),Rr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{opacity:"0.1",width:"163",height:"104",rx:"16",fill:"white"}),d("rect",{x:"1",y:"1",width:"161",height:"102",rx:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),d("path",{d:"M1 64H161.5",stroke:"currentColor",strokeWidth:"2"})),Mr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"104",viewBox:"0 0 163 104",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{opacity:"0.1",width:"163",height:"104",rx:"16",fill:"white"}),d("rect",{x:"1",y:"1",width:"161",height:"102",rx:"15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),Vr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"114",viewBox:"0 0 163 114",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M2 0.5H161C161.828 0.5 162.5 1.17157 162.5 2V110C162.5 111.933 160.933 113.5 159 113.5H4C2.067 113.5 0.5 111.933 0.5 110V2C0.5 1.17157 1.17157 0.5 2 0.5Z",stroke:"currentColor",strokeLinecap:"round"}),d("g",{filter:"url(#filter0_d)"},d("path",{d:"M12.5813 95.8096V95.0156L10.9829 94.4795L10.7846 94.4092L10.9829 94.3359L12.5813 93.791V93L10 94.0752V94.7344L12.5813 95.8096Z",fill:"currentColor"}),d("path",{d:"M17.4233 95.8096V95.0156L15.825 94.4795L15.6266 94.4092L15.825 94.3359L17.4233 93.791V93L14.842 94.0752V94.7344L17.4233 95.8096Z",fill:"currentColor"}),d("path",{d:"M22.2654 95.8096V95.0156L20.667 94.4795L20.4687 94.4092L20.667 94.3359L22.2654 93.791V93L19.684 94.0752V94.7344L22.2654 95.8096Z",fill:"currentColor"}),d("path",{d:"M27.1074 95.8096V95.0156L25.509 94.4795L25.3107 94.4092L25.509 94.3359L27.1074 93.791V93L24.5261 94.0752V94.7344L27.1074 95.8096Z",fill:"currentColor"}),d("path",{d:"M31.9494 95.8096V95.0156L30.351 94.4795L30.1527 94.4092L30.351 94.3359L31.9494 93.791V93L29.3681 94.0752V94.7344L31.9494 95.8096Z",fill:"currentColor"}),d("path",{d:"M36.7914 95.8096V95.0156L35.1931 94.4795L34.9947 94.4092L35.1931 94.3359L36.7914 93.791V93L34.2101 94.0752V94.7344L36.7914 95.8096Z",fill:"currentColor"}),d("path",{d:"M41.6335 95.8096V95.0156L40.0351 94.4795L39.8367 94.4092L40.0351 94.3359L41.6335 93.791V93L39.0521 94.0752V94.7344L41.6335 95.8096Z",fill:"currentColor"}),d("path",{d:"M46.4755 95.8096V95.0156L44.8771 94.4795L44.6788 94.4092L44.8771 94.3359L46.4755 93.791V93L43.8942 94.0752V94.7344L46.4755 95.8096Z",fill:"currentColor"}),d("path",{d:"M51.3175 95.8096V95.0156L49.7191 94.4795L49.5208 94.4092L49.7191 94.3359L51.3175 93.791V93L48.7362 94.0752V94.7344L51.3175 95.8096Z",fill:"currentColor"}),d("path",{d:"M56.1595 95.8096V95.0156L54.5612 94.4795L54.3628 94.4092L54.5612 94.3359L56.1595 93.791V93L53.5782 94.0752V94.7344L56.1595 95.8096Z",fill:"currentColor"}),d("path",{d:"M61.0016 95.8096V95.0156L59.4032 94.4795L59.2048 94.4092L59.4032 94.3359L61.0016 93.791V93L58.4202 94.0752V94.7344L61.0016 95.8096Z",fill:"currentColor"}),d("path",{d:"M65.8436 95.8096V95.0156L64.2452 94.4795L64.0469 94.4092L64.2452 94.3359L65.8436 93.791V93L63.2623 94.0752V94.7344L65.8436 95.8096Z",fill:"currentColor"}),d("path",{d:"M70.6856 95.8096V95.0156L69.0872 94.4795L68.8889 94.4092L69.0872 94.3359L70.6856 93.791V93L68.1043 94.0752V94.7344L70.6856 95.8096Z",fill:"currentColor"}),d("path",{d:"M75.5276 95.8096V95.0156L73.9293 94.4795L73.7309 94.4092L73.9293 94.3359L75.5276 93.791V93L72.9463 94.0752V94.7344L75.5276 95.8096Z",fill:"currentColor"}),d("path",{d:"M80.3697 95.8096V95.0156L78.7713 94.4795L78.5729 94.4092L78.7713 94.3359L80.3697 93.791V93L77.7883 94.0752V94.7344L80.3697 95.8096Z",fill:"currentColor"}),d("path",{d:"M85.2117 95.8096V95.0156L83.6133 94.4795L83.415 94.4092L83.6133 94.3359L85.2117 93.791V93L82.6304 94.0752V94.7344L85.2117 95.8096Z",fill:"currentColor"}),d("path",{d:"M90.0537 95.8096V95.0156L88.4553 94.4795L88.257 94.4092L88.4553 94.3359L90.0537 93.791V93L87.4724 94.0752V94.7344L90.0537 95.8096Z",fill:"currentColor"}),d("path",{d:"M94.8957 95.8096V95.0156L93.2973 94.4795L93.099 94.4092L93.2973 94.3359L94.8957 93.791V93L92.3144 94.0752V94.7344L94.8957 95.8096Z",fill:"currentColor"}),d("path",{d:"M99.7377 95.8096V95.0156L98.1394 94.4795L97.941 94.4092L98.1394 94.3359L99.7377 93.791V93L97.1564 94.0752V94.7344L99.7377 95.8096Z",fill:"currentColor"}),d("path",{d:"M104.58 95.8096V95.0156L102.981 94.4795L102.783 94.4092L102.981 94.3359L104.58 93.791V93L101.998 94.0752V94.7344L104.58 95.8096Z",fill:"currentColor"}),d("path",{d:"M109.422 95.8096V95.0156L107.823 94.4795L107.625 94.4092L107.823 94.3359L109.422 93.791V93L106.84 94.0752V94.7344L109.422 95.8096Z",fill:"currentColor"}),d("path",{d:"M114.264 95.8096V95.0156L112.665 94.4795L112.467 94.4092L112.665 94.3359L114.264 93.791V93L111.683 94.0752V94.7344L114.264 95.8096Z",fill:"currentColor"}),d("path",{d:"M119.106 95.8096V95.0156L117.507 94.4795L117.309 94.4092L117.507 94.3359L119.106 93.791V93L116.525 94.0752V94.7344L119.106 95.8096Z",fill:"currentColor"}),d("path",{d:"M123.948 95.8096V95.0156L122.349 94.4795L122.151 94.4092L122.349 94.3359L123.948 93.791V93L121.367 94.0752V94.7344L123.948 95.8096Z",fill:"currentColor"}),d("path",{d:"M128.79 95.8096V95.0156L127.192 94.4795L126.993 94.4092L127.192 94.3359L128.79 93.791V93L126.209 94.0752V94.7344L128.79 95.8096Z",fill:"currentColor"}),d("path",{d:"M133.632 95.8096V95.0156L132.034 94.4795L131.835 94.4092L132.034 94.3359L133.632 93.791V93L131.051 94.0752V94.7344L133.632 95.8096Z",fill:"currentColor"}),d("path",{d:"M138.474 95.8096V95.0156L136.876 94.4795L136.677 94.4092L136.876 94.3359L138.474 93.791V93L135.893 94.0752V94.7344L138.474 95.8096Z",fill:"currentColor"}),d("path",{d:"M143.316 95.8096V95.0156L141.718 94.4795L141.519 94.4092L141.718 94.3359L143.316 93.791V93L140.735 94.0752V94.7344L143.316 95.8096Z",fill:"currentColor"}),d("path",{d:"M148.158 95.8096V95.0156L146.56 94.4795L146.361 94.4092L146.56 94.3359L148.158 93.791V93L145.577 94.0752V94.7344L148.158 95.8096Z",fill:"currentColor"}),d("path",{d:"M153 95.8096V95.0156L151.402 94.4795L151.203 94.4092L151.402 94.3359L153 93.791V93L150.419 94.0752V94.7344L153 95.8096Z",fill:"currentColor"}),d("path",{d:"M12.5813 103.81V103.016L10.9829 102.479L10.7846 102.409L10.9829 102.336L12.5813 101.791V101L10 102.075V102.734L12.5813 103.81Z",fill:"currentColor"}),d("path",{d:"M17.4233 103.81V103.016L15.825 102.479L15.6266 102.409L15.825 102.336L17.4233 101.791V101L14.842 102.075V102.734L17.4233 103.81Z",fill:"currentColor"}),d("path",{d:"M22.2654 103.81V103.016L20.667 102.479L20.4687 102.409L20.667 102.336L22.2654 101.791V101L19.684 102.075V102.734L22.2654 103.81Z",fill:"currentColor"}),d("path",{d:"M27.1074 103.81V103.016L25.509 102.479L25.3107 102.409L25.509 102.336L27.1074 101.791V101L24.5261 102.075V102.734L27.1074 103.81Z",fill:"currentColor"}),d("path",{d:"M31.9494 103.81V103.016L30.351 102.479L30.1527 102.409L30.351 102.336L31.9494 101.791V101L29.3681 102.075V102.734L31.9494 103.81Z",fill:"currentColor"}),d("path",{d:"M36.7914 103.81V103.016L35.1931 102.479L34.9947 102.409L35.1931 102.336L36.7914 101.791V101L34.2101 102.075V102.734L36.7914 103.81Z",fill:"currentColor"}),d("path",{d:"M41.6335 103.81V103.016L40.0351 102.479L39.8367 102.409L40.0351 102.336L41.6335 101.791V101L39.0521 102.075V102.734L41.6335 103.81Z",fill:"currentColor"}),d("path",{d:"M46.4755 103.81V103.016L44.8771 102.479L44.6788 102.409L44.8771 102.336L46.4755 101.791V101L43.8942 102.075V102.734L46.4755 103.81Z",fill:"currentColor"}),d("path",{d:"M51.3175 103.81V103.016L49.7191 102.479L49.5208 102.409L49.7191 102.336L51.3175 101.791V101L48.7362 102.075V102.734L51.3175 103.81Z",fill:"currentColor"}),d("path",{d:"M56.1595 103.81V103.016L54.5612 102.479L54.3628 102.409L54.5612 102.336L56.1595 101.791V101L53.5782 102.075V102.734L56.1595 103.81Z",fill:"currentColor"}),d("path",{d:"M61.0016 103.81V103.016L59.4032 102.479L59.2048 102.409L59.4032 102.336L61.0016 101.791V101L58.4202 102.075V102.734L61.0016 103.81Z",fill:"currentColor"}),d("path",{d:"M65.8436 103.81V103.016L64.2452 102.479L64.0469 102.409L64.2452 102.336L65.8436 101.791V101L63.2623 102.075V102.734L65.8436 103.81Z",fill:"currentColor"}),d("path",{d:"M70.6856 103.81V103.016L69.0872 102.479L68.8889 102.409L69.0872 102.336L70.6856 101.791V101L68.1043 102.075V102.734L70.6856 103.81Z",fill:"currentColor"}),d("path",{d:"M75.5276 103.81V103.016L73.9293 102.479L73.7309 102.409L73.9293 102.336L75.5276 101.791V101L72.9463 102.075V102.734L75.5276 103.81Z",fill:"currentColor"}),d("path",{d:"M80.3697 103.81V103.016L78.7713 102.479L78.5729 102.409L78.7713 102.336L80.3697 101.791V101L77.7883 102.075V102.734L80.3697 103.81Z",fill:"currentColor"}),d("path",{d:"M85.2117 103.81V103.016L83.6133 102.479L83.415 102.409L83.6133 102.336L85.2117 101.791V101L82.6304 102.075V102.734L85.2117 103.81Z",fill:"currentColor"}),d("path",{d:"M90.0537 103.81V103.016L88.4553 102.479L88.257 102.409L88.4553 102.336L90.0537 101.791V101L87.4724 102.075V102.734L90.0537 103.81Z",fill:"currentColor"}),d("path",{d:"M94.8957 103.81V103.016L93.2973 102.479L93.099 102.409L93.2973 102.336L94.8957 101.791V101L92.3144 102.075V102.734L94.8957 103.81Z",fill:"currentColor"}),d("path",{d:"M99.7377 103.81V103.016L98.1394 102.479L97.941 102.409L98.1394 102.336L99.7377 101.791V101L97.1564 102.075V102.734L99.7377 103.81Z",fill:"currentColor"}),d("path",{d:"M104.58 103.81V103.016L102.981 102.479L102.783 102.409L102.981 102.336L104.58 101.791V101L101.998 102.075V102.734L104.58 103.81Z",fill:"currentColor"}),d("path",{d:"M109.422 103.81V103.016L107.823 102.479L107.625 102.409L107.823 102.336L109.422 101.791V101L106.84 102.075V102.734L109.422 103.81Z",fill:"currentColor"}),d("path",{d:"M114.264 103.81V103.016L112.665 102.479L112.467 102.409L112.665 102.336L114.264 101.791V101L111.683 102.075V102.734L114.264 103.81Z",fill:"currentColor"}),d("path",{d:"M119.106 103.81V103.016L117.507 102.479L117.309 102.409L117.507 102.336L119.106 101.791V101L116.525 102.075V102.734L119.106 103.81Z",fill:"currentColor"}),d("path",{d:"M123.948 103.81V103.016L122.349 102.479L122.151 102.409L122.349 102.336L123.948 101.791V101L121.367 102.075V102.734L123.948 103.81Z",fill:"currentColor"}),d("path",{d:"M128.79 103.81V103.016L127.192 102.479L126.993 102.409L127.192 102.336L128.79 101.791V101L126.209 102.075V102.734L128.79 103.81Z",fill:"currentColor"}),d("path",{d:"M133.632 103.81V103.016L132.034 102.479L131.835 102.409L132.034 102.336L133.632 101.791V101L131.051 102.075V102.734L133.632 103.81Z",fill:"currentColor"}),d("path",{d:"M138.474 103.81V103.016L136.876 102.479L136.677 102.409L136.876 102.336L138.474 101.791V101L135.893 102.075V102.734L138.474 103.81Z",fill:"currentColor"}),d("path",{d:"M143.316 103.81V103.016L141.718 102.479L141.519 102.409L141.718 102.336L143.316 101.791V101L140.735 102.075V102.734L143.316 103.81Z",fill:"currentColor"}),d("path",{d:"M148.158 103.81V103.016L146.56 102.479L146.361 102.409L146.56 102.336L148.158 101.791V101L145.577 102.075V102.734L148.158 103.81Z",fill:"currentColor"}),d("path",{d:"M153 103.81V103.016L151.402 102.479L151.203 102.409L151.402 102.336L153 101.791V101L150.419 102.075V102.734L153 103.81Z",fill:"currentColor"})),d("path",{d:"M1 85H162",stroke:"currentColor"}),d("defs",null,d("filter",{id:"filter0_d",x:"6",y:"93",width:"151",height:"18.8096",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},d("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),d("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),d("feOffset",{dy:"4"}),d("feGaussianBlur",{stdDeviation:"2"}),d("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.74902 0 0 0 0 0.698039 0 0 0 0.08 0"}),d("feBlend",{mode:"darken",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),d("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})))),Dr=()=>d("svg",{preserveAspectRatio:"none",width:"163",height:"114",viewBox:"0 0 163 114",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M2 0.5H161C161.828 0.5 162.5 1.17157 162.5 2V110C162.5 111.933 160.933 113.5 159 113.5H4C2.067 113.5 0.5 111.933 0.5 110V2C0.5 1.17157 1.17157 0.5 2 0.5Z",stroke:"currentColor",strokeLinecap:"round"}),d("path",{d:"M1 85H162",stroke:"currentColor"}),d("defs",null,d("filter",{id:"filter0_d",x:"6",y:"93",width:"151",height:"18.8096",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},d("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),d("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),d("feOffset",{dy:"4"}),d("feGaussianBlur",{stdDeviation:"2"}),d("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.74902 0 0 0 0 0.698039 0 0 0 0.08 0"}),d("feBlend",{mode:"darken",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),d("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})))),Pr=()=>{const{documentCameraOptions:{uiCustomisation:e}}=Gn();switch(e.placeholder.documentPlaceholder){case"id-rectangle-corners-front":return d(Sr,null);case"id-rectangle-dash-front":return d(kr,null);case"id-rectangle-dot-front":return d(xr,null);case"id-rectangle-solid-front":return d(Ar,null);case"id-rounded-rectangle-photo-front":return d(Er,null);case"id-rounded-rectangle-corners-front":return d(Ir,null);case"id-rounded-rectangle-dash-front":return d(Tr,null);case"id-rounded-rectangle-dot-front":return d(Or,null);case"id-rounded-rectangle-solid-back":return d(Rr,null);case"id-rounded-rectangle-solid-front":return d(Mr,null);case"pass-rounded-rectangle-solid-back":return d(Vr,null);case"pass-rounded-rectangle-solid-back-blank":return d(Dr,null);default:return d(Ir,null)}},Hr=F(void 0),Fr=({children:e,onError:t})=>{const[n,r]=ie(Un.LOADING),[i,o]=ie(void 0),a={appState:n,setAppState:r,error:i,handleError:e=>{t(e),r(Un.ERROR),o(e)}};return d(Hr.Provider,{value:a},e)},Nr=()=>{const e=ce(Hr);if(void 0===e)throw new Error("useAppStateContext must be used within a AppStateProvider");return e};let jr;!function(e){e.AUTO_CAPTURE="auto-capture"}(jr||(jr={}));const Wr={appKey:"",deviceId:"",async countlyFetch(e){if(!this.appKey||!this.deviceId)return;const t=En({app_key:this.appKey,device_id:this.deviceId});await fetch(`https://innovatrics.count.ly/i?${t}&${e}`,{method:"GET",headers:{Accept:"application/json"}})},async init(e,t){if(!t)return;this.appKey=t,this.deviceId=e;const n={_app_version:Ln},r={organization:(i=window.location.href,new URL(i).hostname.replace("www.",""))};var i;const o=En({begin_session:"1",metrics:JSON.stringify(n),user_details:JSON.stringify(r)});await this.countlyFetch(o)},async endSession(){const e=En({end_session:"1"});await this.countlyFetch(e)},async sendAutoCaptureEvent(e){const t=[{key:jr.AUTO_CAPTURE,count:1,dur:e.captureTime,segmentation:e}],n=En({events:JSON.stringify(t)});await this.countlyFetch(n)},async sendDocumentData({documentDetection:e,deviceName:t,...n}){if(e){const r={...n,hotspots:Tn(e.hotspots),brightness:Tn(e.brightness),confidence:Tn(e.confidence),sharpness:Tn(e.sharpness),smallestEdge:Tn(e.smallestEdge),camera:t,imageResolution:`${n.imageResolution.width}x${n.imageResolution.height}`,averageFps:On(n.averageFps),captureTime:In(n.captureProcessDurationInMs)};this.sendAutoCaptureEvent(r)}},async sendFaceData({faceDetection:e,deviceName:t,...n}){if(e){const i={...n,faceSize:(r=e.faceSize,10*Math.round(r/10)/1e3),confidence:Tn(e.confidence),camera:t,imageResolution:`${n.imageResolution.width}x${n.imageResolution.height}`,averageFps:On(n.averageFps),captureTime:In(n.captureProcessDurationInMs)};this.sendAutoCaptureEvent(i)}var r}},zr=()=>{const e=sessionStorage.getItem("dot-user-id");if(e)return e;{const e=window.crypto.getRandomValues(new Uint32Array(1))[0].toString(16);return sessionStorage.setItem("dot-user-id",e),e}},Br={init(e){const t=zr();Wr.init(t,e)},endSession(){Wr.endSession()},sendDocumentData(e){Wr.sendDocumentData(e)},sendFaceData(e){Wr.sendFaceData(e)}},$r=({parentRef:e,fontSize:t})=>{const{appState:n,setAppState:r,handleError:i}=Nr(),{documentCameraOptions:o}=Gn(),{uiCustomisation:a,samWasmUrl:s,thresholds:l,validationMode:u,cameraFacing:c,photoTakenCb:f,imageType:h,detectionLayerVisible:p}=o,g=le(null),[m,v]=ie(!1),[y,_]=ie(null),[b,w]=ie(null),[C,L]=ie(void 0),[S,k]=ie(null),[x,A]=ie(!1),[E,I]=ie(null),[T,O]=ie(null),[R,M]=ie(null),[V,D]=ie(null),P=le(null),H=function(e){const[t,n]=ie(!1);return ae((()=>{(async()=>{(await sr.getDeviceList()).length>1&&n(!0)})()}),[e]),t}(V),F=function(e,t){const[n,r]=ie(null);return ae((()=>{function n(){if(e&&null!=t&&t.current)if(e.width/e.height<(null==t?void 0:t.current.clientWidth)/(null==t?void 0:t.current.clientHeight)){const n=t.current.clientHeight/e.height;r({width:n*e.width,height:t.current.clientHeight})}else{const n=t.current.clientWidth/e.width;r({width:t.current.clientWidth,height:n*e.height})}}if(e)return n(),window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)}}),[null==e?void 0:e.width,null==e?void 0:e.height,t]),n}(R,e);ae((()=>(window.addEventListener("beforeunload",Br.endSession),()=>{Br.endSession(),window.removeEventListener("beforeunload",Br.endSession)})),[]),ae((()=>((async()=>{if(null==g||!g.current)return void i(new ir("Something went wrong during video initialization"));const e=new sr(g.current);try{await e.initWebcam({facingMode:c})}catch(e){if(e instanceof Error)return void i(ir.fromCameraError(e))}M(e.getCameraResolution()),O(e.getCameraSettings()),D(e),P.current=e})(),function(){P.current&&P.current.stopCamera()})),[]),ae((()=>{(async()=>{const e=new gr(l,u);try{await e.initDocumentDetector(s)}catch(e){return void i(new ir("Cannot init document detector"))}I(e)})()}),[l,u]),ae((()=>{null!=V&&V.videoTrack&&null!=E&&E.isDetectorInitialized&&r(Un.RUNNING)}),[null==V?void 0:V.videoTrack,null==E?void 0:E.isDetectorInitialized]);const N=async(e,t,n)=>{const r={width:e.width,height:e.height},i=`image/${h}`,o=await Rn(e,i,90);f(o,{cameraSettings:{...null==V?void 0:V.getCameraSettings(),deviceName:await(null==V?void 0:V.getDeviceName())},detection:t,imageResolution:r,record:x?n:void 0})};ae((()=>{if(n!==Un.RUNNING)return;if(!V||!E)throw new ir("Cannot start detection");let e=0,t=!1,o=0;const s=[];return(async()=>{const n=Date.now();for(;V.checkIfStreamIsRunning()&&!t;){if(e&&performance.now()-e>1e3){const{image:e,detection:t}=E.getBestImage()||{},o=E.getRecord();if(e){const i=Date.now();Br.sendDocumentData({documentDetection:t,imageResolution:{width:e.width,height:e.height},deviceName:await V.getDeviceName(),averageFps:nr(s),captureProcessDurationInMs:i-n}),N(e,t,o),r(Un.WAITING),v(!1),E.restart()}else i(new ir("Something went wrong during capturing an image"));return}const t=Date.now(),l=V.takePhoto(),u={width:l.width,height:l.height};let c;try{c=await E.processImage(l)}catch(e){return void(e instanceof Error&&i(ir.fromCameraError(e)))}const f=Date.now()-t,h=xn(1e3/f);s.push(h);const d={document:c.detectedDocument,detectionTime:f,fps:h,resolution:u,instructionCode:c.instructionCode};k(d),x&&console.log(d),c.isInCandidateSelection&&0===e&&(e=performance.now(),v(!0),L(a.instructions[c.instructionCode]));const p=performance.now();p-o>600&&(L(a.instructions[c.instructionCode]),o=p),M(u),await kn(Math.max(100-f,10))}})(),()=>{t=!0}}),[n,V,E,x,o]),ae((()=>{A(!!window.DOT_DEBUG_MODE)}),[window.DOT_DEBUG_MODE]),ae((()=>{R&&w(Wn(R))}),[null==R?void 0:R.width,null==R?void 0:R.height,e]);const j=ue((()=>null==(null==T?void 0:T.facingMode)?null!=y?y:!Sn():null!=y?y:"user"===T.facingMode),[T,y]);const W=e=>{var t;"continue-detection"===(null===(t=e.detail)||void 0===t?void 0:t.instruction)&&n===Un.WAITING&&r(Un.RUNNING)};return ae((()=>(document.addEventListener("document-auto-capture",W),()=>{document.removeEventListener("document-auto-capture",W)})),[n]),d(mr,null,d(vr,{wrapperWidth:null==F?void 0:F.width,wrapperHeight:null==F?void 0:F.height},d(yr,{ref:g,autoPlay:!0,muted:!0,playsInline:!0,isImageMirror:j}),x&&S&&R&&n===Un.RUNNING&&d(Kn,{detectionDetails:S,isImageMirror:j,cameraResolution:R}),p&&S&&R&&n===Un.RUNNING&&d(rr,{detectionDetails:S,isImageMirror:j,cameraResolution:R}),n===Un.RUNNING&&d(br,null,d(wr,{marginRight:H,onClick:function(){_(null==y?!j:!y)}},d(Hn,null)),H&&d(wr,{onClick:async function(){if(V){r(Un.LOADING);try{await V.switchCamera()}catch(e){if(e instanceof Error)return void i(ir.fromCameraError(e))}O(V.getCameraSettings()),_(null)}}},d(Pn,null))),n===Un.RUNNING&&b&&d(_r,{isInCandidateSelection:m,placeholderRect:b},d(Pr,null)),n===Un.RUNNING&&d(Cr,{cssTop:50},d(Dn,{instructionText:C,isInCandidateSelection:m,fontSize:t}))))};function Ur(){return(Ur=Object.assign||function(e){for(var t=1;t=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);var c=n-o/2;return r(s+c,l+c,u+c)}var ti={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var ni=/^#[a-fA-F0-9]{6}$/,ri=/^#[a-fA-F0-9]{8}$/,ii=/^#[a-fA-F0-9]{3}$/,oi=/^#[a-fA-F0-9]{4}$/,ai=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,si=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,li=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,ui=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function ci(e){if("string"!=typeof e)throw new Jr(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return ti[t]?"#"+ti[t]:e}(e);if(t.match(ni))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(ri)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(ii))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(oi)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=ai.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=si.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])};var a=li.exec(t);if(a){var s="rgb("+ei(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=ai.exec(s);if(!l)throw new Jr(4,t,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=ui.exec(t.substring(0,50));if(u){var c="rgb("+ei(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",f=ai.exec(c);if(!f)throw new Jr(4,t,c);return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10),alpha:parseFloat(""+u[4])}}throw new Jr(5)}function fi(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,o=Math.max(n,r,i),a=Math.min(n,r,i),s=(o+a)/2;if(o===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var l=o-a,u=s>.5?l/(2-o-a):l/(o+a);switch(o){case n:t=(r-i)/l+(r=1?mi(e,t,n):"rgba("+ei(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?mi(e.hue,e.saturation,e.lightness):"rgba("+ei(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new Jr(2)}function _i(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return hi("#"+di(e)+di(t)+di(n));if("object"==typeof e&&void 0===t&&void 0===n)return hi("#"+di(e.red)+di(e.green)+di(e.blue));throw new Jr(6)}function bi(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var i=ci(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?_i(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?_i(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Jr(7)}function wi(e){if("object"!=typeof e)throw new Jr(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return bi(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||"undefined"==typeof e.alpha)}(e))return _i(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return yi(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||"undefined"==typeof e.alpha)}(e))return vi(e);throw new Jr(8)}function Ci(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):Ci(e,t,r)}}function Li(e){return Ci(e,e.length,[])}function Si(e,t,n){return Math.max(e,Math.min(t,n))}function ki(e,t){if("transparent"===t)return t;var n=fi(t);return wi(Ur({},n,{lightness:Si(0,1,n.lightness-parseFloat(e))}))}const xi={primary:"#021B41",primaryHover:"#283D5D",primaryActive:"#415470",secondary:"#AACDEB",secondaryHover:"#C3DCF1",secondaryActive:"#D5E6F5",action:"#80DFD8",actionHover:"#6DBEB8",actionActive:"#60A7A2",error:"#FF0E00",warning:"#FFD616",success:"#11EE46",actionOnPrimary:"#214C67",primarySecondary:"#567496",white:"#FFF",white0:"#ffffff00",white15:"#ffffff26",white25:"#ffffff40",white30:"#ffffff4d",white50:"#ffffff80",placeholderColor:"white",placeholderColorSuccess:"#00BFB2",instructionColor:"#F8FBFB",instructionColorSuccess:"#00BFB2",instructionTextColor:"#021B41;"},Ai={colors:xi,colorStyles:{hover:{cyan:Li(ki)(.1,xi.secondary)}},lineHeights:{base:1.25},fontSizes:{base:16},textStyles:{s40heading:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"40px",lineHeight:"48px"},s26heading:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"26px",lineHeight:"30px"},s20heading:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"20px",lineHeight:"24px"},s20bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"16px",lineHeight:"24px","@media (min-height: 575px)":{fontSize:"20px",lineHeight:"30px"}},s20:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"16px",lineHeight:"24px","@media (min-height: 575px)":{fontSize:"20px",lineHeight:"30px"}},s18bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"18px",lineHeight:"27px"},s18:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"18px",lineHeight:"27px"},s16bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"14px",lineHeight:"20px","@media (min-height: 575px)":{fontSize:"16px",lineHeight:"24px"}},s16:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"14px",lineHeight:"20px","@media (min-height: 575px)":{fontSize:"16px",lineHeight:"24px"}},s14bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"14px",lineHeight:"21px"},s14:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"14px",lineHeight:"21px"},s12bold:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"12px",lineHeight:"18px"},s12:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"12px",lineHeight:"18px"},s12input:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:400,fontSize:"12px",lineHeight:"18px",textTransform:"uppercase",letterSpacing:"0.1em"},s13button:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"13px",lineHeight:"18px",textTransform:"uppercase",letterSpacing:"0.3em"},s11button:{fontFamily:"sans-serif",fontStyle:"normal",fontWeight:700,fontSize:"11px",lineHeight:"13px",textTransform:"uppercase",letterSpacing:"0.3em"}},transitions:{buttons:"ease-in-out 0.1s"},space:[0,5,10,15,20,30,40,50,60,70,80,90,100,110,120,130,140].map((e=>`${e}px`)),breakpoints:[960].map((e=>`${e}px`))},Ei=({svgSize:e})=>d("svg",{width:e,height:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.3062 13.5002H1.69384C0.932655 13.5002 0.450552 12.6837 0.818264 12.0172L7.12444 0.587236C7.5047 -0.101994 8.49533 -0.101996 8.87559 0.587234L15.1818 12.0172C15.5495 12.6837 15.0674 13.5002 14.3062 13.5002ZM8.00001 3.25025C8.41423 3.25025 8.75002 3.58604 8.75002 4.00025V8.50025C8.75002 8.91446 8.41423 9.25025 8.00001 9.25025C7.5858 9.25025 7.25001 8.91446 7.25001 8.50025V4.00025C7.25001 3.58604 7.5858 3.25025 8.00001 3.25025ZM8.75002 11.2502C8.75002 11.6645 8.41423 12.0002 8.00001 12.0002C7.5858 12.0002 7.25001 11.6645 7.25001 11.2502C7.25001 10.836 7.5858 10.5002 8.00001 10.5002C8.41423 10.5002 8.75002 10.836 8.75002 11.2502Z",fill:"currentColor"})),Ii=bn.div`
- color: ${e=>e.theme.colors.instructionTextColor};
- animation: spin 2s linear infinite;
-
- @keyframes spin {
- 100% {
- transform: rotate(-360deg);
- }
- }
-`,Ti=({svgSize:e})=>d(Ii,null,d("svg",{width:e,height:e,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M30.9229 9.75026C30.9229 12.3736 28.7533 14.5002 26.0767 14.5002C23.4003 14.5002 21.2307 12.3736 21.2307 9.75026C21.2307 7.12664 23.4003 5 26.0767 5C28.7533 5 30.9229 7.12664 30.9229 9.75026Z",fill:"currentColor"}),d("path",{d:"M40.6155 15.8556C40.6155 18.1044 38.7559 19.9273 36.4618 19.9273C34.1675 19.9273 32.3079 18.1044 32.3079 15.8556C32.3079 13.607 34.1675 11.7842 36.4618 11.7842C38.7559 11.7842 40.6155 13.607 40.6155 15.8556Z",fill:"currentColor"}),d("path",{d:"M42 27.3921C42 29.2659 40.4502 30.785 38.5386 30.785C36.6267 30.785 35.0769 29.2659 35.0769 27.3921C35.0769 25.5181 36.6267 23.999 38.5386 23.999C40.4502 23.999 42 25.5181 42 27.3921Z",fill:"currentColor"}),d("path",{d:"M35.0766 37.5712C35.0766 39.0704 33.837 40.2858 32.3075 40.2858C30.7779 40.2858 29.5383 39.0704 29.5383 37.5712C29.5383 36.0723 30.7779 34.8569 32.3075 34.8569C33.837 34.8569 35.0766 36.0723 35.0766 37.5712Z",fill:"currentColor"}),d("path",{d:"M22.6154 40.2858C22.6154 41.7848 21.3756 43.0001 19.846 43.0001C18.3168 43.0001 17.0769 41.7848 17.0769 40.2858C17.0769 38.7866 18.3168 37.5713 19.846 37.5713C21.3756 37.5713 22.6154 38.7866 22.6154 40.2858Z",fill:"currentColor"}),d("path",{d:"M11.5382 32.8216C11.5382 33.9457 10.6085 34.8573 9.46137 34.8573C8.31426 34.8573 7.38452 33.9457 7.38452 32.8216C7.38452 31.6972 8.31426 30.7856 9.46137 30.7856C10.6085 30.7856 11.5382 31.6972 11.5382 32.8216Z",fill:"currentColor"}),d("path",{d:"M8.76913 21.2849C8.76913 22.0345 8.14932 22.642 7.38456 22.642C6.6198 22.642 6 22.0345 6 21.2849C6 20.5353 6.61981 19.9277 7.38456 19.9277C8.14933 19.9277 8.76913 20.5353 8.76913 21.2849Z",fill:"currentColor"}),d("path",{d:"M15.6927 11.7844C15.6927 12.534 15.0729 13.1415 14.3081 13.1415C13.5434 13.1415 12.9236 12.534 12.9236 11.7844C12.9236 11.0348 13.5434 10.4272 14.3081 10.4272C15.0729 10.4272 15.6927 11.0348 15.6927 11.7844Z",fill:"currentColor"}))),Oi=bn.div`
- width: 100%;
- height: 100%;
- position: relative;
-`,Ri=bn.div`
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- text-align: center;
-`,Mi=bn.div`
- width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- color: ${e=>e.theme.colors.instructionTextColor};
-`,Vi=bn.p`
- background: ${e=>e.theme.colors.instructionColor};
- border-radius: 0.25em;
- padding: 0.583em 0.666em;
- margin: 0.8em 0;
- font-size: ${e=>`${e.fontSize}px`};
- font-family: Montserrat, Arial, sans-serif;
- font-style: normal;
- font-weight: 600;
- line-height: 1em;
- max-width: 80%;
-`,Di=({text:e,fontSize:t,currentAppState:n})=>d(Ri,null,d(Mi,null,(()=>{switch(n){case Un.LOADING:return d(Ti,{svgSize:2*t});case Un.ERROR:return d(Ei,{svgSize:2*t});default:return null}})(),d(Vi,{fontSize:t},e)));class Pi extends m{constructor(e){var t,n,r;super(e),r={error:null},(n="state")in(t=this)?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){this.setState({error:e});const t=new ir("An unknown error has occurred");this.context.setError(t),this.props.triggerOnError(t)}render(){return this.state.error||this.context.error?d(Di,{fontSize:this.props.fontSize,text:this.context.error.message,currentAppState:Un.ERROR}):this.props.children}}Pi.contextType=Hr;const Hi=Pi,Fi=()=>{const{documentCameraOptions:{uiCustomisation:e,onError:t}}=Gn(),{appState:n}=Nr(),r=le(null),i=Lr(r);return d(mn,{theme:(o=null==e?void 0:e.colors,{...Ai,colors:{...Ai.colors,...o}})},d(Oi,{ref:r},d(Hi,{triggerOnError:t,fontSize:i},d($r,{parentRef:r,fontSize:i}),n===Un.LOADING&&d(Di,{text:e.loading.text,fontSize:i,currentAppState:Un.LOADING}),n===Un.WAITING&&d(Di,{text:"Waiting for input",fontSize:i,currentAppState:Un.WAITING}))));var o};var Ni=n(62),ji=n.n(Ni),Wi=n(36),zi=n.n(Wi),Bi=n(793),$i=n.n(Bi),Ui=n(892),Zi=n.n(Ui),Gi=n(173),Yi=n.n(Gi),qi=n(464),Xi=n.n(qi),Ji=n(820),Ki={};Ki.styleTagTransform=Xi(),Ki.setAttributes=Zi(),Ki.insert=$i().bind(null,"head"),Ki.domAPI=zi(),Ki.insertStyleElement=Yi();ji()(Ji.Z,Ki);Ji.Z&&Ji.Z.locals&&Ji.Z.locals;!function(e,t,n,r){function i(){var t=Reflect.construct(HTMLElement,[],i);return t._vdomComponent=e,t._root=r&&r.shadow?t.attachShadow({mode:"open"}):t,t}(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=W,i.prototype.attributeChangedCallback=B,i.prototype.disconnectedCallback=$,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,n.forEach((function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,i)}((({cameraOptions:e})=>e?(ae((()=>{Br.init("065cf6e242fc5e785cd17eebfbfbbd212a33133b")}),[]),d(Yn,{cameraOptions:e},d(Fr,{onError:e.onError},d(Fi,null)))):null),"x-dot-document-auto-capture",["cameraOptions"])},820:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(601),i=n.n(r),o=n(609),a=n.n(o)()(i());a.push([e.id,"@import url(https://fonts.googleapis.com/css?family=Montserrat:600);"]),a.push([e.id,"\n",""]);const s=a},609:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r="undefined"!=typeof t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},601:e=>{"use strict";e.exports=function(e){return e[1]}},463:(e,t,n)=>{"use strict";var r=n(570),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=d(n);i&&i!==p&&e(t,i,r)}var a=c(n);f&&(a=a.concat(f(n)));for(var s=l(t),g=l(n),m=0;m{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,_=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case f:case o:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case u:case h:case m:case g:case l:return e;default:return t}}case i:return t}}}function C(e){return w(e)===f}t.AsyncMode=c,t.ConcurrentMode=f,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=h,t.Fragment=o,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=d,t.isAsyncMode=function(e){return C(e)||w(e)===c},t.isConcurrentMode=C,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===m},t.isMemo=function(e){return w(e)===g},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===s},t.isStrictMode=function(e){return w(e)===a},t.isSuspense=function(e){return w(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===f||e===s||e===a||e===d||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===u||e.$$typeof===h||e.$$typeof===y||e.$$typeof===_||e.$$typeof===b||e.$$typeof===v)},t.typeOf=w},570:(e,t,n)=>{"use strict";e.exports=n(866)},665:e=>{e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l{"use strict";var t=[];function n(e){for(var n=-1,r=0;r{"use strict";var t={};e.exports=function(e,n){var r=function(e){if("undefined"==typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},173:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},892:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},36:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i="undefined"!=typeof n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},464:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},994:e=>{var t,n=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var n,r,i;e=e||{},n||(n="undefined"!=typeof e?e:{}),n.ready=new Promise((function(e,t){r=e,i=t}));var o,a={};for(o in n)n.hasOwnProperty(o)&&(a[o]=n[o]);var s,l,u="./this.program";s="object"==typeof window,l="function"==typeof importScripts;var c,f="";(s||l)&&(l?f=self.location.href:document.currentScript&&(f=document.currentScript.src),t&&(f=t),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",l&&(c=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var h,d=n.print||console.log.bind(console),p=n.printErr||console.warn.bind(console);for(o in a)a.hasOwnProperty(o)&&(n[o]=a[o]);a=null,n.thisProgram&&(u=n.thisProgram),n.wasmBinary&&(h=n.wasmBinary),n.noExitRuntime&&n.noExitRuntime,"object"!=typeof WebAssembly&&Y("no native wasm support detected");var g,m=!1;function v(e){e||Y("Assertion failed: undefined")}var y="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function _(e,t,n){var r=t+n;for(n=t;e[n]&&!(n>=r);)++n;if(16(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&e[t++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function b(e,t,n,r){if(0=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),127>=o){if(n>=r)break;t[n++]=o}else{if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12}else{if(n+3>=r)break;t[n++]=240|o>>18,t[n++]=128|o>>12&63}t[n++]=128|o>>6&63}t[n++]=128|63&o}}t[n]=0}}function w(e){for(var t=0,n=0;n=r&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),127>=r?++t:t=2047>=r?t+2:65535>=r?t+3:t+4}return t}var C,L,S,k,x,A,E,I,T,O="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function R(e,t){for(var n=e>>1,r=n+t/2;!(n>=r)&&x[n];)++n;if(32<(n<<=1)-e&&O)return O.decode(S.subarray(e,n));for(n=0,r="";;){var i=k[e+2*n>>1];if(0==i||n==t/2)return r;++n,r+=String.fromCharCode(i)}}function M(e,t,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i>1]=e.charCodeAt(i),t+=2;return k[t>>1]=0,t-r}function V(e){return 2*e.length}function D(e,t){for(var n=0,r="";!(n>=t/4);){var i=A[e+4*n>>2];if(0==i)break;++n,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}return r}function P(e,t,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=t;n=r+n-4;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++i)),A[t>>2]=o,(t+=4)+4>n)break}return A[t>>2]=0,t-r}function H(e){for(var t=0,n=0;n=r&&++n,t+=4}return t}function F(e){C=e,n.HEAP8=L=new Int8Array(e),n.HEAP16=k=new Int16Array(e),n.HEAP32=A=new Int32Array(e),n.HEAPU8=S=new Uint8Array(e),n.HEAPU16=x=new Uint16Array(e),n.HEAPU32=E=new Uint32Array(e),n.HEAPF32=I=new Float32Array(e),n.HEAPF64=T=new Float64Array(e)}var N=n.INITIAL_MEMORY||16777216;(g=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:N/65536,maximum:32768}))&&(C=g.buffer),N=C.byteLength,F(C);var j=[],W=[],z=[],B=[];function $(){var e=n.preRun.shift();j.unshift(e)}var U=0,Z=null,G=null;function Y(e){throw n.onAbort&&n.onAbort(e),p(e),m=!0,e=new WebAssembly.RuntimeError("abort("+e+"). Build with -s ASSERTIONS=1 for more info."),i(e),e}function q(e){var t=J;return String.prototype.startsWith?t.startsWith(e):0===t.indexOf(e)}function X(){return q("data:application/octet-stream;base64,")}n.preloadedImages={},n.preloadedAudios={};var J="sam.wasm";if(!X()){var K=J;J=n.locateFile?n.locateFile(K,f):f+K}function Q(){try{if(h)return new Uint8Array(h);if(c)return c(J);throw"both async and sync fetching of the wasm failed"}catch(e){Y(e)}}function ee(e){for(;0>2]=e},this.Ua=function(e){A[this.ga+0>>2]=e},this.Va=function(){A[this.ga+4>>2]=0},this.Ta=function(){L[this.ga+12>>0]=0},this.Wa=function(){L[this.ga+13>>0]=0},this.Oa=function(e,t){this.Xa(e),this.Ua(t),this.Va(),this.Ta(),this.Wa()}}function re(){return 0=t?"_"+e:e}function fe(e,t){return e=ce(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function he(e){var t=Error,n=fe(e,(function(t){this.name=e,this.message=t,void 0!==(t=Error(t).stack)&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var de=void 0;function pe(e){throw new de(e)}var ge=void 0;function me(e){throw new ge(e)}function ve(e,t,n){function r(t){(t=n(t)).length!==e.length&&me("Mismatched type converter count");for(var r=0;r>2])}function He(e,t,n){return t===n?e:void 0===n.ma||null===(e=He(e,t,n.ma))?null:n.Ja(e)}var Fe={};function Ne(e,t){return t.ia&&t.ga||me("makeClassHandle requires ptr and ptrType"),!!t.la!=!!t.ka&&me("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Se(Object.create(e,{A:{value:t}}))}function je(e,t,n,r){this.name=e,this.ha=t,this.Da=n,this.xa=r,this.ya=!1,this.ra=this.Ra=this.Qa=this.Fa=this.Ya=this.Pa=void 0,void 0!==t.ma?this.toWireType=Ve:(this.toWireType=r?Me:De,this.oa=null)}function We(e,t,r){n.hasOwnProperty(e)||me("Replacing nonexistant public symbol"),void 0!==n[e].na&&void 0!==r?n[e].na[r]=t:(n[e]=t,n[e].Ha=r)}function ze(e,t){var n=te(e=ae(e),t);return"function"!=typeof n&&pe("unknown function pointer with signature "+e+": "+t),n}var Be=void 0;function $e(e){var t=ae(e=wt(e));return bt(e),t}function Ue(e,t){var n=[],r={};throw t.forEach((function e(t){r[t]||le[t]||(ue[t]?ue[t].forEach(e):(n.push(t),r[t]=!0))})),new Be(e+": "+n.map($e).join([", "]))}function Ze(e,t){for(var n=[],r=0;r>2)+r]);return n}function Ge(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Ye(e,t,n){return e instanceof Object||pe(n+' with invalid "this": '+e),e instanceof t.ha.constructor||pe(n+' incompatible with "this" of type '+e.constructor.name),e.A.ga||pe("cannot call emscripten binding method "+n+" on deleted object"),Re(e.A.ga,e.A.ia.ha,t.ha)}var qe=[],Xe=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Je(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=qe.length?qe.pop():Xe.length;return Xe[t]={Sa:1,value:e},t}}function Ke(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Qe(e,t){switch(t){case 2:return function(e){return this.fromWireType(I[e>>2])};case 3:return function(e){return this.fromWireType(T[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function et(e,t,n){switch(t){case 0:return n?function(e){return L[e]}:function(e){return S[e]};case 1:return n?function(e){return k[e>>1]}:function(e){return x[e>>1]};case 2:return n?function(e){return A[e>>2]}:function(e){return E[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var tt={};function nt(){if(!rt){var e,t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(e in tt)t[e]=tt[e];var n=[];for(e in t)n.push(e+"="+t[e]);rt=n}return rt}var rt,it=[null,[],[]],ot={};function at(e){return 0==e%4&&(0!=e%100||0==e%400)}function st(e,t){for(var n=0,r=0;r<=t;n+=e[r++]);return n}var lt=[31,29,31,30,31,30,31,31,30,31,30,31],ut=[31,28,31,30,31,30,31,31,30,31,30,31];function ct(e,t){for(e=new Date(e.getTime());0r-e.getDate())){e.setDate(e.getDate()+t);break}t-=r-e.getDate()+1,e.setDate(1),11>n?e.setMonth(n+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1))}return e}function ft(e,t,n,r){function i(e,t,n){for(e="number"==typeof e?e.toString():e||"";e.lengthe?-1:0=a(n,e)?0>=a(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var u=A[r+40>>2];for(var c in r={ab:A[r>>2],$a:A[r+4>>2],za:A[r+8>>2],va:A[r+12>>2],ta:A[r+16>>2],ja:A[r+20>>2],Aa:A[r+24>>2],Ba:A[r+28>>2],hb:A[r+32>>2],Za:A[r+36>>2],bb:u&&u?_(S,u,void 0):""},n=n?_(S,n,void 0):"",u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(c,"g"),u[c]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(c in u={"%a":function(e){return f[e.Aa].substring(0,3)},"%A":function(e){return f[e.Aa]},"%b":function(e){return h[e.ta].substring(0,3)},"%B":function(e){return h[e.ta]},"%C":function(e){return o((e.ja+1900)/100|0,2)},"%d":function(e){return o(e.va,2)},"%e":function(e){return i(e.va,2," ")},"%g":function(e){return l(e).toString().substring(2)},"%G":function(e){return l(e)},"%H":function(e){return o(e.za,2)},"%I":function(e){return 0==(e=e.za)?e=12:12e.za?"AM":"PM"},"%S":function(e){return o(e.ab,2)},"%t":function(){return"\t"},"%u":function(e){return e.Aa||7},"%U":function(e){var t=new Date(e.ja+1900,0,1),n=0===t.getDay()?t:ct(t,7-t.getDay());return 0>a(n,e=new Date(e.ja+1900,e.ta,e.va))?o(Math.ceil((31-n.getDate()+(st(at(e.getFullYear())?lt:ut,e.getMonth()-1)-31)+e.getDate())/7),2):0===a(n,t)?"01":"00"},"%V":function(e){var t=new Date(e.ja+1901,0,4),n=s(new Date(e.ja+1900,0,4));t=s(t);var r=ct(new Date(e.ja+1900,0,1),e.Ba);return 0>a(r,n)?"53":0>=a(t,r)?"01":o(Math.ceil((n.getFullYear()a(n,e=new Date(e.ja+1900,e.ta,e.va))?o(Math.ceil((31-n.getDate()+(st(at(e.getFullYear())?lt:ut,e.getMonth()-1)-31)+e.getDate())/7),2):0===a(n,t)?"01":"00"},"%y":function(e){return(e.ja+1900).toString().substring(2)},"%Y":function(e){return e.ja+1900},"%z":function(e){var t=0<=(e=e.Za);return e=Math.abs(e)/60,(t?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":function(e){return e.bb},"%%":function(){return"%"}})0<=n.indexOf(c)&&(n=n.replace(new RegExp(c,"g"),u[c](r)));return(c=function(e){var t=Array(w(e)+1);return b(e,t,0,t.length),t}(n)).length>t?0:(L.set(c,e),c.length-1)}var ht=[];function dt(e){var t,n={};for(t in e)!function(t){var r=e[t];n[t]="function"==typeof r?function(){ht.push(t);try{return r.apply(null,arguments)}finally{if(m)return;var e=ht.pop();v(e===t)}}:r}(t);return n}for(var pt=Array(256),gt=0;256>gt;++gt)pt[gt]=String.fromCharCode(gt);oe=pt,de=n.BindingError=he("BindingError"),ge=n.InternalError=he("InternalError"),Ee.prototype.isAliasOf=function(e){if(!(this instanceof Ee&&e instanceof Ee))return!1;var t=this.A.ia.ha,n=this.A.ga,r=e.A.ia.ha;for(e=e.A.ga;t.ma;)n=t.wa(n),t=t.ma;for(;r.ma;)e=r.wa(e),r=r.ma;return t===r&&n===e},Ee.prototype.clone=function(){if(this.A.ga||be(this),this.A.ua)return this.A.count.value+=1,this;var e=Se(Object.create(Object.getPrototypeOf(this),{A:{value:_e(this.A)}}));return e.A.count.value+=1,e.A.sa=!1,e},Ee.prototype.delete=function(){this.A.ga||be(this),this.A.sa&&!this.A.ua&&pe("Object already scheduled for deletion"),Ce(this),Le(this.A),this.A.ua||(this.A.ka=void 0,this.A.ga=void 0)},Ee.prototype.isDeleted=function(){return!this.A.ga},Ee.prototype.deleteLater=function(){return this.A.ga||be(this),this.A.sa&&!this.A.ua&&pe("Object already scheduled for deletion"),xe.push(this),1===xe.length&&ke&&ke(Ae),this.A.sa=!0,this},je.prototype.Ma=function(e){return this.Fa&&(e=this.Fa(e)),e},je.prototype.Ea=function(e){this.ra&&this.ra(e)},je.prototype.argPackAdvance=8,je.prototype.readValueFromPointer=Pe,je.prototype.deleteObject=function(e){null!==e&&e.delete()},je.prototype.fromWireType=function(e){function t(){return this.ya?Ne(this.ha.qa,{ia:this.Pa,ga:n,la:this,ka:e}):Ne(this.ha.qa,{ia:this,ga:e})}var n=this.Ma(e);if(!n)return this.Ea(e),null;var r=function(e,t){for(void 0===t&&pe("ptr should not be undefined");e.ma;)t=e.wa(t),e=e.ma;return Fe[t]}(this.ha,n);if(void 0!==r)return 0===r.A.count.value?(r.A.ga=n,r.A.ka=e,r.clone()):(r=r.clone(),this.Ea(e),r);if(r=this.ha.La(n),!(r=Ie[r]))return t.call(this);r=this.xa?r.Ia:r.pointerType;var i=He(n,this.ha,r.ha);return null===i?t.call(this):this.ya?Ne(r.ha.qa,{ia:r,ga:i,la:this,ka:e}):Ne(r.ha.qa,{ia:r,ga:i})},n.getInheritedInstanceCount=function(){return Object.keys(Fe).length},n.getLiveInheritedInstances=function(){var e,t=[];for(e in Fe)Fe.hasOwnProperty(e)&&t.push(Fe[e]);return t},n.flushPendingDeletes=Ae,n.setDelayFunction=function(e){ke=e,xe.length&&ke&&ke(Ae)},Be=n.UnboundTypeError=he("UnboundTypeError"),n.count_emval_handles=function(){for(var e=0,t=5;t>o])},oa:null})},g:function(e,t,n,r,i,o,a,s,l,u,c,f,h){c=ae(c),o=ze(i,o),s&&(s=ze(a,s)),u&&(u=ze(l,u)),h=ze(f,h);var d=ce(c);Te(d,(function(){Ue("Cannot construct "+c+" due to unbound types",[r])})),ve([e,t,n],r?[r]:[],(function(t){if(t=t[0],r)var n=t.ha,i=n.qa;else i=Ee.prototype;t=fe(d,(function(){if(Object.getPrototypeOf(this)!==a)throw new de("Use 'new' to construct "+c);if(void 0===l.pa)throw new de(c+" has no accessible constructor");var e=l.pa[arguments.length];if(void 0===e)throw new de("Tried to invoke ctor of "+c+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(l.pa).toString()+") parameters instead!");return e.apply(this,arguments)}));var a=Object.create(i,{constructor:{value:t}});t.prototype=a;var l=new Oe(c,t,a,h,n,o,s,u);n=new je(c,l,!0,!1),i=new je(c+"*",l,!1,!1);var f=new je(c+" const*",l,!1,!0);return Ie[e]={pointerType:i,Ia:f},We(d,t),[n,i,f]}))},f:function(e,t,n,r,i,o){v(0l&&pe("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=null!==n[1]&&!1,c=!1,f=1;f>>s}}var l=-1!=t.indexOf("unsigned");ye(e,{name:t,fromWireType:o,toWireType:function(e,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+Ke(n)+'" to '+this.name);if(ni)throw new TypeError('Passing a number "'+Ke(n)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+r+", "+i+"]!");return l?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:et(t,a,0!==r),oa:null})},c:function(e,t,n){function r(e){var t=E;return new i(C,t[1+(e>>=2)],t[e])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];ye(e,{name:n=ae(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{Na:!0})},i:function(e,t){var n="std::string"===(t=ae(t));ye(e,{name:t,fromWireType:function(e){var t=E[e>>2];if(n)for(var r=e+4,i=0;i<=t;++i){var o=e+4+i;if(i==t||0==S[o]){if(r=r?_(S,r,o-r):"",void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=o+1}}else{for(a=Array(t),i=0;i>2]=i,n&&r)b(t,S,o+4,i+1);else if(r)for(r=0;r>2],o=a(),l=e+4,u=0;u<=i;++u){var c=e+4+u*t;u!=i&&0!=o[c>>s]||(l=r(l,c-l),void 0===n?n=l:(n+=String.fromCharCode(0),n+=l),l=c+t)}return bt(e),n},toWireType:function(e,r){"string"!=typeof r&&pe("Cannot pass non-string to C++ string type "+n);var a=o(r),l=_t(4+a+t);return E[l>>2]=a>>s,i(r,l+4,a+t),null!==e&&e.push(bt,l),l},argPackAdvance:8,readValueFromPointer:Pe,oa:function(e){bt(e)}})},p:function(e,t){ye(e,{fb:!0,name:t=ae(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},n:function(){Y()},s:function(e,t,n){S.copyWithin(e,t,t+n)},t:function(e){e>>>=0;var t=S.length;if(2147483648=n;n*=2){var r=t*(1+.2/n);r=Math.min(r,e+100663296),0<(r=Math.max(16777216,e,r))%65536&&(r+=65536-r%65536);e:{try{g.grow(Math.min(2147483648,r)-C.byteLength+65535>>>16),F(g.buffer);var i=1;break e}catch(e){}i=void 0}if(i)return!0}return!1},v:function(e,t){var n=0;return nt().forEach((function(r,i){var o=t+n;for(i=A[e+4*i>>2]=o,o=0;o>0]=r.charCodeAt(o);L[i>>0]=0,n+=r.length+1})),0},w:function(e,t){var n=nt();A[e>>2]=n.length;var r=0;return n.forEach((function(e){r+=e.length+1})),A[t>>2]=r,0},y:function(){return 0},x:function(e,t,n,r){return e=ot.eb(e),t=ot.cb(e,t,n),A[r>>2]=t,0},q:function(){},k:function(e,t,n,r){for(var i=0,o=0;o>2],s=A[t+(8*o+4)>>2],l=0;l>2]=i,0},a:g,r:function(){},u:function(e,t,n,r){return ft(e,t,n,r)}};!function(){function e(e){e=dt(e=e.exports),n.asm=e,U--,n.monitorRunDependencies&&n.monitorRunDependencies(U),0==U&&(null!==Z&&(clearInterval(Z),Z=null),G&&(e=G,G=null,e()))}function t(t){e(t.instance)}function r(e){return(h||!s&&!l||"function"!=typeof fetch||q("file://")?Promise.resolve().then(Q):fetch(J,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+J+"'";return e.arrayBuffer()})).catch((function(){return Q()}))).then((function(e){return WebAssembly.instantiate(e,i)})).then(e,(function(e){p("failed to asynchronously prepare wasm: "+e),Y(e)}))}var i={a:mt};if(U++,n.monitorRunDependencies&&n.monitorRunDependencies(U),n.instantiateWasm)try{var o=n.instantiateWasm(i,e);return dt(o)}catch(e){return p("Module.instantiateWasm callback failed with error: "+e),!1}!function(){if(h||"function"!=typeof WebAssembly.instantiateStreaming||X()||q("file://")||"function"!=typeof fetch)return r(t);fetch(J,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,i).then(t,(function(e){return p("wasm streaming compile failed: "+e),p("falling back to ArrayBuffer instantiation"),r(t)}))}))}()}();var vt,yt=n.___wasm_call_ctors=function(){return(yt=n.___wasm_call_ctors=n.asm.B).apply(null,arguments)},_t=n._malloc=function(){return(_t=n._malloc=n.asm.C).apply(null,arguments)},bt=n._free=function(){return(bt=n._free=n.asm.D).apply(null,arguments)},wt=n.___getTypeName=function(){return(wt=n.___getTypeName=n.asm.E).apply(null,arguments)};function Ct(){function e(){if(!vt&&(vt=!0,n.calledRun=!0,!m)){if(ee(W),ee(z),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;){var e=n.postRun.shift();B.unshift(e)}ee(B)}}if(!(0{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);n(687)})();
\ No newline at end of file
diff --git a/jquery-components-integration/lib/main-face.js b/jquery-components-integration/lib/main-face.js
deleted file mode 100644
index 673d58a..0000000
--- a/jquery-components-integration/lib/main-face.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/*! For license information please see index.js.LICENSE.txt */
-(()=>{var e={316:(e,t,n)=>{"use strict";var r,i,o,a,s,l={},c=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function f(e,t){for(var n in t)e[n]=t[n];return e}function h(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n){var r,i,o,a=arguments,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>3)for(n=[n],o=3;o0?p(y.type,y.props,y.key,null,y.__v):y)){if(y.__=n,y.__b=n.__b+1,null===(g=S[h])||g&&y.key==g.key&&y.type===g.type)S[h]=void 0;else for(d=0;d3)for(n=[n],o=3;o=0||(i[n]=e[n]);return i}(e,["context","children"]);return j(t,n)}function H(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=d(W,L({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],i={},o=0,a=t.attributes,s=t.childNodes;for(o=a.length;o--;)"slot"!==a[o].name&&(i[a[o].name]=a[o].value,i[$(a[o].name)]=a[o].value);for(o=s.length;o--;){var l=e(s[o],null),c=s[o].slot;c?i[c]=d(Y,{name:c},l):r[o]=l}var u=n?d(Y,null,r):r;return d(n||t.nodeName.toLowerCase(),i,u)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?F:D)(this._vdom,this._root)}function $(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function U(e,t,n){if(this._vdom){var r={};r[e]=n=null==n?void 0:n,r[$(e)]=n,this._vdom=j(this._vdom,r),D(this._vdom,this._root)}}function B(){D(this._vdom=null,this._root)}function Y(e,t){var n=this;return d("slot",L({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}r={__e:function(e,t){for(var n,r,i;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),i=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),i=n.__d),i)return n.__E=n}catch(t){e=t}throw e},__v:0},g.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=f({},this.state),"function"==typeof e&&(e=e(f({},n),this.props)),e&&f(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),_(this))},g.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_(this))},g.prototype.render=m,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,b.__r=0,s=0;var V,G,q,Z=n(570),X=0,J=[],K=r.__b,Q=r.__r,ee=r.diffed,te=r.__c,ne=r.unmount;function re(e,t){r.__h&&r.__h(G,e,X||t),X=0;var n=G.__H||(G.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ie(e){return X=1,oe(ge,e)}function oe(e,t,n){var r=re(V++,2);return r.t=e,r.__c||(r.__=[n?n(t):ge(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=G),r.__}function ae(e,t){var n=re(V++,3);!r.__s&&me(n.__H,t)&&(n.__=e,n.__H=t,G.__H.__h.push(n))}function se(e,t){var n=re(V++,4);!r.__s&&me(n.__H,t)&&(n.__=e,n.__H=t,G.__h.push(n))}function le(e){return X=5,ce((function(){return{current:e}}),[])}function ce(e,t){var n=re(V++,7);return me(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ue(e){var t=G.context[e.__c],n=re(V++,9);return n.__c=e,t?(null==n.__&&(n.__=!0,t.sub(G)),t.props.value):e.__}function fe(){J.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(de),e.__H.__h.forEach(pe),e.__H.__h=[]}catch(t){e.__H.__h=[],r.__e(t,e.__v)}})),J=[]}r.__b=function(e){G=null,K&&K(e)},r.__r=function(e){Q&&Q(e),V=0;var t=(G=e.__c).__H;t&&(t.__h.forEach(de),t.__h.forEach(pe),t.__h=[])},r.diffed=function(e){ee&&ee(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==J.push(t)&&q===r.requestAnimationFrame||((q=r.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),he&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);he&&(t=requestAnimationFrame(n))})(fe)),G=void 0},r.__c=function(e,t){t.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||pe(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],r.__e(n,e.__v)}})),te&&te(e,t)},r.unmount=function(e){ne&&ne(e);var t=e.__c;if(t&&t.__H)try{t.__H.__.forEach(de)}catch(e){r.__e(e,t.__v)}};var he="function"==typeof requestAnimationFrame;function de(e){var t=G;"function"==typeof e.__c&&e.__c(),G=t}function pe(e){var t=G;e.__c=e.__(),G=t}function me(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function ge(e,t){return"function"==typeof t?t(e):t}function ve(e,t){for(var n in t)e[n]=t[n];return e}function ye(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function _e(e){this.props=e}(_e.prototype=new g).isPureReactComponent=!0,_e.prototype.shouldComponentUpdate=function(e,t){return ye(this.props,e)||ye(this.state,t)};var be=r.__b;r.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),be&&be(e)};var we="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ce=function(e,t){return null==e?null:S(S(e).map(t))},Se={map:Ce,forEach:Ce,count:function(e){return e?S(e).length:0},only:function(e){var t=S(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:S},ke=r.__e;r.__e=function(e,t,n){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);ke(e,t,n)};var xe=r.unmount;function Ae(){this.__u=0,this.t=null,this.__b=null}function ze(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function Ie(){this.u=null,this.o=null}r.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),xe&&xe(e)},(Ae.prototype=new g).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var i=ze(r.__v),o=!1,a=function(){o||(o=!0,n.__R=null,i?i(s):s())};n.__R=a;var s=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(a,a)},Ae.prototype.componentWillUnmount=function(){this.t=[]},Ae.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=ve({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__e&&d(m,null,e.fallback);return i&&(i.__h=null),[d(m,null,t.__e?null:e.children),i]};var Ee=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.i.removeChild(e)}}),D(d(Te,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}(Ie.prototype=new g).__e=function(e){var t=this,n=ze(t.__v),r=t.o.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Ee(t,e,r)):i()};n?n(o):o()}},Ie.prototype.render=function(e){this.u=null,this.o=new Map;var t=S(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Ie.prototype.componentDidUpdate=Ie.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ee(e,n,t)}))};var Pe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Re=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Me=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};g.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(g.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var De=r.event;function Fe(){}function je(){return this.cancelBubble}function Ne(){return this.defaultPrevented}r.event=function(e){return De&&(e=De(e)),e.persist=Fe,e.isPropagationStopped=je,e.isDefaultPrevented=Ne,e.nativeEvent=e};var Le,We={configurable:!0,get:function(){return this.class}},He=r.vnode;r.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){for(var i in r={},n){var o=n[i];"value"===i&&"defaultValue"in n&&null==o||("defaultValue"===i&&"value"in n&&null==n.value?i="value":"download"===i&&!0===o?o="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!Me(n.type)?i="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(i)?i=i.toLowerCase():Re.test(i)?i=i.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===o&&(o=void 0),r[i]=o)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=S(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=S(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r}t&&n.class!=n.className&&(We.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",We)),e.$$typeof=Pe,He&&He(e)};var $e=r.__r;r.__r=function(e){$e&&$e(e),Le=e.__c};var Ue={ReactCurrentDispatcher:{current:{readContext:function(e){return Le.__n[e.__c].props.value}}}};"object"==typeof performance&&"function"==typeof performance.now&&performance.now.bind(performance);function Be(e){return!!e&&e.$$typeof===Pe}const Ye={useState:ie,useReducer:oe,useEffect:ae,useLayoutEffect:se,useRef:le,useImperativeHandle:function(e,t,n){X=6,se((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))},useMemo:ce,useCallback:function(e,t){return X=8,ce((function(){return e}),t)},useContext:ue,useDebugValue:function(e,t){r.useDebugValue&&r.useDebugValue(t?t(e):e)},version:"16.8.0",Children:Se,render:function(e,t,n){return null==t.__k&&(t.textContent=""),D(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return F(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(D(null,e),!0)},createPortal:function(e,t){return d(Oe,{__v:e,i:t})},createElement:d,createContext:N,createFactory:function(e){return d.bind(null,e)},cloneElement:function(e){return Be(e)?j.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:m,isValidElement:Be,findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:g,PureComponent:_e,memo:function(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:ye(this.props,e)}function r(t){return this.shouldComponentUpdate=n,d(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r},forwardRef:function(e){function t(t,n){var r=ve({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=we,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:m,Suspense:Ae,SuspenseList:Ie,lazy:function(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return d(n,i)}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ue};var Ve=n(665),Ge=n.n(Ve);const qe=function(e){function t(e,r,l,c,h){for(var d,p,m,g,b,C=0,S=0,k=0,x=0,A=0,P=0,M=m=d=0,F=0,j=0,N=0,L=0,W=l.length,H=W-1,$="",U="",B="",Y="";Fd)&&(L=($=$.replace(" ",":")).length),0